]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This commit was manufactured by cvs2svn to create tag 'drow_intercu- drow_intercu-merge-20040915
authornobody <>
Mon, 18 Oct 2004 08:06:33 +0000 (08:06 +0000)
committernobody <>
Mon, 18 Oct 2004 08:06:33 +0000 (08:06 +0000)
merge-20040915'.

Sprout from gdb_6_3-branch 2004-10-18 08:06:32 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'gdb_6_3-branch'.'
Cherrypick from master 2004-09-15 00:00:05 UTC Alan Modra <amodra@gmail.com> 'daily update':
    ChangeLog
    Makefile.in
    Makefile.tpl
    bfd/ChangeLog
    bfd/Makefile.am
    bfd/Makefile.in
    bfd/aclocal.m4
    bfd/aout-target.h
    bfd/aout-tic30.c
    bfd/bfd-in.h
    bfd/bfd-in2.h
    bfd/bfd.c
    bfd/binary.c
    bfd/coff-rs6000.c
    bfd/coff64-rs6000.c
    bfd/coffcode.h
    bfd/config.bfd
    bfd/configure
    bfd/configure.in
    bfd/cpu-i386.c
    bfd/doc/ChangeLog
    bfd/doc/Makefile.am
    bfd/doc/Makefile.in
    bfd/dwarf2.c
    bfd/ecoff.c
    bfd/elf-bfd.h
    bfd/elf-eh-frame.c
    bfd/elf-hppa.h
    bfd/elf-m10300.c
    bfd/elf.c
    bfd/elf32-arm.h
    bfd/elf32-cris.c
    bfd/elf32-frv.c
    bfd/elf32-hppa.c
    bfd/elf32-i370.c
    bfd/elf32-i386.c
    bfd/elf32-m32r.c
    bfd/elf32-m68k.c
    bfd/elf32-ppc.c
    bfd/elf32-s390.c
    bfd/elf32-sh-symbian.c
    bfd/elf32-sh.c
    bfd/elf32-sh64.c
    bfd/elf32-sparc.c
    bfd/elf32-vax.c
    bfd/elf32-xstormy16.c
    bfd/elf32-xtensa.c
    bfd/elf64-alpha.c
    bfd/elf64-hppa.c
    bfd/elf64-mips.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/elflink.c
    bfd/elfxx-ia64.c
    bfd/elfxx-mips.c
    bfd/elfxx-target.h
    bfd/hash.c
    bfd/i386msdos.c
    bfd/ieee.c
    bfd/ihex.c
    bfd/libaout.h
    bfd/libbfd-in.h
    bfd/libbfd.h
    bfd/libecoff.h
    bfd/linker.c
    bfd/mach-o.c
    bfd/mmo.c
    bfd/nlm-target.h
    bfd/oasys.c
    bfd/opncls.c
    bfd/pe-i386.c
    bfd/pef.c
    bfd/pei-i386.c
    bfd/po/SRC-POTFILES.in
    bfd/po/bfd.pot
    bfd/ppcboot.c
    bfd/reloc.c
    bfd/simple.c
    bfd/som.c
    bfd/srec.c
    bfd/syms.c
    bfd/targets.c
    bfd/tekhex.c
    bfd/versados.c
    bfd/version.h
    bfd/vms.c
    bfd/xcoff-target.h
    bfd/xcofflink.c
    bfd/xsym.c
    bfd/xtensa-isa.c
    bfd/xtensa-modules.c
    config.guess
    config/ChangeLog
    config/gettext.m4
    configure
    configure.in
    gdb/ChangeLog
    gdb/MAINTAINERS
    gdb/Makefile.in
    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/alphanbsd-tdep.c
    gdb/amd64-nat.h
    gdb/amd64bsd-nat.c
    gdb/amd64fbsd-nat.c
    gdb/amd64nbsd-nat.c
    gdb/amd64obsd-nat.c
    gdb/breakpoint.c
    gdb/bsd-kvm.c
    gdb/config.in
    gdb/config/alpha/alpha-linux.mh
    gdb/config/arm/linux.mh
    gdb/config/djgpp/fnchange.lst
    gdb/config/frv/tm-frv.h
    gdb/config/i386/fbsd.mh
    gdb/config/i386/fbsd64.mh
    gdb/config/i386/linux.mh
    gdb/config/i386/linux64.mh
    gdb/config/i386/nbsd64.mh
    gdb/config/i386/nbsdaout.mh
    gdb/config/i386/nbsdelf.mh
    gdb/config/i386/nm-fbsd.h
    gdb/config/i386/nm-fbsd64.h
    gdb/config/i386/nm-i386.h
    gdb/config/i386/nm-linux.h
    gdb/config/i386/nm-nbsdaout.h
    gdb/config/i386/nm-obsd.h
    gdb/config/i386/obsd.mh
    gdb/config/i386/obsd64.mh
    gdb/config/i386/obsdaout.mh
    gdb/config/ia64/linux.mh
    gdb/config/ia64/nm-linux.h
    gdb/config/m68k/linux.mh
    gdb/config/m88k/obsd.mh
    gdb/config/mips/linux.mh
    gdb/config/nm-linux.h
    gdb/config/nm-lynx.h
    gdb/config/pa/hpux1020.mh
    gdb/config/pa/hpux11.mh
    gdb/config/pa/hpux11w.mh
    gdb/config/pa/linux.mh
    gdb/config/powerpc/linux.mh
    gdb/config/powerpc/nbsd.mh
    gdb/config/powerpc/ppc64-linux.mh
    gdb/config/s390/s390.mh
    gdb/config/sparc/fbsd.mh
    gdb/config/sparc/linux.mh
    gdb/config/sparc/linux64.mh
    gdb/config/sparc/nbsd64.mh
    gdb/config/sparc/nbsd64.mt
    gdb/config/sparc/nbsdaout.mh
    gdb/config/sparc/nbsdelf.mh
    gdb/config/sparc/obsd.mt
    gdb/config/sparc/obsd64.mt
    gdb/config/vax/nbsdaout.mh
    gdb/config/vax/nbsdelf.mh
    gdb/config/vax/obsd.mh
    gdb/configure
    gdb/configure.in
    gdb/configure.tgt
    gdb/corelow.c
    gdb/cris-tdep.c
    gdb/defs.h
    gdb/doc/ChangeLog
    gdb/doc/gdb.texinfo
    gdb/doc/gdbint.texinfo
    gdb/doc/stabs.texinfo
    gdb/dwarf2read.c
    gdb/event-top.c
    gdb/exec.c
    gdb/fbsd-proc.c
    gdb/fork-child.c
    gdb/frv-tdep.c
    gdb/gdb_indent.sh
    gdb/gdb_thread_db.h
    gdb/gdbcmd.h
    gdb/gdbserver/ChangeLog
    gdb/gdbserver/Makefile.in
    gdb/gdbserver/configure
    gdb/gdbserver/configure.in
    gdb/gdbserver/linux-i386-low.c
    gdb/gdbserver/linux-low.c
    gdb/gdbserver/linux-x86-64-low.c
    gdb/gdbserver/proc-service.c
    gdb/gdbserver/remote-utils.c
    gdb/gdbserver/thread-db.c
    gdb/gdbtypes.h
    gdb/gnu-nat.c
    gdb/go32-nat.c
    gdb/hppa-tdep.c
    gdb/hppah-nat.c
    gdb/hpux-thread.c
    gdb/i386-nat.c
    gdb/i386-tdep.c
    gdb/i386bsd-nat.c
    gdb/i386fbsd-nat.c
    gdb/i386gnu-nat.c
    gdb/i386nbsd-nat.c
    gdb/ia64-linux-nat.c
    gdb/inf-child.c
    gdb/inf-ptrace.c
    gdb/infcall.c
    gdb/infptrace.c
    gdb/infrun.c
    gdb/inftarg.c
    gdb/infttrace.c
    gdb/jv-exp.y
    gdb/language.c
    gdb/lin-lwp.c
    gdb/linux-nat.c
    gdb/linux-proc.c
    gdb/m32r-tdep.c
    gdb/m88kbsd-nat.c
    gdb/maint.c
    gdb/minsyms.c
    gdb/mips-tdep.c
    gdb/monitor.c
    gdb/nto-procfs.c
    gdb/objfiles.c
    gdb/ppc-bdm.c
    gdb/procfs.c
    gdb/regcache.c
    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.c
    gdb/rs6000-nat.c
    gdb/rs6000-tdep.c
    gdb/sh-tdep.c
    gdb/sh-tdep.h
    gdb/sol-thread.c
    gdb/solib-sunos.c
    gdb/source.c
    gdb/sparc-linux-tdep.c
    gdb/sparc-nat.c
    gdb/sparc-nat.h
    gdb/sparc64-linux-tdep.c
    gdb/sparc64nbsd-nat.c
    gdb/sparc64nbsd-tdep.c
    gdb/sparc64obsd-tdep.c
    gdb/sparcnbsd-nat.c
    gdb/symfile.c
    gdb/symtab.c
    gdb/target.c
    gdb/target.h
    gdb/testsuite/ChangeLog
    gdb/testsuite/Makefile.in
    gdb/testsuite/config/gdbserver.exp
    gdb/testsuite/configure
    gdb/testsuite/configure.in
    gdb/testsuite/gdb.asm/asm-source.exp
    gdb/testsuite/gdb.base/bigcore.c
    gdb/testsuite/gdb.base/bigcore.exp
    gdb/testsuite/gdb.base/constvars.exp
    gdb/testsuite/gdb.base/overlays.exp
    gdb/testsuite/gdb.base/sigstep.exp
    gdb/testsuite/gdb.base/volatile.exp
    gdb/testsuite/gdb.mi/gdb701.c
    gdb/testsuite/gdb.threads/bp_in_thread.exp
    gdb/testsuite/gdb.threads/pthread_cond_wait.exp
    gdb/testsuite/gdb.threads/watchthreads.exp
    gdb/thread-db.c
    gdb/top.c
    gdb/tui/tui-wingeneral.c
    gdb/utils.c
    gdb/uw-thread.c
    gdb/v850ice.c
    gdb/valarith.c
    gdb/vaxbsd-nat.c
    gdb/version.in
    gdb/win32-nat.c
    gdb/wince.c
    gdb/xstormy16-tdep.c
    include/ChangeLog
    include/bfdlink.h
    include/elf/ChangeLog
    include/elf/arm.h
    include/elf/common.h
    include/elf/dwarf2.h
    include/elf/x86-64.h
    include/elf/xtensa.h
    include/opcode/ChangeLog
    include/opcode/arm.h
    include/opcode/crx.h
    include/xtensa-config.h
    include/xtensa-isa-internal.h
    include/xtensa-isa.h
    install-sh
    intl/ChangeLog
    intl/Makefile.in
    intl/acconfig.h
    intl/aclocal.m4
    intl/bindtextdom.c
    intl/cat-compat.c
    intl/config.in
    intl/configure
    intl/configure.in
    intl/dcgettext.c
    intl/dgettext.c
    intl/explodename.c
    intl/finddomain.c
    intl/gettext.c
    intl/gettext.h
    intl/gettextP.h
    intl/hash-string.h
    intl/intl-compat.c
    intl/intlh.inst.in
    intl/l10nflist.c
    intl/libgettext.h
    intl/libintl.glibc
    intl/linux-msg.sed
    intl/loadinfo.h
    intl/loadmsgcat.c
    intl/localealias.c
    intl/po2tbl.sed.in
    intl/textdomain.c
    intl/xopen-msg.sed
    ltcf-c.sh
    ltcf-cxx.sh
    ltconfig
    mmalloc/COPYING.LIB
    mmalloc/ChangeLog
    mmalloc/MAINTAINERS
    mmalloc/Makefile.in
    mmalloc/TODO
    mmalloc/acinclude.m4
    mmalloc/aclocal.m4
    mmalloc/attach.c
    mmalloc/configure
    mmalloc/configure.in
    mmalloc/detach.c
    mmalloc/keys.c
    mmalloc/mcalloc.c
    mmalloc/mfree.c
    mmalloc/mm.c
    mmalloc/mmalloc.c
    mmalloc/mmalloc.h
    mmalloc/mmalloc.texi
    mmalloc/mmap-sup.c
    mmalloc/mmcheck.c
    mmalloc/mmemalign.c
    mmalloc/mmprivate.h
    mmalloc/mmstats.c
    mmalloc/mmtrace.awk
    mmalloc/mmtrace.c
    mmalloc/mrealloc.c
    mmalloc/mvalloc.c
    mmalloc/sbrk-sup.c
    opcodes/ChangeLog
    opcodes/Makefile.am
    opcodes/Makefile.in
    opcodes/aclocal.m4
    opcodes/arm-dis.c
    opcodes/arm-opc.h
    opcodes/configure
    opcodes/crx-dis.c
    opcodes/crx-opc.c
    opcodes/pdp11-dis.c
    opcodes/po/POTFILES.in
    opcodes/po/opcodes.pot
    opcodes/ppc-opc.c
    opcodes/xtensa-dis.c
    sim/common/ChangeLog
    sim/common/cgen-defs.h
    sim/mips/ChangeLog
    sim/mips/m16.igen
    sim/ppc/ChangeLog
    sim/ppc/config.in
    sim/ppc/configure
    sim/ppc/configure.in
    sim/ppc/emul_netbsd.c
Cherrypick from cygnus 1999-05-03 07:29:11 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import':
    ylwrap
Delete:
    config/codeset.m4
    config/gcc-lib-path.m4
    config/gettext-sister.m4
    config/glibc21.m4
    config/iconv.m4
    config/intdiv0.m4
    config/inttypes-pri.m4
    config/inttypes.m4
    config/inttypes_h.m4
    config/lcmessage.m4
    config/lib-ld.m4
    config/lib-link.m4
    config/lib-prefix.m4
    config/mh-x86omitfp
    config/nls.m4
    config/po.m4
    config/stdint_h.m4
    config/uintmax_t.m4
    config/ulonglong.m4
    config/warnings.m4
    gdb/config/m32r/linux.mh
    gdb/config/m32r/linux.mt
    gdb/config/m32r/nm-linux.h
    gdb/fbsd-nat.c
    gdb/fbsd-nat.h
    gdb/i386bsd-nat.h
    gdb/m32r-linux-nat.c
    gdb/m32r-linux-tdep.c
    gdb/m32r-tdep.h
    gdb/testsuite/gdb.asm/m32r-linux.inc
    gdb/testsuite/gdb.dwarf2/Makefile.in
    gdb/testsuite/gdb.dwarf2/dw2-basic.S
    gdb/testsuite/gdb.dwarf2/dw2-basic.exp
    gdb/testsuite/gdb.dwarf2/dw2-intercu.S
    gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
    gdb/testsuite/gdb.dwarf2/file1.txt
    gdb/testsuite/gdb.dwarf2/main.c
    gdb/testsuite/gdb.java/jprint.exp
    gdb/testsuite/gdb.java/jprint.java
    gdb/testsuite/gdb.threads/watchthreads.c

423 files changed:
ChangeLog
Makefile.in
Makefile.tpl
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/aclocal.m4
bfd/aout-target.h
bfd/aout-tic30.c
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/bfd.c
bfd/binary.c
bfd/coff-rs6000.c
bfd/coff64-rs6000.c
bfd/coffcode.h
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/cpu-i386.c
bfd/doc/ChangeLog
bfd/doc/Makefile.am
bfd/doc/Makefile.in
bfd/dwarf2.c
bfd/ecoff.c
bfd/elf-bfd.h
bfd/elf-eh-frame.c
bfd/elf-hppa.h
bfd/elf-m10300.c
bfd/elf.c
bfd/elf32-arm.h
bfd/elf32-cris.c
bfd/elf32-frv.c
bfd/elf32-hppa.c
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh-symbian.c
bfd/elf32-sh.c
bfd/elf32-sh64.c
bfd/elf32-sparc.c
bfd/elf32-vax.c
bfd/elf32-xstormy16.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-mips.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/elflink.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-target.h
bfd/hash.c
bfd/i386msdos.c
bfd/ieee.c
bfd/ihex.c
bfd/libaout.h
bfd/libbfd-in.h
bfd/libbfd.h
bfd/libecoff.h
bfd/linker.c
bfd/mach-o.c
bfd/mmo.c
bfd/nlm-target.h
bfd/oasys.c
bfd/opncls.c
bfd/pe-i386.c
bfd/pef.c
bfd/pei-i386.c
bfd/po/SRC-POTFILES.in
bfd/po/bfd.pot
bfd/ppcboot.c
bfd/reloc.c
bfd/simple.c
bfd/som.c
bfd/srec.c
bfd/syms.c
bfd/targets.c
bfd/tekhex.c
bfd/versados.c
bfd/version.h
bfd/vms.c
bfd/xcoff-target.h
bfd/xcofflink.c
bfd/xsym.c
bfd/xtensa-isa.c
bfd/xtensa-modules.c
config.guess
config/ChangeLog
config/codeset.m4 [deleted file]
config/gcc-lib-path.m4 [deleted file]
config/gettext-sister.m4 [deleted file]
config/gettext.m4
config/glibc21.m4 [deleted file]
config/iconv.m4 [deleted file]
config/intdiv0.m4 [deleted file]
config/inttypes-pri.m4 [deleted file]
config/inttypes.m4 [deleted file]
config/inttypes_h.m4 [deleted file]
config/lcmessage.m4 [deleted file]
config/lib-ld.m4 [deleted file]
config/lib-link.m4 [deleted file]
config/lib-prefix.m4 [deleted file]
config/mh-x86omitfp [deleted file]
config/nls.m4 [deleted file]
config/po.m4 [deleted file]
config/stdint_h.m4 [deleted file]
config/uintmax_t.m4 [deleted file]
config/ulonglong.m4 [deleted file]
config/warnings.m4 [deleted file]
configure
configure.in
gdb/ChangeLog
gdb/MAINTAINERS
gdb/Makefile.in
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/alphanbsd-tdep.c
gdb/amd64-nat.h
gdb/amd64bsd-nat.c
gdb/amd64fbsd-nat.c
gdb/amd64nbsd-nat.c
gdb/amd64obsd-nat.c
gdb/breakpoint.c
gdb/bsd-kvm.c
gdb/config.in
gdb/config/alpha/alpha-linux.mh
gdb/config/arm/linux.mh
gdb/config/djgpp/fnchange.lst
gdb/config/frv/tm-frv.h
gdb/config/i386/fbsd.mh
gdb/config/i386/fbsd64.mh
gdb/config/i386/linux.mh
gdb/config/i386/linux64.mh
gdb/config/i386/nbsd64.mh
gdb/config/i386/nbsdaout.mh
gdb/config/i386/nbsdelf.mh
gdb/config/i386/nm-fbsd.h
gdb/config/i386/nm-fbsd64.h [moved from gdb/i386bsd-nat.h with 69% similarity]
gdb/config/i386/nm-i386.h
gdb/config/i386/nm-linux.h
gdb/config/i386/nm-nbsdaout.h [moved from gdb/config/m32r/nm-linux.h with 69% similarity]
gdb/config/i386/nm-obsd.h
gdb/config/i386/obsd.mh
gdb/config/i386/obsd64.mh
gdb/config/i386/obsdaout.mh
gdb/config/ia64/linux.mh
gdb/config/ia64/nm-linux.h
gdb/config/m32r/linux.mh [deleted file]
gdb/config/m32r/linux.mt [deleted file]
gdb/config/m68k/linux.mh
gdb/config/m88k/obsd.mh
gdb/config/mips/linux.mh
gdb/config/nm-linux.h
gdb/config/nm-lynx.h
gdb/config/pa/hpux1020.mh
gdb/config/pa/hpux11.mh
gdb/config/pa/hpux11w.mh
gdb/config/pa/linux.mh
gdb/config/powerpc/linux.mh
gdb/config/powerpc/nbsd.mh
gdb/config/powerpc/ppc64-linux.mh
gdb/config/s390/s390.mh
gdb/config/sparc/fbsd.mh
gdb/config/sparc/linux.mh
gdb/config/sparc/linux64.mh
gdb/config/sparc/nbsd64.mh
gdb/config/sparc/nbsd64.mt
gdb/config/sparc/nbsdaout.mh
gdb/config/sparc/nbsdelf.mh
gdb/config/sparc/obsd.mt
gdb/config/sparc/obsd64.mt
gdb/config/vax/nbsdaout.mh
gdb/config/vax/nbsdelf.mh
gdb/config/vax/obsd.mh
gdb/configure
gdb/configure.in
gdb/configure.tgt
gdb/corelow.c
gdb/cris-tdep.c
gdb/defs.h
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/doc/stabs.texinfo
gdb/dwarf2read.c
gdb/event-top.c
gdb/exec.c
gdb/fbsd-nat.h [deleted file]
gdb/fbsd-proc.c [moved from gdb/fbsd-nat.c with 86% similarity]
gdb/fork-child.c
gdb/frv-tdep.c
gdb/gdb_indent.sh
gdb/gdb_thread_db.h
gdb/gdbcmd.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/configure
gdb/gdbserver/configure.in
gdb/gdbserver/linux-i386-low.c
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-x86-64-low.c
gdb/gdbserver/proc-service.c
gdb/gdbserver/remote-utils.c
gdb/gdbserver/thread-db.c
gdb/gdbtypes.h
gdb/gnu-nat.c
gdb/go32-nat.c
gdb/hppa-tdep.c
gdb/hppah-nat.c
gdb/hpux-thread.c
gdb/i386-nat.c
gdb/i386-tdep.c
gdb/i386bsd-nat.c
gdb/i386fbsd-nat.c
gdb/i386gnu-nat.c
gdb/i386nbsd-nat.c
gdb/ia64-linux-nat.c
gdb/inf-child.c
gdb/inf-ptrace.c
gdb/infcall.c
gdb/infptrace.c
gdb/infrun.c
gdb/inftarg.c
gdb/infttrace.c
gdb/jv-exp.y
gdb/language.c
gdb/lin-lwp.c [new file with mode: 0644]
gdb/linux-nat.c
gdb/linux-proc.c [new file with mode: 0644]
gdb/m32r-linux-nat.c [deleted file]
gdb/m32r-linux-tdep.c [deleted file]
gdb/m32r-tdep.c
gdb/m32r-tdep.h [deleted file]
gdb/m88kbsd-nat.c
gdb/maint.c
gdb/minsyms.c
gdb/mips-tdep.c
gdb/monitor.c
gdb/nto-procfs.c
gdb/objfiles.c
gdb/ppc-bdm.c
gdb/procfs.c
gdb/regcache.c
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.c
gdb/rs6000-nat.c
gdb/rs6000-tdep.c
gdb/sh-tdep.c
gdb/sh-tdep.h
gdb/sol-thread.c
gdb/solib-sunos.c
gdb/source.c
gdb/sparc-linux-tdep.c
gdb/sparc-nat.c
gdb/sparc-nat.h
gdb/sparc64-linux-tdep.c
gdb/sparc64nbsd-nat.c
gdb/sparc64nbsd-tdep.c
gdb/sparc64obsd-tdep.c
gdb/sparcnbsd-nat.c
gdb/symfile.c
gdb/symtab.c
gdb/target.c
gdb/target.h
gdb/testsuite/ChangeLog
gdb/testsuite/Makefile.in
gdb/testsuite/config/gdbserver.exp
gdb/testsuite/configure
gdb/testsuite/configure.in
gdb/testsuite/gdb.asm/asm-source.exp
gdb/testsuite/gdb.asm/m32r-linux.inc [deleted file]
gdb/testsuite/gdb.base/bigcore.c
gdb/testsuite/gdb.base/bigcore.exp
gdb/testsuite/gdb.base/constvars.exp
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/sigstep.exp
gdb/testsuite/gdb.base/volatile.exp
gdb/testsuite/gdb.dwarf2/Makefile.in [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-basic.S [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-basic.exp [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-intercu.S [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-intercu.exp [deleted file]
gdb/testsuite/gdb.dwarf2/file1.txt [deleted file]
gdb/testsuite/gdb.dwarf2/main.c [deleted file]
gdb/testsuite/gdb.java/jprint.exp [deleted file]
gdb/testsuite/gdb.java/jprint.java [deleted file]
gdb/testsuite/gdb.mi/gdb701.c
gdb/testsuite/gdb.threads/bp_in_thread.exp
gdb/testsuite/gdb.threads/pthread_cond_wait.exp
gdb/testsuite/gdb.threads/watchthreads.c [deleted file]
gdb/testsuite/gdb.threads/watchthreads.exp
gdb/thread-db.c
gdb/top.c
gdb/tui/tui-wingeneral.c
gdb/utils.c
gdb/uw-thread.c
gdb/v850ice.c
gdb/valarith.c
gdb/vaxbsd-nat.c
gdb/version.in
gdb/win32-nat.c
gdb/wince.c
gdb/xstormy16-tdep.c
include/ChangeLog
include/bfdlink.h
include/elf/ChangeLog
include/elf/arm.h
include/elf/common.h
include/elf/dwarf2.h
include/elf/x86-64.h
include/elf/xtensa.h
include/opcode/ChangeLog
include/opcode/arm.h
include/opcode/crx.h
include/xtensa-config.h
include/xtensa-isa-internal.h
include/xtensa-isa.h
install-sh
intl/ChangeLog [new file with mode: 0644]
intl/Makefile.in [new file with mode: 0644]
intl/acconfig.h [new file with mode: 0644]
intl/aclocal.m4 [new file with mode: 0644]
intl/bindtextdom.c [new file with mode: 0644]
intl/cat-compat.c [new file with mode: 0644]
intl/config.in [new file with mode: 0644]
intl/configure [new file with mode: 0755]
intl/configure.in [new file with mode: 0644]
intl/dcgettext.c [new file with mode: 0644]
intl/dgettext.c [new file with mode: 0644]
intl/explodename.c [new file with mode: 0644]
intl/finddomain.c [new file with mode: 0644]
intl/gettext.c [new file with mode: 0644]
intl/gettext.h [new file with mode: 0644]
intl/gettextP.h [new file with mode: 0644]
intl/hash-string.h [new file with mode: 0644]
intl/intl-compat.c [new file with mode: 0644]
intl/intlh.inst.in [new file with mode: 0644]
intl/l10nflist.c [new file with mode: 0644]
intl/libgettext.h [new file with mode: 0644]
intl/libintl.glibc [new file with mode: 0644]
intl/linux-msg.sed [new file with mode: 0644]
intl/loadinfo.h [new file with mode: 0644]
intl/loadmsgcat.c [new file with mode: 0644]
intl/localealias.c [new file with mode: 0644]
intl/po2tbl.sed.in [new file with mode: 0644]
intl/textdomain.c [new file with mode: 0644]
intl/xopen-msg.sed [new file with mode: 0644]
ltcf-c.sh
ltcf-cxx.sh
ltconfig
mmalloc/COPYING.LIB [new file with mode: 0644]
mmalloc/ChangeLog [new file with mode: 0644]
mmalloc/MAINTAINERS [new file with mode: 0644]
mmalloc/Makefile.in [new file with mode: 0644]
mmalloc/TODO [new file with mode: 0644]
mmalloc/acinclude.m4 [new file with mode: 0644]
mmalloc/aclocal.m4 [new file with mode: 0644]
mmalloc/attach.c [new file with mode: 0644]
mmalloc/configure [new file with mode: 0755]
mmalloc/configure.in [new file with mode: 0644]
mmalloc/detach.c [new file with mode: 0644]
mmalloc/keys.c [new file with mode: 0644]
mmalloc/mcalloc.c [new file with mode: 0644]
mmalloc/mfree.c [new file with mode: 0644]
mmalloc/mm.c [new file with mode: 0644]
mmalloc/mmalloc.c [new file with mode: 0644]
mmalloc/mmalloc.h [new file with mode: 0644]
mmalloc/mmalloc.texi [new file with mode: 0644]
mmalloc/mmap-sup.c [new file with mode: 0644]
mmalloc/mmcheck.c [new file with mode: 0644]
mmalloc/mmemalign.c [new file with mode: 0644]
mmalloc/mmprivate.h [new file with mode: 0644]
mmalloc/mmstats.c [new file with mode: 0644]
mmalloc/mmtrace.awk [new file with mode: 0644]
mmalloc/mmtrace.c [new file with mode: 0644]
mmalloc/mrealloc.c [new file with mode: 0644]
mmalloc/mvalloc.c [new file with mode: 0644]
mmalloc/sbrk-sup.c [new file with mode: 0644]
opcodes/ChangeLog
opcodes/Makefile.am
opcodes/Makefile.in
opcodes/aclocal.m4
opcodes/arm-dis.c
opcodes/arm-opc.h
opcodes/configure
opcodes/crx-dis.c
opcodes/crx-opc.c
opcodes/pdp11-dis.c
opcodes/po/POTFILES.in
opcodes/po/opcodes.pot
opcodes/ppc-opc.c
opcodes/xtensa-dis.c
sim/common/ChangeLog
sim/common/cgen-defs.h
sim/mips/ChangeLog
sim/mips/m16.igen
sim/ppc/ChangeLog
sim/ppc/config.in
sim/ppc/configure
sim/ppc/configure.in
sim/ppc/emul_netbsd.c

index dc234e3e029ea8ca715fd70ac90d72775d2aa777..1a8463701e1a83c5154343e9c80038ac07f98df1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,71 +1,3 @@
-2004-10-12  Kelley Cook  <kcook@gcc.gnu.org>
-
-       * configure.in (*-*-cygwin*): Supress warning if newlib not present.
-       * configure: Regenerate.
-
-2004-10-06  Paolo Bonzini  <bonzini@gnu.org>
-
-       Fix wrong conflict resolution in:
-
-       2004-08-16  Paolo Bonzini  <bonzini@gnu.org>
-
-       * Makefile.in: Regenerate.
-       * Makefile.tpl (Autogenerated `all-*' targets): Invoke $(TARGET-*)
-       in the recursive `make', instead of hardwiring `all'.
-       (Autogenerated TARGET-* variables): New.
-
-2004-10-05  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       Merged from GCC / libtool upstream:
-       2004-10-02  P.J. Darcy  <darcypj@us.ibm.com>
-       * ltcf-c.sh (tpf*): Add ld_shlibs=yes.
-       * ltcf-cxx.sh (tpf*): Likewise.
-       * ltconfig (tpf*): Add TPF OS configuration support.
-
-2004-09-30  Tomer Levi  <Tomer.Levi@nsc.com>
-
-       * configure.in: Enable target-libgloss for crx-*-*.
-        * configure: Regenerate.
-
-2004-09-24  Michael Roth  <mroth@nessie.de>
-
-       * configure.in (--without-headers): Add missing double quotes.
-       * configure: Regenerate.
-
-2004-09-24  Kelley Cook <kcook@gcc.gnu.org>
-
-       * ylwrap: Revert to previous version.
-
-2004-09-23  H.J. Lu  <hongjiu.lu@intel.com>
-
-       PR bootstrap/17369
-       * Makefile.tpl (REALLY_SET_LIB_PATH): Add @SET_GCC_LIB_PATH@.
-       (HOST_EXPORTS]): Add @SET_GCC_LIB_PATH@. Set and export
-       SET_GCC_LIB_PATH_CMD.
-       (BASE_TARGET_EXPORTS): Likewise.
-       * Makefile.in: Regenerated.
-
-       * configure.in (SET_GCC_LIB_PATH): Set and substitute.
-       * configure: Regenerated.
-
-2004-09-23  Kelley Cook  <kcook@gcc.gnu.org>
-
-       * config.guess: New upstream version
-       * compile, depcomp, install-sh, ylwrap: Likewise.
-
-2004-09-19  Roger Sayle  <roger@eyesopen.com>
-
-       * config/mh-x86omitfp: New host makefile fragment.  Add
-       -fomit-frame-pointer to the default BOOT_CFLAGS.
-       * configure.in: Use it to speed up bootstrap on some IA-32 hosts.
-       * configure: Regenerate.
-
-2004-09-15  Andrew Pinski  <pinskia@physics.uc.edu>
-
-       PR target/11572
-       * configure.in (*-*-darwin*): Renable libobjc.
-       * configure: Regenerate.
-
 2004-09-09  Daniel Berlin  <dberlin@dberlin.org>
        
        * Makefile.def: Remove libbanshee.
index 0867ec9f535853a0fd7a0b820af2c52e5389fbd2..8047c004da80363f182e7c05b5d10d8db950471a 100644 (file)
@@ -101,7 +101,6 @@ SET_LIB_PATH = @SET_LIB_PATH@
 # Some platforms don't like blank entries, so we remove duplicate,
 # leading and trailing colons.
 REALLY_SET_LIB_PATH = \
-  @SET_GCC_LIB_PATH@ \
   $(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.
@@ -171,9 +170,7 @@ HOST_EXPORTS = \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
        GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
-       GMPINC="$(HOST_GMPINC)"; export GMPINC; \
-       SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-       @SET_GCC_LIB_PATH@
+       GMPINC="$(HOST_GMPINC)"; export GMPINC;
 
 # Similar, for later GCC stages.
 STAGE_HOST_EXPORTS = \
@@ -207,9 +204,7 @@ BASE_TARGET_EXPORTS = \
        LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
        NM="$(NM_FOR_TARGET)"; export NM; \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
-       SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-       @SET_GCC_LIB_PATH@
+       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
 
 RAW_CXX_TARGET_EXPORTS = \
        $(BASE_TARGET_EXPORTS) \
@@ -2543,15 +2538,13 @@ configure-ash:
 .PHONY: all-ash maybe-all-ash
 maybe-all-ash:
 @if ash
-TARGET-ash=all
 maybe-all-ash: all-ash
 all-ash: configure-ash
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd ash && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-ash))
+       (cd ash && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif ash
 
 .PHONY: check-ash maybe-check-ash
@@ -2847,15 +2840,13 @@ configure-autoconf:
 .PHONY: all-autoconf maybe-all-autoconf
 maybe-all-autoconf:
 @if autoconf
-TARGET-autoconf=all
 maybe-all-autoconf: all-autoconf
 all-autoconf: configure-autoconf
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-autoconf))
+       (cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif autoconf
 
 .PHONY: check-autoconf maybe-check-autoconf
@@ -3151,15 +3142,13 @@ configure-automake:
 .PHONY: all-automake maybe-all-automake
 maybe-all-automake:
 @if automake
-TARGET-automake=all
 maybe-all-automake: all-automake
 all-automake: configure-automake
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd automake && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-automake))
+       (cd automake && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif automake
 
 .PHONY: check-automake maybe-check-automake
@@ -3455,15 +3444,13 @@ configure-bash:
 .PHONY: all-bash maybe-all-bash
 maybe-all-bash:
 @if bash
-TARGET-bash=all
 maybe-all-bash: all-bash
 all-bash: configure-bash
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd bash && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-bash))
+       (cd bash && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif bash
 
 .PHONY: check-bash maybe-check-bash
@@ -3760,7 +3747,6 @@ configure-bfd:
 .PHONY: all-bfd maybe-all-bfd
 maybe-all-bfd:
 @if bfd
-TARGET-bfd=all
 maybe-all-bfd: all-bfd
 all-bfd: configure-bfd
        @test -f stage_last && exit 0; \
@@ -3768,8 +3754,7 @@ all-bfd: configure-bfd
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd bfd && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-bfd))
+       (cd bfd && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif bfd
 
 .PHONY: check-bfd maybe-check-bfd
@@ -4066,7 +4051,6 @@ configure-opcodes:
 .PHONY: all-opcodes maybe-all-opcodes
 maybe-all-opcodes:
 @if opcodes
-TARGET-opcodes=all
 maybe-all-opcodes: all-opcodes
 all-opcodes: configure-opcodes
        @test -f stage_last && exit 0; \
@@ -4074,8 +4058,7 @@ all-opcodes: configure-opcodes
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-opcodes))
+       (cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif opcodes
 
 .PHONY: check-opcodes maybe-check-opcodes
@@ -4372,7 +4355,6 @@ configure-binutils:
 .PHONY: all-binutils maybe-all-binutils
 maybe-all-binutils:
 @if binutils
-TARGET-binutils=all
 maybe-all-binutils: all-binutils
 all-binutils: configure-binutils
        @test -f stage_last && exit 0; \
@@ -4380,8 +4362,7 @@ all-binutils: configure-binutils
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd binutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-binutils))
+       (cd binutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif binutils
 
 .PHONY: check-binutils maybe-check-binutils
@@ -4677,15 +4658,13 @@ configure-bison:
 .PHONY: all-bison maybe-all-bison
 maybe-all-bison:
 @if bison
-TARGET-bison=all
 maybe-all-bison: all-bison
 all-bison: configure-bison
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd bison && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-bison))
+       (cd bison && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif bison
 
 .PHONY: check-bison maybe-check-bison
@@ -4984,15 +4963,13 @@ configure-byacc:
 .PHONY: all-byacc maybe-all-byacc
 maybe-all-byacc:
 @if byacc
-TARGET-byacc=all
 maybe-all-byacc: all-byacc
 all-byacc: configure-byacc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd byacc && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-byacc))
+       (cd byacc && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif byacc
 
 .PHONY: check-byacc maybe-check-byacc
@@ -5291,15 +5268,13 @@ configure-bzip2:
 .PHONY: all-bzip2 maybe-all-bzip2
 maybe-all-bzip2:
 @if bzip2
-TARGET-bzip2=all
 maybe-all-bzip2: all-bzip2
 all-bzip2: configure-bzip2
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-bzip2))
+       (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif bzip2
 
 .PHONY: check-bzip2 maybe-check-bzip2
@@ -5595,15 +5570,13 @@ configure-dejagnu:
 .PHONY: all-dejagnu maybe-all-dejagnu
 maybe-all-dejagnu:
 @if dejagnu
-TARGET-dejagnu=all
 maybe-all-dejagnu: all-dejagnu
 all-dejagnu: configure-dejagnu
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-dejagnu))
+       (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif dejagnu
 
 .PHONY: check-dejagnu maybe-check-dejagnu
@@ -5899,15 +5872,13 @@ configure-diff:
 .PHONY: all-diff maybe-all-diff
 maybe-all-diff:
 @if diff
-TARGET-diff=all
 maybe-all-diff: all-diff
 all-diff: configure-diff
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd diff && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-diff))
+       (cd diff && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif diff
 
 .PHONY: check-diff maybe-check-diff
@@ -6203,15 +6174,13 @@ configure-dosutils:
 .PHONY: all-dosutils maybe-all-dosutils
 maybe-all-dosutils:
 @if dosutils
-TARGET-dosutils=all
 maybe-all-dosutils: all-dosutils
 all-dosutils: configure-dosutils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd dosutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-dosutils))
+       (cd dosutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif dosutils
 
 .PHONY: check-dosutils maybe-check-dosutils
@@ -6502,15 +6471,13 @@ configure-etc:
 .PHONY: all-etc maybe-all-etc
 maybe-all-etc:
 @if etc
-TARGET-etc=all
 maybe-all-etc: all-etc
 all-etc: configure-etc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd etc && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-etc))
+       (cd etc && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif etc
 
 .PHONY: check-etc maybe-check-etc
@@ -6806,15 +6773,13 @@ configure-fastjar:
 .PHONY: all-fastjar maybe-all-fastjar
 maybe-all-fastjar:
 @if fastjar
-TARGET-fastjar=all
 maybe-all-fastjar: all-fastjar
 all-fastjar: configure-fastjar
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-fastjar))
+       (cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif fastjar
 
 .PHONY: check-fastjar maybe-check-fastjar
@@ -7113,15 +7078,13 @@ configure-fileutils:
 .PHONY: all-fileutils maybe-all-fileutils
 maybe-all-fileutils:
 @if fileutils
-TARGET-fileutils=all
 maybe-all-fileutils: all-fileutils
 all-fileutils: configure-fileutils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-fileutils))
+       (cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif fileutils
 
 .PHONY: check-fileutils maybe-check-fileutils
@@ -7417,15 +7380,13 @@ configure-findutils:
 .PHONY: all-findutils maybe-all-findutils
 maybe-all-findutils:
 @if findutils
-TARGET-findutils=all
 maybe-all-findutils: all-findutils
 all-findutils: configure-findutils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd findutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-findutils))
+       (cd findutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif findutils
 
 .PHONY: check-findutils maybe-check-findutils
@@ -7721,15 +7682,13 @@ configure-find:
 .PHONY: all-find maybe-all-find
 maybe-all-find:
 @if find
-TARGET-find=all
 maybe-all-find: all-find
 all-find: configure-find
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd find && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-find))
+       (cd find && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif find
 
 .PHONY: check-find maybe-check-find
@@ -8025,15 +7984,13 @@ configure-flex:
 .PHONY: all-flex maybe-all-flex
 maybe-all-flex:
 @if flex
-TARGET-flex=all
 maybe-all-flex: all-flex
 all-flex: configure-flex
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd flex && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-flex))
+       (cd flex && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif flex
 
 .PHONY: check-flex maybe-check-flex
@@ -8333,7 +8290,6 @@ configure-gas:
 .PHONY: all-gas maybe-all-gas
 maybe-all-gas:
 @if gas
-TARGET-gas=all
 maybe-all-gas: all-gas
 all-gas: configure-gas
        @test -f stage_last && exit 0; \
@@ -8341,8 +8297,7 @@ all-gas: configure-gas
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gas && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gas))
+       (cd gas && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gas
 
 .PHONY: check-gas maybe-check-gas
@@ -8639,7 +8594,6 @@ configure-gcc:
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
 @if gcc
-TARGET-gcc=`if [ -f gcc/stage_last ]; then echo quickstrap ; else echo all; fi`
 maybe-all-gcc: all-gcc
 all-gcc: configure-gcc
        @test -f stage_last && exit 0; \
@@ -8647,8 +8601,8 @@ all-gcc: configure-gcc
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gcc && $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
-         $(TARGET-gcc))
+       (cd gcc && $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)  \
+           `if [ -f gcc/stage_last ]; then echo quickstrap ; else echo all; fi` )
 @endif gcc
 
 .PHONY: check-gcc maybe-check-gcc
@@ -8944,15 +8898,13 @@ configure-gawk:
 .PHONY: all-gawk maybe-all-gawk
 maybe-all-gawk:
 @if gawk
-TARGET-gawk=all
 maybe-all-gawk: all-gawk
 all-gawk: configure-gawk
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gawk && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gawk))
+       (cd gawk && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gawk
 
 .PHONY: check-gawk maybe-check-gawk
@@ -9248,15 +9200,13 @@ configure-gettext:
 .PHONY: all-gettext maybe-all-gettext
 maybe-all-gettext:
 @if gettext
-TARGET-gettext=all
 maybe-all-gettext: all-gettext
 all-gettext: configure-gettext
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gettext && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gettext))
+       (cd gettext && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gettext
 
 .PHONY: check-gettext maybe-check-gettext
@@ -9552,15 +9502,13 @@ configure-gnuserv:
 .PHONY: all-gnuserv maybe-all-gnuserv
 maybe-all-gnuserv:
 @if gnuserv
-TARGET-gnuserv=all
 maybe-all-gnuserv: all-gnuserv
 all-gnuserv: configure-gnuserv
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gnuserv))
+       (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gnuserv
 
 .PHONY: check-gnuserv maybe-check-gnuserv
@@ -9856,15 +9804,13 @@ configure-gprof:
 .PHONY: all-gprof maybe-all-gprof
 maybe-all-gprof:
 @if gprof
-TARGET-gprof=all
 maybe-all-gprof: all-gprof
 all-gprof: configure-gprof
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gprof && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gprof))
+       (cd gprof && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gprof
 
 .PHONY: check-gprof maybe-check-gprof
@@ -10160,15 +10106,13 @@ configure-gzip:
 .PHONY: all-gzip maybe-all-gzip
 maybe-all-gzip:
 @if gzip
-TARGET-gzip=all
 maybe-all-gzip: all-gzip
 all-gzip: configure-gzip
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gzip && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-gzip))
+       (cd gzip && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif gzip
 
 .PHONY: check-gzip maybe-check-gzip
@@ -10464,15 +10408,13 @@ configure-hello:
 .PHONY: all-hello maybe-all-hello
 maybe-all-hello:
 @if hello
-TARGET-hello=all
 maybe-all-hello: all-hello
 all-hello: configure-hello
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd hello && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-hello))
+       (cd hello && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif hello
 
 .PHONY: check-hello maybe-check-hello
@@ -10768,15 +10710,13 @@ configure-indent:
 .PHONY: all-indent maybe-all-indent
 maybe-all-indent:
 @if indent
-TARGET-indent=all
 maybe-all-indent: all-indent
 all-indent: configure-indent
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd indent && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-indent))
+       (cd indent && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif indent
 
 .PHONY: check-indent maybe-check-indent
@@ -11073,7 +11013,6 @@ configure-intl:
 .PHONY: all-intl maybe-all-intl
 maybe-all-intl:
 @if intl
-TARGET-intl=all
 maybe-all-intl: all-intl
 all-intl: configure-intl
        @test -f stage_last && exit 0; \
@@ -11081,8 +11020,7 @@ all-intl: configure-intl
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd intl && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-intl))
+       (cd intl && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif intl
 
 .PHONY: check-intl maybe-check-intl
@@ -11378,15 +11316,13 @@ configure-tcl:
 .PHONY: all-tcl maybe-all-tcl
 maybe-all-tcl:
 @if tcl
-TARGET-tcl=all
 maybe-all-tcl: all-tcl
 all-tcl: configure-tcl
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd tcl && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-tcl))
+       (cd tcl && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif tcl
 
 .PHONY: check-tcl maybe-check-tcl
@@ -11667,15 +11603,13 @@ configure-itcl:
 .PHONY: all-itcl maybe-all-itcl
 maybe-all-itcl:
 @if itcl
-TARGET-itcl=all
 maybe-all-itcl: all-itcl
 all-itcl: configure-itcl
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd itcl && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-itcl))
+       (cd itcl && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif itcl
 
 .PHONY: check-itcl maybe-check-itcl
@@ -11972,7 +11906,6 @@ configure-ld:
 .PHONY: all-ld maybe-all-ld
 maybe-all-ld:
 @if ld
-TARGET-ld=all
 maybe-all-ld: all-ld
 all-ld: configure-ld
        @test -f stage_last && exit 0; \
@@ -11980,8 +11913,7 @@ all-ld: configure-ld
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd ld && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-ld))
+       (cd ld && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif ld
 
 .PHONY: check-ld maybe-check-ld
@@ -12278,7 +12210,6 @@ configure-libcpp:
 .PHONY: all-libcpp maybe-all-libcpp
 maybe-all-libcpp:
 @if libcpp
-TARGET-libcpp=all
 maybe-all-libcpp: all-libcpp
 all-libcpp: configure-libcpp
        @test -f stage_last && exit 0; \
@@ -12286,8 +12217,7 @@ all-libcpp: configure-libcpp
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-libcpp))
+       (cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif libcpp
 
 .PHONY: check-libcpp maybe-check-libcpp
@@ -12583,15 +12513,13 @@ configure-libgui:
 .PHONY: all-libgui maybe-all-libgui
 maybe-all-libgui:
 @if libgui
-TARGET-libgui=all
 maybe-all-libgui: all-libgui
 all-libgui: configure-libgui
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd libgui && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-libgui))
+       (cd libgui && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif libgui
 
 .PHONY: check-libgui maybe-check-libgui
@@ -12888,7 +12816,6 @@ configure-libiberty:
 .PHONY: all-libiberty maybe-all-libiberty
 maybe-all-libiberty:
 @if libiberty
-TARGET-libiberty=all
 maybe-all-libiberty: all-libiberty
 all-libiberty: configure-libiberty
        @test -f stage_last && exit 0; \
@@ -12896,8 +12823,7 @@ all-libiberty: configure-libiberty
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-libiberty))
+       (cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif libiberty
 
 .PHONY: check-libiberty maybe-check-libiberty
@@ -13193,15 +13119,13 @@ configure-libtool:
 .PHONY: all-libtool maybe-all-libtool
 maybe-all-libtool:
 @if libtool
-TARGET-libtool=all
 maybe-all-libtool: all-libtool
 all-libtool: configure-libtool
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd libtool && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-libtool))
+       (cd libtool && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif libtool
 
 .PHONY: check-libtool maybe-check-libtool
@@ -13497,15 +13421,13 @@ configure-m4:
 .PHONY: all-m4 maybe-all-m4
 maybe-all-m4:
 @if m4
-TARGET-m4=all
 maybe-all-m4: all-m4
 all-m4: configure-m4
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd m4 && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-m4))
+       (cd m4 && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif m4
 
 .PHONY: check-m4 maybe-check-m4
@@ -13801,15 +13723,13 @@ configure-make:
 .PHONY: all-make maybe-all-make
 maybe-all-make:
 @if make
-TARGET-make=all
 maybe-all-make: all-make
 all-make: configure-make
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd make && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-make))
+       (cd make && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif make
 
 .PHONY: check-make maybe-check-make
@@ -14105,15 +14025,13 @@ configure-mmalloc:
 .PHONY: all-mmalloc maybe-all-mmalloc
 maybe-all-mmalloc:
 @if mmalloc
-TARGET-mmalloc=all
 maybe-all-mmalloc: all-mmalloc
 all-mmalloc: configure-mmalloc
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-mmalloc))
+       (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif mmalloc
 
 .PHONY: check-mmalloc maybe-check-mmalloc
@@ -14404,15 +14322,13 @@ configure-patch:
 .PHONY: all-patch maybe-all-patch
 maybe-all-patch:
 @if patch
-TARGET-patch=all
 maybe-all-patch: all-patch
 all-patch: configure-patch
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd patch && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-patch))
+       (cd patch && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif patch
 
 .PHONY: check-patch maybe-check-patch
@@ -14708,15 +14624,13 @@ configure-perl:
 .PHONY: all-perl maybe-all-perl
 maybe-all-perl:
 @if perl
-TARGET-perl=all
 maybe-all-perl: all-perl
 all-perl: configure-perl
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd perl && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-perl))
+       (cd perl && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif perl
 
 .PHONY: check-perl maybe-check-perl
@@ -15012,15 +14926,13 @@ configure-prms:
 .PHONY: all-prms maybe-all-prms
 maybe-all-prms:
 @if prms
-TARGET-prms=all
 maybe-all-prms: all-prms
 all-prms: configure-prms
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd prms && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-prms))
+       (cd prms && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif prms
 
 .PHONY: check-prms maybe-check-prms
@@ -15316,15 +15228,13 @@ configure-rcs:
 .PHONY: all-rcs maybe-all-rcs
 maybe-all-rcs:
 @if rcs
-TARGET-rcs=all
 maybe-all-rcs: all-rcs
 all-rcs: configure-rcs
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd rcs && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-rcs))
+       (cd rcs && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif rcs
 
 .PHONY: check-rcs maybe-check-rcs
@@ -15620,15 +15530,13 @@ configure-readline:
 .PHONY: all-readline maybe-all-readline
 maybe-all-readline:
 @if readline
-TARGET-readline=all
 maybe-all-readline: all-readline
 all-readline: configure-readline
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd readline && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-readline))
+       (cd readline && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif readline
 
 .PHONY: check-readline maybe-check-readline
@@ -15924,15 +15832,13 @@ configure-release:
 .PHONY: all-release maybe-all-release
 maybe-all-release:
 @if release
-TARGET-release=all
 maybe-all-release: all-release
 all-release: configure-release
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd release && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-release))
+       (cd release && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif release
 
 .PHONY: check-release maybe-check-release
@@ -16218,15 +16124,13 @@ configure-recode:
 .PHONY: all-recode maybe-all-recode
 maybe-all-recode:
 @if recode
-TARGET-recode=all
 maybe-all-recode: all-recode
 all-recode: configure-recode
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd recode && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-recode))
+       (cd recode && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif recode
 
 .PHONY: check-recode maybe-check-recode
@@ -16522,15 +16426,13 @@ configure-sed:
 .PHONY: all-sed maybe-all-sed
 maybe-all-sed:
 @if sed
-TARGET-sed=all
 maybe-all-sed: all-sed
 all-sed: configure-sed
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd sed && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-sed))
+       (cd sed && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif sed
 
 .PHONY: check-sed maybe-check-sed
@@ -16826,15 +16728,13 @@ configure-send-pr:
 .PHONY: all-send-pr maybe-all-send-pr
 maybe-all-send-pr:
 @if send-pr
-TARGET-send-pr=all
 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) \
        $(HOST_EXPORTS) \
-       (cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-send-pr))
+       (cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif send-pr
 
 .PHONY: check-send-pr maybe-check-send-pr
@@ -17130,15 +17030,13 @@ configure-shellutils:
 .PHONY: all-shellutils maybe-all-shellutils
 maybe-all-shellutils:
 @if shellutils
-TARGET-shellutils=all
 maybe-all-shellutils: all-shellutils
 all-shellutils: configure-shellutils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-shellutils))
+       (cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif shellutils
 
 .PHONY: check-shellutils maybe-check-shellutils
@@ -17434,15 +17332,13 @@ configure-sid:
 .PHONY: all-sid maybe-all-sid
 maybe-all-sid:
 @if sid
-TARGET-sid=all
 maybe-all-sid: all-sid
 all-sid: configure-sid
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd sid && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-sid))
+       (cd sid && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif sid
 
 .PHONY: check-sid maybe-check-sid
@@ -17738,15 +17634,13 @@ configure-sim:
 .PHONY: all-sim maybe-all-sim
 maybe-all-sim:
 @if sim
-TARGET-sim=all
 maybe-all-sim: all-sim
 all-sim: configure-sim
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd sim && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-sim))
+       (cd sim && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif sim
 
 .PHONY: check-sim maybe-check-sim
@@ -18042,15 +17936,13 @@ configure-tar:
 .PHONY: all-tar maybe-all-tar
 maybe-all-tar:
 @if tar
-TARGET-tar=all
 maybe-all-tar: all-tar
 all-tar: configure-tar
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd tar && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-tar))
+       (cd tar && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif tar
 
 .PHONY: check-tar maybe-check-tar
@@ -18346,15 +18238,13 @@ configure-texinfo:
 .PHONY: all-texinfo maybe-all-texinfo
 maybe-all-texinfo:
 @if texinfo
-TARGET-texinfo=all
 maybe-all-texinfo: all-texinfo
 all-texinfo: configure-texinfo
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd texinfo && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-texinfo))
+       (cd texinfo && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif texinfo
 
 .PHONY: check-texinfo maybe-check-texinfo
@@ -18645,15 +18535,13 @@ configure-textutils:
 .PHONY: all-textutils maybe-all-textutils
 maybe-all-textutils:
 @if textutils
-TARGET-textutils=all
 maybe-all-textutils: all-textutils
 all-textutils: configure-textutils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd textutils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-textutils))
+       (cd textutils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif textutils
 
 .PHONY: check-textutils maybe-check-textutils
@@ -18949,15 +18837,13 @@ configure-time:
 .PHONY: all-time maybe-all-time
 maybe-all-time:
 @if time
-TARGET-time=all
 maybe-all-time: all-time
 all-time: configure-time
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd time && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-time))
+       (cd time && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif time
 
 .PHONY: check-time maybe-check-time
@@ -19253,15 +19139,13 @@ configure-uudecode:
 .PHONY: all-uudecode maybe-all-uudecode
 maybe-all-uudecode:
 @if uudecode
-TARGET-uudecode=all
 maybe-all-uudecode: all-uudecode
 all-uudecode: configure-uudecode
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-uudecode))
+       (cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif uudecode
 
 .PHONY: check-uudecode maybe-check-uudecode
@@ -19557,15 +19441,13 @@ configure-wdiff:
 .PHONY: all-wdiff maybe-all-wdiff
 maybe-all-wdiff:
 @if wdiff
-TARGET-wdiff=all
 maybe-all-wdiff: all-wdiff
 all-wdiff: configure-wdiff
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-wdiff))
+       (cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif wdiff
 
 .PHONY: check-wdiff maybe-check-wdiff
@@ -19861,15 +19743,13 @@ configure-zip:
 .PHONY: all-zip maybe-all-zip
 maybe-all-zip:
 @if zip
-TARGET-zip=all
 maybe-all-zip: all-zip
 all-zip: configure-zip
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd zip && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-zip))
+       (cd zip && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif zip
 
 .PHONY: check-zip maybe-check-zip
@@ -20169,7 +20049,6 @@ configure-zlib:
 .PHONY: all-zlib maybe-all-zlib
 maybe-all-zlib:
 @if zlib
-TARGET-zlib=all
 maybe-all-zlib: all-zlib
 all-zlib: configure-zlib
        @test -f stage_last && exit 0; \
@@ -20177,8 +20056,7 @@ all-zlib: configure-zlib
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd zlib && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-zlib))
+       (cd zlib && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif zlib
 
 .PHONY: check-zlib maybe-check-zlib
@@ -20464,15 +20342,13 @@ configure-gdb:
 .PHONY: all-gdb maybe-all-gdb
 maybe-all-gdb:
 @if gdb
-TARGET-gdb=all
 maybe-all-gdb: all-gdb
 all-gdb: configure-gdb
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-         $(TARGET-gdb))
+       (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
 @endif gdb
 
 .PHONY: check-gdb maybe-check-gdb
@@ -20768,15 +20644,13 @@ configure-expect:
 .PHONY: all-expect maybe-all-expect
 maybe-all-expect:
 @if expect
-TARGET-expect=all
 maybe-all-expect: all-expect
 all-expect: configure-expect
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-         $(TARGET-expect))
+       (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
 @endif expect
 
 .PHONY: check-expect maybe-check-expect
@@ -21072,15 +20946,13 @@ configure-guile:
 .PHONY: all-guile maybe-all-guile
 maybe-all-guile:
 @if guile
-TARGET-guile=all
 maybe-all-guile: all-guile
 all-guile: configure-guile
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-         $(TARGET-guile))
+       (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
 @endif guile
 
 .PHONY: check-guile maybe-check-guile
@@ -21376,15 +21248,13 @@ configure-tk:
 .PHONY: all-tk maybe-all-tk
 maybe-all-tk:
 @if tk
-TARGET-tk=all
 maybe-all-tk: all-tk
 all-tk: configure-tk
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-         $(TARGET-tk))
+       (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
 @endif tk
 
 .PHONY: check-tk maybe-check-tk
@@ -21680,15 +21550,13 @@ configure-libtermcap:
 .PHONY: all-libtermcap maybe-all-libtermcap
 maybe-all-libtermcap:
 @if libtermcap
-TARGET-libtermcap=all
 maybe-all-libtermcap: all-libtermcap
 all-libtermcap: configure-libtermcap
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-libtermcap))
+       (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif libtermcap
 
 .PHONY: check-libtermcap maybe-check-libtermcap
@@ -21919,15 +21787,13 @@ configure-utils:
 .PHONY: all-utils maybe-all-utils
 maybe-all-utils:
 @if utils
-TARGET-utils=all
 maybe-all-utils: all-utils
 all-utils: configure-utils
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd utils && $(MAKE) $(FLAGS_TO_PASS)  \
-         $(TARGET-utils))
+       (cd utils && $(MAKE) $(FLAGS_TO_PASS)  all)
 @endif utils
 
 .PHONY: check-utils maybe-check-utils
index 3fb09f7d8bbb4a638abcf4ca204daccce3edbd5f..d685c39ded58c00a08dd888181f0c962e47f34e2 100644 (file)
@@ -104,7 +104,6 @@ SET_LIB_PATH = @SET_LIB_PATH@
 # Some platforms don't like blank entries, so we remove duplicate,
 # leading and trailing colons.
 REALLY_SET_LIB_PATH = \
-  @SET_GCC_LIB_PATH@ \
   $(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.
@@ -174,9 +173,7 @@ HOST_EXPORTS = \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
        GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
-       GMPINC="$(HOST_GMPINC)"; export GMPINC; \
-       SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-       @SET_GCC_LIB_PATH@
+       GMPINC="$(HOST_GMPINC)"; export GMPINC;
 
 # Similar, for later GCC stages.
 STAGE_HOST_EXPORTS = \
@@ -210,9 +207,7 @@ BASE_TARGET_EXPORTS = \
        LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
        NM="$(NM_FOR_TARGET)"; export NM; \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
-       SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-       @SET_GCC_LIB_PATH@
+       WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
 
 RAW_CXX_TARGET_EXPORTS = \
        $(BASE_TARGET_EXPORTS) \
@@ -909,7 +904,6 @@ configure-[+module+]:
 .PHONY: all-[+module+] maybe-all-[+module+]
 maybe-all-[+module+]:
 @if [+module+]
-TARGET-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
 maybe-all-[+module+]: all-[+module+]
 all-[+module+]: configure-[+module+]
        @[+ IF bootstrap +]test -f stage_last && exit 0; \
@@ -917,8 +911,13 @@ all-[+module+]: configure-[+module+]
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        $(HOST_EXPORTS) \
-       (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] \
-         $(TARGET-[+module+]))
+       (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
+         IF with_x 
+           +] $(X11_FLAGS_TO_PASS)[+ 
+         ENDIF with_x +] [+extra_make_flags+] [+
+         IF (== (get "module") "gcc") +] \
+           `if [ -f gcc/stage_last ]; then echo quickstrap ; else echo all; fi` [+
+         ELSE +]all[+ ENDIF +])
 @endif [+module+]
 
 .PHONY: check-[+module+] maybe-check-[+module+]
index de596386d90717f2080b069033ff3dd1c4ae1d46..eb179d9d1b54a140ed797d05f8a3c2ee4edb7fd0 100644 (file)
@@ -1,730 +1,3 @@
-2004-10-18  Nick Clifton  <nickc@redhat.com>
-
-       * elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute
-       'name' for relocs against both local and global symbols.
-
-2004-10-16  Daniel Jacobowitz  <dan@debian.org>
-
-       * bfd-in2.h: Regenerate.
-       * bfd.c (struct bfd): Add no_export.
-       * elflink.c (elf_link_add_object_symbols): Handle no_export.
-
-2004-10-15  Alan Modra  <amodra@bigpond.net.au>
-
-       * config.bfd: Whitespace cleanup.
-       * Makefile.am: Run "make dep-am"
-       * Makefile.in: Regenerate.
-
-2004-10-15  Jakub Jelinek  <jakub@redhat.com>
-
-       * elflink.c (struct already_linked_section): Removed.
-       (try_match_symbols_in_sections, already_linked): Removed.
-       (_bfd_elf_section_already_linked): Skip ^\.gnu\.linkonce\.[^.]*\.
-       prefix of section names when finding already_linked_table
-       chain.  Compare section names.  Instead of calling already_linked,
-       do it inline and only for sections in the same already_linked_list.
-
-2004-10-15  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Add "info"
-       parameter.  If called after _bfd_elf_write_section_eh_frame,
-       don't allow a -2 return unless need_* bit is already set, and
-       handle offsets adjusted for output_offset.
-       * elf-bfd.h (_bfd_elf_eh_frame_section_offset): Update prototype.
-       * elf.c (_bfd_elf_section_offset): Update call.
-
-2004-10-13  H.J. Lu  <hongjiu.lu@intel.com>
-
-       PR 440
-       * coffcode.h (coff_compute_section_file_positions): Cast to
-       bfd_vma when computing page alignment.
-
-2004-10-13  Mark Mitchell  <mark@codesourcery.com>
-
-       * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
-       offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED.
-
-2004-10-12  Mark Mitchell  <mark@codesourcery.com>
-
-       * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Make .rel.plt
-       relocations use a virtual address, not a section offset.
-
-2004-10-12  Bob Wilson  <bob.wilson@acm.org>
-
-       * elf32-xtensa.c (elf_xtensa_get_private_bfd_flags): Delete.
-       (narrow_instruction, widen_instruction): Remove unnecessary calls to
-       xtensa_format_encode.
-       (ebb_propose_action): Inline call to ebb_add_proposed_action.
-       (ebb_add_proposed_action): Delete.
-
-2004-10-12  Bob Wilson  <bob.wilson@acm.org>
-
-       * elf32-xtensa.c: Use ISO C90 formatting.
-
-2004-10-12  Paul Brook  <paul@codesourcery.com>
-
-       * elf32-arm.h (elf32_arm_merge_private_bfd_data): Rephrase error
-       message.
-
-2004-10-12  Paul Brook  <paul@codesourcery.com>
-
-       * elf32-arm.h: Support EABI version 4 objects.
-
-2004-10-12  Alan Modra  <amodra@bigpond.net.au>
-
-       PR 325
-       * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Place last in chain.
-       Don't mark as default.
-       (bfd_x86_64_arch): Don't mark as default.
-
-2004-10-12  Alan Modra  <amodra@bigpond.net.au>
-
-       * elflink.c (enum action_discarded): New.
-       (elf_section_complain_discarded): Delete.
-       (elf_action_discarded): New function subsuming the above and also
-       controlling reloc behaviour.
-       (elf_link_input_bfd): Use it.
-
-2004-10-11  Jakub Jelinek  <jakub@redhat.com>
-
-       * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
-       (special_sections): Add .gnu.liblist and .gnu.conflict.
-       (assign_section_numbers): Handle SHT_GNU_LIBLIST.
-
-2004-10-11  Alan Modra  <amodra@bigpond.net.au>
-
-       PR 233
-       * elflink.c (elf_link_input_bfd): Try harder to support
-       relocations against symbols in removed linkonce sections.
-
-2004-10-11  Alan Modra  <amodra@bigpond.net.au>
-
-       * elflink.c (elf_link_input_bfd): Revert PR 354 change.
-
-       PR 354
-       * elflink.c (elf_link_input_bfd): Check that relocs in SEC_ALLOC
-       sections do not reference symbols in non-SEC_ALLOC sections.
-
-2004-10-11  Alan Modra  <amodra@bigpond.net.au>
-
-       PR 437
-       * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
-       (_bfd_elf_link_omit_section_dynsym): Formatting.
-
-2004-10-10  Alan Modra  <amodra@bigpond.net.au>
-
-       * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
-       * libbfd.h: Regnerate.
-       * elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
-       * elf32-frv.c: Likewise.
-       * elf32-m32r.c: Likewise.
-       * elf32-ppc.c: Likewise.
-       * elf64-hppa.c: Likewise.
-       * elfxx-ia64.c: Likewise.
-       * opncls.c: Likewise.
-
-2004-10-10  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted.
-       * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust
-       offsets stored in struct eh_cie_fde entries before doing other
-       work.
-
-       * elf-bfd.h (struct eh_cie_fde): Add cie_inf, remove sec.
-       (struct eh_frame_hdr_info): Add last_cie_inf, remove last_cie_offset.
-       * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete code
-       setting offsets for removed CIEs.  Don't set "sec", instead set
-       cie_inf for FDEs.  Keep a pointer to last struct eh_cie_fde for a
-       CIE in hdr_info.  Only set make_relative and make_lsda_relative
-       for CIEs.  Use pointers rather than array indices.
-       (_bfd_elf_eh_frame_section_offset): Test/set make_relative,
-       make_lsda_relative, need_* on cie_inf for FDEs.
-       (_bfd_elf_write_section_eh_frame): Adjust offset and new_offset for
-       section output_offset.  Delete cie_offset, instead use cie_inf
-       pointer to CIE entry.  Use need_relative and need_lsda_relative on
-       CIE entry for FDEs.  Use pointers rather than array indices.
-
-2004-10-09  Alan Modra  <amodra@bigpond.net.au>
-
-       * coff-rs6000.c (rs6000coff_vec): Add initializer for
-       bfd_is_target_special_symbol.
-       * coff64-rs6000.c (rs6000coff64_vec): Likewise.
-       * som.c (som_bfd_is_target_special_symbol): Define.
-
-2004-10-08  Nick Clifton  <nickc@redhat.com>
-
-       * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93.
-       * configure: Regenerate.
-       * bfd-in2.h: Regenerate.
-       * syms.c (bfd_is_target_special_symbol): New interface function.
-       Returns true when a symbol should be considered to be special.
-       * targets.c (bfd_target): Include bfd_is_target_special_symbol in
-       the symbol jump table.
-       * elf32-arm.h (elf32_arm_is_target_special_symbol): New function.
-       Return true iff the symbol is a mapping symbol.
-       (bfd_elf32_bfd_is_target_special_symbol): Define.
-       * elfxx-target.h: Provide a default definition for
-       bfd_is_target_special_symbol.
-       * aout-target.h: Likewise.
-       * aout-tic30.c: Likewise.
-       * binary.c: Likewise.
-       * coffcode.h: Likewise.
-       * i386msdos.c: Likewise.
-       * ieee.c: Likewise.
-       * ihex.c: Likewise.
-       * libaout.h: Likewise.
-       * libbfd-in.h: Likewise
-       * libecoff.h: Likewise.
-       * mach-o.c: Likewise.
-       * mmo.c: Likewise.
-       * nlm-target.h: Likewise.
-       * oasys.c: Likewise.
-       * pef.c: Likewise.
-       * ppcboot.c: Likewise.
-       * srec.c: Likewise.
-       * tekhex.c: Likewise.
-       * versados.c: Likewise.
-       * vms.c: Likewise.
-       * xcoff-target.h: Likewise.
-       * xsym.c: Likewise.
-       * libbfd.h: Regenerate.
-
-2004-10-08  Daniel Jacobowitz  <dan@debian.org>
-
-       * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
-       * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function.
-       (elf_backend_section_from_shdr): Define.
-
-2004-10-08  Alan Modra  <amodra@bigpond.net.au>
-
-       * syms.c (bfd_is_local_label): Return false for file symbols.
-
-2004-10-07  Bob Wilson  <bob.wilson@acm.org>
-           David Heine  <dlheine@tensilica.com>
-
-       * elf32-xtensa.c (elf32xtensa_size_opt): New global variable.
-       (xtensa_default_isa): Global variable moved here from xtensa-isa.c.
-       (elf32xtensa_no_literal_movement): New global variable.
-       (elf_howto_table): Add entries for new relocations.
-       (elf_xtensa_reloc_type_lookup): Handle new relocations.
-       (property_table_compare): When addresses are equal, compare sizes and
-       various property flags.
-       (property_table_matches): New.
-       (xtensa_read_table_entries): Extend to read new property tables.  Add
-       output_addr parameter to indicate that output addresses should be used.
-       Use bfd_get_section_limit.
-       (elf_xtensa_find_property_entry): New.
-       (elf_xtensa_in_literal_pool): Use elf_xtensa_find_property_entry.
-       (elf_xtensa_check_relocs): Handle new relocations.
-       (elf_xtensa_do_reloc): Use bfd_get_section_limit.  Handle new
-       relocations.  Use new xtensa-isa.h functions.
-       (build_encoding_error_message): Remove encode_result parameter.  Add
-       new target_address parameter used to detect alignment errors.
-       (elf_xtensa_relocate_section): Use bfd_get_section_limit.  Clean up
-       error handling.  Use new is_operand_relocation function.
-       (elf_xtensa_combine_prop_entries, elf_xtensa_merge_private_bfd_data):
-       Use underbar macro for error messages.  Formatting.
-       (get_const16_opcode): New.
-       (get_l32r_opcode): Add a separate flag for initialization.
-       (get_relocation_opnd): Operand number is no longer explicit in the
-       relocation.  Change to decode the opcode and analyze its operands.
-       (get_relocation_slot): New.
-       (get_relocation_opcode): Add bfd parameter.  Use bfd_get_section_limit.
-       Use new xtensa-isa.h functions to handle multislot instructions.
-       (is_l32r_relocation): Add bfd parameter.  Use is_operand_relocation.
-       (get_asm_simplify_size, is_alt_relocation, is_operand_relocation,
-       insn_decode_len, insn_decode_opcode, check_branch_target_aligned,
-       check_loop_aligned, check_branch_target_aligned_address, narrowable,
-       widenable, narrow_instruction, widen_instruction, op_single_fmt_table,
-       get_single_format, init_op_single_format_table): New.
-       (elf_xtensa_do_asm_simplify): Add error_message parameter and use it
-       instead of calling _bfd_error_handler.  Use new xtensa-isa.h functions.
-       (contract_asm_expansion): Add error_message parameter and pass it to
-       elf_xtensa_do_asm_simplify.  Replace use of R_XTENSA_OP0 relocation
-       with R_XTENSA_SLOT0_OP.
-       (get_expanded_call_opcode): Extend to handle either L32R or CONST16
-       instructions.  Use new xtensa-isa.h functions.
-       (r_reloc struct): Add new virtual_offset field.
-       (r_reloc_init): Add contents and content_length parameters.  Set
-       virtual_offset field to zero.  Add contents to target_offset field for
-       partial_inplace relocations.
-       (r_reloc_is_defined): Check for null.
-       (print_r_reloc): New debug function.
-       (source_reloc struct): Replace xtensa_operand field with pair of the
-       opcode and the operand position.  Add is_abs_literal field.
-       (init_source_reloc): Specify operand by opcode/position pair.  Set
-       is_abs_literal field.
-       (source_reloc_compare): When target_offsets are equal, compare other
-       fields to make sorting predictable.
-       (literal_value struct): Add is_abs_literal field.
-       (value_map_hash_table struct): Add has_last_loc and last_loc fields.
-       (init_literal_value): New.
-       (is_same_value): Replace with ...
-       (literal_value_equal): ... this function.  Add comparisons of
-       virtual_offset and is_abs_literal fields.
-       (value_map_hash_table_init): Use bfd_zmalloc.  Check for allocation
-       failure.  Initialize has_last_loc field.
-       (value_map_hash_table_delete): New.
-       (hash_literal_value): Rename to ...
-       (literal_value_hash): ... this.  Include is_abs_literal flag and
-       virtual_offset field in the hash value.
-       (get_cached_value): Rename to ...
-       (value_map_get_cached_value): ... this.  Update calls to
-       literal_value_hash and literal_value_equal.
-       (add_value_map): Check for allocation failure.  Update calls to
-       value_map_get_cached_value and literal_value_hash.
-       (text_action, text_action_list, text_action_t): New types.
-       (find_fill_action, compute_removed_action_diff, adjust_fill_action,
-       text_action_add, text_action_add_literal, offset_with_removed_text,
-       offset_with_removed_text_before_fill, find_insn_action,
-       print_action_list, print_removed_literals): New.
-       (offset_with_removed_literals): Delete.
-       (xtensa_relax_info struct): Add is_relaxable_asm_section, action_list,
-       fix_array, fix_array_count, allocated_relocs, relocs_count, and
-       allocated_relocs_count fields.
-       (init_xtensa_relax_info): Initialize new fields.
-       (reloc_bfd_fix struct): Add new translated field.
-       (reloc_bfd_fix_init): Add translated parameter and use it to set the
-       translated field.
-       (fix_compare, cache_fix_array): New.
-       (get_bfd_fix): Remove fix_list parameter and get all relax_info for the
-       section via get_xtensa_relax_info.  Use cache_fix_array to set up
-       sorted fix_array and use bsearch instead of linear search.
-       (section_cache_t): New struct.
-       (init_section_cache, section_cache_section, clear_section_cache): New.
-       (ebb_t, ebb_target_enum, proposed_action, ebb_constraint): New types.
-       (init_ebb_constraint, free_ebb_constraint, init_ebb, extend_ebb_bounds,
-       extend_ebb_bounds_forward, extend_ebb_bounds_backward,
-       insn_block_decodable_len, ebb_propose_action, ebb_add_proposed_action):
-       New.
-       (retrieve_contents): Use bfd_get_section_limit.
-       (elf_xtensa_relax_section): Add relocations_analyzed flag.  Update call
-       to compute_removed_literals.  Free value_map_hash_table when no longer
-       needed.
-       (analyze_relocations): Check is_relaxable_asm_section flag.  Call
-       compute_text_actions for all sections.
-       (find_relaxable_sections): Mark sections as relaxable if they contain
-       ASM_EXPAND relocations that can be optimized.  Adjust r_reloc_init
-       call.  Increment relax_info src_count field only for appropriate
-       relocation types.  Remove is_literal_section check.
-       (collect_source_relocs): Use bfd_get_section_limit.  Adjust calls to
-       r_reloc_init and find_associated_l32r_irel.  Check
-       is_relaxable_asm_section flag.  Handle L32R instructions with absolute
-       literals.  Pass is_abs_literal flag to init_source_reloc.
-       (is_resolvable_asm_expansion): Use bfd_get_section_limit.  Check for
-       CONST16 instructions.  Adjust calls to r_reloc_init and
-       pcrel_reloc_fits.  Handle weak symbols conservatively.
-       (find_associated_l32r_irel): Add bfd parameter and pass it to
-       is_l32r_relocation.
-       (compute_text_actions, compute_ebb_proposed_actions,
-       compute_ebb_actions, check_section_ebb_pcrels_fit,
-       check_section_ebb_reduces, text_action_add_proposed,
-       compute_fill_extra_space): New.
-       (remove_literals): Replace with ...
-       (compute_removed_literals): ... this function.  Call
-       init_section_cache.  Use bfd_get_section_limit.  Sort internal_relocs.
-       Call xtensa_read_table_entries to get the property table.  Skip
-       relocations other than R_XTENSA_32 and R_XTENSA_PLT.  Use new
-       is_removable_literal, remove_dead_literal, and
-       identify_literal_placement functions.
-       (get_irel_at_offset): Rewrite to use bsearch on sorted relocations
-       instead of linear search.
-       (is_removable_literal, remove_dead_literal,
-       identify_literal_placement): New.
-       (relocations_reach): Update check for literal not referenced by any
-       PC-relative relocations.  Adjust call to pcrel_reloc_fits.
-       (coalesce_shared_literal, move_shared_literal): New.
-       (relax_section): Use bfd_get_section_limit.  Call
-       translate_section_fixes.  Update calls to r_reloc_init and
-       offset_with_removed_text.  Check new is_relaxable_asm_section flag.
-       Add call to pin_internal_relocs.  Add special handling for
-       R_XTENSA_ASM_SIMPLIFY and R_XTENSA_DIFF* relocs.  Use virtual_offset
-       info to calculate new addend_displacement variable.  Replace code for
-       deleting literals with more general code to perform the actions
-       determined by the action_list for the section.
-       (translate_section_fixes, translate_reloc_bfd_fix): New.
-       (translate_reloc): Check new is_relaxable_asm_section flag.  Call
-       find_removed_literal only if is_operand_relocation.  Update call to
-       offset_with_removed_text.  Use new target_offset and removed_bytes
-       variables.
-       (move_literal): New.
-       (relax_property_section):  Use bfd_get_section_limit.  Set new
-       is_full_prop_section flag and handle new property tables.  Update calls
-       to r_reloc_init and offset_with_removed_text.  Check
-       is_relaxable_asm_section flag.  Handle expansion of zero-sized
-       unreachable entries, with use of offset_with_removed_text_before_fill.
-       For relocatable links, combine entries only for literal tables.
-       (relax_section_symbols): Check is_relaxable_asm_section flag.  Update
-       calls to offset_with_removed_text.  Translate st_size field for
-       function symbols.
-       (do_fix_for_relocatable_link): Change to return bfd_boolean to indicate
-       failure.  Add contents parameter.  Update call to get_bfd_fix.  Update
-       call to r_reloc_init.  Call _bfd_error_handler and return FALSE for
-       R_XTENSA_ASM_EXPAND relocs.
-       (do_fix_for_final_link): Add input_bfd and contents parameters.  Update
-       call to get_bfd_fix.  Include offset from contents for partial_inplace
-       relocations.
-       (is_reloc_sym_weak): New.
-       (pcrel_reloc_fits): Use new xtensa-isa.h functions.
-       (prop_sec_len): New.
-       (xtensa_is_property_section): Handle new property sections.
-       (is_literal_section): Delete.
-       (internal_reloc_compare): When r_offset matches, compare r_info and
-       r_addend to make sorting predictable.
-       (internal_reloc_matches): New.
-       (xtensa_get_property_section_name): Handle new property sections.
-       (xtensa_get_property_predef_flags): New.
-       (xtensa_callback_required_dependence): Use bfd_get_section_limit.
-       Update calls to xtensa_isa_init, is_l32r_relocation, and r_reloc_init.
-       * xtensa-isa.c (xtensa_default_isa): Moved to elf32-xtensa.c.
-       (xtisa_errno, xtisa_error_msg): New variables.
-       (xtensa_isa_errno, xtensa_isa_error_msg): New.
-       (xtensa_insnbuf_alloc): Add error handling.
-       (xtensa_insnbuf_to_chars): Add num_chars parameter.  Update to
-       use xtensa_format_decode.  Add error handling.
-       (xtensa_insnbuf_from_chars): Add num_chars parameter.  Decode the
-       instruction length to find the number of bytes to copy.
-       (xtensa_isa_init): Add error handling.  Replace calls to
-       xtensa_load_isa and xtensa_extend_isa with code to initialize lookup
-       tables in the xtensa_modules structure.
-       (xtensa_check_isa_config, xtensa_add_isa, xtensa_load_isa,
-       xtensa_extend_isa): Delete.
-       (xtensa_isa_free): Change to only free lookup tables.
-       (opname_lookup_compare): Replace with ...
-       (xtensa_isa_name_compare): ... this function.  Use strcasecmp.
-       (xtensa_insn_maxlength): Rename to ...
-       (xtensa_isa_maxlength): ... this.
-       (xtensa_insn_length): Delete.
-       (xtensa_insn_length_from_first_byte): Replace with ...
-       (xtensa_isa_length_from_chars): ... this function.
-       (xtensa_num_opcodes): Rename to ...
-       (xtensa_isa_num_opcodes): ... this.
-       (xtensa_isa_num_pipe_stages, xtensa_isa_num_formats,
-       xtensa_isa_num_regfiles, xtensa_isa_num_stages,
-       xtensa_isa_num_sysregs, xtensa_isa_num_interfaces,
-       xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup,
-       xtensa_format_decode, xtensa_format_encode, xtensa_format_length,
-       xtensa_format_num_slots, xtensa_format_slot_nop_opcode,
-       xtensa_format_get_slot, xtensa_format_set_slot): New functions.
-       (xtensa_opcode_lookup): Add error handling.
-       (xtensa_decode_insn): Replace with ...
-       (xtensa_opcode_decode): ... this function, with new format and
-       slot parameters.  Add error handling.
-       (xtensa_encode_insn): Replace with ...
-       (xtensa_opcode_encode): ... this function, which does the encoding via
-       one of the entries in the "encode_fns" array.  Add error handling.
-       (xtensa_opcode_name): Add error handling.
-       (xtensa_opcode_is_branch, xtensa_opcode_is_jump, xtensa_opcode_is_loop,
-       xtensa_opcode_is_call): New.
-       (xtensa_num_operands): Replace with ...
-       (xtensa_opcode_num_operands): ... this function.  Add error handling.
-       (xtensa_opcode_num_stateOperands,
-       xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses,
-       xtensa_opcode_funcUnit_use, xtensa_operand_name,
-       xtensa_operand_is_visible): New.
-       (xtensa_get_operand, xtensa_operand_kind): Delete.
-       (xtensa_operand_inout): Add error handling and special-case for
-       "sout" operands.
-       (xtensa_operand_get_field, xtensa_operand_set_field): Rewritten to
-       operate on one slot of an instruction.  Added error handling.
-       (xtensa_operand_encode): Handle default operands with no encoding
-       functions.  Check for success by comparing against decoded value.
-       Add error handling.
-       (xtensa_operand_decode): Handle default operands.  Return decoded value
-       through argument pointer.  Add error handling.
-       (xtensa_operand_is_register, xtensa_operand_regfile,
-       xtensa_operand_num_regs, xtensa_operand_is_known_reg): New.
-       (xtensa_operand_isPCRelative): Rename to ...
-       (xtensa_operand_is_PCrelative): ... this.  Add error handling.
-       (xtensa_operand_do_reloc, xtensa_operand_undo_reloc): Return value
-       through argument pointer.  Add error handling.
-       (xtensa_stateOperand_state, xtensa_stateOperand_inout,
-       xtensa_interfaceOperand_interface, xtensa_regfile_lookup,
-       xtensa_regfile_lookup_shortname, xtensa_regfile_name,
-       xtensa_regfile_shortname, xtensa_regfile_view_parent,
-       xtensa_regfile_num_bits, xtensa_regfile_num_entries,
-       xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits,
-       xtensa_state_is_exported, xtensa_sysreg_lookup,
-       xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number,
-       xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name,
-       xtensa_interface_num_bits, xtensa_interface_inout,
-       xtensa_interface_has_side_effect, xtensa_funcUnit_lookup,
-       xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New.
-       * xtensa-modules.c: Rewrite to use new data structures.
-       * reloc.c (BFD_RELOC_XTENSA_DIFF8, BFD_RELOC_XTENSA_DIFF16,
-       BFD_RELOC_XTENSA_DIFF32, BFD_RELOC_XTENSA_SLOT0_OP,
-       BFD_RELOC_XTENSA_SLOT1_OP, BFD_RELOC_XTENSA_SLOT2_OP,
-       BFD_RELOC_XTENSA_SLOT3_OP, BFD_RELOC_XTENSA_SLOT4_OP,
-       BFD_RELOC_XTENSA_SLOT5_OP, BFD_RELOC_XTENSA_SLOT6_OP,
-       BFD_RELOC_XTENSA_SLOT7_OP, BFD_RELOC_XTENSA_SLOT8_OP,
-       BFD_RELOC_XTENSA_SLOT9_OP, BFD_RELOC_XTENSA_SLOT10_OP,
-       BFD_RELOC_XTENSA_SLOT11_OP, BFD_RELOC_XTENSA_SLOT12_OP,
-       BFD_RELOC_XTENSA_SLOT13_OP, BFD_RELOC_XTENSA_SLOT14_OP,
-       BFD_RELOC_XTENSA_SLOT0_ALT, BFD_RELOC_XTENSA_SLOT1_ALT,
-       BFD_RELOC_XTENSA_SLOT2_ALT, BFD_RELOC_XTENSA_SLOT3_ALT,
-       BFD_RELOC_XTENSA_SLOT4_ALT, BFD_RELOC_XTENSA_SLOT5_ALT,
-       BFD_RELOC_XTENSA_SLOT6_ALT, BFD_RELOC_XTENSA_SLOT7_ALT,
-       BFD_RELOC_XTENSA_SLOT8_ALT, BFD_RELOC_XTENSA_SLOT9_ALT,
-       BFD_RELOC_XTENSA_SLOT10_ALT, BFD_RELOC_XTENSA_SLOT11_ALT,
-       BFD_RELOC_XTENSA_SLOT12_ALT, BFD_RELOC_XTENSA_SLOT13_ALT,
-       BFD_RELOC_XTENSA_SLOT14_ALT): Add new relocations.
-       * Makefile.am (xtensa-isa.lo, xtensa-modules.lo): Update dependencies.
-       * Makefile.in: Regenerate.
-       * bfd-in2.h: Likewise.
-       * libbfd.h: Likewise.
-
-2004-10-07  Richard Sandiford  <rsandifo@redhat.com>
-
-       * elf64-mips.c (mips_elf64_write_rel): Use STN_UNDEF for relocs
-       against the absolute section.
-       (mips_elf64_write_rela): Likewise.
-
-2004-10-07  Jan Beulich <jbeulich@novell.com>
-
-       * elf.c (elf_find_function): Don't generally check for matching
-       section, just for non-file symbols.  Remove redunant comparison
-       for the latter.
-       * elf32-arm.h (arm_elf_find_function): Likewise.
-
-2004-10-07  Jeff Baker  <jbaker@qnx.com>
-
-       * elflink.c (_bfd_elf_add_dynamic_entry): Add code to warn if
-       adding a DT_TEXTREL to a shared object and --warn-shared-textrel
-       was specified.
-
-2004-10-04  Roland McGrath  <roland@redhat.com>
-
-       * hash.c (bfd_hash_set_default_size): Use const for table.
-       Use size_t instead of int for variable compared to sizeof results.
-
-2004-10-05  Alan Modra  <amodra@bigpond.net.au>
-
-       PR 425
-       * syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs.
-
-2004-10-01  Paul Brook  <paul@codesourcery.com>
-
-       * elf32-arm.h (elf32_arm_fake_sections,
-       is_arm_elf_unwind_section_name, elf32_arm_section_from_shdr): New
-       functions.
-       (elf_backend_fake_sections, elf_backend_section_from_shdr): Define.
-
-2004-10-01  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf-bfd.h (struct eh_cie_fde): Add need_relative and
-       need_lsda_relative.
-       * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Set
-       need_relative or need_lsda_relative if we are processing an
-       offset for a reloc on a FDE initial loc or LSDA field
-       respectively.
-       (_bfd_elf_write_section_eh_frame): Test need_relative and
-       need_lsda_relative in place of corresponding make_* field
-       when deciding to use pc-relative encodings.
-
-2004-09-30  Paul Brook  <paul@codesourcery.com>
-
-       * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs"
-       target2 relocation type.
-
-2004-09-30  H.J. Lu  <hongjiu.lu@intel.com>
-
-       PR 414
-       * elflink.c (_bfd_elf_merge_symbol): Check TLS symbol.
-
-2004-09-30  Paul Brook  <paul@codesourcery.com>
-
-       * reloc.c: Add BFD_RELOC_ARM_SMI.
-       * bfd-in2.h: Regenerate.
-       * libbfd.h: Ditto.
-
-2004-09-24  Alan Modra  <amodra@bigpond.net.au>
-
-       * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section
-       vma and output offset to address.
-       * simple.c (simple_save_output_info): Only set output section
-       and offset for debug sections, or those not already set up by
-       the linker.
-       (bfd_simple_get_relocated_section_contents): Update comment.
-
-2004-09-24  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf.c (IS_LOADED): Delete.
-       (assign_file_positions_for_segments): Just test SEC_LOAD instead.
-       Restore SEC_HAS_CONTENTS test to the one place it was used prior
-       to 2004-09-22.
-
-2004-09-23  Alan Modra  <amodra@bigpond.net.au>
-
-       PR gas/396
-       * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
-       bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite.  Remove
-       redundant assignment of EM_SPARC.
-
-2004-09-22  Brian Ford  <ford@vss.fsi.com>
-
-       * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
-       alignment for .rdata sections so sse[2] code works with gcc >= 3.3.3
-       constants.
-       * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
-
-2004-09-22  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf32-ppc.c (ppc_elf_modify_segment_map): Delete.
-       (elf_backend_modify_segment_map): Don't define.
-
-2004-09-22  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf.c (IS_LOADED): Define.
-       (assign_file_positions_for_segments): Don't round up file offset of
-       PT_LOAD segments containing no SEC_LOAD sections, instead round down.
-       Delete code handling link script adjustment of lma.  Do the adjust
-       in later code handling similar ajustments.  Remove dead code error
-       check.  Warn if section lma would require a negative offset
-       adjustment.  Tweak lma adjustment to use p_filesz rather than p_memsz.
-       Use p_vaddr + p_memsz inside section loop in place of voff.  Don't
-       update voff in section loop.  Change voff in segment loop to be an
-       adjustment on top of "off".  Set sec->filepos and update "off" later.
-       Test for loadable sections consistently using IS_LOADED.  Similarly,
-       test for alloc-only sections other than .tbss consistently.
-       Don't bother checking SEC_ALLOC in PT_LOAD segments.  Remove FIXME.
-       Tidy PT_NOTE handling.  Use %B and %A in error messages.
-       (assign_file_positions_except_relocs): Use %B in error message.
-
-2004-09-17  H.J. Lu  <hongjiu.lu@intel.com>
-
-       * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
-       (CONFIG_STATUS_DEPENDENCIES): New.
-       (Makefile): Removed.
-       (config.status): Likewise.
-       * Makefile.in: Regenerated.
-
-2004-09-17  Paul Brook  <paul@codesourcery.com>
-
-       * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype.
-       (bfd_elf32_arm_process_before_allocation): Update prototype.
-       * bfd-in2.h: Regenerate.
-       * bfd/elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc.
-       (elf32_arm_link_hash_table_create): Set it.
-       (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel.
-       (bfd_elf32_arm_set_target_relocs): New function.
-       (arm_real_reloc_type): New function.
-       (elf32_arm_final_link_relocate): Use it.  Handle R_ARM_PREL31 and
-       R_ARM_GOT_PREL.  Remove R_ARM_TARGET1.
-       (elf32_arm_gc_sweep_hook): Ditto.
-       (elf32_arm_check_relocs): Ditto.
-       (elf32_arm_relocate_section): Handle R_ARM_GOT_PREL.
-       * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_PREL31 and
-       R_ARM_GOT_TARGET2.
-       (elf32_arm_got_prel): New variable.
-       (elf32_arm_howto_from_type): New function.
-       (elf32_arm_info_to_howto): Use it.
-       (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PREL31 and
-       BFD_RELOC_ARM_TARGET2.
-       * libbfd.h: Regenerate.
-       * reloc.c: Add BFD_RELOC_ARM_TARGET2 and BFD_RELOC_ARM_PREL31.
-
-2004-09-17  Alan Modra  <amodra@bigpond.net.au>
-
-       * ecoff.c: Update u.undef.next refs.
-       * elf64-ppc.c: Likewise.
-       * elflink.c: Likewise.
-       * linker.c: Likewise.
-       * xcofflink.c: Likewise.
-
-       * elf-bfd.h (struct elf_link_hash_entry): Rearrange.  Add FIXME to
-       dynamic_def.  Combine weakdef and elf_hash_value.  Move vtable
-       fields to indirect struct.
-       * elf-m10300.c: Update u.weakdef refs.
-       * elf32-arm.h: Likewise.
-       * elf32-cris.c: Likewise.
-       * elf32-frv.c: Likewise.
-       * elf32-hppa.c: Likewise.
-       * elf32-i370.c: Likewise.
-       * elf32-i386.c: Likewise.
-       * elf32-m32r.c: Likewise.
-       * elf32-m68k.c: Likewise.
-       * elf32-ppc.c: Likewise.
-       * elf32-s390.c: Likewise.
-       * elf32-sh.c: Likewise.
-       * elf32-sparc.c: Likewise.
-       * elf32-vax.c: Likewise.
-       * elf32-xtensa.c: Likewise.
-       * elf64-alpha.c: Likewise.
-       * elf64-hppa.c: Likewise.
-       * elf64-ppc.c: Likewise.
-       * elf64-s390.c: Likewise.
-       * elf64-sh64.c: Likewise.
-       * elf64-sparc.c: Likewise.
-       * elf64-x86-64.c: Likewise.
-       * elfxx-ia64.c: Likewise.
-       * elfxx-mips.c: Likewise.
-       * elflink.c: Likewise.  Also u.elf_hash_value.
-       (elf_gc_propagate_vtable_entries_used): Update for h->vtable
-       indirection.
-       (elf_gc_smash_unused_vtentry_relocs): Likewise.
-       (bfd_elf_gc_record_vtinherit): Alloc vtable.
-       (bfd_elf_gc_record_vtentry): Likewise.
-       * elf.c (_bfd_elf_link_hash_newfunc): Use memset.
-
-2004-09-17  Alan Modra  <amodra@bigpond.net.au>
-
-       * Makefile.am: Run "make dep-am".
-       * Makefile.in: Regenerate.
-       * bfd-in2.h: Regenerate.
-       * po/SRC-POTFILES.in: Regenerate.
-       * po/bfd.pot: Regenerate.
-
-2004-09-16  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
-       with bitfields.  Make "type" and "other" bitfields too.
-       (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR,
-       ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC,
-       ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED,
-       ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF,
-       ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK,
-       ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK,
-       ELF_LINK_POINTER_EQUALITY_NEEDED): Delete.
-       (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update.
-       * elf-hppa.h: Update all uses of elf_link_hash_flags.
-       * elf-m10300.c: Likewise.
-       * elf.c: Likewise.
-       * elf32-arm.h: Likewise.
-       * elf32-cris.c: Likewise.
-       * elf32-frv.c: Likewise.
-       * elf32-hppa.c: Likewise.
-       * elf32-i370.c: Likewise.
-       * elf32-i386.c: Likewise.
-       * elf32-m32r.c: Likewise.
-       * elf32-m68k.c: Likewise.
-       * elf32-ppc.c: Likewise.
-       * elf32-s390.c: Likewise.
-       * elf32-sh-symbian.c: Likewise.
-       * elf32-sh.c: Likewise.
-       * elf32-sh64.c: Likewise.
-       * elf32-sparc.c: Likewise.
-       * elf32-vax.c: Likewise.
-       * elf32-xtensa.c: Likewise.
-       * elf64-alpha.c: Likewise.
-       * elf64-hppa.c: Likewise.
-       * elf64-ppc.c: Likewise.
-       * elf64-s390.c: Likewise.
-       * elf64-sh64.c: Likewise.
-       * elf64-sparc.c: Likewise.
-       * elf64-x86-64.c: Likewise.
-       * elflink.c: Likewise.
-       * elfxx-ia64.c: Likewise.
-       * elfxx-mips.c: Likewise.
-       * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92.
-       * configure: Regenerate.
-       * aclocal.m4: Regenerate.
-
-2004-09-16  Alan Modra  <amodra@bigpond.net.au>
-
-       * elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI
-       around uses of R_ARM_TARGET1.
-       (elf32_arm_check_relocs): Likewise.
-
 2004-09-13  Paul Brook  <paul@codesourcery.com>
 
        * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
        * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a
        PT_DYNAMIC segment.
        (elf_backend_want_got_plt): Define to zero for Symbian OS.
-
+       
 2004-09-06  Nick Clifton  <nickc@redhat.com>
 
        * elflink.c (elf_link_add_object_symbols): Set the error code to
index 17c9214b53788dcbd6769d6fa906eec11d19fcfa..a937cc046141a2409e97c36b2f19987d721134e2 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AUTOMAKE_OPTIONS = 1.9 cygnus
+AUTOMAKE_OPTIONS = cygnus
 
 # Uncomment the following line when doing a release.
 # RELEASE=y
@@ -575,14 +575,6 @@ OPTIONAL_BACKENDS_CFILES = \
        trad-core.c \
        cisco-core.c
 
-# We want to rerun configure if configure.in, config.bfd or
-# configure.host change. configure.in is needed since the version
-# number in Makefile comes from configure.in.
-CONFIG_STATUS_DEPENDENCIES = \
-       $(srcdir)/configure.in \
-       $(srcdir)/config.bfd \
-       $(srcdir)/configure.host
-
 # These are defined by configure.in:
 WORDSIZE = @wordsize@
 ALL_BACKENDS = @all_backends@
@@ -771,6 +763,8 @@ uninstall_libbfd:
        rm -f $(DESTDIR)$(bfdincludedir)/symcat.h
        rm -f $(DESTDIR)$(bfdincludedir)/bfdlink.h
 
+Makefile: $(srcdir)/configure.in
+
 # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
 DEP: dep.sed $(CFILES) $(HFILES) bfd.h
        rm -f DEP1
@@ -877,6 +871,10 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 
 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
+# 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/'` ;\
@@ -1174,9 +1172,9 @@ 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 $(INCDIR)/bfdlink.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.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 \
@@ -1323,10 +1321,10 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
+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 \
@@ -1557,10 +1555,9 @@ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
   libxcoff.h
 xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h
-xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/xtensa-isa-internal.h
-xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.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-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 \
index 2c7da661dc49fb565a5dafc4efdbc4da4fb3d9cc..8d8440944d23572f9cc7e1183ea11b531f06425a 100644 (file)
@@ -1,8 +1,6 @@
-# Makefile.in generated by automake 1.9.1 from Makefile.am.
-# @configure_input@
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  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.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-@SET_MAKE@
-
 
-SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
+SHELL = @SHELL@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+
 top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
 INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = @build@
+host_alias = @host_alias@
 host_triplet = @host@
-target_triplet = @target@
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \
-       ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/configure $(am__configure_deps) \
-       $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
-       $(srcdir)/bfd-in2.h $(top_srcdir)/po/Make-in \
-       $(srcdir)/../ltmain.sh $(srcdir)/../config.guess \
-       $(srcdir)/../config.sub
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/../config/accross.m4 \
-       $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../libtool.m4 \
-       $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = bfd-in3.h po/Makefile.in
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-libbfd_a_AR = $(AR) $(ARFLAGS)
-libbfd_a_LIBADD =
-am_libbfd_a_OBJECTS =
-libbfd_a_OBJECTS = $(am_libbfd_a_OBJECTS)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(bfdlibdir)"
-bfdlibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(bfdlib_LTLIBRARIES)
-am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
-       cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo \
-       opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \
-       linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \
-       stab-syms.lo merge.lo dwarf2.lo simple.lo
-am__objects_2 = archive64.lo
-am_libbfd_la_OBJECTS = $(am__objects_1) $(am__objects_2)
-libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-exec-recursive install-info-recursive \
-       install-recursive installcheck-recursive installdirs-recursive \
-       pdf-recursive ps-recursive uninstall-info-recursive \
-       uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
 AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
+AS = @AS@
 BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
 BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
 BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
@@ -122,140 +69,89 @@ BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
 CATALOGS = @CATALOGS@
 CATOBJEXT = @CATOBJEXT@
 CC = @CC@
-CCDEPMODE = @CCDEPMODE@
 CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
 COREFILE = @COREFILE@
 COREFLAG = @COREFLAG@
 CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
 DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+DLLTOOL = @DLLTOOL@
 EXEEXT = @EXEEXT@
 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
+GNATBIND = @GNATBIND@
 GT_NO = @GT_NO@
 GT_YES = @GT_YES@
+HAVE_LIB = @HAVE_LIB@
 HDEFINES = @HDEFINES@
 INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@
-INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INSTOBJEXT = @INSTOBJEXT@
 INTLDEPS = @INTLDEPS@
 INTLLIBS = @INTLLIBS@
 INTLOBJS = @INTLOBJS@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
+LIB = @LIB@
 LIBTOOL = @LIBTOOL@
+LN = @LN@
 LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
+LTLIB = @LTLIB@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
 MKINSTALLDIRS = @MKINSTALLDIRS@
 MSGFMT = @MSGFMT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
 POFILES = @POFILES@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
 STRIP = @STRIP@
 TDEFINES = @TDEFINES@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
 WIN32LDFLAGS = @WIN32LDFLAGS@
 WIN32LIBADD = @WIN32LIBADD@
-XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
 all_backends = @all_backends@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
 bfd_backends = @bfd_backends@
 bfd_default_target_size = @bfd_default_target_size@
 bfd_file_ptr = @bfd_file_ptr@
 bfd_libs = @bfd_libs@
 bfd_machines = @bfd_machines@
 bfd_ufile_ptr = @bfd_ufile_ptr@
-bfdincludedir = @bfdincludedir@
-bfdlibdir = @bfdlibdir@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
+build_noncanonical = @build_noncanonical@
+build_subdir = @build_subdir@
+do_compare = @do_compare@
 host_noncanonical = @host_noncanonical@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
+host_subdir = @host_subdir@
 l = @l@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
+ncn_cv_ = @ncn_cv_@
 target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_vendor = @target_vendor@
+target_subdir = @target_subdir@
 tdefaults = @tdefaults@
 wordsize = @wordsize@
-AUTOMAKE_OPTIONS = 1.9 cygnus
+
+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
+
 SUBDIRS = doc po
+
 docdir = doc
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
+
 bfdlib_LTLIBRARIES = libbfd.la
+
+WARN_CFLAGS = @WARN_CFLAGS@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 # bfd.h goes here, for now
@@ -268,560 +164,45 @@ BFD_H = bfd.h
 # for the debugger, so if you are downloading things as S-records you
 # need two copies of the executable, one to download and one for the
 # debugger).
-BFD32_LIBS = \
-       archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
-       cache.lo coffgen.lo corefile.lo \
-       format.lo init.lo libbfd.lo opncls.lo reloc.lo \
-       section.lo syms.lo targets.lo hash.lo linker.lo \
-       srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
-       merge.lo dwarf2.lo simple.lo
+BFD32_LIBS =   archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo        cache.lo coffgen.lo corefile.lo         format.lo init.lo libbfd.lo opncls.lo reloc.lo  section.lo syms.lo targets.lo hash.lo linker.lo         srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo       merge.lo dwarf2.lo simple.lo
+
 
 BFD64_LIBS = archive64.lo
-BFD32_LIBS_CFILES = \
-       archive.c archures.c bfd.c bfdio.c bfdwin.c \
-       cache.c coffgen.c corefile.c \
-       format.c init.c libbfd.c opncls.c reloc.c \
-       section.c syms.c targets.c hash.c linker.c \
-       srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
-       merge.c dwarf2.c simple.c
+
+BFD32_LIBS_CFILES =    archive.c archures.c bfd.c bfdio.c bfdwin.c     cache.c coffgen.c corefile.c    format.c init.c libbfd.c opncls.c reloc.c       section.c syms.c targets.c hash.c linker.c      srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c     merge.c dwarf2.c simple.c
+
 
 BFD64_LIBS_CFILES = archive64.c
 
 # This list is alphabetized to make it easier to keep in sync
 # with the decls and initializer in archures.c.
-ALL_MACHINES = \
-       cpu-a29k.lo \
-       cpu-alpha.lo \
-       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 \
-       cpu-fr30.lo \
-       cpu-frv.lo \
-       cpu-h8300.lo \
-       cpu-h8500.lo \
-       cpu-hppa.lo \
-       cpu-ia64.lo \
-       cpu-i370.lo \
-       cpu-i386.lo \
-       cpu-i860.lo \
-       cpu-i960.lo \
-       cpu-ip2k.lo \
-       cpu-iq2000.lo \
-       cpu-m32r.lo \
-       cpu-m68hc11.lo \
-       cpu-m68hc12.lo \
-       cpu-m68k.lo \
-       cpu-m88k.lo \
-       cpu-m10200.lo \
-       cpu-m10300.lo \
-       cpu-mcore.lo \
-       cpu-mips.lo \
-       cpu-mmix.lo \
-       cpu-msp430.lo \
-       cpu-or32.lo \
-       cpu-ns32k.lo \
-       cpu-openrisc.lo \
-       cpu-pdp11.lo \
-       cpu-pj.lo \
-       cpu-powerpc.lo \
-       cpu-rs6000.lo \
-       cpu-s390.lo \
-       cpu-sh.lo \
-       cpu-sparc.lo \
-       cpu-tic30.lo \
-       cpu-tic4x.lo \
-       cpu-tic54x.lo \
-       cpu-tic80.lo \
-       cpu-v850.lo \
-       cpu-vax.lo \
-       cpu-we32k.lo \
-       cpu-w65.lo \
-       cpu-xstormy16.lo \
-       cpu-xtensa.lo \
-       cpu-z8k.lo
-
-ALL_MACHINES_CFILES = \
-       cpu-a29k.c \
-       cpu-alpha.c \
-       cpu-arc.c \
-       cpu-arm.c \
-       cpu-avr.c \
-       cpu-cris.c \
-       cpu-cr16c.c \
-       cpu-crx.c \
-       cpu-d10v.c \
-       cpu-d30v.c \
-       cpu-dlx.c \
-       cpu-fr30.c \
-       cpu-frv.c \
-       cpu-h8300.c \
-       cpu-h8500.c \
-       cpu-hppa.c \
-       cpu-ia64.c \
-       cpu-i370.c \
-       cpu-i386.c \
-       cpu-i860.c \
-       cpu-i960.c \
-       cpu-ip2k.c \
-       cpu-iq2000.c \
-       cpu-m32r.c \
-       cpu-m68hc11.c \
-       cpu-m68hc12.c \
-       cpu-m68k.c \
-       cpu-m88k.c \
-       cpu-m10200.c \
-       cpu-m10300.c \
-       cpu-mcore.c \
-       cpu-mips.c \
-       cpu-mmix.c \
-       cpu-msp430.c \
-       cpu-or32.c \
-       cpu-ns32k.c \
-       cpu-openrisc.c \
-       cpu-pdp11.c \
-       cpu-pj.c \
-       cpu-powerpc.c \
-       cpu-rs6000.c \
-       cpu-s390.c \
-       cpu-sh.c \
-       cpu-sparc.c \
-       cpu-tic30.c \
-       cpu-tic4x.c \
-       cpu-tic54x.c \
-       cpu-tic80.c \
-       cpu-v850.c \
-       cpu-vax.c \
-       cpu-we32k.c \
-       cpu-w65.c \
-       cpu-xstormy16.c \
-       cpu-xtensa.c \
-       cpu-z8k.c
+ALL_MACHINES =         cpu-a29k.lo     cpu-alpha.lo    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      cpu-fr30.lo     cpu-frv.lo      cpu-h8300.lo    cpu-h8500.lo    cpu-hppa.lo     cpu-ia64.lo     cpu-i370.lo     cpu-i386.lo     cpu-i860.lo     cpu-i960.lo     cpu-ip2k.lo     cpu-iq2000.lo   cpu-m32r.lo     cpu-m68hc11.lo  cpu-m68hc12.lo  cpu-m68k.lo     cpu-m88k.lo     cpu-m10200.lo   cpu-m10300.lo   cpu-mcore.lo    cpu-mips.lo     cpu-mmix.lo     cpu-msp430.lo   cpu-or32.lo     cpu-ns32k.lo    cpu-openrisc.lo         cpu-pdp11.lo    cpu-pj.lo       cpu-powerpc.lo  cpu-rs6000.lo   cpu-s390.lo     cpu-sh.lo       cpu-sparc.lo    cpu-tic30.lo    cpu-tic4x.lo    cpu-tic54x.lo   cpu-tic80.lo    cpu-v850.lo     cpu-vax.lo      cpu-we32k.lo    cpu-w65.lo      cpu-xstormy16.lo        cpu-xtensa.lo   cpu-z8k.lo
+
+
+ALL_MACHINES_CFILES =          cpu-a29k.c      cpu-alpha.c     cpu-arc.c       cpu-arm.c       cpu-avr.c       cpu-cris.c      cpu-cr16c.c     cpu-crx.c       cpu-d10v.c      cpu-d30v.c      cpu-dlx.c       cpu-fr30.c      cpu-frv.c       cpu-h8300.c     cpu-h8500.c     cpu-hppa.c      cpu-ia64.c      cpu-i370.c      cpu-i386.c      cpu-i860.c      cpu-i960.c      cpu-ip2k.c      cpu-iq2000.c    cpu-m32r.c      cpu-m68hc11.c   cpu-m68hc12.c   cpu-m68k.c      cpu-m88k.c      cpu-m10200.c    cpu-m10300.c    cpu-mcore.c     cpu-mips.c      cpu-mmix.c      cpu-msp430.c    cpu-or32.c      cpu-ns32k.c     cpu-openrisc.c  cpu-pdp11.c     cpu-pj.c        cpu-powerpc.c   cpu-rs6000.c    cpu-s390.c      cpu-sh.c        cpu-sparc.c     cpu-tic30.c     cpu-tic4x.c     cpu-tic54x.c    cpu-tic80.c     cpu-v850.c      cpu-vax.c       cpu-we32k.c     cpu-w65.c       cpu-xstormy16.c         cpu-xtensa.c    cpu-z8k.c
 
 
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
-BFD32_BACKENDS = \
-       aout-adobe.lo \
-       aout-arm.lo \
-       aout-cris.lo \
-       aout-ns32k.lo \
-       aout-sparcle.lo \
-       aout-tic30.lo \
-       aout0.lo \
-       aout32.lo \
-       armnetbsd.lo \
-       bout.lo \
-       cf-i386lynx.lo \
-       cf-m68klynx.lo \
-       cf-sparclynx.lo \
-       coff-a29k.lo \
-       coff-apollo.lo \
-       coff-arm.lo \
-       coff-aux.lo \
-       coff-h8300.lo \
-       coff-h8500.lo \
-       coff-i386.lo \
-       coff-go32.lo \
-       coff-i860.lo \
-       coff-i960.lo \
-       coff-m68k.lo \
-       coff-m88k.lo \
-       coff-mips.lo \
-       coff-or32.lo \
-       coff-rs6000.lo \
-       coff-sh.lo \
-       coff-sparc.lo \
-       coff-stgo32.lo \
-       coff-svm68k.lo \
-       coff-tic30.lo \
-       coff-tic4x.lo \
-       coff-tic54x.lo \
-       coff-tic80.lo \
-       coff-u68k.lo \
-       coff-we32k.lo \
-       coff-w65.lo \
-       coff-z8k.lo \
-       cofflink.lo \
-       dwarf1.lo \
-       ecoff.lo \
-       ecofflink.lo \
-       efi-app-ia32.lo \
-       elf.lo \
-       elf32-am33lin.lo \
-       elf32-arc.lo \
-       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 \
-       elf32-fr30.lo \
-       elf32-frv.lo \
-       elf32-gen.lo \
-       elf32-h8300.lo \
-       elf32-hppa.lo \
-       elf32-i370.lo \
-       elf32-i386.lo \
-       elf32-i860.lo \
-       elf32-i960.lo \
-       elf32-ia64.lo \
-       elf32-ip2k.lo \
-       elf32-iq2000.lo \
-       elf32-m32r.lo \
-       elf32-m68hc11.lo \
-       elf32-m68hc12.lo \
-       elf32-m68hc1x.lo \
-       elf32-m68k.lo \
-       elf32-m88k.lo \
-       elf-m10200.lo \
-       elf-m10300.lo \
-       elf32-mcore.lo \
-       elfxx-mips.lo \
-       elf32-mips.lo \
-       elf32-msp430.lo \
-       elf32-openrisc.lo \
-       elf32-or32.lo \
-       elf32-pj.lo \
-       elf32-ppc.lo \
-       elf32-s390.lo \
-       elf32-sh.lo \
-       elf32-sh-symbian.lo \
-       elf32-sh64.lo \
-       elf32-sh64-com.lo \
-       elf32-sparc.lo \
-       elf32-v850.lo \
-       elf32-vax.lo \
-       elf32-xstormy16.lo \
-       elf32-xtensa.lo \
-       elf32.lo \
-       elflink.lo \
-       elf-strtab.lo \
-       elf-eh-frame.lo \
-       epoc-pe-arm.lo \
-       epoc-pei-arm.lo \
-       hp300bsd.lo \
-       hp300hpux.lo \
-       som.lo \
-       i386aout.lo \
-       i386bsd.lo \
-       i386dynix.lo \
-       i386freebsd.lo \
-       i386linux.lo \
-       i386lynx.lo \
-       i386msdos.lo \
-       i386netbsd.lo \
-       i386mach3.lo \
-       i386os9k.lo \
-       ieee.lo \
-       m68k4knetbsd.lo \
-       m68klinux.lo \
-       m68klynx.lo \
-       m68knetbsd.lo \
-       m88kmach3.lo \
-       m88kopenbsd.lo \
-       mach-o.lo \
-       mipsbsd.lo \
-       newsos3.lo \
-       nlm.lo \
-       nlm32-i386.lo \
-       nlm32-sparc.lo \
-       nlm32-ppc.lo \
-       nlm32.lo \
-       ns32knetbsd.lo \
-       oasys.lo \
-       pc532-mach.lo \
-       pdp11.lo \
-       pef.lo \
-       pe-arm.lo \
-       pei-arm.lo \
-       pe-i386.lo \
-       pei-i386.lo \
-       pe-mcore.lo \
-       pei-mcore.lo \
-       pe-ppc.lo \
-       pei-ppc.lo \
-       pe-sh.lo \
-       pei-sh.lo \
-       pe-mips.lo \
-       pei-mips.lo \
-       peigen.lo \
-       ppcboot.lo \
-       reloc16.lo \
-       riscix.lo \
-       sparclinux.lo \
-       sparclynx.lo \
-       sparcnetbsd.lo \
-       sunos.lo \
-       vaxnetbsd.lo \
-       vax1knetbsd.lo \
-       vaxbsd.lo \
-       versados.lo \
-       vms.lo \
-       vms-gsd.lo \
-       vms-hdr.lo \
-       vms-misc.lo \
-       vms-tir.lo \
-       xcofflink.lo \
-       xsym.lo \
-       xtensa-isa.lo \
-       xtensa-modules.lo
-
-BFD32_BACKENDS_CFILES = \
-       aout-adobe.c \
-       aout-arm.c \
-       aout-cris.c \
-       aout-ns32k.c \
-       aout-sparcle.c \
-       aout-tic30.c \
-       aout0.c \
-       aout32.c \
-       armnetbsd.c \
-       bout.c \
-       cf-i386lynx.c \
-       cf-m68klynx.c \
-       cf-sparclynx.c \
-       coff-a29k.c \
-       coff-apollo.c \
-       coff-arm.c \
-       coff-aux.c \
-       coff-h8300.c \
-       coff-h8500.c \
-       coff-i386.c \
-       coff-i860.c \
-       coff-go32.c \
-       coff-i960.c \
-       coff-m68k.c \
-       coff-m88k.c \
-       coff-mips.c \
-       coff-or32.c \
-       coff-rs6000.c \
-       coff-sh.c \
-       coff-sparc.c \
-       coff-stgo32.c \
-       coff-svm68k.c \
-       coff-tic30.c \
-       coff-tic4x.c \
-       coff-tic54x.c \
-       coff-tic80.c \
-       coff-u68k.c \
-       coff-we32k.c \
-       coff-w65.c \
-       coff-z8k.c \
-       cofflink.c \
-       dwarf1.c \
-       ecoff.c \
-       ecofflink.c \
-       efi-app-ia32.c \
-       elf.c \
-       elf32-am33lin.c \
-       elf32-arc.c \
-       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 \
-       elf32-fr30.c \
-       elf32-frv.c \
-       elf32-gen.c \
-       elf32-h8300.c \
-       elf32-hppa.c \
-       elf32-i370.c \
-       elf32-i386.c \
-       elf32-i860.c \
-       elf32-i960.c \
-       elf32-ip2k.c \
-       elf32-iq2000.c \
-       elf32-m32r.c \
-       elf32-m68k.c \
-       elf32-m68hc11.c \
-       elf32-m68hc12.c \
-       elf32-m68hc1x.c \
-       elf32-m88k.c \
-       elf-m10200.c \
-       elf-m10300.c \
-       elf32-mcore.c \
-       elfxx-mips.c \
-       elf32-mips.c \
-       elf32-msp430.c \
-       elf32-openrisc.c \
-       elf32-or32.c \
-       elf32-pj.c \
-       elf32-ppc.c \
-       elf32-sh64.c \
-       elf32-sh64-com.c \
-       elf32-s390.c \
-       elf32-sh.c \
-       elf32-sh-symbian.c \
-       elf32-sparc.c \
-       elf32-v850.c \
-       elf32-vax.c \
-       elf32-xstormy16.c \
-       elf32-xtensa.c \
-       elf32.c \
-       elflink.c \
-       elf-strtab.c \
-       elf-eh-frame.c \
-       epoc-pe-arm.c \
-       epoc-pei-arm.c \
-       hp300bsd.c \
-       hp300hpux.c \
-       som.c \
-       i386aout.c \
-       i386bsd.c \
-       i386dynix.c \
-       i386freebsd.c \
-       i386linux.c \
-       i386lynx.c \
-       i386msdos.c \
-       i386netbsd.c \
-       i386mach3.c \
-       i386os9k.c \
-       ieee.c \
-       m68k4knetbsd.c \
-       m68klinux.c \
-       m68klynx.c \
-       m68knetbsd.c \
-       m88kmach3.c \
-       m88kopenbsd.c \
-       mach-o.c \
-       mipsbsd.c \
-       newsos3.c \
-       nlm.c \
-       nlm32-i386.c \
-       nlm32-sparc.c \
-       nlm32-ppc.c \
-       nlm32.c \
-       ns32knetbsd.c \
-       oasys.c \
-       pc532-mach.c \
-       pdp11.c \
-       pef.c \
-       pe-arm.c \
-       pei-arm.c \
-       pe-i386.c \
-       pei-i386.c \
-       pe-mcore.c \
-       pei-mcore.c \
-       pe-ppc.c \
-       pei-ppc.c \
-       pe-sh.c \
-       pei-sh.c \
-       pe-mips.c \
-       pei-mips.c \
-       ppcboot.c \
-       reloc16.c \
-       riscix.c \
-       sparclinux.c \
-       sparclynx.c \
-       sparcnetbsd.c \
-       sunos.c \
-       vaxnetbsd.c \
-       vax1knetbsd.c \
-       vaxbsd.c \
-       versados.c \
-       vms.c \
-       vms-gsd.c \
-       vms-hdr.c \
-       vms-misc.c \
-       vms-tir.c \
-       xcofflink.c \
-       xsym.c \
-       xtensa-isa.c \
-       xtensa-modules.c
+BFD32_BACKENDS =       aout-adobe.lo   aout-arm.lo     aout-cris.lo    aout-ns32k.lo   aout-sparcle.lo         aout-tic30.lo   aout0.lo        aout32.lo       armnetbsd.lo    bout.lo         cf-i386lynx.lo  cf-m68klynx.lo  cf-sparclynx.lo         coff-a29k.lo    coff-apollo.lo  coff-arm.lo     coff-aux.lo     coff-h8300.lo   coff-h8500.lo   coff-i386.lo    coff-go32.lo    coff-i860.lo    coff-i960.lo    coff-m68k.lo    coff-m88k.lo    coff-mips.lo    coff-or32.lo    coff-rs6000.lo  coff-sh.lo      coff-sparc.lo   coff-stgo32.lo  coff-svm68k.lo  coff-tic30.lo   coff-tic4x.lo   coff-tic54x.lo  coff-tic80.lo   coff-u68k.lo    coff-we32k.lo   coff-w65.lo     coff-z8k.lo     cofflink.lo     dwarf1.lo       ecoff.lo        ecofflink.lo    efi-app-ia32.lo         elf.lo  elf32-am33lin.lo        elf32-arc.lo    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    elf32-fr30.lo   elf32-frv.lo    elf32-gen.lo    elf32-h8300.lo  elf32-hppa.lo   elf32-i370.lo   elf32-i386.lo   elf32-i860.lo   elf32-i960.lo   elf32-ia64.lo   elf32-ip2k.lo   elf32-iq2000.lo         elf32-m32r.lo   elf32-m68hc11.lo        elf32-m68hc12.lo        elf32-m68hc1x.lo        elf32-m68k.lo   elf32-m88k.lo   elf-m10200.lo   elf-m10300.lo   elf32-mcore.lo  elfxx-mips.lo   elf32-mips.lo   elf32-msp430.lo         elf32-openrisc.lo       elf32-or32.lo   elf32-pj.lo     elf32-ppc.lo    elf32-s390.lo   elf32-sh.lo     elf32-sh-symbian.lo     elf32-sh64.lo   elf32-sh64-com.lo       elf32-sparc.lo  elf32-v850.lo   elf32-vax.lo    elf32-xstormy16.lo      elf32-xtensa.lo         elf32.lo        elflink.lo      elf-strtab.lo   elf-eh-frame.lo         epoc-pe-arm.lo  epoc-pei-arm.lo         hp300bsd.lo     hp300hpux.lo    som.lo  i386aout.lo     i386bsd.lo      i386dynix.lo    i386freebsd.lo  i386linux.lo    i386lynx.lo     i386msdos.lo    i386netbsd.lo   i386mach3.lo    i386os9k.lo     ieee.lo         m68k4knetbsd.lo         m68klinux.lo    m68klynx.lo     m68knetbsd.lo   m88kmach3.lo    m88kopenbsd.lo  mach-o.lo       mipsbsd.lo      newsos3.lo      nlm.lo  nlm32-i386.lo   nlm32-sparc.lo  nlm32-ppc.lo    nlm32.lo        ns32knetbsd.lo  oasys.lo        pc532-mach.lo   pdp11.lo        pef.lo  pe-arm.lo       pei-arm.lo      pe-i386.lo      pei-i386.lo     pe-mcore.lo     pei-mcore.lo    pe-ppc.lo       pei-ppc.lo      pe-sh.lo        pei-sh.lo       pe-mips.lo      pei-mips.lo     peigen.lo       ppcboot.lo      reloc16.lo      riscix.lo       sparclinux.lo   sparclynx.lo    sparcnetbsd.lo  sunos.lo        vaxnetbsd.lo    vax1knetbsd.lo  vaxbsd.lo       versados.lo     vms.lo  vms-gsd.lo      vms-hdr.lo      vms-misc.lo     vms-tir.lo      xcofflink.lo    xsym.lo         xtensa-isa.lo   xtensa-modules.lo
+
+
+BFD32_BACKENDS_CFILES =        aout-adobe.c    aout-arm.c      aout-cris.c     aout-ns32k.c    aout-sparcle.c  aout-tic30.c    aout0.c         aout32.c        armnetbsd.c     bout.c  cf-i386lynx.c   cf-m68klynx.c   cf-sparclynx.c  coff-a29k.c     coff-apollo.c   coff-arm.c      coff-aux.c      coff-h8300.c    coff-h8500.c    coff-i386.c     coff-i860.c     coff-go32.c     coff-i960.c     coff-m68k.c     coff-m88k.c     coff-mips.c     coff-or32.c     coff-rs6000.c   coff-sh.c       coff-sparc.c    coff-stgo32.c   coff-svm68k.c   coff-tic30.c    coff-tic4x.c    coff-tic54x.c   coff-tic80.c    coff-u68k.c     coff-we32k.c    coff-w65.c      coff-z8k.c      cofflink.c      dwarf1.c        ecoff.c         ecofflink.c     efi-app-ia32.c  elf.c   elf32-am33lin.c         elf32-arc.c     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     elf32-fr30.c    elf32-frv.c     elf32-gen.c     elf32-h8300.c   elf32-hppa.c    elf32-i370.c    elf32-i386.c    elf32-i860.c    elf32-i960.c    elf32-ip2k.c    elf32-iq2000.c  elf32-m32r.c    elf32-m68k.c    elf32-m68hc11.c         elf32-m68hc12.c         elf32-m68hc1x.c         elf32-m88k.c    elf-m10200.c    elf-m10300.c    elf32-mcore.c   elfxx-mips.c    elf32-mips.c    elf32-msp430.c  elf32-openrisc.c        elf32-or32.c    elf32-pj.c      elf32-ppc.c     elf32-sh64.c    elf32-sh64-com.c        elf32-s390.c    elf32-sh.c      elf32-sh-symbian.c      elf32-sparc.c   elf32-v850.c    elf32-vax.c     elf32-xstormy16.c       elf32-xtensa.c  elf32.c         elflink.c       elf-strtab.c    elf-eh-frame.c  epoc-pe-arm.c   epoc-pei-arm.c  hp300bsd.c      hp300hpux.c     som.c   i386aout.c      i386bsd.c       i386dynix.c     i386freebsd.c   i386linux.c     i386lynx.c      i386msdos.c     i386netbsd.c    i386mach3.c     i386os9k.c      ieee.c  m68k4knetbsd.c  m68klinux.c     m68klynx.c      m68knetbsd.c    m88kmach3.c     m88kopenbsd.c   mach-o.c        mipsbsd.c       newsos3.c       nlm.c   nlm32-i386.c    nlm32-sparc.c   nlm32-ppc.c     nlm32.c         ns32knetbsd.c   oasys.c         pc532-mach.c    pdp11.c         pef.c   pe-arm.c        pei-arm.c       pe-i386.c       pei-i386.c      pe-mcore.c      pei-mcore.c     pe-ppc.c        pei-ppc.c       pe-sh.c         pei-sh.c        pe-mips.c       pei-mips.c      ppcboot.c       reloc16.c       riscix.c        sparclinux.c    sparclynx.c     sparcnetbsd.c   sunos.c         vaxnetbsd.c     vax1knetbsd.c   vaxbsd.c        versados.c      vms.c   vms-gsd.c       vms-hdr.c       vms-misc.c      vms-tir.c       xcofflink.c     xsym.c  xtensa-isa.c    xtensa-modules.c
 
 
 # The .o files needed by all of the 64 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all
 # and --enable-64-bit-bfd.
-BFD64_BACKENDS = \
-       aix5ppc-core.lo \
-       aout64.lo \
-       coff-alpha.lo \
-       coff64-rs6000.lo \
-       demo64.lo \
-       efi-app-ia64.lo \
-       elf64-x86-64.lo \
-       elf64-alpha.lo \
-       elf64-hppa.lo \
-       elf64-ia64.lo \
-       elf64-gen.lo \
-       elfn32-mips.lo \
-       elf64-mips.lo \
-       elf64-mmix.lo \
-       elf64-sh64.lo \
-       elf64-ppc.lo \
-       elf64-s390.lo \
-       elf64-sparc.lo \
-       elf64.lo \
-       mmo.lo \
-       nlm32-alpha.lo \
-       nlm64.lo \
-       pepigen.lo
-
-BFD64_BACKENDS_CFILES = \
-       aix5ppc-core.c \
-       aout64.c \
-       coff-alpha.c \
-       coff64-rs6000.c \
-       demo64.c \
-       efi-app-ia64.c \
-       elf64-x86-64.c \
-       elf64-alpha.c \
-       elf64-hppa.c \
-       elf64-gen.c \
-       elfn32-mips.c \
-       elf64-mips.c \
-       elf64-mmix.c \
-       elf64-ppc.c \
-       elf64-s390.c \
-       elf64-sh64.c \
-       elf64-sparc.c \
-       elf64.c \
-       mmo.c \
-       nlm32-alpha.c \
-       nlm64.c
-
-OPTIONAL_BACKENDS = \
-       aix386-core.lo \
-       hpux-core.lo \
-       irix-core.lo \
-       lynx-core.lo \
-       osf-core.lo \
-       sco5-core.lo \
-       trad-core.lo \
-       cisco-core.lo
-
-OPTIONAL_BACKENDS_CFILES = \
-       aix386-core.c \
-       hpux-core.c \
-       irix-core.c \
-       lynx-core.c \
-       osf-core.c \
-       sco5-core.c \
-       trad-core.c \
-       cisco-core.c
-
-
-# We want to rerun configure if configure.in, config.bfd or
-# configure.host change. configure.in is needed since the version
-# number in Makefile comes from configure.in.
-CONFIG_STATUS_DEPENDENCIES = \
-       $(srcdir)/configure.in \
-       $(srcdir)/config.bfd \
-       $(srcdir)/configure.host
+BFD64_BACKENDS =       aix5ppc-core.lo         aout64.lo       coff-alpha.lo   coff64-rs6000.lo        demo64.lo       efi-app-ia64.lo         elf64-x86-64.lo         elf64-alpha.lo  elf64-hppa.lo   elf64-ia64.lo   elf64-gen.lo    elfn32-mips.lo  elf64-mips.lo   elf64-mmix.lo   elf64-sh64.lo   elf64-ppc.lo    elf64-s390.lo   elf64-sparc.lo  elf64.lo        mmo.lo  nlm32-alpha.lo  nlm64.lo        pepigen.lo
+
+
+BFD64_BACKENDS_CFILES =        aix5ppc-core.c  aout64.c        coff-alpha.c    coff64-rs6000.c         demo64.c        efi-app-ia64.c  elf64-x86-64.c  elf64-alpha.c   elf64-hppa.c    elf64-gen.c     elfn32-mips.c   elf64-mips.c    elf64-mmix.c    elf64-ppc.c     elf64-s390.c    elf64-sh64.c    elf64-sparc.c   elf64.c         mmo.c   nlm32-alpha.c   nlm64.c
+
+
+OPTIONAL_BACKENDS =    aix386-core.lo  hpux-core.lo    irix-core.lo    lynx-core.lo    osf-core.lo     sco5-core.lo    trad-core.lo    cisco-core.lo
+
+
+OPTIONAL_BACKENDS_CFILES =     aix386-core.c   hpux-core.c     irix-core.c     lynx-core.c     osf-core.c      sco5-core.c     trad-core.c     cisco-core.c
 
 
 # These are defined by configure.in:
@@ -831,36 +212,26 @@ BFD_BACKENDS = @bfd_backends@
 BFD_LIBS = @bfd_libs@
 BFD_MACHINES = @bfd_machines@
 TDEFAULTS = @tdefaults@
+
 INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
 
 # C source files that correspond to .o's.
-SOURCE_CFILES = \
-       $(BFD32_LIBS_CFILES) \
-       $(BFD64_LIBS_CFILES) \
-       $(ALL_MACHINES_CFILES) \
-       $(BFD32_BACKENDS_CFILES) \
-       $(BFD64_BACKENDS_CFILES) \
-       $(OPTIONAL_BACKENDS_CFILES)
+SOURCE_CFILES =        $(BFD32_LIBS_CFILES)    $(BFD64_LIBS_CFILES)    $(ALL_MACHINES_CFILES)  $(BFD32_BACKENDS_CFILES)        $(BFD64_BACKENDS_CFILES)        $(OPTIONAL_BACKENDS_CFILES)
+
+
+BUILD_CFILES =         elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
 
-BUILD_CFILES = \
-       elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
 
 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
-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 \
-       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 \
-       netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
-       pef.h pef-traceback.h peicode.h som.h version.h \
-       vms.h xcoff-target.h xsym.h
-
-BUILD_HFILES = \
-       bfdver.h elf32-target.h elf64-target.h targmatch.h
+
+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        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        netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h       pef.h pef-traceback.h peicode.h som.h version.h         vms.h xcoff-target.h xsym.h
+
+
+BUILD_HFILES =         bfdver.h elf32-target.h elf64-target.h targmatch.h
+
 
 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
+
 SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
@@ -869,6 +240,7 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 # BFD_MACHINES Architecture-specific routines the configured targets need.
 # COREFILE     Core file routines for a native configuration
 OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+
 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
 libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
@@ -878,112 +250,150 @@ libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
 # directory so that we don't have to convert all the programs that use
 # libbfd.a simultaneously.  This is a hack which should be removed if
 # everything else starts using libtool.  FIXME.
+
 noinst_LIBRARIES = libbfd.a
 libbfd_a_SOURCES = 
+
 BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
 LOCAL_H_DEPS = libbfd.h sysdep.h config.h
-BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
-       reloc.c syms.c bfd.c bfdio.c bfdwin.c \
-       archive.c corefile.c targets.c format.c
+
+BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c   reloc.c syms.c bfd.c bfdio.c bfdwin.c   archive.c corefile.c targets.c format.c
 
 BFD64_H_FILES = archive64.c
-LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
-       cache.c reloc.c archures.c elf.c
+LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c  cache.c reloc.c archures.c elf.c
 
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
+
 MOSTLYCLEANFILES = ofiles stamp-ofiles
-CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
-       stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+
+CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib    stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+
 
 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
-all: config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =  bfd-in3.h
+LIBRARIES =  $(noinst_LIBRARIES)
 
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libbfd_a_LIBADD = 
+libbfd_a_OBJECTS = 
+LTLIBRARIES =  $(bfdlib_LTLIBRARIES)
+
+libbfd_la_OBJECTS =  archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
+cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo \
+reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo \
+binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo \
+simple.lo archive64.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+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
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
+OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
+
+all: all-redirect
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-am--refresh:
-       @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
-             cd $(srcdir) && $(AUTOMAKE) --cygnus  \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus  Makefile'; \
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --cygnus  Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           echo ' $(SHELL) ./config.status'; \
-           $(SHELL) ./config.status;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       $(SHELL) ./config.status --recheck
+.SUFFIXES: .S .c .lo .o .obj .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+       cd $(srcdir) && $(ACLOCAL)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
        cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
-config.h: stamp-h1
+config.h: stamp-h
        @if test ! -f $@; then \
-         rm -f stamp-h1; \
-         $(MAKE) stamp-h1; \
+               rm -f stamp-h; \
+               $(MAKE) stamp-h; \
        else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
-       @rm -f stamp-h1
-       cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+            $(SHELL) ./config.status
+       @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+       @if test ! -f $@; then \
+               rm -f $(srcdir)/stamp-h.in; \
+               $(MAKE) $(srcdir)/stamp-h.in; \
+       else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
        cd $(top_srcdir) && $(AUTOHEADER)
-       rm -f stamp-h1
-       touch $@
+       @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
 
 distclean-hdr:
-       -rm -f config.h stamp-h1
-bfd-in3.h: $(top_builddir)/config.status $(srcdir)/bfd-in2.h
-       cd $(top_builddir) && $(SHELL) ./config.status $@
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
-       cd $(top_builddir) && $(SHELL) ./config.status $@
+       -rm -f config.h
+
+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
+
+mostlyclean-noinstLIBRARIES:
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 
-clean-bfdlibLTLIBRARIES:
-       -test -z "$(bfdlib_LTLIBRARIES)" || rm -f $(bfdlib_LTLIBRARIES)
-       @list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
-libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES) 
-       $(LINK) -rpath $(bfdlibdir) $(libbfd_la_LDFLAGS) $(libbfd_la_OBJECTS) $(libbfd_la_LIBADD) $(LIBS)
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+.c.o:
+       $(COMPILE) -c $<
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+       $(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+       $(COMPILE) -c $<
+
+.S.o:
+       $(COMPILE) -c $<
 
 mostlyclean-compile:
+       -rm -f *.o core *.core
        -rm -f *.$(OBJEXT)
 
+clean-compile:
+
 distclean-compile:
        -rm -f *.tab.c
 
-.c.o:
-       $(COMPILE) -c $<
-
-.c.obj:
-       $(COMPILE) -c `$(CYGPATH_W) '$<'`
+maintainer-clean-compile:
 
 .c.lo:
-       $(LTCOMPILE) -c -o $@ $<
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -992,8 +402,20 @@ clean-libtool:
        -rm -rf .libs _libs
 
 distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+
+maintainer-clean-libtool:
+
+mostlyclean-bfdlibLTLIBRARIES:
+
+clean-bfdlibLTLIBRARIES:
+       -test -z "$(bfdlib_LTLIBRARIES)" || rm -f $(bfdlib_LTLIBRARIES)
+
+distclean-bfdlibLTLIBRARIES:
+
+maintainer-clean-bfdlibLTLIBRARIES:
+
+libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
+       $(LINK) -rpath $(bfdlibdir) $(libbfd_la_LDFLAGS) $(libbfd_la_OBJECTS) $(libbfd_la_LIBADD) $(LIBS)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -1001,8 +423,13 @@ uninstall-info-am:
 # (1) if the variable is set in `config.status', edit `config.status'
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -1022,18 +449,13 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
+       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+         rev="$$subdir $$rev"; \
+         test "$$subdir" != "." || dot_seen=yes; \
        done; \
-       rev="$$rev ."; \
+       test "$$dot_seen" = "no" && rev=". $$rev"; \
        target=`echo $@ | sed s/-recursive//`; \
        for subdir in $$rev; do \
          echo "Making $$target in $$subdir"; \
@@ -1049,93 +471,132 @@ tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
        done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       mkid -fID $$unique
 tags: TAGS
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       here=`pwd` && cd $(srcdir) \
+         && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
        tags=; \
        here=`pwd`; \
-       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-         include_option=--etags-include; \
-         empty_fix=.; \
-       else \
-         include_option=--include; \
-         empty_fix=; \
-       fi; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test ! -f $$subdir/TAGS || \
-             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
-         fi; \
+   if test "$$subdir" = .; then :; else \
+           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+   fi; \
        done; \
-       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-           $$tags $$unique; \
-       fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
-       test -z "$(CTAGS_ARGS)$$tags$$unique" \
-         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-            $$tags $$unique
+       test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+         || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.in $$unique $(LISP))
 
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && cd $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) $$here
+mostlyclean-tags:
+
+clean-tags:
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       -rm -rf $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+       mkdir $(distdir)/=build
+       mkdir $(distdir)/=inst
+       dc_install_base=`cd $(distdir)/=inst && pwd`; \
+       cd $(distdir)/=build \
+         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) dist
+       -rm -rf $(distdir)
+       @banner="$(distdir).tar.gz is ready for distribution"; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"
+dist: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+dist-all: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+distdir: $(DISTFILES)
+       -rm -rf $(distdir)
+       mkdir $(distdir)
+       -chmod 777 $(distdir)
+       @for file in $(DISTFILES); do \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           cp -pr $$d/$$file $(distdir)/$$file; \
+         else \
+           test -f $(distdir)/$$file \
+           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+           || cp -p $$d/$$file $(distdir)/$$file || :; \
+         fi; \
+       done
+       for subdir in $(SUBDIRS); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           chmod 777 $(distdir)/$$subdir; \
+           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+             || exit 1; \
+         fi; \
+       done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
 check-am:
 check: check-recursive
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
-installdirs: installdirs-recursive
-installdirs-am:
-       for dir in "$(DESTDIR)$(bfdlibdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
-       done
-install: install-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-info-am: 
+install-info: install-info-recursive
+all-recursive-am: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
 install-exec: install-exec-recursive
+
+install-data-am: install-bfdlibLTLIBRARIES
 install-data: install-data-recursive
-uninstall: uninstall-recursive
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
+install: install-recursive
+uninstall-am: uninstall-bfdlibLTLIBRARIES
+uninstall: uninstall-recursive
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
+all-redirect: all-recursive-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+       $(mkinstalldirs)  $(DESTDIR)$(bfdlibdir)
+
+
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
@@ -1143,81 +604,65 @@ clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
        -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-bfdlibLTLIBRARIES clean-generic clean-libtool \
-       clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-hdr distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-bfdlibLTLIBRARIES
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf $(top_srcdir)/autom4te.cache
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
+mostlyclean-am:  mostlyclean-hdr mostlyclean-noinstLIBRARIES \
+               mostlyclean-compile mostlyclean-libtool \
+               mostlyclean-bfdlibLTLIBRARIES mostlyclean-tags \
+               mostlyclean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool
-
-pdf: pdf-recursive
+clean-am:  clean-hdr clean-noinstLIBRARIES clean-compile clean-libtool \
+               clean-bfdlibLTLIBRARIES clean-tags clean-generic \
+               mostlyclean-am
 
-pdf-am:
-
-ps: ps-recursive
+clean: clean-recursive
 
-ps-am:
+distclean-am:  distclean-hdr distclean-noinstLIBRARIES distclean-compile \
+               distclean-libtool distclean-bfdlibLTLIBRARIES \
+               distclean-tags distclean-generic clean-am
+       -rm -f libtool
 
-uninstall-am: uninstall-bfdlibLTLIBRARIES
+distclean: distclean-recursive
+       -rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-hdr \
+               maintainer-clean-noinstLIBRARIES \
+               maintainer-clean-compile maintainer-clean-libtool \
+               maintainer-clean-bfdlibLTLIBRARIES \
+               maintainer-clean-tags maintainer-clean-generic \
+               distclean-am
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
 
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
-       check-am clean clean-bfdlibLTLIBRARIES clean-generic \
-       clean-libtool clean-noinstLIBRARIES clean-recursive ctags \
-       ctags-recursive distclean distclean-compile distclean-generic \
-       distclean-hdr distclean-libtool distclean-recursive \
-       distclean-tags dvi dvi-am html html-am info info-am install \
-       install-am install-bfdlibLTLIBRARIES install-data \
-       install-data-am install-exec install-exec-am install-info \
-       install-info-am install-man install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic maintainer-clean-recursive \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
-       tags tags-recursive uninstall uninstall-am \
-       uninstall-bfdlibLTLIBRARIES uninstall-info-am
+maintainer-clean: maintainer-clean-recursive
+       -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-bfdlibLTLIBRARIES \
+distclean-bfdlibLTLIBRARIES clean-bfdlibLTLIBRARIES \
+maintainer-clean-bfdlibLTLIBRARIES uninstall-bfdlibLTLIBRARIES \
+install-bfdlibLTLIBRARIES install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-info-am \
+install-info all-recursive-am install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
@@ -1341,6 +786,8 @@ uninstall_libbfd:
        rm -f $(DESTDIR)$(bfdincludedir)/symcat.h
        rm -f $(DESTDIR)$(bfdincludedir)/bfdlink.h
 
+Makefile: $(srcdir)/configure.in
+
 # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
 DEP: dep.sed $(CFILES) $(HFILES) bfd.h
        rm -f DEP1
@@ -1432,6 +879,10 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
        $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
        touch stmp-lcoff-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/'` ;\
@@ -1729,9 +1180,9 @@ 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 $(INCDIR)/bfdlink.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.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 \
@@ -1878,10 +1329,10 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
+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 \
@@ -2112,10 +1563,9 @@ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
   libxcoff.h
 xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h
-xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/xtensa-isa-internal.h
-xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.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-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 \
@@ -2230,6 +1680,7 @@ pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \
   libcoff.h $(INCDIR)/bfdlink.h libpei.h
 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 49e8d5bac91443882ac98502f92aafde0df9b3fb..4759a9f2f6ec45d5d480507256177e78cf849188 100644 (file)
-# generated automatically by aclocal 1.9.1 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
-# This file 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-#                                                        -*- Autoconf -*-
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-
-# 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
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.9.1])])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright (C) 2001, 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, 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 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, 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.
-
-# serial 6
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../config/accross.m4)
+sinclude(../config/acx.m4)
+
+dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
+AC_DEFUN([BFD_BINARY_FOPEN],
+[AC_REQUIRE([AC_CANONICAL_TARGET])
+case "${host}" in
+changequote(,)dnl
+*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
+changequote([,])dnl
+  AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
+esac])dnl
+
+dnl Get a default for CC_FOR_BUILD to put into Makefile.
+AC_DEFUN([BFD_CC_FOR_BUILD],
+[# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+  if test "x$cross_compiling" = "xno"; then
+    CC_FOR_BUILD='$(CC)'
+  else
+    CC_FOR_BUILD=gcc
+  fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+  EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
-  $1_TRUE='#'
-  $1_FALSE=
+  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
+    [rm -f conftest*
+     echo 'int main () { return 0; }' > conftest.c
+     bfd_cv_build_exeext=
+     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+     for file in conftest.*; do
+       case $file in
+       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+       esac
+     done
+     rm -f conftest*
+     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+  EXEEXT_FOR_BUILD=""
+  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
 fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# serial 7                                             -*- Autoconf -*-
-
-# Copyright (C) 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
-# 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.
-
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl
+
+dnl See whether we need a declaration for a function.
+AC_DEFUN([BFD_NEED_DECLARATION],
+[AC_MSG_CHECKING([whether $1 must be declared])
+AC_CACHE_VAL(bfd_cv_decl_needed_$1,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],
+[char *(*pfn) = (char *(*)) $1],
+bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
+AC_MSG_RESULT($bfd_cv_decl_needed_$1)
+if test $bfd_cv_decl_needed_$1 = yes; then
+  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
+           [Define if $1 is not declared in system header files.])
+fi
+])dnl
+
+dnl Check for existence of a type $1 in sys/procfs.h
+
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
+[AC_MSG_CHECKING([for $1 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar],
+      bfd_cv_have_sys_procfs_type_$1=yes,
+      bfd_cv_have_sys_procfs_type_$1=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+            [Define if <sys/procfs.h> has $1.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
+])
 
 
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
+dnl Check for existence of member $2 in type $1 in sys/procfs.h
+
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
+[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar; void* aref = (void*) &avar.$2],
+      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
+      bfd_cv_have_sys_procfs_type_member_$1_$2=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
+            [Define if <sys/procfs.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
+])
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_DEFUN([AM_DISABLE_SHARED],)
+AC_SUBST(LIBTOOL)
+])
 
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
+sinclude(../gettext.m4)
+ifelse(yes,no,[
+AC_DEFUN([CY_WITH_NLS],)
+AC_SUBST(INTLLIBS)
+])
 
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+AC_DEFUN([AM_INSTALL_LIBBFD],
+[AC_MSG_CHECKING([whether to install libbfd])
+  AC_ARG_ENABLE(install-libbfd,
+[  --enable-install-libbfd controls installation of libbfd and related headers],
+      install_libbfd_p=$enableval,
+      if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
+        install_libbfd_p=yes
+      else
+        install_libbfd_p=no
+      fi)
+  AC_MSG_RESULT($install_libbfd_p)
+  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
+  # Need _noncanonical variables for this.
+  ACX_NONCANONICAL_HOST
+  ACX_NONCANONICAL_TARGET
+  # libbfd.a is a host library containing target dependent code
+  bfdlibdir='$(libdir)'
+  bfdincludedir='$(includedir)'
+  if test "${host}" != "${target}"; then
+    bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
+    bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
   fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+  AC_SUBST(bfdlibdir)
+  AC_SUBST(bfdincludedir)
+]
+)
 
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
       else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
       fi
     fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
 ])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/lib"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/lib"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
 ])
 
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
 ])
 
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 ])
 
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
-
-# Copyright (C) 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
-# 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.
-
-#serial 2
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  undefine([Name])
+  undefine([NAME])
+])
 
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIB[]NAME"
+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
   else
-    continue
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
   fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  undefine([Name])
+  undefine([NAME])
 ])
 
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 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, 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.
-
-# serial 7
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                            -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# Copyright (C) 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
-# 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.
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE(rpath,
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
 
-# 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.
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib$1-prefix],
+[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */lib | */lib/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux*) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/lib"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux*) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+])
 
-# serial 11
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
 
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names.  We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
   else
-    CYGPATH_W=echo
+    PATH_SEPARATOR=:
   fi
+  rm -f conf$$.sh
 fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-                            [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $1 | $1:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-
-# Copyright (C) 2001, 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, 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.
-
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-#                                                          -*- Autoconf -*-
-# Copyright (C) 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, 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.
-
-# serial 1
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot.  For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
 else
-  am__leading_dot=_
+  AC_MSG_CHECKING([for non-GNU ld])
 fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 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
-# 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.
-
-# serial 3
-
-AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-  dnl maintainer-mode is disabled by default
-  AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer],
-      USE_MAINTAINER_MODE=$enableval,
-      USE_MAINTAINER_MODE=no)
-  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
-  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
-  MAINT=$MAINTAINER_MODE_TRUE
-  AC_SUBST(MAINT)dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes.     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 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, 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.
-
-# serial 2
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-#  -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 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, 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.
-
-# serial 3
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
 else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
 fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
 ])
 
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+# Define a conditional.
 
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+  [
+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+  ]
+)
 
-# 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.
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
 
-# 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.
+# serial 1
 
-# 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.
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# 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
@@ -844,77 +1076,42 @@ AC_SUBST([mkdir_p])])
 # 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.
-
-# serial 2
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
 
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+        [AM_AUTOMAKE_VERSION([1.4-p6])])
 
 #
 # Check to make sure that the build environment is sane.
 #
 
-# Copyright (C) 1996, 1997, 2000, 2001, 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, 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.
-
-# serial 3
-
-# AM_SANITY_CHECK
-# ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
 # Just in case
 sleep 1
-echo timestamp > conftest.file
+echo timestamp > conftestfile
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t $srcdir/configure conftestfile`
    fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -924,7 +1121,7 @@ if (
 alias in your environment])
    fi
 
-   test "$[2]" = conftest.file
+   test "[$]2" = conftestfile
    )
 then
    # Ok.
@@ -933,153 +1130,65 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
+rm -f conftest*
 AC_MSG_RESULT(yes)])
 
-# AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 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, 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.
-
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# 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.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball.                            -*- Autoconf -*-
-
-# 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, 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.
-
-# serial 1
-
+AC_SUBST($1)])
 
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-#     tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-#     $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated.  We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+  case " <<$>>CONFIG_HEADERS " in
+  *" <<$>>am_file "*<<)>>
+    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
     ;;
   esac
+  am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
-  rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
+# serial 1
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
 
-m4_include([acinclude.m4])
index 913339f39d9d057274f5cbc9e52bb019d6ce379b..a1697043550357365d9d785daa5c015e63fffab1 100644 (file)
@@ -579,10 +579,6 @@ MY_bfd_final_link (abfd, info)
 #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
-#ifndef MY_bfd_is_target_special_symbol
-#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#endif
-
 #ifndef MY_bfd_free_cached_info
 #define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
 #endif
index 850c5589d5cc6a24524eafab4194da53fd7417ad..a9c06ff3b4e9e0c4d31110c6334e900f2b217254 100644 (file)
@@ -1036,11 +1036,6 @@ tic30_aout_set_arch_mach (abfd, arch, machine)
 #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
-#ifndef MY_bfd_is_target_special_symbol
-#define MY_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#endif
-
 #ifndef MY_bfd_free_cached_info
 #define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
 #endif
index 04dfe69d490951ae62d495adfe8a4373c6619d72..da4c9746c2e1fb54943afdefc1e98897a40db5fb 100644 (file)
@@ -814,10 +814,7 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int, int);
-
-void bfd_elf32_arm_set_target_relocs
-  (struct bfd_link_info *, int, char *);
+  (bfd *, struct bfd_link_info *, int, int, int);
 
 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
   (bfd *, struct bfd_link_info *);
index a25bef34f61706a589e104828c693819dce6ef39..8e732b77432d0ad9ab793ee7e8f51ab47e95a6a2 100644 (file)
@@ -821,10 +821,7 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int, int);
-
-void bfd_elf32_arm_set_target_relocs
-  (struct bfd_link_info *, int, char *);
+  (bfd *, struct bfd_link_info *, int, int, int);
 
 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
   (bfd *, struct bfd_link_info *);
@@ -1487,7 +1484,7 @@ void bfd_map_over_sections
 
 asection *bfd_sections_find_if
    (bfd *abfd,
-    bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
+    bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
     void *obj);
 
 bfd_boolean bfd_set_section_size
@@ -2618,7 +2615,6 @@ field in the instruction.  */
   BFD_RELOC_ARM_ADRL_IMMEDIATE,
   BFD_RELOC_ARM_OFFSET_IMM,
   BFD_RELOC_ARM_SHIFT_IMM,
-  BFD_RELOC_ARM_SMI,
   BFD_RELOC_ARM_SWI,
   BFD_RELOC_ARM_MULTI,
   BFD_RELOC_ARM_CP_OFF_IMM,
@@ -2653,14 +2649,6 @@ entries in .init_array sections.  */
 /* Data segment base relative address.  */
   BFD_RELOC_ARM_SBREL32,
 
-/* This reloc is used for References to RTTI dta from exception handling
-tables.  The actual definition depends on the target.  It may be a
-pc-relative or some form of GOT-indirect relocation.  */
-  BFD_RELOC_ARM_TARGET2,
-
-/* 31-bit PC relative address.  */
-  BFD_RELOC_ARM_PREL31,
-
 /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
   BFD_RELOC_SH_PCDISP8BY2,
   BFD_RELOC_SH_PCDISP12BY2,
@@ -3621,56 +3609,9 @@ to one of its own internal functions or data structures.  */
 PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
   BFD_RELOC_XTENSA_PLT,
 
-/* Xtensa relocations to mark the difference of two local symbols.
-These are only needed to support linker relaxation and can be ignored
-when not relaxing.  The field is set to the value of the difference
-assuming no relaxation.  The relocation encodes the position of the
-first symbol so the linker can determine whether to adjust the field
-value.  */
-  BFD_RELOC_XTENSA_DIFF8,
-  BFD_RELOC_XTENSA_DIFF16,
-  BFD_RELOC_XTENSA_DIFF32,
-
-/* Generic Xtensa relocations for instruction operands.  Only the slot
-number is encoded in the relocation.  The relocation applies to the
-last PC-relative immediate operand, or if there are no PC-relative
-immediates, to the last immediate operand.  */
-  BFD_RELOC_XTENSA_SLOT0_OP,
-  BFD_RELOC_XTENSA_SLOT1_OP,
-  BFD_RELOC_XTENSA_SLOT2_OP,
-  BFD_RELOC_XTENSA_SLOT3_OP,
-  BFD_RELOC_XTENSA_SLOT4_OP,
-  BFD_RELOC_XTENSA_SLOT5_OP,
-  BFD_RELOC_XTENSA_SLOT6_OP,
-  BFD_RELOC_XTENSA_SLOT7_OP,
-  BFD_RELOC_XTENSA_SLOT8_OP,
-  BFD_RELOC_XTENSA_SLOT9_OP,
-  BFD_RELOC_XTENSA_SLOT10_OP,
-  BFD_RELOC_XTENSA_SLOT11_OP,
-  BFD_RELOC_XTENSA_SLOT12_OP,
-  BFD_RELOC_XTENSA_SLOT13_OP,
-  BFD_RELOC_XTENSA_SLOT14_OP,
-
-/* Alternate Xtensa relocations.  Only the slot is encoded in the
-relocation.  The meaning of these relocations is opcode-specific.  */
-  BFD_RELOC_XTENSA_SLOT0_ALT,
-  BFD_RELOC_XTENSA_SLOT1_ALT,
-  BFD_RELOC_XTENSA_SLOT2_ALT,
-  BFD_RELOC_XTENSA_SLOT3_ALT,
-  BFD_RELOC_XTENSA_SLOT4_ALT,
-  BFD_RELOC_XTENSA_SLOT5_ALT,
-  BFD_RELOC_XTENSA_SLOT6_ALT,
-  BFD_RELOC_XTENSA_SLOT7_ALT,
-  BFD_RELOC_XTENSA_SLOT8_ALT,
-  BFD_RELOC_XTENSA_SLOT9_ALT,
-  BFD_RELOC_XTENSA_SLOT10_ALT,
-  BFD_RELOC_XTENSA_SLOT11_ALT,
-  BFD_RELOC_XTENSA_SLOT12_ALT,
-  BFD_RELOC_XTENSA_SLOT13_ALT,
-  BFD_RELOC_XTENSA_SLOT14_ALT,
-
-/* Xtensa relocations for backward compatibility.  These have all been
-replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
+/* Generic Xtensa relocations.  Only the operand number is encoded
+in the relocation.  The details are determined by extracting the
+instruction opcode.  */
   BFD_RELOC_XTENSA_OP0,
   BFD_RELOC_XTENSA_OP1,
   BFD_RELOC_XTENSA_OP2,
@@ -3828,11 +3769,6 @@ bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
 #define bfd_is_local_label_name(abfd, name) \
   BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
 
-bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
-
-#define bfd_is_target_special_symbol(abfd, sym) \
-  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
-
 #define bfd_canonicalize_symtab(abfd, location) \
   BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
 
@@ -3962,9 +3898,6 @@ struct bfd
   /* Pointer to structure which contains architecture information.  */
   const struct bfd_arch_info *arch_info;
 
-  /* Flag set if symbols from this BFD should not be exported.  */
-  bfd_boolean no_export;
-
   /* Stuff only useful for archives.  */
   void *arelt_data;
   struct bfd *my_archive;      /* The containing archive BFD.  */
@@ -4451,7 +4384,6 @@ typedef struct bfd_target
   NAME##_print_symbol, \
   NAME##_get_symbol_info, \
   NAME##_bfd_is_local_label_name, \
-  NAME##_bfd_is_target_special_symbol, \
   NAME##_get_lineno, \
   NAME##_find_nearest_line, \
   NAME##_bfd_make_debug_symbol, \
@@ -4470,7 +4402,7 @@ typedef struct bfd_target
     (bfd *, struct bfd_symbol *, symbol_info *);
 #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
-  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
+
   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
   bfd_boolean (*_bfd_find_nearest_line)
     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
index 0126a9f3e3abf6ff51dae827c14e4e9d8879239f..8ebc81a9953d33f30d24fdeede90874eeb04167f 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -133,9 +133,6 @@ CODE_FRAGMENT
 .  {* Pointer to structure which contains architecture information.  *}
 .  const struct bfd_arch_info *arch_info;
 .
-.  {* Flag set if symbols from this BFD should not be exported.  *}
-.  bfd_boolean no_export;
-.
 .  {* Stuff only useful for archives.  *}
 .  void *arelt_data;
 .  struct bfd *my_archive;      {* The containing archive BFD.  *}
index 45286726c0a2712cf0db1355a598c0220e140e81..4335a28ed3b2a7fb03d0942318409816883b8449 100644 (file)
@@ -234,7 +234,6 @@ binary_get_symbol_info (ignore_abfd, symbol, ret)
   bfd_symbol_info (symbol, ret);
 }
 
-#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define binary_get_lineno _bfd_nosymbols_get_lineno
 #define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
index d1df0a2d4256582b1a75190a1855a3c28068ed12..9fe9cbd3714372c8cf7e718e7032cf41f01c41ee 100644 (file)
@@ -4169,7 +4169,6 @@ const bfd_target rs6000coff_vec =
     coff_print_symbol,
     coff_get_symbol_info,
     _bfd_xcoff_is_local_label_name,
-    coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
     coff_bfd_make_debug_symbol,
@@ -4416,7 +4415,6 @@ const bfd_target pmac_xcoff_vec =
     coff_print_symbol,
     coff_get_symbol_info,
     _bfd_xcoff_is_local_label_name,
-    coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
     coff_bfd_make_debug_symbol,
index b33658a885441ecd4b3f3c64f7bfdf6ebd667957..0e24adb1513f61354232d074c5abdff7807cd3ce 100644 (file)
@@ -2710,7 +2710,6 @@ const bfd_target rs6000coff64_vec =
     coff_print_symbol,
     coff_get_symbol_info,
     _bfd_xcoff_is_local_label_name,
-    coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
     coff_bfd_make_debug_symbol,
@@ -2958,7 +2957,6 @@ const bfd_target aix5coff64_vec =
     coff_print_symbol,
     coff_get_symbol_info,
     _bfd_xcoff_is_local_label_name,
-    coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
     coff_bfd_make_debug_symbol,
index 7bfdc6b1754e4c64330098b23ea28f86a1a17788..51d00c63e0378759ab2f7c0362d5f0d5492ebfe2 100644 (file)
@@ -3243,7 +3243,7 @@ coff_compute_section_file_positions (abfd)
 #ifdef COFF_PAGE_SIZE
       if ((abfd->flags & D_PAGED) != 0
          && (current->flags & SEC_ALLOC) != 0)
-       sofar += (current->vma - (bfd_vma) sofar) % page_size;
+       sofar += (current->vma - sofar) % page_size;
 #endif
       current->filepos = sofar;
 
@@ -5547,10 +5547,6 @@ static const bfd_coff_backend_data ticoff1_swap_table =
 #define coff_bfd_is_local_label_name       _bfd_coff_is_local_label_name
 #endif
 
-#ifndef coff_bfd_is_target_special_symbol
-#define coff_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#endif
-
 #ifndef coff_read_minisymbols
 #define coff_read_minisymbols              _bfd_generic_read_minisymbols
 #endif
index 549397b1ba10d70faee29171775bf5e2b78c9c90..d4e0e604abb521fae73878a4672684acd9b486c7 100644 (file)
@@ -47,38 +47,38 @@ esac
 
 targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 case "${targ_cpu}" in
-alpha*)                 targ_archs=bfd_alpha_arch ;;
-arm*)           targ_archs=bfd_arm_arch ;;
-c30*)           targ_archs=bfd_tic30_arch ;;
-c4x*)           targ_archs=bfd_tic4x_arch ;;
-c54x*)          targ_archs=bfd_tic54x_arch ;;
-crx*)           targ_archs=bfd_crx_arch ;;
+alpha*)          targ_archs=bfd_alpha_arch ;;
+arm*)           targ_archs=bfd_arm_arch ;;
+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 ;;
-i370)           targ_archs=bfd_i370_arch ;;
+hppa*)          targ_archs=bfd_hppa_arch ;;
+i[3-7]86)       targ_archs=bfd_i386_arch ;;
+i370)            targ_archs=bfd_i370_arch ;;
 m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;;
 m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;;
-m68*)           targ_archs=bfd_m68k_arch ;;
-m88*)           targ_archs=bfd_m88k_arch ;;
-mips*)          targ_archs=bfd_mips_arch ;;
+m68*)           targ_archs=bfd_m68k_arch ;;
+m88*)           targ_archs=bfd_m88k_arch ;;
+mips*)          targ_archs=bfd_mips_arch ;;
 or32*)          targ_archs=bfd_or32_arch ;;
-pdp11*)                 targ_archs=bfd_pdp11_arch ;;
-pj*)            targ_archs="bfd_pj_arch bfd_i386_arch";;
-powerpc*)       targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
-rs6000)                 targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
-s390*)          targ_archs=bfd_s390_arch ;;
-sh*)            targ_archs=bfd_sh_arch ;;
-sparc*)                 targ_archs=bfd_sparc_arch ;;
-strongarm*)     targ_archs=bfd_arm_arch ;;
-thumb*)                 targ_archs=bfd_arm_arch ;;
-v850*)          targ_archs=bfd_v850_arch ;;
-x86_64)                 targ_archs=bfd_i386_arch ;;
-xscale*)        targ_archs=bfd_arm_arch ;;
-xtensa*)        targ_archs=bfd_xtensa_arch ;;
-z8k*)           targ_archs=bfd_z8k_arch ;;
-am33_2.0)       targ_archs=bfd_mn10300_arch ;;
-*)              targ_archs=bfd_${targ_cpu}_arch ;;
+pdp11*)                 targ_archs=bfd_pdp11_arch ;;
+pj*)            targ_archs="bfd_pj_arch bfd_i386_arch";;
+powerpc*)        targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
+rs6000)                 targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
+s390*)           targ_archs=bfd_s390_arch ;;
+sh*)             targ_archs=bfd_sh_arch ;;
+sparc*)          targ_archs=bfd_sparc_arch ;;
+strongarm*)      targ_archs=bfd_arm_arch ;;
+thumb*)                 targ_archs=bfd_arm_arch ;;
+v850*)          targ_archs=bfd_v850_arch ;;
+x86_64)          targ_archs=bfd_i386_arch ;;
+xscale*)         targ_archs=bfd_arm_arch ;;
+xtensa*)         targ_archs=bfd_xtensa_arch ;;
+z8k*)           targ_archs=bfd_z8k_arch ;;
+am33_2.0)        targ_archs=bfd_mn10300_arch ;;
+*)              targ_archs=bfd_${targ_cpu}_arch ;;
 esac
 
 
@@ -416,7 +416,7 @@ case "${targ}" in
     ;;
 #endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */
 
-  i370-*-*)
+  i370-*-*) 
     targ_defvec=bfd_elf32_i370_vec
     targ_selvecs="bfd_elf32_i370_vec"
     ;;
@@ -424,18 +424,12 @@ case "${targ}" in
     targ_defvec=i386coff_vec
     targ_selvecs=bfd_elf32_i386_vec
     ;;
-  i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | \
+  i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | i[3-7]86-*-solaris2* | \
   i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \
   i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*)
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386coff_vec
     ;;
-  i[3-7]86-*-solaris2*)
-    targ_defvec=bfd_elf32_i386_vec
-    targ_selvecs=i386coff_vec
-    targ64_selvecs=bfd_elf64_x86_64_vec
-    want64=true
-    ;;
   i[3-7]86-*-kaos*)
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=bfd_elf32_i386_vec
@@ -509,7 +503,7 @@ case "${targ}" in
     targ_selvecs="bfd_elf32_i386_vec i386bsd_vec"
     targ_underscore=yes
     ;;
-  i[3-7]86-*-openbsd*)
+  i[3-7]86-*-openbsd*) 
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386netbsd_vec
     ;;
@@ -640,12 +634,12 @@ case "${targ}" in
     targ_defvec=bfd_elf32_m32rlelin_vec
     targ_selvecs="bfd_elf32_m32rlin_vec  bfd_elf32_m32rlelin_vec"
     ;;
-
+                                                                                
   m32r*-*-linux*)
     targ_defvec=bfd_elf32_m32rlin_vec
     targ_selvecs="bfd_elf32_m32rlin_vec  bfd_elf32_m32rlelin_vec"
     ;;
-
+                                                                                
   m32r*le-*-*)
     targ_defvec=bfd_elf32_m32rle_vec
     targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec"
@@ -729,7 +723,7 @@ case "${targ}" in
     targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
     targ_underscore=yes
     ;;
-  m68*-*-netbsdelf*)
+  m68*-*-netbsdelf*) 
     targ_defvec=bfd_elf32_m68k_vec
     targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
     ;;
@@ -965,7 +959,7 @@ case "${targ}" in
     targ_defvec=rs6000coff_vec
     targ64_selvecs=rs6000coff64_vec
     case "${targ}" in
-       *-*-aix4.[3456789]* | *-*-aix[56789]*)
+        *-*-aix4.[3456789]* | *-*-aix[56789]*)
        want64=true;;
        *)
        targ_cflags=-DSMALL_ARCHIVE;;
@@ -1010,7 +1004,7 @@ case "${targ}" in
     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"
@@ -1126,7 +1120,7 @@ case "${targ}" in
     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"
index f249bb25c3c74b2db2297360a50714ddd54b356b..48d6ca637e48ccad9c336bfd0d1df20302e1168f 100755 (executable)
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S STRIP ac_ct_STRIP LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -850,8 +850,6 @@ if test -n "$ac_init_help"; then
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
   --enable-shared=PKGS  build shared libraries default=no
   --enable-static=PKGS  build static libraries default=yes
   --enable-fast-install=PKGS  optimize for fast installation default=yes
@@ -860,8 +858,8 @@ Optional Features:
   --enable-targets        alternative target configurations
   --enable-commonbfdlib   build shared BFD/opcodes/libiberty library
   --enable-build-warnings Enable build-time compiler warnings if gcc is used
-  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer
   --enable-install-libbfd controls installation of libbfd and related headers
   --disable-nls           do not use Native Language Support
 
@@ -2360,13 +2358,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for library containing strerror" >&5
-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
-if test "${ac_cv_search_strerror+set}" = set; then
+
+        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_strerror=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -2411,83 +2410,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_strerror="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_strerror" = no; then
-  for ac_lib in cposix; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strerror ();
-int
-main ()
-{
-strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 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_exeext'
-  { (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
-  ac_cv_search_strerror="-l$ac_lib"
-break
+  ac_cv_lib_cposix_strerror=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_cposix_strerror=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
+LIBS=$ac_check_lib_save_LIBS
 fi
-LIBS=$ac_func_search_save_LIBS
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
+  LIBS="$LIBS -lcposix"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
-echo "${ECHO_T}$ac_cv_search_strerror" >&6
-if test "$ac_cv_search_strerror" != no; then
-  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
 
-fi
 
 
-am__api_version="1.9"
+
+am__api_version="1.4"
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -2571,21 +2514,20 @@ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
 # Just in case
 sleep 1
-echo timestamp > conftest.file
+echo timestamp > conftestfile
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t $srcdir/configure conftestfile`
    fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -2598,7 +2540,7 @@ alias in your environment" >&2;}
    { (exit 1); exit 1; }; }
    fi
 
-   test "$2" = conftest.file
+   test "$2" = conftestfile
    )
 then
    # Ok.
@@ -2610,6 +2552,7 @@ echo "$as_me: error: newly created file is older than distributed files!
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
+rm -f conftest*
 echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 test "$program_prefix" != NONE &&
@@ -2625,92 +2568,6 @@ _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-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 "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$AWK" && break
-done
-
 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
@@ -2740,103 +2597,17 @@ echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-          ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
 
+PACKAGE=bfd
 
+VERSION=2.15.91
 
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=bfd
- VERSION=2.15.93
-
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
 _ACEOF
@@ -2846,234 +2617,86 @@ cat >>confdefs.h <<_ACEOF
 #define VERSION "$VERSION"
 _ACEOF
 
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # 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 "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+missing_dir=`cd $ac_aux_dir && pwd`
+echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
+echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
+# 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.
+if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal-${am__api_version}
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
+   ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+echo "$as_me:$LINENO: checking for working autoconf" >&5
+echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
+# 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.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
-  STRIP=$ac_ct_STRIP
+echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
+echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
+# 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.
+if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake-${am__api_version}
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
+   AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
 
-
-
-depcc="$CC"   am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working autoheader" >&5
+echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
+# 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.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-
-
-if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
+echo "$as_me:$LINENO: checking for working makeinfo" >&5
+echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
+# 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.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
 
 
-
 if test -n "$ac_tool_prefix"; then
   # 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
@@ -3974,7 +3597,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3977 "configure"' > conftest.$ac_ext
+  echo '#line 3600 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4284,8 +3907,11 @@ if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then
 fi
 
 
+
           ac_config_headers="$ac_config_headers config.h:config.in"
 
+          ac_config_commands="$ac_config_commands default-1"
+
 
 if test -z "$target" ; then
     { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5
@@ -4313,7 +3939,6 @@ else
   MAINTAINER_MODE_TRUE='#'
   MAINTAINER_MODE_FALSE=
 fi
-
   MAINT=$MAINTAINER_MODE_TRUE
 
 
@@ -4356,7 +3981,6 @@ else
   INSTALL_LIBBFD_TRUE='#'
   INSTALL_LIBBFD_FALSE=
 fi
-
   # Need _noncanonical variables for this.
 
 
@@ -12717,34 +12341,6 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${INSTALL_LIBBFD_TRUE}" && test -z "${INSTALL_LIBBFD_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBBFD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_LIBBFD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -13178,7 +12774,7 @@ cat >>$CONFIG_STATUS <<_ACEOF
 # INIT-COMMANDS section.
 #
 
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
 
 
 _ACEOF
@@ -13194,7 +12790,7 @@ do
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
   "bfd-in3.h" ) CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;;
   "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
@@ -13304,7 +12900,6 @@ s,@OBJEXT@,$OBJEXT,;t t
 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
 s,@PACKAGE@,$PACKAGE,;t t
 s,@VERSION@,$VERSION,;t t
 s,@ACLOCAL@,$ACLOCAL,;t t
@@ -13312,31 +12907,14 @@ s,@AUTOCONF@,$AUTOCONF,;t t
 s,@AUTOMAKE@,$AUTOMAKE,;t t
 s,@AUTOHEADER@,$AUTOHEADER,;t t
 s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
 s,@AR@,$AR,;t t
 s,@ac_ct_AR@,$ac_ct_AR,;t t
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 s,@LN_S@,$LN_S,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
 s,@LIBTOOL@,$LIBTOOL,;t t
 s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
 s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
@@ -13854,28 +13432,6 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
     cat $tmp/config.h
     rm -f $tmp/config.h
   fi
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $ac_file | $ac_file:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X$ac_file : 'X\(//\)[^/]' \| \
-        X$ac_file : 'X\(//\)$' \| \
-        X$ac_file : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`/stamp-h$_am_stamp_count
 done
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -13992,91 +13548,7 @@ esac
   { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
 echo "$as_me: executing $ac_dest commands" >&6;}
   case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
- ;;
+    default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
     default ) sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile ;;
   esac
 done
index cc8afcfc6faa52416dd4cf0d65edc1ae1e2ebf1a..7e3fa454ce00cd40657e846d47e7bc903b0989a7 100644 (file)
@@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
 AC_CANONICAL_TARGET
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.15.93)
+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.
index 895568de2232bcf237069e7bb76e15a0b85ef0cf..272c7196242f762da0ec7b5634cf0791f4407fdd 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD support for the Intel 386 architecture.
-   Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004
+   Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -22,22 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 
-const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x86_64_intel_syntax,
-  "i386:intel",
-  "i386:x86-64:intel",
-  3,
-  FALSE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  0
-};
-
 const bfd_arch_info_type bfd_i386_arch_intel_syntax =
 {
   32,  /* 32 bits in a word */
@@ -50,11 +34,25 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax =
   3,
   TRUE,
   bfd_default_compatible,
-  bfd_default_scan,
-  &bfd_x86_64_arch_intel_syntax
+  bfd_default_scan ,
+  0,
 };
-
-const bfd_arch_info_type i8086_arch =
+const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
+{
+  64, /* 64 bits in a word */
+  64, /* 64 bits in an address */
+  8,  /* 8 bits in a byte */
+  bfd_arch_i386,
+  bfd_mach_x86_64_intel_syntax,
+  "i386:intel",
+  "i386:x86-64:intel",
+  3,
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan ,
+  &bfd_i386_arch_intel_syntax,
+};
+static const bfd_arch_info_type i8086_arch =
 {
   32,  /* 32 bits in a word */
   32,  /* 32 bits in an address (well, not really) */
@@ -66,8 +64,8 @@ const bfd_arch_info_type i8086_arch =
   3,
   FALSE,
   bfd_default_compatible,
-  bfd_default_scan,
-  &bfd_i386_arch_intel_syntax
+  bfd_default_scan ,
+  &bfd_x86_64_arch_intel_syntax,
 };
 
 const bfd_arch_info_type bfd_x86_64_arch =
@@ -80,10 +78,10 @@ const bfd_arch_info_type bfd_x86_64_arch =
   "i386",
   "i386:x86-64",
   3,
-  FALSE,
+  TRUE,
   bfd_default_compatible,
-  bfd_default_scan,
-  &i8086_arch
+  bfd_default_scan ,
+  &i8086_arch,
 };
 
 const bfd_arch_info_type bfd_i386_arch =
@@ -98,6 +96,6 @@ const bfd_arch_info_type bfd_i386_arch =
   3,
   TRUE,
   bfd_default_compatible,
-  bfd_default_scan,
+  bfd_default_scan ,
   &bfd_x86_64_arch
 };
index c340ff0527cc1fcab8687c7a15b980217807f106..cc57b2bb7a50af0280ff457ad3df8ac44f985987 100644 (file)
@@ -1,14 +1,3 @@
-2004-09-19  H.J. Lu  <hongjiu.lu@intel.com>
-
-       * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
-       (bfd.info): Rename the target to ...
-       ($(srcdir)/bfd.info): This.
-       * Makefile.in: Regenerated.
-
-2004-09-17  Alan Modra  <amodra@bigpond.net.au>
-
-       * Makefile.in: Regenerate.
-
 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
 
        * bfdint.texi: Remove all mention of elflink.h.
index 65d034502f12996a544ac2e78e7fd5889ecab613..4aaa341807ce56134d768735d556fba5fd3a36af 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AUTOMAKE_OPTIONS = 1.9 cygnus
+AUTOMAKE_OPTIONS = cygnus
 
 DOCFILES = aoutx.texi  archive.texi archures.texi \
        bfdt.texi  cache.texi coffcode.texi \
@@ -62,7 +62,7 @@ chew.o: chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-$(srcdir)/bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
index b36bec4795df4e7d6263fe7cbfe9a21cc5a5d32a..9f064895a27725dc20755113ba3b8349bf7d4973 100644 (file)
@@ -1,8 +1,6 @@
-# Makefile.in generated by automake 1.9.1 from Makefile.am.
-# @configure_input@
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  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.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-@SET_MAKE@
+
+SHELL = @SHELL@
+
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+
 top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
 INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = @build@
+host_alias = @host_alias@
 host_triplet = @host@
-target_triplet = @target@
-subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/../config/accross.m4 \
-       $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../libtool.m4 \
-       $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-INFO_DEPS = $(srcdir)/bfd.info
-TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
-am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
-DVIS = bfd.dvi
-PDFS = bfd.pdf
-PSS = bfd.ps
-HTMLS = bfd.html
-TEXINFOS = bfd.texinfo
-TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
-             echo $(top_srcdir)/../texinfo/util/texi2dvi; \
-           else \
-             echo texi2dvi; \
-           fi`
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
 AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
+AS = @AS@
 BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
 BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
 BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
@@ -86,64 +69,45 @@ BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
 CATALOGS = @CATALOGS@
 CATOBJEXT = @CATOBJEXT@
 CC = @CC@
-CCDEPMODE = @CCDEPMODE@
 CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
 COREFILE = @COREFILE@
 COREFLAG = @COREFLAG@
 CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
 DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+DLLTOOL = @DLLTOOL@
 EXEEXT = @EXEEXT@
 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
+GNATBIND = @GNATBIND@
 GT_NO = @GT_NO@
 GT_YES = @GT_YES@
+HAVE_LIB = @HAVE_LIB@
 HDEFINES = @HDEFINES@
 INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@
-INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INSTOBJEXT = @INSTOBJEXT@
 INTLDEPS = @INTLDEPS@
 INTLLIBS = @INTLLIBS@
 INTLOBJS = @INTLOBJS@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
+LIB = @LIB@
 LIBTOOL = @LIBTOOL@
+LN = @LN@
 LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
+LTLIB = @LTLIB@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
 MKINSTALLDIRS = @MKINSTALLDIRS@
 MSGFMT = @MSGFMT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
 POFILES = @POFILES@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
 STRIP = @STRIP@
 TDEFINES = @TDEFINES@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
@@ -152,19 +116,7 @@ VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WIN32LDFLAGS = @WIN32LDFLAGS@
 WIN32LIBADD = @WIN32LIBADD@
-XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
 all_backends = @all_backends@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
 bfd_backends = @bfd_backends@
 bfd_default_target_size = @bfd_default_target_size@
 bfd_file_ptr = @bfd_file_ptr@
@@ -173,308 +125,248 @@ bfd_machines = @bfd_machines@
 bfd_ufile_ptr = @bfd_ufile_ptr@
 bfdincludedir = @bfdincludedir@
 bfdlibdir = @bfdlibdir@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
+build_noncanonical = @build_noncanonical@
+build_subdir = @build_subdir@
+do_compare = @do_compare@
 host_noncanonical = @host_noncanonical@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
+host_subdir = @host_subdir@
 l = @l@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
+ncn_cv_ = @ncn_cv_@
 target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_vendor = @target_vendor@
+target_subdir = @target_subdir@
 tdefaults = @tdefaults@
 wordsize = @wordsize@
-AUTOMAKE_OPTIONS = 1.9 cygnus
-DOCFILES = aoutx.texi  archive.texi archures.texi \
-       bfdt.texi  cache.texi coffcode.texi \
-       core.texi elf.texi elfcode.texi  format.texi \
-       libbfd.texi bfdwin.texi bfdio.texi \
-       opncls.texi  reloc.texi  section.texi  \
-       syms.texi  targets.texi init.texi hash.texi linker.texi \
-       mmo.texi
-
-PROTOS = archive.p archures.p bfd.p \
-        core.p format.p \
-       bfdio.p bfdwin.p \
-       libbfd.p opncls.p reloc.p \
-       section.p syms.p targets.p  \
-       format.p  core.p init.p
+
+AUTOMAKE_OPTIONS = cygnus
+
+DOCFILES = aoutx.texi  archive.texi archures.texi      bfdt.texi  cache.texi coffcode.texi     core.texi elf.texi elfcode.texi  format.texi    libbfd.texi bfdwin.texi bfdio.texi      opncls.texi  reloc.texi  section.texi   syms.texi  targets.texi init.texi hash.texi linker.texi         mmo.texi
+
+
+PROTOS = archive.p archures.p bfd.p     core.p format.p        bfdio.p bfdwin.p        libbfd.p opncls.p reloc.p       section.p syms.p targets.p      format.p  core.p init.p
+
 
 IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip
 
 # SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction 
 # between VPATH and suffix rules.  If you use GNU Make, perhaps other Makes,
 # you don't need these three:
-SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c \
-       $(srcdir)/../archures.c $(srcdir)/../bfd.c \
-       $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-       $(srcdir)/../cache.c $(srcdir)/../coffcode.h \
-       $(srcdir)/../corefile.c $(srcdir)/../elf.c \
-       $(srcdir)/../elfcode.h  $(srcdir)/../format.c \
-       $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
-       $(srcdir)/../reloc.c  $(srcdir)/../section.c \
-       $(srcdir)/../syms.c  $(srcdir)/../targets.c \
-       $(srcdir)/../hash.c $(srcdir)/../linker.c \
-       $(srcdir)/../mmo.c
-
-SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
-       $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
-       $(srcdir)/../format.c $(srcdir)/../libbfd.c \
-       $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-       $(srcdir)/../opncls.c $(srcdir)/../reloc.c \
-       $(srcdir)/../section.c $(srcdir)/../syms.c \
-       $(srcdir)/../targets.c $(srcdir)/../init.c
-
-SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
-       $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-       $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
-       $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
-       $(srcdir)/../init.c
+SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c  $(srcdir)/../archures.c $(srcdir)/../bfd.c      $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c      $(srcdir)/../cache.c $(srcdir)/../coffcode.h    $(srcdir)/../corefile.c $(srcdir)/../elf.c      $(srcdir)/../elfcode.h  $(srcdir)/../format.c   $(srcdir)/../libbfd.c $(srcdir)/../opncls.c     $(srcdir)/../reloc.c  $(srcdir)/../section.c    $(srcdir)/../syms.c  $(srcdir)/../targets.c     $(srcdir)/../hash.c $(srcdir)/../linker.c       $(srcdir)/../mmo.c
+
+
+SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c       $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c      $(srcdir)/../format.c $(srcdir)/../libbfd.c     $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c      $(srcdir)/../opncls.c $(srcdir)/../reloc.c      $(srcdir)/../section.c $(srcdir)/../syms.c      $(srcdir)/../targets.c $(srcdir)/../init.c
+
+
+SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c  $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c      $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c   $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c         $(srcdir)/../init.c
+
 
 TEXIDIR = $(srcdir)/../../texinfo/fsf
+
 info_TEXINFOS = bfd.texinfo
+
 MKDOC = chew$(EXEEXT_FOR_BUILD)
-LIBBFD_H_DEP = \
-       $(srcdir)/../libbfd-in.h        \
-       $(srcdir)/../init.c             \
-       $(srcdir)/../libbfd.c           \
-       $(srcdir)/../bfdio.c            \
-       $(srcdir)/../bfdwin.c           \
-       $(srcdir)/../cache.c            \
-       $(srcdir)/../reloc.c            \
-       $(srcdir)/../archures.c         \
-       $(srcdir)/../elf.c              \
-       $(srcdir)/header.sed            \
-       $(srcdir)/proto.str             \
-       $(MKDOC)
-
-LIBCOFF_H_DEP = \
-       $(srcdir)/../libcoff-in.h       \
-       $(srcdir)/../coffcode.h         \
-       $(srcdir)/header.sed            \
-       $(srcdir)/proto.str             \
-       $(MKDOC)
-
-BFD_H_DEP = \
-       $(srcdir)/../bfd-in.h           \
-       $(srcdir)/../init.c             \
-       $(srcdir)/../opncls.c           \
-       $(srcdir)/../libbfd.c           \
-       $(srcdir)/../bfdio.c            \
-       $(srcdir)/../bfdwin.c           \
-       $(srcdir)/../section.c          \
-       $(srcdir)/../archures.c         \
-       $(srcdir)/../reloc.c            \
-       $(srcdir)/../syms.c             \
-       $(srcdir)/../bfd.c              \
-       $(srcdir)/../archive.c          \
-       $(srcdir)/../corefile.c         \
-       $(srcdir)/../targets.c          \
-       $(srcdir)/../format.c           \
-       $(srcdir)/../linker.c           \
-       $(srcdir)/../simple.c           \
-       $(srcdir)/header.sed            \
-       $(srcdir)/proto.str             \
-       $(srcdir)/../version.h          \
-       $(MKDOC)
+
+LIBBFD_H_DEP =         $(srcdir)/../libbfd-in.h                $(srcdir)/../init.c                     $(srcdir)/../libbfd.c                   $(srcdir)/../bfdio.c                    $(srcdir)/../bfdwin.c                   $(srcdir)/../cache.c                    $(srcdir)/../reloc.c                    $(srcdir)/../archures.c                 $(srcdir)/../elf.c                      $(srcdir)/header.sed                    $(srcdir)/proto.str                     $(MKDOC)
+
+
+LIBCOFF_H_DEP =        $(srcdir)/../libcoff-in.h               $(srcdir)/../coffcode.h                 $(srcdir)/header.sed                    $(srcdir)/proto.str                     $(MKDOC)
+
+
+BFD_H_DEP =    $(srcdir)/../bfd-in.h                   $(srcdir)/../init.c                     $(srcdir)/../opncls.c                   $(srcdir)/../libbfd.c                   $(srcdir)/../bfdio.c                    $(srcdir)/../bfdwin.c                   $(srcdir)/../section.c                  $(srcdir)/../archures.c                 $(srcdir)/../reloc.c                    $(srcdir)/../syms.c                     $(srcdir)/../bfd.c                      $(srcdir)/../archive.c                  $(srcdir)/../corefile.c                 $(srcdir)/../targets.c                  $(srcdir)/../format.c                   $(srcdir)/../linker.c                   $(srcdir)/../simple.c                   $(srcdir)/header.sed                    $(srcdir)/proto.str                     $(srcdir)/../version.h                  $(MKDOC)
+
 
 noinst_TEXINFOS = bfdint.texi
+
 MOSTLYCLEANFILES = $(MKDOC) *.o
+
 CLEANFILES = s-* *.p *.ip
+
 DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
+
 MAINTAINERCLEANFILES = $(DOCFILES)
-all: all-am
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
+INFO_DEPS = bfd.info
+DVIS = bfd.dvi
+TEXINFOS = bfd.texinfo
+DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+all: all-redirect
 .SUFFIXES:
-.SUFFIXES: .dvi .html .info .pdf .ps .texinfo
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus  doc/Makefile'; \
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --cygnus  doc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-
-distclean-libtool:
-       -rm -f libtool
+.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+bfd.info: bfd.texinfo
+bfd.dvi: bfd.texinfo
+
+
+DVIPS = dvips
+
+.texi.info:
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
+
+.texi.dvi:
+       TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texi:
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
 
 .texinfo.info:
-       restore=: && backupdir="$(am__leading_dot)am$$$$" && \
-       am__cwd=`pwd` && cd $(srcdir) && \
-       rm -rf $$backupdir && mkdir $$backupdir && \
-       for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
-         if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
-       done; \
-       cd "$$am__cwd"; \
-       if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-        -o $@ $<; \
-       then \
-         rc=0; \
-         cd $(srcdir); \
-       else \
-         rc=$$?; \
-         cd $(srcdir) && \
-         $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
-       fi; \
-       rm -rf $$backupdir; exit $$rc
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo:
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
 
 .texinfo.dvi:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2DVI) $<
-
-.texinfo.pdf:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2PDF) $<
-
-.texinfo.html:
-       rm -rf $(@:.html=.htp)
-       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-        -o $(@:.html=.htp) $<; \
-       then \
-         rm -rf $@; \
-         if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
-           mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
-       else \
-         if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
-           rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
-         exit 1; \
-       fi
-$(srcdir)/bfd.info: bfd.texinfo 
-bfd.dvi: bfd.texinfo 
-bfd.pdf: bfd.texinfo 
-bfd.html: bfd.texinfo 
+       TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+       TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
-       $(DVIPS) -o $@ $<
+       $(DVIPS) $< -o $@
 
-uninstall-info-am:
-       $(PRE_UNINSTALL)
-       @if (install-info --version && \
-            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+install-info-am: $(INFO_DEPS)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(infodir)
+       @list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+           if test -f $$d/$$ifile; then \
+             echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+             $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
+           else : ; fi; \
+         done; \
+       done
+       @$(POST_INSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
          list='$(INFO_DEPS)'; \
          for file in $$list; do \
-           relfile=`echo "$$file" | sed 's|^.*/||'`; \
-           echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
-           install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+           echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+           install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
          done; \
-       else :; fi
+       else : ; fi
+
+uninstall-info:
+       $(PRE_UNINSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+         ii=yes; \
+       else ii=; fi; \
+       list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         test -z "$$ii" \
+           || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
+       done
        @$(NORMAL_UNINSTALL)
-       @list='$(INFO_DEPS)'; \
+       list='$(INFO_DEPS)'; \
        for file in $$list; do \
-         relfile=`echo "$$file" | sed 's|^.*/||'`; \
-         relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
-         (if cd "$(DESTDIR)$(infodir)"; then \
-            echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
-            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
-          else :; fi); \
+         (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
        done
 
 dist-info: $(INFO_DEPS)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        list='$(INFO_DEPS)'; \
        for base in $$list; do \
-         case $$base in \
-           $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
-         esac; \
          if test -f $$base; then d=.; else d=$(srcdir); fi; \
-         for file in $$d/$$base*; do \
-           relfile=`expr "$$file" : "$$d/\(.*\)"`; \
-           test -f $(distdir)/$$relfile || \
-             cp -p $$file $(distdir)/$$relfile; \
+         for file in `cd $$d && eval echo $$base*`; do \
+           test -f $(distdir)/$$file \
+           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+           || cp -p $$d/$$file $(distdir)/$$file; \
          done; \
        done
 
 mostlyclean-aminfo:
-       -rm -rf bfd.aux bfd.cp bfd.cps bfd.fn bfd.ky bfd.kys bfd.log bfd.pg bfd.pgs \
-         bfd.tmp bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs bfd.dvi \
-         bfd.pdf bfd.ps bfd.html
+       -rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+         bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+         bfd.op bfd.tr bfd.cv bfd.cn
+
+clean-aminfo:
+
+distclean-aminfo:
 
 maintainer-clean-aminfo:
-       @list='$(INFO_DEPS)'; for i in $$list; do \
-         i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
-         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
-         rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
+       for i in $(INFO_DEPS); do \
+         rm -f $$i; \
+         if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+           rm -f $$i-[0-9]*; \
+         fi; \
        done
-
 clean-info: mostlyclean-aminfo
 tags: TAGS
 TAGS:
 
-ctags: CTAGS
-CTAGS:
 
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = doc
+
+distdir: $(DISTFILES)
+       @for file in $(DISTFILES); do \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           cp -pr $$d/$$file $(distdir)/$$file; \
+         else \
+           test -f $(distdir)/$$file \
+           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+           || cp -p $$d/$$file $(distdir)/$$file || :; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+info-am: $(INFO_DEPS)
+info: info-am
+dvi-am: $(DVIS)
+dvi: dvi-am
 check-am:
 check: check-am
-all-am: Makefile
-installdirs:
+installcheck-am:
+installcheck: installcheck-am
+install-info-am: 
+install-info: install-info-am
+install-exec-am:
 install-exec: install-exec-am
+
+install-data-am:
 install-data: install-data-am
-uninstall: uninstall-am
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
@@ -482,103 +374,40 @@ clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
        -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-       -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
-
-dvi: dvi-am
-
-dvi-am: $(DVIS)
-
-html: html-am
-
-html-am: $(HTMLS)
-
-info: info-am
-
-info-am: $(INFO_DEPS)
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-info-am: $(INFO_DEPS)
-       @$(NORMAL_INSTALL)
-       test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       list='$(INFO_DEPS)'; \
-       for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-         esac; \
-         if test -f $$file; then d=.; else d=$(srcdir); fi; \
-         file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
-         for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
-                       $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
-           if test -f $$ifile; then \
-             relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
-             echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
-             $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
-           else : ; fi; \
-         done; \
-       done
-       @$(POST_INSTALL)
-       @if (install-info --version && \
-            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
-         list='$(INFO_DEPS)'; \
-         for file in $$list; do \
-           relfile=`echo "$$file" | sed 's|^.*/||'`; \
-           echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
-           install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
-         done; \
-       else : ; fi
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
-       maintainer-clean-generic
+mostlyclean-am:  mostlyclean-aminfo mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \
-       mostlyclean-libtool
+clean-am:  clean-aminfo clean-generic mostlyclean-am
 
-pdf: pdf-am
+clean: clean-am
 
-pdf-am: $(PDFS)
+distclean-am:  distclean-aminfo distclean-generic clean-am
+       -rm -f libtool
 
-ps: ps-am
+distclean: distclean-am
 
-ps-am: $(PSS)
+maintainer-clean-am:  maintainer-clean-aminfo maintainer-clean-generic \
+               distclean-am
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
 
-uninstall-am:
+maintainer-clean: maintainer-clean-am
 
-.PHONY: all all-am check check-am clean clean-generic clean-info \
-       clean-libtool dist-info distclean distclean-generic \
-       distclean-libtool dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am install-exec \
-       install-exec-am install-info install-info-am install-man \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-aminfo \
-       maintainer-clean-generic mostlyclean mostlyclean-aminfo \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       uninstall uninstall-am uninstall-info-am
+.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
+distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-info-am install-info install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 $(MKDOC): chew.o
@@ -589,7 +418,7 @@ chew.o: chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-$(srcdir)/bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
@@ -778,6 +607,7 @@ bfd.h: $(BFD_H_DEP)
 # We want install to imply install-info as per GNU standards, despite the
 # cygnus option.
 install: install-info
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index b1f4ea68854300247e9aff7f4edc6c567748b9b6..a09265755a00e78b988be3484d102a18fae0465a 100644 (file)
@@ -1703,19 +1703,13 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
      We keep a list of all the previously read compilation units, and
      a pointer to the next un-read compilation unit.  Check the
      previously read units before reading more.  */
-  struct dwarf2_debug *stash;
+  struct dwarf2_debug *stash = *pinfo;
 
   /* What address are we looking for?  */
-  bfd_vma addr;
+  bfd_vma addr = offset + section->vma;
 
   struct comp_unit* each;
 
-  stash = *pinfo;
-  addr = offset;
-  if (section->output_section)
-    addr += section->output_section->vma + section->output_offset;
-  else
-    addr += section->vma;
   *filename_ptr = NULL;
   *functionname_ptr = NULL;
   *linenumber_ptr = 0;
index b94de12abb7548aeeb3f79e4bb863d2a739fe761..eba6236fd6b18b9920a9479d5266a8f92b55f178 100644 (file)
@@ -3563,9 +3563,9 @@ ecoff_link_add_archive_symbols (abfd, info)
             entry if it is the tail, because that would lose any
             entries we add to the list later on.  */
          if (*pundef != info->hash->undefs_tail)
-           *pundef = (*pundef)->u.undef.next;
+           *pundef = (*pundef)->und_next;
          else
-           pundef = &(*pundef)->u.undef.next;
+           pundef = &(*pundef)->und_next;
          continue;
        }
 
@@ -3575,7 +3575,7 @@ ecoff_link_add_archive_symbols (abfd, info)
         other object format.  */
       if (h->type != bfd_link_hash_undefined)
        {
-         pundef = &(*pundef)->u.undef.next;
+         pundef = &(*pundef)->und_next;
          continue;
        }
 
@@ -3587,7 +3587,7 @@ ecoff_link_add_archive_symbols (abfd, info)
       if (file_offset == 0)
        {
          /* Nothing in this slot.  */
-         pundef = &(*pundef)->u.undef.next;
+         pundef = &(*pundef)->und_next;
          continue;
        }
 
@@ -3618,7 +3618,7 @@ ecoff_link_add_archive_symbols (abfd, info)
 
          if (! found)
            {
-             pundef = &(*pundef)->u.undef.next;
+             pundef = &(*pundef)->und_next;
              continue;
            }
 
@@ -3640,7 +3640,7 @@ ecoff_link_add_archive_symbols (abfd, info)
       if (! ecoff_link_add_object_symbols (element, info))
        return FALSE;
 
-      pundef = &(*pundef)->u.undef.next;
+      pundef = &(*pundef)->und_next;
     }
 
   return TRUE;
index ff2661399857fa0420c3ae93c485536ee067b0e7..5565e49e96a9daea98140b852021e35aaf02f44d 100644 (file)
@@ -104,6 +104,40 @@ struct elf_link_hash_entry
      not visible outside this DSO.  */
   long dynindx;
 
+  /* String table index in .dynstr if this is a dynamic symbol.  */
+  unsigned long dynstr_index;
+
+  /* Hash value of the name computed using the ELF hash function.  */
+  unsigned long elf_hash_value;
+
+  /* If this is a weak defined symbol from a dynamic object, this
+     field points to a defined symbol with the same value, if there is
+     one.  Otherwise it is NULL.  */
+  struct elf_link_hash_entry *weakdef;
+
+  /* Version information.  */
+  union
+  {
+    /* This field is used for a symbol which is not defined in a
+       regular object.  It points to the version information read in
+       from the dynamic object.  */
+    Elf_Internal_Verdef *verdef;
+    /* This field is used for a symbol which is defined in a regular
+       object.  It is set up in size_dynamic_sections.  It points to
+       the version information we should write out for this symbol.  */
+    struct bfd_elf_version_tree *vertree;
+  } verinfo;
+
+  /* Virtual table entry use information.  This array is nominally of size
+     size/sizeof(target_void_pointer), though we have to be able to assume
+     and track a size while the symbol is still undefined.  It is indexed
+     via offset/sizeof(target_void_pointer).  */
+  size_t vtable_entries_size;
+  bfd_boolean *vtable_entries_used;
+
+  /* Virtual table derivation info.  */
+  struct elf_link_hash_entry *vtable_parent;
+
   /* If this symbol requires an entry in the global offset table, the
      processor specific backend uses this field to track usage and
      final offset.  Two schemes are supported:  The first assumes that
@@ -128,89 +162,47 @@ struct elf_link_hash_entry
   bfd_size_type size;
 
   /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.).  */
-  unsigned int type : 8;
+  char type;
 
   /* Symbol st_other value, symbol visibility.  */
-  unsigned int other : 8;
+  unsigned char other;
 
+  /* Some flags; legal values follow.  */
+  unsigned short elf_link_hash_flags;
   /* Symbol is referenced by a non-shared object.  */
-  unsigned int ref_regular : 1;
+#define ELF_LINK_HASH_REF_REGULAR 01
   /* Symbol is defined by a non-shared object.  */
-  unsigned int def_regular : 1;
+#define ELF_LINK_HASH_DEF_REGULAR 02
   /* Symbol is referenced by a shared object.  */
-  unsigned int ref_dynamic : 1;
+#define ELF_LINK_HASH_REF_DYNAMIC 04
   /* Symbol is defined by a shared object.  */
-  unsigned int def_dynamic : 1;
+#define ELF_LINK_HASH_DEF_DYNAMIC 010
   /* Symbol has a non-weak reference from a non-shared object.  */
-  unsigned int ref_regular_nonweak : 1;
+#define ELF_LINK_HASH_REF_REGULAR_NONWEAK 020
   /* Dynamic symbol has been adjustd.  */
-  unsigned int dynamic_adjusted : 1;
+#define ELF_LINK_HASH_DYNAMIC_ADJUSTED 040
   /* Symbol needs a copy reloc.  */
-  unsigned int needs_copy : 1;
+#define ELF_LINK_HASH_NEEDS_COPY 0100
   /* Symbol needs a procedure linkage table entry.  */
-  unsigned int needs_plt : 1;
+#define ELF_LINK_HASH_NEEDS_PLT 0200
   /* Symbol appears in a non-ELF input file.  */
-  unsigned int non_elf : 1;
+#define ELF_LINK_NON_ELF 0400
   /* Symbol should be marked as hidden in the version information.  */
-  unsigned int hidden : 1;
+#define ELF_LINK_HIDDEN 01000
   /* Symbol was forced to local scope due to a version script file.  */
-  unsigned int forced_local : 1;
+#define ELF_LINK_FORCED_LOCAL 02000
   /* Symbol was marked during garbage collection.  */
-  unsigned int mark : 1;
+#define ELF_LINK_HASH_MARK 04000
   /* Symbol is referenced by a non-GOT/non-PLT relocation.  This is
      not currently set by all the backends.  */
-  unsigned int non_got_ref : 1;
-  /* Symbol has a definition in a shared object.
-     FIXME: There is no real need for this field if def_dynamic is never
-     cleared and all places that test def_dynamic also test def_regular.  */
-  unsigned int dynamic_def : 1;
+#define ELF_LINK_NON_GOT_REF 010000
+  /* Symbol has a definition in a shared object.  */
+#define ELF_LINK_DYNAMIC_DEF 020000
   /* Symbol is weak in all shared objects.  */
-  unsigned int dynamic_weak : 1;
+#define ELF_LINK_DYNAMIC_WEAK 040000
   /* Symbol is referenced with a relocation where C/C++ pointer equality
      matters.  */
-  unsigned int pointer_equality_needed : 1;
-
-  /* String table index in .dynstr if this is a dynamic symbol.  */
-  unsigned long dynstr_index;
-
-  union
-  {
-    /* If this is a weak defined symbol from a dynamic object, this
-       field points to a defined symbol with the same value, if there is
-       one.  Otherwise it is NULL.  */
-    struct elf_link_hash_entry *weakdef;
-
-    /* Hash value of the name computed using the ELF hash function.
-       Used part way through size_dynamic_sections, after we've finished
-       with weakdefs.  */
-    unsigned long elf_hash_value;
-  } u;
-
-  /* Version information.  */
-  union
-  {
-    /* This field is used for a symbol which is not defined in a
-       regular object.  It points to the version information read in
-       from the dynamic object.  */
-    Elf_Internal_Verdef *verdef;
-    /* This field is used for a symbol which is defined in a regular
-       object.  It is set up in size_dynamic_sections.  It points to
-       the version information we should write out for this symbol.  */
-    struct bfd_elf_version_tree *vertree;
-  } verinfo;
-
-  struct
-  {
-    /* Virtual table entry use information.  This array is nominally of size
-       size/sizeof(target_void_pointer), though we have to be able to assume
-       and track a size while the symbol is still undefined.  It is indexed
-       via offset/sizeof(target_void_pointer).  */
-    size_t size;
-    bfd_boolean *used;
-
-    /* Virtual table derivation info.  */
-    struct elf_link_hash_entry *parent;
-  } *vtable;
+#define ELF_LINK_POINTER_EQUALITY_NEEDED 0100000
 };
 
 /* Will references to this symbol always reference the symbol
@@ -229,8 +221,8 @@ struct elf_link_hash_entry
 /* Common symbols that are turned into definitions don't have the
    DEF_REGULAR flag set, so they might appear to be undefined.  */
 #define ELF_COMMON_DEF_P(H) \
-  (!(H)->def_regular                                                   \
-   && !(H)->def_dynamic                                                        \
+  (((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0         \
+   && ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0      \
    && (H)->root.type == bfd_link_hash_defined)
 
 /* Records local symbols to be emitted in the dynamic symbol table.  */
@@ -286,10 +278,9 @@ struct cie
 
 struct eh_cie_fde
 {
-  /* For FDEs, this points to the CIE used.  */
-  struct eh_cie_fde *cie_inf;
-  unsigned int size;
   unsigned int offset;
+  unsigned int size;
+  asection *sec;
   unsigned int new_offset;
   unsigned char fde_encoding;
   unsigned char lsda_encoding;
@@ -298,8 +289,6 @@ struct eh_cie_fde
   unsigned int removed : 1;
   unsigned int make_relative : 1;
   unsigned int make_lsda_relative : 1;
-  unsigned int need_relative : 1;
-  unsigned int need_lsda_relative : 1;
   unsigned int per_encoding_relative : 1;
 };
 
@@ -320,15 +309,14 @@ struct eh_frame_hdr_info
 {
   struct cie last_cie;
   asection *last_cie_sec;
-  struct eh_cie_fde *last_cie_inf;
   asection *hdr_sec;
+  unsigned int last_cie_offset;
   unsigned int fde_count, array_count;
   struct eh_frame_array_ent *array;
   /* TRUE if .eh_frame_hdr should contain the sorted search table.
      We build it if we successfully read all .eh_frame input sections
      and recognize them.  */
   bfd_boolean table;
-  bfd_boolean offsets_adjusted;
 };
 
 /* ELF linker hash table.  */
@@ -1260,7 +1248,7 @@ struct elf_obj_tdata
   unsigned int cverrefs;
 
   /* Segment flags for the PT_GNU_STACK segment.  */
-  unsigned int stack_flags;
+  unsigned int stack_flags;  
 
   /* Should the PT_GNU_RELRO segment be emitted?  */
   bfd_boolean relro;
@@ -1532,7 +1520,7 @@ extern bfd_boolean _bfd_elf_discard_section_eh_frame
 extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr
   (bfd *, struct bfd_link_info *);
 extern bfd_vma _bfd_elf_eh_frame_section_offset
-  (bfd *, struct bfd_link_info *, asection *, bfd_vma);
+  (bfd *, asection *, bfd_vma);
 extern bfd_boolean _bfd_elf_write_section_eh_frame
   (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
 extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
@@ -1783,8 +1771,10 @@ extern bfd_boolean _sh_elf_set_mach_from_flags
    about initializing any .plt and .got entries in relocate_section.  */
 #define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
   ((DYN)                                                               \
-   && ((SHARED) || !(H)->forced_local)                                 \
-   && ((H)->dynindx != -1 || (H)->forced_local))
+   && ((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.  */
index c4cf46f65cc063f6d81833805ba844d0bf0716bc..be4e3072345b97645bc572fcaa4a6a65e924919b 100644 (file)
@@ -213,14 +213,14 @@ _bfd_elf_discard_section_eh_frame
 {
   bfd_byte *ehbuf = NULL, *buf;
   bfd_byte *last_cie, *last_fde;
-  struct eh_cie_fde *ent, *last_cie_inf, *this_inf;
   struct cie_header hdr;
   struct cie cie;
   struct elf_link_hash_table *htab;
   struct eh_frame_hdr_info *hdr_info;
   struct eh_frame_sec_info *sec_info = NULL;
   unsigned int leb128_tmp;
-  unsigned int cie_usage_count, offset;
+  unsigned int cie_usage_count, last_cie_ndx, i, offset;
+  unsigned int make_relative, make_lsda_relative;
   bfd_size_type new_size;
   unsigned int ptr_size;
 
@@ -234,7 +234,7 @@ _bfd_elf_discard_section_eh_frame
        && bfd_is_abs_section (sec->output_section)))
     {
       /* At least one of the sections is being discarded from the
-        link, so we should just ignore them.  */
+         link, so we should just ignore them.  */
       return FALSE;
     }
 
@@ -264,10 +264,12 @@ _bfd_elf_discard_section_eh_frame
              == ELFCLASS64) ? 8 : 4;
   buf = ehbuf;
   last_cie = NULL;
-  last_cie_inf = NULL;
+  last_cie_ndx = 0;
   memset (&cie, 0, sizeof (cie));
   cie_usage_count = 0;
   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)
@@ -284,14 +286,14 @@ _bfd_elf_discard_section_eh_frame
 
 #define SKIP_RELOCS(buf)                               \
   while (cookie->rel < cookie->relend                  \
-        && (cookie->rel->r_offset                      \
+         && (cookie->rel->r_offset                     \
             < (bfd_size_type) ((buf) - ehbuf)))        \
     cookie->rel++
 
 #define GET_RELOC(buf)                                 \
   ((cookie->rel < cookie->relend                       \
     && (cookie->rel->r_offset                          \
-       == (bfd_size_type) ((buf) - ehbuf)))            \
+        == (bfd_size_type) ((buf) - ehbuf)))           \
    ? cookie->rel : NULL)
 
   for (;;)
@@ -300,25 +302,18 @@ _bfd_elf_discard_section_eh_frame
 
       if (sec_info->count == sec_info->alloced)
        {
-         struct eh_cie_fde *old_entry = sec_info->entry;
          sec_info = bfd_realloc (sec_info,
                                  sizeof (struct eh_frame_sec_info)
-                                 + ((sec_info->alloced + 99)
-                                    * sizeof (struct eh_cie_fde)));
+                                 + (sec_info->alloced + 99)
+                                    * sizeof (struct eh_cie_fde));
          if (sec_info == NULL)
            goto free_no_table;
 
          memset (&sec_info->entry[sec_info->alloced], 0,
                  100 * sizeof (struct eh_cie_fde));
          sec_info->alloced += 100;
-
-         /* Now fix any pointers into the array.  */
-         if (last_cie_inf >= old_entry
-             && last_cie_inf < old_entry + sec_info->count)
-           last_cie_inf = sec_info->entry + (last_cie_inf - old_entry);
        }
 
-      this_inf = sec_info->entry + sec_info->count;
       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).  */
@@ -339,8 +334,8 @@ _bfd_elf_discard_section_eh_frame
            /* CIE/FDE not contained fully in this .eh_frame input section.  */
            goto free_no_table;
 
-         this_inf->offset = last_fde - ehbuf;
-         this_inf->size = 4 + hdr.length;
+         sec_info->entry[sec_info->count].offset = last_fde - ehbuf;
+         sec_info->entry[sec_info->count].size = 4 + hdr.length;
 
          if (hdr.length == 0)
            {
@@ -381,15 +376,21 @@ _bfd_elf_discard_section_eh_frame
                  || cie_usage_count == 0)
                {
                  new_size -= cie.hdr.length + 4;
-                 last_cie_inf->removed = 1;
+                 sec_info->entry[last_cie_ndx].removed = 1;
+                 sec_info->entry[last_cie_ndx].sec = hdr_info->last_cie_sec;
+                 sec_info->entry[last_cie_ndx].new_offset
+                   = hdr_info->last_cie_offset;
                }
              else
                {
                  hdr_info->last_cie = cie;
                  hdr_info->last_cie_sec = sec;
-                 last_cie_inf->make_relative = cie.make_relative;
-                 last_cie_inf->make_lsda_relative = cie.make_lsda_relative;
-                 last_cie_inf->per_encoding_relative
+                 hdr_info->last_cie_offset = last_cie - ehbuf;
+                 sec_info->entry[last_cie_ndx].make_relative
+                   = cie.make_relative;
+                 sec_info->entry[last_cie_ndx].make_lsda_relative
+                   = cie.make_lsda_relative;
+                 sec_info->entry[last_cie_ndx].per_encoding_relative
                    = (cie.per_encoding & 0x70) == DW_EH_PE_pcrel;
                }
            }
@@ -397,8 +398,8 @@ _bfd_elf_discard_section_eh_frame
          if (hdr.id == (unsigned int) -1)
            break;
 
-         last_cie_inf = this_inf;
-         this_inf->cie = 1;
+         last_cie_ndx = sec_info->count;
+         sec_info->entry[sec_info->count].cie = 1;
 
          cie_usage_count = 0;
          memset (&cie, 0, sizeof (cie));
@@ -511,7 +512,7 @@ _bfd_elf_discard_section_eh_frame
 
          /* For shared libraries, try to get rid of as many RELATIVE relocs
             as possible.  */
-         if (info->shared
+          if (info->shared
              && (get_elf_backend_data (abfd)
                  ->elf_backend_can_make_relative_eh_frame
                  (abfd, info, sec))
@@ -551,13 +552,12 @@ _bfd_elf_discard_section_eh_frame
          if (GET_RELOC (buf) == NULL)
            /* This should not happen.  */
            goto free_no_table;
-
          if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie))
            {
              /* This is a FDE against a discarded section.  It should
                 be deleted.  */
              new_size -= hdr.length + 4;
-             this_inf->removed = 1;
+             sec_info->entry[sec_info->count].removed = 1;
            }
          else
            {
@@ -585,14 +585,14 @@ _bfd_elf_discard_section_eh_frame
                read_uleb128 (dummy, buf);
              /* If some new augmentation data is added before LSDA
                 in FDE augmentation area, this need to be adjusted.  */
-             this_inf->lsda_offset = (buf - aug);
+             sec_info->entry[sec_info->count].lsda_offset = (buf - aug);
            }
          buf = last_fde + 4 + hdr.length;
          SKIP_RELOCS (buf);
        }
 
-      this_inf->fde_encoding = cie.fde_encoding;
-      this_inf->lsda_encoding = cie.lsda_encoding;
+      sec_info->entry[sec_info->count].fde_encoding = cie.fde_encoding;
+      sec_info->entry[sec_info->count].lsda_encoding = cie.lsda_encoding;
       sec_info->count++;
     }
 
@@ -601,18 +601,41 @@ _bfd_elf_discard_section_eh_frame
 
   /* Ok, now we can assign new offsets.  */
   offset = 0;
-  last_cie_inf = hdr_info->last_cie_inf;
-  for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent)
-    if (!ent->removed)
-      {
-       ent->new_offset = offset;
-       offset += ent->size;
-       if (ent->cie)
-         last_cie_inf = ent;
-       else
-         ent->cie_inf = last_cie_inf;
-      }
-  hdr_info->last_cie_inf = last_cie_inf;
+  last_cie_ndx = 0;
+  for (i = 0; i < sec_info->count; i++)
+    {
+      if (! sec_info->entry[i].removed)
+       {
+         sec_info->entry[i].new_offset = offset;
+         offset += sec_info->entry[i].size;
+         if (sec_info->entry[i].cie)
+           {
+             last_cie_ndx = i;
+             make_relative = sec_info->entry[i].make_relative;
+             make_lsda_relative = sec_info->entry[i].make_lsda_relative;
+           }
+         else
+           {
+             sec_info->entry[i].make_relative = make_relative;
+             sec_info->entry[i].make_lsda_relative = make_lsda_relative;
+             sec_info->entry[i].per_encoding_relative = 0;
+           }
+       }
+      else if (sec_info->entry[i].cie && sec_info->entry[i].sec == sec)
+       {
+         /* Need to adjust new_offset too.  */
+         BFD_ASSERT (sec_info->entry[last_cie_ndx].offset
+                     == sec_info->entry[i].new_offset);
+         sec_info->entry[i].new_offset
+           = sec_info->entry[last_cie_ndx].new_offset;
+       }
+    }
+  if (hdr_info->last_cie_sec == sec)
+    {
+      BFD_ASSERT (sec_info->entry[last_cie_ndx].offset
+                 == hdr_info->last_cie_offset);
+      hdr_info->last_cie_offset = sec_info->entry[last_cie_ndx].new_offset;
+    }
 
   /* Shrink the sec as needed.  */
   sec->rawsize = sec->size;
@@ -713,13 +736,10 @@ _bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info)
 
 bfd_vma
 _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
-                                 struct bfd_link_info *info,
                                  asection *sec,
                                  bfd_vma offset)
 {
   struct eh_frame_sec_info *sec_info;
-  struct elf_link_hash_table *htab;
-  struct eh_frame_hdr_info *hdr_info;
   unsigned int lo, hi, mid;
 
   if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
@@ -729,11 +749,6 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
   if (offset >= sec->rawsize)
     return offset - sec->rawsize + sec->size;
 
-  htab = elf_hash_table (info);
-  hdr_info = &htab->eh_info;
-  if (hdr_info->offsets_adjusted)
-    offset += sec->output_offset;
-
   lo = 0;
   hi = sec_info->count;
   mid = 0;
@@ -757,31 +772,19 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   /* If converting to DW_EH_PE_pcrel, there will be no need for run-time
      relocation against FDE's initial_location field.  */
-  if (!sec_info->entry[mid].cie
-      && sec_info->entry[mid].cie_inf->make_relative
-      && offset == sec_info->entry[mid].offset + 8
-      && (sec_info->entry[mid].cie_inf->need_relative
-         || !hdr_info->offsets_adjusted))
-    {
-      sec_info->entry[mid].cie_inf->need_relative = 1;
-      return (bfd_vma) -2;
-    }
+  if (sec_info->entry[mid].make_relative
+      && ! sec_info->entry[mid].cie
+      && offset == sec_info->entry[mid].offset + 8)
+    return (bfd_vma) -2;
 
   /* If converting LSDA pointers to DW_EH_PE_pcrel, there will be no need
      for run-time relocation against LSDA field.  */
-  if (!sec_info->entry[mid].cie
-      && sec_info->entry[mid].cie_inf->make_lsda_relative
+  if (sec_info->entry[mid].make_lsda_relative
+      && ! sec_info->entry[mid].cie
       && (offset == (sec_info->entry[mid].offset + 8
-                    + sec_info->entry[mid].lsda_offset))
-      && (sec_info->entry[mid].cie_inf->need_lsda_relative
-         || !hdr_info->offsets_adjusted))
-    {
-      sec_info->entry[mid].cie_inf->need_lsda_relative = 1;
-      return (bfd_vma) -2;
-    }
+                    + sec_info->entry[mid].lsda_offset)))
+    return (bfd_vma) -2;
 
-  if (hdr_info->offsets_adjusted)
-    offset -= sec->output_offset;
   return (offset + sec_info->entry[mid].new_offset
          - sec_info->entry[mid].offset);
 }
@@ -798,10 +801,11 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
   struct eh_frame_sec_info *sec_info;
   struct elf_link_hash_table *htab;
   struct eh_frame_hdr_info *hdr_info;
+  unsigned int i;
   bfd_byte *p, *buf;
   unsigned int leb128_tmp;
+  unsigned int cie_offset = 0;
   unsigned int ptr_size;
-  struct eh_cie_fde *ent;
 
   ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS]
              == ELFCLASS64) ? 8 : 4;
@@ -812,39 +816,6 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
   sec_info = elf_section_data (sec)->sec_info;
   htab = elf_hash_table (info);
   hdr_info = &htab->eh_info;
-
-  /* First convert all offsets to output section offsets, so that a
-     CIE offset is valid if the CIE is used by a FDE from some other
-     section.  This can happen when duplicate CIEs are deleted in
-     _bfd_elf_discard_section_eh_frame.  We do all sections here because
-     this function might not be called on sections in the same order as
-     _bfd_elf_discard_section_eh_frame.  */
-  if (!hdr_info->offsets_adjusted)
-    {
-      bfd *ibfd;
-      asection *eh;
-      struct eh_frame_sec_info *eh_inf;
-
-      for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
-       {
-         if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-             || (ibfd->flags & DYNAMIC) != 0)
-           continue;
-
-         eh = bfd_get_section_by_name (ibfd, ".eh_frame");
-         if (eh == NULL || eh->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
-           continue;
-
-         eh_inf = elf_section_data (eh)->sec_info;
-         for (ent = eh_inf->entry; ent < eh_inf->entry + eh_inf->count; ++ent)
-           {
-             ent->offset += eh->output_offset;
-             ent->new_offset += eh->output_offset;
-           }
-       }
-      hdr_info->offsets_adjusted = TRUE;
-    }
-
   if (hdr_info->table && hdr_info->array == NULL)
     hdr_info->array
       = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array));
@@ -852,17 +823,36 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
     hdr_info = NULL;
 
   p = contents;
-  for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent)
+  for (i = 0; i < sec_info->count; ++i)
     {
-      if (ent->removed)
-       continue;
+      if (sec_info->entry[i].removed)
+       {
+         if (sec_info->entry[i].cie)
+           {
+             /* If CIE is removed due to no remaining FDEs referencing it
+                and there were no CIEs kept before it, sec_info->entry[i].sec
+                will be zero.  */
+             if (sec_info->entry[i].sec == NULL)
+               cie_offset = 0;
+             else
+               {
+                 cie_offset = sec_info->entry[i].new_offset;
+                 cie_offset += (sec_info->entry[i].sec->output_section->vma
+                                + sec_info->entry[i].sec->output_offset
+                                - sec->output_section->vma
+                                - sec->output_offset);
+               }
+           }
+         continue;
+       }
 
-      if (ent->cie)
+      if (sec_info->entry[i].cie)
        {
          /* CIE */
-         if (ent->need_relative
-             || ent->need_lsda_relative
-             || ent->per_encoding_relative)
+         cie_offset = sec_info->entry[i].new_offset;
+         if (sec_info->entry[i].make_relative
+             || sec_info->entry[i].make_lsda_relative
+             || sec_info->entry[i].per_encoding_relative)
            {
              unsigned char *aug;
              unsigned int action;
@@ -870,10 +860,10 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
 
              /* Need to find 'R' or 'L' augmentation's argument and modify
                 DW_EH_PE_* value.  */
-             action = ((ent->need_relative ? 1 : 0)
-                       | (ent->need_lsda_relative ? 2 : 0)
-                       | (ent->per_encoding_relative ? 4 : 0));
-             buf = contents + ent->offset - sec->output_offset;
+             action = (sec_info->entry[i].make_relative ? 1 : 0)
+                      | (sec_info->entry[i].make_lsda_relative ? 2 : 0)
+                      | (sec_info->entry[i].per_encoding_relative ? 4 : 0);
+             buf = contents + sec_info->entry[i].offset;
              /* Skip length, id and version.  */
              buf += 9;
              aug = buf;
@@ -893,7 +883,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
                  case 'L':
                    if (action & 2)
                      {
-                       BFD_ASSERT (*buf == ent->lsda_encoding);
+                       BFD_ASSERT (*buf == sec_info->entry[i].lsda_encoding);
                        *buf |= DW_EH_PE_pcrel;
                        action &= ~2;
                      }
@@ -901,22 +891,25 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
                    break;
                  case 'P':
                    per_encoding = *buf++;
-                   per_width = get_DW_EH_PE_width (per_encoding, ptr_size);
+                    per_width = get_DW_EH_PE_width (per_encoding,
+                                                   ptr_size);
                    BFD_ASSERT (per_width != 0);
                    BFD_ASSERT (((per_encoding & 0x70) == DW_EH_PE_pcrel)
-                               == ent->per_encoding_relative);
+                               == sec_info->entry[i].per_encoding_relative);
                    if ((per_encoding & 0xf0) == DW_EH_PE_aligned)
                      buf = (contents
                             + ((buf - contents + per_width - 1)
                                & ~((bfd_size_type) per_width - 1)));
                    if (action & 4)
                      {
-                       bfd_vma val;
-
-                       val = read_value (abfd, buf, per_width,
-                                         get_DW_EH_PE_signed (per_encoding));
-                       val += ent->offset - ent->new_offset;
-                       write_value (abfd, buf, val, per_width);
+                       bfd_vma value;
+
+                       value = read_value (abfd, buf, per_width,
+                                           get_DW_EH_PE_signed
+                                           (per_encoding));
+                       value += (sec_info->entry[i].offset
+                                 - sec_info->entry[i].new_offset);
+                       write_value (abfd, buf, value, per_width);
                        action &= ~4;
                      }
                    buf += per_width;
@@ -924,7 +917,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
                  case 'R':
                    if (action & 1)
                      {
-                       BFD_ASSERT (*buf == ent->fde_encoding);
+                       BFD_ASSERT (*buf == sec_info->entry[i].fde_encoding);
                        *buf |= DW_EH_PE_pcrel;
                        action &= ~1;
                      }
@@ -935,25 +928,26 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
                  }
            }
        }
-      else if (ent->size > 4)
+      else if (sec_info->entry[i].size > 4)
        {
          /* FDE */
-         bfd_vma value, address;
+         bfd_vma value = 0, address;
          unsigned int width;
 
-         buf = contents + ent->offset - sec->output_offset;
+         buf = contents + sec_info->entry[i].offset;
          /* Skip length.  */
          buf += 4;
-         value = ent->new_offset + 4 - ent->cie_inf->new_offset;
-         bfd_put_32 (abfd, value, buf);
+         bfd_put_32 (abfd,
+                     sec_info->entry[i].new_offset + 4 - cie_offset, buf);
          buf += 4;
-         width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size);
-         value = read_value (abfd, buf, width,
-                             get_DW_EH_PE_signed (ent->fde_encoding));
-         address = value;
+         width = get_DW_EH_PE_width (sec_info->entry[i].fde_encoding,
+                                     ptr_size);
+         address = value = read_value (abfd, buf, width,
+                                       get_DW_EH_PE_signed
+                                       (sec_info->entry[i].fde_encoding));
          if (value)
            {
-             switch (ent->fde_encoding & 0xf0)
+             switch (sec_info->entry[i].fde_encoding & 0xf0)
                {
                case DW_EH_PE_indirect:
                case DW_EH_PE_textrel:
@@ -968,12 +962,15 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
                  }
                  break;
                case DW_EH_PE_pcrel:
-                 value += ent->offset - ent->new_offset;
-                 address += sec->output_section->vma + ent->offset + 8;
+                 value += (sec_info->entry[i].offset
+                           - sec_info->entry[i].new_offset);
+                 address += (sec->output_section->vma + sec->output_offset
+                             + sec_info->entry[i].offset + 8);
                  break;
                }
-             if (ent->cie_inf->need_relative)
-               value -= sec->output_section->vma + ent->new_offset + 8;
+             if (sec_info->entry[i].make_relative)
+               value -= (sec->output_section->vma + sec->output_offset
+                         + sec_info->entry[i].new_offset + 8);
              write_value (abfd, buf, value, width);
            }
 
@@ -981,34 +978,41 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
            {
              hdr_info->array[hdr_info->array_count].initial_loc = address;
              hdr_info->array[hdr_info->array_count++].fde
-               = sec->output_section->vma + ent->new_offset;
+               = (sec->output_section->vma + sec->output_offset
+                  + sec_info->entry[i].new_offset);
            }
 
-         if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel
-             || ent->cie_inf->need_lsda_relative)
+         if ((sec_info->entry[i].lsda_encoding & 0xf0) == DW_EH_PE_pcrel
+             || sec_info->entry[i].make_lsda_relative)
            {
-             buf += ent->lsda_offset;
-             width = get_DW_EH_PE_width (ent->lsda_encoding, ptr_size);
+             buf += sec_info->entry[i].lsda_offset;
+             width = get_DW_EH_PE_width (sec_info->entry[i].lsda_encoding,
+                                         ptr_size);
              value = read_value (abfd, buf, width,
-                                 get_DW_EH_PE_signed (ent->lsda_encoding));
+                                 get_DW_EH_PE_signed
+                                 (sec_info->entry[i].lsda_encoding));
              if (value)
                {
-                 if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel)
-                   value += ent->offset - ent->new_offset;
-                 else if (ent->cie_inf->need_lsda_relative)
-                   value -= (sec->output_section->vma + ent->new_offset + 8
-                             + ent->lsda_offset);
+                 if ((sec_info->entry[i].lsda_encoding & 0xf0)
+                     == DW_EH_PE_pcrel)
+                   value += (sec_info->entry[i].offset
+                             - sec_info->entry[i].new_offset);
+                 else if (sec_info->entry[i].make_lsda_relative)
+                   value -= (sec->output_section->vma + sec->output_offset
+                             + sec_info->entry[i].new_offset + 8
+                             + sec_info->entry[i].lsda_offset);
                  write_value (abfd, buf, value, width);
                }
            }
        }
       else
        /* Terminating FDE must be at the end of .eh_frame section only.  */
-       BFD_ASSERT (ent == sec_info->entry + sec_info->count - 1);
+       BFD_ASSERT (i == sec_info->count - 1);
 
-      BFD_ASSERT (p == contents + ent->new_offset - sec->output_offset);
-      memmove (p, contents + ent->offset - sec->output_offset, ent->size);
-      p += ent->size;
+      BFD_ASSERT (p == contents + sec_info->entry[i].new_offset);
+      memmove (p, contents + sec_info->entry[i].offset,
+              sec_info->entry[i].size);
+      p += sec_info->entry[i].size;
     }
 
     {
@@ -1022,22 +1026,22 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
              <= sec->output_section->size))
        {
          /* Find the last CIE/FDE.  */
-         ent = sec_info->entry + sec_info->count;
-         while (--ent != sec_info->entry)
-           if (!ent->removed)
+         for (i = sec_info->count - 1; i > 0; i--)
+           if (! sec_info->entry[i].removed)
              break;
 
          /* The size of the last CIE/FDE must be at least 4.  */
-         if (ent->removed || ent->size < 4)
+         if (sec_info->entry[i].removed
+             || sec_info->entry[i].size < 4)
            abort ();
 
          pad = alignment - pad;
 
-         buf = contents + ent->new_offset - sec->output_offset;
+         buf = contents + sec_info->entry[i].new_offset;
 
          /* Update length.  */
-         ent->size += pad;
-         bfd_put_32 (abfd, ent->size - 4, buf);
+         sec_info->entry[i].size += pad;
+         bfd_put_32 (abfd, sec_info->entry[i].size - 4, buf);
 
          /* Pad it with DW_CFA_nop  */
          memset (p, 0, pad);
@@ -1050,8 +1054,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
   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->size);
+                                   contents, (file_ptr) sec->output_offset,
+                                   sec->size);
 }
 
 /* Helper function used to sort .eh_frame_hdr search table by increasing
index a6d3d691f131953827b482533eca0baf3f8cc0c5..b1e00af1ce47f0d744e42054c262c4dae50f39d6 100644 (file)
@@ -1115,11 +1115,11 @@ elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
   if (! info->relocatable
       && info->unresolved_syms_in_shared_libs != RM_IGNORE
       && h->root.type == bfd_link_hash_undefined
-      && h->ref_dynamic
-      && !h->ref_regular)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
     {
-      h->ref_dynamic = 0;
-      h->pointer_equality_needed = 1;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_REF_DYNAMIC;
+      h->elf_link_hash_flags |= 0x8000;
     }
 
   return TRUE;
@@ -1149,12 +1149,12 @@ elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
   if (! info->relocatable
       && info->unresolved_syms_in_shared_libs != RM_IGNORE
       && h->root.type == bfd_link_hash_undefined
-      && !h->ref_dynamic
-      && !h->ref_regular
-      && h->pointer_equality_needed)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
+      && (h->elf_link_hash_flags & 0x8000) != 0)
     {
-      h->ref_dynamic = 1;
-      h->pointer_equality_needed = 0;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+      h->elf_link_hash_flags &= ~0x8000;
     }
 
   return TRUE;
index d882eb4f775f6223dadf0ac691fc7a13e543ad19..a83015d7647d5aa90e767fbb927f9574efcb9aaa 100644 (file)
@@ -593,7 +593,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
              get_elf_backend_data (abfd)->collect, &bh)))
        return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (info->shared
@@ -627,7 +627,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
         bed->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   if (info->shared
@@ -864,7 +864,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
              || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
            break;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
          break;
 
@@ -875,12 +875,12 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
        case R_MN10300_PCREL16:
        case R_MN10300_PCREL8:
          if (h != NULL)
-           h->non_got_ref = 1;
+           h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
          break;
 
        case R_MN10300_32:
          if (h != NULL)
-           h->non_got_ref = 1;
+           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.  */
@@ -1470,7 +1470,8 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                             externally in shared libraries.  We can't
                             do anything with them here.  */
                          || ((input_section->flags & SEC_DEBUGGING) != 0
-                             && h->root.def_dynamic)))))
+                             && (h->root.elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))))
            /* In these cases, we don't need the relocation
               value.  We check specially because in some
               obscure cases sec->output_section will be NULL.  */
@@ -4020,28 +4021,31 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! info->shared
-         && !h->def_dynamic
-         && !h->ref_dynamic)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
        {
          /* This case can occur if we saw a PLT reloc in an input
             file, but the symbol was never referred to by a dynamic
             object.  In such a case, we don't actually need to build
             a procedure linkage table, and we can just do a REL32
             reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
          return TRUE;
        }
 
@@ -4066,7 +4070,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (! info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = s->size;
@@ -4096,12 +4100,12 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -4117,7 +4121,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* We must allocate the symbol in our .dynbss section, which will
@@ -4144,7 +4148,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -4441,7 +4445,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
                                 (bfd_byte *) ((Elf32_External_Rela *) srel->contents
                                               + plt_index));
 
-      if (!h->def_regular)
+      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.  */
        sym->st_shndx = SHN_UNDEF;
@@ -4470,7 +4474,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
         initialized in the relocate_section function.  */
       if (info->shared
          && (info->symbolic || h->dynindx == -1)
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          rel.r_info = ELF32_R_INFO (0, R_MN10300_RELATIVE);
          rel.r_addend = (h->root.u.def.value
@@ -4490,7 +4494,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
       ++ srel->reloc_count;
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *        s;
       Elf_Internal_Rela rel;
index b7674e316e68e2d6bb604e4dc943e984e73b133b..c0d60090dbebc6158675d477d2b6ed9893c6590f 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1391,14 +1391,23 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
       /* Set local fields.  */
       ret->indx = -1;
       ret->dynindx = -1;
-      ret->got = ret->plt = htab->init_refcount;
-      memset (&ret->size, 0, (sizeof (struct elf_link_hash_entry)
-                             - offsetof (struct elf_link_hash_entry, size)));
+      ret->dynstr_index = 0;
+      ret->elf_hash_value = 0;
+      ret->weakdef = NULL;
+      ret->verinfo.verdef = NULL;
+      ret->vtable_entries_size = 0;
+      ret->vtable_entries_used = NULL;
+      ret->vtable_parent = NULL;
+      ret->got = htab->init_refcount;
+      ret->plt = htab->init_refcount;
+      ret->size = 0;
+      ret->type = STT_NOTYPE;
+      ret->other = 0;
       /* Assume that we have been called by a non-ELF symbol reader.
          This flag is then reset by the code which reads an ELF input
          file.  This ensures that a symbol created by a non-ELF symbol
          reader will have the flag set correctly.  */
-      ret->non_elf = 1;
+      ret->elf_link_hash_flags = ELF_LINK_NON_ELF;
     }
 
   return entry;
@@ -1418,12 +1427,13 @@ _bfd_elf_link_hash_copy_indirect (const struct elf_backend_data *bed,
   /* Copy down any references that we may have already seen to the
      symbol which just became indirect.  */
 
-  dir->ref_dynamic |= ind->ref_dynamic;
-  dir->ref_regular |= ind->ref_regular;
-  dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-  dir->non_got_ref |= ind->non_got_ref;
-  dir->needs_plt |= ind->needs_plt;
-  dir->pointer_equality_needed |= ind->pointer_equality_needed;
+  dir->elf_link_hash_flags
+    |= ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+                                  | ELF_LINK_HASH_REF_REGULAR
+                                  | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+                                  | ELF_LINK_NON_GOT_REF
+                                  | ELF_LINK_HASH_NEEDS_PLT
+                                  | ELF_LINK_POINTER_EQUALITY_NEEDED);
 
   if (ind->root.type != bfd_link_hash_indirect)
     return;
@@ -1465,10 +1475,10 @@ _bfd_elf_link_hash_hide_symbol (struct bfd_link_info *info,
                                bfd_boolean force_local)
 {
   h->plt = elf_hash_table (info)->init_offset;
-  h->needs_plt = 0;
+  h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
   if (force_local)
     {
-      h->forced_local = 1;
+      h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
       if (h->dynindx != -1)
        {
          h->dynindx = -1;
@@ -1739,7 +1749,6 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
     case SHT_INIT_ARRAY:       /* .init_array section.  */
     case SHT_FINI_ARRAY:       /* .fini_array section.  */
     case SHT_PREINIT_ARRAY:    /* .preinit_array section.  */
-    case SHT_GNU_LIBLIST:      /* .gnu.liblist section.  */
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
 
     case SHT_DYNAMIC:  /* Dynamic linking information.  */
@@ -2133,8 +2142,6 @@ static struct bfd_elf_special_section const special_sections[] =
   { ".rela",           5, -1, SHT_RELA,     0 },
   { ".rel",            4, -1, SHT_REL,      0 },
   { ".stabstr",        5,  3, SHT_STRTAB,   0 },
-  { ".gnu.liblist",   12,  0, SHT_GNU_LIBLIST, SHF_ALLOC },
-  { ".gnu.conflict",  13,  0, SHT_RELA,     SHF_ALLOC },
   { NULL,              0,  0, 0,            0 }
 };
 
@@ -2972,17 +2979,6 @@ assign_section_numbers (bfd *abfd)
            d->this_hdr.sh_link = elf_section_data (s)->this_idx;
          break;
 
-       case SHT_GNU_LIBLIST:
-         /* sh_link is the section header index of the prelink library
-            list 
-            used for the dynamic entries, or the symbol table, or the
-            version strings.  */
-         s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC)
-                                            ? ".dynstr" : ".gnu.libstr");
-         if (s != NULL)
-           d->this_hdr.sh_link = elf_section_data (s)->this_idx;
-         break;
-
        case SHT_HASH:
        case SHT_GNU_versym:
          /* sh_link is the section header index of the symbol table
@@ -3880,8 +3876,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
   if (alloc != 0 && count > alloc)
     {
       ((*_bfd_error_handler)
-       (_("%B: Not enough room for program headers (allocated %u, need %u)"),
-       abfd, alloc, count));
+       (_("%s: Not enough room for program headers (allocated %u, need %u)"),
+       bfd_get_filename (abfd), alloc, count));
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -3920,63 +3916,32 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
        qsort (m->sections, (size_t) m->count, sizeof (asection *),
               elf_sort_sections);
 
-      /* An ELF segment (described by Elf_Internal_Phdr) may contain a
-        number of sections with contents contributing to both p_filesz
-        and p_memsz, followed by a number of sections with no contents
-        that just contribute to p_memsz.  In this loop, OFF tracks next
-        available file offset for PT_LOAD and PT_NOTE segments.  VOFF is
-        an adjustment we use for segments that have no file contents
-        but need zero filled memory allocation.  */
-      voff = 0;
       p->p_type = m->p_type;
       p->p_flags = m->p_flags;
 
       if (p->p_type == PT_LOAD
-         && m->count > 0)
+         && m->count > 0
+         && (m->sections[0]->flags & SEC_ALLOC) != 0)
        {
-         bfd_size_type align;
-         bfd_vma adjust;
-
          if ((abfd->flags & D_PAGED) != 0)
-           align = bed->maxpagesize;
+           off += vma_page_aligned_bias (m->sections[0]->vma, off,
+                                         bed->maxpagesize);
          else
            {
-             unsigned int align_power = 0;
+             bfd_size_type align;
+
+             align = 0;
              for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
                {
-                 unsigned int secalign;
+                 bfd_size_type secalign;
 
                  secalign = bfd_get_section_alignment (abfd, *secpp);
-                 if (secalign > align_power)
-                   align_power = secalign;
+                 if (secalign > align)
+                   align = secalign;
                }
-             align = (bfd_size_type) 1 << align_power;
-           }
 
-         adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align);
-         off += adjust;
-         if (adjust != 0
-             && !m->includes_filehdr
-             && !m->includes_phdrs
-             && (ufile_ptr) off >= align)
-           {
-             /* If the first section isn't loadable, the same holds for
-                any other sections.  Since the segment won't need file
-                space, we can make p_offset overlap some prior segment.
-                However, .tbss is special.  If a segment starts with
-                .tbss, we need to look at the next section to decide
-                whether the segment has any loadable sections.  */
-             i = 0;
-             while ((m->sections[i]->flags & SEC_LOAD) == 0)
-               {
-                 if ((m->sections[i]->flags & SEC_THREAD_LOCAL) == 0
-                     || ++i >= m->count)
-                   {
-                     off -= adjust;
-                     voff = adjust - align;
-                     break;
-                   }
-               }
+             off += vma_page_aligned_bias (m->sections[0]->vma, off,
+                                           1 << align);
            }
        }
       /* Make sure the .dynamic section is the first section in the
@@ -3986,8 +3951,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
               && strcmp (m->sections[0]->name, ".dynamic") != 0)
        {
          _bfd_error_handler
-           (_("%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"),
-            abfd);
+           (_("%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;
        }
@@ -4030,8 +3995,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
              if (p->p_vaddr < (bfd_vma) off)
                {
                  (*_bfd_error_handler)
-                   (_("%B: Not enough room for program headers, try linking with -N"),
-                    abfd);
+                   (_("%s: Not enough room for program headers, try linking with -N"),
+                    bfd_get_filename (abfd));
                  bfd_set_error (bfd_error_bad_value);
                  return FALSE;
                }
@@ -4089,7 +4054,7 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
          || (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core))
        {
          if (! m->includes_filehdr && ! m->includes_phdrs)
-           p->p_offset = off + voff;
+           p->p_offset = off;
          else
            {
              file_ptr adjust;
@@ -4100,6 +4065,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
            }
        }
 
+      voff = off;
+
       for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
        {
          asection *sec;
@@ -4110,97 +4077,117 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
          flags = sec->flags;
          align = 1 << bfd_get_section_alignment (abfd, sec);
 
-         if (p->p_type == PT_LOAD
-             || p->p_type == PT_TLS)
+         /* The section may have artificial alignment forced by a
+            link script.  Notice this case by the gap between the
+            cumulative phdr lma and the section's lma.  */
+         if (p->p_paddr + p->p_memsz < sec->lma)
+           {
+             bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz);
+
+             p->p_memsz += adjust;
+             if (p->p_type == PT_LOAD
+                 || (p->p_type == PT_NOTE
+                     && bfd_get_format (abfd) == bfd_core))
+               {
+                 off += adjust;
+                 voff += adjust;
+               }
+             if ((flags & SEC_LOAD) != 0
+                 || (flags & SEC_THREAD_LOCAL) != 0)
+               p->p_filesz += adjust;
+           }
+
+         if (p->p_type == PT_LOAD)
            {
              bfd_signed_vma adjust;
 
              if ((flags & SEC_LOAD) != 0)
                {
-                 adjust = sec->lma - (p->p_paddr + p->p_filesz);
+                 adjust = sec->lma - (p->p_paddr + p->p_memsz);
                  if (adjust < 0)
-                   {
-                     (*_bfd_error_handler)
-                       (_("%B: section %A lma 0x%lx overlaps previous sections"),
-                        abfd, sec, (unsigned long) sec->lma);
-                     adjust = 0;
-                   }
-                 off += adjust;
-                 p->p_filesz += adjust;
-                 p->p_memsz += adjust;
+                   adjust = 0;
                }
-             /* .tbss is special.  It doesn't contribute to p_memsz of
-                normal segments.  */
-             else if ((flags & SEC_THREAD_LOCAL) == 0
-                      || p->p_type == PT_TLS)
+             else if ((flags & SEC_ALLOC) != 0)
                {
                  /* The section VMA must equal the file position
-                    modulo the page size.  */
-                 bfd_size_type page = align;
+                    modulo the page size.  FIXME: I'm not sure if
+                    this adjustment is really necessary.  We used to
+                    not have the SEC_LOAD case just above, and then
+                    this was necessary, but now I'm not sure.  */
                  if ((abfd->flags & D_PAGED) != 0)
-                   page = bed->maxpagesize;
-                 adjust = vma_page_aligned_bias (sec->vma,
-                                                 p->p_vaddr + p->p_memsz,
-                                                 page);
+                   adjust = vma_page_aligned_bias (sec->vma, voff,
+                                                   bed->maxpagesize);
+                 else
+                   adjust = vma_page_aligned_bias (sec->vma, voff,
+                                                   align);
+               }
+             else
+               adjust = 0;
+
+             if (adjust != 0)
+               {
+                 if (i == 0)
+                   {
+                     (* _bfd_error_handler) (_("\
+Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x"),
+                                             bfd_section_name (abfd, sec),
+                                             sec->lma,
+                                             p->p_paddr);
+                     return FALSE;
+                   }
                  p->p_memsz += adjust;
+                 off += adjust;
+                 voff += adjust;
+                 if ((flags & SEC_LOAD) != 0)
+                   p->p_filesz += adjust;
                }
+
+             sec->filepos = off;
+
+             /* We check SEC_HAS_CONTENTS here because if NOLOAD is
+                 used in a linker script we may have a section with
+                 SEC_LOAD clear but which is supposed to have
+                 contents.  */
+             if ((flags & SEC_LOAD) != 0
+                 || (flags & SEC_HAS_CONTENTS) != 0)
+               off += sec->size;
+
+             if ((flags & SEC_ALLOC) != 0
+                 && ((flags & SEC_LOAD) != 0
+                     || (flags & SEC_THREAD_LOCAL) == 0))
+               voff += sec->size;
            }
 
          if (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core)
            {
-             /* The section at i == 0 is the one that actually contains
-                everything.  */
+             /* The actual "note" segment has i == 0.
+                This is the one that actually contains everything.  */
              if (i == 0)
                {
                  sec->filepos = off;
-                 off += sec->size;
                  p->p_filesz = sec->size;
-                 p->p_memsz = 0;
-                 p->p_align = 1;
+                 off += sec->size;
+                 voff = off;
                }
              else
                {
-                 /* The rest are fake sections that shouldn't be written.  */
+                 /* Fake sections -- don't need to be written.  */
                  sec->filepos = 0;
                  sec->size = 0;
-                 sec->flags = 0;
-                 continue;
+                 flags = sec->flags = 0;
                }
+             p->p_memsz = 0;
+             p->p_align = 1;
            }
          else
            {
-             if (p->p_type == PT_LOAD)
-               {
-                 sec->filepos = off;
-                 /* FIXME: The SEC_HAS_CONTENTS test here dates back to
-                    1997, and the exact reason for it isn't clear.  One
-                    plausible explanation is that it is to work around
-                    a problem we have with linker scripts using data
-                    statements in NOLOAD sections.  I don't think it
-                    makes a great deal of sense to have such a section
-                    assigned to a PT_LOAD segment, but apparently
-                    people do this.  The data statement results in a
-                    bfd_data_link_order being built, and these need
-                    section contents to write into.  Eventually, we get
-                    to _bfd_elf_write_object_contents which writes any
-                    section with contents to the output.  Make room
-                    here for the write, so that following segments are
-                    not trashed.  */
-                 if ((flags & SEC_LOAD) != 0
-                     || (flags & SEC_HAS_CONTENTS) != 0)
-                   off += sec->size;
-               }
+             if ((sec->flags & SEC_LOAD) != 0
+                 || (sec->flags & SEC_THREAD_LOCAL) == 0
+                 || p->p_type == PT_TLS)
+             p->p_memsz += sec->size;
 
              if ((flags & SEC_LOAD) != 0)
-               {
-                 p->p_filesz += sec->size;
-                 p->p_memsz += sec->size;
-               }
-             /* .tbss is special.  It doesn't contribute to p_memsz of
-                normal segments.  */
-             else if ((flags & SEC_THREAD_LOCAL) == 0
-                      || p->p_type == PT_TLS)
-               p->p_memsz += sec->size;
+               p->p_filesz += sec->size;
 
              if (p->p_type == PT_TLS
                  && sec->size == 0
@@ -4516,8 +4503,8 @@ assign_file_positions_except_relocs (bfd *abfd,
          else if ((hdr->sh_flags & SHF_ALLOC) != 0)
            {
              ((*_bfd_error_handler)
-              (_("%B: warning: allocated section `%s' not in segment"),
-               abfd,
+              (_("%s: warning: allocated section `%s' not in segment"),
+               bfd_get_filename (abfd),
                (hdr->bfd_section == NULL
                 ? "*unknown*"
                 : hdr->bfd_section->name)));
@@ -6318,6 +6305,9 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
 
       q = (elf_symbol_type *) *p;
 
+      if (bfd_get_section (&q->symbol) != section)
+       continue;
+
       switch (ELF_ST_TYPE (q->internal_elf_sym.st_info))
        {
        default:
@@ -6327,7 +6317,7 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
          break;
        case STT_NOTYPE:
        case STT_FUNC:
-         if (bfd_get_section (&q->symbol) == section
+         if (q->symbol.section == section
              && q->symbol.value >= low_func
              && q->symbol.value <= offset)
            {
@@ -7746,7 +7736,7 @@ _bfd_elf_rel_local_sym (bfd *abfd,
 
 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)
 {
@@ -7756,7 +7746,7 @@ _bfd_elf_section_offset (bfd *abfd,
       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, info, sec, offset);
+      return _bfd_elf_eh_frame_section_offset (abfd, sec, offset);
     default:
       return offset;
     }
index 88636d2c055334a5d1427ec6de418f6aa35bb5db..ac3ec95be3f579309604eb15e53f7ea08755bdf6 100644 (file)
@@ -25,9 +25,9 @@
 typedef unsigned long int insn32;
 typedef unsigned short int insn16;
 
-/* In lieu of proper flags, assume all EABIv4 objects are interworkable.  */
+/* In leiu of proper flags, assume all EABIv3 objects are interworkable.  */
 #define INTERWORK_FLAG(abfd)  \
-  (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER4 \
+  (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER3 \
   || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK))
 
 /* The linker script knows the section names for placement.
@@ -186,9 +186,6 @@ struct elf32_arm_link_hash_table
        Nonzero if R_ARM_TARGET1 means R_ARM_ABS32.  */
     int target1_is_rel;
 
-    /* The relocation to use for R_ARM_TARGET2 relocations.  */
-    int target2_reloc;
-
     /* The number of bytes in the initial entry in the PLT.  */
     bfd_size_type plt_header_size;
 
@@ -381,7 +378,6 @@ elf32_arm_link_hash_table_create (bfd *abfd)
   ret->no_pipeline_knowledge = 0;
   ret->byteswap_code = 0;
   ret->target1_is_rel = 0;
-  ret->target2_reloc = R_ARM_NONE;
 #ifdef FOUR_WORD_PLT
   ret->plt_header_size = 16;
   ret->plt_entry_size = 16;
@@ -761,7 +757,8 @@ bfd_boolean
 bfd_elf32_arm_process_before_allocation (bfd *abfd,
                                         struct bfd_link_info *link_info,
                                         int no_pipeline_knowledge,
-                                        int byteswap_code)
+                                        int byteswap_code,
+                                        int target1_is_rel)
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs = NULL;
@@ -784,7 +781,7 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd,
   BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
 
   globals->no_pipeline_knowledge = no_pipeline_knowledge;
-
+  globals->target1_is_rel = target1_is_rel;
   if (byteswap_code && !bfd_big_endian (abfd))
     {
       _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."),
@@ -909,34 +906,6 @@ error_return:
 }
 #endif
 
-
-#ifndef OLD_ARM_ABI
-/* Set target relocation values needed during linking.  */
-
-void
-bfd_elf32_arm_set_target_relocs (struct bfd_link_info *link_info,
-                                int target1_is_rel,
-                                char * target2_type)
-{
-  struct elf32_arm_link_hash_table *globals;
-
-  globals = elf32_arm_hash_table (link_info);
-
-  globals->target1_is_rel = target1_is_rel;
-  if (strcmp (target2_type, "rel") == 0)
-    globals->target2_reloc = R_ARM_REL32;
-  else if (strcmp (target2_type, "abs") == 0)
-    globals->target2_reloc = R_ARM_ABS32;
-  else if (strcmp (target2_type, "got-rel") == 0)
-    globals->target2_reloc = R_ARM_GOT_PREL;
-  else
-    {
-      _bfd_error_handler (_("Invalid TARGET2 relocation type '%s'."),
-                         target2_type);
-    }
-}
-#endif
-
 /* The thumb form of a long branch is a bit finicky, because the offset
    encoding is split over two fields, each in it's own instruction. They
    can occur in any order. So given a thumb form of long branch, and an
@@ -1182,32 +1151,6 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info,
   return TRUE;
 }
 
-
-#ifndef OLD_ARM_ABI
-/* Some relocations map to different relocations depending on the
-   target.  Return the real relocation.  */
-static int
-arm_real_reloc_type (struct elf32_arm_link_hash_table * globals,
-                    int r_type)
-{
-  switch (r_type)
-    {
-    case R_ARM_TARGET1:
-      if (globals->target1_is_rel)
-       return R_ARM_REL32;
-      else
-       return R_ARM_ABS32;
-
-    case R_ARM_TARGET2:
-      return globals->target2_reloc;
-
-    default:
-      return r_type;
-    }
-}
-#endif /* OLD_ARM_ABI */
-
-
 /* Perform a relocation as part of a final link.  */
 
 static bfd_reloc_status_type
@@ -1243,9 +1186,15 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
 #ifndef OLD_ARM_ABI
   /* Some relocation type map to different relocations depending on the
      target.  We pick the right one here.  */
-  r_type = arm_real_reloc_type (globals, r_type);
-  if (r_type != howto->type)
-    howto = elf32_arm_howto_from_type (r_type);
+  if (r_type == R_ARM_TARGET1)
+    {
+      if (globals->target1_is_rel)
+       r_type = R_ARM_REL32;
+      else
+       r_type = R_ARM_ABS32;
+      
+      howto = &elf32_arm_howto_table[r_type];
+    }
 #endif /* OLD_ARM_ABI */
 
   /* If the start address has been set, then set the EF_ARM_HASENTRY
@@ -1296,7 +1245,6 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
     case R_ARM_REL32:
 #ifndef OLD_ARM_ABI
     case R_ARM_XPC25:
-    case R_ARM_PREL31:
 #endif
     case R_ARM_PLT32:
       /* r_symndx will be zero only for relocs against symbols
@@ -1309,11 +1257,7 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
         will use the symbol's value, which may point to a PLT entry, but we
         don't need to handle that here.  If we created a PLT entry, all
         branches in this object should go to it.  */
-      if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32
-#ifndef OLD_ARM_ABI
-          && r_type != R_ARM_PREL31
-#endif
-          )
+      if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
          && h != NULL
          && splt != NULL
          && h->plt.offset != (bfd_vma) -1)
@@ -1335,11 +1279,8 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
         into the output file to be resolved at run time.  */
       if (info->shared
          && (input_section->flags & SEC_ALLOC)
-         && ((r_type != R_ARM_REL32
-#ifndef OLD_ARM_ABI
-             && r_type != R_ARM_PREL31
-#endif
-             ) || !SYMBOL_CALLS_LOCAL (info, h))
+         && (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)
@@ -1389,7 +1330,8 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                   && h->dynindx != -1
                   && (!info->shared
                       || !info->symbolic
-                      || !h->def_regular))
+                      || (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0))
            outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
          else
            {
@@ -1539,24 +1481,6 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                    + input_section->output_offset + rel->r_offset);
          value += addend;
          break;
-
-#ifndef OLD_ARM_ABI
-       case R_ARM_PREL31:
-         value -= (input_section->output_section->vma
-                   + input_section->output_offset + rel->r_offset);
-         value += signed_addend;
-         if (! h || h->root.type != bfd_link_hash_undefweak)
-           {
-             /* Check for overflow */
-             if ((value ^ (value >> 1)) & (1 << 30))
-               return bfd_reloc_overflow;
-           }
-         value &= 0x7fffffff;
-         value |= (bfd_get_32 (input_bfd, hit_data) & 0x80000000);
-         if (sym_flags == STT_ARM_TFUNC)
-           value |= 1;
-         break;
-#endif
        }
 
       bfd_put_32 (input_bfd, value, hit_data);
@@ -1846,9 +1770,6 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                                       (bfd_vma) 0);
 
     case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
-    case R_ARM_GOT_PREL:
-#endif
       /* Relocation is to the entry for this symbol in the
          global offset table.  */
       if (sgot == NULL)
@@ -1937,8 +1858,6 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
 
          value = sgot->output_offset + off;
        }
-      if (r_type != R_ARM_GOT32)
-       value += sgot->output_section->vma;
 
       return _bfd_final_link_relocate (howto, input_bfd, input_section,
                                       contents, rel->r_offset, value,
@@ -2193,8 +2112,10 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
                case R_ARM_PLT32:
 
                  if (info->shared
-                     && ((!info->symbolic && h->dynindx != -1)
-                         || !h->def_regular)
+                     && (
+                         (!info->symbolic && h->dynindx != -1)
+                         || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+                         )
                      && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
                      && ((input_section->flags & SEC_ALLOC) != 0
                          /* DWARF will emit R_ARM_ABS32 relocations in its
@@ -2202,7 +2123,8 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
                             in shared libraries.  We can't do anything
                             with them here.  */
                          || ((input_section->flags & SEC_DEBUGGING) != 0
-                             && h->def_dynamic))
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
                      )
                    relocation = 0;
                  break;
@@ -2212,15 +2134,13 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
                  break;
 
                case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
-               case R_ARM_GOT_PREL:
-#endif
                  if ((WILL_CALL_FINISH_DYNAMIC_SYMBOL
                       (elf_hash_table (info)->dynamic_sections_created,
                        info->shared, h))
                      && (!info->shared
                          || (!info->symbolic && h->dynindx != -1)
-                         || !h->def_regular))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))
                    relocation = 0;
                  break;
 
@@ -2328,7 +2248,6 @@ elf32_arm_object_p (bfd *abfd)
 }
 
 /* Function to keep ARM specific flags in the ELF header.  */
-
 static bfd_boolean
 elf32_arm_set_private_flags (bfd *abfd, flagword flags)
 {
@@ -2504,7 +2423,7 @@ elf32_arm_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
   if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags))
     {
       _bfd_error_handler
-       (_("ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"),
+       (_("ERROR: %B is compiled for EABI version %d, whereas %B is compiled for version %d"),
         ibfd, obfd,
         (in_flags & EF_ARM_EABIMASK) >> 24,
         (out_flags & EF_ARM_EABIMASK) >> 24);
@@ -2705,10 +2624,6 @@ elf32_arm_print_private_bfd_data (bfd *abfd, void * ptr)
 
     case EF_ARM_EABI_VER3:
       fprintf (file, _(" [Version3 EABI]"));
-      break;
-
-    case EF_ARM_EABI_VER4:
-      fprintf (file, _(" [Version4 EABI]"));
 
       if (flags & EF_ARM_BE8)
        fprintf (file, _(" [BE8]"));
@@ -2816,9 +2731,6 @@ elf32_arm_gc_sweep_hook (bfd *                     abfd ATTRIBUTE_UNUSED,
   const Elf_Internal_Rela *rel, *relend;
   unsigned long r_symndx;
   struct elf_link_hash_entry *h;
-  struct elf32_arm_link_hash_table * globals;
-
-  globals = elf32_arm_hash_table (info);
 
   elf_section_data (sec)->local_dynrel = NULL;
 
@@ -2828,77 +2740,62 @@ elf32_arm_gc_sweep_hook (bfd *                     abfd ATTRIBUTE_UNUSED,
 
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; rel++)
-    {
-      int r_type;
-
-      r_type = ELF32_R_TYPE (rel->r_info);
-#ifndef OLD_ARM_ABI
-      r_type = arm_real_reloc_type (globals, r_type);
-#endif
-      switch (r_type)
-       {
-       case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
-       case R_ARM_GOT_PREL:
-#endif
-         r_symndx = ELF32_R_SYM (rel->r_info);
-         if (r_symndx >= symtab_hdr->sh_info)
-           {
-             h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-             if (h->got.refcount > 0)
-               h->got.refcount -= 1;
-           }
-         else if (local_got_refcounts != NULL)
-           {
-             if (local_got_refcounts[r_symndx] > 0)
-               local_got_refcounts[r_symndx] -= 1;
-           }
-         break;
-
-       case R_ARM_ABS32:
-       case R_ARM_REL32:
-       case R_ARM_PC24:
-       case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
-       case R_ARM_PREL31:
-#endif
-         r_symndx = ELF32_R_SYM (rel->r_info);
-         if (r_symndx >= symtab_hdr->sh_info)
-           {
-             struct elf32_arm_link_hash_entry *eh;
-             struct elf32_arm_relocs_copied **pp;
-             struct elf32_arm_relocs_copied *p;
+    switch (ELF32_R_TYPE (rel->r_info))
+      {
+      case R_ARM_GOT32:
+       r_symndx = ELF32_R_SYM (rel->r_info);
+       if (r_symndx >= symtab_hdr->sh_info)
+         {
+           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+           if (h->got.refcount > 0)
+             h->got.refcount -= 1;
+         }
+       else if (local_got_refcounts != NULL)
+         {
+           if (local_got_refcounts[r_symndx] > 0)
+             local_got_refcounts[r_symndx] -= 1;
+         }
+       break;
+
+      case R_ARM_ABS32:
+      case R_ARM_REL32:
+      case R_ARM_TARGET1:
+      case R_ARM_PC24:
+      case R_ARM_PLT32:
+       r_symndx = ELF32_R_SYM (rel->r_info);
+       if (r_symndx >= symtab_hdr->sh_info)
+         {
+           struct elf32_arm_link_hash_entry *eh;
+           struct elf32_arm_relocs_copied **pp;
+           struct elf32_arm_relocs_copied *p;
 
-             h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 
-             if (h->plt.refcount > 0)
-               h->plt.refcount -= 1;
+           if (h->plt.refcount > 0)
+             h->plt.refcount -= 1;
 
-             if (r_type == R_ARM_ABS32
-#ifndef OLD_ARM_ABI
-                 || r_type == R_ARM_PREL31
-#endif
-                 || r_type == R_ARM_REL32)
-               {
-                 eh = (struct elf32_arm_link_hash_entry *) h;
+           if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32
+               || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32
+               || ELF32_R_TYPE (rel->r_info) == R_ARM_TARGET1)
+             {
+               eh = (struct elf32_arm_link_hash_entry *) h;
 
-                 for (pp = &eh->relocs_copied; (p = *pp) != NULL;
-                      pp = &p->next)
-                 if (p->section == sec)
-                   {
-                     p->count -= 1;
-                     if (p->count == 0)
-                       *pp = p->next;
-                     break;
-                   }
-               }
-           }
-         break;
+               for (pp = &eh->relocs_copied; (p = *pp) != NULL;
+                    pp = &p->next)
+               if (p->section == sec)
+                 {
+                   p->count -= 1;
+                   if (p->count == 0)
+                     *pp = p->next;
+                   break;
+                 }
+             }
+         }
+       break;
 
-       default:
-         break;
-       }
-    }
+      default:
+       break;
+      }
 
   return TRUE;
 }
@@ -2941,24 +2838,16 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
     {
       struct elf_link_hash_entry *h;
       unsigned long r_symndx;
-      int r_type;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
-      r_type = ELF32_R_TYPE (rel->r_info);
-#ifndef OLD_ARM_ABI
-      r_type = arm_real_reloc_type (htab, r_type);
-#endif
       if (r_symndx < symtab_hdr->sh_info)
         h = NULL;
       else
         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 
-      switch (r_type)
+      switch (ELF32_R_TYPE (rel->r_info))
         {
          case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
-         case R_ARM_GOT_PREL:
-#endif
            /* This symbol requires a global offset table entry.  */
            if (h != NULL)
              {
@@ -2983,9 +2872,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
                  }
                local_got_refcounts[r_symndx] += 1;
              }
-           if (r_type == R_ARM_GOT32)
-             break;
-           /* Fall through.  */
+           break;
 
          case R_ARM_GOTOFF:
          case R_ARM_GOTPC:
@@ -3000,11 +2887,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
 
          case R_ARM_ABS32:
          case R_ARM_REL32:
+         case R_ARM_TARGET1:
          case R_ARM_PC24:
          case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
-         case R_ARM_PREL31:
-#endif
            if (h != NULL)
              {
                /* If this reloc is in a read-only section, we might
@@ -3014,15 +2899,15 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
                   Tentatively set the flag for now, and correct in
                   adjust_dynamic_symbol.  */
                if (!info->shared)
-                 h->non_got_ref = 1;
+                 h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
                /* We may need a .plt entry if the function this reloc
                   refers to is in a different object.  We can't tell for
                   sure yet, because something later might force the
                   symbol local.  */
-               if (r_type == R_ARM_PC24
-                   || r_type == R_ARM_PLT32)
-                 h->needs_plt = 1;
+               if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24
+                   || ELF32_R_TYPE (rel->r_info) == R_ARM_PLT32)
+                 h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
                /* If we create a PLT entry, this relocation will reference
                   it, even if it's an ABS32 relocation.  */
@@ -3043,15 +2928,14 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
                relocs_copied field of the hash table entry.  */
            if (info->shared
                && (sec->flags & SEC_ALLOC) != 0
-               && ((r_type != R_ARM_PC24
-                    && r_type != R_ARM_PLT32
-#ifndef OLD_ARM_ABI
-                    && r_type != R_ARM_PREL31
-#endif
-                    && r_type != R_ARM_REL32)
+               && ((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_REL32
+                    && ELF32_R_TYPE (rel->r_info) != R_ARM_TARGET1)
                    || (h != NULL
                        && (! info->symbolic
-                           || !h->def_regular))))
+                           || (h->elf_link_hash_flags
+                               & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              {
                struct elf32_arm_relocs_copied *p, **head;
 
@@ -3131,11 +3015,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
                    p->count = 0;
                  }
 
-               if (r_type == R_ARM_ABS32
-#ifndef OLD_ARM_ABI
-                   || r_type == R_ARM_PREL31
-#endif
-                   || r_type == R_ARM_REL32)
+               if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32
+                   || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32
+                   || ELF32_R_TYPE (rel->r_info) == R_ARM_TARGET1)
                  p->count += 1;
              }
            break;
@@ -3168,14 +3050,6 @@ is_arm_mapping_symbol_name (const char * name)
     && (name[2] == 0);
 }
 
-/* Treat mapping symbols as special target symbols.  */
-
-static bfd_boolean
-elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym)
-{
-  return is_arm_mapping_symbol_name (sym->name);
-}
-
 /* This is a copy of elf_find_function() from elf.c except that
    ARM mapping symbols are ignored when looking for function names
    and STT_ARM_TFUNC is considered to a function type.  */
@@ -3199,6 +3073,9 @@ arm_elf_find_function (bfd *         abfd ATTRIBUTE_UNUSED,
 
       q = (elf_symbol_type *) *p;
 
+      if (bfd_get_section (&q->symbol) != section)
+       continue;
+
       switch (ELF_ST_TYPE (q->internal_elf_sym.st_info))
        {
        default:
@@ -3214,7 +3091,7 @@ arm_elf_find_function (bfd *         abfd ATTRIBUTE_UNUSED,
            continue;
          /* Fall through.  */
        case STT_NOTYPE:
-         if (bfd_get_section (&q->symbol) == section
+         if (q->symbol.section == section
              && q->symbol.value >= low_func
              && q->symbol.value <= offset)
            {
@@ -3305,17 +3182,20 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || SYMBOL_CALLS_LOCAL (info, h)
@@ -3328,7 +3208,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC24 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -3344,12 +3224,12 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -3386,7 +3266,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
       srel = bfd_get_section_by_name (dynobj, ".rel.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rel);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -3442,7 +3322,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -3466,7 +3346,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -3486,13 +3366,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   if (h->got.refcount > 0)
@@ -3503,7 +3383,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -3549,9 +3429,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->root.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -3559,7 +3439,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -3853,8 +3733,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
                        splt->contents + h->plt.offset + 4 * i);
          
          /* Fill in the entry in the .rel.plt section.  */
-         rel.r_offset = (splt->output_section->vma
-                         + splt->output_offset
+         rel.r_offset = (splt->output_offset
                          + h->plt.offset + 4 * (i - 1));
          rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
        }
@@ -3911,7 +3790,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
       loc = srel->contents + plt_index * sizeof (Elf32_External_Rel);
       bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -3920,7 +3799,8 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
             Otherwise, the PLT entry would provide a definition for
             the symbol even if the symbol wasn't defined anywhere,
             and so the symbol would never be NULL.  */
-         if (!h->ref_regular_nonweak)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
            sym->st_value = 0;
        }
     }
@@ -3964,7 +3844,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
       bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection * s;
       Elf_Internal_Rela rel;
@@ -4047,16 +3927,7 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info
            case DT_SYMTAB:
              name = ".dynsym";
              goto get_vma_if_bpabi;
-           case DT_VERSYM:
-             name = ".gnu.version";
-             goto get_vma_if_bpabi;
-           case DT_VERDEF:
-             name = ".gnu.version_d";
-             goto get_vma_if_bpabi;
-           case DT_VERNEED:
-             name = ".gnu.version_r";
-             goto get_vma_if_bpabi;
-
+             
            case DT_PLTGOT:
              name = ".got";
              goto get_vma;
@@ -4255,6 +4126,9 @@ elf32_arm_reloc_type_class (const Elf_Internal_Rela *rela)
     }
 }
 
+static bfd_boolean elf32_arm_section_flags           (flagword *, const Elf_Internal_Shdr *);
+static void        elf32_arm_final_write_processing  (bfd *, bfd_boolean);
+
 /* Set the right machine number for an Arm ELF file.  */
 
 static bfd_boolean
@@ -4272,65 +4146,6 @@ elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED
   bfd_arm_update_notes (abfd, ARM_NOTE_SECTION);
 }
 
-/* Return TRUE if this is an unwinding table entry.  */
-
-static bfd_boolean
-is_arm_elf_unwind_section_name (bfd * abfd ATTRIBUTE_UNUSED, const char * name)
-{
-  size_t len1, len2;
-
-  len1 = sizeof (ELF_STRING_ARM_unwind) - 1;
-  len2 = sizeof (ELF_STRING_ARM_unwind_once) - 1;
-  return (strncmp (name, ELF_STRING_ARM_unwind, len1) == 0
-         || strncmp (name, ELF_STRING_ARM_unwind_once, len2) == 0);
-}
-
-
-/* Set the type and flags for an ARM section.  We do this by
-   the section name, which is a hack, but ought to work.  */
-
-static bfd_boolean
-elf32_arm_fake_sections (bfd * abfd, Elf_Internal_Shdr * hdr, asection * sec)
-{
-  const char * name;
-
-  name = bfd_get_section_name (abfd, sec);
-
-  if (is_arm_elf_unwind_section_name (abfd, name))
-    {
-      hdr->sh_type = SHT_ARM_EXIDX;
-      hdr->sh_flags |= SHF_LINK_ORDER;
-    }
-  return TRUE;
-}
-
-/* Handle an ARM specific section when reading an object file.
-   This is called when elf.c finds a section with an unknown type.  */
-
-static bfd_boolean
-elf32_arm_section_from_shdr (bfd *abfd,
-                            Elf_Internal_Shdr * hdr,
-                            const char *name)
-{
-  /* There ought to be a place to keep ELF backend specific flags, but
-     at the moment there isn't one.  We just keep track of the
-     sections by their name, instead.  Fortunately, the ABI gives
-     names for all the ARM specific sections, so we will probably get
-     away with this.  */
-  switch (hdr->sh_type)
-    {
-    case SHT_ARM_EXIDX:
-      break;
-
-    default:
-      return FALSE;
-    }
-
-  if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
-    return FALSE;
-
-  return TRUE;
-}
 
 /* Called for each symbol.  Builds a section map based on mapping symbols.
    Does not alter any of the symbols.  */
@@ -4485,7 +4300,6 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec,
 #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 bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol
 
 #define elf_backend_get_symbol_type             elf32_arm_get_symbol_type
 #define elf_backend_gc_mark_hook                elf32_arm_gc_mark_hook
@@ -4503,8 +4317,6 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec,
 #define elf_backend_reloc_type_class           elf32_arm_reloc_type_class
 #define elf_backend_object_p                   elf32_arm_object_p
 #define elf_backend_section_flags              elf32_arm_section_flags
-#define elf_backend_fake_sections              elf32_arm_fake_sections
-#define elf_backend_section_from_shdr                  elf32_arm_section_from_shdr
 #define elf_backend_final_write_processing      elf32_arm_final_write_processing
 #define elf_backend_copy_indirect_symbol        elf32_arm_copy_indirect_symbol
 
index f0c88dcc6dff519a229420c2b9f07e2dc151c2ee..ae8b3d204e648873642631e5c12db7da5347577b 100644 (file)
@@ -905,7 +905,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                 other targets.  */
              if (info->shared
                  && ((! info->symbolic && h->dynindx != -1)
-                     || !h->def_regular)
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)
                  && (input_section->flags & SEC_ALLOC) != 0
                  && (r_type == R_CRIS_8
                      || r_type == R_CRIS_16
@@ -966,9 +967,11 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          if (h != NULL
              && (h->got.offset == (bfd_vma) -1
                  || (!info->shared
-                     && !(h->def_regular
-                          || (!h->def_dynamic
-                              && h->root.type == bfd_link_hash_undefweak)))))
+                     && !((h->elf_link_hash_flags
+                           & ELF_LINK_HASH_DEF_REGULAR) != 0
+                          || ((h->elf_link_hash_flags
+                               & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+                             && h->root.type == bfd_link_hash_undefweak)))))
            {
              (*_bfd_error_handler)
                ((h->got.offset == (bfd_vma) -1)
@@ -1008,12 +1011,13 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
                if (!elf_hash_table (info)->dynamic_sections_created
                    || (! info->shared
-                       && (h->def_regular
+                       && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                            || h->type == STT_FUNC
-                           || h->needs_plt))
+                           || (h->elf_link_hash_flags
+                               & ELF_LINK_HASH_NEEDS_PLT)))
                    || (info->shared
                        && (info->symbolic || h->dynindx == -1)
-                       && h->def_regular))
+                       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                  {
                    /* This wasn't checked above for ! info->shared, but
                       must hold there if we get here; the symbol must
@@ -1021,9 +1025,11 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                       or be a function or otherwise need a PLT.  */
                    BFD_ASSERT (!elf_hash_table (info)->dynamic_sections_created
                                || info->shared
-                               || h->def_regular
+                               || (h->elf_link_hash_flags
+                                   & ELF_LINK_HASH_DEF_REGULAR) != 0
                                || h->type == STT_FUNC
-                               || h->needs_plt
+                               || (h->elf_link_hash_flags
+                                   & ELF_LINK_HASH_NEEDS_PLT)
                                || h->root.type == bfd_link_hash_undefweak);
 
                    /* This is actually a static link, or it is a
@@ -1127,8 +1133,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          if (h != NULL
              && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
              && !(!info->shared
-                  && (h->def_regular
-                      || (!h->def_dynamic
+                  && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+                      || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
                           && h->root.type == bfd_link_hash_undefweak))))
            {
              (*_bfd_error_handler)
@@ -1230,7 +1236,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                   && r_type != R_CRIS_16_PCREL
                   && r_type != R_CRIS_32_PCREL)
                  || (!info->symbolic
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
@@ -1293,7 +1300,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                 become local.  */
              else if (h != NULL
                       && ((! info->symbolic && h->dynindx != -1)
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  BFD_ASSERT (h->dynindx != -1);
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
@@ -1507,7 +1515,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
          bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
        }
 
-      if (!h->def_regular)
+      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.  */
@@ -1521,7 +1529,8 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
             Otherwise, the PLT entry would provide a definition for
             the symbol even if the symbol wasn't defined anywhere,
             and so the symbol would never be NULL.  */
-         if (!h->ref_regular_nonweak)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
            sym->st_value = 0;
        }
     }
@@ -1535,7 +1544,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
       && (info->shared
          || (h->dynindx != -1
              && h->plt.offset == (bfd_vma) -1
-             && !h->def_regular
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
              && h->root.type != bfd_link_hash_undefweak)))
     {
       asection *sgot;
@@ -1563,7 +1572,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
       if (! elf_hash_table (info)->dynamic_sections_created
          || (info->shared
              && (info->symbolic || h->dynindx == -1)
-             && h->def_regular))
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
        {
          rela.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE);
          rela.r_addend = bfd_get_signed_32 (output_bfd, where);
@@ -1580,7 +1589,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
@@ -2023,17 +2032,20 @@ elf_cris_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       /* If we link a program (not a DSO), we'll get rid of unnecessary
         PLT entries; we point to the actual symbols -- even for pic
@@ -2042,15 +2054,15 @@ elf_cris_adjust_dynamic_symbol (info, h)
         symbols.
         FIXME: m68k and i386 differ here, for unclear reasons.  */
       if (! info->shared
-         && !h->def_dynamic)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
        {
          /* This case can occur if we saw a PLT reloc in an input file,
             but the symbol was not defined by a dynamic object.  In such
             a case, we don't actually need to build a procedure linkage
             table, and we can just do an absolute or PC reloc instead, or
             change a .got.plt index to a .got index for GOTPLT relocs.  */
-         BFD_ASSERT (h->needs_plt);
-         h->needs_plt = 0;
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          h->plt.offset = (bfd_vma) -1;
          return
            elf_cris_adjust_gotplt_to_got ((struct
@@ -2071,7 +2083,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
       /* GC or folding may have rendered this entry unused.  */
       if (h->plt.refcount <= 0)
        {
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -2095,7 +2107,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
         not generating a shared library, then set the symbol to this
         location in the .plt.  */
       if (!info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = s->size;
@@ -2162,12 +2174,12 @@ elf_cris_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -2183,7 +2195,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* We must allocate the symbol in our .dynbss section, which will
@@ -2210,7 +2222,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* Historic precedent: m68k and i386 allow max 8-byte alignment for the
@@ -2466,7 +2478,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
          if (h == NULL)
            continue;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount++;
          break;
 
@@ -2498,7 +2510,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
        case R_CRIS_32_PCREL:
          if (h != NULL)
            {
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
              /* Make sure a plt entry is created for this symbol if it
                 turns out to be a function defined by a dynamic object.  */
@@ -2546,7 +2558,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
                 we can't identify at this time.  */
              if (info->symbolic
                  && h->root.type != bfd_link_hash_defweak
-                 && h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
                break;
            }
 
@@ -2856,8 +2868,8 @@ elf_cris_discard_excess_dso_dynamics (h, inf)
   /* 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.def_regular
-      && (h->root.forced_local
+  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)
@@ -2886,7 +2898,7 @@ elf_cris_discard_excess_program_dynamics (h, inf)
      (or rather, not defined by a DSO) then lose the reloc for the .got
      (don't allocate room for it).  Likewise for relocs for something
      for which we create a PLT.  */
-  if (!h->root.def_dynamic
+  if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
       || h->root.plt.refcount > 0)
     {
       if (h->root.got.refcount > 0
@@ -2913,8 +2925,8 @@ elf_cris_discard_excess_program_dynamics (h, inf)
         introduce new problems.  Of course we don't do this if we're
         exporting all dynamic symbols.  */
       if (! info->export_dynamic
-         && !h->root.def_dynamic
-         && !h->root.ref_dynamic)
+         && (h->root.elf_link_hash_flags
+             & (ELF_LINK_HASH_DEF_DYNAMIC|ELF_LINK_HASH_REF_DYNAMIC)) == 0)
        {
          h->root.dynindx = -1;
          _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
@@ -2960,7 +2972,7 @@ cris_elf_print_private_bfd_data (abfd, ptr)
 {
   FILE *file = (FILE *) ptr;
 
-  BFD_ASSERT (abfd != NULL && ptr != NULL);
+  BFD_ASSERT (abfd != NULL && ptr != NULL)
 
   _bfd_elf_print_private_bfd_data (abfd, ptr);
 
index 53deac7d09c1ea5093cc9732730668674db51691..9341fe8acca22d6b25f737fea606c892b640857f 100644 (file)
@@ -832,7 +832,7 @@ frvfdpic_relocs_info_for_global (struct htab *ht,
 
 /* 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.  */
+   entry if none existed.  */  
 inline static struct frvfdpic_relocs_info *
 frvfdpic_relocs_info_for_local (struct htab *ht,
                                bfd *abfd,
@@ -1021,7 +1021,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
                                       asection *sec,
                                       Elf_Internal_Sym *sym,
                                       bfd_vma addend)
-
+                                 
 {
   bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
   int dynindx = -1;
@@ -1099,7 +1099,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
                                 ->output_section->vma
                                 + frvfdpic_got_section (info)->output_offset,
                                 R_FRV_32, idx, ad, entry);
-
+       
       bfd_put_32 (output_bfd, ad,
                  frvfdpic_got_section (info)->contents
                  + frvfdpic_got_initial_offset (info)
@@ -1112,7 +1112,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
     {
       int reloc, idx;
       bfd_vma ad = 0;
-
+      
       if (! (entry->symndx == -1
             && entry->d.h->root.type == bfd_link_hash_undefweak
             && FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
@@ -1285,7 +1285,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
        {
          if (ad)
            return FALSE;
-
+         
          fd_lazy_rel_offset = ofst;
 
          /* A function descriptor used for lazy or local resolving is
@@ -1297,7 +1297,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
          lowword = entry->lzplt_entry + 4
            + frvfdpic_plt_section (info)->output_offset
            + frvfdpic_plt_section (info)->output_section->vma;
-         highword = _frvfdpic_osec_to_segment
+         highword = _frvfdpic_osec_to_segment 
            (output_bfd, frvfdpic_plt_section (info)->output_section);
        }
       else
@@ -2095,14 +2095,14 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
          relocation = picrel->got_entry;
          check_segment[0] = check_segment[1] = got_segment;
          break;
-
+         
        case R_FRV_FUNCDESC_GOT12:
        case R_FRV_FUNCDESC_GOTHI:
        case R_FRV_FUNCDESC_GOTLO:
          relocation = picrel->fdgot_entry;
          check_segment[0] = check_segment[1] = got_segment;
          break;
-
+         
        case R_FRV_GOTOFFHI:
        case R_FRV_GOTOFF12:
        case R_FRV_GOTOFFLO:
@@ -2479,7 +2479,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
          if (! IS_FDPIC (output_bfd) || ! picrel->plt)
            break;
          /* Fall through.  */
-
+         
          /* When referencing a GOT entry, a function descriptor or a
             PLT, we don't want the addend to apply to the reference,
             but rather to the referenced symbol.  The actual entry
@@ -2497,7 +2497,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
          /* Note that we only want GOTOFFHI, not GOTOFFLO or GOTOFF12
             here, since we do want to apply the addend to the others.
             Note that we've applied the addend to GOTOFFHI before we
-            shifted it right.  */
+            shifted it right.  */ 
        case R_FRV_GOTOFFHI:
          relocation -= rel->r_addend;
          break;
@@ -2755,7 +2755,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
             bed->collect, &bh)))
        return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       /* Machine-specific: we want the symbol for executables as
@@ -2814,7 +2814,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
         bed->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   /* Machine-specific: we want the symbol for executables as well.  */
@@ -2869,7 +2869,7 @@ elf32_frvfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
              FALSE, get_elf_backend_data (abfd)->collect, &bh)))
        return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (! info->executable
@@ -3147,7 +3147,7 @@ _frvfdpic_compute_got_alloc_data (struct _frvfdpic_dynamic_got_alloc_data *gad,
       odd = cur + got;
       got += 4;
     }
-
+  
   /* Compute the tentative boundaries of this range.  */
   gad->max = cur + got;
   gad->min = fdcur - fd;
@@ -3222,7 +3222,7 @@ inline static bfd_signed_vma
 _frvfdpic_get_got_entry (struct _frvfdpic_dynamic_got_alloc_data *gad)
 {
   bfd_signed_vma ret;
-
+  
   if (gad->odd)
     {
       /* If there was an odd word left behind, use it.  */
@@ -3301,7 +3301,7 @@ _frvfdpic_assign_got_entries (void **entryp, void *info_)
     }
   else if (entry->privfd)
     entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
-
+  
   return 1;
 }
 
@@ -3331,7 +3331,7 @@ _frvfdpic_assign_plt_entries (void **entryp, void *info_)
        }
       else
        {
-         BFD_ASSERT (dinfo->gothilo.fdplt);
+         BFD_ASSERT (dinfo->gothilo.fdplt)
          entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
          dinfo->gothilo.fdplt -= 8;
        }
@@ -3370,9 +3370,9 @@ _frvfdpic_assign_plt_entries (void **entryp, void *info_)
          == FRVFDPIC_LZPLT_RESOLV_LOC)
        dinfo->g.lzplt += 4;
     }
-
+      
   return 1;
-}
+}  
 
 /* Follow indirect and warning hash entries so that each got entry
    points to the final symbol definition.  P must point to a pointer
@@ -3540,7 +3540,7 @@ elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd,
       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.  */
@@ -3571,7 +3571,7 @@ elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd,
       if (frvfdpic_gotfixup_section (info)->contents == NULL)
        return FALSE;
     }
-
+  
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       frvfdpic_pltrel_section (info)->size =
@@ -3587,7 +3587,7 @@ elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd,
            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 _frvfdpic_assign_got_entries didn't
@@ -3677,7 +3677,7 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd,
                                FALSE, FALSE, FALSE);
       if (! h || h->root.type != bfd_link_hash_defined
          || h->type != STT_OBJECT
-         || !h->def_regular)
+         || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          struct bfd_link_hash_entry *bh = NULL;
 
@@ -3689,7 +3689,7 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd,
            return FALSE;
 
          h = (struct elf_link_hash_entry *) bh;
-         h->def_regular = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
        }
 
@@ -3865,20 +3865,23 @@ elf32_frvfdpic_adjust_dynamic_symbol
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && (h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
     }
 
   return TRUE;
@@ -4145,14 +4148,14 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
          picrel = NULL;
          break;
        }
-
+      
       switch (ELF32_R_TYPE (rel->r_info))
         {
        case R_FRV_LABEL24:
          if (IS_FDPIC (abfd))
            picrel->call = 1;
          break;
-
+               
        case R_FRV_FUNCDESC_VALUE:
          picrel->relocsfdv++;
          if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
@@ -4167,11 +4170,11 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
          if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
            picrel->relocs32++;
          break;
-
+           
        case R_FRV_GOT12:
          picrel->got12 = 1;
          break;
-
+           
        case R_FRV_GOTHI:
        case R_FRV_GOTLO:
          picrel->gothilo = 1;
@@ -4180,32 +4183,32 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
        case R_FRV_FUNCDESC_GOT12:
          picrel->fdgot12 = 1;
          break;
-
+           
        case R_FRV_FUNCDESC_GOTHI:
        case R_FRV_FUNCDESC_GOTLO:
          picrel->fdgothilo = 1;
          break;
-
+           
        case R_FRV_GOTOFF12:
        case R_FRV_GOTOFFHI:
        case R_FRV_GOTOFFLO:
          picrel->gotoff = 1;
          break;
-
+           
        case R_FRV_FUNCDESC_GOTOFF12:
          picrel->fdgoff12 = 1;
          break;
-
+           
        case R_FRV_FUNCDESC_GOTOFFHI:
        case R_FRV_FUNCDESC_GOTOFFLO:
          picrel->fdgoffhilo = 1;
          break;
-
+           
        case R_FRV_FUNCDESC:
          picrel->fd = 1;
          picrel->relocsfd++;
          break;
-
+         
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_FRV_GNU_VTINHERIT:
@@ -4723,7 +4726,7 @@ frv_elf_print_private_bfd_data (abfd, ptr)
 
   if (flags & EF_FRV_FDPIC)
     fprintf (file, " -mfdpic");
-
+  
   if (flags & EF_FRV_NON_PIC_RELOCS)
     fprintf (file, " non-pic relocations");
 
index dbe6d06553e6ee8f79864356023a8c84200656e0..701c72fd3f821fb173149e726252e58d07247a61 100644 (file)
@@ -570,7 +570,7 @@ hppa_type_of_stub (asection *input_sec,
       && hash->elf.dynindx != -1
       && !hash->plabel
       && (info->shared
-         || !hash->elf.def_regular
+         || !(hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
          || hash->elf.root.type == bfd_link_hash_defweak))
     {
       /* We need an import stub.  Decide between hppa_stub_import
@@ -1019,16 +1019,15 @@ elf32_hppa_copy_indirect_symbol (const struct elf_backend_data *bed,
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -1279,7 +1278,7 @@ elf32_hppa_check_relocs (bfd *abfd,
            {
              if (h != NULL)
                {
-                 h->elf.needs_plt = 1;
+                 h->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
                  h->elf.plt.refcount += 1;
 
                  /* If this .plt entry is for a plabel, mark it so
@@ -1320,7 +1319,7 @@ elf32_hppa_check_relocs (bfd *abfd,
             so that we generate copy relocs if it turns out to be
             dynamic.  */
          if (h != NULL && !info->shared)
-           h->elf.non_got_ref = 1;
+           h->elf.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.  However, if we are
@@ -1356,13 +1355,15 @@ elf32_hppa_check_relocs (bfd *abfd,
                   || (h != NULL
                       && (!info->symbolic
                           || h->elf.root.type == bfd_link_hash_defweak
-                          || !h->elf.def_regular))))
+                          || (h->elf.elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->elf.root.type == bfd_link_hash_defweak
-                     || !h->elf.def_regular)))
+                     || (h->elf.elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf32_hppa_dyn_reloc_entry *p;
              struct elf32_hppa_dyn_reloc_entry **head;
@@ -1610,7 +1611,7 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
 {
   if (force_local)
     {
-      h->forced_local = 1;
+      h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
       if (h->dynindx != -1)
        {
          h->dynindx = -1;
@@ -1621,7 +1622,7 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
 
   if (! ((struct elf32_hppa_link_hash_entry *) h)->plabel)
     {
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
       h->plt = elf_hash_table (info)->init_refcount;
     }
 }
@@ -1643,10 +1644,10 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
-         || (h->def_regular
+         || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
              && h->root.type != bfd_link_hash_defweak
              && ! ((struct elf32_hppa_link_hash_entry *) h)->plabel
              && (!info->shared || info->symbolic)))
@@ -1660,7 +1661,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
             application or we are doing a shared symbolic link.  */
 
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -1671,15 +1672,17 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      if (h->u.weakdef->root.type != bfd_link_hash_defined
-         && h->u.weakdef->root.type != bfd_link_hash_defweak)
+      if (h->weakdef->root.type != bfd_link_hash_defined
+         && h->weakdef->root.type != bfd_link_hash_defweak)
        abort ();
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -1695,7 +1698,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   if (ELIMINATE_COPY_RELOCS)
@@ -1715,7 +1718,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -1738,7 +1741,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1791,7 +1794,7 @@ allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
          && h->type != STT_PARISC_MILLI)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -1818,13 +1821,13 @@ allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
        {
          /* No .plt entry needed.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   return TRUE;
@@ -1869,7 +1872,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
          && h->type != STT_PARISC_MILLI)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -1882,7 +1885,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       if (htab->elf.dynamic_sections_created
          && (info->shared
              || (h->dynindx != -1
-                 && !h->forced_local)))
+                 && h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
        {
          htab->srelgot->size += sizeof (Elf32_External_Rela);
        }
@@ -1929,10 +1932,10 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* For the non-shared case, discard space for relocs against
         symbols which turn out to need copy relocs or are not
         dynamic.  */
-      if (!h->non_got_ref
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
          && ((ELIMINATE_COPY_RELOCS
-              && h->def_dynamic
-              && !h->def_regular)
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1940,7 +1943,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
              && h->type != STT_PARISC_MILLI)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -1984,7 +1987,7 @@ clobber_millicode_symbols (struct elf_link_hash_entry *h,
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
   if (h->type == STT_PARISC_MILLI
-      && !h->forced_local)
+      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
     {
       elf32_hppa_hide_symbol (info, h, TRUE);
     }
@@ -2543,8 +2546,8 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
                  && (hash->elf.root.u.def.section->output_section->owner
                      == output_bfd)
                  && hash->elf.root.u.def.section->owner == input_bfd
-                 && hash->elf.def_regular
-                 && !hash->elf.forced_local
+                 && (hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+                 && !(hash->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
                  && ELF_ST_VISIBILITY (hash->elf.other) == STV_DEFAULT)
                {
                  asection *sec;
@@ -3101,7 +3104,7 @@ final_link_relocate (asection *input_section,
              && h->elf.dynindx != -1
              && !h->plabel
              && (info->shared
-                 || !h->elf.def_regular
+                 || !(h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                  || h->elf.root.type == bfd_link_hash_defweak)))
        {
          stub_entry = hppa_get_stub_entry (input_section, sym_sec,
@@ -3687,10 +3690,12 @@ elf32_hppa_relocate_section (bfd *output_bfd,
              || (!info->shared
                  && h != NULL
                  && h->elf.dynindx != -1
-                 && !h->elf.non_got_ref
+                 && (h->elf.elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
                  && ((ELIMINATE_COPY_RELOCS
-                      && h->elf.def_dynamic
-                      && !h->elf.def_regular)
+                      && (h->elf.elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf.elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->elf.root.type == bfd_link_hash_undefweak
                      || h->elf.root.type == bfd_link_hash_undefined)))
            {
@@ -3722,7 +3727,8 @@ elf32_hppa_relocate_section (bfd *output_bfd,
                           || !IS_ABSOLUTE_RELOC (r_type)
                           || !info->shared
                           || !info->symbolic
-                          || !h->elf.def_regular))
+                          || (h->elf.elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  outrel.r_info = ELF32_R_INFO (h->elf.dynindx, r_type);
                }
@@ -3888,7 +3894,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
       loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, &rel, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -3912,7 +3918,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
         relocate_section function.  */
       if (info->shared
          && (info->symbolic || h->dynindx == -1)
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          rel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32);
          rel.r_addend = (h->root.u.def.value
@@ -3933,7 +3939,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
       bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
 
index 18d4a2558e116abbc33e3ff719ea793e28d4f5bc..a44ff4c881956ae65dec5f26cb46939138eed480 100644 (file)
@@ -500,11 +500,14 @@ i370_elf_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   s = bfd_get_section_by_name (dynobj, ".rela.text");
   BFD_ASSERT (s != NULL);
@@ -513,12 +516,12 @@ i370_elf_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -566,7 +569,7 @@ i370_elf_adjust_dynamic_symbol (info, h)
        srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1215,7 +1218,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              sec = h->root.u.def.section;
              if (info->shared
                  && ((! info->symbolic && h->dynindx != -1)
-                     || !h->def_regular)
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)
                  && (input_section->flags & SEC_ALLOC) != 0
                  && (r_type == R_I370_ADDR31
                      || r_type == R_I370_COPY
@@ -1334,7 +1338,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                  become local.  */
              else if (h != NULL
                       && ((! info->symbolic && h->dynindx != -1)
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  BFD_ASSERT (h->dynindx != -1);
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
index 5763acc00e9afe005d463506fca8b64b90b28676..f689bee56bedf88ed1e7951ba4bf53cb51347d24 100644 (file)
@@ -784,17 +784,16 @@ elf_i386_copy_indirect_symbol (const struct elf_backend_data *bed,
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-      dir->pointer_equality_needed |= ind->pointer_equality_needed;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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_POINTER_EQUALITY_NEEDED));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -894,7 +893,7 @@ elf_i386_check_relocs (bfd *abfd,
          if (h == NULL)
            continue;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
          break;
 
@@ -1019,13 +1018,13 @@ elf_i386_check_relocs (bfd *abfd,
                 sections have not yet been mapped to output sections.
                 Tentatively set the flag for now, and correct in
                 adjust_dynamic_symbol.  */
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
              /* 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_386_PC32)
-               h->pointer_equality_needed = 1;
+               h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED;
            }
 
          /* If we are creating a shared library, and this is a reloc
@@ -1055,13 +1054,15 @@ elf_i386_check_relocs (bfd *abfd,
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf_i386_dyn_relocs *p;
              struct elf_i386_dyn_relocs **head;
@@ -1325,7 +1326,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || SYMBOL_CALLS_LOCAL (info, h)
@@ -1338,7 +1339,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC32 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -1354,14 +1355,16 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -1377,13 +1380,13 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -1404,7 +1407,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -1427,7 +1430,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf32_External_Rel);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1484,7 +1487,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1508,7 +1511,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -1527,13 +1530,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   /* If R_386_TLS_{IE_32,IE,GOTIE} symbol is now local to the binary,
@@ -1552,7 +1555,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1631,9 +1634,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1641,7 +1644,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -2341,9 +2344,11 @@ elf_i386_relocate_section (bfd *output_bfd,
                  && !info->shared
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && ((h->def_dynamic
-                      && !h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (((h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined)))
            {
@@ -2376,7 +2381,8 @@ elf_i386_relocate_section (bfd *output_bfd,
                       && (r_type == R_386_PC32
                           || !info->shared
                           || !info->symbolic
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
              else
                {
@@ -2906,7 +2912,7 @@ elf_i386_relocate_section (bfd *output_bfd,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        {
          (*_bfd_error_handler)
            (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
@@ -3039,7 +3045,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
       loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rel);
       bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
 
-      if (!h->def_regular)
+      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 if there were any
@@ -3050,7 +3056,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
             called from a binary, there is no need to slow down
             shared libraries because of that.  */
          sym->st_shndx = SHN_UNDEF;
-         if (!h->pointer_equality_needed)
+         if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0)
            sym->st_value = 0;
        }
     }
@@ -3096,7 +3102,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
       bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       Elf_Internal_Rela rel;
       bfd_byte *loc;
index fd259cd201be96bcb343589ee60012835c11c5c7..b7609e02ada2049e0111640eb7f7aae9d2189000 100644 (file)
@@ -1350,7 +1350,7 @@ m32r_info_to_howto_rel (abfd, cache_ptr, dst)
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (ELF32_R_TYPE(dst->r_info) <= (unsigned int) R_M32R_GNU_VTENTRY);
+  BFD_ASSERT (ELF32_R_TYPE(dst->r_info) <= (unsigned int) R_M32R_GNU_VTENTRY)
   cache_ptr->howto = &m32r_elf_howto_table[r_type];
 }
 
@@ -1783,7 +1783,7 @@ m32r_elf_create_dynamic_sections (abfd, info)
               get_elf_backend_data (abfd)->collect, &bh)))
         return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (info->shared
@@ -1954,22 +1954,25 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-              && (h->needs_plt
-                  || h->u.weakdef != NULL
-                  || (h->def_dynamic
-                      && h->ref_regular
-                      && !h->def_regular)));
+              && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                  || h->weakdef != NULL
+                  || ((h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_REF_REGULAR) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! info->shared
-          && !h->def_dynamic
-          && !h->ref_dynamic
+          && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+          && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
          && h->root.type != bfd_link_hash_undefweak
          && h->root.type != bfd_link_hash_undefined)
         {
@@ -1979,7 +1982,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
              a procedure linkage table, and we can just do a PCREL
              reloc instead.  */
           h->plt.offset = (bfd_vma) -1;
-          h->needs_plt = 0;
+          h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
         }
 
       return TRUE;
@@ -1990,12 +1993,12 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                  || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                  || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -2011,13 +2014,13 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -2034,7 +2037,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
      the copy reloc.  */
   if (p == NULL)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -2063,7 +2066,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
       srel = htab->srelbss;
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -2117,7 +2120,7 @@ allocate_dynrelocs (h, inf)
 
   eh = (struct elf_m32r_link_hash_entry *) h;
 //  if ((h->got.refcount > 0
-//      || h->forced_local)
+//      || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
 //      && eh->gotplt_refcount > 0)
 //    {
 //      /* The symbol has been forced local, or we have some direct got refs,
@@ -2133,7 +2136,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
          Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-          && !h->forced_local)
+          && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
         {
           if (! bfd_elf_link_record_dynamic_symbol (info, h))
             return FALSE;
@@ -2156,7 +2159,7 @@ allocate_dynrelocs (h, inf)
              pointers compare as equal between the normal executable and
              the shared library.  */
           if (! info->shared
-              && !h->def_regular)
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
             {
               h->root.u.def.section = s;
               h->root.u.def.value = h->plt.offset;
@@ -2175,13 +2178,13 @@ allocate_dynrelocs (h, inf)
       else
         {
           h->plt.offset = (bfd_vma) -1;
-          h->needs_plt = 0;
+          h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
         }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   if (h->got.refcount > 0)
@@ -2192,7 +2195,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
          Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-          && !h->forced_local)
+          && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
         {
           if (! bfd_elf_link_record_dynamic_symbol (info, h))
             return FALSE;
@@ -2220,8 +2223,8 @@ allocate_dynrelocs (h, inf)
 
   if (info->shared)
     {
-      if (h->def_regular
-          && (h->forced_local
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+          && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
               || info->symbolic))
         {
           struct elf_m32r_dyn_relocs **pp;
@@ -2242,9 +2245,9 @@ allocate_dynrelocs (h, inf)
          symbols which turn out to need copy relocs or are not
          dynamic.  */
 
-      if (!h->non_got_ref
-          && ((h->def_dynamic
-               && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+          && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+               && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
               || (htab->root.dynamic_sections_created
                   && (h->root.type == bfd_link_hash_undefweak
                       || h->root.type == bfd_link_hash_undefined))))
@@ -2252,7 +2255,7 @@ allocate_dynrelocs (h, inf)
           /* Make sure this symbol is output as a dynamic symbol.
              Undefined weak syms won't yet be marked as dynamic.  */
           if (h->dynindx == -1
-              && !h->forced_local)
+              && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
             {
               if (! bfd_elf_link_record_dynamic_symbol (info, h))
                 return FALSE;
@@ -2758,17 +2761,20 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                                              info->shared, h)
                           && (! info->shared
                               || (! info->symbolic && h->dynindx != -1)
-                              || !h->def_regular))
+                              || (h->elf_link_hash_flags
+                                  & ELF_LINK_HASH_DEF_REGULAR) == 0))
                       || (info->shared
                           && ((! info->symbolic && h->dynindx != -1)
-                              || !h->def_regular)
+                              || (h->elf_link_hash_flags
+                                  & ELF_LINK_HASH_DEF_REGULAR) == 0)
                           && (((r_type == R_M32R_16_RELA
                               || r_type == R_M32R_32_RELA
                               || r_type == R_M32R_24_RELA
                               || r_type == R_M32R_HI16_ULO_RELA
                               || r_type == R_M32R_HI16_SLO_RELA
                               || r_type == R_M32R_LO16_RELA)
-                                 && !h->forced_local)
+                                 && (h->elf_link_hash_flags
+                                     & ELF_LINK_FORCED_LOCAL) == 0)
                               || r_type == R_M32R_10_PCREL_RELA
                               || r_type == R_M32R_18_PCREL_RELA
                               || r_type == R_M32R_26_PCREL_RELA)
@@ -2778,7 +2784,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                  externally in shared libraries.  We can't do
                                  anything with them here.  */
                               || ((input_section->flags & SEC_DEBUGGING) != 0
-                                  && h->def_dynamic))))
+                                  && (h->elf_link_hash_flags
+                                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
                     {
                       /* In these cases, we don't need the relocation
                          value.  We check specially because in some
@@ -2828,7 +2835,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
             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.  */
 
@@ -2902,8 +2909,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                       || (info->shared
                           && (info->symbolic
                               || h->dynindx == -1
-                              || h->forced_local)
-                          && h->def_regular))
+                              || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+                          && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                     {
                       /* This is actually a static link, or it is a
                          -Bsymbolic link and the symbol is defined
@@ -2993,7 +3000,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
               //if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
               //    || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
               //  break;
-              if (h->forced_local)
+              if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
                 break;
 
               if (h->plt.offset == (bfd_vma) -1)
@@ -3032,7 +3039,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                       || (h != NULL
                           && h->dynindx != -1
                           && (! info->symbolic
-                              || !h->def_regular))))
+                              || (h->elf_link_hash_flags
+                                  & ELF_LINK_HASH_DEF_REGULAR) == 0))))
                 {
                   Elf_Internal_Rela outrel;
                   bfd_boolean skip, relocate;
@@ -3091,7 +3099,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                        become local.  */
                     if (h == NULL
                         || ((info->symbolic || h->dynindx == -1)
-                             && h->def_regular))
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_REGULAR) != 0))
                       {
                         relocate = TRUE;
                         outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
@@ -3391,7 +3400,7 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
       loc += plt_index * sizeof(Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -3424,8 +3433,8 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
       if (info->shared
           && (info->symbolic
              || h->dynindx == -1
-             || h->forced_local)
-          && h->def_regular)
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+          && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
         {
           rela.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
           rela.r_addend = (h->root.u.def.value
@@ -3446,7 +3455,7 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
       ++srela->reloc_count;
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
@@ -4271,7 +4280,7 @@ m32r_elf_print_private_bfd_data (abfd, ptr)
 {
   FILE * file = (FILE *) ptr;
 
-  BFD_ASSERT (abfd != NULL && ptr != NULL);
+  BFD_ASSERT (abfd != NULL && ptr != NULL)
 
   _bfd_elf_print_private_bfd_data (abfd, ptr);
 
@@ -4555,10 +4564,10 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
           if (h == NULL)
             continue;
 
-          if (h->forced_local)
+          if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
             break;
 
-          h->needs_plt = 1;
+          h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
           break;
 
@@ -4574,7 +4583,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
 
           if (h != NULL && !info->shared)
             {
-              h->non_got_ref = 1;
+              h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
               h->plt.refcount += 1;
             }
 
@@ -4604,12 +4613,14 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
               || (!info->shared
                   && (sec->flags & SEC_ALLOC) != 0
                   && h != NULL
                   && (h->root.type == bfd_link_hash_defweak
-                      || !h->def_regular)))
+                      || (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)))
             {
               struct elf_m32r_dyn_relocs *p;
               struct elf_m32r_dyn_relocs **head;
index 4f119035811e6c16808dfef71e2e1c90985b191c..08cc79347612dba192fa338c6f5d5484100b5f28 100644 (file)
@@ -506,7 +506,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
                {
                  /* Make sure this symbol is output as a dynamic symbol.  */
                  if (h->dynindx == -1
-                     && !h->forced_local)
+                     && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
                    {
                      if (!bfd_elf_link_record_dynamic_symbol (info, h))
                        return FALSE;
@@ -564,7 +564,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
          if (h == NULL)
            continue;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount++;
          break;
 
@@ -584,13 +584,13 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
 
          /* Make sure this symbol is output as a dynamic symbol.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (!bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
            }
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount++;
          break;
 
@@ -612,7 +612,8 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
                && h != NULL
                && (!info->symbolic
                    || h->root.type == bfd_link_hash_defweak
-                   || !h->def_regular)))
+                   || (h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              if (h != NULL)
                {
@@ -924,21 +925,24 @@ elf_m68k_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! info->shared
-         && !h->def_dynamic
-         && !h->ref_dynamic
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
          /* We must always create the plt entry if it was referenced
             by a PLTxxO relocation.  In this case we already recorded
             it as a dynamic symbol.  */
@@ -949,7 +953,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
             object.  In such a case, we don't actually need to build
             a procedure linkage table, and we can just do a PCxx
             reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -957,14 +961,14 @@ elf_m68k_adjust_dynamic_symbol (info, h)
       /* GC may have rendered this entry unused.  */
       if (h->plt.refcount <= 0)
        {
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
 
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -989,7 +993,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (!info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = s->size;
@@ -1024,12 +1028,12 @@ elf_m68k_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1067,7 +1071,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1291,9 +1295,9 @@ elf_m68k_discard_copies (h, inf)
   if (h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-  if (!h->def_regular
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
       || (!info->symbolic
-         && !h->forced_local))
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
     {
       if ((info->flags & DF_TEXTREL) == 0)
        {
@@ -1438,8 +1442,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
                    || (info->shared
                        && (info->symbolic
                            || h->dynindx == -1
-                           || h->forced_local)
-                       && h->def_regular))
+                           || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+                       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) != 0)
                  {
                    /* This is actually a static link, or it is a
                       -Bsymbolic link and the symbol is defined
@@ -1575,7 +1579,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_68K_PC32:
          if (h == NULL
              || (info->shared
-                 && h->forced_local))
+                 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
            break;
          /* Fall through.  */
        case R_68K_8:
@@ -1593,7 +1597,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
                  || (h != NULL
                      && h->dynindx != -1
                      && (!info->symbolic
-                         || !h->def_regular))))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))))
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
@@ -1625,7 +1630,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
                           || r_type == R_68K_PC32
                           || !info->shared
                           || !info->symbolic
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
                  outrel.r_addend = rel->r_addend;
@@ -1696,7 +1702,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        {
          (*_bfd_error_handler)
            (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
@@ -1848,7 +1854,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -1882,8 +1888,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
       if (info->shared
          && (info->symbolic
              || h->dynindx == -1
-             || h->forced_local)
-         && h->def_regular)
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          rela.r_info = ELF32_R_INFO (0, R_68K_RELATIVE);
          rela.r_addend = bfd_get_signed_32 (output_bfd,
@@ -1903,7 +1909,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
index edc4efc1b958f8d6f0e19545c411d87003f4d1e1..9c22c17244924d72b460c04c071c95aa24b7b54e 100644 (file)
@@ -329,16 +329,15 @@ ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -2527,7 +2526,7 @@ elf_finish_pointer_linker_section (bfd *output_bfd,
       if (! elf_hash_table (info)->dynamic_sections_created
          || (info->shared
              && info->symbolic
-             && h->def_regular))
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
        {
          /* This is actually a static link, or it is a
             -Bsymbolic link and the symbol is defined
@@ -2759,6 +2758,15 @@ ppc_elf_additional_program_headers (bfd *abfd)
 
   return ret;
 }
+
+/* Modify the segment map if needed.  */
+
+static bfd_boolean
+ppc_elf_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED,
+                           struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+  return TRUE;
+}
 \f
 /* The powerpc .got has a blrl instruction in it.  Mark it executable.  */
 
@@ -2864,15 +2872,18 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* Make sure we know what is going on here.  */
   htab = ppc_elf_hash_table (info);
   BFD_ASSERT (htab->elf.dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* Deal with function syms.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       /* Clear procedure linkage table information for any symbol that
         won't need a .plt entry.  */
@@ -2892,7 +2903,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
             3. We know for certain that a call to this symbol
             will go to this object, or will remain undefined.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
       return TRUE;
     }
@@ -2902,14 +2913,16 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -2925,7 +2938,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   if (ELIMINATE_COPY_RELOCS)
@@ -2942,7 +2955,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -2981,7 +2994,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
        srel = htab->relbss;
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -3044,7 +3057,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
     {
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -3074,7 +3087,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
             function pointers compare as equal between the normal
             executable and the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -3093,13 +3106,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   eh = (struct ppc_elf_link_hash_entry *) h;
@@ -3107,14 +3120,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
     {
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (eh->elf.dynindx == -1
-         && !eh->elf.forced_local)
+         && (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (!bfd_elf_link_record_dynamic_symbol (info, &eh->elf))
            return FALSE;
        }
 
       if (eh->tls_mask == (TLS_TLS | TLS_LD)
-         && !eh->elf.def_dynamic)
+         && !(eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
        /* If just an LD reloc, we'll just use htab->tlsld_got.offset.  */
        eh->elf.got.offset = (bfd_vma) -1;
       else
@@ -3197,7 +3210,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
          && eh->dyn_relocs != NULL
          && h->dynindx == -1
          && h->root.type == bfd_link_hash_undefweak
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -3209,14 +3222,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && h->def_dynamic
-         && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -3761,7 +3774,7 @@ ppc_elf_check_relocs (bfd *abfd,
              return FALSE;
            }
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount++;
          break;
 
@@ -3870,7 +3883,7 @@ ppc_elf_check_relocs (bfd *abfd,
              h->plt.refcount++;
 
              /* We may need a copy reloc too.  */
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
            }
 
        dodyn:
@@ -3900,13 +3913,15 @@ ppc_elf_check_relocs (bfd *abfd,
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct ppc_elf_dyn_relocs *p;
              struct ppc_elf_dyn_relocs **head;
@@ -4235,7 +4250,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
 
                is_local = FALSE;
                if (h == NULL
-                   || !h->def_dynamic)
+                   || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
                  is_local = TRUE;
 
                r_type = ELF32_R_TYPE (rel->r_info);
@@ -4463,7 +4478,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
             + reloc_index * sizeof (Elf32_External_Rela));
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -4472,12 +4487,13 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
             Otherwise, the PLT entry would provide a definition for
             the symbol even if the symbol wasn't defined anywhere,
             and so the symbol would never be NULL.  */
-         if (!h->ref_regular_nonweak)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
            sym->st_value = 0;
        }
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
@@ -5016,7 +5032,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
            indx = 0;
            if (tls_type == (TLS_TLS | TLS_LD)
                && (h == NULL
-                   || !h->def_dynamic))
+                   || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
              offp = &htab->tlsld_got.offset;
            else if (h != NULL)
              {
@@ -5059,7 +5075,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
                if (offp == &htab->tlsld_got.offset)
                  tls_m = TLS_LD;
                else if (h == NULL
-                        || !h->def_dynamic)
+                        || !(h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_DYNAMIC))
                  tls_m &= ~TLS_LD;
 
                /* We might have multiple got entries for this sym.
@@ -5178,7 +5195,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
                  {
                    if ((tls_mask & TLS_LD) != 0
                        && !(h == NULL
-                            || !h->def_dynamic))
+                            || !(h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC)))
                      off += 8;
                    if (tls_type != (TLS_TLS | TLS_GD))
                      {
@@ -5303,9 +5321,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
                  && (input_section->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && h->def_dynamic
-                 && !h->def_regular))
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
            {
              int skip;
 
@@ -5473,7 +5491,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
          BFD_ASSERT (sec != NULL);
          BFD_ASSERT (bfd_is_und_section (sec)
                      || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
-                     || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0);
+                     || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0)
 
            addend -= sec->output_section->vma + sec->output_offset + 0x8000;
          break;
@@ -5704,7 +5722,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
 
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        {
          (*_bfd_error_handler)
            (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
@@ -6214,6 +6232,7 @@ static struct bfd_elf_special_section const ppc_elf_special_sections[]=
 #define elf_backend_finish_dynamic_sections    ppc_elf_finish_dynamic_sections
 #define elf_backend_fake_sections              ppc_elf_fake_sections
 #define elf_backend_additional_program_headers ppc_elf_additional_program_headers
+#define elf_backend_modify_segment_map         ppc_elf_modify_segment_map
 #define elf_backend_grok_prstatus              ppc_elf_grok_prstatus
 #define elf_backend_grok_psinfo                        ppc_elf_grok_psinfo
 #define elf_backend_reloc_type_class           ppc_elf_reloc_type_class
index 65c27e0220f5ccee89e6be9c7e393e4d4043b9df..72ae02e83285f0f06fb52aaf096109aaee241a32 100644 (file)
@@ -899,16 +899,15 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -1069,7 +1068,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
             creating a procedure linkage table entry.  */
          if (h != NULL)
            {
-             h->needs_plt = 1;
+             h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
              h->plt.refcount += 1;
            }
          break;
@@ -1090,7 +1089,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
          if (h != NULL)
            {
              ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++;
-             h->needs_plt = 1;
+             h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
              h->plt.refcount += 1;
            }
          else
@@ -1199,7 +1198,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                 sections have not yet been mapped to output sections.
                 Tentatively set the flag for now, and correct in
                 adjust_dynamic_symbol.  */
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
              /* We may need a .plt entry if the function this reloc
                 refers to is in a shared lib.  */
@@ -1236,13 +1235,15 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf_s390_dyn_relocs *p;
              struct elf_s390_dyn_relocs **head;
@@ -1579,12 +1580,12 @@ elf_s390_adjust_dynamic_symbol (info, h)
      will fill in the contents of the procedure linkage table later
      (although we could actually do it here).  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || (! info->shared
-             && !h->def_dynamic
-             && !h->ref_dynamic
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
              && h->root.type != bfd_link_hash_undefweak
              && h->root.type != bfd_link_hash_undefined))
        {
@@ -1594,7 +1595,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC32 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
        }
 
@@ -1611,14 +1612,16 @@ elf_s390_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -1634,13 +1637,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -1661,7 +1664,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -1684,7 +1687,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1745,7 +1748,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1769,7 +1772,7 @@ allocate_dynrelocs (h, inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -1788,14 +1791,14 @@ allocate_dynrelocs (h, inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
       elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
     }
 
@@ -1828,7 +1831,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1896,9 +1899,9 @@ allocate_dynrelocs (h, inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1906,7 +1909,7 @@ allocate_dynrelocs (h, inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -2369,8 +2372,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                  || (info->shared
                      && (info->symbolic
                          || h->dynindx == -1
-                         || h->forced_local)
-                     && h->def_regular)
+                         || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+                     && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
                  || (ELF_ST_VISIBILITY (h->other)
                      && h->root.type == bfd_link_hash_undefweak))
                {
@@ -2550,9 +2553,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                  && !info->shared
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && ((h->def_dynamic
-                      && !h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined)))
            {
@@ -2588,7 +2593,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                           || r_type == R_390_PC32
                           || !info->shared
                           || !info->symbolic
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
                  outrel.r_addend = rel->r_addend;
@@ -2984,7 +2990,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd,
@@ -3188,7 +3194,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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
@@ -3225,8 +3231,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       if (info->shared
          && (info->symbolic
              || h->dynindx == -1
-             || h->forced_local)
-         && h->def_regular)
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          BFD_ASSERT((h->got.offset & 1) != 0);
          rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
@@ -3247,7 +3253,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       Elf_Internal_Rela rela;
       bfd_byte *loc;
index adce088cc4d766e08af7d7d4740e1313f7ca3470..1247c6f11ad92f378ab3ccc304ab315e1b036518 100644 (file)
@@ -505,7 +505,7 @@ sh_symbian_relocate_section (bfd *                  output_bfd,
 
              /* Allow the symbol to become local if necessary.  */
              if (new_hash->dynindx == -1)
-               new_hash->def_regular = 1;
+               new_hash->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 
              if (DEBUG)
                fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
index 4304a4ec40a22aae0d20daeb16db94462db6b08a..a5aa4ff7bc355b91efe9862a3a282b82de83990e 100644 (file)
@@ -3910,7 +3910,7 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
        return FALSE;
 
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (info->shared
@@ -4017,17 +4017,20 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (htab->root.dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || SYMBOL_CALLS_LOCAL (info, h)
@@ -4040,7 +4043,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
             a procedure linkage table, and we can just do a REL32
             reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -4051,14 +4054,16 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (info->nocopyreloc)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -4074,13 +4079,13 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -4097,7 +4102,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
      the copy reloc.  */
   if (p == NULL)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -4125,7 +4130,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       srel = htab->srelbss;
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -4177,7 +4182,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
 
   eh = (struct elf_sh_link_hash_entry *) h;
   if ((h->got.refcount > 0
-       || h->forced_local)
+      || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
       && eh->gotplt_refcount > 0)
     {
       /* The symbol has been forced local, or we have some direct got refs,
@@ -4195,7 +4200,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -4219,7 +4224,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -4238,13 +4243,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   if (h->got.refcount > 0)
@@ -4256,7 +4261,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -4294,7 +4299,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -4349,9 +4354,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->root.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -4359,7 +4364,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -4857,7 +4862,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                      && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
                      && (! info->shared
                          || (! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))
                  /* The cases above are those in which relocation is
                     overwritten in the switch block below.  The cases
                     below are those in which we must defer relocation
@@ -4865,9 +4871,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                     addresses when creating a shared library.  */
                  || (info->shared
                      && ((! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular)
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      && ((r_type == R_SH_DIR32
-                          && !h->forced_local)
+                          && (h->elf_link_hash_flags
+                              & ELF_LINK_FORCED_LOCAL) == 0)
                          || r_type == R_SH_REL32)
                      && ((input_section->flags & SEC_ALLOC) != 0
                          /* DWARF will emit R_SH_DIR32 relocations in its
@@ -4875,13 +4883,15 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                             in shared libraries.  We can't do anything
                             with them here.  */
                          || ((input_section->flags & SEC_DEBUGGING) != 0
-                             && h->def_dynamic)))
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
                  /* Dynamic relocs are not propagated for SEC_DEBUGGING
                     sections because such sections are not SEC_ALLOC and
                     thus ld.so will not process them.  */
                  || (sec->output_section == NULL
                      && ((input_section->flags & SEC_DEBUGGING) != 0
-                         && h->def_dynamic))
+                         && (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
                  || (sec->output_section == NULL
                      && (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
                          || sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
@@ -5128,7 +5138,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                     become local.  */
                  if (h == NULL
                      || ((info->symbolic || h->dynindx == -1)
-                         && h->def_regular))
+                         && (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) != 0))
                    {
                      relocate = TRUE;
                      outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
@@ -5172,7 +5183,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
             procedure linkage table.  */
 
          if (h == NULL
-             || h->forced_local
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
              || ! info->shared
              || info->symbolic
              || h->dynindx == -1
@@ -5400,7 +5411,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          if (h == NULL)
            goto final_link_relocate;
 
-         if (h->forced_local)
+         if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
            goto final_link_relocate;
 
          if (h->plt.offset == (bfd_vma) -1)
@@ -5453,7 +5464,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
              tls_type = sh_elf_hash_entry (h)->tls_type;
              if (! info->shared
                  && (h->dynindx == -1
-                     || h->def_regular))
+                     || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                r_type = R_SH_TLS_LE_32;
            }
 
@@ -6296,16 +6307,15 @@ sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
     }
 
   if (ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -6401,7 +6411,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
          && h->root.type != bfd_link_hash_undefined
          && h->root.type != bfd_link_hash_undefweak
          && (h->dynindx == -1
-             || h->def_regular))
+             || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
        r_type = R_SH_TLS_LE_32;
 
       /* Some relocs require a global offset table.  */
@@ -6598,13 +6608,13 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
             creating a procedure linkage table entry.  */
 
          if (h == NULL
-             || h->forced_local
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
              || ! info->shared
              || info->symbolic
              || h->dynindx == -1)
            goto force_got;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
          ((struct elf_sh_link_hash_entry *) h)->gotplt_refcount += 1;
 
@@ -6629,10 +6639,10 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
          if (h == NULL)
            continue;
 
-         if (h->forced_local)
+         if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
            break;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
          break;
 
@@ -6646,7 +6656,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 #endif
          if (h != NULL && ! info->shared)
            {
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
              h->plt.refcount += 1;
            }
 
@@ -6675,12 +6685,14 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (! info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf_sh_dyn_relocs *p;
              struct elf_sh_dyn_relocs **head;
@@ -7069,7 +7081,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
       loc = srel->contents + plt_index * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -7173,7 +7185,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
   }
 #endif
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rel;
index f7d8949fe3aca5d5d1f0b8a8c5ff245413cef50a..58833715af9c92cf9d62f53373d6404fedb9aa3f 100644 (file)
@@ -425,7 +425,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
            }
 
          h = (struct elf_link_hash_entry *) bh;
-         h->non_elf = 0;
+         h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
       else
index c44a50a1d3cf7c1dead157b936e4861363853654..5b8053341922b81af8bf6038da631840971410aa 100644 (file)
@@ -1098,7 +1098,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
              break;
            }
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
          if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32)
            goto r_sparc_plt32;
@@ -1108,7 +1108,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
        case R_SPARC_PC10:
        case R_SPARC_PC22:
          if (h != NULL)
-           h->non_got_ref = 1;
+           h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
          if (h != NULL
              && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
@@ -1132,7 +1132,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
        case R_SPARC_UA16:
        case R_SPARC_UA32:
          if (h != NULL)
-           h->non_got_ref = 1;
+           h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
        r_sparc_plt32:
          if (h != NULL && !info->shared)
@@ -1169,12 +1169,14 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (!info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf32_sparc_dyn_relocs *p;
              struct elf32_sparc_dyn_relocs **head;
@@ -1455,11 +1457,14 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (htab->elf.dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later
@@ -1469,7 +1474,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
      some of their functions as STT_NOTYPE when they really should be
      STT_FUNC.  */
   if (h->type == STT_FUNC
-      || h->needs_plt
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
       || (h->type == STT_NOTYPE
          && (h->root.type == bfd_link_hash_defined
              || h->root.type == bfd_link_hash_defweak)
@@ -1477,8 +1482,8 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
     {
       if (h->plt.refcount <= 0
          || (! info->shared
-             && !h->def_dynamic
-             && !h->ref_dynamic
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
              && h->root.type != bfd_link_hash_undefweak
              && h->root.type != bfd_link_hash_undefined))
        {
@@ -1488,7 +1493,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a WDISP30 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -1499,12 +1504,12 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1520,7 +1525,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   eh = (struct elf32_sparc_link_hash_entry *) h;
@@ -1535,7 +1540,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
   if (p == NULL)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -1556,7 +1561,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1615,7 +1620,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1644,7 +1649,7 @@ allocate_dynrelocs (h, inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -1659,13 +1664,13 @@ allocate_dynrelocs (h, inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   /* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary,
@@ -1684,7 +1689,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1723,8 +1728,8 @@ allocate_dynrelocs (h, inf)
 
   if (info->shared)
     {
-      if (h->def_regular
-         && (h->forced_local
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+         && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
              || info->symbolic))
        {
          struct elf32_sparc_dyn_relocs **pp;
@@ -1746,9 +1751,9 @@ allocate_dynrelocs (h, inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1756,7 +1761,7 @@ allocate_dynrelocs (h, inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -2224,8 +2229,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
                  || (info->shared
                      && (info->symbolic
                          || h->dynindx == -1
-                         || h->forced_local)
-                     && h->def_regular))
+                         || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+                     && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                {
                  /* This is actually a static link, or it is a
                     -Bsymbolic link and the symbol is defined
@@ -2373,13 +2378,16 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
                   || (h != NULL
                       && h->dynindx != -1
                       && (! info->symbolic
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (!info->shared
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && ((h->def_dynamic
-                      && !h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (((h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined)))
            {
@@ -2444,7 +2452,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
                 become local.  */
              else if (h != NULL && ! is_plt
                       && ((! info->symbolic && h->dynindx != -1)
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  BFD_ASSERT (h->dynindx != -1);
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
@@ -2840,7 +2849,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd,
@@ -3091,7 +3100,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc += (h->plt.offset / PLT_ENTRY_SIZE - 4) * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -3100,7 +3109,8 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
             Otherwise, the PLT entry would provide a definition for
             the symbol even if the symbol wasn't defined anywhere,
             and so the symbol would never be NULL.  */
-         if (!h->ref_regular_nonweak)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
            sym->st_value = 0;
        }
     }
@@ -3132,7 +3142,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
         initialized in the relocate_section function.  */
       if (info->shared
          && (info->symbolic || h->dynindx == -1)
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          asection *sec = h->root.u.def.section;
          rela.r_info = ELF32_R_INFO (0, R_SPARC_RELATIVE);
@@ -3153,7 +3163,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
@@ -3371,8 +3381,6 @@ elf32_sparc_final_write_processing (abfd, linker)
   switch (bfd_get_mach (abfd))
     {
     case bfd_mach_sparc :
-    case bfd_mach_sparc_sparclet :
-    case bfd_mach_sparc_sparclite :
       break; /* nothing to do */
     case bfd_mach_sparc_v8plus :
       elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
@@ -3391,6 +3399,7 @@ elf32_sparc_final_write_processing (abfd, linker)
                                       | EF_SPARC_SUN_US3;
       break;
     case bfd_mach_sparc_sparclite_le :
+      elf_elfheader (abfd)->e_machine = EM_SPARC;
       elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
       break;
     default :
index 9a8f0407435347558e64c699942538c7b4382075..a0249b19f3dfc97b9a956ef3fe027b76a8b4e1ac 100644 (file)
@@ -682,7 +682,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
          if (h == NULL)
            continue;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          if (h->plt.refcount == -1)
            h->plt.refcount = 1;
          else
@@ -706,7 +706,8 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
                && (sec->flags & SEC_ALLOC) != 0
                && h != NULL
                && (!info->symbolic
-                   || !h->def_regular)))
+                   || (h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              if (h != NULL)
                {
@@ -961,21 +962,24 @@ elf_vax_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! info->shared
-         && !h->def_dynamic
-         && !h->ref_dynamic
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
          /* We must always create the plt entry if it was referenced
             by a PLTxxO relocation.  In this case we already recorded
             it as a dynamic symbol.  */
@@ -986,7 +990,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
             object.  In such a case, we don't actually need to build
             a procedure linkage table, and we can just do a PCxx
             reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -994,7 +998,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
       /* GC may have rendered this entry unused.  */
       if (h->plt.refcount <= 0)
        {
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -1022,7 +1026,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (!info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = s->size;
@@ -1056,12 +1060,12 @@ elf_vax_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1099,7 +1103,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1345,7 +1349,7 @@ elf_vax_discard_copies (h, ignore)
     h = (struct elf_vax_link_hash_entry *) h->root.root.u.i.link;
 
   /* We only discard relocs for symbols defined in a regular object.  */
-  if (!h->root.def_regular)
+  if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return TRUE;
 
   for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
@@ -1500,10 +1504,12 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                      && elf_hash_table (info)->dynamic_sections_created
                      && (! info->shared
                          || (! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))
                  || (info->shared
                      && ((! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular)
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      && ((input_section->flags & SEC_ALLOC) != 0
                          /* DWARF will emit R_VAX_32 relocations in its
                             sections against symbols defined externally
@@ -1511,7 +1517,8 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                             with them here.  */
 
                          || ((input_section->flags & SEC_DEBUGGING) != 0
-                             && h->def_dynamic))
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
                      && (r_type == R_VAX_8
                          || r_type == R_VAX_16
                          || r_type == R_VAX_32
@@ -1551,7 +1558,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
 
            if (info->shared
                && h->dynindx == -1
-               && h->def_regular)
+               && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
              {
                /* The symbol was forced to be local
                   because of a version file..  We must initialize
@@ -1658,7 +1665,8 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                   && r_type != R_VAX_PC16
                   && r_type != R_VAX_PC32)
                  || (!info->symbolic
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
@@ -1706,7 +1714,8 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                  become local.  */
              else if (h != NULL
                       && ((! info->symbolic && h->dynindx != -1)
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  BFD_ASSERT (h->dynindx != -1);
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
@@ -1914,7 +1923,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -1945,7 +1954,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
         the relocate_section function.  */
       if (info->shared
          && h->dynindx == -1
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          rela.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE);
        }
@@ -1962,7 +1971,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
index 8c96348ac49cc083478923aef3575dba44f22777..e03cc77190db89644726e0d8e2e3613faa4836f7 100644 (file)
@@ -840,6 +840,10 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          sym = local_syms + r_symndx;
          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;
        }
       else
        {
@@ -851,16 +855,6 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                   unresolved_reloc, warned);
        }
 
-      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 (ELF32_R_TYPE (rel->r_info))
        {
        case R_XSTORMY16_24:
index 8d9649e3a60bbb2ba422b39bff68614fb7f3018d..cfdbd235fde78ccac7d83bb8b65fa4847d00f5c0 100644 (file)
 #include "xtensa-isa.h"
 #include "xtensa-config.h"
 
-#define XTENSA_NO_NOP_REMOVAL 0
+/* Main interface functions.  */
+static void elf_xtensa_info_to_howto_rela
+  PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+static reloc_howto_type *elf_xtensa_reloc_type_lookup
+  PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+extern int xtensa_read_table_entries
+  PARAMS ((bfd *, asection *, property_table_entry **, const char *));
+static bfd_boolean elf_xtensa_check_relocs
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+          const Elf_Internal_Rela *));
+static void elf_xtensa_hide_symbol
+  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
+static asection *elf_xtensa_gc_mark_hook
+  PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
+          struct elf_link_hash_entry *, Elf_Internal_Sym *));
+static bfd_boolean elf_xtensa_gc_sweep_hook
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+          const Elf_Internal_Rela *));
+static bfd_boolean elf_xtensa_create_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_xtensa_adjust_dynamic_symbol
+  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static bfd_boolean elf_xtensa_size_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_xtensa_modify_segment_map
+  PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_xtensa_relocate_section
+  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+          Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+static bfd_boolean elf_xtensa_relax_section
+  PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *again));
+static bfd_boolean elf_xtensa_finish_dynamic_symbol
+  PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+          Elf_Internal_Sym *));
+static bfd_boolean elf_xtensa_finish_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_xtensa_merge_private_bfd_data
+  PARAMS ((bfd *, bfd *));
+static bfd_boolean elf_xtensa_set_private_flags
+  PARAMS ((bfd *, flagword));
+extern flagword elf_xtensa_get_private_bfd_flags
+  PARAMS ((bfd *));
+static bfd_boolean elf_xtensa_print_private_bfd_data
+  PARAMS ((bfd *, PTR));
+static bfd_boolean elf_xtensa_object_p
+  PARAMS ((bfd *));
+static void elf_xtensa_final_write_processing
+  PARAMS ((bfd *, bfd_boolean));
+static enum elf_reloc_type_class elf_xtensa_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
+static bfd_boolean elf_xtensa_discard_info
+  PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *));
+static bfd_boolean elf_xtensa_ignore_discarded_relocs
+  PARAMS ((asection *));
+static bfd_boolean elf_xtensa_grok_prstatus
+  PARAMS ((bfd *, Elf_Internal_Note *));
+static bfd_boolean elf_xtensa_grok_psinfo
+  PARAMS ((bfd *, Elf_Internal_Note *));
+static bfd_boolean elf_xtensa_new_section_hook
+  PARAMS ((bfd *, asection *));
+
 
 /* Local helper functions.  */
 
-static bfd_boolean add_extra_plt_sections (bfd *, int);
-static char *build_encoding_error_message (xtensa_opcode, bfd_vma);
+static bfd_boolean xtensa_elf_dynamic_symbol_p
+  PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *));
+static int property_table_compare
+  PARAMS ((const PTR, const PTR));
+static bfd_boolean elf_xtensa_in_literal_pool
+  PARAMS ((property_table_entry *, int, bfd_vma));
+static void elf_xtensa_make_sym_local
+  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static bfd_boolean add_extra_plt_sections
+  PARAMS ((bfd *, int));
+static bfd_boolean elf_xtensa_fix_refcounts
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_xtensa_allocate_plt_size
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_xtensa_allocate_got_size
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+static void elf_xtensa_allocate_local_got_size
+  PARAMS ((struct bfd_link_info *, asection *));
+static bfd_reloc_status_type elf_xtensa_do_reloc
+  PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_vma, bfd_byte *,
+          bfd_vma, bfd_boolean, char **));
+static char * vsprint_msg
+  VPARAMS ((const char *, const char *, int, ...));
+static char *build_encoding_error_message
+  PARAMS ((xtensa_opcode, xtensa_encode_result));
 static bfd_reloc_status_type bfd_elf_xtensa_reloc
-  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static bfd_boolean do_fix_for_relocatable_link
-  (Elf_Internal_Rela *, bfd *, asection *, bfd_byte *);
+  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static void do_fix_for_relocatable_link
+  PARAMS ((Elf_Internal_Rela *, bfd *, asection *));
 static void do_fix_for_final_link
-  (Elf_Internal_Rela *, bfd *, asection *, bfd_byte *, bfd_vma *);
+  PARAMS ((Elf_Internal_Rela *, asection *, bfd_vma *));
+static bfd_vma elf_xtensa_create_plt_entry
+  PARAMS ((bfd *, bfd *, unsigned));
+static int elf_xtensa_combine_prop_entries
+  PARAMS ((bfd *, asection *, asection *));
+static bfd_boolean elf_xtensa_discard_info_for_section
+  PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *,
+          asection *));
 
 /* Local functions to handle Xtensa configurability.  */
 
-static bfd_boolean is_indirect_call_opcode (xtensa_opcode);
-static bfd_boolean is_direct_call_opcode (xtensa_opcode);
-static bfd_boolean is_windowed_call_opcode (xtensa_opcode);
-static xtensa_opcode get_const16_opcode (void);
-static xtensa_opcode get_l32r_opcode (void);
-static bfd_vma l32r_offset (bfd_vma, bfd_vma);
-static int get_relocation_opnd (xtensa_opcode, int);
-static int get_relocation_slot (int);
+static void init_call_opcodes
+  PARAMS ((void));
+static bfd_boolean is_indirect_call_opcode
+  PARAMS ((xtensa_opcode));
+static bfd_boolean is_direct_call_opcode
+  PARAMS ((xtensa_opcode));
+static bfd_boolean is_windowed_call_opcode
+  PARAMS ((xtensa_opcode));
+static xtensa_opcode get_l32r_opcode
+  PARAMS ((void));
+static bfd_vma l32r_offset
+  PARAMS ((bfd_vma, bfd_vma));
+static int get_relocation_opnd
+  PARAMS ((Elf_Internal_Rela *));
 static xtensa_opcode get_relocation_opcode
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *);
+  PARAMS ((asection *, bfd_byte *, Elf_Internal_Rela *));
 static bfd_boolean is_l32r_relocation
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *);
-static bfd_boolean is_alt_relocation (int);
-static bfd_boolean is_operand_relocation (int);
-static bfd_size_type insn_decode_len
-  (bfd_byte *, bfd_size_type, bfd_size_type);
-static xtensa_opcode insn_decode_opcode
-  (bfd_byte *, bfd_size_type, bfd_size_type, int);
-static bfd_boolean check_branch_target_aligned
-  (bfd_byte *, bfd_size_type, bfd_vma, bfd_vma);
-static bfd_boolean check_loop_aligned
-  (bfd_byte *, bfd_size_type, bfd_vma, bfd_vma);
-static bfd_boolean check_branch_target_aligned_address (bfd_vma, int);
-static bfd_size_type get_asm_simplify_size
-  (bfd_byte *, bfd_size_type, bfd_size_type);
+  PARAMS ((asection *, bfd_byte *, Elf_Internal_Rela *));
 
 /* Functions for link-time code simplifications.  */
 
-static bfd_reloc_status_type elf_xtensa_do_asm_simplify
-  (bfd_byte *, bfd_vma, bfd_vma, char **);
+static bfd_reloc_status_type elf_xtensa_do_asm_simplify 
+  PARAMS ((bfd_byte *, bfd_vma, bfd_vma));
 static bfd_reloc_status_type contract_asm_expansion
-  (bfd_byte *, bfd_vma, Elf_Internal_Rela *, char **);
-static xtensa_opcode swap_callx_for_call_opcode (xtensa_opcode);
-static xtensa_opcode get_expanded_call_opcode (bfd_byte *, int, bfd_boolean *);
+  PARAMS ((bfd_byte *, bfd_vma, Elf_Internal_Rela *));
+static xtensa_opcode swap_callx_for_call_opcode
+  PARAMS ((xtensa_opcode));
+static xtensa_opcode get_expanded_call_opcode
+  PARAMS ((bfd_byte *, int));
 
 /* Access to internal relocations, section contents and symbols.  */
 
 static Elf_Internal_Rela *retrieve_internal_relocs
-  (bfd *, asection *, bfd_boolean);
-static void pin_internal_relocs (asection *, Elf_Internal_Rela *);
-static void release_internal_relocs (asection *, Elf_Internal_Rela *);
-static bfd_byte *retrieve_contents (bfd *, asection *, bfd_boolean);
-static void pin_contents (asection *, bfd_byte *);
-static void release_contents (asection *, bfd_byte *);
-static Elf_Internal_Sym *retrieve_local_syms (bfd *);
+  PARAMS ((bfd *, asection *, bfd_boolean));
+static void pin_internal_relocs
+  PARAMS ((asection *, Elf_Internal_Rela *));
+static void release_internal_relocs
+  PARAMS ((asection *, Elf_Internal_Rela *));
+static bfd_byte *retrieve_contents
+  PARAMS ((bfd *, asection *, bfd_boolean));
+static void pin_contents
+  PARAMS ((asection *, bfd_byte *));
+static void release_contents
+  PARAMS ((asection *, bfd_byte *));
+static Elf_Internal_Sym *retrieve_local_syms
+  PARAMS ((bfd *));
 
 /* Miscellaneous utility functions.  */
 
-static asection *elf_xtensa_get_plt_section (bfd *, int);
-static asection *elf_xtensa_get_gotplt_section (bfd *, int);
-static asection *get_elf_r_symndx_section (bfd *, unsigned long);
+static asection *elf_xtensa_get_plt_section
+  PARAMS ((bfd *, int));
+static asection *elf_xtensa_get_gotplt_section
+  PARAMS ((bfd *, int));
+static asection *get_elf_r_symndx_section
+  PARAMS ((bfd *, unsigned long));
 static struct elf_link_hash_entry *get_elf_r_symndx_hash_entry
-  (bfd *, unsigned long);
-static bfd_vma get_elf_r_symndx_offset (bfd *, unsigned long);
-static bfd_boolean is_reloc_sym_weak (bfd *, Elf_Internal_Rela *);
-static bfd_boolean pcrel_reloc_fits (xtensa_opcode, int, bfd_vma, bfd_vma);
-static bfd_boolean xtensa_is_property_section (asection *);
-static bfd_boolean xtensa_is_littable_section (asection *);
-static int internal_reloc_compare (const void *, const void *);
-static int internal_reloc_matches (const void *, const void *);
-extern char *xtensa_get_property_section_name (asection *, const char *);
-static flagword xtensa_get_property_predef_flags (asection *);
+  PARAMS ((bfd *, unsigned long));
+static bfd_vma get_elf_r_symndx_offset
+  PARAMS ((bfd *, unsigned long));
+static bfd_boolean pcrel_reloc_fits
+  PARAMS ((xtensa_operand, bfd_vma, bfd_vma));
+static bfd_boolean xtensa_is_property_section
+  PARAMS ((asection *));
+static bfd_boolean xtensa_is_littable_section
+  PARAMS ((asection *));
+static bfd_boolean is_literal_section
+  PARAMS ((asection *));
+static int internal_reloc_compare
+  PARAMS ((const PTR, const PTR));
+extern char *xtensa_get_property_section_name
+  PARAMS ((asection *, const char *));
 
 /* Other functions called directly by the linker.  */
 
 typedef void (*deps_callback_t)
-  (asection *, bfd_vma, asection *, bfd_vma, void *);
+  PARAMS ((asection *, bfd_vma, asection *, bfd_vma, PTR));
 extern bfd_boolean xtensa_callback_required_dependence
-  (bfd *, asection *, struct bfd_link_info *, deps_callback_t, void *);
-
-
-/* Globally visible flag for choosing size optimization of NOP removal
-   instead of branch-target-aware minimization for NOP removal.
-   When nonzero, narrow all instructions and remove all NOPs possible
-   around longcall expansions.  */
-
-int elf32xtensa_size_opt;
+  PARAMS ((bfd *, asection *, struct bfd_link_info *,
+          deps_callback_t, PTR));
 
 
-/* The "new_section_hook" is used to set up a per-section
-   "xtensa_relax_info" data structure with additional information used
-   during relaxation.  */
-
 typedef struct xtensa_relax_info_struct xtensa_relax_info;
 
 
@@ -146,25 +234,12 @@ typedef struct xtensa_relax_info_struct xtensa_relax_info;
 static int plt_reloc_count = 0;
 
 
-/* The GNU tools do not easily allow extending interfaces to pass around
-   the pointer to the Xtensa ISA information, so instead we add a global
-   variable here (in BFD) that can be used by any of the tools that need
-   this information. */
-
-xtensa_isa xtensa_default_isa;
-
-
 /* When this is true, relocations may have been modified to refer to
    symbols from other input files.  The per-section list of "fix"
    records needs to be checked when resolving relocations.  */
 
 static bfd_boolean relaxing_section = FALSE;
 
-/* When this is true, during final links, literals that cannot be
-   coalesced and their relocations may be moved to other sections.  */
-
-int elf32xtensa_no_literal_movement = 1;
-
 \f
 static reloc_howto_type elf_howto_table[] =
 {
@@ -221,115 +296,10 @@ static reloc_howto_type elf_howto_table[] =
   /* GNU extension to record C++ vtable member usage.  */
   HOWTO (R_XTENSA_GNU_VTENTRY, 0, 2, 0, FALSE, 0, complain_overflow_dont,
          _bfd_elf_rel_vtable_reloc_fn, "R_XTENSA_GNU_VTENTRY",
-        FALSE, 0x00000000, 0x00000000, FALSE),
-
-  /* Relocations for supporting difference of symbols.  */
-  HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
-        bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8",
-        FALSE, 0xffffffff, 0xffffffff, FALSE),
-  HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
-        bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16",
-        FALSE, 0xffffffff, 0xffffffff, FALSE),
-  HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
-        bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32",
-        FALSE, 0xffffffff, 0xffffffff, FALSE),
-
-  /* General immediate operand relocations.  */
-  HOWTO (R_XTENSA_SLOT0_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT1_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT2_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT3_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT4_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT5_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT6_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT7_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT8_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT9_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT10_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT11_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT12_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT13_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT14_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_OP",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-
-  /* "Alternate" relocations.  The meaning of these is opcode-specific.  */
-  HOWTO (R_XTENSA_SLOT0_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT1_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT2_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT3_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT4_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT5_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT6_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT7_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT8_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT9_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT10_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT11_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT12_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT13_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE),
-  HOWTO (R_XTENSA_SLOT14_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont,
-        bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_ALT",
-        FALSE, 0x00000000, 0x00000000, TRUE)
+        FALSE, 0x00000000, 0x00000000, FALSE)
 };
 
-#if DEBUG_GEN_RELOC
+#ifdef DEBUG_GEN_RELOC
 #define TRACE(str) \
   fprintf (stderr, "Xtensa bfd reloc lookup %d (%s)\n", code, str)
 #else
@@ -337,8 +307,9 @@ static reloc_howto_type elf_howto_table[] =
 #endif
 
 static reloc_howto_type *
-elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
-                             bfd_reloc_code_real_type code)
+elf_xtensa_reloc_type_lookup (abfd, code)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     bfd_reloc_code_real_type code;
 {
   switch (code)
     {
@@ -350,18 +321,6 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
       TRACE ("BFD_RELOC_32");
       return &elf_howto_table[(unsigned) R_XTENSA_32 ];
 
-    case BFD_RELOC_XTENSA_DIFF8:
-      TRACE ("BFD_RELOC_XTENSA_DIFF8");
-      return &elf_howto_table[(unsigned) R_XTENSA_DIFF8 ];
-
-    case BFD_RELOC_XTENSA_DIFF16:
-      TRACE ("BFD_RELOC_XTENSA_DIFF16");
-      return &elf_howto_table[(unsigned) R_XTENSA_DIFF16 ];
-
-    case BFD_RELOC_XTENSA_DIFF32:
-      TRACE ("BFD_RELOC_XTENSA_DIFF32");
-      return &elf_howto_table[(unsigned) R_XTENSA_DIFF32 ];
-
     case BFD_RELOC_XTENSA_RTLD:
       TRACE ("BFD_RELOC_XTENSA_RTLD");
       return &elf_howto_table[(unsigned) R_XTENSA_RTLD ];
@@ -411,22 +370,6 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
       return &elf_howto_table[(unsigned) R_XTENSA_GNU_VTENTRY ];
 
     default:
-      if (code >= BFD_RELOC_XTENSA_SLOT0_OP
-         && code <= BFD_RELOC_XTENSA_SLOT14_OP)
-       {
-         unsigned n = (R_XTENSA_SLOT0_OP +
-                       (code - BFD_RELOC_XTENSA_SLOT0_OP));
-         return &elf_howto_table[n];
-       }
-
-      if (code >= BFD_RELOC_XTENSA_SLOT0_ALT
-         && code <= BFD_RELOC_XTENSA_SLOT14_ALT)
-       {
-         unsigned n = (R_XTENSA_SLOT0_ALT +
-                       (code - BFD_RELOC_XTENSA_SLOT0_ALT));
-         return &elf_howto_table[n];
-       }
-
       break;
     }
 
@@ -439,9 +382,10 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
    it in the BFD internal arelent representation of the relocation.  */
 
 static void
-elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
-                              arelent *cache_ptr,
-                              Elf_Internal_Rela *dst)
+elf_xtensa_info_to_howto_rela (abfd, cache_ptr, dst)
+     bfd *abfd ATTRIBUTE_UNUSED;
+     arelent *cache_ptr;
+     Elf_Internal_Rela *dst;
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
 
@@ -502,8 +446,9 @@ static const bfd_byte elf_xtensa_le_plt_entry[PLT_ENTRY_SIZE] =
 
 
 static inline bfd_boolean
-xtensa_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
-                            struct bfd_link_info *info)
+xtensa_elf_dynamic_symbol_p (h, info)
+     struct elf_link_hash_entry *h;
+     struct bfd_link_info *info;
 {
   /* Check if we should do dynamic things to this symbol.  The
      "ignore_protected" argument need not be set, because Xtensa code
@@ -516,51 +461,15 @@ xtensa_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
 
 \f
 static int
-property_table_compare (const void *ap, const void *bp)
-{
-  const property_table_entry *a = (const property_table_entry *) ap;
-  const property_table_entry *b = (const property_table_entry *) bp;
-
-  if (a->address == b->address)
-    {
-      /* The only circumstance where two entries may legitimately have the
-        same address is when one of them is a zero-size placeholder to
-        mark a place where fill can be inserted.  The zero-size entry should
-        come first.  */
-      BFD_ASSERT ((a->size == 0 || b->size == 0));
-
-      if (a->size != b->size)
-       return (a->size - b->size);
-
-      if ((a->flags & XTENSA_PROP_ALIGN) != (b->flags & XTENSA_PROP_ALIGN))
-       return ((b->flags & XTENSA_PROP_ALIGN)
-               - (a->flags & XTENSA_PROP_ALIGN));
-
-      if ((a->flags & XTENSA_PROP_ALIGN)
-         && (GET_XTENSA_PROP_ALIGNMENT (a->flags)
-             != GET_XTENSA_PROP_ALIGNMENT (b->flags)))
-       return (GET_XTENSA_PROP_ALIGNMENT (a->flags)
-               - GET_XTENSA_PROP_ALIGNMENT (b->flags));
-      
-      if ((a->flags & XTENSA_PROP_UNREACHABLE)
-         != (b->flags & XTENSA_PROP_UNREACHABLE))
-       return ((b->flags & XTENSA_PROP_UNREACHABLE)
-               - (a->flags & XTENSA_PROP_UNREACHABLE));
-
-      return (a->flags - b->flags);
-    }
-
-  return (a->address - b->address);
-}
-
-
-static int
-property_table_matches (const void *ap, const void *bp)
+property_table_compare (ap, bp)
+     const PTR ap;
+     const PTR bp;
 {
   const property_table_entry *a = (const property_table_entry *) ap;
   const property_table_entry *b = (const property_table_entry *) bp;
 
-  /* Check if one entry overlaps with the other.  */
+  /* Check if one entry overlaps with the other; this shouldn't happen
+     except when searching for a match.  */
   if ((b->address >= a->address && b->address < (a->address + a->size))
       || (a->address >= b->address && a->address < (b->address + b->size)))
     return 0;
@@ -569,16 +478,16 @@ property_table_matches (const void *ap, const void *bp)
 }
 
 
-/* Get the literal table or property table entries for the given
-   section.  Sets TABLE_P and returns the number of entries.  On
-   error, returns a negative value.  */
+/* Get the literal table or instruction table entries for the given
+   section.  Sets TABLE_P and returns the number of entries.  On error,
+   returns a negative value.  */
 
-static int
-xtensa_read_table_entries (bfd *abfd,
-                          asection *section,
-                          property_table_entry **table_p,
-                          const char *sec_name,
-                          bfd_boolean output_addr)
+int
+xtensa_read_table_entries (abfd, section, table_p, sec_name)
+     bfd *abfd;
+     asection *section;
+     property_table_entry **table_p;
+     const char *sec_name;
 {
   asection *table_section;
   char *table_section_name;
@@ -589,44 +498,27 @@ xtensa_read_table_entries (bfd *abfd,
   bfd_size_type num_records;
   Elf_Internal_Rela *internal_relocs;
   bfd_vma section_addr;
-  flagword predef_flags;
-  bfd_size_type table_entry_size;
-
-  if (!section
-      || !(section->flags & SEC_ALLOC)
-      || (section->flags & SEC_DEBUGGING))
-    {
-      *table_p = NULL;
-      return 0;
-    }
 
-  table_section_name = xtensa_get_property_section_name (section, sec_name);
+  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)
+  if (table_section != NULL)
     table_size = table_section->size;
-
+  
   if (table_size == 0) 
     {
       *table_p = NULL;
       return 0;
     }
 
-  predef_flags = xtensa_get_property_predef_flags (table_section);
-  table_entry_size = 12;
-  if (predef_flags)
-    table_entry_size -= 4;
-
-  num_records = table_size / table_entry_size;
+  num_records = table_size / 8;
   table_data = retrieve_contents (abfd, table_section, TRUE);
   blocks = (property_table_entry *)
     bfd_malloc (num_records * sizeof (property_table_entry));
   block_count = 0;
-
-  if (output_addr)
-    section_addr = section->output_section->vma + section->output_offset;
-  else
-    section_addr = section->vma;
+  
+  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.  */
@@ -649,18 +541,11 @@ xtensa_read_table_entries (bfd *abfd,
          if (get_elf_r_symndx_section (abfd, r_symndx) == section)
            {
              bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx);
-             BFD_ASSERT (sym_off == 0);
-             BFD_ASSERT (rel->r_addend == 0);
              blocks[block_count].address =
                (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);
-             if (predef_flags)
-               blocks[block_count].flags = predef_flags;
-             else
-               blocks[block_count].flags =
-                 bfd_get_32 (abfd, table_data + rel->r_offset + 8);
              block_count++;
            }
        }
@@ -670,23 +555,17 @@ xtensa_read_table_entries (bfd *abfd,
       /* The file has already been relocated and the addresses are
         already in the table.  */
       bfd_vma off;
-      bfd_size_type section_limit = bfd_get_section_limit (abfd, section);
 
-      for (off = 0; off < table_size; off += table_entry_size
+      for (off = 0; off < table_size; off += 8
        {
          bfd_vma address = bfd_get_32 (abfd, table_data + off);
 
          if (address >= section_addr
-             && address < section_addr + section_limit)
+             && address < section_addr + section->size)
            {
              blocks[block_count].address = address;
              blocks[block_count].size =
                bfd_get_32 (abfd, table_data + off + 4);
-             if (predef_flags)
-               blocks[block_count].flags = predef_flags;
-             else
-               blocks[block_count].flags =
-                 bfd_get_32 (abfd, table_data + off + 8);
              block_count++;
            }
        }
@@ -695,45 +574,34 @@ xtensa_read_table_entries (bfd *abfd,
   release_contents (table_section, table_data);
   release_internal_relocs (table_section, internal_relocs);
 
-  if (block_count > 0)
+  if (block_count > 0) 
     {
       /* Now sort them into address order for easy reference.  */
       qsort (blocks, block_count, sizeof (property_table_entry),
             property_table_compare);
     }
-
+    
   *table_p = blocks;
   return block_count;
 }
 
 
-static property_table_entry *
-elf_xtensa_find_property_entry (property_table_entry *property_table,
-                               int property_table_size,
-                               bfd_vma addr)
+static bfd_boolean
+elf_xtensa_in_literal_pool (lit_table, lit_table_size, addr)
+     property_table_entry *lit_table;
+     int lit_table_size;
+     bfd_vma addr;
 {
   property_table_entry entry;
-  property_table_entry *rv;
 
-  if (property_table_size == 0)
-    return NULL;
+  if (lit_table_size == 0)
+    return FALSE;
 
   entry.address = addr;
   entry.size = 1;
-  entry.flags = 0;
-
-  rv = bsearch (&entry, property_table, property_table_size,
-               sizeof (property_table_entry), property_table_matches);
-  return rv;
-}
-
 
-static bfd_boolean
-elf_xtensa_in_literal_pool (property_table_entry *lit_table,
-                           int lit_table_size,
-                           bfd_vma addr)
-{
-  if (elf_xtensa_find_property_entry (lit_table, lit_table_size, addr))
+  if (bsearch (&entry, lit_table, lit_table_size,
+              sizeof (property_table_entry), property_table_compare))
     return TRUE;
 
   return FALSE;
@@ -744,10 +612,11 @@ elf_xtensa_in_literal_pool (property_table_entry *lit_table,
    calculate needed space in the dynamic reloc sections.  */
 
 static bfd_boolean
-elf_xtensa_check_relocs (bfd *abfd,
-                        struct bfd_link_info *info,
-                        asection *sec,
-                        const Elf_Internal_Rela *relocs)
+elf_xtensa_check_relocs (abfd, info, sec, relocs)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     asection *sec;
+     const Elf_Internal_Rela *relocs;
 {
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
@@ -812,7 +681,7 @@ elf_xtensa_check_relocs (bfd *abfd,
            {
              if (h->plt.refcount <= 0)
                {
-                 h->needs_plt = 1;
+                 h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
                  h->plt.refcount = 1;
                }
              else
@@ -845,8 +714,8 @@ elf_xtensa_check_relocs (bfd *abfd,
 
                  size = symtab_hdr->sh_info;
                  size *= sizeof (bfd_signed_vma);
-                 local_got_refcounts =
-                   (bfd_signed_vma *) bfd_zalloc (abfd, size);
+                 local_got_refcounts = ((bfd_signed_vma *)
+                                        bfd_zalloc (abfd, size));
                  if (local_got_refcounts == NULL)
                    return FALSE;
                  elf_local_got_refcounts (abfd) = local_got_refcounts;
@@ -858,41 +727,8 @@ elf_xtensa_check_relocs (bfd *abfd,
        case R_XTENSA_OP0:
        case R_XTENSA_OP1:
        case R_XTENSA_OP2:
-       case R_XTENSA_SLOT0_OP:
-       case R_XTENSA_SLOT1_OP:
-       case R_XTENSA_SLOT2_OP:
-       case R_XTENSA_SLOT3_OP:
-       case R_XTENSA_SLOT4_OP:
-       case R_XTENSA_SLOT5_OP:
-       case R_XTENSA_SLOT6_OP:
-       case R_XTENSA_SLOT7_OP:
-       case R_XTENSA_SLOT8_OP:
-       case R_XTENSA_SLOT9_OP:
-       case R_XTENSA_SLOT10_OP:
-       case R_XTENSA_SLOT11_OP:
-       case R_XTENSA_SLOT12_OP:
-       case R_XTENSA_SLOT13_OP:
-       case R_XTENSA_SLOT14_OP:
-       case R_XTENSA_SLOT0_ALT:
-       case R_XTENSA_SLOT1_ALT:
-       case R_XTENSA_SLOT2_ALT:
-       case R_XTENSA_SLOT3_ALT:
-       case R_XTENSA_SLOT4_ALT:
-       case R_XTENSA_SLOT5_ALT:
-       case R_XTENSA_SLOT6_ALT:
-       case R_XTENSA_SLOT7_ALT:
-       case R_XTENSA_SLOT8_ALT:
-       case R_XTENSA_SLOT9_ALT:
-       case R_XTENSA_SLOT10_ALT:
-       case R_XTENSA_SLOT11_ALT:
-       case R_XTENSA_SLOT12_ALT:
-       case R_XTENSA_SLOT13_ALT:
-       case R_XTENSA_SLOT14_ALT:
        case R_XTENSA_ASM_EXPAND:
        case R_XTENSA_ASM_SIMPLIFY:
-       case R_XTENSA_DIFF8:
-       case R_XTENSA_DIFF16:
-       case R_XTENSA_DIFF32:
          /* Nothing to do for these.  */
          break;
 
@@ -920,33 +756,10 @@ elf_xtensa_check_relocs (bfd *abfd,
 
 
 static void
-elf_xtensa_make_sym_local (struct bfd_link_info *info,
-                          struct elf_link_hash_entry *h)
-{
-  if (info->shared)
-    {
-      if (h->plt.refcount > 0)
-       {
-         /* Will use RELATIVE relocs instead of JMP_SLOT relocs.  */
-         if (h->got.refcount < 0)
-           h->got.refcount = 0;
-         h->got.refcount += h->plt.refcount;
-         h->plt.refcount = 0;
-       }
-    }
-  else
-    {
-      /* Don't need any dynamic relocations at all.  */
-      h->plt.refcount = 0;
-      h->got.refcount = 0;
-    }
-}
-
-
-static void
-elf_xtensa_hide_symbol (struct bfd_link_info *info,
-                       struct elf_link_hash_entry *h,
-                       bfd_boolean force_local)
+elf_xtensa_hide_symbol (info, h, force_local)
+     struct bfd_link_info *info;
+     struct elf_link_hash_entry *h;
+     bfd_boolean force_local;
 {
   /* For a shared link, move the plt refcount to the got refcount to leave
      space for RELATIVE relocs.  */
@@ -960,13 +773,14 @@ elf_xtensa_hide_symbol (struct bfd_link_info *info,
    relocation.  */
 
 static asection *
-elf_xtensa_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)
+elf_xtensa_gc_mark_hook (sec, info, rel, h, sym)
+     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)
+  if (h != NULL)
     {
       switch (ELF32_R_TYPE (rel->r_info))
        {
@@ -995,15 +809,15 @@ elf_xtensa_gc_mark_hook (asection *sec,
   return NULL;
 }
 
-
 /* Update the GOT & PLT entry reference counts
    for the section being removed.  */
 
 static bfd_boolean
-elf_xtensa_gc_sweep_hook (bfd *abfd,
-                         struct bfd_link_info *info ATTRIBUTE_UNUSED,
-                         asection *sec,
-                         const Elf_Internal_Rela *relocs)
+elf_xtensa_gc_sweep_hook (abfd, info, sec, relocs)
+     bfd *abfd;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     asection *sec;
+     const Elf_Internal_Rela *relocs;
 {
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
@@ -1062,7 +876,9 @@ elf_xtensa_gc_sweep_hook (bfd *abfd,
 /* Create all the dynamic sections.  */
 
 static bfd_boolean
-elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
+elf_xtensa_create_dynamic_sections (dynobj, info)
+     bfd *dynobj;
+     struct bfd_link_info *info;
 {
   flagword flags, noalloc_flags;
   asection *s;
@@ -1112,7 +928,9 @@ elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
 
 
 static bfd_boolean
-add_extra_plt_sections (bfd *dynobj, int count)
+add_extra_plt_sections (dynobj, count)
+     bfd *dynobj;
+     int count;
 {
   int chunk;
 
@@ -1159,18 +977,19 @@ add_extra_plt_sections (bfd *dynobj, int count)
    understand.  */
 
 static bfd_boolean
-elf_xtensa_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
-                                 struct elf_link_hash_entry *h)
+elf_xtensa_adjust_dynamic_symbol (info, h)
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     struct elf_link_hash_entry *h;
 {
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1182,8 +1001,35 @@ elf_xtensa_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
 }
 
 
+static void
+elf_xtensa_make_sym_local (info, h)
+     struct bfd_link_info *info;
+     struct elf_link_hash_entry *h;
+{
+  if (info->shared)
+    {
+      if (h->plt.refcount > 0)
+       {
+         /* Will use RELATIVE relocs instead of JMP_SLOT relocs.  */
+         if (h->got.refcount < 0)
+           h->got.refcount = 0;
+         h->got.refcount += h->plt.refcount;
+         h->plt.refcount = 0;
+       }
+    }
+  else
+    {
+      /* Don't need any dynamic relocations at all.  */
+      h->plt.refcount = 0;
+      h->got.refcount = 0;
+    }
+}
+
+
 static bfd_boolean
-elf_xtensa_fix_refcounts (struct elf_link_hash_entry *h, void *arg)
+elf_xtensa_fix_refcounts (h, arg)
+     struct elf_link_hash_entry *h;
+     PTR arg;
 {
   struct bfd_link_info *info = (struct bfd_link_info *) arg;
 
@@ -1198,7 +1044,9 @@ elf_xtensa_fix_refcounts (struct elf_link_hash_entry *h, void *arg)
 
 
 static bfd_boolean
-elf_xtensa_allocate_plt_size (struct elf_link_hash_entry *h, void *arg)
+elf_xtensa_allocate_plt_size (h, arg)
+     struct elf_link_hash_entry *h;
+     PTR arg;
 {
   asection *srelplt = (asection *) arg;
 
@@ -1213,7 +1061,9 @@ elf_xtensa_allocate_plt_size (struct elf_link_hash_entry *h, void *arg)
 
 
 static bfd_boolean
-elf_xtensa_allocate_got_size (struct elf_link_hash_entry *h, void *arg)
+elf_xtensa_allocate_got_size (h, arg)
+     struct elf_link_hash_entry *h;
+     PTR arg;
 {
   asection *srelgot = (asection *) arg;
 
@@ -1228,8 +1078,9 @@ elf_xtensa_allocate_got_size (struct elf_link_hash_entry *h, void *arg)
 
 
 static void
-elf_xtensa_allocate_local_got_size (struct bfd_link_info *info,
-                                   asection *srelgot)
+elf_xtensa_allocate_local_got_size (info, srelgot)
+     struct bfd_link_info *info;
+     asection *srelgot;
 {
   bfd *i;
 
@@ -1259,8 +1110,9 @@ elf_xtensa_allocate_local_got_size (struct bfd_link_info *info,
 /* Set the sizes of the dynamic sections.  */
 
 static bfd_boolean
-elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
-                                 struct bfd_link_info *info)
+elf_xtensa_size_dynamic_sections (output_bfd, info)
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info;
 {
   bfd *dynobj, *abfd;
   asection *s, *srelplt, *splt, *sgotplt, *srelgot, *spltlittbl, *sgotloc;
@@ -1296,7 +1148,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       /* Adjust refcounts for symbols that we now know are not "dynamic".  */
       elf_link_hash_traverse (elf_hash_table (info),
                              elf_xtensa_fix_refcounts,
-                             (void *) info);
+                             (PTR) info);
 
       /* Allocate space in ".rela.got" for literals that reference
         global symbols.  */
@@ -1305,7 +1157,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        abort ();
       elf_link_hash_traverse (elf_hash_table (info),
                              elf_xtensa_allocate_got_size,
-                             (void *) srelgot);
+                             (PTR) srelgot);
 
       /* If we are generating a shared object, we also need space in
         ".rela.got" for R_XTENSA_RELATIVE relocs for literals that
@@ -1319,7 +1171,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        abort ();
       elf_link_hash_traverse (elf_hash_table (info),
                              elf_xtensa_allocate_plt_size,
-                             (void *) srelplt);
+                             (PTR) srelplt);
 
       /* Allocate space in ".plt" to match the size of ".rela.plt".  For
         each PLT entry, we need the PLT code plus a 4-byte literal.
@@ -1527,13 +1379,14 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
    this and it probably ought to be moved into elf.c as well.  */
 
 static bfd_boolean
-elf_xtensa_modify_segment_map (bfd *abfd,
-                              struct bfd_link_info *info ATTRIBUTE_UNUSED)
+elf_xtensa_modify_segment_map (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   struct elf_segment_map **m_p;
 
   m_p = &elf_tdata (abfd)->segment_map;
-  while (*m_p)
+  while (*m_p != NULL)
     {
       if ((*m_p)->p_type == PT_LOAD && (*m_p)->count == 0)
        *m_p = (*m_p)->next;
@@ -1550,42 +1403,32 @@ elf_xtensa_modify_segment_map (bfd *abfd,
    howto.  */
 
 #define CALL_SEGMENT_BITS (30)
-#define CALL_SEGMENT_SIZE (1 << CALL_SEGMENT_BITS)
+#define CALL_SEGMENT_SIZE (1<<CALL_SEGMENT_BITS)
 
 static bfd_reloc_status_type
-elf_xtensa_do_reloc (reloc_howto_type *howto,
-                    bfd *abfd,
-                    asection *input_section,
-                    bfd_vma relocation,
-                    bfd_byte *contents,
-                    bfd_vma address,
-                    bfd_boolean is_weak_undef,
-                    char **error_message)
+elf_xtensa_do_reloc (howto, abfd, input_section, relocation,
+                    contents, address, is_weak_undef, error_message)
+     reloc_howto_type *howto;
+     bfd *abfd;
+     asection *input_section;
+     bfd_vma relocation;
+     bfd_byte *contents;
+     bfd_vma address;
+     bfd_boolean is_weak_undef;
+     char **error_message;
 {
-  xtensa_format fmt;
   xtensa_opcode opcode;
+  xtensa_operand operand;
+  xtensa_encode_result encode_result;
   xtensa_isa isa = xtensa_default_isa;
-  static xtensa_insnbuf ibuff = NULL;
-  static xtensa_insnbuf sbuff = NULL;
-  bfd_vma self_address = 0;
-  bfd_size_type input_size;
-  int opnd, slot;
+  xtensa_insnbuf ibuff;
+  bfd_vma self_address;
+  int opnd;
   uint32 newval;
 
-  if (!ibuff)
-    {
-      ibuff = xtensa_insnbuf_alloc (isa);
-      sbuff = xtensa_insnbuf_alloc (isa);
-    }
-
-  input_size = bfd_get_section_limit (abfd, input_section);
-
   switch (howto->type)
     {
     case R_XTENSA_NONE:
-    case R_XTENSA_DIFF8:
-    case R_XTENSA_DIFF16:
-    case R_XTENSA_DIFF32:
       return bfd_reloc_ok;
 
     case R_XTENSA_ASM_EXPAND:
@@ -1594,14 +1437,14 @@ elf_xtensa_do_reloc (reloc_howto_type *howto,
          /* Check for windowed CALL across a 1GB boundary.  */
          xtensa_opcode opcode =
            get_expanded_call_opcode (contents + address,
-                                     input_size - address, 0);
+                                     input_section->size - address);
          if (is_windowed_call_opcode (opcode))
            {
              self_address = (input_section->output_section->vma
                              + input_section->output_offset
                              + address);
-             if ((self_address >> CALL_SEGMENT_BITS)
-                 != (relocation >> CALL_SEGMENT_BITS)) 
+             if ((self_address >> CALL_SEGMENT_BITS) !=
+                 (relocation >> CALL_SEGMENT_BITS)) 
                {
                  *error_message = "windowed longcall crosses 1GB boundary; "
                    "return may fail";
@@ -1612,17 +1455,16 @@ elf_xtensa_do_reloc (reloc_howto_type *howto,
       return bfd_reloc_ok;
 
     case R_XTENSA_ASM_SIMPLIFY:
-      {
+      { 
         /* Convert the L32R/CALLX to CALL.  */
-       bfd_reloc_status_type retval =
-         elf_xtensa_do_asm_simplify (contents, address, input_size,
-                                     error_message);
+       bfd_reloc_status_type retval = 
+         elf_xtensa_do_asm_simplify (contents, address, input_section->size);
        if (retval != bfd_reloc_ok)
-         return bfd_reloc_dangerous;
+         return retval;
 
        /* The CALL needs to be relocated.  Continue below for that part.  */
        address += 3;
-       howto = &elf_howto_table[(unsigned) R_XTENSA_SLOT0_OP ];
+       howto = &elf_howto_table[(unsigned) R_XTENSA_OP0 ];
       }
       break;
 
@@ -1637,131 +1479,73 @@ elf_xtensa_do_reloc (reloc_howto_type *howto,
       return bfd_reloc_ok;
     }
 
-  /* Only instruction slot-specific relocations handled below.... */
-  slot = get_relocation_slot (howto->type);
-  if (slot == XTENSA_UNDEFINED)
+  /* Read the instruction into a buffer and decode the opcode.  */
+  ibuff = xtensa_insnbuf_alloc (isa);
+  xtensa_insnbuf_from_chars (isa, ibuff, contents + address);
+  opcode = xtensa_decode_insn (isa, ibuff);
+
+  /* Determine which operand is being relocated.  */
+  if (opcode == XTENSA_UNDEFINED)
     {
-      *error_message = "unexpected relocation";
+      *error_message = "cannot decode instruction";
       return bfd_reloc_dangerous;
     }
 
-  /* Read the instruction into a buffer and decode the opcode.  */
-  xtensa_insnbuf_from_chars (isa, ibuff, contents + address,
-                            input_size - address);
-  fmt = xtensa_format_decode (isa, ibuff);
-  if (fmt == XTENSA_UNDEFINED)
+  if (howto->type < R_XTENSA_OP0 || howto->type > R_XTENSA_OP2)
     {
-      *error_message = "cannot decode instruction format";
+      *error_message = "unexpected relocation";
       return bfd_reloc_dangerous;
     }
 
-  xtensa_format_get_slot (isa, fmt, slot, ibuff, sbuff);
+  opnd = howto->type - R_XTENSA_OP0;
 
-  opcode = xtensa_opcode_decode (isa, fmt, slot, sbuff);
-  if (opcode == XTENSA_UNDEFINED)
+  /* Calculate the PC address for this instruction.  */
+  if (!howto->pc_relative)
     {
-      *error_message = "cannot decode instruction opcode";
+      *error_message = "expected PC-relative relocation";
       return bfd_reloc_dangerous;
     }
 
-  /* Check for opcode-specific "alternate" relocations.  */
-  if (is_alt_relocation (howto->type))
-    {
-      if (opcode == get_l32r_opcode ())
-       {
-         /* Handle the special-case of non-PC-relative L32R instructions.  */
-         bfd *output_bfd = input_section->output_section->owner;
-         asection *lit4_sec = bfd_get_section_by_name (output_bfd, ".lit4");
-         if (!lit4_sec)
-           {
-             *error_message = "relocation references missing .lit4 section";
-             return bfd_reloc_dangerous;
-           }
-         self_address = ((lit4_sec->vma & ~0xfff)
-                         + 0x40000 - 3); /* -3 to compensate for do_reloc */
-         newval = relocation;
-         opnd = 1;
-       }
-      else if (opcode == get_const16_opcode ())
-       {
-         /* ALT used for high 16 bits.  */
-         newval = relocation >> 16;
-         opnd = 1;
-       }
-      else
-       {
-         /* No other "alternate" relocations currently defined.  */
-         *error_message = "unexpected relocation";
-         return bfd_reloc_dangerous;
-       }
-    }
-  else /* Not an "alternate" relocation.... */
-    {
-      if (opcode == get_const16_opcode ())
-       {
-         newval = relocation & 0xffff;
-         opnd = 1;
-       }
-      else
-       {
-         /* ...normal PC-relative relocation.... */
-
-         /* Determine which operand is being relocated.  */
-         opnd = get_relocation_opnd (opcode, howto->type);
-         if (opnd == XTENSA_UNDEFINED)
-           {
-             *error_message = "unexpected relocation";
-             return bfd_reloc_dangerous;
-           }
-
-         if (!howto->pc_relative)
-           {
-             *error_message = "expected PC-relative relocation";
-             return bfd_reloc_dangerous;
-           }
+  self_address = (input_section->output_section->vma
+                 + input_section->output_offset
+                 + address);
 
-         /* Calculate the PC address for this instruction.  */
-         self_address = (input_section->output_section->vma
-                         + input_section->output_offset
-                         + address);
+  /* Apply the relocation.  */
+  operand = xtensa_get_operand (isa, opcode, opnd);
+  newval = xtensa_operand_do_reloc (operand, relocation, self_address);
+  encode_result = xtensa_operand_encode (operand, &newval);
+  xtensa_operand_set_field (operand, ibuff, newval);
 
-         newval = relocation;
-       }
-    }
+  /* Write the modified instruction back out of the buffer.  */
+  xtensa_insnbuf_to_chars (isa, ibuff, contents + address);
+  free (ibuff);
 
-  /* Apply the relocation.  */
-  if (xtensa_operand_do_reloc (isa, opcode, opnd, &newval, self_address)
-      || xtensa_operand_encode (isa, opcode, opnd, &newval)
-      || xtensa_operand_set_field (isa, opcode, opnd, fmt, slot,
-                                  sbuff, newval))
+  if (encode_result != xtensa_encode_result_ok)
     {
-      *error_message = build_encoding_error_message (opcode, relocation);
+      char *message = build_encoding_error_message (opcode, encode_result);
+      *error_message = message;
       return bfd_reloc_dangerous;
     }
 
-  /* Check for calls across 1GB boundaries.  */
+  /* Final check for call.  */
   if (is_direct_call_opcode (opcode)
       && is_windowed_call_opcode (opcode))
     {
-      if ((self_address >> CALL_SEGMENT_BITS)
-         != (relocation >> CALL_SEGMENT_BITS)) 
+      if ((self_address >> CALL_SEGMENT_BITS) !=
+         (relocation >> CALL_SEGMENT_BITS)) 
        {
-         *error_message =
-           "windowed call crosses 1GB boundary; return may fail";
+         *error_message = "windowed call crosses 1GB boundary; "
+           "return may fail";
          return bfd_reloc_dangerous;
        }
     }
 
-  /* Write the modified instruction back out of the buffer.  */
-  xtensa_format_set_slot (isa, fmt, slot, ibuff, sbuff);
-  xtensa_insnbuf_to_chars (isa, ibuff, contents + address,
-                          input_size - address);
   return bfd_reloc_ok;
 }
 
 
 static char *
-vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
+vsprint_msg VPARAMS ((const char *origmsg, const char *fmt, int arglen, ...))
 {
   /* To reduce the size of the memory leak,
      we only use a single message buffer.  */
@@ -1791,27 +1575,55 @@ vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
 
 
 static char *
-build_encoding_error_message (xtensa_opcode opcode, bfd_vma target_address)
+build_encoding_error_message (opcode, encode_result)
+     xtensa_opcode opcode;
+     xtensa_encode_result encode_result;
 {
   const char *opname = xtensa_opcode_name (xtensa_default_isa, opcode);
-  const char *msg;
+  const char *msg = NULL;
 
-  msg = "cannot encode";
-  if (is_direct_call_opcode (opcode))
+  switch (encode_result)
     {
-      if ((target_address & 0x3) != 0)
-       msg = "misaligned call target";
-      else
-       msg = "call target out of range";
+    case xtensa_encode_result_ok:
+      msg = "unexpected valid encoding";
+      break;
+    case xtensa_encode_result_align:
+      msg = "misaligned encoding";
+      break;
+    case xtensa_encode_result_not_in_table:
+      msg = "encoding not in lookup table";
+      break;
+    case xtensa_encode_result_too_low:
+      msg = "encoding out of range: too low";
+      break;
+    case xtensa_encode_result_too_high:
+      msg = "encoding out of range: too high";
+      break;
+    case xtensa_encode_result_not_ok:
+    default:
+      msg = "could not encode";
+      break;
     }
-  else if (opcode == get_l32r_opcode ())
+
+  if (is_direct_call_opcode (opcode)
+      && (encode_result == xtensa_encode_result_too_low
+         || encode_result == xtensa_encode_result_too_high))
+
+    msg = "direct call out of range";
+
+  else if (opcode == get_l32r_opcode ()) 
     {
-      if ((target_address & 0x3) != 0)
-       msg = "misaligned literal target";
-      else
-       msg = "literal target out of range";
+      /* L32Rs have the strange interaction with encoding in that they
+         have an unsigned immediate field, so libisa returns "too high"
+         when the absolute value is out of range and never returns "too
+         low", but I leave the "too low" message in case anything
+         changes.  */
+      if (encode_result == xtensa_encode_result_too_low)
+       msg = "literal out of range";
+      else if (encode_result == xtensa_encode_result_too_high)
+       msg = "literal placed after use";
     }
-
+  
   return vsprint_msg (opname, ": %s", strlen (msg) + 2, msg);
 }
 
@@ -1824,13 +1636,15 @@ build_encoding_error_message (xtensa_opcode opcode, bfd_vma target_address)
    stripped-down version of bfd_perform_relocation.  */
 
 static bfd_reloc_status_type
-bfd_elf_xtensa_reloc (bfd *abfd,
-                     arelent *reloc_entry,
-                     asymbol *symbol,
-                     void *data,
-                     asection *input_section,
-                     bfd *output_bfd,
-                     char **error_message)
+bfd_elf_xtensa_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;
 {
   bfd_vma relocation;
   bfd_reloc_status_type flag;
@@ -1851,7 +1665,8 @@ bfd_elf_xtensa_reloc (bfd *abfd,
      relocs to begin with, but that's a long story and there's little we
      can do about it now....)  */
 
-  if (output_bfd && (symbol->flags & BSF_SECTION_SYM) == 0)
+  if (output_bfd != (bfd *) NULL
+      && (symbol->flags & BSF_SECTION_SYM) == 0)
     {
       reloc_entry->address += input_section->output_offset;
       return bfd_reloc_ok;
@@ -1894,7 +1709,7 @@ bfd_elf_xtensa_reloc (bfd *abfd,
             to the reloc entry rather than the raw data.  Everything except
             relocations against section symbols has already been handled
             above.  */
-
+         
          BFD_ASSERT (symbol->flags & BSF_SECTION_SYM);
          reloc_entry->addend = relocation;
          reloc_entry->address += input_section->output_offset;
@@ -1930,9 +1745,10 @@ bfd_elf_xtensa_reloc (bfd *abfd,
 /* Set up an entry in the procedure linkage table.  */
 
 static bfd_vma
-elf_xtensa_create_plt_entry (bfd *dynobj,
-                            bfd *output_bfd,
-                            unsigned reloc_index)
+elf_xtensa_create_plt_entry (dynobj, output_bfd, reloc_index)
+      bfd *dynobj;
+      bfd *output_bfd;
+      unsigned reloc_index;
 {
   asection *splt, *sgotplt;
   bfd_vma plt_base, got_base;
@@ -1979,14 +1795,17 @@ elf_xtensa_create_plt_entry (bfd *dynobj,
    both relocatable and final links.  */
 
 static bfd_boolean
-elf_xtensa_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_xtensa_relocate_section (output_bfd, info, input_bfd,
+                            input_section, contents, relocs,
+                            local_syms, local_sections)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+     bfd *input_bfd;
+     asection *input_section;
+     bfd_byte *contents;
+     Elf_Internal_Rela *relocs;
+     Elf_Internal_Sym *local_syms;
+     asection **local_sections;
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *rel;
@@ -1997,10 +1816,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
   property_table_entry *lit_table = 0;
   int ltblsize = 0;
   char *error_message = NULL;
-  bfd_size_type input_size;
 
-  if (!xtensa_default_isa)
-    xtensa_default_isa = xtensa_isa_init (0, 0);
+  if (xtensa_default_isa == NULL)
+    xtensa_isa_init ();
 
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -2008,7 +1826,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
 
   srelgot = NULL;
   srelplt = NULL;
-  if (dynobj)
+  if (dynobj != NULL)
     {
       srelgot = bfd_get_section_by_name (dynobj, ".rela.got");;
       srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
@@ -2017,14 +1835,11 @@ elf_xtensa_relocate_section (bfd *output_bfd,
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       ltblsize = xtensa_read_table_entries (input_bfd, input_section,
-                                           &lit_table, XTENSA_LIT_SEC_NAME,
-                                           TRUE);
+                                           &lit_table, XTENSA_LIT_SEC_NAME);
       if (ltblsize < 0)
        return FALSE;
     }
 
-  input_size = bfd_get_section_limit (input_bfd, input_section);
-
   rel = relocs;
   relend = relocs + input_section->reloc_count;
   for (; rel < relend; rel++)
@@ -2057,7 +1872,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
 
       if (info->relocatable)
        {
-         /* This is a relocatable link.
+         /* This is a relocatable link. 
             1) If the reloc is against a section symbol, adjust
             according to the output section.
             2) If there is a new target for this relocation,
@@ -2068,26 +1883,15 @@ elf_xtensa_relocate_section (bfd *output_bfd,
          if (relaxing_section)
            {
              /* Check if this references a section in another input file.  */
-             if (!do_fix_for_relocatable_link (rel, input_bfd, input_section,
-                                               contents))
-               return FALSE;
+             do_fix_for_relocatable_link (rel, input_bfd, input_section);
              r_type = ELF32_R_TYPE (rel->r_info);
            }
 
-         if (r_type == R_XTENSA_ASM_SIMPLIFY)
+         if (r_type == R_XTENSA_ASM_SIMPLIFY) 
            {
-             char *error_message = NULL;
              /* Convert ASM_SIMPLIFY into the simpler relocation
                 so that they never escape a relaxing link.  */
-             r = contract_asm_expansion (contents, input_size, rel,
-                                         &error_message);
-             if (r != bfd_reloc_ok)
-               {
-                 if (!((*info->callbacks->reloc_dangerous)
-                       (info, error_message, input_bfd, input_section,
-                        rel->r_offset)))
-                   return FALSE;
-               }
+             contract_asm_expansion (contents, input_section->size, rel);
              r_type = ELF32_R_TYPE (rel->r_info);
            }
 
@@ -2175,8 +1979,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
       if (relaxing_section)
        {
          /* Check if this references a section in another input file.  */
-         do_fix_for_final_link (rel, input_bfd, input_section, contents,
-                                &relocation);
+         do_fix_for_final_link (rel, input_section, &relocation);
 
          /* Update some already cached values.  */
          r_type = ELF32_R_TYPE (rel->r_info);
@@ -2184,12 +1987,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
        }
 
       /* Sanity check the address.  */
-      if (rel->r_offset >= input_size
+      if (rel->r_offset >= bfd_get_section_limit (input_bfd, input_section)
          && ELF32_R_TYPE (rel->r_info) != R_XTENSA_NONE)
        {
-         (*_bfd_error_handler)
-           (_("%B(%A+0x%lx): relocation offset out of range (size=0x%x)"),
-            input_bfd, input_section, rel->r_offset, input_size);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
@@ -2199,7 +1999,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
        {
          bfd_boolean dynamic_symbol = xtensa_elf_dynamic_symbol_p (h, info);
 
-         if (dynamic_symbol && is_operand_relocation (r_type))
+         if (dynamic_symbol && (r_type == R_XTENSA_OP0
+                                || r_type == R_XTENSA_OP1
+                                || r_type == R_XTENSA_OP2))
            {
              /* This is an error.  The symbol's real value won't be known
                 until runtime and it's likely to be out of range anyway.  */
@@ -2271,7 +2073,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
                          /* Create the PLT entry and set the initial
                             contents of the literal entry to the address of
                             the PLT entry.  */
-                         relocation =
+                         relocation = 
                            elf_xtensa_create_plt_entry (dynobj, output_bfd,
                                                         srel->reloc_count);
                        }
@@ -2298,7 +2100,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd,
@@ -2312,15 +2114,15 @@ elf_xtensa_relocate_section (bfd *output_bfd,
                               relocation + rel->r_addend,
                               contents, rel->r_offset, is_weak_undef,
                               &error_message);
-
+      
       if (r != bfd_reloc_ok && !warned)
        {
          const char *name;
 
-         BFD_ASSERT (r == bfd_reloc_dangerous || r == bfd_reloc_other);
-         BFD_ASSERT (error_message != NULL);
+         BFD_ASSERT (r == bfd_reloc_dangerous);
+         BFD_ASSERT (error_message != (char *) NULL);
 
-         if (h)
+         if (h != NULL)
            name = h->root.root.string;
          else
            {
@@ -2330,16 +2132,8 @@ elf_xtensa_relocate_section (bfd *output_bfd,
                name = bfd_section_name (input_bfd, sec);
            }
          if (name)
-           {
-             if (rel->r_addend == 0)
-               error_message = vsprint_msg (error_message, ": %s",
-                                            strlen (name) + 2, name);
-             else
-               error_message = vsprint_msg (error_message, ": (%s+0x%x)",
-                                            strlen (name) + 22,
-                                            name, rel->r_addend);
-           }
-
+           error_message = vsprint_msg (error_message, ": %s",
+                                        strlen (name), name);
          if (!((*info->callbacks->reloc_dangerous)
                (info, error_message, input_bfd, input_section,
                 rel->r_offset)))
@@ -2360,13 +2154,14 @@ elf_xtensa_relocate_section (bfd *output_bfd,
    the PLT and GOT entries are all set up by relocate_section.  */
 
 static bfd_boolean
-elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
-                                 struct bfd_link_info *info ATTRIBUTE_UNUSED,
-                                 struct elf_link_hash_entry *h,
-                                 Elf_Internal_Sym *sym)
+elf_xtensa_finish_dynamic_symbol (output_bfd, info, h, sym)
+     bfd *output_bfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     struct elf_link_hash_entry *h;
+     Elf_Internal_Sym *sym;
 {
-  if (h->needs_plt
-      && !h->def_regular)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
+      && (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.  */
@@ -2391,9 +2186,10 @@ elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
    on error.  */
 
 static int
-elf_xtensa_combine_prop_entries (bfd *output_bfd,
-                                asection *sxtlit,
-                                asection *sgotloc)
+elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc)
+     bfd *output_bfd;
+     asection *sxtlit;
+     asection *sgotloc;
 {
   bfd_byte *contents;
   property_table_entry *table;
@@ -2409,7 +2205,7 @@ elf_xtensa_combine_prop_entries (bfd *output_bfd,
   if (sgotloc_size != section_size)
     {
       (*_bfd_error_handler)
-       (_("internal inconsistency in size of .got.loc section"));
+       ("internal inconsistency in size of .got.loc section");
       return -1;
     }
 
@@ -2498,8 +2294,9 @@ elf_xtensa_combine_prop_entries (bfd *output_bfd,
 /* Finish up the dynamic sections.  */
 
 static bfd_boolean
-elf_xtensa_finish_dynamic_sections (bfd *output_bfd,
-                                   struct bfd_link_info *info)
+elf_xtensa_finish_dynamic_sections (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
 {
   bfd *dynobj;
   asection *sdyn, *srelplt, *sgot, *sxtlit, *sgotloc;
@@ -2520,7 +2317,7 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd,
     {
       BFD_ASSERT (sgot->size == 4);
       if (sdyn == NULL)
-       bfd_put_32 (output_bfd, 0, sgot->contents);
+       bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
       else
        bfd_put_32 (output_bfd,
                    sdyn->output_section->vma + sdyn->output_offset,
@@ -2528,7 +2325,7 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd,
     }
 
   srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
-  if (srelplt && srelplt->size != 0)
+  if (srelplt != NULL && srelplt->size != 0)
     {
       asection *sgotplt, *srelgot, *spltlittbl;
       int chunk, plt_chunks, plt_entries;
@@ -2701,7 +2498,9 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd,
    object file when linking.  */
 
 static bfd_boolean
-elf_xtensa_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+elf_xtensa_merge_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
 {
   unsigned out_mach, in_mach;
   flagword out_flag, in_flag;
@@ -2720,10 +2519,10 @@ elf_xtensa_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   out_mach = out_flag & EF_XTENSA_MACH;
   in_mach = in_flag & EF_XTENSA_MACH;
-  if (out_mach != in_mach)
+  if (out_mach != in_mach) 
     {
       (*_bfd_error_handler)
-       (_("%B: incompatible machine type. Output is 0x%x. Input is 0x%x"),
+       ("%B: incompatible machine type. Output is 0x%x. Input is 0x%x",
         ibfd, out_mach, in_mach);
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
@@ -2733,27 +2532,31 @@ elf_xtensa_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
     {
       elf_flags_init (obfd) = TRUE;
       elf_elfheader (obfd)->e_flags = in_flag;
-
+      
       if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
          && bfd_get_arch_info (obfd)->the_default)
        return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
                                  bfd_get_mach (ibfd));
-
+      
       return TRUE;
     }
 
-  if ((out_flag & EF_XTENSA_XT_INSN) != (in_flag & EF_XTENSA_XT_INSN)) 
-    elf_elfheader (obfd)->e_flags &= (~ EF_XTENSA_XT_INSN);
+  if ((out_flag & EF_XTENSA_XT_INSN) !=
+      (in_flag & EF_XTENSA_XT_INSN)) 
+    elf_elfheader(obfd)->e_flags &= (~ EF_XTENSA_XT_INSN);
 
-  if ((out_flag & EF_XTENSA_XT_LIT) != (in_flag & EF_XTENSA_XT_LIT)) 
-    elf_elfheader (obfd)->e_flags &= (~ EF_XTENSA_XT_LIT);
+  if ((out_flag & EF_XTENSA_XT_LIT) !=
+      (in_flag & EF_XTENSA_XT_LIT)) 
+    elf_elfheader(obfd)->e_flags &= (~ EF_XTENSA_XT_LIT);
 
   return TRUE;
 }
 
 
 static bfd_boolean
-elf_xtensa_set_private_flags (bfd *abfd, flagword flags)
+elf_xtensa_set_private_flags (abfd, flags)
+     bfd *abfd;
+     flagword flags;
 {
   BFD_ASSERT (!elf_flags_init (abfd)
              || elf_elfheader (abfd)->e_flags == flags);
@@ -2765,14 +2568,24 @@ elf_xtensa_set_private_flags (bfd *abfd, flagword flags)
 }
 
 
+extern flagword
+elf_xtensa_get_private_bfd_flags (abfd)
+     bfd *abfd;
+{
+  return elf_elfheader (abfd)->e_flags;
+}
+
+
 static bfd_boolean
-elf_xtensa_print_private_bfd_data (bfd *abfd, void *farg)
+elf_xtensa_print_private_bfd_data (abfd, farg)
+     bfd *abfd;
+     PTR farg;
 {
   FILE *f = (FILE *) farg;
   flagword e_flags = elf_elfheader (abfd)->e_flags;
 
   fprintf (f, "\nXtensa header:\n");
-  if ((e_flags & EF_XTENSA_MACH) == E_XTENSA_MACH)
+  if ((e_flags & EF_XTENSA_MACH) == E_XTENSA_MACH) 
     fprintf (f, "\nMachine     = Base\n");
   else
     fprintf (f, "\nMachine Id  = 0x%x\n", e_flags & EF_XTENSA_MACH);
@@ -2790,7 +2603,8 @@ elf_xtensa_print_private_bfd_data (bfd *abfd, void *farg)
 /* Set the right machine number for an Xtensa ELF file.  */
 
 static bfd_boolean
-elf_xtensa_object_p (bfd *abfd)
+elf_xtensa_object_p (abfd)
+     bfd *abfd;
 {
   int mach;
   unsigned long arch = elf_elfheader (abfd)->e_flags & EF_XTENSA_MACH;
@@ -2814,8 +2628,9 @@ elf_xtensa_object_p (bfd *abfd)
    number.  */
 
 static void
-elf_xtensa_final_write_processing (bfd *abfd,
-                                  bfd_boolean linker ATTRIBUTE_UNUSED)
+elf_xtensa_final_write_processing (abfd, linker)
+     bfd *abfd;
+     bfd_boolean linker ATTRIBUTE_UNUSED;
 {
   int mach;
   unsigned long val;
@@ -2835,7 +2650,8 @@ elf_xtensa_final_write_processing (bfd *abfd,
 
 
 static enum elf_reloc_type_class
-elf_xtensa_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_xtensa_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
@@ -2850,10 +2666,11 @@ elf_xtensa_reloc_type_class (const Elf_Internal_Rela *rela)
 
 \f
 static bfd_boolean
-elf_xtensa_discard_info_for_section (bfd *abfd,
-                                    struct elf_reloc_cookie *cookie,
-                                    struct bfd_link_info *info,
-                                    asection *sec)
+elf_xtensa_discard_info_for_section (abfd, cookie, info, sec)
+     bfd *abfd;
+     struct elf_reloc_cookie *cookie;
+     struct bfd_link_info *info;
+     asection *sec;
 {
   bfd_byte *contents;
   bfd_vma section_size;
@@ -2974,9 +2791,10 @@ elf_xtensa_discard_info_for_section (bfd *abfd,
 
 
 static bfd_boolean
-elf_xtensa_discard_info (bfd *abfd,
-                        struct elf_reloc_cookie *cookie,
-                        struct bfd_link_info *info)
+elf_xtensa_discard_info (abfd, cookie, info)
+     bfd *abfd;
+     struct elf_reloc_cookie *cookie;
+     struct bfd_link_info *info;
 {
   asection *sec;
   bfd_boolean changed = FALSE;
@@ -2995,7 +2813,8 @@ elf_xtensa_discard_info (bfd *abfd,
 
 
 static bfd_boolean
-elf_xtensa_ignore_discarded_relocs (asection *sec)
+elf_xtensa_ignore_discarded_relocs (sec)
+     asection *sec;
 {
   return xtensa_is_property_section (sec);
 }
@@ -3004,7 +2823,9 @@ elf_xtensa_ignore_discarded_relocs (asection *sec)
 /* Support for core dump NOTE sections.  */
 
 static bfd_boolean
-elf_xtensa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+elf_xtensa_grok_prstatus (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
 {
   int offset;
   unsigned int size;
@@ -3029,7 +2850,9 @@ elf_xtensa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 
 
 static bfd_boolean
-elf_xtensa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+elf_xtensa_grok_psinfo (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
 {
   switch (note->descsz)
     {
@@ -3071,7 +2894,7 @@ static xtensa_opcode call8_op = XTENSA_UNDEFINED;
 static xtensa_opcode call12_op = XTENSA_UNDEFINED;
 
 static void
-init_call_opcodes (void)
+init_call_opcodes ()
 {
   if (callx0_op == XTENSA_UNDEFINED)
     {
@@ -3088,7 +2911,8 @@ init_call_opcodes (void)
 
 
 static bfd_boolean
-is_indirect_call_opcode (xtensa_opcode opcode)
+is_indirect_call_opcode (opcode)
+     xtensa_opcode opcode;
 {
   init_call_opcodes ();
   return (opcode == callx0_op
@@ -3099,7 +2923,8 @@ is_indirect_call_opcode (xtensa_opcode opcode)
 
 
 static bfd_boolean
-is_direct_call_opcode (xtensa_opcode opcode)
+is_direct_call_opcode (opcode)
+     xtensa_opcode opcode;
 {
   init_call_opcodes ();
   return (opcode == call0_op
@@ -3110,7 +2935,8 @@ is_direct_call_opcode (xtensa_opcode opcode)
 
 
 static bfd_boolean
-is_windowed_call_opcode (xtensa_opcode opcode)
+is_windowed_call_opcode (opcode)
+     xtensa_opcode opcode;
 {
   init_call_opcodes ();
   return (opcode == call4_op
@@ -3122,37 +2948,23 @@ is_windowed_call_opcode (xtensa_opcode opcode)
 }
 
 
-static xtensa_opcode
-get_const16_opcode (void)
-{
-  static bfd_boolean done_lookup = FALSE;
-  static xtensa_opcode const16_opcode = XTENSA_UNDEFINED;
-  if (!done_lookup)
-    {
-      const16_opcode = xtensa_opcode_lookup (xtensa_default_isa, "const16");
-      done_lookup = TRUE;
-    }
-  return const16_opcode;
-}
-
-
 static xtensa_opcode
 get_l32r_opcode (void)
 {
   static xtensa_opcode l32r_opcode = XTENSA_UNDEFINED;
-  static bfd_boolean done_lookup = FALSE;
-
-  if (!done_lookup)
+  if (l32r_opcode == XTENSA_UNDEFINED)
     {
       l32r_opcode = xtensa_opcode_lookup (xtensa_default_isa, "l32r");
-      done_lookup = TRUE;
+      BFD_ASSERT (l32r_opcode != XTENSA_UNDEFINED);
     }
   return l32r_opcode;
 }
 
 
 static bfd_vma
-l32r_offset (bfd_vma addr, bfd_vma pc)
+l32r_offset (addr, pc)
+     bfd_vma addr;
+     bfd_vma pc;
 {
   bfd_vma offset;
 
@@ -3164,5089 +2976,1855 @@ l32r_offset (bfd_vma addr, bfd_vma pc)
 }
 
 
+/* Get the operand number for a PC-relative relocation.
+   If the relocation is not a PC-relative one, return (-1).  */
+
 static int
-get_relocation_opnd (xtensa_opcode opcode, int r_type)
+get_relocation_opnd (irel)
+     Elf_Internal_Rela *irel;
+{
+  if (ELF32_R_TYPE (irel->r_info) < R_XTENSA_OP0
+      || ELF32_R_TYPE (irel->r_info) >= R_XTENSA_max)
+    return -1;
+  return ELF32_R_TYPE (irel->r_info) - R_XTENSA_OP0;
+}
+
+
+/* Get the opcode for a relocation.  */
+
+static xtensa_opcode
+get_relocation_opcode (sec, contents, irel)
+     asection *sec;
+     bfd_byte *contents;
+     Elf_Internal_Rela *irel;
 {
+  static xtensa_insnbuf ibuff = NULL;
   xtensa_isa isa = xtensa_default_isa;
-  int last_immed, last_opnd, opi;
 
-  if (opcode == XTENSA_UNDEFINED)
+  if (get_relocation_opnd (irel) == -1)
     return XTENSA_UNDEFINED;
 
-  /* Find the last visible PC-relative immediate operand for the opcode.
-     If there are no PC-relative immediates, then choose the last visible
-     immediate; otherwise, fail and return XTENSA_UNDEFINED.  */
-  last_immed = XTENSA_UNDEFINED;
-  last_opnd = xtensa_opcode_num_operands (isa, opcode);
-  for (opi = last_opnd - 1; opi >= 0; opi--)
-    {
-      if (xtensa_operand_is_visible (isa, opcode, opi) == 0)
-       continue;
-      if (xtensa_operand_is_PCrelative (isa, opcode, opi) == 1)
-       {
-         last_immed = opi;
-         break;
-       }
-      if (last_immed == XTENSA_UNDEFINED
-         && xtensa_operand_is_register (isa, opcode, opi) == 0)
-       last_immed = opi;
-    }
-  if (last_immed < 0)
+  if (contents == NULL)
     return XTENSA_UNDEFINED;
 
-  /* If the operand number was specified in an old-style relocation,
-     check for consistency with the operand computed above.  */
-  if (r_type >= R_XTENSA_OP0 && r_type <= R_XTENSA_OP2)
-    {
-      int reloc_opnd = r_type - R_XTENSA_OP0;
-      if (reloc_opnd != last_immed)
-       return XTENSA_UNDEFINED;
-    }
+  if (sec->size <= irel->r_offset)
+    return XTENSA_UNDEFINED;
 
-  return last_immed;
+  if (ibuff == NULL)
+    ibuff = xtensa_insnbuf_alloc (isa);
+      
+  /* Decode the instruction.  */
+  xtensa_insnbuf_from_chars (isa, ibuff, &contents[irel->r_offset]);
+  return xtensa_decode_insn (isa, ibuff);
 }
 
 
-int
-get_relocation_slot (int r_type)
+bfd_boolean
+is_l32r_relocation (sec, contents, irel)
+     asection *sec;
+     bfd_byte *contents;
+     Elf_Internal_Rela *irel;
 {
-  switch (r_type)
-    {
-    case R_XTENSA_OP0:
-    case R_XTENSA_OP1:
-    case R_XTENSA_OP2:
-      return 0;
-
-    default:
-      if (r_type >= R_XTENSA_SLOT0_OP && r_type <= R_XTENSA_SLOT14_OP)
-       return r_type - R_XTENSA_SLOT0_OP;
-      if (r_type >= R_XTENSA_SLOT0_ALT && r_type <= R_XTENSA_SLOT14_ALT)
-       return r_type - R_XTENSA_SLOT0_ALT;
-      break;
-    }
+  xtensa_opcode opcode;
 
-  return XTENSA_UNDEFINED;
+  if (ELF32_R_TYPE (irel->r_info) != R_XTENSA_OP1)
+    return FALSE;
+  
+  opcode = get_relocation_opcode (sec, contents, irel);
+  return (opcode == get_l32r_opcode ());
 }
 
+\f
+/* Code for transforming CALLs at link-time.  */
 
-/* Get the opcode for a relocation.  */
-
-static xtensa_opcode
-get_relocation_opcode (bfd *abfd,
-                      asection *sec,
-                      bfd_byte *contents,
-                      Elf_Internal_Rela *irel)
+static bfd_reloc_status_type
+elf_xtensa_do_asm_simplify (contents, address, content_length)
+     bfd_byte *contents;
+     bfd_vma address;
+     bfd_vma content_length;
 {
-  static xtensa_insnbuf ibuff = NULL;
-  static xtensa_insnbuf sbuff = NULL;
+  static xtensa_insnbuf insnbuf = NULL;
+  xtensa_opcode opcode;
+  xtensa_operand operand;
+  xtensa_opcode direct_call_opcode;
   xtensa_isa isa = xtensa_default_isa;
-  xtensa_format fmt;
-  int slot;
-
-  if (contents == NULL)
-    return XTENSA_UNDEFINED;
+  bfd_byte *chbuf = contents + address;
+  int opn;
 
-  if (bfd_get_section_limit (abfd, sec) <= irel->r_offset)
-    return XTENSA_UNDEFINED;
+  if (insnbuf == NULL)
+    insnbuf = xtensa_insnbuf_alloc (isa);
 
-  if (ibuff == NULL)
+  if (content_length < address)
     {
-      ibuff = xtensa_insnbuf_alloc (isa);
-      sbuff = xtensa_insnbuf_alloc (isa);
+      (*_bfd_error_handler)
+       ("Attempt to convert L32R/CALLX to CALL failed");
+      return bfd_reloc_other;
     }
 
-  /* Decode the instruction.  */
-  xtensa_insnbuf_from_chars (isa, ibuff, &contents[irel->r_offset],
-                            sec->size - irel->r_offset);
-  fmt = xtensa_format_decode (isa, ibuff);
-  slot = get_relocation_slot (ELF32_R_TYPE (irel->r_info));
-  if (slot == XTENSA_UNDEFINED)
-    return XTENSA_UNDEFINED;
-  xtensa_format_get_slot (isa, fmt, slot, ibuff, sbuff);
-  return xtensa_opcode_decode (isa, fmt, slot, sbuff);
-}
-
-
-bfd_boolean
-is_l32r_relocation (bfd *abfd,
-                   asection *sec,
-                   bfd_byte *contents,
-                   Elf_Internal_Rela *irel)
-{
-  xtensa_opcode opcode;
-  if (!is_operand_relocation (ELF32_R_TYPE (irel->r_info)))
-    return FALSE;
-  opcode = get_relocation_opcode (abfd, sec, contents, irel);
-  return (opcode == get_l32r_opcode ());
-}
-
-
-static bfd_size_type
-get_asm_simplify_size (bfd_byte *contents,
-                      bfd_size_type content_len,
-                      bfd_size_type offset)
-{
-  bfd_size_type insnlen, size = 0;
-
-  /* Decode the size of the next two instructions.  */
-  insnlen = insn_decode_len (contents, content_len, offset);
-  if (insnlen == 0)
-    return 0;
-
-  size += insnlen;
+  opcode = get_expanded_call_opcode (chbuf, content_length - address);
+  direct_call_opcode = swap_callx_for_call_opcode (opcode);
+  if (direct_call_opcode == XTENSA_UNDEFINED)
+    {
+      (*_bfd_error_handler)
+       ("Attempt to convert L32R/CALLX to CALL failed");
+      return bfd_reloc_other;
+    }
   
-  insnlen = insn_decode_len (contents, content_len, offset + size);
-  if (insnlen == 0)
-    return 0;
-
-  size += insnlen;
-  return size;
-}
+  /* Assemble a NOP ("or a1, a1, a1") into the 0 byte offset.  */
+  opcode = xtensa_opcode_lookup (isa, "or");
+  xtensa_encode_insn (isa, opcode, insnbuf);
+  for (opn = 0; opn < 3; opn++) 
+    {
+      operand = xtensa_get_operand (isa, opcode, opn);
+      xtensa_operand_set_field (operand, insnbuf, 1);
+    }
+  xtensa_insnbuf_to_chars (isa, insnbuf, chbuf);
 
+  /* Assemble a CALL ("callN 0") into the 3 byte offset.  */
+  xtensa_encode_insn (isa, direct_call_opcode, insnbuf);
+  operand = xtensa_get_operand (isa, opcode, 0);
+  xtensa_operand_set_field (operand, insnbuf, 0);
+  xtensa_insnbuf_to_chars (isa, insnbuf, chbuf + 3);
 
-bfd_boolean
-is_alt_relocation (int r_type)
-{
-  return (r_type >= R_XTENSA_SLOT0_ALT
-         && r_type <= R_XTENSA_SLOT14_ALT);
+  return bfd_reloc_ok;
 }
 
 
-bfd_boolean
-is_operand_relocation (int r_type)
+static bfd_reloc_status_type
+contract_asm_expansion (contents, content_length, irel)
+     bfd_byte *contents;
+     bfd_vma content_length;
+     Elf_Internal_Rela *irel;
 {
-  switch (r_type)
-    {
-    case R_XTENSA_OP0:
-    case R_XTENSA_OP1:
-    case R_XTENSA_OP2:
-      return TRUE;
+  bfd_reloc_status_type retval =
+    elf_xtensa_do_asm_simplify (contents, irel->r_offset, content_length);
 
-    default:
-      if (r_type >= R_XTENSA_SLOT0_OP && r_type <= R_XTENSA_SLOT14_OP)
-       return TRUE;
-      if (r_type >= R_XTENSA_SLOT0_ALT && r_type <= R_XTENSA_SLOT14_ALT)
-       return TRUE;
-      break;
-    }
+  if (retval != bfd_reloc_ok)
+    return retval;
 
-  return FALSE;
+  /* Update the irel->r_offset field so that the right immediate and
+     the right instruction are modified during the relocation.  */
+  irel->r_offset += 3;
+  irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_XTENSA_OP0);
+  return bfd_reloc_ok;
 }
 
-      
-#define MIN_INSN_LENGTH 2
-
-/* Return 0 if it fails to decode.  */
 
-bfd_size_type
-insn_decode_len (bfd_byte *contents,
-                bfd_size_type content_len,
-                bfd_size_type offset)
+static xtensa_opcode
+swap_callx_for_call_opcode (opcode)
+     xtensa_opcode opcode;
 {
-  int insn_len;
-  xtensa_isa isa = xtensa_default_isa;
-  xtensa_format fmt;
-  static xtensa_insnbuf ibuff = NULL;
+  init_call_opcodes ();
 
-  if (offset + MIN_INSN_LENGTH > content_len)
-    return 0;
+  if (opcode == callx0_op) return call0_op;
+  if (opcode == callx4_op) return call4_op;
+  if (opcode == callx8_op) return call8_op;
+  if (opcode == callx12_op) return call12_op;
 
-  if (ibuff == NULL)
-    ibuff = xtensa_insnbuf_alloc (isa);
-  xtensa_insnbuf_from_chars (isa, ibuff, &contents[offset],
-                            content_len - offset);
-  fmt = xtensa_format_decode (isa, ibuff);
-  if (fmt == XTENSA_UNDEFINED)
-    return 0;
-  insn_len = xtensa_format_length (isa, fmt);
-  if (insn_len ==  XTENSA_UNDEFINED)
-    return 0;
-  return insn_len;
+  /* Return XTENSA_UNDEFINED if the opcode is not an indirect call.  */
+  return XTENSA_UNDEFINED;
 }
 
 
-/* Decode the opcode for a single slot instruction.
-   Return 0 if it fails to decode or the instruction is multi-slot.  */
+/* Check if "buf" is pointing to a "L32R aN; CALLX aN" sequence, and
+   if so, return the CALLX opcode.  If not, return XTENSA_UNDEFINED.  */
+
+#define L32R_TARGET_REG_OPERAND 0
+#define CALLN_SOURCE_OPERAND 0
 
-xtensa_opcode
-insn_decode_opcode (bfd_byte *contents,
-                   bfd_size_type content_len,
-                   bfd_size_type offset,
-                   int slot)
+static xtensa_opcode 
+get_expanded_call_opcode (buf, bufsize)
+     bfd_byte *buf;
+     int bufsize;
 {
-  xtensa_isa isa = xtensa_default_isa;
-  xtensa_format fmt;
   static xtensa_insnbuf insnbuf = NULL;
-  static xtensa_insnbuf slotbuf = NULL;
-
-  if (offset + MIN_INSN_LENGTH > content_len)
+  xtensa_opcode opcode;
+  xtensa_operand operand;
+  xtensa_isa isa = xtensa_default_isa;
+  uint32 regno, call_regno;
+  
+  /* Buffer must be at least 6 bytes.  */
+  if (bufsize < 6)
     return XTENSA_UNDEFINED;
 
   if (insnbuf == NULL)
-    {
-      insnbuf = xtensa_insnbuf_alloc (isa);
-      slotbuf = xtensa_insnbuf_alloc (isa);
-    }
-
-  xtensa_insnbuf_from_chars (isa, insnbuf, &contents[offset],
-                            content_len - offset);
-  fmt = xtensa_format_decode (isa, insnbuf);
-  if (fmt == XTENSA_UNDEFINED)
+    insnbuf = xtensa_insnbuf_alloc (isa);
+      
+  xtensa_insnbuf_from_chars (isa, insnbuf, buf);
+  opcode = xtensa_decode_insn (isa, insnbuf);
+  
+  if (opcode != get_l32r_opcode ())
     return XTENSA_UNDEFINED;
-
-  if (slot >= xtensa_format_num_slots (isa, fmt))
+  
+  operand = xtensa_get_operand (isa, opcode, L32R_TARGET_REG_OPERAND);
+  regno = xtensa_operand_decode
+    (operand, xtensa_operand_get_field (operand, insnbuf));
+  
+  /* Next instruction should be an CALLXn with operand 0 == regno.  */
+  xtensa_insnbuf_from_chars (isa, insnbuf, 
+                            buf + xtensa_insn_length (isa, opcode));
+  opcode = xtensa_decode_insn (isa, insnbuf);
+  
+  if (!is_indirect_call_opcode (opcode))
     return XTENSA_UNDEFINED;
-
-  xtensa_format_get_slot (isa, fmt, slot, insnbuf, slotbuf);
-  return xtensa_opcode_decode (isa, fmt, slot, slotbuf);
+  
+  operand = xtensa_get_operand (isa, opcode, CALLN_SOURCE_OPERAND);
+  call_regno = xtensa_operand_decode
+    (operand, xtensa_operand_get_field (operand, insnbuf));
+  if (call_regno != regno)
+    return XTENSA_UNDEFINED;
+  
+  return opcode;
 }
 
+\f
+/* Data structures used during relaxation.  */
 
-/* The offset is the offset in the contents.
-   The address is the address of that offset.  */
+/* r_reloc: relocation values.  */
 
-static bfd_boolean
-check_branch_target_aligned (bfd_byte *contents,
-                            bfd_size_type content_length,
-                            bfd_vma offset,
-                            bfd_vma address)
-{
-  bfd_size_type insn_len = insn_decode_len (contents, content_length, offset);
-  if (insn_len == 0)
-    return FALSE;
-  return check_branch_target_aligned_address (address, insn_len);
-}
+/* Through the relaxation process, we need to keep track of the values
+   that will result from evaluating relocations.  The standard ELF
+   relocation structure is not sufficient for this purpose because we're
+   operating on multiple input files at once, so we need to know which
+   input file a relocation refers to.  The r_reloc structure thus
+   records both the input file (bfd) and ELF relocation.
 
+   For efficiency, an r_reloc also contains a "target_offset" field to
+   cache the target-section-relative offset value that is represented by
+   the relocation.  */
 
-static bfd_boolean
-check_loop_aligned (bfd_byte *contents,
-                   bfd_size_type content_length,
-                   bfd_vma offset,
-                   bfd_vma address)
-{
-  bfd_size_type loop_len, insn_len;
-  xtensa_opcode opcode =
-    insn_decode_opcode (contents, content_length, offset, 0);
-  BFD_ASSERT (opcode != XTENSA_UNDEFINED);
-  if (opcode != XTENSA_UNDEFINED)
-    return FALSE;
-  BFD_ASSERT (xtensa_opcode_is_loop (xtensa_default_isa, opcode));
-  if (!xtensa_opcode_is_loop (xtensa_default_isa, opcode))
-    return FALSE;
+typedef struct r_reloc_struct r_reloc;
 
-  loop_len = insn_decode_len (contents, content_length, offset);
-  BFD_ASSERT (loop_len != 0);
-  if (loop_len == 0)
-    return FALSE;
+struct r_reloc_struct
+{
+  bfd *abfd;
+  Elf_Internal_Rela rela;
+  bfd_vma target_offset;
+};
 
-  insn_len = insn_decode_len (contents, content_length, offset + loop_len);
-  BFD_ASSERT (insn_len != 0);
-  if (insn_len == 0)
-    return FALSE;
+static bfd_boolean r_reloc_is_const
+  PARAMS ((const r_reloc *));
+static void r_reloc_init
+  PARAMS ((r_reloc *, bfd *, Elf_Internal_Rela *));
+static bfd_vma r_reloc_get_target_offset
+  PARAMS ((const r_reloc *));
+static asection *r_reloc_get_section
+  PARAMS ((const r_reloc *));
+static bfd_boolean r_reloc_is_defined
+  PARAMS ((const r_reloc *));
+static struct elf_link_hash_entry *r_reloc_get_hash_entry
+  PARAMS ((const r_reloc *));
 
-  return check_branch_target_aligned_address (address + loop_len, insn_len);
-}
 
+/* The r_reloc structure is included by value in literal_value, but not
+   every literal_value has an associated relocation -- some are simple
+   constants.  In such cases, we set all the fields in the r_reloc
+   struct to zero.  The r_reloc_is_const function should be used to
+   detect this case.  */
 
 static bfd_boolean
-check_branch_target_aligned_address (bfd_vma addr, int len)
+r_reloc_is_const (r_rel)
+     const r_reloc *r_rel;
 {
-  if (len == 8)
-    return (addr % 8 == 0);
-  return ((addr >> 2) == ((addr + len - 1) >> 2));
+  return (r_rel->abfd == NULL);
 }
 
-\f
-/* Instruction widening and narrowing.  */
-
-/* When FLIX is available we need to access certain instructions only
-   when they are 16-bit or 24-bit instructions.  This table caches
-   information about such instructions by walking through all the
-   opcodes and finding the smallest single-slot format into which each
-   can be encoded.  */
-
-static xtensa_format *op_single_fmt_table = NULL;
-
 
 static void
-init_op_single_format_table (void)
+r_reloc_init (r_rel, abfd, irel) 
+     r_reloc *r_rel;
+     bfd *abfd;
+     Elf_Internal_Rela *irel;
 {
-  xtensa_isa isa = xtensa_default_isa;
-  xtensa_insnbuf ibuf;
-  xtensa_opcode opcode;
-  xtensa_format fmt;
-  int num_opcodes;
-
-  if (op_single_fmt_table)
-    return;
-
-  ibuf = xtensa_insnbuf_alloc (isa);
-  num_opcodes = xtensa_isa_num_opcodes (isa);
-
-  op_single_fmt_table = (xtensa_format *)
-    bfd_malloc (sizeof (xtensa_format) * num_opcodes);
-  for (opcode = 0; opcode < num_opcodes; opcode++)
+  if (irel != NULL)
     {
-      op_single_fmt_table[opcode] = XTENSA_UNDEFINED;
-      for (fmt = 0; fmt < xtensa_isa_num_formats (isa); fmt++)
-       {
-         if (xtensa_format_num_slots (isa, fmt) == 1
-             && xtensa_opcode_encode (isa, fmt, 0, ibuf, opcode) == 0)
-           {
-             xtensa_opcode old_fmt = op_single_fmt_table[opcode];
-             int fmt_length = xtensa_format_length (isa, fmt);
-             if (old_fmt == XTENSA_UNDEFINED
-                 || fmt_length < xtensa_format_length (isa, old_fmt))
-               op_single_fmt_table[opcode] = fmt;
-           }
-       }
+      r_rel->rela = *irel;
+      r_rel->abfd = abfd;
+      r_rel->target_offset = r_reloc_get_target_offset (r_rel);
     }
-  xtensa_insnbuf_free (isa, ibuf);
+  else
+    memset (r_rel, 0, sizeof (r_reloc));
 }
 
 
-static xtensa_format
-get_single_format (xtensa_opcode opcode)
+static bfd_vma
+r_reloc_get_target_offset (r_rel)
+     const r_reloc *r_rel;
 {
-  init_op_single_format_table ();
-  return op_single_fmt_table[opcode];
-}
+  bfd_vma target_offset;
+  unsigned long r_symndx;
 
+  BFD_ASSERT (!r_reloc_is_const (r_rel));
+  r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
+  target_offset = get_elf_r_symndx_offset (r_rel->abfd, r_symndx);
+  return (target_offset + r_rel->rela.r_addend);
+}
 
-/* For the set of narrowable instructions we do NOT include the
-   narrowings beqz -> beqz.n or bnez -> bnez.n because of complexities
-   involved during linker relaxation that may require these to
-   re-expand in some conditions.  Also, the narrowing "or" -> mov.n
-   requires special case code to ensure it only works when op1 == op2.  */
 
-struct string_pair
+static struct elf_link_hash_entry *
+r_reloc_get_hash_entry (r_rel)
+     const r_reloc *r_rel;
 {
-  const char *wide;
-  const char *narrow;
-};
+  unsigned long r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
+  return get_elf_r_symndx_hash_entry (r_rel->abfd, r_symndx);
+}
 
-struct string_pair narrowable[] =
-{
-  { "add", "add.n" },
-  { "addi", "addi.n" },
-  { "addmi", "addi.n" },
-  { "l32i", "l32i.n" },
-  { "movi", "movi.n" },
-  { "ret", "ret.n" },
-  { "retw", "retw.n" },
-  { "s32i", "s32i.n" },
-  { "or", "mov.n" } /* special case only when op1 == op2 */
-};
 
-struct string_pair widenable[] =
+static asection *
+r_reloc_get_section (r_rel)
+     const r_reloc *r_rel;
 {
-  { "add", "add.n" },
-  { "addi", "addi.n" },
-  { "addmi", "addi.n" },
-  { "beqz", "beqz.n" },
-  { "bnez", "bnez.n" },
-  { "l32i", "l32i.n" },
-  { "movi", "movi.n" },
-  { "ret", "ret.n" },
-  { "retw", "retw.n" },
-  { "s32i", "s32i.n" },
-  { "or", "mov.n" } /* special case only when op1 == op2 */
-};
-
+  unsigned long r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
+  return get_elf_r_symndx_section (r_rel->abfd, r_symndx);
+}
 
-/* Attempt to narrow an instruction.  Return true if the narrowing is
-   valid.  If the do_it parameter is non-zero, then perform the action
-   in-place directly into the contents.  Otherwise, do not modify the
-   contents.  The set of valid narrowing are specified by a string table
-   but require some special case operand checks in some cases.  */
 
 static bfd_boolean
-narrow_instruction (bfd_byte *contents,
-                   bfd_size_type content_length,
-                   bfd_size_type offset,
-                   bfd_boolean do_it)
+r_reloc_is_defined (r_rel)
+     const r_reloc *r_rel;
 {
-  xtensa_opcode opcode;
-  bfd_size_type insn_len, opi;
-  xtensa_isa isa = xtensa_default_isa;
-  xtensa_format fmt, o_fmt;
-
-  static xtensa_insnbuf insnbuf = NULL;
-  static xtensa_insnbuf slotbuf = NULL;
-  static xtensa_insnbuf o_insnbuf = NULL;
-  static xtensa_insnbuf o_slotbuf = NULL;
-
-  if (insnbuf == NULL)
-    {
-      insnbuf = xtensa_insnbuf_alloc (isa);
-      slotbuf = xtensa_insnbuf_alloc (isa);
-      o_insnbuf = xtensa_insnbuf_alloc (isa);
-      o_slotbuf = xtensa_insnbuf_alloc (isa);
-    }
-
-  BFD_ASSERT (offset < content_length);
-
-  if (content_length < 2)
+  asection *sec = r_reloc_get_section (r_rel);
+  if (sec == bfd_abs_section_ptr
+      || sec == bfd_com_section_ptr
+      || sec == bfd_und_section_ptr)
     return FALSE;
+  return TRUE;
+}
 
-  /* We will hand-code a few of these for a little while.
-     These have all been specified in the assembler aleady.  */
-  xtensa_insnbuf_from_chars (isa, insnbuf, &contents[offset],
-                            content_length - offset);
-  fmt = xtensa_format_decode (isa, insnbuf);
-  if (xtensa_format_num_slots (isa, fmt) != 1)
-    return FALSE;
+\f
+/* source_reloc: relocations that reference literal sections.  */
 
-  if (xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf) != 0)
-    return FALSE;
+/* To determine whether literals can be coalesced, we need to first
+   record all the relocations that reference the literals.  The
+   source_reloc structure below is used for this purpose.  The
+   source_reloc entries are kept in a per-literal-section array, sorted
+   by offset within the literal section (i.e., target offset).
 
-  opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf);
-  if (opcode == XTENSA_UNDEFINED)
-    return FALSE;
-  insn_len = xtensa_format_length (isa, fmt);
-  if (insn_len > content_length)
-    return FALSE;
+   The source_sec and r_rel.rela.r_offset fields identify the source of
+   the relocation.  The r_rel field records the relocation value, i.e.,
+   the offset of the literal being referenced.  The opnd field is needed
+   to determine the range of the immediate field to which the relocation
+   applies, so we can determine whether another literal with the same
+   value is within range.  The is_null field is true when the relocation
+   is being removed (e.g., when an L32R is being removed due to a CALLX
+   that is converted to a direct CALL).  */
 
-  for (opi = 0; opi < (sizeof (narrowable)/sizeof (struct string_pair)); ++opi)
-    {
-      bfd_boolean is_or = (strcmp ("or", narrowable[opi].wide) == 0);
+typedef struct source_reloc_struct source_reloc;
 
-      if (opcode == xtensa_opcode_lookup (isa, narrowable[opi].wide))
-       {
-         uint32 value, newval;
-         int i, operand_count, o_operand_count;
-         xtensa_opcode o_opcode;
+struct source_reloc_struct
+{
+  asection *source_sec;
+  r_reloc r_rel;
+  xtensa_operand opnd;
+  bfd_boolean is_null;
+};
 
-         /* Address does not matter in this case.  We might need to
-            fix it to handle branches/jumps.  */
-         bfd_vma self_address = 0;
 
-         o_opcode = xtensa_opcode_lookup (isa, narrowable[opi].narrow);
-         if (o_opcode == XTENSA_UNDEFINED)
-           return FALSE;
-         o_fmt = get_single_format (o_opcode);
-         if (o_fmt == XTENSA_UNDEFINED)
-           return FALSE;
+static void init_source_reloc
+  PARAMS ((source_reloc *, asection *, const r_reloc *, xtensa_operand));
+static source_reloc *find_source_reloc
+  PARAMS ((source_reloc *, int, asection *, Elf_Internal_Rela *));
+static int source_reloc_compare
+  PARAMS ((const PTR, const PTR));
 
-         if (xtensa_format_length (isa, fmt) != 3
-             || xtensa_format_length (isa, o_fmt) != 2)
-           return FALSE;
 
-         xtensa_format_encode (isa, o_fmt, o_insnbuf);
-         operand_count = xtensa_opcode_num_operands (isa, opcode);
-         o_operand_count = xtensa_opcode_num_operands (isa, o_opcode);
+static void
+init_source_reloc (reloc, source_sec, r_rel, opnd)
+     source_reloc *reloc;
+     asection *source_sec;
+     const r_reloc *r_rel;
+     xtensa_operand opnd;
+{
+  reloc->source_sec = source_sec;
+  reloc->r_rel = *r_rel;
+  reloc->opnd = opnd;
+  reloc->is_null = FALSE;
+}
 
-         if (xtensa_opcode_encode (isa, o_fmt, 0, o_slotbuf, o_opcode) != 0)
-           return FALSE;
 
-         if (!is_or)
-           {
-             if (xtensa_opcode_num_operands (isa, o_opcode) != operand_count)
-               return FALSE;
-           }
-         else
-           {
-             uint32 rawval0, rawval1, rawval2;
+/* Find the source_reloc for a particular source offset and relocation
+   type.  Note that the array is sorted by _target_ offset, so this is
+   just a linear search.  */
 
-             if (o_operand_count + 1 != operand_count)
-               return FALSE;
-             if (xtensa_operand_get_field (isa, opcode, 0,
-                                           fmt, 0, slotbuf, &rawval0) != 0)
-               return FALSE;
-             if (xtensa_operand_get_field (isa, opcode, 1,
-                                           fmt, 0, slotbuf, &rawval1) != 0)
-               return FALSE;
-             if (xtensa_operand_get_field (isa, opcode, 2,
-                                           fmt, 0, slotbuf, &rawval2) != 0)
-               return FALSE;
+static source_reloc *
+find_source_reloc (src_relocs, src_count, sec, irel)
+     source_reloc *src_relocs;
+     int src_count;
+     asection *sec;
+     Elf_Internal_Rela *irel;
+{
+  int i;
 
-             if (rawval1 != rawval2)
-               return FALSE;
-             if (rawval0 == rawval1) /* it is a nop */
-               return FALSE;
-           }
+  for (i = 0; i < src_count; i++)
+    {
+      if (src_relocs[i].source_sec == sec
+         && src_relocs[i].r_rel.rela.r_offset == irel->r_offset
+         && (ELF32_R_TYPE (src_relocs[i].r_rel.rela.r_info)
+             == ELF32_R_TYPE (irel->r_info)))
+       return &src_relocs[i];
+    }
 
-         for (i = 0; i < o_operand_count; ++i)
-           {
-             if (xtensa_operand_get_field (isa, opcode, i, fmt, 0,
-                                           slotbuf, &value)
-                 || xtensa_operand_decode (isa, opcode, i, &value))
-               return FALSE;
+  return NULL;
+}
 
-             /* PC-relative branches need adjustment, but
-                the PC-rel operand will always have a relocation.  */
-             newval = value;
-             if (xtensa_operand_do_reloc (isa, o_opcode, i, &newval,
-                                          self_address)
-                 || xtensa_operand_encode (isa, o_opcode, i, &newval)
-                 || xtensa_operand_set_field (isa, o_opcode, i, o_fmt, 0,
-                                              o_slotbuf, newval))
-               return FALSE;
-           }
 
-         if (xtensa_format_set_slot (isa, o_fmt, 0,
-                                     o_insnbuf, o_slotbuf) != 0)
-           return FALSE;
+static int
+source_reloc_compare (ap, bp)
+     const PTR ap;
+     const PTR bp;
+{
+  const source_reloc *a = (const source_reloc *) ap;
+  const source_reloc *b = (const source_reloc *) bp;
 
-         if (do_it)
-           xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset,
-                                    content_length - offset);
-         return TRUE;
-       }
-    }
-  return FALSE;
+  return (a->r_rel.target_offset - b->r_rel.target_offset);
 }
 
+\f
+/* Literal values and value hash tables.  */
 
-/* Attempt to widen an instruction.  Return true if the widening is
-   valid.  If the do_it parameter is non-zero, then the action should
-   be performed inplace into the contents.  Otherwise, do not modify
-   the contents.  The set of valid widenings are specified by a string
-   table but require some special case operand checks in some
-   cases.  */
+/* Literals with the same value can be coalesced.  The literal_value
+   structure records the value of a literal: the "r_rel" field holds the
+   information from the relocation on the literal (if there is one) and
+   the "value" field holds the contents of the literal word itself.
 
-static bfd_boolean
-widen_instruction (bfd_byte *contents,
-                  bfd_size_type content_length,
-                  bfd_size_type offset,
-                  bfd_boolean do_it)
+   The value_map structure records a literal value along with the
+   location of a literal holding that value.  The value_map hash table
+   is indexed by the literal value, so that we can quickly check if a
+   particular literal value has been seen before and is thus a candidate
+   for coalescing.  */
+
+typedef struct literal_value_struct literal_value;
+typedef struct value_map_struct value_map;
+typedef struct value_map_hash_table_struct value_map_hash_table;
+
+struct literal_value_struct
 {
-  xtensa_opcode opcode;
-  bfd_size_type insn_len, opi;
-  xtensa_isa isa = xtensa_default_isa;
-  xtensa_format fmt, o_fmt;
+  r_reloc r_rel; 
+  unsigned long value;
+};
 
-  static xtensa_insnbuf insnbuf = NULL;
-  static xtensa_insnbuf slotbuf = NULL;
-  static xtensa_insnbuf o_insnbuf = NULL;
-  static xtensa_insnbuf o_slotbuf = NULL;
+struct value_map_struct
+{
+  literal_value val;                   /* The literal value.  */
+  r_reloc loc;                         /* Location of the literal.  */
+  value_map *next;
+};
 
-  if (insnbuf == NULL)
-    {
-      insnbuf = xtensa_insnbuf_alloc (isa);
-      slotbuf = xtensa_insnbuf_alloc (isa);
-      o_insnbuf = xtensa_insnbuf_alloc (isa);
-      o_slotbuf = xtensa_insnbuf_alloc (isa);
-    }
+struct value_map_hash_table_struct
+{
+  unsigned bucket_count;
+  value_map **buckets;
+  unsigned count;
+};
 
-  BFD_ASSERT (offset < content_length);
 
-  if (content_length < 2)
-    return FALSE;
+static bfd_boolean is_same_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
+  PARAMS ((const literal_value *));
+static unsigned hash_bfd_vma
+  PARAMS ((bfd_vma));
+static value_map *get_cached_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 *,
+          bfd_boolean));
 
-  /* We will hand code a few of these for a little while.
-     These have all been specified in the assembler aleady.  */
-  xtensa_insnbuf_from_chars (isa, insnbuf, &contents[offset],
-                            content_length - offset);
-  fmt = xtensa_format_decode (isa, insnbuf);
-  if (xtensa_format_num_slots (isa, fmt) != 1)
-    return FALSE;
 
-  if (xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf) != 0)
+static bfd_boolean
+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;
 
-  opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf);
-  if (opcode == XTENSA_UNDEFINED)
+  if (r_reloc_is_const (&src1->r_rel))
+    return (src1->value == src2->value);
+
+  if (ELF32_R_TYPE (src1->r_rel.rela.r_info)
+      != ELF32_R_TYPE (src2->r_rel.rela.r_info))
     return FALSE;
-  insn_len = xtensa_format_length (isa, fmt);
-  if (insn_len > content_length)
+
+  if (r_reloc_get_target_offset (&src1->r_rel)
+      != r_reloc_get_target_offset (&src2->r_rel))
     return FALSE;
 
-  for (opi = 0; opi < (sizeof (widenable)/sizeof (struct string_pair)); ++opi)
+  if (src1->value != src2->value)
+    return FALSE;
+  
+  /* 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))
+       return FALSE;
+    }
+  else
     {
-      bfd_boolean is_or = (strcmp ("or", widenable[opi].wide) == 0);
-      bfd_boolean is_branch = (strcmp ("beqz", widenable[opi].wide) == 0
-                              || strcmp ("bnez", widenable[opi].wide) == 0);
+      /* Require that the hash entries (i.e., symbols) be identical.  */
+      if (h1 != h2 || h1 == 0)
+       return FALSE;
+    }
 
-      if (opcode == xtensa_opcode_lookup (isa, widenable[opi].narrow))
-       {
-         uint32 value, newval;
-         int i, operand_count, o_operand_count, check_operand_count;
-         xtensa_opcode o_opcode;
+  return TRUE;
+}
 
-         /* Address does not matter in this case.  We might need to fix it
-            to handle branches/jumps.  */
-         bfd_vma self_address = 0;
 
-         o_opcode = xtensa_opcode_lookup (isa, widenable[opi].wide);
-         if (o_opcode == XTENSA_UNDEFINED)
-           return FALSE;
-         o_fmt = get_single_format (o_opcode);
-         if (o_fmt == XTENSA_UNDEFINED)
-           return FALSE;
+/* Must be power of 2.  */
+#define INITIAL_HASH_RELOC_BUCKET_COUNT 1024
 
-         if (xtensa_format_length (isa, fmt) != 2
-             || xtensa_format_length (isa, o_fmt) != 3)
-           return FALSE;
+static value_map_hash_table *
+value_map_hash_table_init ()
+{
+  value_map_hash_table *values;
 
-         xtensa_format_encode (isa, o_fmt, o_insnbuf);
-         operand_count = xtensa_opcode_num_operands (isa, opcode);
-         o_operand_count = xtensa_opcode_num_operands (isa, o_opcode);
-         check_operand_count = o_operand_count;
+  values = (value_map_hash_table *)
+    bfd_malloc (sizeof (value_map_hash_table));
 
-         if (xtensa_opcode_encode (isa, o_fmt, 0, o_slotbuf, o_opcode) != 0)
-           return FALSE;
+  values->bucket_count = INITIAL_HASH_RELOC_BUCKET_COUNT;
+  values->count = 0;
+  values->buckets = (value_map **)
+    bfd_zmalloc (sizeof (value_map *) * values->bucket_count);
 
-         if (!is_or)
-           {
-             if (xtensa_opcode_num_operands (isa, o_opcode) != operand_count)
-               return FALSE;
-           }
-         else
-           {
-             uint32 rawval0, rawval1;
+  return values;
+}
 
-             if (o_operand_count != operand_count + 1)
-               return FALSE;
-             if (xtensa_operand_get_field (isa, opcode, 0,
-                                           fmt, 0, slotbuf, &rawval0) != 0)
-               return FALSE;
-             if (xtensa_operand_get_field (isa, opcode, 1,
-                                           fmt, 0, slotbuf, &rawval1) != 0)
-               return FALSE;
-             if (rawval0 == rawval1) /* it is a nop */
-               return FALSE;
-           }
-         if (is_branch)
-           check_operand_count--;
 
-         for (i = 0; i < check_operand_count; ++i)
-           {
-             int new_i = i;
-             if (is_or && i == o_operand_count - 1)
-               new_i = i - 1;
-             if (xtensa_operand_get_field (isa, opcode, new_i, fmt, 0,
-                                           slotbuf, &value)
-                 || xtensa_operand_decode (isa, opcode, new_i, &value))
-               return FALSE;
+static unsigned
+hash_bfd_vma (val) 
+     bfd_vma val;
+{
+  return (val >> 2) + (val >> 10);
+}
 
-             /* PC-relative branches need adjustment, but
-                the PC-rel operand will always have a relocation.  */
-             newval = value;
-             if (xtensa_operand_do_reloc (isa, o_opcode, i, &newval,
-                                          self_address)
-                 || xtensa_operand_encode (isa, o_opcode, i, &newval)
-                 || xtensa_operand_set_field (isa, o_opcode, i, o_fmt, 0,
-                                              o_slotbuf, newval))
-               return FALSE;
-           }
 
-         if (xtensa_format_set_slot (isa, o_fmt, 0, o_insnbuf, o_slotbuf))
-           return FALSE;
+static unsigned
+hash_literal_value (src)
+     const literal_value *src;
+{
+  unsigned hash_val;
 
-         if (do_it)
-           xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset,
-                                    content_length - offset);
-         return TRUE;
-       }
-    }
-  return FALSE;
+  if (r_reloc_is_const (&src->r_rel))
+    return hash_bfd_vma (src->value);
+
+  hash_val = (hash_bfd_vma (r_reloc_get_target_offset (&src->r_rel))
+             + hash_bfd_vma (src->value));
+  
+  /* Now check for the same section and the same elf_hash.  */
+  if (r_reloc_is_defined (&src->r_rel))
+    hash_val += hash_bfd_vma ((bfd_vma) (unsigned) r_reloc_get_section (&src->r_rel));
+  else
+    hash_val += hash_bfd_vma ((bfd_vma) (unsigned) r_reloc_get_hash_entry (&src->r_rel));
+
+  return hash_val;
 }
 
-\f
-/* Code for transforming CALLs at link-time.  */
 
-static bfd_reloc_status_type
-elf_xtensa_do_asm_simplify (bfd_byte *contents,
-                           bfd_vma address,
-                           bfd_vma content_length,
-                           char **error_message)
+/* Check if the specified literal_value has been seen before.  */
+
+static value_map *
+get_cached_value (map, val, final_static_link)
+     value_map_hash_table *map;
+     const literal_value *val;
+     bfd_boolean final_static_link;
 {
-  static xtensa_insnbuf insnbuf = NULL;
-  static xtensa_insnbuf slotbuf = NULL;
-  xtensa_format core_format = XTENSA_UNDEFINED;
-  xtensa_opcode opcode;
-  xtensa_opcode direct_call_opcode;
-  xtensa_isa isa = xtensa_default_isa;
-  bfd_byte *chbuf = contents + address;
-  int opn;
+  value_map *map_e;
+  value_map *bucket;
+  unsigned idx;
 
-  if (insnbuf == NULL)
+  idx = hash_literal_value (val);
+  idx = idx & (map->bucket_count - 1);
+  bucket = map->buckets[idx];
+  for (map_e = bucket; map_e; map_e = map_e->next)
     {
-      insnbuf = xtensa_insnbuf_alloc (isa);
-      slotbuf = xtensa_insnbuf_alloc (isa);
+      if (is_same_value (&map_e->val, val, final_static_link))
+       return map_e;
     }
+  return NULL;
+}
 
-  if (content_length < address)
-    {
-      *error_message = _("Attempt to convert L32R/CALLX to CALL failed");
-      return bfd_reloc_other;
-    }
 
-  opcode = get_expanded_call_opcode (chbuf, content_length - address, 0);
-  direct_call_opcode = swap_callx_for_call_opcode (opcode);
-  if (direct_call_opcode == XTENSA_UNDEFINED)
-    {
-      *error_message = _("Attempt to convert L32R/CALLX to CALL failed");
-      return bfd_reloc_other;
-    }
-  
-  /* Assemble a NOP ("or a1, a1, a1") into the 0 byte offset.  */
-  core_format = xtensa_format_lookup (isa, "x24");
-  opcode = xtensa_opcode_lookup (isa, "or");
-  xtensa_opcode_encode (isa, core_format, 0, slotbuf, opcode);
-  for (opn = 0; opn < 3; opn++) 
-    {
-      uint32 regno = 1;
-      xtensa_operand_encode (isa, opcode, opn, &regno);
-      xtensa_operand_set_field (isa, opcode, opn, core_format, 0,
-                               slotbuf, regno);
-    }
-  xtensa_format_encode (isa, core_format, insnbuf);
-  xtensa_format_set_slot (isa, core_format, 0, insnbuf, slotbuf);
-  xtensa_insnbuf_to_chars (isa, insnbuf, chbuf, content_length - address);
+/* Record a new literal value.  It is illegal to call this if VALUE
+   already has an entry here.  */
 
-  /* Assemble a CALL ("callN 0") into the 3 byte offset.  */
-  xtensa_opcode_encode (isa, core_format, 0, slotbuf, direct_call_opcode);
-  xtensa_operand_set_field (isa, opcode, 0, core_format, 0, slotbuf, 0);
+static value_map *
+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;
 
-  xtensa_format_encode (isa, core_format, insnbuf);
-  xtensa_format_set_slot (isa, core_format, 0, insnbuf, slotbuf);
-  xtensa_insnbuf_to_chars (isa, insnbuf, chbuf + 3,
-                          content_length - address - 3);
+  value_map *val_e = (value_map *) bfd_zmalloc (sizeof (value_map));
 
-  return bfd_reloc_ok;
-}
+  BFD_ASSERT (get_cached_value (map, val, final_static_link) == NULL);
+  val_e->val = *val;
+  val_e->loc = *loc;
 
+  idx = hash_literal_value (val);
+  idx = idx & (map->bucket_count - 1);
+  bucket_p = &map->buckets[idx];
 
-static bfd_reloc_status_type
-contract_asm_expansion (bfd_byte *contents,
-                       bfd_vma content_length,
-                       Elf_Internal_Rela *irel,
-                       char **error_message)
-{
-  bfd_reloc_status_type retval =
-    elf_xtensa_do_asm_simplify (contents, irel->r_offset, content_length,
-                               error_message);
+  val_e->next = *bucket_p;
+  *bucket_p = val_e;
+  map->count++;
+  /* FIXME: consider resizing the hash table if we get too many entries */
+  
+  return val_e;
+}
 
-  if (retval != bfd_reloc_ok)
-    return bfd_reloc_dangerous;
+\f
+/* Lists of literals being coalesced or removed.  */
 
-  /* Update the irel->r_offset field so that the right immediate and
-     the right instruction are modified during the relocation.  */
-  irel->r_offset += 3;
-  irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_XTENSA_SLOT0_OP);
-  return bfd_reloc_ok;
-}
+/* In the usual case, the literal identified by "from" is being
+   coalesced with another literal identified by "to".  If the literal is
+   unused and is being removed altogether, "to.abfd" will be NULL.
+   The removed_literal entries are kept on a per-section list, sorted
+   by the "from" offset field.  */
 
+typedef struct removed_literal_struct removed_literal;
+typedef struct removed_literal_list_struct removed_literal_list;
 
-static xtensa_opcode
-swap_callx_for_call_opcode (xtensa_opcode opcode)
+struct removed_literal_struct
 {
-  init_call_opcodes ();
+  r_reloc from;
+  r_reloc to;
+  removed_literal *next;
+};
 
-  if (opcode == callx0_op) return call0_op;
-  if (opcode == callx4_op) return call4_op;
-  if (opcode == callx8_op) return call8_op;
-  if (opcode == callx12_op) return call12_op;
+struct removed_literal_list_struct
+{
+  removed_literal *head;
+  removed_literal *tail;
+};
 
-  /* Return XTENSA_UNDEFINED if the opcode is not an indirect call.  */
-  return XTENSA_UNDEFINED;
-}
 
+static void add_removed_literal
+  PARAMS ((removed_literal_list *, const r_reloc *, const r_reloc *));
+static removed_literal *find_removed_literal
+  PARAMS ((removed_literal_list *, bfd_vma));
+static bfd_vma offset_with_removed_literals
+  PARAMS ((removed_literal_list *, bfd_vma));
 
-/* Check if "buf" is pointing to a "L32R aN; CALLX aN" or "CONST16 aN;
-   CONST16 aN; CALLX aN" sequence, and if so, return the CALLX opcode.
-   If not, return XTENSA_UNDEFINED.  */
 
-#define L32R_TARGET_REG_OPERAND 0
-#define CONST16_TARGET_REG_OPERAND 0
-#define CALLN_SOURCE_OPERAND 0
+/* Record that the literal at "from" is being removed.  If "to" is not
+   NULL, the "from" literal is being coalesced with the "to" literal.  */
 
-static xtensa_opcode 
-get_expanded_call_opcode (bfd_byte *buf, int bufsize, bfd_boolean *p_uses_l32r)
+static void
+add_removed_literal (removed_list, from, to)
+     removed_literal_list *removed_list;
+     const r_reloc *from;
+     const r_reloc *to;
 {
-  static xtensa_insnbuf insnbuf = NULL;
-  static xtensa_insnbuf slotbuf = NULL;
-  xtensa_format fmt;
-  xtensa_opcode opcode;
-  xtensa_isa isa = xtensa_default_isa;
-  uint32 regno, const16_regno, call_regno;
-  int offset = 0;
-
-  if (insnbuf == NULL)
-    {
-      insnbuf = xtensa_insnbuf_alloc (isa);
-      slotbuf = xtensa_insnbuf_alloc (isa);
-    }
-
-  xtensa_insnbuf_from_chars (isa, insnbuf, buf, bufsize);
-  fmt = xtensa_format_decode (isa, insnbuf);
-  if (fmt == XTENSA_UNDEFINED
-      || xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf))
-    return XTENSA_UNDEFINED;
+  removed_literal *r, *new_r, *next_r;
 
-  opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf);
-  if (opcode == XTENSA_UNDEFINED)
-    return XTENSA_UNDEFINED;
+  new_r = (removed_literal *) bfd_zmalloc (sizeof (removed_literal));
 
-  if (opcode == get_l32r_opcode ())
+  new_r->from = *from;
+  if (to)
+    new_r->to = *to;
+  else
+    new_r->to.abfd = NULL;
+  new_r->next = NULL;
+  
+  r = removed_list->head;
+  if (r == NULL) 
     {
-      if (p_uses_l32r)
-       *p_uses_l32r = TRUE;
-      if (xtensa_operand_get_field (isa, opcode, L32R_TARGET_REG_OPERAND,
-                                   fmt, 0, slotbuf, &regno)
-         || xtensa_operand_decode (isa, opcode, L32R_TARGET_REG_OPERAND,
-                                   &regno))
-       return XTENSA_UNDEFINED;
+      removed_list->head = new_r;
+      removed_list->tail = new_r;
     }
-  else if (opcode == get_const16_opcode ())
+  /* Special check for common case of append.  */
+  else if (removed_list->tail->from.target_offset < from->target_offset)
     {
-      if (p_uses_l32r)
-       *p_uses_l32r = FALSE;
-      if (xtensa_operand_get_field (isa, opcode, CONST16_TARGET_REG_OPERAND,
-                                   fmt, 0, slotbuf, &regno)
-         || xtensa_operand_decode (isa, opcode, CONST16_TARGET_REG_OPERAND,
-                                   &regno))
-       return XTENSA_UNDEFINED;
-
-      /* Check that the next instruction is also CONST16.  */
-      offset += xtensa_format_length (isa, fmt);
-      xtensa_insnbuf_from_chars (isa, insnbuf, buf + offset, bufsize - offset);
-      fmt = xtensa_format_decode (isa, insnbuf);
-      if (fmt == XTENSA_UNDEFINED
-         || xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf))
-       return XTENSA_UNDEFINED;
-      opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf);
-      if (opcode != get_const16_opcode ())
-       return XTENSA_UNDEFINED;
-
-      if (xtensa_operand_get_field (isa, opcode, CONST16_TARGET_REG_OPERAND,
-                                   fmt, 0, slotbuf, &const16_regno)
-         || xtensa_operand_decode (isa, opcode, CONST16_TARGET_REG_OPERAND,
-                                   &const16_regno)
-         || const16_regno != regno)
-       return XTENSA_UNDEFINED;
+      removed_list->tail->next = new_r;
+      removed_list->tail = new_r;
     }
   else
-    return XTENSA_UNDEFINED;
-
-  /* Next instruction should be an CALLXn with operand 0 == regno.  */
-  offset += xtensa_format_length (isa, fmt);
-  xtensa_insnbuf_from_chars (isa, insnbuf, buf + offset, bufsize - offset);
-  fmt = xtensa_format_decode (isa, insnbuf);
-  if (fmt == XTENSA_UNDEFINED
-      || xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf))
-    return XTENSA_UNDEFINED;
-  opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf);
-  if (opcode == XTENSA_UNDEFINED 
-      || !is_indirect_call_opcode (opcode))
-    return XTENSA_UNDEFINED;
-
-  if (xtensa_operand_get_field (isa, opcode, CALLN_SOURCE_OPERAND,
-                               fmt, 0, slotbuf, &call_regno)
-      || xtensa_operand_decode (isa, opcode, CALLN_SOURCE_OPERAND,
-                               &call_regno))
-    return XTENSA_UNDEFINED;
-
-  if (call_regno != regno)
-    return XTENSA_UNDEFINED;
-
-  return opcode;
+    {
+      while (r->from.target_offset < from->target_offset
+            && r->next != NULL) 
+       {
+         r = r->next;
+       }
+      next_r = r->next;
+      r->next = new_r;
+      new_r->next = next_r;
+      if (next_r == NULL)
+       removed_list->tail = new_r;
+    }
 }
 
-\f
-/* Data structures used during relaxation.  */
-
-/* r_reloc: relocation values.  */
-
-/* Through the relaxation process, we need to keep track of the values
-   that will result from evaluating relocations.  The standard ELF
-   relocation structure is not sufficient for this purpose because we're
-   operating on multiple input files at once, so we need to know which
-   input file a relocation refers to.  The r_reloc structure thus
-   records both the input file (bfd) and ELF relocation.
-
-   For efficiency, an r_reloc also contains a "target_offset" field to
-   cache the target-section-relative offset value that is represented by
-   the relocation.
-   
-   The r_reloc also contains a virtual offset that allows multiple
-   inserted literals to be placed at the same "address" with
-   different offsets.  */
 
-typedef struct r_reloc_struct r_reloc;
+/* Check if the list of removed literals contains an entry for the
+   given address.  Return the entry if found.  */
 
-struct r_reloc_struct
+static removed_literal *
+find_removed_literal (removed_list, addr)
+     removed_literal_list *removed_list;
+     bfd_vma addr;
 {
-  bfd *abfd;
-  Elf_Internal_Rela rela;
-  bfd_vma target_offset;
-  bfd_vma virtual_offset;
-};
+  removed_literal *r = removed_list->head;
+  while (r && r->from.target_offset < addr)
+    r = r->next;
+  if (r && r->from.target_offset == addr)
+    return r;
+  return NULL;
+}
 
 
-/* The r_reloc structure is included by value in literal_value, but not
-   every literal_value has an associated relocation -- some are simple
-   constants.  In such cases, we set all the fields in the r_reloc
-   struct to zero.  The r_reloc_is_const function should be used to
-   detect this case.  */
+/* Adjust an offset in a section to compensate for literals that are
+   being removed.  Search the list of removed literals and subtract
+   4 bytes for every removed literal prior to the given address.  */
 
-static bfd_boolean
-r_reloc_is_const (const r_reloc *r_rel)
+static bfd_vma 
+offset_with_removed_literals (removed_list, addr)
+     removed_literal_list *removed_list;
+     bfd_vma addr;
 {
-  return (r_rel->abfd == NULL);
-}
-
+  removed_literal *r = removed_list->head;
+  unsigned num_bytes = 0;
 
-static bfd_vma
-r_reloc_get_target_offset (const r_reloc *r_rel)
-{
-  bfd_vma target_offset;
-  unsigned long r_symndx;
+  if (r == NULL)
+    return addr;
 
-  BFD_ASSERT (!r_reloc_is_const (r_rel));
-  r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
-  target_offset = get_elf_r_symndx_offset (r_rel->abfd, r_symndx);
-  return (target_offset + r_rel->rela.r_addend);
+  while (r && r->from.target_offset <= addr)
+    {
+      num_bytes += 4;
+      r = r->next;
+    }
+  if (num_bytes > addr)
+    return 0;
+  return (addr - num_bytes);
 }
 
+\f
+/* Coalescing literals may require a relocation to refer to a section in
+   a different input file, but the standard relocation information
+   cannot express that.  Instead, the reloc_bfd_fix structures are used
+   to "fix" the relocations that refer to sections in other input files.
+   These structures are kept on per-section lists.  The "src_type" field
+   records the relocation type in case there are multiple relocations on
+   the same location.  FIXME: This is ugly; an alternative might be to
+   add new symbols with the "owner" field to some other input file.  */
 
-static struct elf_link_hash_entry *
-r_reloc_get_hash_entry (const r_reloc *r_rel)
-{
-  unsigned long r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
-  return get_elf_r_symndx_hash_entry (r_rel->abfd, r_symndx);
-}
-
+typedef struct reloc_bfd_fix_struct reloc_bfd_fix;
 
-static asection *
-r_reloc_get_section (const r_reloc *r_rel)
+struct reloc_bfd_fix_struct
 {
-  unsigned long r_symndx = ELF32_R_SYM (r_rel->rela.r_info);
-  return get_elf_r_symndx_section (r_rel->abfd, r_symndx);
-}
-
+  asection *src_sec;
+  bfd_vma src_offset;
+  unsigned src_type;                   /* Relocation type.  */
+  
+  bfd *target_abfd;
+  asection *target_sec;
+  bfd_vma target_offset;
+  
+  reloc_bfd_fix *next;
+};
 
-static bfd_boolean
-r_reloc_is_defined (const r_reloc *r_rel)
-{
-  asection *sec;
-  if (r_rel == NULL)
-    return FALSE;
 
-  sec = r_reloc_get_section (r_rel);
-  if (sec == bfd_abs_section_ptr
-      || sec == bfd_com_section_ptr
-      || sec == bfd_und_section_ptr)
-    return FALSE;
-  return TRUE;
-}
+static reloc_bfd_fix *reloc_bfd_fix_init
+  PARAMS ((asection *, bfd_vma, unsigned, bfd *, asection *, bfd_vma));
+static reloc_bfd_fix *get_bfd_fix
+  PARAMS ((reloc_bfd_fix *, asection *, bfd_vma, unsigned));
 
 
-static void
-r_reloc_init (r_reloc *r_rel,
-             bfd *abfd,
-             Elf_Internal_Rela *irel,
-             bfd_byte *contents,
-             bfd_size_type content_length)
+static reloc_bfd_fix *
+reloc_bfd_fix_init (src_sec, src_offset, src_type,
+                   target_abfd, target_sec, target_offset)
+     asection *src_sec;
+     bfd_vma src_offset;
+     unsigned src_type;
+     bfd *target_abfd;
+     asection *target_sec;
+     bfd_vma target_offset;
 {
-  int r_type;
-  reloc_howto_type *howto;
+  reloc_bfd_fix *fix;
 
-  if (irel)
-    {
-      r_rel->rela = *irel;
-      r_rel->abfd = abfd;
-      r_rel->target_offset = r_reloc_get_target_offset (r_rel);
-      r_rel->virtual_offset = 0;
-      r_type = ELF32_R_TYPE (r_rel->rela.r_info);
-      howto = &elf_howto_table[r_type];
-      if (howto->partial_inplace)
-       {
-         bfd_vma inplace_val;
-         BFD_ASSERT (r_rel->rela.r_offset < content_length);
+  fix = (reloc_bfd_fix *) bfd_malloc (sizeof (reloc_bfd_fix));
+  fix->src_sec = src_sec;
+  fix->src_offset = src_offset;
+  fix->src_type = src_type;
+  fix->target_abfd = target_abfd;
+  fix->target_sec = target_sec;
+  fix->target_offset = target_offset;
 
-         inplace_val = bfd_get_32 (abfd, &contents[r_rel->rela.r_offset]);
-         r_rel->target_offset += inplace_val;
-       }
-    }
-  else
-    memset (r_rel, 0, sizeof (r_reloc));
+  return fix;
 }
 
 
-#if DEBUG
-
-static void
-print_r_reloc (FILE *fp, const r_reloc *r_rel)
+static reloc_bfd_fix *
+get_bfd_fix (fix_list, sec, offset, type)
+     reloc_bfd_fix *fix_list;
+     asection *sec;
+     bfd_vma offset;
+     unsigned type;
 {
-  if (r_reloc_is_defined (r_rel))
-    {
-      asection *sec = r_reloc_get_section (r_rel);
-      fprintf (fp, " %s(%s + ", sec->owner->filename, sec->name);
-    }
-  else if (r_reloc_get_hash_entry (r_rel))
-    fprintf (fp, " %s + ", r_reloc_get_hash_entry (r_rel)->root.root.string);
-  else
-    fprintf (fp, " ?? + ");
+  reloc_bfd_fix *r;
 
-  fprintf_vma (fp, r_rel->target_offset);
-  if (r_rel->virtual_offset)
+  for (r = fix_list; r != NULL; r = r->next) 
     {
-      fprintf (fp, " + ");
-      fprintf_vma (fp, r_rel->virtual_offset);
+      if (r->src_sec == sec
+         && r->src_offset == offset
+         && r->src_type == type)
+       return r;
     }
-    
-  fprintf (fp, ")");
+  return NULL;
 }
 
-#endif /* DEBUG */
-
 \f
-/* source_reloc: relocations that reference literals.  */
-
-/* To determine whether literals can be coalesced, we need to first
-   record all the relocations that reference the literals.  The
-   source_reloc structure below is used for this purpose.  The
-   source_reloc entries are kept in a per-literal-section array, sorted
-   by offset within the literal section (i.e., target offset).
-
-   The source_sec and r_rel.rela.r_offset fields identify the source of
-   the relocation.  The r_rel field records the relocation value, i.e.,
-   the offset of the literal being referenced.  The opnd field is needed
-   to determine the range of the immediate field to which the relocation
-   applies, so we can determine whether another literal with the same
-   value is within range.  The is_null field is true when the relocation
-   is being removed (e.g., when an L32R is being removed due to a CALLX
-   that is converted to a direct CALL).  */
-
-typedef struct source_reloc_struct source_reloc;
+/* Per-section data for relaxation.  */
 
-struct source_reloc_struct
+struct xtensa_relax_info_struct
 {
-  asection *source_sec;
-  r_reloc r_rel;
-  xtensa_opcode opcode;
-  int opnd;
-  bfd_boolean is_null;
-  bfd_boolean is_abs_literal;
-};
-
+  bfd_boolean is_relaxable_literal_section;
+  int visited;                         /* Number of times visited.  */
 
-static void
-init_source_reloc (source_reloc *reloc,
-                  asection *source_sec,
-                  const r_reloc *r_rel,
-                  xtensa_opcode opcode,
-                  int opnd,
-                  bfd_boolean is_abs_literal)
-{
-  reloc->source_sec = source_sec;
-  reloc->r_rel = *r_rel;
-  reloc->opcode = opcode;
-  reloc->opnd = opnd;
-  reloc->is_null = FALSE;
-  reloc->is_abs_literal = is_abs_literal;
-}
+  source_reloc *src_relocs;            /* Array[src_count].  */
+  int src_count;
+  int src_next;                                /* Next src_relocs entry to assign.  */
 
+  removed_literal_list removed_list;
 
-/* Find the source_reloc for a particular source offset and relocation
-   type.  Note that the array is sorted by _target_ offset, so this is
-   just a linear search.  */
+  reloc_bfd_fix *fix_list;
+};
 
-static source_reloc *
-find_source_reloc (source_reloc *src_relocs,
-                  int src_count,
-                  asection *sec,
-                  Elf_Internal_Rela *irel)
+struct elf_xtensa_section_data
 {
-  int i;
-
-  for (i = 0; i < src_count; i++)
-    {
-      if (src_relocs[i].source_sec == sec
-         && src_relocs[i].r_rel.rela.r_offset == irel->r_offset
-         && (ELF32_R_TYPE (src_relocs[i].r_rel.rela.r_info)
-             == ELF32_R_TYPE (irel->r_info)))
-       return &src_relocs[i];
-    }
+  struct bfd_elf_section_data elf;
+  xtensa_relax_info relax_info;
+};
 
-  return NULL;
-}
+static void init_xtensa_relax_info
+  PARAMS ((asection *));
+static xtensa_relax_info *get_xtensa_relax_info
+  PARAMS ((asection *));
+static void add_fix
+  PARAMS ((asection *, reloc_bfd_fix *));
 
 
-static int
-source_reloc_compare (const void *ap, const void *bp)
+static bfd_boolean
+elf_xtensa_new_section_hook (abfd, sec)
+     bfd *abfd;
+     asection *sec;
 {
-  const source_reloc *a = (const source_reloc *) ap;
-  const source_reloc *b = (const source_reloc *) bp;
-
-  if (a->r_rel.target_offset != b->r_rel.target_offset)
-    return (a->r_rel.target_offset - b->r_rel.target_offset);
-
-  /* We don't need to sort on these criteria for correctness,
-     but enforcing a more strict ordering prevents unstable qsort
-     from behaving differently with different implementations.
-     Without the code below we get correct but different results
-     on Solaris 2.7 and 2.8.  We would like to always produce the
-     same results no matter the host. */
-
-  if ((!a->is_null) - (!b->is_null))
-    return ((!a->is_null) - (!b->is_null));
-  return internal_reloc_compare (&a->r_rel.rela, &b->r_rel.rela);
-}
+  struct elf_xtensa_section_data *sdata;
+  bfd_size_type amt = sizeof (*sdata);
 
-\f
-/* Literal values and value hash tables.  */
-
-/* Literals with the same value can be coalesced.  The literal_value
-   structure records the value of a literal: the "r_rel" field holds the
-   information from the relocation on the literal (if there is one) and
-   the "value" field holds the contents of the literal word itself.
-
-   The value_map structure records a literal value along with the
-   location of a literal holding that value.  The value_map hash table
-   is indexed by the literal value, so that we can quickly check if a
-   particular literal value has been seen before and is thus a candidate
-   for coalescing.  */
-
-typedef struct literal_value_struct literal_value;
-typedef struct value_map_struct value_map;
-typedef struct value_map_hash_table_struct value_map_hash_table;
-
-struct literal_value_struct
-{
-  r_reloc r_rel; 
-  unsigned long value;
-  bfd_boolean is_abs_literal;
-};
-
-struct value_map_struct
-{
-  literal_value val;                   /* The literal value.  */
-  r_reloc loc;                         /* Location of the literal.  */
-  value_map *next;
-};
-
-struct value_map_hash_table_struct
-{
-  unsigned bucket_count;
-  value_map **buckets;
-  unsigned count;
-  bfd_boolean has_last_loc;
-  r_reloc last_loc;
-};
-
-
-static void
-init_literal_value (literal_value *lit,
-                   const r_reloc *r_rel,
-                   unsigned long value,
-                   bfd_boolean is_abs_literal)
-{
-  lit->r_rel = *r_rel;
-  lit->value = value;
-  lit->is_abs_literal = is_abs_literal;
-}
-
-
-static bfd_boolean
-literal_value_equal (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;
-
-  if (r_reloc_is_const (&src1->r_rel))
-    return (src1->value == src2->value);
-
-  if (ELF32_R_TYPE (src1->r_rel.rela.r_info)
-      != ELF32_R_TYPE (src2->r_rel.rela.r_info))
-    return FALSE;
-
-  if (src1->r_rel.target_offset != src2->r_rel.target_offset)
-    return FALSE;
-   
-  if (src1->r_rel.virtual_offset != src2->r_rel.virtual_offset)
-    return FALSE;
-
-  if (src1->value != src2->value)
-    return FALSE;
-  
-  /* 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))
-       return FALSE;
-    }
-  else
-    {
-      /* Require that the hash entries (i.e., symbols) be identical.  */
-      if (h1 != h2 || h1 == 0)
-       return FALSE;
-    }
-
-  if (src1->is_abs_literal != src2->is_abs_literal)
-    return FALSE;
-
-  return TRUE;
-}
-
-
-/* Must be power of 2.  */
-#define INITIAL_HASH_RELOC_BUCKET_COUNT 1024
-
-static value_map_hash_table *
-value_map_hash_table_init (void)
-{
-  value_map_hash_table *values;
-
-  values = (value_map_hash_table *)
-    bfd_zmalloc (sizeof (value_map_hash_table));
-  values->bucket_count = INITIAL_HASH_RELOC_BUCKET_COUNT;
-  values->count = 0;
-  values->buckets = (value_map **)
-    bfd_zmalloc (sizeof (value_map *) * values->bucket_count);
-  if (values->buckets == NULL) 
-    {
-      free (values);
-      return NULL;
-    }
-  values->has_last_loc = FALSE;
-
-  return values;
-}
-
-
-static void
-value_map_hash_table_delete (value_map_hash_table *table)
-{
-  free (table->buckets);
-  free (table);
-}
-
-
-static unsigned
-hash_bfd_vma (bfd_vma val)
-{
-  return (val >> 2) + (val >> 10);
-}
-
-
-static unsigned
-literal_value_hash (const literal_value *src)
-{
-  unsigned hash_val;
-
-  hash_val = hash_bfd_vma (src->value);
-  if (!r_reloc_is_const (&src->r_rel))
-    {
-      void *sec_or_hash;
-
-      hash_val += hash_bfd_vma (src->is_abs_literal * 1000);
-      hash_val += hash_bfd_vma (src->r_rel.target_offset);
-      hash_val += hash_bfd_vma (src->r_rel.virtual_offset);
-  
-      /* Now check for the same section and the same elf_hash.  */
-      if (r_reloc_is_defined (&src->r_rel))
-       sec_or_hash = r_reloc_get_section (&src->r_rel);
-      else
-       sec_or_hash = r_reloc_get_hash_entry (&src->r_rel);
-      hash_val += hash_bfd_vma ((bfd_vma) (unsigned) sec_or_hash);
-    }
-  return hash_val;
-}
-
-
-/* Check if the specified literal_value has been seen before.  */
-
-static value_map *
-value_map_get_cached_value (value_map_hash_table *map,
-                           const literal_value *val,
-                           bfd_boolean final_static_link)
-{
-  value_map *map_e;
-  value_map *bucket;
-  unsigned idx;
-
-  idx = literal_value_hash (val);
-  idx = idx & (map->bucket_count - 1);
-  bucket = map->buckets[idx];
-  for (map_e = bucket; map_e; map_e = map_e->next)
-    {
-      if (literal_value_equal (&map_e->val, val, final_static_link))
-       return map_e;
-    }
-  return NULL;
-}
-
-
-/* Record a new literal value.  It is illegal to call this if VALUE
-   already has an entry here.  */
-
-static value_map *
-add_value_map (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));
-  if (val_e == NULL)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return NULL;
-    }
-
-  BFD_ASSERT (!value_map_get_cached_value (map, val, final_static_link));
-  val_e->val = *val;
-  val_e->loc = *loc;
-
-  idx = literal_value_hash (val);
-  idx = idx & (map->bucket_count - 1);
-  bucket_p = &map->buckets[idx];
-
-  val_e->next = *bucket_p;
-  *bucket_p = val_e;
-  map->count++;
-  /* FIXME: Consider resizing the hash table if we get too many entries.  */
-  
-  return val_e;
-}
-
-\f
-/* Lists of text actions (ta_) for narrowing, widening, longcall
-   conversion, space fill, code & literal removal, etc.  */
-
-/* The following text actions are generated:
-
-   "ta_remove_insn"         remove an instruction or instructions
-   "ta_remove_longcall"     convert longcall to call
-   "ta_convert_longcall"    convert longcall to nop/call
-   "ta_narrow_insn"         narrow a wide instruction
-   "ta_widen"               widen a narrow instruction
-   "ta_fill"                add fill or remove fill
-      removed < 0 is a fill; branches to the fill address will be
-       changed to address + fill size (e.g., address - removed)
-      removed >= 0 branches to the fill address will stay unchanged
-   "ta_remove_literal"      remove a literal; this action is
-                           indicated when a literal is removed
-                            or replaced.
-   "ta_add_literal"         insert a new literal; this action is
-                            indicated when a literal has been moved.
-                            It may use a virtual_offset because
-                           multiple literals can be placed at the
-                            same location.
-
-   For each of these text actions, we also record the number of bytes
-   removed by performing the text action.  In the case of a "ta_widen"
-   or a "ta_fill" that adds space, the removed_bytes will be negative.  */
-
-typedef struct text_action_struct text_action;
-typedef struct text_action_list_struct text_action_list;
-typedef enum text_action_enum_t text_action_t;
-
-enum text_action_enum_t
-{
-  ta_none,
-  ta_remove_insn,        /* removed = -size */
-  ta_remove_longcall,    /* removed = -size */
-  ta_convert_longcall,   /* removed = 0 */
-  ta_narrow_insn,        /* removed = -1 */
-  ta_widen_insn,         /* removed = +1 */
-  ta_fill,               /* removed = +size */
-  ta_remove_literal,
-  ta_add_literal
-};
-
-
-/* Structure for a text action record.  */
-struct text_action_struct
-{
-  text_action_t action;
-  asection *sec;       /* Optional */
-  bfd_vma offset;
-  bfd_vma virtual_offset;  /* Zero except for adding literals.  */
-  int removed_bytes;
-  literal_value value; /* Only valid when adding literals.  */
-
-  text_action *next;
-};
-
-
-/* List of all of the actions taken on a text section.  */
-struct text_action_list_struct
-{
-  text_action *head;
-};
-
-
-static text_action *
-find_fill_action (text_action_list *l, asection *sec, bfd_vma offset)
-{
-  text_action **m_p;
-
-  /* It is not necessary to fill at the end of a section.  */
-  if (sec->size == offset)
-    return NULL;
-
-  for (m_p = &l->head; *m_p && (*m_p)->offset <= offset; m_p = &(*m_p)->next)
-    {
-      text_action *t = *m_p;
-      /* When the action is another fill at the same address,
-        just increase the size.  */
-      if (t->offset == offset && t->action == ta_fill)
-       return t;
-    }
-  return NULL;
-}
-
-
-static int
-compute_removed_action_diff (const text_action *ta,
-                            asection *sec,
-                            bfd_vma offset,
-                            int removed,
-                            int removable_space)
-{
-  int new_removed;
-  int current_removed = 0;
-
-  if (ta)
-    current_removed = ta->removed_bytes;
-
-  BFD_ASSERT (ta == NULL || ta->offset == offset);
-  BFD_ASSERT (ta == NULL || ta->action == ta_fill);
-
-  /* It is not necessary to fill at the end of a section.  Clean this up.  */
-  if (sec->size == offset)
-    new_removed = removable_space - 0;
-  else
-    {
-      int space;
-      int added = -removed - current_removed;
-      /* Ignore multiples of the section alignment.  */
-      added = ((1 << sec->alignment_power) - 1) & added;
-      new_removed = (-added);
-
-      /* Modify for removable.  */
-      space = removable_space - new_removed;
-      new_removed = (removable_space
-                    - (((1 << sec->alignment_power) - 1) & space));
-    }
-  return (new_removed - current_removed);
-}
-
-
-static void
-adjust_fill_action (text_action *ta, int fill_diff)
-{
-  ta->removed_bytes += fill_diff;
-}
-
-
-/* Add a modification action to the text.  For the case of adding or
-   removing space, modify any current fill and assume that
-   "unreachable_space" bytes can be freely contracted.  Note that a
-   negative removed value is a fill.  */
-
-static void 
-text_action_add (text_action_list *l,
-                text_action_t action,
-                asection *sec,
-                bfd_vma offset,
-                int removed)
-{
-  text_action **m_p;
-  text_action *ta;
-
-  /* It is not necessary to fill at the end of a section.  */
-  if (action == ta_fill && sec->size == offset)
-    return;
-
-  /* It is not necessary to fill 0 bytes.  */
-  if (action == ta_fill && removed == 0)
-    return;
-
-  for (m_p = &l->head; *m_p && (*m_p)->offset <= offset; m_p = &(*m_p)->next)
-    {
-      text_action *t = *m_p;
-      /* When the action is another fill at the same address,
-        just increase the size.  */
-      if (t->offset == offset && t->action == ta_fill && action == ta_fill)
-       {
-         t->removed_bytes += removed;
-         return;
-       }
-    }
-
-  /* Create a new record and fill it up.  */
-  ta = (text_action *) bfd_zmalloc (sizeof (text_action));
-  ta->action = action;
-  ta->sec = sec;
-  ta->offset = offset;
-  ta->removed_bytes = removed;
-  ta->next = (*m_p);
-  *m_p = ta;
-}
-
-
-static void
-text_action_add_literal (text_action_list *l,
-                        text_action_t action,
-                        const r_reloc *loc,
-                        const literal_value *value,
-                        int removed)
-{
-  text_action **m_p;
-  text_action *ta;
-  asection *sec = r_reloc_get_section (loc);
-  bfd_vma offset = loc->target_offset;
-  bfd_vma virtual_offset = loc->virtual_offset;
-
-  BFD_ASSERT (action == ta_add_literal);
-
-  for (m_p = &l->head; *m_p != NULL; m_p = &(*m_p)->next)
-    {
-      if ((*m_p)->offset > offset
-         && ((*m_p)->offset != offset
-             || (*m_p)->virtual_offset > virtual_offset))
-       break;
-    }
-
-  /* Create a new record and fill it up.  */
-  ta = (text_action *) bfd_zmalloc (sizeof (text_action));
-  ta->action = action;
-  ta->sec = sec;
-  ta->offset = offset;
-  ta->virtual_offset = virtual_offset;
-  ta->value = *value;
-  ta->removed_bytes = removed;
-  ta->next = (*m_p);
-  *m_p = ta;
-}
-
-
-static bfd_vma 
-offset_with_removed_text (text_action_list *action_list, bfd_vma offset)
-{
-  text_action *r;
-  int removed = 0;
-
-  for (r = action_list->head; r && r->offset <= offset; r = r->next)
-    {
-      if (r->offset < offset
-         || (r->action == ta_fill && r->removed_bytes < 0))
-       removed += r->removed_bytes;
-    }
-
-  return (offset - removed);
-}
-
-
-static bfd_vma
-offset_with_removed_text_before_fill (text_action_list *action_list,
-                                     bfd_vma offset)
-{
-  text_action *r;
-  int removed = 0;
-
-  for (r = action_list->head; r && r->offset < offset; r = r->next)
-    removed += r->removed_bytes;
-
-  return (offset - removed);
-}
-
-
-/* The find_insn_action routine will only find non-fill actions.  */
-
-static text_action *
-find_insn_action (text_action_list *action_list, bfd_vma offset)
-{
-  text_action *t;
-  for (t = action_list->head; t; t = t->next)
-    {
-      if (t->offset == offset)
-       {
-         switch (t->action)
-           {
-           case ta_none:
-           case ta_fill:
-             break;
-           case ta_remove_insn:
-           case ta_remove_longcall:
-           case ta_convert_longcall:
-           case ta_narrow_insn:
-           case ta_widen_insn:
-             return t;
-           case ta_remove_literal:
-           case ta_add_literal:
-             BFD_ASSERT (0);
-             break;
-           }
-       }
-    }
-  return NULL;
-}
-
-
-#if DEBUG
-
-static void
-print_action_list (FILE *fp, text_action_list *action_list)
-{
-  text_action *r;
-
-  fprintf (fp, "Text Action\n");
-  for (r = action_list->head; r != NULL; r = r->next)
-    {
-      const char *t = "unknown";
-      switch (r->action)
-       {
-       case ta_remove_insn:
-         t = "remove_insn"; break;
-       case ta_remove_longcall:
-         t = "remove_longcall"; break;
-       case ta_convert_longcall:
-         t = "remove_longcall"; break;
-       case ta_narrow_insn:
-         t = "narrow_insn"; break;
-       case ta_widen_insn:
-         t = "widen_insn"; break;
-       case ta_fill:
-         t = "fill"; break;
-       case ta_none:
-         t = "none"; break;
-       case ta_remove_literal:
-         t = "remove_literal"; break;
-       case ta_add_literal:
-         t = "add_literal"; break;
-       }
-
-      fprintf (fp, "%s: %s[0x%lx] \"%s\" %d\n",
-              r->sec->owner->filename,
-              r->sec->name, r->offset, t, r->removed_bytes);
-    }
-}
-
-#endif /* DEBUG */
-
-\f
-/* Lists of literals being coalesced or removed.  */
-
-/* In the usual case, the literal identified by "from" is being
-   coalesced with another literal identified by "to".  If the literal is
-   unused and is being removed altogether, "to.abfd" will be NULL.
-   The removed_literal entries are kept on a per-section list, sorted
-   by the "from" offset field.  */
-
-typedef struct removed_literal_struct removed_literal;
-typedef struct removed_literal_list_struct removed_literal_list;
-
-struct removed_literal_struct
-{
-  r_reloc from;
-  r_reloc to;
-  removed_literal *next;
-};
-
-struct removed_literal_list_struct
-{
-  removed_literal *head;
-  removed_literal *tail;
-};
-
-
-/* Record that the literal at "from" is being removed.  If "to" is not
-   NULL, the "from" literal is being coalesced with the "to" literal.  */
-
-static void
-add_removed_literal (removed_literal_list *removed_list,
-                    const r_reloc *from,
-                    const r_reloc *to)
-{
-  removed_literal *r, *new_r, *next_r;
-
-  new_r = (removed_literal *) bfd_zmalloc (sizeof (removed_literal));
-
-  new_r->from = *from;
-  if (to)
-    new_r->to = *to;
-  else
-    new_r->to.abfd = NULL;
-  new_r->next = NULL;
-  
-  r = removed_list->head;
-  if (r == NULL) 
-    {
-      removed_list->head = new_r;
-      removed_list->tail = new_r;
-    }
-  /* Special check for common case of append.  */
-  else if (removed_list->tail->from.target_offset < from->target_offset)
-    {
-      removed_list->tail->next = new_r;
-      removed_list->tail = new_r;
-    }
-  else
-    {
-      while (r->from.target_offset < from->target_offset && r->next) 
-       {
-         r = r->next;
-       }
-      next_r = r->next;
-      r->next = new_r;
-      new_r->next = next_r;
-      if (next_r == NULL)
-       removed_list->tail = new_r;
-    }
-}
-
-
-/* Check if the list of removed literals contains an entry for the
-   given address.  Return the entry if found.  */
-
-static removed_literal *
-find_removed_literal (removed_literal_list *removed_list, bfd_vma addr)
-{
-  removed_literal *r = removed_list->head;
-  while (r && r->from.target_offset < addr)
-    r = r->next;
-  if (r && r->from.target_offset == addr)
-    return r;
-  return NULL;
-}
-
-
-#if DEBUG
-
-static void
-print_removed_literals (FILE *fp, removed_literal_list *removed_list)
-{
-  removed_literal *r;
-  r = removed_list->head;
-  if (r)
-    fprintf (fp, "Removed Literals\n");
-  for (; r != NULL; r = r->next)
-    {
-      print_r_reloc (fp, &r->from);
-      fprintf (fp, " => ");
-      if (r->to.abfd == NULL)
-       fprintf (fp, "REMOVED");
-      else
-       print_r_reloc (fp, &r->to);
-      fprintf (fp, "\n");
-    }
-}
-
-#endif /* DEBUG */
-
-\f
-/* Per-section data for relaxation.  */
-
-typedef struct reloc_bfd_fix_struct reloc_bfd_fix;
-
-struct xtensa_relax_info_struct
-{
-  bfd_boolean is_relaxable_literal_section;
-  bfd_boolean is_relaxable_asm_section;
-  int visited;                         /* Number of times visited.  */
-
-  source_reloc *src_relocs;            /* Array[src_count].  */
-  int src_count;
-  int src_next;                                /* Next src_relocs entry to assign.  */
-
-  removed_literal_list removed_list;
-  text_action_list action_list;
-
-  reloc_bfd_fix *fix_list;
-  reloc_bfd_fix *fix_array;
-  unsigned fix_array_count;
-
-  /* Support for expanding the reloc array that is stored
-     in the section structure.  If the relocations have been
-     reallocated, the newly allocated relocations will be referenced
-     here along with the actual size allocated.  The relocation
-     count will always be found in the section structure.  */
-  Elf_Internal_Rela *allocated_relocs; 
-  unsigned relocs_count;
-  unsigned allocated_relocs_count;
-};
-
-struct elf_xtensa_section_data
-{
-  struct bfd_elf_section_data elf;
-  xtensa_relax_info relax_info;
-};
-
-
-static bfd_boolean
-elf_xtensa_new_section_hook (bfd *abfd, asection *sec)
-{
-  struct elf_xtensa_section_data *sdata;
-  bfd_size_type amt = sizeof (*sdata);
-
-  sdata = (struct elf_xtensa_section_data *) bfd_zalloc (abfd, amt);
-  if (sdata == NULL)
-    return FALSE;
-  sec->used_by_bfd = (void *) sdata;
-
-  return _bfd_elf_new_section_hook (abfd, sec);
-}
-
-
-static xtensa_relax_info *
-get_xtensa_relax_info (asection *sec)
-{
-  struct elf_xtensa_section_data *section_data;
-
-  /* No info available if no section or if it is an output section.  */
-  if (!sec || sec == sec->output_section)
-    return NULL;
-
-  section_data = (struct elf_xtensa_section_data *) elf_section_data (sec);
-  return &section_data->relax_info;
-}
-
-
-static void
-init_xtensa_relax_info (asection *sec)
-{
-  xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
-
-  relax_info->is_relaxable_literal_section = FALSE;
-  relax_info->is_relaxable_asm_section = FALSE;
-  relax_info->visited = 0;
-
-  relax_info->src_relocs = NULL;
-  relax_info->src_count = 0;
-  relax_info->src_next = 0;
-
-  relax_info->removed_list.head = NULL;
-  relax_info->removed_list.tail = NULL;
-
-  relax_info->action_list.head = NULL;
-
-  relax_info->fix_list = NULL;
-  relax_info->fix_array = NULL;
-  relax_info->fix_array_count = 0;
-
-  relax_info->allocated_relocs = NULL; 
-  relax_info->relocs_count = 0;
-  relax_info->allocated_relocs_count = 0;
-}
-
-\f
-/* Coalescing literals may require a relocation to refer to a section in
-   a different input file, but the standard relocation information
-   cannot express that.  Instead, the reloc_bfd_fix structures are used
-   to "fix" the relocations that refer to sections in other input files.
-   These structures are kept on per-section lists.  The "src_type" field
-   records the relocation type in case there are multiple relocations on
-   the same location.  FIXME: This is ugly; an alternative might be to
-   add new symbols with the "owner" field to some other input file.  */
-
-struct reloc_bfd_fix_struct
-{
-  asection *src_sec;
-  bfd_vma src_offset;
-  unsigned src_type;                   /* Relocation type.  */
-  
-  bfd *target_abfd;
-  asection *target_sec;
-  bfd_vma target_offset;
-  bfd_boolean translated;
-  
-  reloc_bfd_fix *next;
-};
-
-
-static reloc_bfd_fix *
-reloc_bfd_fix_init (asection *src_sec,
-                   bfd_vma src_offset,
-                   unsigned src_type,
-                   bfd *target_abfd,
-                   asection *target_sec,
-                   bfd_vma target_offset,
-                   bfd_boolean translated)
-{
-  reloc_bfd_fix *fix;
-
-  fix = (reloc_bfd_fix *) bfd_malloc (sizeof (reloc_bfd_fix));
-  fix->src_sec = src_sec;
-  fix->src_offset = src_offset;
-  fix->src_type = src_type;
-  fix->target_abfd = target_abfd;
-  fix->target_sec = target_sec;
-  fix->target_offset = target_offset;
-  fix->translated = translated;
-
-  return fix;
-}
-
-
-static void
-add_fix (asection *src_sec, reloc_bfd_fix *fix)
-{
-  xtensa_relax_info *relax_info;
-
-  relax_info = get_xtensa_relax_info (src_sec);
-  fix->next = relax_info->fix_list;
-  relax_info->fix_list = fix;
-}
-
-
-static int
-fix_compare (const void *ap, const void *bp)
-{
-  const reloc_bfd_fix *a = (const reloc_bfd_fix *) ap;
-  const reloc_bfd_fix *b = (const reloc_bfd_fix *) bp;
-
-  if (a->src_offset != b->src_offset)
-    return (a->src_offset - b->src_offset);
-  return (a->src_type - b->src_type);
-}
-
-
-static void
-cache_fix_array (asection *sec)
-{
-  unsigned i, count = 0;
-  reloc_bfd_fix *r;
-  xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
-
-  if (relax_info == NULL)
-    return;
-  if (relax_info->fix_list == NULL)
-    return;
-
-  for (r = relax_info->fix_list; r != NULL; r = r->next)
-    count++;
-
-  relax_info->fix_array =
-    (reloc_bfd_fix *) bfd_malloc (sizeof (reloc_bfd_fix) * count);
-  relax_info->fix_array_count = count;
-
-  r = relax_info->fix_list;
-  for (i = 0; i < count; i++, r = r->next)
-    {
-      relax_info->fix_array[count - 1 - i] = *r;
-      relax_info->fix_array[count - 1 - i].next = NULL;
-    }
-
-  qsort (relax_info->fix_array, relax_info->fix_array_count,
-        sizeof (reloc_bfd_fix), fix_compare);
-}
-
-
-static reloc_bfd_fix *
-get_bfd_fix (asection *sec, bfd_vma offset, unsigned type)
-{
-  xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
-  reloc_bfd_fix *rv;
-  reloc_bfd_fix key;
-
-  if (relax_info == NULL)
-    return NULL;
-  if (relax_info->fix_list == NULL)
-    return NULL;
-
-  if (relax_info->fix_array == NULL)
-    cache_fix_array (sec);
-
-  key.src_offset = offset;
-  key.src_type = type;
-  rv = bsearch (&key, relax_info->fix_array,  relax_info->fix_array_count,
-               sizeof (reloc_bfd_fix), fix_compare);
-  return rv;
-}
-
-\f
-/* Section caching.  */
-
-typedef struct section_cache_struct section_cache_t;
-
-struct section_cache_struct
-{
-  asection *sec;
-
-  bfd_byte *contents;          /* Cache of the section contents.  */
-  bfd_size_type content_length;
-
-  property_table_entry *ptbl;  /* Cache of the section property table.  */
-  unsigned pte_count;
-
-  Elf_Internal_Rela *relocs;   /* Cache of the section relocations.  */
-  unsigned reloc_count;
-};
-
-
-static void
-init_section_cache (section_cache_t *sec_cache)
-{
-  memset (sec_cache, 0, sizeof (*sec_cache));
-}
-
-
-static void
-clear_section_cache (section_cache_t *sec_cache)
-{
-  if (sec_cache->sec)
-    {
-      release_contents (sec_cache->sec, sec_cache->contents);
-      release_internal_relocs (sec_cache->sec, sec_cache->relocs);
-      if (sec_cache->ptbl)
-       free (sec_cache->ptbl);
-      memset (sec_cache, 0, sizeof (sec_cache));
-    }
-}
-
-
-static bfd_boolean
-section_cache_section (section_cache_t *sec_cache,
-                      asection *sec,
-                      struct bfd_link_info *link_info)
-{
-  bfd *abfd;
-  property_table_entry *prop_table = NULL;
-  int ptblsize = 0;
-  bfd_byte *contents = NULL;
-  Elf_Internal_Rela *internal_relocs = NULL;
-  bfd_size_type sec_size;
-
-  if (sec == NULL)
-    return FALSE;
-  if (sec == sec_cache->sec)
-    return TRUE;
-
-  abfd = sec->owner;
-  sec_size = bfd_get_section_limit (abfd, sec);
-
-  /* Get the contents.  */
-  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
-    goto err;
-
-  /* Get the relocations.  */
-  internal_relocs = retrieve_internal_relocs (abfd, sec,
-                                             link_info->keep_memory);
-
-  /* Get the entry table.  */
-  ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
-                                       XTENSA_PROP_SEC_NAME, FALSE);
-  if (ptblsize < 0)
-    goto err;
-
-  /* Fill in the new section cache.  */
-  clear_section_cache (sec_cache);
-  memset (sec_cache, 0, sizeof (sec_cache));
-
-  sec_cache->sec = sec;
-  sec_cache->contents = contents;
-  sec_cache->content_length = sec_size;
-  sec_cache->relocs = internal_relocs;
-  sec_cache->reloc_count = sec->reloc_count;
-  sec_cache->pte_count = ptblsize;
-  sec_cache->ptbl = prop_table;
-
-  return TRUE;
-
- err:
-  release_contents (sec, contents);
-  release_internal_relocs (sec, internal_relocs);
-  if (prop_table)
-    free (prop_table);
-  return FALSE;
-}
-
-\f
-/* Extended basic blocks.  */
-
-/* An ebb_struct represents an Extended Basic Block.  Within this
-   range, we guarantee that all instructions are decodable, the
-   property table entries are contiguous, and no property table
-   specifies a segment that cannot have instructions moved.  This
-   structure contains caches of the contents, property table and
-   relocations for the specified section for easy use.  The range is
-   specified by ranges of indices for the byte offset, property table
-   offsets and relocation offsets.  These must be consistent.  */
-
-typedef struct ebb_struct ebb_t;
-
-struct ebb_struct
-{
-  asection *sec;
-
-  bfd_byte *contents;          /* Cache of the section contents.  */
-  bfd_size_type content_length;
-
-  property_table_entry *ptbl;  /* Cache of the section property table.  */
-  unsigned pte_count;
-
-  Elf_Internal_Rela *relocs;   /* Cache of the section relocations.  */
-  unsigned reloc_count;
-
-  bfd_vma start_offset;                /* Offset in section.  */
-  unsigned start_ptbl_idx;     /* Offset in the property table.  */
-  unsigned start_reloc_idx;    /* Offset in the relocations.  */
-
-  bfd_vma end_offset;
-  unsigned end_ptbl_idx;
-  unsigned end_reloc_idx;
-
-  bfd_boolean ends_section;    /* Is this the last ebb in a section?  */
-
-  /* The unreachable property table at the end of this set of blocks;
-     NULL if the end is not an unreachable block.  */
-  property_table_entry *ends_unreachable;
-};
-
-
-enum ebb_target_enum
-{
-  EBB_NO_ALIGN = 0,
-  EBB_DESIRE_TGT_ALIGN,
-  EBB_REQUIRE_TGT_ALIGN,
-  EBB_REQUIRE_LOOP_ALIGN,
-  EBB_REQUIRE_ALIGN
-};
-
-
-/* proposed_action_struct is similar to the text_action_struct except
-   that is represents a potential transformation, not one that will
-   occur.  We build a list of these for an extended basic block
-   and use them to compute the actual actions desired.  We must be
-   careful that the entire set of actual actions we perform do not
-   break any relocations that would fit if the actions were not
-   performed.  */
-
-typedef struct proposed_action_struct proposed_action;
-
-struct proposed_action_struct
-{
-  enum ebb_target_enum align_type; /* for the target alignment */
-  bfd_vma alignment_pow;
-  text_action_t action;
-  bfd_vma offset;
-  int removed_bytes;
-  bfd_boolean do_action; /* If false, then we will not perform the action.  */
-};
-
-
-/* The ebb_constraint_struct keeps a set of proposed actions for an
-   extended basic block.   */
-
-typedef struct ebb_constraint_struct ebb_constraint;
-
-struct ebb_constraint_struct
-{
-  ebb_t ebb;
-  bfd_boolean start_movable;
-
-  /* Bytes of extra space at the beginning if movable.  */
-  int start_extra_space;
-
-  enum ebb_target_enum start_align;
-
-  bfd_boolean end_movable;
-
-  /* Bytes of extra space at the end if movable.  */
-  int end_extra_space;
-
-  unsigned action_count;
-  unsigned action_allocated;
-
-  /* Array of proposed actions.  */
-  proposed_action *actions;
-
-  /* Action alignments -- one for each proposed action.  */
-  enum ebb_target_enum *action_aligns;
-};
-
-
-static void
-init_ebb_constraint (ebb_constraint *c)
-{
-  memset (c, 0, sizeof (ebb_constraint));
-}
-
-
-static void
-free_ebb_constraint (ebb_constraint *c)
-{
-  if (c->actions)
-    free (c->actions);
-}
-
-
-static void
-init_ebb (ebb_t *ebb,
-         asection *sec,
-         bfd_byte *contents,
-         bfd_size_type content_length,
-         property_table_entry *prop_table,
-         unsigned ptblsize,
-         Elf_Internal_Rela *internal_relocs,
-         unsigned reloc_count)
-{
-  memset (ebb, 0, sizeof (ebb_t));
-  ebb->sec = sec;
-  ebb->contents = contents;
-  ebb->content_length = content_length;
-  ebb->ptbl = prop_table;
-  ebb->pte_count = ptblsize;
-  ebb->relocs = internal_relocs;
-  ebb->reloc_count = reloc_count;
-  ebb->start_offset = 0;
-  ebb->end_offset = ebb->content_length - 1;
-  ebb->start_ptbl_idx = 0;
-  ebb->end_ptbl_idx = ptblsize;
-  ebb->start_reloc_idx = 0;
-  ebb->end_reloc_idx = reloc_count;
-}
-
-
-/* Extend the ebb to all decodable contiguous sections.  The algorithm
-   for building a basic block around an instruction is to push it
-   forward until we hit the end of a section, an unreachable block or
-   a block that cannot be transformed.  Then we push it backwards
-   searching for similar conditions.  */
-
-static bfd_boolean extend_ebb_bounds_forward (ebb_t *);
-static bfd_boolean extend_ebb_bounds_backward (ebb_t *);
-static bfd_size_type insn_block_decodable_len
-  (bfd_byte *, bfd_size_type, bfd_vma, bfd_size_type);
-
-static bfd_boolean
-extend_ebb_bounds (ebb_t *ebb)
-{
-  if (!extend_ebb_bounds_forward (ebb))
-    return FALSE;
-  if (!extend_ebb_bounds_backward (ebb))
-    return FALSE;
-  return TRUE;
-}
-
-
-static bfd_boolean
-extend_ebb_bounds_forward (ebb_t *ebb)
-{
-  property_table_entry *the_entry, *new_entry;
-
-  the_entry = &ebb->ptbl[ebb->end_ptbl_idx];
-
-  /* Stop when (1) we cannot decode an instruction, (2) we are at
-     the end of the property tables, (3) we hit a non-contiguous property
-     table entry, (4) we hit a NO_TRANSFORM region.  */
-
-  while (1)
-    {
-      bfd_vma entry_end;
-      bfd_size_type insn_block_len;
-
-      entry_end = the_entry->address - ebb->sec->vma + the_entry->size;
-      insn_block_len =
-       insn_block_decodable_len (ebb->contents, ebb->content_length,
-                                 ebb->end_offset,
-                                 entry_end - ebb->end_offset);
-      if (insn_block_len != (entry_end - ebb->end_offset))
-       {
-         (*_bfd_error_handler)
-           (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"),
-            ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
-         return FALSE;
-       }
-      ebb->end_offset += insn_block_len;
-
-      if (ebb->end_offset == ebb->sec->size)
-       ebb->ends_section = TRUE;
-
-      /* Update the reloc counter.  */
-      while (ebb->end_reloc_idx + 1 < ebb->reloc_count
-            && (ebb->relocs[ebb->end_reloc_idx + 1].r_offset
-                < ebb->end_offset))
-       {
-         ebb->end_reloc_idx++;
-       }
-
-      if (ebb->end_ptbl_idx + 1 == ebb->pte_count)
-       return TRUE;
-
-      new_entry = &ebb->ptbl[ebb->end_ptbl_idx + 1];
-      if (((new_entry->flags & XTENSA_PROP_INSN) == 0)
-         || ((new_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) != 0)
-         || ((the_entry->flags & XTENSA_PROP_ALIGN) != 0))
-       break;
-
-      if (the_entry->address + the_entry->size != new_entry->address)
-       break;
-
-      the_entry = new_entry;
-      ebb->end_ptbl_idx++;
-    }
-
-  /* Quick check for an unreachable or end of file just at the end.  */
-  if (ebb->end_ptbl_idx + 1 == ebb->pte_count)
-    {
-      if (ebb->end_offset == ebb->content_length)
-       ebb->ends_section = TRUE;
-    }
-  else
-    {
-      new_entry = &ebb->ptbl[ebb->end_ptbl_idx + 1];
-      if ((new_entry->flags & XTENSA_PROP_UNREACHABLE) != 0
-         && the_entry->address + the_entry->size == new_entry->address)
-       ebb->ends_unreachable = new_entry;
-    }
-
-  /* Any other ending requires exact alignment.  */
-  return TRUE;
-}
-
-
-static bfd_boolean
-extend_ebb_bounds_backward (ebb_t *ebb)
-{
-  property_table_entry *the_entry, *new_entry;
-
-  the_entry = &ebb->ptbl[ebb->start_ptbl_idx];
-
-  /* Stop when (1) we cannot decode the instructions in the current entry.
-     (2) we are at the beginning of the property tables, (3) we hit a
-     non-contiguous property table entry, (4) we hit a NO_TRANSFORM region.  */
-
-  while (1)
-    {
-      bfd_vma block_begin;
-      bfd_size_type insn_block_len;
-
-      block_begin = the_entry->address - ebb->sec->vma;
-      insn_block_len =
-       insn_block_decodable_len (ebb->contents, ebb->content_length,
-                                 block_begin,
-                                 ebb->start_offset - block_begin);
-      if (insn_block_len != ebb->start_offset - block_begin)
-       {
-         (*_bfd_error_handler)
-           (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"),
-            ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
-         return FALSE;
-       }
-      ebb->start_offset -= insn_block_len;
-
-      /* Update the reloc counter.  */
-      while (ebb->start_reloc_idx > 0
-            && (ebb->relocs[ebb->start_reloc_idx - 1].r_offset
-                >= ebb->start_offset))
-       {
-         ebb->start_reloc_idx--;
-       }
-
-      if (ebb->start_ptbl_idx == 0)
-       return TRUE;
-
-      new_entry = &ebb->ptbl[ebb->start_ptbl_idx - 1];
-      if ((new_entry->flags & XTENSA_PROP_INSN) == 0
-         || ((new_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) != 0)
-         || ((new_entry->flags & XTENSA_PROP_ALIGN) != 0))
-       return TRUE;
-      if (new_entry->address + new_entry->size != the_entry->address)
-       return TRUE;
-
-      the_entry = new_entry;
-      ebb->start_ptbl_idx--;
-    }
-  return TRUE;
-}
-
-
-static bfd_size_type
-insn_block_decodable_len (bfd_byte *contents,
-                         bfd_size_type content_len,
-                         bfd_vma block_offset,
-                         bfd_size_type block_len)
-{
-  bfd_vma offset = block_offset;
-
-  while (offset < block_offset + block_len)
-    {
-      bfd_size_type insn_len = 0;
-
-      insn_len = insn_decode_len (contents, content_len, offset);
-      if (insn_len == 0)
-       return (offset - block_offset);
-      offset += insn_len;
-    }
-  return (offset - block_offset);
-}
-
-
-static void
-ebb_propose_action (ebb_constraint *c,
-                   bfd_vma alignment_pow,
-                   enum ebb_target_enum align_type,
-                   text_action_t action,
-                   bfd_vma offset,
-                   int removed_bytes,
-                   bfd_boolean do_action)
-{
-  proposed_action *act;
-
-  if (c->action_allocated <= c->action_count)
-    {
-      unsigned new_allocated, i;
-
-      new_allocated = (c->action_count + 2) * 2;
-      proposed_action *new_actions = (proposed_action *)
-       bfd_zmalloc (sizeof (proposed_action) * new_allocated);
-
-      for (i = 0; i < c->action_count; i++)
-       new_actions[i] = c->actions[i];
-      if (c->actions)
-       free (c->actions);
-      c->actions = new_actions;
-      c->action_allocated = new_allocated;
-    }
-
-  act = &c->actions[c->action_count];
-  act->align_type = align_type;
-  act->alignment_pow = alignment_pow;
-  act->action = action;
-  act->offset = offset;
-  act->removed_bytes = removed_bytes;
-  act->do_action = do_action;
-
-  c->action_count++;
-}
-
-\f
-/* Access to internal relocations, section contents and symbols.  */
-
-/* During relaxation, we need to modify relocations, section contents,
-   and symbol definitions, and we need to keep the original values from
-   being reloaded from the input files, i.e., we need to "pin" the
-   modified values in memory.  We also want to continue to observe the
-   setting of the "keep-memory" flag.  The following functions wrap the
-   standard BFD functions to take care of this for us.  */
-
-static Elf_Internal_Rela *
-retrieve_internal_relocs (bfd *abfd, asection *sec, bfd_boolean keep_memory)
-{
-  Elf_Internal_Rela *internal_relocs;
-
-  if ((sec->flags & SEC_LINKER_CREATED) != 0)
-    return NULL;
-
-  internal_relocs = elf_section_data (sec)->relocs;
-  if (internal_relocs == NULL)
-    internal_relocs = (_bfd_elf_link_read_relocs
-                      (abfd, sec, NULL, NULL, keep_memory));
-  return internal_relocs;
-}
-
-
-static void
-pin_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs)
-{
-  elf_section_data (sec)->relocs = internal_relocs;
-}
-
-
-static void
-release_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs)
-{
-  if (internal_relocs
-      && elf_section_data (sec)->relocs != internal_relocs)
-    free (internal_relocs);
-}
-
-
-static bfd_byte *
-retrieve_contents (bfd *abfd, asection *sec, bfd_boolean keep_memory)
-{
-  bfd_byte *contents;
-  bfd_size_type sec_size;
-
-  sec_size = bfd_get_section_limit (abfd, sec);
-  contents = elf_section_data (sec)->this_hdr.contents;
-  
-  if (contents == NULL && sec_size != 0)
-    {
-      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
-       {
-         if (contents)
-           free (contents);
-         return NULL;
-       }
-      if (keep_memory) 
-       elf_section_data (sec)->this_hdr.contents = contents;
-    }
-  return contents;
-}
-
-
-static void
-pin_contents (asection *sec, bfd_byte *contents)
-{
-  elf_section_data (sec)->this_hdr.contents = contents;
-}
-
-
-static void
-release_contents (asection *sec, bfd_byte *contents)
-{
-  if (contents && elf_section_data (sec)->this_hdr.contents != contents)
-    free (contents);
-}
-
-
-static Elf_Internal_Sym *
-retrieve_local_syms (bfd *input_bfd)
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Sym *isymbuf;
-  size_t locsymcount;
-
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
-  locsymcount = symtab_hdr->sh_info;
-
-  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
-  if (isymbuf == NULL && locsymcount != 0)
-    isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0,
-                                   NULL, NULL, NULL);
-
-  /* Save the symbols for this input file so they won't be read again.  */
-  if (isymbuf && isymbuf != (Elf_Internal_Sym *) symtab_hdr->contents)
-    symtab_hdr->contents = (unsigned char *) isymbuf;
-
-  return isymbuf;
-}
-
-\f
-/* Code for link-time relaxation.  */
-
-/* Initialization for relaxation: */
-static bfd_boolean analyze_relocations (struct bfd_link_info *);
-static bfd_boolean find_relaxable_sections
-  (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
-static bfd_boolean collect_source_relocs
-  (bfd *, asection *, struct bfd_link_info *);
-static bfd_boolean is_resolvable_asm_expansion
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, struct bfd_link_info *,
-   bfd_boolean *);
-static Elf_Internal_Rela *find_associated_l32r_irel
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Rela *);
-static bfd_boolean compute_text_actions
-  (bfd *, asection *, struct bfd_link_info *);
-static bfd_boolean compute_ebb_proposed_actions (ebb_constraint *);
-static bfd_boolean compute_ebb_actions (ebb_constraint *);
-static bfd_boolean check_section_ebb_pcrels_fit
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *);
-static bfd_boolean check_section_ebb_reduces (const ebb_constraint *);
-static void text_action_add_proposed
-  (text_action_list *, const ebb_constraint *, asection *);
-static int compute_fill_extra_space (property_table_entry *);
-
-/* First pass: */
-static bfd_boolean compute_removed_literals
-  (bfd *, asection *, struct bfd_link_info *, value_map_hash_table *);
-static Elf_Internal_Rela *get_irel_at_offset
-  (asection *, Elf_Internal_Rela *, bfd_vma);
-static bfd_boolean is_removable_literal 
-  (const source_reloc *, int, const source_reloc *, int);
-static bfd_boolean remove_dead_literal
-  (bfd *, asection *, struct bfd_link_info *, Elf_Internal_Rela *,
-   Elf_Internal_Rela *, source_reloc *, property_table_entry *, int); 
-static bfd_boolean identify_literal_placement
-  (bfd *, asection *, bfd_byte *, struct bfd_link_info *,
-   value_map_hash_table *, bfd_boolean *, Elf_Internal_Rela *, int,
-   source_reloc *, property_table_entry *, int, section_cache_t *,
-   bfd_boolean);
-static bfd_boolean relocations_reach (source_reloc *, int, const r_reloc *);
-static bfd_boolean coalesce_shared_literal
-  (asection *, source_reloc *, property_table_entry *, int, value_map *);
-static bfd_boolean move_shared_literal
-  (asection *, struct bfd_link_info *, source_reloc *, property_table_entry *,
-   int, const r_reloc *, const literal_value *, section_cache_t *);
-
-/* Second pass: */
-static bfd_boolean relax_section (bfd *, asection *, struct bfd_link_info *);
-static bfd_boolean translate_section_fixes (asection *);
-static bfd_boolean translate_reloc_bfd_fix (reloc_bfd_fix *);
-static void translate_reloc (const r_reloc *, r_reloc *);
-static void shrink_dynamic_reloc_sections
-  (struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *);
-static bfd_boolean move_literal
-  (bfd *, struct bfd_link_info *, asection *, bfd_vma, bfd_byte *,
-   xtensa_relax_info *, Elf_Internal_Rela **, const literal_value *);
-static bfd_boolean relax_property_section
-  (bfd *, asection *, struct bfd_link_info *);
-
-/* Third pass: */
-static bfd_boolean relax_section_symbols (bfd *, asection *);
-
-
-static bfd_boolean 
-elf_xtensa_relax_section (bfd *abfd,
-                         asection *sec,
-                         struct bfd_link_info *link_info,
-                         bfd_boolean *again)
-{
-  static value_map_hash_table *values = NULL;
-  static bfd_boolean relocations_analyzed = FALSE;
-  xtensa_relax_info *relax_info;
-
-  if (!relocations_analyzed)
-    {
-      /* Do some overall initialization for relaxation.  */
-      values = value_map_hash_table_init ();
-      if (values == NULL)
-       return FALSE;
-      relaxing_section = TRUE;
-      if (!analyze_relocations (link_info))
-       return FALSE;
-      relocations_analyzed = TRUE;
-    }
-  *again = FALSE;
-
-  /* Don't mess with linker-created sections.  */
-  if ((sec->flags & SEC_LINKER_CREATED) != 0)
-    return TRUE;
-
-  relax_info = get_xtensa_relax_info (sec);
-  BFD_ASSERT (relax_info != NULL);
-
-  switch (relax_info->visited)
-    {
-    case 0:
-      /* Note: It would be nice to fold this pass into
-        analyze_relocations, but it is important for this step that the
-        sections be examined in link order.  */
-      if (!compute_removed_literals (abfd, sec, link_info, values))
-       return FALSE;
-      *again = TRUE;
-      break;
-
-    case 1:
-      if (values)
-       value_map_hash_table_delete (values);
-      values = NULL;
-      if (!relax_section (abfd, sec, link_info))
-       return FALSE;
-      *again = TRUE;
-      break;
-
-    case 2:
-      if (!relax_section_symbols (abfd, sec))
-       return FALSE;
-      break;
-    }
-
-  relax_info->visited++;
-  return TRUE;
-}
-
-\f
-/* Initialization for relaxation.  */
-
-/* This function is called once at the start of relaxation.  It scans
-   all the input sections and marks the ones that are relaxable (i.e.,
-   literal sections with L32R relocations against them), and then
-   collects source_reloc information for all the relocations against
-   those relaxable sections.  During this process, it also detects
-   longcalls, i.e., calls relaxed by the assembler into indirect
-   calls, that can be optimized back into direct calls.  Within each
-   extended basic block (ebb) containing an optimized longcall, it
-   computes a set of "text actions" that can be performed to remove
-   the L32R associated with the longcall while optionally preserving
-   branch target alignments.  */
-
-static bfd_boolean
-analyze_relocations (struct bfd_link_info *link_info)
-{
-  bfd *abfd;
-  asection *sec;
-  bfd_boolean is_relaxable = FALSE;
-
-  /* Initialize the per-section relaxation info.  */
-  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    for (sec = abfd->sections; sec != NULL; sec = sec->next)
-      {
-       init_xtensa_relax_info (sec);
-      }
-
-  /* Mark relaxable sections (and count relocations against each one).  */
-  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    for (sec = abfd->sections; sec != NULL; sec = sec->next)
-      {
-       if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable))
-         return FALSE;
-      }
-
-  /* Bail out if there are no relaxable sections.  */
-  if (!is_relaxable)
-    return TRUE;
-
-  /* Allocate space for source_relocs.  */
-  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    for (sec = abfd->sections; sec != NULL; sec = sec->next)
-      {
-       xtensa_relax_info *relax_info;
-
-       relax_info = get_xtensa_relax_info (sec);
-       if (relax_info->is_relaxable_literal_section
-           || relax_info->is_relaxable_asm_section)
-         {
-           relax_info->src_relocs = (source_reloc *)
-             bfd_malloc (relax_info->src_count * sizeof (source_reloc));
-         }
-      }
-
-  /* Collect info on relocations against each relaxable section.  */
-  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    for (sec = abfd->sections; sec != NULL; sec = sec->next)
-      {
-       if (!collect_source_relocs (abfd, sec, link_info))
-         return FALSE;
-      }
-
-  /* Compute the text actions.  */
-  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    for (sec = abfd->sections; sec != NULL; sec = sec->next)
-      {
-       if (!compute_text_actions (abfd, sec, link_info))
-         return FALSE;
-      }
-
-  return TRUE;
-}
-
-
-/* Find all the sections that might be relaxed.  The motivation for
-   this pass is that collect_source_relocs() needs to record _all_ the
-   relocations that target each relaxable section.  That is expensive
-   and unnecessary unless the target section is actually going to be
-   relaxed.  This pass identifies all such sections by checking if
-   they have L32Rs pointing to them.  In the process, the total number
-   of relocations targeting each section is also counted so that we
-   know how much space to allocate for source_relocs against each
-   relaxable literal section.  */
-
-static bfd_boolean
-find_relaxable_sections (bfd *abfd,
-                        asection *sec,
-                        struct bfd_link_info *link_info,
-                        bfd_boolean *is_relaxable_p)
-{
-  Elf_Internal_Rela *internal_relocs;
-  bfd_byte *contents;
-  bfd_boolean ok = TRUE;
-  unsigned i;
-  xtensa_relax_info *source_relax_info;
-
-  internal_relocs = retrieve_internal_relocs (abfd, sec,
-                                             link_info->keep_memory);
-  if (internal_relocs == NULL) 
-    return ok;
-
-  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->size != 0)
-    {
-      ok = FALSE;
-      goto error_return;
-    }
-
-  source_relax_info = get_xtensa_relax_info (sec);
-  for (i = 0; i < sec->reloc_count; i++) 
-    {
-      Elf_Internal_Rela *irel = &internal_relocs[i];
-      r_reloc r_rel;
-      asection *target_sec;
-      xtensa_relax_info *target_relax_info;
-
-      /* If this section has not already been marked as "relaxable", and
-        if it contains any ASM_EXPAND relocations (marking expanded
-        longcalls) that can be optimized into direct calls, then mark
-        the section as "relaxable".  */
-      if (source_relax_info
-         && !source_relax_info->is_relaxable_asm_section
-         && ELF32_R_TYPE (irel->r_info) == R_XTENSA_ASM_EXPAND)
-       {
-         bfd_boolean is_reachable = FALSE;
-         if (is_resolvable_asm_expansion (abfd, sec, contents, irel,
-                                          link_info, &is_reachable)
-             && is_reachable)
-           {
-             source_relax_info->is_relaxable_asm_section = TRUE;
-             *is_relaxable_p = TRUE;
-           }
-       }
-
-      r_reloc_init (&r_rel, abfd, irel, contents,
-                   bfd_get_section_limit (abfd, sec));
-
-      target_sec = r_reloc_get_section (&r_rel);
-      target_relax_info = get_xtensa_relax_info (target_sec);
-      if (!target_relax_info)
-       continue;
-
-      /* Count PC-relative operand relocations against the target section.
-         Note: The conditions tested here must match the conditions under
-        which init_source_reloc is called in collect_source_relocs().  */
-      if (is_operand_relocation (ELF32_R_TYPE (irel->r_info))
-         && (!is_alt_relocation (ELF32_R_TYPE (irel->r_info))
-             || is_l32r_relocation (abfd, sec, contents, irel)))
-       target_relax_info->src_count++;
-
-      if (is_l32r_relocation (abfd, sec, contents, irel)
-         && r_reloc_is_defined (&r_rel))
-       {
-         /* Mark the target section as relaxable.  */
-         target_relax_info->is_relaxable_literal_section = TRUE;
-         *is_relaxable_p = TRUE;
-       }
-    }
-
- error_return:
-  release_contents (sec, contents);
-  release_internal_relocs (sec, internal_relocs);
-  return ok;
-}
-
-
-/* Record _all_ the relocations that point to relaxable sections, and
-   get rid of ASM_EXPAND relocs by either converting them to
-   ASM_SIMPLIFY or by removing them.  */
-
-static bfd_boolean
-collect_source_relocs (bfd *abfd,
-                      asection *sec,
-                      struct bfd_link_info *link_info)
-{
-  Elf_Internal_Rela *internal_relocs;
-  bfd_byte *contents;
-  bfd_boolean ok = TRUE;
-  unsigned i;
-  bfd_size_type sec_size;
-
-  internal_relocs = retrieve_internal_relocs (abfd, sec, 
-                                             link_info->keep_memory);
-  if (internal_relocs == NULL) 
-    return ok;
-
-  sec_size = bfd_get_section_limit (abfd, sec);
-  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
-    {
-      ok = FALSE;
-      goto error_return;
-    }
-
-  /* Record relocations against relaxable literal sections.  */
-  for (i = 0; i < sec->reloc_count; i++) 
-    {
-      Elf_Internal_Rela *irel = &internal_relocs[i];
-      r_reloc r_rel;
-      asection *target_sec;
-      xtensa_relax_info *target_relax_info;
-
-      r_reloc_init (&r_rel, abfd, irel, contents, sec_size);
-
-      target_sec = r_reloc_get_section (&r_rel);
-      target_relax_info = get_xtensa_relax_info (target_sec);
-
-      if (target_relax_info
-         && (target_relax_info->is_relaxable_literal_section
-             || target_relax_info->is_relaxable_asm_section))
-       {
-         xtensa_opcode opcode = XTENSA_UNDEFINED;
-         int opnd = -1;
-         bfd_boolean is_abs_literal = FALSE;
-
-         if (is_alt_relocation (ELF32_R_TYPE (irel->r_info)))
-           {
-             /* None of the current alternate relocs are PC-relative,
-                and only PC-relative relocs matter here.  However, we
-                still need to record the opcode for literal
-                coalescing.  */
-             opcode = get_relocation_opcode (abfd, sec, contents, irel);
-             if (opcode == get_l32r_opcode ())
-               {
-                 is_abs_literal = TRUE;
-                 opnd = 1;
-               }
-             else
-               opcode = XTENSA_UNDEFINED;
-           }
-         else if (is_operand_relocation (ELF32_R_TYPE (irel->r_info)))
-           {
-             opcode = get_relocation_opcode (abfd, sec, contents, irel);
-             opnd = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
-           }
-
-         if (opcode != XTENSA_UNDEFINED)
-           {
-             int src_next = target_relax_info->src_next++;
-             source_reloc *s_reloc = &target_relax_info->src_relocs[src_next];
-
-             init_source_reloc (s_reloc, sec, &r_rel, opcode, opnd,
-                                is_abs_literal);
-           }
-       }
-    }
-
-  /* Now get rid of ASM_EXPAND relocations.  At this point, the
-     src_relocs array for the target literal section may still be
-     incomplete, but it must at least contain the entries for the L32R
-     relocations associated with ASM_EXPANDs because they were just
-     added in the preceding loop over the relocations.  */
-
-  for (i = 0; i < sec->reloc_count; i++) 
-    {
-      Elf_Internal_Rela *irel = &internal_relocs[i];
-      bfd_boolean is_reachable;
-
-      if (!is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info,
-                                       &is_reachable))
-       continue;
-
-      if (is_reachable)
-       {
-         Elf_Internal_Rela *l32r_irel;
-         r_reloc r_rel;
-         asection *target_sec;
-         xtensa_relax_info *target_relax_info;
-
-         /* Mark the source_reloc for the L32R so that it will be
-            removed in compute_removed_literals(), along with the
-            associated literal.  */
-         l32r_irel = find_associated_l32r_irel (abfd, sec, contents,
-                                                irel, internal_relocs);
-         if (l32r_irel == NULL)
-           continue;
-
-         r_reloc_init (&r_rel, abfd, l32r_irel, contents, sec_size);
-
-         target_sec = r_reloc_get_section (&r_rel);
-         target_relax_info = get_xtensa_relax_info (target_sec);
-
-         if (target_relax_info
-             && (target_relax_info->is_relaxable_literal_section
-                 || target_relax_info->is_relaxable_asm_section))
-           {
-             source_reloc *s_reloc;
-
-             /* Search the source_relocs for the entry corresponding to
-                the l32r_irel.  Note: The src_relocs array is not yet
-                sorted, but it wouldn't matter anyway because we're
-                searching by source offset instead of target offset.  */
-             s_reloc = find_source_reloc (target_relax_info->src_relocs, 
-                                          target_relax_info->src_next,
-                                          sec, l32r_irel);
-             BFD_ASSERT (s_reloc);
-             s_reloc->is_null = TRUE;
-           }
-
-         /* Convert this reloc to ASM_SIMPLIFY.  */
-         irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
-                                      R_XTENSA_ASM_SIMPLIFY);
-         l32r_irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
-
-         pin_internal_relocs (sec, internal_relocs);
-       }
-      else
-       {
-         /* It is resolvable but doesn't reach.  We resolve now
-            by eliminating the relocation -- the call will remain
-            expanded into L32R/CALLX.  */
-         irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
-         pin_internal_relocs (sec, internal_relocs);
-       }
-    }
-
- error_return:
-  release_contents (sec, contents);
-  release_internal_relocs (sec, internal_relocs);
-  return ok;
-}
-
-
-/* Return TRUE if the asm expansion can be resolved.  Generally it can
-   be resolved on a final link or when a partial link locates it in the
-   same section as the target.  Set "is_reachable" flag if the target of
-   the call is within the range of a direct call, given the current VMA
-   for this section and the target section.  */
-
-bfd_boolean
-is_resolvable_asm_expansion (bfd *abfd,
-                            asection *sec,
-                            bfd_byte *contents,
-                            Elf_Internal_Rela *irel,
-                            struct bfd_link_info *link_info,
-                            bfd_boolean *is_reachable_p)
-{
-  asection *target_sec;
-  bfd_vma target_offset;
-  r_reloc r_rel;
-  xtensa_opcode opcode, direct_call_opcode;
-  bfd_vma self_address;
-  bfd_vma dest_address;
-  bfd_boolean uses_l32r;
-  bfd_size_type sec_size;
-
-  *is_reachable_p = FALSE;
-
-  if (contents == NULL)
-    return FALSE;
-
-  if (ELF32_R_TYPE (irel->r_info) != R_XTENSA_ASM_EXPAND) 
-    return FALSE;
-
-  sec_size = bfd_get_section_limit (abfd, sec);
-  opcode = get_expanded_call_opcode (contents + irel->r_offset,
-                                    sec_size - irel->r_offset, &uses_l32r);
-  /* Optimization of longcalls that use CONST16 is not yet implemented.  */
-  if (!uses_l32r)
-    return FALSE;
-  
-  direct_call_opcode = swap_callx_for_call_opcode (opcode);
-  if (direct_call_opcode == XTENSA_UNDEFINED)
-    return FALSE;
-
-  /* Check and see that the target resolves.  */
-  r_reloc_init (&r_rel, abfd, irel, contents, sec_size);
-  if (!r_reloc_is_defined (&r_rel))
-    return FALSE;
-
-  target_sec = r_reloc_get_section (&r_rel);
-  target_offset = r_rel.target_offset;
-
-  /* If the target is in a shared library, then it doesn't reach.  This
-     isn't supposed to come up because the compiler should never generate
-     non-PIC calls on systems that use shared libraries, but the linker
-     shouldn't crash regardless.  */
-  if (!target_sec->output_section)
-    return FALSE;
-      
-  /* For relocatable sections, we can only simplify when the output
-     section of the target is the same as the output section of the
-     source.  */
-  if (link_info->relocatable
-      && (target_sec->output_section != sec->output_section
-         || is_reloc_sym_weak (abfd, irel)))
-    return FALSE;
-
-  self_address = (sec->output_section->vma
-                 + sec->output_offset + irel->r_offset + 3);
-  dest_address = (target_sec->output_section->vma
-                 + target_sec->output_offset + target_offset);
-      
-  *is_reachable_p = pcrel_reloc_fits (direct_call_opcode, 0,
-                                     self_address, dest_address);
-
-  if ((self_address >> CALL_SEGMENT_BITS) !=
-      (dest_address >> CALL_SEGMENT_BITS))
-    return FALSE;
-
-  return TRUE;
-}
-
-
-static Elf_Internal_Rela *
-find_associated_l32r_irel (bfd *abfd,
-                          asection *sec,
-                          bfd_byte *contents,
-                          Elf_Internal_Rela *other_irel,
-                          Elf_Internal_Rela *internal_relocs)
-{
-  unsigned i;
-
-  for (i = 0; i < sec->reloc_count; i++) 
-    {
-      Elf_Internal_Rela *irel = &internal_relocs[i];
-
-      if (irel == other_irel)
-       continue;
-      if (irel->r_offset != other_irel->r_offset)
-       continue;
-      if (is_l32r_relocation (abfd, sec, contents, irel))
-       return irel;
-    }
-
-  return NULL;
-}
-
-
-/* The compute_text_actions function will build a list of potential
-   transformation actions for code in the extended basic block of each
-   longcall that is optimized to a direct call.  From this list we
-   generate a set of actions to actually perform that optimizes for
-   space and, if not using size_opt, maintains branch target
-   alignments.
-
-   These actions to be performed are placed on a per-section list.
-   The actual changes are performed by relax_section() in the second
-   pass.  */
-
-bfd_boolean
-compute_text_actions (bfd *abfd,
-                     asection *sec,
-                     struct bfd_link_info *link_info)
-{
-  xtensa_relax_info *relax_info;
-  bfd_byte *contents;
-  Elf_Internal_Rela *internal_relocs;
-  bfd_boolean ok = TRUE;
-  unsigned i;
-  property_table_entry *prop_table = 0;
-  int ptblsize = 0;
-  bfd_size_type sec_size;
-  static bfd_boolean no_insn_move = FALSE;
-
-  if (no_insn_move)
-    return ok;
-
-  /* Do nothing if the section contains no optimized longcalls.  */
-  relax_info = get_xtensa_relax_info (sec);
-  BFD_ASSERT (relax_info);
-  if (!relax_info->is_relaxable_asm_section)
-    return ok;
-
-  internal_relocs = retrieve_internal_relocs (abfd, sec,
-                                             link_info->keep_memory);
-
-  if (internal_relocs)
-    qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
-          internal_reloc_compare);
-
-  sec_size = bfd_get_section_limit (abfd, sec);
-  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
-    {
-      ok = FALSE;
-      goto error_return;
-    }
-
-  ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
-                                       XTENSA_PROP_SEC_NAME, FALSE);
-  if (ptblsize < 0)
-    {
-      ok = FALSE;
-      goto error_return;
-    }
-
-  for (i = 0; i < sec->reloc_count; i++)
-    {
-      Elf_Internal_Rela *irel = &internal_relocs[i];
-      bfd_vma r_offset;
-      property_table_entry *the_entry;
-      int ptbl_idx;
-      ebb_t *ebb;
-      ebb_constraint ebb_table;
-      bfd_size_type simplify_size;
-
-      if (irel && ELF32_R_TYPE (irel->r_info) != R_XTENSA_ASM_SIMPLIFY)
-       continue;
-      r_offset = irel->r_offset;
-
-      simplify_size = get_asm_simplify_size (contents, sec_size, r_offset);
-      if (simplify_size == 0)
-       {
-         (*_bfd_error_handler)
-           (_("%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"),
-            sec->owner, sec, r_offset);
-         continue;
-       }
-
-      /* If the instruction table is not around, then don't do this
-        relaxation.  */
-      the_entry = elf_xtensa_find_property_entry (prop_table, ptblsize,
-                                                 sec->vma + irel->r_offset);
-      if (the_entry == NULL || XTENSA_NO_NOP_REMOVAL)
-       {
-         text_action_add (&relax_info->action_list,
-                          ta_convert_longcall, sec, r_offset,
-                          0);
-         continue;
-       }
-
-      /* If the next longcall happens to be at the same address as an
-        unreachable section of size 0, then skip forward.  */
-      ptbl_idx = the_entry - prop_table;
-      while ((the_entry->flags & XTENSA_PROP_UNREACHABLE)
-            && the_entry->size == 0
-            && ptbl_idx + 1 < ptblsize
-            && (prop_table[ptbl_idx + 1].address
-                == prop_table[ptbl_idx].address))
-       {
-         ptbl_idx++;
-         the_entry++;
-       }
-
-      if (the_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM)
-         /* NO_REORDER is OK */
-       continue;
-
-      init_ebb_constraint (&ebb_table);
-      ebb = &ebb_table.ebb;
-      init_ebb (ebb, sec, contents, sec_size, prop_table, ptblsize,
-               internal_relocs, sec->reloc_count);
-      ebb->start_offset = r_offset + simplify_size;
-      ebb->end_offset = r_offset + simplify_size;
-      ebb->start_ptbl_idx = ptbl_idx;
-      ebb->end_ptbl_idx = ptbl_idx;
-      ebb->start_reloc_idx = i;
-      ebb->end_reloc_idx = i;
-
-      if (!extend_ebb_bounds (ebb)
-         || !compute_ebb_proposed_actions (&ebb_table)
-         || !compute_ebb_actions (&ebb_table)
-         || !check_section_ebb_pcrels_fit (abfd, sec, contents,
-                                           internal_relocs, &ebb_table)
-         || !check_section_ebb_reduces (&ebb_table))
-       {
-         /* If anything goes wrong or we get unlucky and something does
-            not fit, with our plan because of expansion between
-            critical branches, just convert to a NOP.  */
-
-         text_action_add (&relax_info->action_list,
-                          ta_convert_longcall, sec, r_offset, 0);
-         i = ebb_table.ebb.end_reloc_idx;
-         free_ebb_constraint (&ebb_table);
-         continue;
-       }
-
-      text_action_add_proposed (&relax_info->action_list, &ebb_table, sec);
-
-      /* Update the index so we do not go looking at the relocations
-        we have already processed.  */
-      i = ebb_table.ebb.end_reloc_idx;
-      free_ebb_constraint (&ebb_table);
-    }
-
-#if DEBUG
-  if (relax_info->action_list.head)
-    print_action_list (stderr, &relax_info->action_list);
-#endif
-
-error_return:
-  release_contents (sec, contents);
-  release_internal_relocs (sec, internal_relocs);
-  if (prop_table)
-    free (prop_table);
-
-  return ok;
-}
-
-
-/* Find all of the possible actions for an extended basic block.  */
-
-bfd_boolean
-compute_ebb_proposed_actions (ebb_constraint *ebb_table)
-{
-  const ebb_t *ebb = &ebb_table->ebb;
-  unsigned rel_idx = ebb->start_reloc_idx;
-  property_table_entry *entry, *start_entry, *end_entry;
-
-  start_entry = &ebb->ptbl[ebb->start_ptbl_idx];
-  end_entry = &ebb->ptbl[ebb->end_ptbl_idx];
-
-  for (entry = start_entry; entry <= end_entry; entry++)
-    {
-      bfd_vma offset, start_offset, end_offset;
-      bfd_size_type insn_len;
-
-      start_offset = entry->address - ebb->sec->vma;
-      end_offset = entry->address + entry->size - ebb->sec->vma;
-
-      if (entry == start_entry)
-       start_offset = ebb->start_offset;
-      if (entry == end_entry)
-       end_offset = ebb->end_offset;
-      offset = start_offset;
-
-      if (offset == entry->address - ebb->sec->vma
-         && (entry->flags & XTENSA_PROP_INSN_BRANCH_TARGET) != 0)
-       {
-         enum ebb_target_enum align_type = EBB_DESIRE_TGT_ALIGN;
-         BFD_ASSERT (offset != end_offset);
-         if (offset == end_offset)
-           return FALSE;
-
-         insn_len = insn_decode_len (ebb->contents, ebb->content_length,
-                                     offset);
-
-         /* Propose no actions for a section with an undecodable offset.  */
-         if (insn_len == 0) 
-           {
-             (*_bfd_error_handler)
-               (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"),
-                ebb->sec->owner, ebb->sec, offset);
-             return FALSE;
-           }
-         if (check_branch_target_aligned_address (offset, insn_len))
-           align_type = EBB_REQUIRE_TGT_ALIGN;
-
-         ebb_propose_action (ebb_table, align_type, 0,
-                             ta_none, offset, 0, TRUE);
-       }
-
-      while (offset != end_offset)
-       {
-         Elf_Internal_Rela *irel;
-         xtensa_opcode opcode;
-
-         while (rel_idx < ebb->end_reloc_idx
-                && (ebb->relocs[rel_idx].r_offset < offset
-                    || (ebb->relocs[rel_idx].r_offset == offset
-                        && (ELF32_R_TYPE (ebb->relocs[rel_idx].r_info)
-                            != R_XTENSA_ASM_SIMPLIFY))))
-           rel_idx++;
-
-         /* Check for longcall.  */
-         irel = &ebb->relocs[rel_idx];
-         if (irel->r_offset == offset
-             && ELF32_R_TYPE (irel->r_info) == R_XTENSA_ASM_SIMPLIFY)
-           {
-             bfd_size_type simplify_size;
-
-             simplify_size = get_asm_simplify_size (ebb->contents, 
-                                                    ebb->content_length,
-                                                    irel->r_offset);
-             if (simplify_size == 0)
-               {
-                 (*_bfd_error_handler)
-                   (_("%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"),
-                    ebb->sec->owner, ebb->sec, offset);
-                 return FALSE;
-               }
-
-             ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0,
-                                 ta_convert_longcall, offset, 0, TRUE);
-             
-             offset += simplify_size;
-             continue;
-           }
-
-         insn_len = insn_decode_len (ebb->contents, ebb->content_length,
-                                     offset);
-         /* If the instruction is undecodable, then report an error.  */
-         if (insn_len == 0)
-           {
-             (*_bfd_error_handler)
-               (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"),
-                ebb->sec->owner, ebb->sec, offset);
-             return FALSE;
-           }
-           
-         if ((entry->flags & XTENSA_PROP_INSN_NO_DENSITY) == 0
-             && (entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) == 0
-             && narrow_instruction (ebb->contents, ebb->content_length,
-                                    offset, FALSE))
-           {
-             /* Add an instruction narrow action.  */
-             ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0,
-                                 ta_narrow_insn, offset, 0, FALSE);
-             offset += insn_len;
-             continue;
-           }
-         if ((entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) == 0
-             && widen_instruction (ebb->contents, ebb->content_length,
-                                   offset, FALSE))
-           {
-             /* Add an instruction widen action.  */
-             ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0,
-                                 ta_widen_insn, offset, 0, FALSE);
-             offset += insn_len;
-             continue;
-           }
-         opcode = insn_decode_opcode (ebb->contents, ebb->content_length,
-                                      offset, 0);
-         if (xtensa_opcode_is_loop (xtensa_default_isa, opcode))
-           {
-             /* Check for branch targets.  */
-             ebb_propose_action (ebb_table, EBB_REQUIRE_LOOP_ALIGN, 0,
-                                 ta_none, offset, 0, TRUE);
-             offset += insn_len;
-             continue;
-           }
-
-         offset += insn_len;
-       }
-    }
-
-  if (ebb->ends_unreachable)
-    {
-      ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0,
-                         ta_fill, ebb->end_offset, 0, TRUE);
-    }
-
-  return TRUE;
-}
-
-
-/* After all of the information has collected about the
-   transformations possible in an EBB, compute the appropriate actions
-   here in compute_ebb_actions.  We still must check later to make
-   sure that the actions do not break any relocations.  The algorithm
-   used here is pretty greedy.  Basically, it removes as many no-ops
-   as possible so that the end of the EBB has the same alignment
-   characteristics as the original.  First, it uses narrowing, then
-   fill space at the end of the EBB, and finally widenings.  If that
-   does not work, it tries again with one fewer no-op removed.  The
-   optimization will only be performed if all of the branch targets
-   that were aligned before transformation are also aligned after the
-   transformation.
-
-   When the size_opt flag is set, ignore the branch target alignments,
-   narrow all wide instructions, and remove all no-ops unless the end
-   of the EBB prevents it.  */
-
-bfd_boolean
-compute_ebb_actions (ebb_constraint *ebb_table)
-{
-  unsigned i = 0;
-  unsigned j;
-  int removed_bytes = 0;
-  ebb_t *ebb = &ebb_table->ebb;
-  unsigned seg_idx_start = 0;
-  unsigned seg_idx_end = 0;
-
-  /* We perform this like the assembler relaxation algorithm: Start by
-     assuming all instructions are narrow and all no-ops removed; then
-     walk through....  */
-
-  /* For each segment of this that has a solid constraint, check to
-     see if there are any combinations that will keep the constraint.
-     If so, use it.  */
-  for (seg_idx_end = 0; seg_idx_end < ebb_table->action_count; seg_idx_end++)
-    {
-      bfd_boolean requires_text_end_align = FALSE;
-      unsigned longcall_count = 0;
-      unsigned longcall_convert_count = 0;
-      unsigned narrowable_count = 0;
-      unsigned narrowable_convert_count = 0;
-      unsigned widenable_count = 0;
-      unsigned widenable_convert_count = 0;
-
-      proposed_action *action = NULL;
-      int align = (1 << ebb_table->ebb.sec->alignment_power);
-
-      seg_idx_start = seg_idx_end;
-
-      for (i = seg_idx_start; i < ebb_table->action_count; i++)
-       {
-         action = &ebb_table->actions[i];
-         if (action->action == ta_convert_longcall)
-           longcall_count++;
-         if (action->action == ta_narrow_insn)
-           narrowable_count++;
-         if (action->action == ta_widen_insn)
-           widenable_count++;
-         if (action->action == ta_fill)
-           break;
-         if (action->align_type == EBB_REQUIRE_LOOP_ALIGN)
-           break;
-         if (action->align_type == EBB_REQUIRE_TGT_ALIGN
-             && !elf32xtensa_size_opt)
-           break;
-       }
-      seg_idx_end = i;
-
-      if (seg_idx_end == ebb_table->action_count && !ebb->ends_unreachable)
-       requires_text_end_align = TRUE;
-
-      if (elf32xtensa_size_opt && !requires_text_end_align
-         && action->align_type != EBB_REQUIRE_LOOP_ALIGN
-         && action->align_type != EBB_REQUIRE_TGT_ALIGN)
-       {
-         longcall_convert_count = longcall_count;
-         narrowable_convert_count = narrowable_count;
-         widenable_convert_count = 0;
-       }
-      else
-       {
-         /* There is a constraint.  Convert the max number of longcalls.  */
-         narrowable_convert_count = 0;
-         longcall_convert_count = 0;
-         widenable_convert_count = 0;
-
-         for (j = 0; j < longcall_count; j++)
-           {
-             int removed = (longcall_count - j) * 3 & (align - 1);
-             unsigned desire_narrow = (align - removed) & (align - 1);
-             unsigned desire_widen = removed;
-             if (desire_narrow <= narrowable_count)
-               {
-                 narrowable_convert_count = desire_narrow;
-                 narrowable_convert_count +=
-                   (align * ((narrowable_count - narrowable_convert_count)
-                             / align));
-                 longcall_convert_count = (longcall_count - j);
-                 widenable_convert_count = 0;
-                 break;
-               }
-             if (desire_widen <= widenable_count && !elf32xtensa_size_opt)
-               {
-                 narrowable_convert_count = 0;
-                 longcall_convert_count = longcall_count - j;
-                 widenable_convert_count = desire_widen;
-                 break;
-               }
-           }
-       }
-
-      /* Now the number of conversions are saved.  Do them.  */
-      for (i = seg_idx_start; i < seg_idx_end; i++)
-       {
-         action = &ebb_table->actions[i];
-         switch (action->action)
-           {
-           case ta_convert_longcall:
-             if (longcall_convert_count != 0)
-               {
-                 action->action = ta_remove_longcall;
-                 action->do_action = TRUE;
-                 action->removed_bytes += 3;
-                 longcall_convert_count--;
-               }
-             break;
-           case ta_narrow_insn:
-             if (narrowable_convert_count != 0)
-               {
-                 action->do_action = TRUE;
-                 action->removed_bytes += 1;
-                 narrowable_convert_count--;
-               }
-             break;
-           case ta_widen_insn:
-             if (widenable_convert_count != 0)
-               {
-                 action->do_action = TRUE;
-                 action->removed_bytes -= 1;
-                 widenable_convert_count--;
-               }
-             break;
-           default:
-             break;
-           }
-       }
-    }
-
-  /* Now we move on to some local opts.  Try to remove each of the
-     remaining longcalls.  */
-
-  if (ebb_table->ebb.ends_section || ebb_table->ebb.ends_unreachable)
-    {
-      removed_bytes = 0;
-      for (i = 0; i < ebb_table->action_count; i++)
-       {
-         int old_removed_bytes = removed_bytes;
-         proposed_action *action = &ebb_table->actions[i];
-
-         if (action->do_action && action->action == ta_convert_longcall)
-           {
-             bfd_boolean bad_alignment = FALSE;
-             removed_bytes += 3;
-             for (j = i + 1; j < ebb_table->action_count; j++)
-               {
-                 proposed_action *new_action = &ebb_table->actions[j];
-                 bfd_vma offset = new_action->offset;
-                 if (new_action->align_type == EBB_REQUIRE_TGT_ALIGN)
-                   {
-                     if (!check_branch_target_aligned
-                         (ebb_table->ebb.contents,
-                          ebb_table->ebb.content_length,
-                          offset, offset - removed_bytes))
-                       {
-                         bad_alignment = TRUE;
-                         break;
-                       }
-                   }
-                 if (new_action->align_type == EBB_REQUIRE_LOOP_ALIGN)
-                   {
-                     if (!check_loop_aligned (ebb_table->ebb.contents,
-                                              ebb_table->ebb.content_length,
-                                              offset,
-                                              offset - removed_bytes))
-                       {
-                         bad_alignment = TRUE;
-                         break;
-                       }
-                   }
-                 if (new_action->action == ta_narrow_insn
-                     && !new_action->do_action
-                     && ebb_table->ebb.sec->alignment_power == 2)
-                   {
-                     /* Narrow an instruction and we are done.  */
-                     new_action->do_action = TRUE;
-                     new_action->removed_bytes += 1;
-                     bad_alignment = FALSE;
-                     break;
-                   }
-                 if (new_action->action == ta_widen_insn
-                     && new_action->do_action
-                     && ebb_table->ebb.sec->alignment_power == 2)
-                   {
-                     /* Narrow an instruction and we are done.  */
-                     new_action->do_action = FALSE;
-                     new_action->removed_bytes += 1;
-                     bad_alignment = FALSE;
-                     break;
-                   }
-               }
-             if (!bad_alignment)
-               {
-                 action->removed_bytes += 3;
-                 action->action = ta_remove_longcall;
-                 action->do_action = TRUE;
-               }
-           }
-         removed_bytes = old_removed_bytes;
-         if (action->do_action)
-           removed_bytes += action->removed_bytes;
-       }
-    }
-
-  removed_bytes = 0;
-  for (i = 0; i < ebb_table->action_count; ++i)
-    {
-      proposed_action *action = &ebb_table->actions[i];
-      if (action->do_action)
-       removed_bytes += action->removed_bytes;
-    }
-
-  if ((removed_bytes % (1 << ebb_table->ebb.sec->alignment_power)) != 0
-      && ebb->ends_unreachable)
-    {
-      proposed_action *action;
-      int br;
-      int extra_space;
-
-      BFD_ASSERT (ebb_table->action_count != 0);
-      action = &ebb_table->actions[ebb_table->action_count - 1];
-      BFD_ASSERT (action->action == ta_fill);
-      BFD_ASSERT (ebb->ends_unreachable->flags & XTENSA_PROP_UNREACHABLE);
-
-      extra_space = compute_fill_extra_space (ebb->ends_unreachable);
-      br = action->removed_bytes + removed_bytes + extra_space;
-      br = br & ((1 << ebb->sec->alignment_power ) - 1);
-
-      action->removed_bytes = extra_space - br;
-    }
-  return TRUE;
-}
-
-
-/* Use check_section_ebb_pcrels_fit to make sure that all of the
-   relocations in a section will fit if a proposed set of actions
-   are performed.  */
-
-static bfd_boolean
-check_section_ebb_pcrels_fit (bfd *abfd,
-                             asection *sec,
-                             bfd_byte *contents,
-                             Elf_Internal_Rela *internal_relocs,
-                             const ebb_constraint *constraint)
-{
-  unsigned i, j;
-  Elf_Internal_Rela *irel;
-  xtensa_relax_info *relax_info;
-
-  relax_info = get_xtensa_relax_info (sec);
-
-  for (i = 0; i < sec->reloc_count; i++)
-    {
-      r_reloc r_rel;
-      bfd_vma orig_self_offset, orig_target_offset;
-      bfd_vma self_offset, target_offset;
-      int r_type;
-      reloc_howto_type *howto;
-      int self_removed_bytes, target_removed_bytes;
-
-      irel = &internal_relocs[i];
-      r_type = ELF32_R_TYPE (irel->r_info);
-
-      howto = &elf_howto_table[r_type];
-      /* We maintain the required invariant: PC-relative relocations
-        that fit before linking must fit after linking.  Thus we only
-        need to deal with relocations to the same section that are
-        PC-relative.  */
-      if (ELF32_R_TYPE (irel->r_info) == R_XTENSA_ASM_SIMPLIFY
-         || !howto->pc_relative)
-       continue;
-
-      r_reloc_init (&r_rel, abfd, irel, contents,
-                   bfd_get_section_limit (abfd, sec));
-
-      if (r_reloc_get_section (&r_rel) != sec)
-       continue;
-
-      orig_self_offset = irel->r_offset;
-      orig_target_offset = r_rel.target_offset;
-
-      self_offset = orig_self_offset;
-      target_offset = orig_target_offset;
-
-      if (relax_info)
-       {
-         self_offset = offset_with_removed_text (&relax_info->action_list,
-                                                 orig_self_offset);
-         target_offset = offset_with_removed_text (&relax_info->action_list,
-                                                   orig_target_offset);
-       }
-
-      self_removed_bytes = 0;
-      target_removed_bytes = 0;
-
-      for (j = 0; j < constraint->action_count; ++j)
-       {
-         proposed_action *action = &constraint->actions[j];
-         bfd_vma offset = action->offset;
-         int removed_bytes = action->removed_bytes;
-         if (offset < orig_self_offset
-             || (offset == orig_self_offset && action->action == ta_fill
-                 && action->removed_bytes < 0))
-           self_removed_bytes += removed_bytes;
-         if (offset < orig_target_offset
-             || (offset == orig_target_offset && action->action == ta_fill
-                 && action->removed_bytes < 0))
-           target_removed_bytes += removed_bytes;
-       }
-      self_offset -= self_removed_bytes;
-      target_offset -= target_removed_bytes;
-
-      /* Try to encode it.  Get the operand and check.  */
-      if (is_alt_relocation (ELF32_R_TYPE (irel->r_info)))
-       {
-         /* None of the current alternate relocs are PC-relative,
-            and only PC-relative relocs matter here.  */
-       }
-      else
-       {
-         xtensa_opcode opcode;
-         int opnum;
-
-         opcode = get_relocation_opcode (abfd, sec, contents, irel);
-         if (opcode == XTENSA_UNDEFINED)
-           return FALSE;
-
-         opnum = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
-         if (opnum == XTENSA_UNDEFINED)
-           return FALSE;
-
-         if (!pcrel_reloc_fits (opcode, opnum, self_offset, target_offset))
-           return FALSE;
-       }
-    }
-
-  return TRUE;
-}
-
-
-static bfd_boolean
-check_section_ebb_reduces (const ebb_constraint *constraint)
-{
-  int removed = 0;
-  unsigned i;
-
-  for (i = 0; i < constraint->action_count; i++)
-    {
-      const proposed_action *action = &constraint->actions[i];
-      if (action->do_action)
-       removed += action->removed_bytes;
-    }
-  if (removed < 0)
+  sdata = (struct elf_xtensa_section_data *) bfd_zalloc (abfd, amt);
+  if (sdata == NULL)
     return FALSE;
+  sec->used_by_bfd = (PTR) sdata;
 
-  return TRUE;
+  return _bfd_elf_new_section_hook (abfd, sec);
 }
 
 
-void
-text_action_add_proposed (text_action_list *l,
-                         const ebb_constraint *ebb_table,
-                         asection *sec)
+static void
+init_xtensa_relax_info (sec)
+     asection *sec;
 {
-  unsigned i;
+  xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
 
-  for (i = 0; i < ebb_table->action_count; i++)
-    {
-      proposed_action *action = &ebb_table->actions[i];
+  relax_info->is_relaxable_literal_section = FALSE;
+  relax_info->visited = 0;
 
-      if (!action->do_action)
-       continue;
-      switch (action->action)
-       {
-       case ta_remove_insn:
-       case ta_remove_longcall:
-       case ta_convert_longcall:
-       case ta_narrow_insn:
-       case ta_widen_insn:
-       case ta_fill:
-       case ta_remove_literal:
-         text_action_add (l, action->action, sec, action->offset,
-                          action->removed_bytes);
-         break;
-       case ta_none:
-         break;
-       default:
-         BFD_ASSERT (0);
-         break;
-       }
-    }
+  relax_info->src_relocs = NULL;
+  relax_info->src_count = 0;
+  relax_info->src_next = 0;
+
+  relax_info->removed_list.head = NULL;
+  relax_info->removed_list.tail = NULL;
+
+  relax_info->fix_list = NULL;
 }
 
 
-int
-compute_fill_extra_space (property_table_entry *entry)
+static xtensa_relax_info *
+get_xtensa_relax_info (sec)
+     asection *sec;
 {
-  int fill_extra_space;
+  struct elf_xtensa_section_data *section_data;
 
-  if (!entry)
-    return 0;
+  /* No info available if no section or if it is an output section.  */
+  if (!sec || sec == sec->output_section)
+    return NULL;
 
-  if ((entry->flags & XTENSA_PROP_UNREACHABLE) == 0)
-    return 0;
+  section_data = (struct elf_xtensa_section_data *) elf_section_data (sec);
+  return &section_data->relax_info;
+}
 
-  fill_extra_space = entry->size;
-  if ((entry->flags & XTENSA_PROP_ALIGN) != 0)
-    {
-      /* Fill bytes for alignment:
-        (2**n)-1 - (addr + (2**n)-1) & (2**n -1) */
-      int pow = GET_XTENSA_PROP_ALIGNMENT (entry->flags);
-      int nsm = (1 << pow) - 1;
-      bfd_vma addr = entry->address + entry->size;
-      bfd_vma align_fill = nsm - ((addr + nsm) & nsm);
-      fill_extra_space += align_fill;
-    }
-  return fill_extra_space;
+
+static void
+add_fix (src_sec, fix)
+     asection *src_sec;
+     reloc_bfd_fix *fix;
+{
+  xtensa_relax_info *relax_info;
+
+  relax_info = get_xtensa_relax_info (src_sec);
+  fix->next = relax_info->fix_list;
+  relax_info->fix_list = fix;
 }
 
 \f
-/* First relaxation pass.  */
+/* Access to internal relocations, section contents and symbols.  */
 
-/* If the section contains relaxable literals, check each literal to
-   see if it has the same value as another literal that has already
-   been seen, either in the current section or a previous one.  If so,
-   add an entry to the per-section list of removed literals.  The
-   actual changes are deferred until the next pass.  */
+/* During relaxation, we need to modify relocations, section contents,
+   and symbol definitions, and we need to keep the original values from
+   being reloaded from the input files, i.e., we need to "pin" the
+   modified values in memory.  We also want to continue to observe the
+   setting of the "keep-memory" flag.  The following functions wrap the
+   standard BFD functions to take care of this for us.  */
 
-static bfd_boolean 
-compute_removed_literals (bfd *abfd,
-                         asection *sec,
-                         struct bfd_link_info *link_info,
-                         value_map_hash_table *values)
+static Elf_Internal_Rela *
+retrieve_internal_relocs (abfd, sec, keep_memory)
+     bfd *abfd;
+     asection *sec;
+     bfd_boolean keep_memory;
 {
-  xtensa_relax_info *relax_info;
-  bfd_byte *contents;
   Elf_Internal_Rela *internal_relocs;
-  source_reloc *src_relocs, *rel;
-  bfd_boolean ok = TRUE;
-  property_table_entry *prop_table = NULL;
-  int ptblsize;
-  int i, prev_i;
-  bfd_boolean last_loc_is_prev = FALSE;
-  bfd_vma last_target_offset = 0;
-  section_cache_t target_sec_cache;
-  bfd_size_type sec_size;
 
-  init_section_cache (&target_sec_cache);
+  if ((sec->flags & SEC_LINKER_CREATED) != 0)
+    return NULL;
 
-  /* Do nothing if it is not a relaxable literal section.  */
-  relax_info = get_xtensa_relax_info (sec);
-  BFD_ASSERT (relax_info);
-  if (!relax_info->is_relaxable_literal_section)
-    return ok;
+  internal_relocs = elf_section_data (sec)->relocs;
+  if (internal_relocs == NULL)
+    internal_relocs = (_bfd_elf_link_read_relocs
+                      (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+                       keep_memory));
+  return internal_relocs;
+}
 
-  internal_relocs = retrieve_internal_relocs (abfd, sec, 
-                                             link_info->keep_memory);
 
-  sec_size = bfd_get_section_limit (abfd, sec);
-  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
-    {
-      ok = FALSE;
-      goto error_return;
-    }
+static void
+pin_internal_relocs (sec, internal_relocs)
+     asection *sec;
+     Elf_Internal_Rela *internal_relocs;
+{
+  elf_section_data (sec)->relocs = internal_relocs;
+}
 
-  /* Sort the source_relocs by target offset.  */
-  src_relocs = relax_info->src_relocs;
-  qsort (src_relocs, relax_info->src_count,
-        sizeof (source_reloc), source_reloc_compare);
-  qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
-        internal_reloc_compare);
 
-  ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
-                                       XTENSA_PROP_SEC_NAME, FALSE);
-  if (ptblsize < 0)
+static void
+release_internal_relocs (sec, internal_relocs)
+     asection *sec;
+     Elf_Internal_Rela *internal_relocs;
+{
+  if (internal_relocs
+      && elf_section_data (sec)->relocs != internal_relocs)
+    free (internal_relocs);
+}
+
+
+static bfd_byte *
+retrieve_contents (abfd, sec, keep_memory)
+     bfd *abfd;
+     asection *sec;
+     bfd_boolean keep_memory;
+{
+  bfd_byte *contents;
+
+  contents = elf_section_data (sec)->this_hdr.contents;
+  
+  if (contents == NULL && sec->size != 0)
     {
-      ok = FALSE;
-      goto error_return;
+      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
+       {
+         if (contents != NULL)
+           free (contents);
+         return NULL;
+       }
+      if (keep_memory) 
+       elf_section_data (sec)->this_hdr.contents = contents;
     }
+  return contents;
+}
 
-  prev_i = -1;
-  for (i = 0; i < relax_info->src_count; i++)
-    {
-      Elf_Internal_Rela *irel = NULL;
 
-      rel = &src_relocs[i];
-      if (get_l32r_opcode () != rel->opcode)
-       continue;
-      irel = get_irel_at_offset (sec, internal_relocs,
-                                rel->r_rel.target_offset);
+static void
+pin_contents (sec, contents)
+     asection *sec;
+     bfd_byte *contents;
+{
+  elf_section_data (sec)->this_hdr.contents = contents;
+}
 
-      /* If the relocation on this is not a simple R_XTENSA_32 or
-        R_XTENSA_PLT then do not consider it.  This may happen when
-        the difference of two symbols is used in a literal.  */
-      if (irel && (ELF32_R_TYPE (irel->r_info) != R_XTENSA_32
-                  && ELF32_R_TYPE (irel->r_info) != R_XTENSA_PLT))
-       continue;
 
-      /* If the target_offset for this relocation is the same as the
-        previous relocation, then we've already considered whether the
-        literal can be coalesced.  Skip to the next one....  */
-      if (i != 0 && prev_i != -1
-         && src_relocs[i-1].r_rel.target_offset == rel->r_rel.target_offset)
-       continue;
-      prev_i = i;
+static void
+release_contents (sec, contents)
+     asection *sec;
+     bfd_byte *contents;
+{
+  if (contents && 
+      elf_section_data (sec)->this_hdr.contents != contents)
+    free (contents);
+}
 
-      if (last_loc_is_prev && 
-         last_target_offset + 4 != rel->r_rel.target_offset)
-       last_loc_is_prev = FALSE;
 
-      /* Check if the relocation was from an L32R that is being removed
-        because a CALLX was converted to a direct CALL, and check if
-        there are no other relocations to the literal.  */
-      if (is_removable_literal (rel, i, src_relocs, relax_info->src_count))
-       {
-         if (!remove_dead_literal (abfd, sec, link_info, internal_relocs,
-                                   irel, rel, prop_table, ptblsize))
-           {
-             ok = FALSE;
-             goto error_return;
-           }
-         last_target_offset = rel->r_rel.target_offset;
-         continue;
-       }
+static Elf_Internal_Sym *
+retrieve_local_syms (input_bfd)
+     bfd *input_bfd;
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  Elf_Internal_Sym *isymbuf;
+  size_t locsymcount;
 
-      if (!identify_literal_placement (abfd, sec, contents, link_info,
-                                      values, 
-                                      &last_loc_is_prev, irel, 
-                                      relax_info->src_count - i, rel,
-                                      prop_table, ptblsize,
-                                      &target_sec_cache, rel->is_abs_literal))
-       {
-         ok = FALSE;
-         goto error_return;
-       }
-      last_target_offset = rel->r_rel.target_offset;
-    }
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  locsymcount = symtab_hdr->sh_info;
 
-#if DEBUG
-  print_removed_literals (stderr, &relax_info->removed_list);
-  print_action_list (stderr, &relax_info->action_list);
-#endif /* DEBUG */
+  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+  if (isymbuf == NULL && locsymcount != 0)
+    isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0,
+                                   NULL, NULL, NULL);
 
-error_return:
-  if (prop_table) free (prop_table);
-  clear_section_cache (&target_sec_cache);
+  /* Save the symbols for this input file so they won't be read again.  */
+  if (isymbuf && isymbuf != (Elf_Internal_Sym *) symtab_hdr->contents)
+    symtab_hdr->contents = (unsigned char *) isymbuf;
 
-  release_contents (sec, contents);
-  release_internal_relocs (sec, internal_relocs);
-  return ok;
+  return isymbuf;
 }
 
+\f
+/* Code for link-time relaxation.  */
 
-static Elf_Internal_Rela *
-get_irel_at_offset (asection *sec,
-                   Elf_Internal_Rela *internal_relocs,
-                   bfd_vma offset)
-{
-  unsigned i;
-  Elf_Internal_Rela *irel;
-  unsigned r_type;
-  Elf_Internal_Rela key;
+/* Local helper functions.  */
+static bfd_boolean analyze_relocations
+  PARAMS ((struct bfd_link_info *));
+static bfd_boolean find_relaxable_sections
+  PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
+static bfd_boolean collect_source_relocs
+  PARAMS ((bfd *, asection *, struct bfd_link_info *));
+static bfd_boolean is_resolvable_asm_expansion
+  PARAMS ((bfd *, asection *, bfd_byte *, Elf_Internal_Rela *,
+          struct bfd_link_info *, bfd_boolean *));
+static bfd_boolean remove_literals
+  PARAMS ((bfd *, asection *, struct bfd_link_info *, value_map_hash_table *));
+static bfd_boolean relax_section
+  PARAMS ((bfd *, asection *, struct bfd_link_info *));
+static bfd_boolean relax_property_section
+  PARAMS ((bfd *, asection *, struct bfd_link_info *));
+static bfd_boolean relax_section_symbols
+  PARAMS ((bfd *, asection *));
+static bfd_boolean relocations_reach
+  PARAMS ((source_reloc *, int, const r_reloc *));
+static void translate_reloc
+  PARAMS ((const r_reloc *, r_reloc *));
+static Elf_Internal_Rela *get_irel_at_offset
+  PARAMS ((asection *, Elf_Internal_Rela *, bfd_vma));
+static Elf_Internal_Rela *find_associated_l32r_irel
+  PARAMS ((asection *, bfd_byte *, Elf_Internal_Rela *,
+          Elf_Internal_Rela *));
+static void shrink_dynamic_reloc_sections
+  PARAMS ((struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *));
 
-  if (!internal_relocs) 
-    return NULL;
 
-  key.r_offset = offset;
-  irel = bsearch (&key, internal_relocs, sec->reloc_count,
-                 sizeof (Elf_Internal_Rela), internal_reloc_matches);
-  if (!irel)
-    return NULL;
+static bfd_boolean 
+elf_xtensa_relax_section (abfd, sec, link_info, again)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
+     bfd_boolean *again;
+{
+  static value_map_hash_table *values = NULL;
+  xtensa_relax_info *relax_info;
 
-  /* bsearch does not guarantee which will be returned if there are
-     multiple matches.  We need the first that is not an alignment.  */
-  i = irel - internal_relocs;
-  while (i > 0)
-    {
-      if (internal_relocs[i-1].r_offset != offset)
-       break;
-      i--;
-    }
-  for ( ; i < sec->reloc_count; i++)
+  if (!values)
     {
-      irel = &internal_relocs[i];
-      r_type = ELF32_R_TYPE (irel->r_info);
-      if (irel->r_offset == offset && r_type != R_XTENSA_NONE)
-       return irel;
+      /* Do some overall initialization for relaxation.  */
+      values = value_map_hash_table_init ();
+      relaxing_section = TRUE;
+      if (!analyze_relocations (link_info))
+       return FALSE;
     }
+  *again = FALSE;
 
-  return NULL;
-}
+  /* Don't mess with linker-created sections.  */
+  if ((sec->flags & SEC_LINKER_CREATED) != 0)
+    return TRUE;
 
+  relax_info = get_xtensa_relax_info (sec);
+  BFD_ASSERT (relax_info != NULL);
 
-bfd_boolean
-is_removable_literal (const source_reloc *rel,
-                     int i,
-                     const source_reloc *src_relocs,
-                     int src_count)
-{
-  const source_reloc *curr_rel;
-  if (!rel->is_null)
-    return FALSE;
-  
-  for (++i; i < src_count; ++i)
+  switch (relax_info->visited)
     {
-      curr_rel = &src_relocs[i];
-      /* If all others have the same target offset....  */
-      if (curr_rel->r_rel.target_offset != rel->r_rel.target_offset)
-       return TRUE;
-
-      if (!curr_rel->is_null
-         && !xtensa_is_property_section (curr_rel->source_sec)
-         && !(curr_rel->source_sec->flags & SEC_DEBUGGING))
+    case 0:
+      /* Note: It would be nice to fold this pass into
+        analyze_relocations, but it is important for this step that the
+        sections be examined in link order.  */
+      if (!remove_literals (abfd, sec, link_info, values))
        return FALSE;
+      *again = TRUE;
+      break;
+
+    case 1:
+      if (!relax_section (abfd, sec, link_info))
+       return FALSE;
+      *again = TRUE;
+      break;
+
+    case 2:
+      if (!relax_section_symbols (abfd, sec))
+       return FALSE;
+      break;
     }
+
+  relax_info->visited++;
   return TRUE;
 }
 
+/* Initialization for relaxation.  */
+
+/* This function is called once at the start of relaxation.  It scans
+   all the input sections and marks the ones that are relaxable (i.e.,
+   literal sections with L32R relocations against them).  It then
+   collect source_reloc information for all the relocations against
+   those relaxable sections.  */
 
-bfd_boolean 
-remove_dead_literal (bfd *abfd,
-                    asection *sec,
-                    struct bfd_link_info *link_info,
-                    Elf_Internal_Rela *internal_relocs,
-                    Elf_Internal_Rela *irel,
-                    source_reloc *rel,
-                    property_table_entry *prop_table,
-                    int ptblsize)
+static bfd_boolean
+analyze_relocations (link_info)
+     struct bfd_link_info *link_info;
 {
-  property_table_entry *entry;
-  xtensa_relax_info *relax_info;
-
-  relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
-    return FALSE;
+  bfd *abfd;
+  asection *sec;
+  bfd_boolean is_relaxable = FALSE;
 
-  entry = elf_xtensa_find_property_entry (prop_table, ptblsize,
-                                         sec->vma + rel->r_rel.target_offset);
+  /* Initialize the per-section relaxation info.  */
+  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+    for (sec = abfd->sections; sec != NULL; sec = sec->next)
+      {
+       init_xtensa_relax_info (sec);
+      }
 
-  /* Mark the unused literal so that it will be removed.  */
-  add_removed_literal (&relax_info->removed_list, &rel->r_rel, NULL);
+  /* Mark relaxable sections (and count relocations against each one).  */
+  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+    for (sec = abfd->sections; sec != NULL; sec = sec->next)
+      {
+       if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable))
+         return FALSE;
+      }
 
-  text_action_add (&relax_info->action_list,
-                  ta_remove_literal, sec, rel->r_rel.target_offset, 4);
+  /* Bail out if there are no relaxable sections.  */
+  if (!is_relaxable)
+    return TRUE;
 
-  /* If the section is 4-byte aligned, do not add fill.  */
-  if (sec->alignment_power > 2) 
-    {
-      int fill_extra_space;
-      bfd_vma entry_sec_offset;
-      text_action *fa;
-      property_table_entry *the_add_entry;
-      int removed_diff;
-
-      if (entry)
-       entry_sec_offset = entry->address - sec->vma + entry->size;
-      else
-       entry_sec_offset = rel->r_rel.target_offset + 4;
-
-      /* If the literal range is at the end of the section,
-        do not add fill.  */
-      the_add_entry = elf_xtensa_find_property_entry (prop_table, ptblsize,
-                                                     entry_sec_offset);
-      fill_extra_space = compute_fill_extra_space (the_add_entry);
-
-      fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
-      removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
-                                                 -4, fill_extra_space);
-      if (fa)
-       adjust_fill_action (fa, removed_diff);
-      else
-       text_action_add (&relax_info->action_list,
-                        ta_fill, sec, entry_sec_offset, removed_diff);
-    }
+  /* Allocate space for source_relocs.  */
+  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+    for (sec = abfd->sections; sec != NULL; sec = sec->next)
+      {
+       xtensa_relax_info *relax_info;
 
-  /* Zero out the relocation on this literal location.  */
-  if (irel)
-    {
-      if (elf_hash_table (link_info)->dynamic_sections_created)
-       shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
+       relax_info = get_xtensa_relax_info (sec);
+       if (relax_info->is_relaxable_literal_section)
+         {
+           relax_info->src_relocs = (source_reloc *)
+             bfd_malloc (relax_info->src_count * sizeof (source_reloc));
+         }
+      }
 
-      irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
-      pin_internal_relocs (sec, internal_relocs);
-    }
+  /* Collect info on relocations against each relaxable section.  */
+  for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+    for (sec = abfd->sections; sec != NULL; sec = sec->next)
+      {
+       if (!collect_source_relocs (abfd, sec, link_info))
+         return FALSE;
+      }
 
-  /* Do not modify "last_loc_is_prev".  */
   return TRUE;
 }
 
 
-bfd_boolean 
-identify_literal_placement (bfd *abfd,
-                           asection *sec,
-                           bfd_byte *contents,
-                           struct bfd_link_info *link_info,
-                           value_map_hash_table *values,
-                           bfd_boolean *last_loc_is_prev_p,
-                           Elf_Internal_Rela *irel,
-                           int remaining_src_rels,
-                           source_reloc *rel,
-                           property_table_entry *prop_table,
-                           int ptblsize,
-                           section_cache_t *target_sec_cache,
-                           bfd_boolean is_abs_literal)
-{
-  literal_value val;
-  value_map *val_map;
-  xtensa_relax_info *relax_info;
-  bfd_boolean literal_placed = FALSE;
-  r_reloc r_rel;
-  unsigned long value;
-  bfd_boolean final_static_link;
-  bfd_size_type sec_size;
-
-  relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
-    return FALSE;
+/* Find all the literal sections that might be relaxed.  The motivation
+   for this pass is that collect_source_relocs() needs to record _all_
+   the relocations that target each relaxable section.  That is
+   expensive and unnecessary unless the target section is actually going
+   to be relaxed.  This pass identifies all such sections by checking if
+   they have L32Rs pointing to them.  In the process, the total number
+   of relocations targeting each section is also counted so that we
+   know how much space to allocate for source_relocs against each
+   relaxable literal section.  */
 
-  sec_size = bfd_get_section_limit (abfd, sec);
+static bfd_boolean
+find_relaxable_sections (abfd, sec, link_info, is_relaxable_p)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
+     bfd_boolean *is_relaxable_p;
+{
+  Elf_Internal_Rela *internal_relocs;
+  bfd_byte *contents;
+  bfd_boolean ok = TRUE;
+  unsigned i;
 
-  final_static_link =
-    (!link_info->relocatable
-     && !elf_hash_table (link_info)->dynamic_sections_created);
+  internal_relocs = retrieve_internal_relocs (abfd, sec,
+                                             link_info->keep_memory);
+  if (internal_relocs == NULL) 
+    return ok;
 
-  /* The placement algorithm first checks to see if the literal is
-     already in the value map.  If so and the value map is reachable
-     from all uses, then the literal is moved to that location.  If
-     not, then we identify the last location where a fresh literal was
-     placed.  If the literal can be safely moved there, then we do so.
-     If not, then we assume that the literal is not to move and leave
-     the literal where it is, marking it as the last literal
-     location.  */
-
-  /* Find the literal value.  */
-  value = 0;
-  r_reloc_init (&r_rel, abfd, irel, contents, sec_size);
-  if (!irel)
+  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
+  if (contents == NULL && sec->size != 0)
     {
-      BFD_ASSERT (rel->r_rel.target_offset < sec_size);
-      value = bfd_get_32 (abfd, contents + rel->r_rel.target_offset);
+      ok = FALSE;
+      goto error_return;
     }
-  init_literal_value (&val, &r_rel, value, is_abs_literal);
-
-  /* Check if we've seen another literal with the same value that
-     is in the same output section.  */
-  val_map = value_map_get_cached_value (values, &val, final_static_link);
 
-  if (val_map
-      && (r_reloc_get_section (&val_map->loc)->output_section
-         == sec->output_section)
-      && relocations_reach (rel, remaining_src_rels, &val_map->loc)
-      && coalesce_shared_literal (sec, rel, prop_table, ptblsize, val_map))
+  for (i = 0; i < sec->reloc_count; i++) 
     {
-      /* No change to last_loc_is_prev.  */
-      literal_placed = TRUE;
-    }
+      Elf_Internal_Rela *irel = &internal_relocs[i];
+      r_reloc r_rel;
+      asection *target_sec;
+      xtensa_relax_info *target_relax_info;
 
-  /* For relocatable links, do not try to move literals.  To do it
-     correctly might increase the number of relocations in an input
-     section making the default relocatable linking fail.  */
-  if (!link_info->relocatable && !literal_placed 
-      && values->has_last_loc && !(*last_loc_is_prev_p))
-    {
-      asection *target_sec = r_reloc_get_section (&values->last_loc);
-      if (target_sec && target_sec->output_section == sec->output_section)
+      r_reloc_init (&r_rel, abfd, irel);
+
+      target_sec = r_reloc_get_section (&r_rel);
+      target_relax_info = get_xtensa_relax_info (target_sec);
+      if (!target_relax_info)
+       continue;
+
+      /* Count relocations against the target section.  */
+      target_relax_info->src_count++;
+
+      if (is_literal_section (target_sec)
+         && is_l32r_relocation (sec, contents, irel)
+         && r_reloc_is_defined (&r_rel))
        {
-         /* Increment the virtual offset.  */
-         r_reloc try_loc = values->last_loc;
-         try_loc.virtual_offset += 4;
-
-         /* There is a last loc that was in the same output section.  */
-         if (relocations_reach (rel, remaining_src_rels, &try_loc)
-             && move_shared_literal (sec, link_info, rel,
-                                     prop_table, ptblsize, 
-                                     &try_loc, &val, target_sec_cache))
-           {
-             values->last_loc.virtual_offset += 4;
-             literal_placed = TRUE;
-             if (!val_map)
-               val_map = add_value_map (values, &val, &try_loc,
-                                        final_static_link);
-             else
-               val_map->loc = try_loc;
-           }
+         /* Mark the target section as relaxable.  */
+         target_relax_info->is_relaxable_literal_section = TRUE;
+         *is_relaxable_p = TRUE;
        }
     }
 
-  if (!literal_placed)
-    {
-      /* Nothing worked, leave the literal alone but update the last loc.  */
-      values->has_last_loc = TRUE;
-      values->last_loc = rel->r_rel;
-      if (!val_map)
-       val_map = add_value_map (values, &val, &rel->r_rel, final_static_link);
-      else
-       val_map->loc = rel->r_rel;
-      *last_loc_is_prev_p = TRUE;
-    }
-
-  return TRUE;
+ error_return:
+  release_contents (sec, contents);
+  release_internal_relocs (sec, internal_relocs);
+  return ok;
 }
 
 
-/* Check if the original relocations (presumably on L32R instructions)
-   identified by reloc[0..N] can be changed to reference the literal
-   identified by r_rel.  If r_rel is out of range for any of the
-   original relocations, then we don't want to coalesce the original
-   literal with the one at r_rel.  We only check reloc[0..N], where the
-   offsets are all the same as for reloc[0] (i.e., they're all
-   referencing the same literal) and where N is also bounded by the
-   number of remaining entries in the "reloc" array.  The "reloc" array
-   is sorted by target offset so we know all the entries for the same
-   literal will be contiguous.  */
+/* Record _all_ the relocations that point to relaxable literal
+   sections, and get rid of ASM_EXPAND relocs by either converting them
+   to ASM_SIMPLIFY or by removing them.  */
 
 static bfd_boolean
-relocations_reach (source_reloc *reloc,
-                  int remaining_relocs,
-                  const r_reloc *r_rel)
+collect_source_relocs (abfd, sec, link_info)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
 {
-  bfd_vma from_offset, source_address, dest_address;
-  asection *sec;
-  int i;
+  Elf_Internal_Rela *internal_relocs;
+  bfd_byte *contents;
+  bfd_boolean ok = TRUE;
+  unsigned i;
 
-  if (!r_reloc_is_defined (r_rel))
-    return FALSE;
+  internal_relocs = retrieve_internal_relocs (abfd, sec, 
+                                             link_info->keep_memory);
+  if (internal_relocs == NULL) 
+    return ok;
 
-  sec = r_reloc_get_section (r_rel);
-  from_offset = reloc[0].r_rel.target_offset;
+  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
+  if (contents == NULL && sec->size != 0)
+    {
+      ok = FALSE;
+      goto error_return;
+    }
 
-  for (i = 0; i < remaining_relocs; i++)
+  /* Record relocations against relaxable literal sections.  */
+  for (i = 0; i < sec->reloc_count; i++) 
     {
-      if (reloc[i].r_rel.target_offset != from_offset)
-       break;
+      Elf_Internal_Rela *irel = &internal_relocs[i];
+      r_reloc r_rel;
+      asection *target_sec;
+      xtensa_relax_info *target_relax_info;
 
-      /* Ignore relocations that have been removed.  */
-      if (reloc[i].is_null)
-       continue;
+      r_reloc_init (&r_rel, abfd, irel);
 
-      /* The original and new output section for these must be the same
-         in order to coalesce.  */
-      if (r_reloc_get_section (&reloc[i].r_rel)->output_section
-         != sec->output_section)
-       return FALSE;
+      target_sec = r_reloc_get_section (&r_rel);
+      target_relax_info = get_xtensa_relax_info (target_sec);
 
-      /* A literal with no PC-relative relocations can be moved anywhere.  */
-      if (reloc[i].opnd != -1)
+      if (target_relax_info
+         && target_relax_info->is_relaxable_literal_section)
        {
-         /* Otherwise, check to see that it fits.  */
-         source_address = (reloc[i].source_sec->output_section->vma
-                           + reloc[i].source_sec->output_offset
-                           + reloc[i].r_rel.rela.r_offset);
-         dest_address = (sec->output_section->vma
-                         + sec->output_offset
-                         + r_rel->target_offset);
+         xtensa_opcode opcode;
+         xtensa_operand opnd;
+         source_reloc *s_reloc;
+         int src_next;
 
-         if (!pcrel_reloc_fits (reloc[i].opcode, reloc[i].opnd,
-                                source_address, dest_address))
-           return FALSE;
+         src_next = target_relax_info->src_next++;
+         s_reloc = &target_relax_info->src_relocs[src_next];
+
+         opcode = get_relocation_opcode (sec, contents, irel);
+         if (opcode == XTENSA_UNDEFINED)
+           opnd = NULL;
+         else
+           opnd = xtensa_get_operand (xtensa_default_isa, opcode,
+                                      get_relocation_opnd (irel));
+
+         init_source_reloc (s_reloc, sec, &r_rel, opnd);
        }
     }
 
-  return TRUE;
-}
+  /* Now get rid of ASM_EXPAND relocations.  At this point, the
+     src_relocs array for the target literal section may still be
+     incomplete, but it must at least contain the entries for the L32R
+     relocations associated with ASM_EXPANDs because they were just
+     added in the preceding loop over the relocations.  */
 
+  for (i = 0; i < sec->reloc_count; i++) 
+    {
+      Elf_Internal_Rela *irel = &internal_relocs[i];
+      bfd_boolean is_reachable;
 
-/* Move a literal to another literal location because it is
-   the same as the other literal value.  */
+      if (!is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info,
+                                       &is_reachable))
+       continue;
 
-static bfd_boolean 
-coalesce_shared_literal (asection *sec,
-                        source_reloc *rel,
-                        property_table_entry *prop_table,
-                        int ptblsize,
-                        value_map *val_map)
-{
-  property_table_entry *entry;
-  text_action *fa;
-  property_table_entry *the_add_entry;
-  int removed_diff;
-  xtensa_relax_info *relax_info;
+      if (is_reachable)
+       {
+         Elf_Internal_Rela *l32r_irel;
+         r_reloc r_rel;
+         asection *target_sec;
+         xtensa_relax_info *target_relax_info;
 
-  relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
-    return FALSE;
+         /* Mark the source_reloc for the L32R so that it will be
+            removed in remove_literals(), along with the associated
+            literal.  */
+         l32r_irel = find_associated_l32r_irel (sec, contents,
+                                                irel, internal_relocs);
+         if (l32r_irel == NULL)
+           continue;
 
-  entry = elf_xtensa_find_property_entry
-    (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset);
-  if (entry && (entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM))
-    return TRUE;
+         r_reloc_init (&r_rel, abfd, l32r_irel);
 
-  /* Mark that the literal will be coalesced.  */
-  add_removed_literal (&relax_info->removed_list, &rel->r_rel, &val_map->loc);
+         target_sec = r_reloc_get_section (&r_rel);
+         target_relax_info = get_xtensa_relax_info (target_sec);
 
-  text_action_add (&relax_info->action_list,
-                  ta_remove_literal, sec, rel->r_rel.target_offset, 4);
+         if (target_relax_info
+             && target_relax_info->is_relaxable_literal_section)
+           {
+             source_reloc *s_reloc;
 
-  /* If the section is 4-byte aligned, do not add fill.  */
-  if (sec->alignment_power > 2) 
-    {
-      int fill_extra_space;
-      bfd_vma entry_sec_offset;
+             /* Search the source_relocs for the entry corresponding to
+                the l32r_irel.  Note: The src_relocs array is not yet
+                sorted, but it wouldn't matter anyway because we're
+                searching by source offset instead of target offset.  */
+             s_reloc = find_source_reloc (target_relax_info->src_relocs, 
+                                          target_relax_info->src_next,
+                                          sec, l32r_irel);
+             BFD_ASSERT (s_reloc);
+             s_reloc->is_null = TRUE;
+           }
 
-      if (entry)
-       entry_sec_offset = entry->address - sec->vma + entry->size;
-      else
-       entry_sec_offset = rel->r_rel.target_offset + 4;
-
-      /* If the literal range is at the end of the section,
-        do not add fill.  */
-      fill_extra_space = 0;
-      the_add_entry = elf_xtensa_find_property_entry (prop_table, ptblsize,
-                                                     entry_sec_offset);
-      if (the_add_entry && (the_add_entry->flags & XTENSA_PROP_UNREACHABLE))
-       fill_extra_space = the_add_entry->size;
-
-      fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
-      removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
-                                                 -4, fill_extra_space);
-      if (fa)
-       adjust_fill_action (fa, removed_diff);
+         /* Convert this reloc to ASM_SIMPLIFY.  */
+         irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+                                      R_XTENSA_ASM_SIMPLIFY);
+         l32r_irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
+
+         pin_internal_relocs (sec, internal_relocs);
+       }
       else
-       text_action_add (&relax_info->action_list,
-                        ta_fill, sec, entry_sec_offset, removed_diff);
+       {
+         /* It is resolvable but doesn't reach.  We resolve now
+            by eliminating the relocation -- the call will remain
+            expanded into L32R/CALLX.  */
+         irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
+         pin_internal_relocs (sec, internal_relocs);
+       }
     }
 
-  return TRUE;
+ error_return:
+  release_contents (sec, contents);
+  release_internal_relocs (sec, internal_relocs);
+  return ok;
 }
 
 
-/* Move a literal to another location.  This may actually increase the
-   total amount of space used because of alignments so we need to do
-   this carefully.  Also, it may make a branch go out of range.  */
+/* Return TRUE if the asm expansion can be resolved.  Generally it can
+   be resolved on a final link or when a partial link locates it in the
+   same section as the target.  Set "is_reachable" flag if the target of
+   the call is within the range of a direct call, given the current VMA
+   for this section and the target section.  */
 
-static bfd_boolean 
-move_shared_literal (asection *sec,
-                    struct bfd_link_info *link_info,
-                    source_reloc *rel,
-                    property_table_entry *prop_table,
-                    int ptblsize,
-                    const r_reloc *target_loc,
-                    const literal_value *lit_value,
-                    section_cache_t *target_sec_cache)
+bfd_boolean
+is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info,
+                            is_reachable_p)
+     bfd *abfd;
+     asection *sec;
+     bfd_byte *contents;
+     Elf_Internal_Rela *irel;
+     struct bfd_link_info *link_info;
+     bfd_boolean *is_reachable_p;
 {
-  property_table_entry *the_add_entry, *src_entry, *target_entry = NULL;
-  text_action *fa, *target_fa;
-  int removed_diff;
-  xtensa_relax_info *relax_info, *target_relax_info;
   asection *target_sec;
-  ebb_t *ebb;
-  ebb_constraint ebb_table;
-  bfd_boolean relocs_fit;
+  bfd_vma target_offset;
+  r_reloc r_rel;
+  xtensa_opcode opcode, direct_call_opcode;
+  bfd_vma self_address;
+  bfd_vma dest_address;
 
-  /* If this routine always returns FALSE, the literals that cannot be
-     coalesced will not be moved.  */
-  if (elf32xtensa_no_literal_movement)
-    return FALSE;
+  *is_reachable_p = FALSE;
 
-  relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
+  if (contents == NULL)
     return FALSE;
 
-  target_sec = r_reloc_get_section (target_loc);
-  target_relax_info = get_xtensa_relax_info (target_sec);
-
-  /* Literals to undefined sections may not be moved because they
-     must report an error.  */
-  if (bfd_is_und_section (target_sec))
+  if (ELF32_R_TYPE (irel->r_info) != R_XTENSA_ASM_EXPAND) 
+    return FALSE;
+  
+  opcode = get_expanded_call_opcode (contents + irel->r_offset,
+                                    sec->size - irel->r_offset);
+  
+  direct_call_opcode = swap_callx_for_call_opcode (opcode);
+  if (direct_call_opcode == XTENSA_UNDEFINED)
     return FALSE;
 
-  src_entry = elf_xtensa_find_property_entry
-    (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset);
-
-  if (!section_cache_section (target_sec_cache, target_sec, link_info))
+  /* Check and see that the target resolves.  */
+  r_reloc_init (&r_rel, abfd, irel);
+  if (!r_reloc_is_defined (&r_rel))
     return FALSE;
 
-  target_entry = elf_xtensa_find_property_entry
-    (target_sec_cache->ptbl, target_sec_cache->pte_count, 
-     target_sec->vma + target_loc->target_offset);
+  target_sec = r_reloc_get_section (&r_rel);
+  target_offset = r_reloc_get_target_offset (&r_rel);
 
-  if (!target_entry)
+  /* If the target is in a shared library, then it doesn't reach.  This
+     isn't supposed to come up because the compiler should never generate
+     non-PIC calls on systems that use shared libraries, but the linker
+     shouldn't crash regardless.  */
+  if (!target_sec->output_section)
+    return FALSE;
+      
+  /* For relocatable sections, we can only simplify when the output
+     section of the target is the same as the output section of the
+     source.  */
+  if (link_info->relocatable
+      && (target_sec->output_section != sec->output_section))
     return FALSE;
 
-  /* Make sure that we have not broken any branches.  */
-  relocs_fit = FALSE;
-
-  init_ebb_constraint (&ebb_table);
-  ebb = &ebb_table.ebb;
-  init_ebb (ebb, target_sec_cache->sec, target_sec_cache->contents, 
-           target_sec_cache->content_length,
-           target_sec_cache->ptbl, target_sec_cache->pte_count,
-           target_sec_cache->relocs, target_sec_cache->reloc_count);
-
-  /* Propose to add 4 bytes + worst-case alignment size increase to
-     destination.  */
-  ebb_propose_action (&ebb_table, EBB_NO_ALIGN, 0,
-                     ta_fill, target_loc->target_offset,
-                     -4 - (1 << target_sec->alignment_power), TRUE);
-
-  /* Check all of the PC-relative relocations to make sure they still fit.  */
-  relocs_fit = check_section_ebb_pcrels_fit (target_sec->owner, target_sec, 
-                                            target_sec_cache->contents,
-                                            target_sec_cache->relocs,
-                                            &ebb_table);
-
-  if (!relocs_fit) 
+  self_address = (sec->output_section->vma
+                 + sec->output_offset + irel->r_offset + 3);
+  dest_address = (target_sec->output_section->vma
+                 + target_sec->output_offset + target_offset);
+      
+  *is_reachable_p = pcrel_reloc_fits
+    (xtensa_get_operand (xtensa_default_isa, direct_call_opcode, 0),
+     self_address, dest_address);
+
+  if ((self_address >> CALL_SEGMENT_BITS) !=
+      (dest_address >> CALL_SEGMENT_BITS))
     return FALSE;
 
-  text_action_add_literal (&target_relax_info->action_list,
-                          ta_add_literal, target_loc, lit_value, -4);
-
-  if (target_sec->alignment_power > 2 && target_entry != src_entry) 
-    {
-      /* May need to add or remove some fill to maintain alignment.  */
-      int fill_extra_space;
-      bfd_vma entry_sec_offset;
-
-      entry_sec_offset = 
-       target_entry->address - target_sec->vma + target_entry->size;
-
-      /* If the literal range is at the end of the section,
-        do not add fill.  */
-      fill_extra_space = 0;
-      the_add_entry =
-       elf_xtensa_find_property_entry (target_sec_cache->ptbl,
-                                       target_sec_cache->pte_count,
-                                       entry_sec_offset);
-      if (the_add_entry && (the_add_entry->flags & XTENSA_PROP_UNREACHABLE))
-       fill_extra_space = the_add_entry->size;
-
-      target_fa = find_fill_action (&target_relax_info->action_list,
-                                   target_sec, entry_sec_offset);
-      removed_diff = compute_removed_action_diff (target_fa, target_sec,
-                                                 entry_sec_offset, 4,
-                                                 fill_extra_space);
-      if (target_fa)
-       adjust_fill_action (target_fa, removed_diff);
-      else
-       text_action_add (&target_relax_info->action_list,
-                        ta_fill, target_sec, entry_sec_offset, removed_diff);
-    }
+  return TRUE;
+}
 
-  /* Mark that the literal will be moved to the new location.  */
-  add_removed_literal (&relax_info->removed_list, &rel->r_rel, target_loc);
 
-  /* Remove the literal.  */
-  text_action_add (&relax_info->action_list,
-                  ta_remove_literal, sec, rel->r_rel.target_offset, 4);
+static Elf_Internal_Rela *
+find_associated_l32r_irel (sec, contents, other_irel, internal_relocs)
+     asection *sec;
+     bfd_byte *contents;
+     Elf_Internal_Rela *other_irel;
+     Elf_Internal_Rela *internal_relocs;
+{
+  unsigned i;
 
-  /* If the section is 4-byte aligned, do not add fill.  */
-  if (sec->alignment_power > 2 && target_entry != src_entry) 
+  for (i = 0; i < sec->reloc_count; i++) 
     {
-      int fill_extra_space;
-      bfd_vma entry_sec_offset;
+      Elf_Internal_Rela *irel = &internal_relocs[i];
 
-      if (src_entry)
-       entry_sec_offset = src_entry->address - sec->vma + src_entry->size;
-      else
-       entry_sec_offset = rel->r_rel.target_offset+4;
-
-      /* If the literal range is at the end of the section,
-        do not add fill.  */
-      fill_extra_space = 0;
-      the_add_entry = elf_xtensa_find_property_entry (prop_table, ptblsize,
-                                                     entry_sec_offset);
-      if (the_add_entry && (the_add_entry->flags & XTENSA_PROP_UNREACHABLE))
-       fill_extra_space = the_add_entry->size;
-
-      fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
-      removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
-                                                 -4, fill_extra_space);
-      if (fa)
-       adjust_fill_action (fa, removed_diff);
-      else
-       text_action_add (&relax_info->action_list,
-                        ta_fill, sec, entry_sec_offset, removed_diff);
+      if (irel == other_irel)
+       continue;
+      if (irel->r_offset != other_irel->r_offset)
+       continue;
+      if (is_l32r_relocation (sec, contents, irel))
+       return irel;
     }
 
-  return TRUE;
+  return NULL;
 }
 
-\f
-/* Second relaxation pass.  */
+/* First relaxation pass.  */
 
-/* Modify all of the relocations to point to the right spot, and if this
-   is a relaxable section, delete the unwanted literals and fix the
-   section size.  */
+/* If the section is relaxable (i.e., a literal section), check each
+   literal to see if it has the same value as another literal that has
+   already been seen, either in the current section or a previous one.
+   If so, add an entry to the per-section list of removed literals.  The
+   actual changes are deferred until the next pass.  */
 
-bfd_boolean
-relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+static bfd_boolean 
+remove_literals (abfd, sec, link_info, values)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
+     value_map_hash_table *values;
 {
-  Elf_Internal_Rela *internal_relocs;
   xtensa_relax_info *relax_info;
   bfd_byte *contents;
+  Elf_Internal_Rela *internal_relocs;
+  source_reloc *src_relocs;
+  bfd_boolean final_static_link;
   bfd_boolean ok = TRUE;
-  unsigned i;
-  bfd_boolean rv = FALSE;
-  bfd_boolean virtual_action;
-  bfd_size_type sec_size;
+  int i;
 
-  sec_size = bfd_get_section_limit (abfd, sec);
+  /* Do nothing if it is not a relaxable literal section.  */
   relax_info = get_xtensa_relax_info (sec);
   BFD_ASSERT (relax_info);
 
-  /* First translate any of the fixes that have been added already.  */
-  translate_section_fixes (sec);
-
-  /* Handle property sections (e.g., literal tables) specially.  */
-  if (xtensa_is_property_section (sec))
-    {
-      BFD_ASSERT (!relax_info->is_relaxable_literal_section);
-      return relax_property_section (abfd, sec, link_info);
-    }
+  if (!relax_info->is_relaxable_literal_section)
+    return ok;
 
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
                                              link_info->keep_memory);
+
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
     }
 
-  if (internal_relocs)
-    {
-      for (i = 0; i < sec->reloc_count; i++)
-       {
-         Elf_Internal_Rela *irel;
-         xtensa_relax_info *target_relax_info;
-         bfd_vma source_offset, old_source_offset;
-         r_reloc r_rel;
-         unsigned r_type;
-         asection *target_sec;
-
-         /* Locally change the source address.
-            Translate the target to the new target address.
-            If it points to this section and has been removed,
-            NULLify it.
-            Write it back.  */
-
-         irel = &internal_relocs[i];
-         source_offset = irel->r_offset;
-         old_source_offset = source_offset;
-
-         r_type = ELF32_R_TYPE (irel->r_info);
-         r_reloc_init (&r_rel, abfd, irel, contents,
-                       bfd_get_section_limit (abfd, sec));
-
-         /* If this section could have changed then we may need to
-            change the relocation's offset.  */
-
-         if (relax_info->is_relaxable_literal_section
-             || relax_info->is_relaxable_asm_section)
-           {
-             if (r_type != R_XTENSA_NONE
-                 && find_removed_literal (&relax_info->removed_list,
-                                          irel->r_offset))
-               {
-                 /* Remove this relocation.  */
-                 if (elf_hash_table (link_info)->dynamic_sections_created)
-                   shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
-                 irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
-                 irel->r_offset = offset_with_removed_text
-                   (&relax_info->action_list, irel->r_offset);
-                 pin_internal_relocs (sec, internal_relocs);
-                 continue;
-               }
+  final_static_link =
+    (!link_info->relocatable
+     && !elf_hash_table (link_info)->dynamic_sections_created);
 
-             if (r_type == R_XTENSA_ASM_SIMPLIFY)
-               {
-                 text_action *action =
-                   find_insn_action (&relax_info->action_list,
-                                     irel->r_offset);
-                 if (action && (action->action == ta_convert_longcall
-                                || action->action == ta_remove_longcall))
-                   {
-                     bfd_reloc_status_type retval;
-                     char *error_message = NULL;
+  /* Sort the source_relocs by target offset.  */
+  src_relocs = relax_info->src_relocs;
+  qsort (src_relocs, relax_info->src_count,
+        sizeof (source_reloc), source_reloc_compare);
 
-                     retval = contract_asm_expansion (contents, sec_size,
-                                                      irel, &error_message);
-                     if (retval != bfd_reloc_ok)
-                       {
-                         (*link_info->callbacks->reloc_dangerous)
-                           (link_info, error_message, abfd, sec,
-                            irel->r_offset);
-                         goto error_return;
-                       }
-                     /* Update the action so that the code that moves
-                        the contents will do the right thing.  */
-                     if (action->action == ta_remove_longcall)
-                       action->action = ta_remove_insn;
-                     else
-                       action->action = ta_none;
-                     /* Refresh the info in the r_rel.  */
-                     r_reloc_init (&r_rel, abfd, irel, contents, sec_size);
-                     r_type = ELF32_R_TYPE (irel->r_info);
-                   }
-               }
+  for (i = 0; i < relax_info->src_count; i++)
+    {
+      source_reloc *rel;
+      Elf_Internal_Rela *irel = NULL;
+      literal_value val;
+      value_map *val_map;
 
-             source_offset = offset_with_removed_text
-               (&relax_info->action_list, irel->r_offset);
-             irel->r_offset = source_offset;
-           }
+      rel = &src_relocs[i];
+      irel = get_irel_at_offset (sec, internal_relocs,
+                                rel->r_rel.target_offset);
 
-         /* If the target section could have changed then
-            we may need to change the relocation's target offset.  */
+      /* If the target_offset for this relocation is the same as the
+        previous relocation, then we've already considered whether the
+        literal can be coalesced.  Skip to the next one....  */
+      if (i != 0 && (src_relocs[i-1].r_rel.target_offset
+                    == rel->r_rel.target_offset))
+       continue;
 
-         target_sec = r_reloc_get_section (&r_rel);
-         target_relax_info = get_xtensa_relax_info (target_sec);
+      /* Check if the relocation was from an L32R that is being removed
+        because a CALLX was converted to a direct CALL, and check if
+        there are no other relocations to the literal.  */
+      if (rel->is_null
+         && (i == relax_info->src_count - 1
+             || (src_relocs[i+1].r_rel.target_offset
+                 != rel->r_rel.target_offset)))
+       {
+         /* Mark the unused literal so that it will be removed.  */
+         add_removed_literal (&relax_info->removed_list, &rel->r_rel, NULL);
 
-         if (target_relax_info
-             && (target_relax_info->is_relaxable_literal_section
-                 || target_relax_info->is_relaxable_asm_section))
+         /* Zero out the relocation on this literal location.  */
+         if (irel)
            {
-             r_reloc new_reloc;
-             reloc_bfd_fix *fix;
-             bfd_vma addend_displacement;
-
-             translate_reloc (&r_rel, &new_reloc);
-
-             if (r_type == R_XTENSA_DIFF8
-                 || r_type == R_XTENSA_DIFF16
-                 || r_type == R_XTENSA_DIFF32)
-               {
-                 bfd_vma diff_value = 0, new_end_offset, diff_mask = 0;
-
-                 if (bfd_get_section_limit (abfd, sec) < old_source_offset)
-                   {
-                     (*link_info->callbacks->reloc_dangerous)
-                       (link_info, _("invalid relocation address"),
-                        abfd, sec, old_source_offset);
-                     goto error_return;
-                   }
-
-                 switch (r_type)
-                   {
-                   case R_XTENSA_DIFF8:
-                     diff_value =
-                       bfd_get_8 (abfd, &contents[old_source_offset]);
-                     break;
-                   case R_XTENSA_DIFF16:
-                     diff_value =
-                       bfd_get_16 (abfd, &contents[old_source_offset]);
-                     break;
-                   case R_XTENSA_DIFF32:
-                     diff_value =
-                       bfd_get_32 (abfd, &contents[old_source_offset]);
-                     break;
-                   }
-
-                 new_end_offset = offset_with_removed_text
-                   (&target_relax_info->action_list,
-                    r_rel.target_offset + diff_value);
-                 diff_value = new_end_offset - new_reloc.target_offset;
-
-                 switch (r_type)
-                   {
-                   case R_XTENSA_DIFF8:
-                     diff_mask = 0xff;
-                     bfd_put_8 (abfd, diff_value,
-                                &contents[old_source_offset]);
-                     break;
-                   case R_XTENSA_DIFF16:
-                     diff_mask = 0xffff;
-                     bfd_put_16 (abfd, diff_value,
-                                 &contents[old_source_offset]);
-                     break;
-                   case R_XTENSA_DIFF32:
-                     diff_mask = 0xffffffff;
-                     bfd_put_32 (abfd, diff_value,
-                                 &contents[old_source_offset]);
-                     break;
-                   }
+             if (elf_hash_table (link_info)->dynamic_sections_created)
+               shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
 
-                 /* Check for overflow.  */
-                 if ((diff_value & ~diff_mask) != 0)
-                   {
-                     (*link_info->callbacks->reloc_dangerous)
-                       (link_info, _("overflow after relaxation"),
-                        abfd, sec, old_source_offset);
-                     goto error_return;
-                   }
-
-                 pin_contents (sec, contents);
-               }
-
-             /* FIXME: If the relocation still references a section in
-                the same input file, the relocation should be modified
-                directly instead of adding a "fix" record.  */
-
-             addend_displacement =
-               new_reloc.target_offset + new_reloc.virtual_offset;
-
-             fix = reloc_bfd_fix_init (sec, source_offset, r_type, 0,
-                                       r_reloc_get_section (&new_reloc),
-                                       addend_displacement, TRUE);
-             add_fix (sec, fix);
+             irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
            }
 
-         pin_internal_relocs (sec, internal_relocs);
-       }
-    }
-
-  if ((relax_info->is_relaxable_literal_section
-       || relax_info->is_relaxable_asm_section)
-      && relax_info->action_list.head)
-    {
-      /* Walk through the planned actions and build up a table
-        of move, copy and fill records.  Use the move, copy and
-        fill records to perform the actions once.  */
-
-      bfd_size_type size = sec->size;
-      int removed = 0;
-      bfd_size_type final_size, copy_size, orig_insn_size;
-      bfd_byte *scratch = NULL;
-      bfd_byte *dup_contents = NULL;
-      bfd_size_type orig_size = size;
-      bfd_vma orig_dot = 0;
-      bfd_vma orig_dot_copied = 0; /* Byte copied already from
-                                           orig dot in physical memory.  */
-      bfd_vma orig_dot_vo = 0; /* Virtual offset from orig_dot.  */
-      bfd_vma dup_dot = 0;
-
-      text_action *action = relax_info->action_list.head;
-
-      final_size = sec->size;
-      for (action = relax_info->action_list.head; action;
-          action = action->next)
-       {
-         final_size -= action->removed_bytes;
+         continue;
        }
 
-      scratch = (bfd_byte *) bfd_zmalloc (final_size);
-      dup_contents = (bfd_byte *) bfd_zmalloc (final_size);
-
-      /* The dot is the current fill location.  */
-#if DEBUG
-      print_action_list (stderr, &relax_info->action_list);
-#endif
-
-      for (action = relax_info->action_list.head; action;
-          action = action->next)
+      /* Find the literal value.  */
+      r_reloc_init (&val.r_rel, abfd, irel);
+      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, final_static_link);
+      if (val_map != NULL) 
        {
-         virtual_action = FALSE;
-         if (action->offset > orig_dot)
-           {
-             orig_dot += orig_dot_copied;
-             orig_dot_copied = 0;
-             orig_dot_vo = 0;
-             /* Out of the virtual world.  */
-           }
+         /* First check that THIS and all the other relocs to this
+            literal will FIT if we move them to the new address.  */
 
-         if (action->offset > orig_dot)
-           {
-             copy_size = action->offset - orig_dot;
-             memmove (&dup_contents[dup_dot], &contents[orig_dot], copy_size);
-             orig_dot += copy_size;
-             dup_dot += copy_size;
-             BFD_ASSERT (action->offset == orig_dot);
-           }
-         else if (action->offset < orig_dot)
+         if (relocations_reach (rel, relax_info->src_count - i,
+                                &val_map->loc))
            {
-             if (action->action == ta_fill
-                 && action->offset - action->removed_bytes == orig_dot)
-               {
-                 /* This is OK because the fill only effects the dup_dot.  */
-               }
-             else if (action->action == ta_add_literal)
-               {
-                 /* TBD.  Might need to handle this.  */
-               }
+             /* Mark that the literal will be coalesced.  */
+             add_removed_literal (&relax_info->removed_list,
+                                  &rel->r_rel, &val_map->loc);
            }
-         if (action->offset == orig_dot)
+         else
            {
-             if (action->virtual_offset > orig_dot_vo)
-               {
-                 if (orig_dot_vo == 0)
-                   {
-                     /* Need to copy virtual_offset bytes.  Probably four.  */
-                     copy_size = action->virtual_offset - orig_dot_vo;
-                     memmove (&dup_contents[dup_dot],
-                              &contents[orig_dot], copy_size);
-                     orig_dot_copied = copy_size;
-                     dup_dot += copy_size;
-                   }
-                 virtual_action = TRUE;
-               } 
-             else
-               BFD_ASSERT (action->virtual_offset <= orig_dot_vo);
+             /* Relocations do not reach -- do not remove this literal.  */
+             val_map->loc = rel->r_rel;
            }
-         switch (action->action)
-           {
-           case ta_remove_literal:
-           case ta_remove_insn:
-             BFD_ASSERT (action->removed_bytes >= 0);
-             orig_dot += action->removed_bytes;
-             break;
+       }
+      else
+       {
+         /* 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, final_static_link);
+       }
+    }
 
-           case ta_narrow_insn:
-             orig_insn_size = 3;
-             copy_size = 2;
-             memmove (scratch, &contents[orig_dot], orig_insn_size);
-             BFD_ASSERT (action->removed_bytes == 1);
-             rv = narrow_instruction (scratch, final_size, 0, TRUE);
-             BFD_ASSERT (rv);
-             memmove (&dup_contents[dup_dot], scratch, copy_size);
-             orig_dot += orig_insn_size;
-             dup_dot += copy_size;
-             break;
+error_return:
+  release_contents (sec, contents);
+  release_internal_relocs (sec, internal_relocs);
+  return ok;
+}
 
-           case ta_fill:
-             if (action->removed_bytes >= 0)
-               orig_dot += action->removed_bytes;
-             else
-               {
-                 /* Already zeroed in dup_contents.  Just bump the
-                    counters.  */
-                 dup_dot += (-action->removed_bytes);
-               }
-             break;
 
-           case ta_none:
-             BFD_ASSERT (action->removed_bytes == 0);
-             break;
+/* Check if the original relocations (presumably on L32R instructions)
+   identified by reloc[0..N] can be changed to reference the literal
+   identified by r_rel.  If r_rel is out of range for any of the
+   original relocations, then we don't want to coalesce the original
+   literal with the one at r_rel.  We only check reloc[0..N], where the
+   offsets are all the same as for reloc[0] (i.e., they're all
+   referencing the same literal) and where N is also bounded by the
+   number of remaining entries in the "reloc" array.  The "reloc" array
+   is sorted by target offset so we know all the entries for the same
+   literal will be contiguous.  */
 
-           case ta_convert_longcall:
-           case ta_remove_longcall:
-             /* These will be removed or converted before we get here.  */
-             BFD_ASSERT (0);
-             break;
+static bfd_boolean
+relocations_reach (reloc, remaining_relocs, r_rel)
+     source_reloc *reloc;
+     int remaining_relocs;
+     const r_reloc *r_rel;
+{
+  bfd_vma from_offset, source_address, dest_address;
+  asection *sec;
+  int i;
 
-           case ta_widen_insn:
-             orig_insn_size = 2;
-             copy_size = 3;
-             memmove (scratch, &contents[orig_dot], orig_insn_size);
-             BFD_ASSERT (action->removed_bytes == -1);
-             rv = widen_instruction (scratch, final_size, 0, TRUE);
-             BFD_ASSERT (rv);
-             memmove (&dup_contents[dup_dot], scratch, copy_size);
-             orig_dot += orig_insn_size;
-             dup_dot += copy_size;
-             break;
+  if (!r_reloc_is_defined (r_rel))
+    return FALSE;
 
-           case ta_add_literal:
-             orig_insn_size = 0;
-             copy_size = 4;
-             BFD_ASSERT (action->removed_bytes == -4);
-             /* TBD -- place the literal value here and insert
-                into the table.  */
-             memset (&dup_contents[dup_dot], 0, 4);
-             pin_internal_relocs (sec, internal_relocs);
-             pin_contents (sec, contents);
+  sec = r_reloc_get_section (r_rel);
+  from_offset = reloc[0].r_rel.target_offset;
 
-             if (!move_literal (abfd, link_info, sec, dup_dot, dup_contents,
-                                relax_info, &internal_relocs, &action->value))
-               goto error_return;
+  for (i = 0; i < remaining_relocs; i++)
+    {
+      if (reloc[i].r_rel.target_offset != from_offset)
+       break;
 
-             if (virtual_action) 
-               orig_dot_vo += copy_size;
+      /* Ignore relocations that have been removed.  */
+      if (reloc[i].is_null)
+       continue;
 
-             orig_dot += orig_insn_size;
-             dup_dot += copy_size;
-             break;
+      /* The original and new output section for these must be the same
+         in order to coalesce.  */
+      if (r_reloc_get_section (&reloc[i].r_rel)->output_section
+         != sec->output_section)
+       return FALSE;
 
-           default:
-             /* Not implemented yet.  */
-             BFD_ASSERT (0);
-             break;
-           }
+      /* A NULL operand means it is not a PC-relative relocation, so
+         the literal can be moved anywhere.  */
+      if (reloc[i].opnd)
+       {
+         /* Otherwise, check to see that it fits.  */
+         source_address = (reloc[i].source_sec->output_section->vma
+                           + reloc[i].source_sec->output_offset
+                           + reloc[i].r_rel.rela.r_offset);
+         dest_address = (sec->output_section->vma
+                         + sec->output_offset
+                         + r_rel->target_offset);
 
-         size -= action->removed_bytes;
-         removed += action->removed_bytes;
-         BFD_ASSERT (dup_dot <= final_size);
-         BFD_ASSERT (orig_dot <= orig_size);
+         if (!pcrel_reloc_fits (reloc[i].opnd, source_address, dest_address))
+           return FALSE;
        }
+    }
 
-      orig_dot += orig_dot_copied;
-      orig_dot_copied = 0;
+  return TRUE;
+}
 
-      if (orig_dot != orig_size)
-       {
-         copy_size = orig_size - orig_dot;
-         BFD_ASSERT (orig_size > orig_dot);
-         BFD_ASSERT (dup_dot + copy_size == final_size);
-         memmove (&dup_contents[dup_dot], &contents[orig_dot], copy_size);
-         orig_dot += copy_size;
-         dup_dot += copy_size;
-       }
-      BFD_ASSERT (orig_size == orig_dot);
-      BFD_ASSERT (final_size == dup_dot);
 
-      /* Move the dup_contents back.  */
-      if (final_size > orig_size)
-       {
-         /* Contents need to be reallocated.  Swap the dup_contents into
-            contents.  */
-         sec->contents = dup_contents;
-         free (contents);
-         contents = dup_contents;
-         pin_contents (sec, contents);
-       }
-      else
-       {
-         BFD_ASSERT (final_size <= orig_size);
-         memset (contents, 0, orig_size);
-         memcpy (contents, dup_contents, final_size);
-         free (dup_contents);
-       }
-      free (scratch);
-      pin_contents (sec, contents);
+/* WARNING: linear search here.  If the relocation are in order by
+   address, we can use a faster binary search.  ALSO, we assume that
+   there is only 1 non-NONE relocation per address.  */
 
-      sec->size = final_size;
+static Elf_Internal_Rela *
+get_irel_at_offset (sec, internal_relocs, offset)
+     asection *sec;
+     Elf_Internal_Rela *internal_relocs;
+     bfd_vma offset;
+{
+  unsigned i;
+  if (!internal_relocs) 
+    return NULL;
+  for (i = 0; i < sec->reloc_count; i++)
+    {
+      Elf_Internal_Rela *irel = &internal_relocs[i];
+      if (irel->r_offset == offset
+         && ELF32_R_TYPE (irel->r_info) != R_XTENSA_NONE)
+       return irel;
     }
-
- error_return:
-  release_internal_relocs (sec, internal_relocs);
-  release_contents (sec, contents);
-  return ok;
+  return NULL;
 }
 
+\f
+/* Second relaxation pass.  */
 
-static bfd_boolean 
-translate_section_fixes (asection *sec)
+/* Modify all of the relocations to point to the right spot, and if this
+   is a relaxable section, delete the unwanted literals and fix the
+   cooked_size.  */
+
+bfd_boolean 
+relax_section (abfd, sec, link_info)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
 {
+  Elf_Internal_Rela *internal_relocs;
   xtensa_relax_info *relax_info;
-  reloc_bfd_fix *r;
+  bfd_byte *contents;
+  bfd_boolean ok = TRUE;
+  unsigned i;
 
   relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
-    return TRUE;
+  BFD_ASSERT (relax_info);
 
-  for (r = relax_info->fix_list; r != NULL; r = r->next)
-    if (!translate_reloc_bfd_fix (r))
-      return FALSE;
+  /* Handle property sections (e.g., literal tables) specially.  */
+  if (xtensa_is_property_section (sec))
+    {
+      BFD_ASSERT (!relax_info->is_relaxable_literal_section);
+      return relax_property_section (abfd, sec, link_info);
+    }
 
-  return TRUE;
-}
+  internal_relocs = retrieve_internal_relocs (abfd, sec, 
+                                             link_info->keep_memory);
+  contents = retrieve_contents (abfd, sec, link_info->keep_memory);
+  if (contents == NULL && sec->size != 0)
+    {
+      ok = FALSE;
+      goto error_return;
+    }
 
+  if (internal_relocs)
+    {
+      for (i = 0; i < sec->reloc_count; i++) 
+       {
+         Elf_Internal_Rela *irel;
+         xtensa_relax_info *target_relax_info;
+         bfd_vma source_offset;
+         r_reloc r_rel;
+         unsigned r_type;
+         asection *target_sec;
 
-/* Translate a fix given the mapping in the relax info for the target
-   section.  If it has already been translated, no work is required.  */
+         /* Locally change the source address.
+            Translate the target to the new target address.
+            If it points to this section and has been removed,
+            NULLify it.
+            Write it back.  */
 
-static bfd_boolean 
-translate_reloc_bfd_fix (reloc_bfd_fix *fix)
-{
-  reloc_bfd_fix new_fix;
-  asection *sec;
-  xtensa_relax_info *relax_info;
-  removed_literal *removed;
-  bfd_vma new_offset, target_offset;
+         irel = &internal_relocs[i];
+         source_offset = irel->r_offset;
 
-  if (fix->translated)
-    return TRUE;
+         r_type = ELF32_R_TYPE (irel->r_info);
+         r_reloc_init (&r_rel, abfd, irel);
+       
+         if (relax_info->is_relaxable_literal_section)
+           {
+             if (r_type != R_XTENSA_NONE
+                 && find_removed_literal (&relax_info->removed_list,
+                                          irel->r_offset))
+               {
+                 /* Remove this relocation.  */
+                 if (elf_hash_table (link_info)->dynamic_sections_created)
+                   shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
+                 irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
+                 irel->r_offset = offset_with_removed_literals
+                   (&relax_info->removed_list, irel->r_offset);
+                 continue;
+               }
+             source_offset =
+               offset_with_removed_literals (&relax_info->removed_list,
+                                             irel->r_offset);
+             irel->r_offset = source_offset;
+           }
 
-  sec = fix->target_sec;
-  target_offset = fix->target_offset;
+         target_sec = r_reloc_get_section (&r_rel);
+         target_relax_info = get_xtensa_relax_info (target_sec);
 
-  relax_info = get_xtensa_relax_info (sec);
-  if (!relax_info)
-    {
-      fix->translated = TRUE;
-      return TRUE;
-    }
+         if (target_relax_info
+             && target_relax_info->is_relaxable_literal_section)
+           {
+             r_reloc new_rel;
+             reloc_bfd_fix *fix;
 
-  new_fix = *fix;
+             translate_reloc (&r_rel, &new_rel);
 
-  /* The fix does not need to be translated if the section cannot change.  */
-  if (!relax_info->is_relaxable_literal_section
-      && !relax_info->is_relaxable_asm_section)
-    {
-      fix->translated = TRUE;
-      return TRUE;
-    }
+             /* FIXME: If the relocation still references a section in
+                the same input file, the relocation should be modified
+                directly instead of adding a "fix" record.  */
 
-  /* If the literal has been moved and this relocation was on an
-     opcode, then the relocation should move to the new literal
-     location.  Otherwise, the relocation should move within the
-     section.  */
+             fix = reloc_bfd_fix_init (sec, source_offset, r_type, 0,
+                                       r_reloc_get_section (&new_rel),
+                                       new_rel.target_offset);
+             add_fix (sec, fix);
+           }
 
-  removed = FALSE;
-  if (is_operand_relocation (fix->src_type))
-    {
-      /* Check if the original relocation is against a literal being
-        removed.  */
-      removed = find_removed_literal (&relax_info->removed_list,
-                                     target_offset);
+         pin_internal_relocs (sec, internal_relocs);
+       }
     }
 
-  if (removed) 
+  if (relax_info->is_relaxable_literal_section)
     {
-      asection *new_sec;
+      /* Walk through the contents and delete literals that are not needed 
+         anymore.  */
 
-      /* The fact that there is still a relocation to this literal indicates
-        that the literal is being coalesced, not simply removed.  */
-      BFD_ASSERT (removed->to.abfd != NULL);
+      unsigned long size = sec->size;
+      unsigned long removed = 0;
 
-      /* This was moved to some other address (possibly another section).  */
-      new_sec = r_reloc_get_section (&removed->to);
-      if (new_sec != sec) 
+      removed_literal *reloc = relax_info->removed_list.head;
+      for (; reloc; reloc = reloc->next) 
        {
-         sec = new_sec;
-         relax_info = get_xtensa_relax_info (sec);
-         if (!relax_info || 
-             (!relax_info->is_relaxable_literal_section
-              && !relax_info->is_relaxable_asm_section))
+         unsigned long upper = sec->size;
+         bfd_vma start = reloc->from.target_offset + 4;
+         if (reloc->next)
+           upper = reloc->next->from.target_offset;
+         if (upper - start != 0) 
            {
-             target_offset = removed->to.target_offset;
-             new_fix.target_sec = new_sec;
-             new_fix.target_offset = target_offset;
-             new_fix.translated = TRUE;
-             *fix = new_fix;
-             return TRUE;
+             BFD_ASSERT (start <= upper);
+             memmove (contents + start - removed - 4,
+                      contents + start,
+                      upper - start );
+             pin_contents (sec, contents);
            }
+         removed += 4;
+         size -= 4;
        }
-      target_offset = removed->to.target_offset;
-      new_fix.target_sec = new_sec;
-    }
 
-  /* The target address may have been moved within its section.  */
-  new_offset = offset_with_removed_text (&relax_info->action_list,
-                                        target_offset);
-
-  new_fix.target_offset = new_offset;
-  new_fix.target_offset = new_offset;
-  new_fix.translated = TRUE;
-  *fix = new_fix;
-  return TRUE;
+      /* Change the section size.  */
+      sec->size = size;
+    }
+  
+ error_return:
+  release_internal_relocs (sec, internal_relocs);
+  release_contents (sec, contents);
+  return ok;
 }
 
 
 /* Fix up a relocation to take account of removed literals.  */
 
 static void
-translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel)
+translate_reloc (orig_rel, new_rel)
+     const r_reloc *orig_rel;
+     r_reloc *new_rel;
 {
   asection *sec;
   xtensa_relax_info *relax_info;
   removed_literal *removed;
-  bfd_vma new_offset, target_offset, removed_bytes;
+  unsigned long new_offset;
 
   *new_rel = *orig_rel;
 
@@ -8257,21 +4835,13 @@ translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel)
   relax_info = get_xtensa_relax_info (sec);
   BFD_ASSERT (relax_info);
 
-  if (!relax_info->is_relaxable_literal_section
-      && !relax_info->is_relaxable_asm_section)
+  if (!relax_info->is_relaxable_literal_section)
     return;
 
-  target_offset = orig_rel->target_offset;
-
-  removed = FALSE;
-  if (is_operand_relocation (ELF32_R_TYPE (orig_rel->rela.r_info)))
-    {
-      /* Check if the original relocation is against a literal being
-        removed.  */
-      removed = find_removed_literal (&relax_info->removed_list,
-                                     target_offset);
-    }
-  if (removed && removed->to.abfd)
+  /* Check if the original relocation is against a literal being removed.  */
+  removed = find_removed_literal (&relax_info->removed_list,
+                                 orig_rel->target_offset);
+  if (removed) 
     {
       asection *new_sec;
 
@@ -8279,30 +4849,25 @@ translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel)
         that the literal is being coalesced, not simply removed.  */
       BFD_ASSERT (removed->to.abfd != NULL);
 
-      /* This was moved to some other address
-        (possibly in another section).  */
+      /* This was moved to some other address (possibly in another section). */
       *new_rel = removed->to;
       new_sec = r_reloc_get_section (new_rel);
-      if (new_sec != sec)
+      if (new_sec != sec) 
        {
          sec = new_sec;
          relax_info = get_xtensa_relax_info (sec);
-         if (!relax_info
-             || (!relax_info->is_relaxable_literal_section
-                 && !relax_info->is_relaxable_asm_section))
+         if (!relax_info || !relax_info->is_relaxable_literal_section)
            return;
        }
-      target_offset = new_rel->target_offset;
     }
 
   /* ...and the target address may have been moved within its section.  */
-  new_offset = offset_with_removed_text (&relax_info->action_list,
-                                        target_offset);
+  new_offset = offset_with_removed_literals (&relax_info->removed_list,
+                                            new_rel->target_offset);
 
   /* Modify the offset and addend.  */
-  removed_bytes = target_offset - new_offset;
   new_rel->target_offset = new_offset;
-  new_rel->rela.r_addend -= removed_bytes;
+  new_rel->rela.r_addend += (new_offset - new_rel->target_offset);
 }
 
 
@@ -8316,10 +4881,11 @@ translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel)
    nothing else that needs to be done.  */
 
 static void
-shrink_dynamic_reloc_sections (struct bfd_link_info *info,
-                              bfd *abfd,
-                              asection *input_section,
-                              Elf_Internal_Rela *rel)
+shrink_dynamic_reloc_sections (info, abfd, input_section, rel)
+     struct bfd_link_info *info;
+     bfd *abfd;
+     asection *input_section;
+     Elf_Internal_Rela *rel;
 {
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
@@ -8411,185 +4977,40 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
 }
 
 
-/* Take an r_rel and move it to another section.  This usually
-   requires extending the interal_relocation array and pinning it.  If
-   the original r_rel is from the same BFD, we can complete this here.
-   Otherwise, we add a fix record to let the final link fix the
-   appropriate address.  Contents and internal relocations for the
-   section must be pinned after calling this routine.  */
-
-static bfd_boolean
-move_literal (bfd *abfd,
-             struct bfd_link_info *link_info,
-             asection *sec,
-             bfd_vma offset,
-             bfd_byte *contents,
-             xtensa_relax_info *relax_info,
-             Elf_Internal_Rela **internal_relocs_p,
-             const literal_value *lit)
-{
-  Elf_Internal_Rela *new_relocs = NULL;
-  size_t new_relocs_count = 0;
-  Elf_Internal_Rela this_rela;
-  const r_reloc *r_rel;
-
-  r_rel = &lit->r_rel;
-  BFD_ASSERT (elf_section_data (sec)->relocs == *internal_relocs_p);
-
-  if (r_reloc_is_const (r_rel))
-    bfd_put_32 (abfd, lit->value, contents + offset);
-  else
-    {
-      int r_type;
-      unsigned i;
-      asection *target_sec;
-      reloc_bfd_fix *fix;
-      unsigned insert_at;
-
-      r_type = ELF32_R_TYPE (r_rel->rela.r_info);
-      target_sec = r_reloc_get_section (r_rel);
-
-      /* This is the difficult case.  We have to create a fix up.  */
-      this_rela.r_offset = offset;
-      this_rela.r_info = ELF32_R_INFO (0, r_type);
-      this_rela.r_addend =
-       r_rel->target_offset - r_reloc_get_target_offset (r_rel);
-      bfd_put_32 (abfd, lit->value, contents + offset);
-
-      /* Currently, we cannot move relocations during a relocatable link.  */
-      BFD_ASSERT (!link_info->relocatable);
-      fix = reloc_bfd_fix_init (sec, offset, r_type, r_rel->abfd,
-                               r_reloc_get_section (r_rel),
-                               r_rel->target_offset + r_rel->virtual_offset,
-                               FALSE);
-      /* We also need to mark that relocations are needed here.  */
-      sec->flags |= SEC_RELOC;
-
-      translate_reloc_bfd_fix (fix);
-      /* This fix has not yet been translated.  */
-      add_fix (sec, fix);
-
-      /* Add the relocation.  If we have already allocated our own
-        space for the relocations and we have room for more, then use
-        it.  Otherwise, allocate new space and move the literals.  */
-      insert_at = sec->reloc_count;
-      for (i = 0; i < sec->reloc_count; ++i)
-       {
-         if (this_rela.r_offset < (*internal_relocs_p)[i].r_offset)
-           {
-             insert_at = i;
-             break;
-           }
-       }
-
-      if (*internal_relocs_p != relax_info->allocated_relocs
-         || sec->reloc_count + 1 > relax_info->allocated_relocs_count)
-       {
-         BFD_ASSERT (relax_info->allocated_relocs == NULL
-                     || sec->reloc_count == relax_info->relocs_count);
-
-         if (relax_info->allocated_relocs_count == 0) 
-           new_relocs_count = (sec->reloc_count + 2) * 2;
-         else
-           new_relocs_count = (relax_info->allocated_relocs_count + 2) * 2;
-
-         new_relocs = (Elf_Internal_Rela *)
-           bfd_zmalloc (sizeof (Elf_Internal_Rela) * (new_relocs_count));
-         if (!new_relocs)
-           return FALSE;
-
-         /* We could handle this more quickly by finding the split point.  */
-         if (insert_at != 0)
-           memcpy (new_relocs, *internal_relocs_p,
-                   insert_at * sizeof (Elf_Internal_Rela));
-
-         new_relocs[insert_at] = this_rela;
-
-         if (insert_at != sec->reloc_count)
-           memcpy (new_relocs + insert_at + 1,
-                   (*internal_relocs_p) + insert_at,
-                   (sec->reloc_count - insert_at) 
-                   * sizeof (Elf_Internal_Rela));
-
-         if (*internal_relocs_p != relax_info->allocated_relocs)
-           {
-             /* The first time we re-allocate, we can only free the
-                old relocs if they were allocated with bfd_malloc.
-                This is not true when keep_memory is in effect.  */
-             if (!link_info->keep_memory)
-               free (*internal_relocs_p);
-           }
-         else
-           free (*internal_relocs_p);
-         relax_info->allocated_relocs = new_relocs;
-         relax_info->allocated_relocs_count = new_relocs_count;
-         elf_section_data (sec)->relocs = new_relocs;
-         sec->reloc_count++;
-         relax_info->relocs_count = sec->reloc_count;
-         *internal_relocs_p = new_relocs;
-       }
-      else
-       {
-         if (insert_at != sec->reloc_count)
-           {
-             unsigned idx;
-             for (idx = sec->reloc_count; idx > insert_at; idx--)
-               (*internal_relocs_p)[idx] = (*internal_relocs_p)[idx-1];
-           }
-         (*internal_relocs_p)[insert_at] = this_rela;
-         sec->reloc_count++;
-         if (relax_info->allocated_relocs)
-           relax_info->relocs_count = sec->reloc_count;
-       }
-    }
-  return TRUE;
-}
-
-
 /* This is similar to relax_section except that when a target is moved,
    we shift addresses up.  We also need to modify the size.  This
    algorithm does NOT allow for relocations into the middle of the
    property sections.  */
 
-static bfd_boolean
-relax_property_section (bfd *abfd,
-                       asection *sec,
-                       struct bfd_link_info *link_info)
+static bfd_boolean 
+relax_property_section (abfd, sec, link_info)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
 {
   Elf_Internal_Rela *internal_relocs;
   bfd_byte *contents;
   unsigned i, nexti;
   bfd_boolean ok = TRUE;
-  bfd_boolean is_full_prop_section;
-  size_t last_zfill_target_offset = 0;
-  asection *last_zfill_target_sec = NULL;
-  bfd_size_type sec_size;
 
-  sec_size = bfd_get_section_limit (abfd, sec);
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
                                              link_info->keep_memory);
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
     }
 
-  is_full_prop_section =
-    ((strcmp (sec->name, XTENSA_PROP_SEC_NAME) == 0)
-     || (strncmp (sec->name, ".gnu.linkonce.prop.",
-                 sizeof ".gnu.linkonce.prop." - 1) == 0));
-
-  if (internal_relocs)
+  if (internal_relocs) 
     {
-      for (i = 0; i < sec->reloc_count; i++)
+      for (i = 0; i < sec->reloc_count; i++) 
        {
          Elf_Internal_Rela *irel;
          xtensa_relax_info *target_relax_info;
+         r_reloc r_rel;
          unsigned r_type;
          asection *target_sec;
-         literal_value val;
-         bfd_byte *size_p, *flags_p;
 
          /* Locally change the source address.
             Translate the target to the new target address.
@@ -8602,88 +5023,42 @@ relax_property_section (bfd *abfd,
          if (r_type == R_XTENSA_NONE)
            continue;
 
-         /* Find the literal value.  */
-         r_reloc_init (&val.r_rel, abfd, irel, contents, sec_size);
-         size_p = &contents[irel->r_offset + 4];
-         flags_p = NULL;
-         if (is_full_prop_section)
-           {
-             flags_p = &contents[irel->r_offset + 8];
-             BFD_ASSERT (irel->r_offset + 12 <= sec_size);
-           }
-         else
-           BFD_ASSERT (irel->r_offset + 8 <= sec_size);
+         r_reloc_init (&r_rel, abfd, irel);
 
-         target_sec = r_reloc_get_section (&val.r_rel);
+         target_sec = r_reloc_get_section (&r_rel);
          target_relax_info = get_xtensa_relax_info (target_sec);
 
          if (target_relax_info
-             && (target_relax_info->is_relaxable_literal_section
-                 || target_relax_info->is_relaxable_asm_section ))
+             && target_relax_info->is_relaxable_literal_section)
            {
              /* Translate the relocation's destination.  */
-             bfd_vma new_offset, new_end_offset;
+             bfd_vma new_offset;
+             bfd_vma new_end_offset;
+             bfd_byte *size_p;
              long old_size, new_size;
 
-             new_offset = offset_with_removed_text
-               (&target_relax_info->action_list, val.r_rel.target_offset);
+             new_offset =
+               offset_with_removed_literals (&target_relax_info->removed_list,
+                                             r_rel.target_offset);
 
              /* Assert that we are not out of bounds.  */
-             old_size = bfd_get_32 (abfd, size_p);
-
-             if (old_size == 0)
-               {
-                 /* Only the first zero-sized unreachable entry is
-                    allowed to expand.  In this case the new offset
-                    should be the offset before the fill and the new
-                    size is the expansion size.  For other zero-sized
-                    entries the resulting size should be zero with an
-                    offset before or after the fill address depending
-                    on whether the expanding unreachable entry
-                    preceeds it.  */
-                 if (last_zfill_target_sec
-                     && last_zfill_target_sec == target_sec
-                     && last_zfill_target_offset == val.r_rel.target_offset)
-                   new_end_offset = new_offset;
-                 else
-                   {
-                     new_end_offset = new_offset;
-                     new_offset = offset_with_removed_text_before_fill
-                       (&target_relax_info->action_list,
-                        val.r_rel.target_offset);
-
-                     /* If it is not unreachable and we have not yet
-                        seen an unreachable at this address, place it
-                        before the fill address.  */
-                     if (!flags_p
-                         || (bfd_get_32 (abfd, flags_p)
-                             & XTENSA_PROP_UNREACHABLE) == 0)
-                       new_end_offset = new_offset;
-                     else
-                       {
-                         last_zfill_target_sec = target_sec;
-                         last_zfill_target_offset = val.r_rel.target_offset;
-                       }
-                   }
-               }
-             else
-               {
-                 new_end_offset = offset_with_removed_text_before_fill
-                   (&target_relax_info->action_list,
-                    val.r_rel.target_offset + old_size);
-               }
+             size_p = &contents[irel->r_offset + 4];
+             old_size = bfd_get_32 (abfd, &contents[irel->r_offset + 4]);
 
+             new_end_offset =
+               offset_with_removed_literals (&target_relax_info->removed_list,
+                                             r_rel.target_offset + old_size);
+             
              new_size = new_end_offset - new_offset;
-
              if (new_size != old_size)
                {
                  bfd_put_32 (abfd, new_size, size_p);
                  pin_contents (sec, contents);
                }
-
-             if (new_offset != val.r_rel.target_offset)
+             
+             if (new_offset != r_rel.target_offset)
                {
-                 bfd_vma diff = new_offset - val.r_rel.target_offset;
+                 bfd_vma diff = new_offset - r_rel.target_offset;
                  irel->r_addend += diff;
                  pin_internal_relocs (sec, internal_relocs);
                }
@@ -8695,22 +5070,12 @@ relax_property_section (bfd *abfd,
      finish_dynamic_sections() but at that point it's too late to
      reclaim the space in the output section, so we do this twice.  */
 
-  if (internal_relocs && (!link_info->relocatable
-                         || strcmp (sec->name, XTENSA_LIT_SEC_NAME) == 0))
+  if (internal_relocs)
     {
       Elf_Internal_Rela *last_irel = NULL;
       int removed_bytes = 0;
       bfd_vma offset, last_irel_offset;
       bfd_vma section_size;
-      bfd_size_type entry_size;
-      flagword predef_flags;
-
-      if (is_full_prop_section)
-       entry_size = 12;
-      else
-       entry_size = 8;
-
-      predef_flags = xtensa_get_property_predef_flags (sec);
 
       /* Walk over memory and irels at the same time.
          This REQUIRES that the internal_relocs be sorted by offset.  */
@@ -8723,14 +5088,13 @@ relax_property_section (bfd *abfd,
 
       last_irel_offset = (bfd_vma) -1;
       section_size = sec->size;
-      BFD_ASSERT (section_size % entry_size == 0);
+      BFD_ASSERT (section_size % 8 == 0);
 
-      for (offset = 0; offset < section_size; offset += entry_size)
+      for (offset = 0; offset < section_size; offset += 8)
        {
          Elf_Internal_Rela *irel, *next_irel;
          bfd_vma bytes_to_remove, size, actual_offset;
          bfd_boolean remove_this_irel;
-         flagword flags;
 
          irel = NULL;
          next_irel = NULL;
@@ -8768,38 +5132,28 @@ relax_property_section (bfd *abfd,
          actual_offset = offset - removed_bytes;
          size = bfd_get_32 (abfd, &contents[actual_offset + 4]);
 
-         if (is_full_prop_section) 
-           flags = bfd_get_32 (abfd, &contents[actual_offset + 8]);
-         else
-           flags = predef_flags;
-
          /* Check that the irels are sorted by offset,
             with only one per address.  */
          BFD_ASSERT (!irel || (int) irel->r_offset > (int) last_irel_offset); 
          BFD_ASSERT (!next_irel || next_irel->r_offset > irel->r_offset);
 
-         /* Make sure there aren't relocs on the size or flag fields.  */
-         if ((irel && irel->r_offset == offset + 4)
-             || (is_full_prop_section 
-                 && irel && irel->r_offset == offset + 8))
+         /* Make sure there isn't a reloc on the size field.  */
+         if (irel && irel->r_offset == offset + 4)
            {
              irel->r_offset -= removed_bytes;
              last_irel_offset = irel->r_offset;
            }
-         else if (next_irel && (next_irel->r_offset == offset + 4
-                                || (is_full_prop_section 
-                                    && next_irel->r_offset == offset + 8)))
+         else if (next_irel && next_irel->r_offset == offset + 4)
            {
              nexti += 1;
              irel->r_offset -= removed_bytes;
              next_irel->r_offset -= removed_bytes;
              last_irel_offset = next_irel->r_offset;
            }
-         else if (size == 0 && (flags & XTENSA_PROP_ALIGN) == 0
-                  && (flags & XTENSA_PROP_UNREACHABLE) == 0)
+         else if (size == 0)
            {
-             /* Always remove entries with zero size and no alignment.  */
-             bytes_to_remove = entry_size;
+             /* Always remove entries with zero size.  */
+             bytes_to_remove = 8;
              if (irel && irel->r_offset == offset)
                {
                  remove_this_irel = TRUE;
@@ -8814,32 +5168,23 @@ relax_property_section (bfd *abfd,
                {
                  if (last_irel)
                    {
-                     flagword old_flags;
-                     bfd_vma old_size =
+                     bfd_vma old_size = 
                        bfd_get_32 (abfd, &contents[last_irel->r_offset + 4]);
-                     bfd_vma old_address =
-                       (last_irel->r_addend
+                     bfd_vma old_address = 
+                       (last_irel->r_addend 
                         + bfd_get_32 (abfd, &contents[last_irel->r_offset]));
-                     bfd_vma new_address =
-                       (irel->r_addend
+                     bfd_vma new_address = 
+                       (irel->r_addend 
                         + bfd_get_32 (abfd, &contents[actual_offset]));
-                     if (is_full_prop_section) 
-                       old_flags = bfd_get_32
-                         (abfd, &contents[last_irel->r_offset + 8]);
-                     else
-                       old_flags = predef_flags;
-
-                     if ((ELF32_R_SYM (irel->r_info)
-                          == ELF32_R_SYM (last_irel->r_info))
-                         && old_address + old_size == new_address
-                         && old_flags == flags
-                         && (old_flags & XTENSA_PROP_INSN_BRANCH_TARGET) == 0
-                         && (old_flags & XTENSA_PROP_INSN_LOOP_TARGET) == 0)
+
+                     if ((ELF32_R_SYM (irel->r_info) ==
+                          ELF32_R_SYM (last_irel->r_info))
+                         && (old_address + old_size == new_address)) 
                        {
-                         /* Fix the old size.  */
+                         /* fix the old size */
                          bfd_put_32 (abfd, old_size + size,
                                      &contents[last_irel->r_offset + 4]);
-                         bytes_to_remove = entry_size;
+                         bytes_to_remove = 8;
                          remove_this_irel = TRUE;
                        }
                      else
@@ -8862,14 +5207,14 @@ relax_property_section (bfd *abfd,
          if (bytes_to_remove != 0)
            {
              removed_bytes += bytes_to_remove;
-             if (offset + bytes_to_remove < section_size)
+             if (offset + 8 < section_size)
                memmove (&contents[actual_offset],
-                        &contents[actual_offset + bytes_to_remove],
-                        section_size - offset - bytes_to_remove);
+                        &contents[actual_offset+8],
+                        section_size - offset - 8);
            }
        }
 
-      if (removed_bytes)
+      if (removed_bytes) 
        {
          /* Clear the removed bytes.  */
          memset (&contents[section_size - removed_bytes], 0, removed_bytes);
@@ -8901,8 +5246,10 @@ relax_property_section (bfd *abfd,
 
 /* Change symbol values to account for removed literals.  */
 
-bfd_boolean
-relax_section_symbols (bfd *abfd, asection *sec)
+bfd_boolean 
+relax_section_symbols (abfd, sec)
+     bfd *abfd;
+     asection *sec;
 {
   xtensa_relax_info *relax_info;
   unsigned int sec_shndx;
@@ -8913,8 +5260,7 @@ relax_section_symbols (bfd *abfd, asection *sec)
   relax_info = get_xtensa_relax_info (sec);
   BFD_ASSERT (relax_info);
 
-  if (!relax_info->is_relaxable_literal_section
-      && !relax_info->is_relaxable_asm_section)
+  if (!relax_info->is_relaxable_literal_section)
     return TRUE;
 
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@@ -8932,19 +5278,10 @@ relax_section_symbols (bfd *abfd, asection *sec)
 
       if (isym->st_shndx == sec_shndx)
        {
-         bfd_vma new_address = offset_with_removed_text
-           (&relax_info->action_list, isym->st_value);
-         bfd_vma new_size = isym->st_size;
-
-         if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC)
-           {
-             bfd_vma new_end = offset_with_removed_text
-               (&relax_info->action_list, isym->st_value + isym->st_size);
-             new_size = new_end - new_address;
-           }
-
-         isym->st_value = new_address;
-         isym->st_size = new_size;
+         bfd_vma new_address = offset_with_removed_literals
+           (&relax_info->removed_list, isym->st_value);
+         if (new_address != isym->st_value)
+           isym->st_value = new_address;
        }
     }
 
@@ -8962,20 +5299,10 @@ relax_section_symbols (bfd *abfd, asection *sec)
           || sym_hash->root.type == bfd_link_hash_defweak)
          && sym_hash->root.u.def.section == sec)
        {
-         bfd_vma new_address = offset_with_removed_text
-           (&relax_info->action_list, sym_hash->root.u.def.value);
-         bfd_vma new_size = sym_hash->size;
-
-         if (sym_hash->type == STT_FUNC)
-           {
-             bfd_vma new_end = offset_with_removed_text
-               (&relax_info->action_list,
-                sym_hash->root.u.def.value + sym_hash->size);
-             new_size = new_end - new_address;
-           }
-
-         sym_hash->root.u.def.value = new_address;
-         sym_hash->size = new_size;
+         bfd_vma new_address = offset_with_removed_literals
+           (&relax_info->removed_list, sym_hash->root.u.def.value);
+         if (new_address != sym_hash->root.u.def.value)
+           sym_hash->root.u.def.value = new_address;
        }
     }
 
@@ -8985,40 +5312,37 @@ relax_section_symbols (bfd *abfd, asection *sec)
 \f
 /* "Fix" handling functions, called while performing relocations.  */
 
-static bfd_boolean
-do_fix_for_relocatable_link (Elf_Internal_Rela *rel,
-                            bfd *input_bfd,
-                            asection *input_section,
-                            bfd_byte *contents)
+static void
+do_fix_for_relocatable_link (rel, input_bfd, input_section)
+     Elf_Internal_Rela *rel;
+     bfd *input_bfd;
+     asection *input_section;
 {
   r_reloc r_rel;
   asection *sec, *old_sec;
   bfd_vma old_offset;
   int r_type = ELF32_R_TYPE (rel->r_info);
+  reloc_bfd_fix *fix_list;
   reloc_bfd_fix *fix;
 
   if (r_type == R_XTENSA_NONE)
-    return TRUE;
+    return;
 
-  fix = get_bfd_fix (input_section, rel->r_offset, r_type);
-  if (!fix)
-    return TRUE;
+  fix_list = (get_xtensa_relax_info (input_section))->fix_list;
+  if (fix_list == NULL)
+    return;
 
-  r_reloc_init (&r_rel, input_bfd, rel, contents,
-               bfd_get_section_limit (input_bfd, input_section));
-  old_sec = r_reloc_get_section (&r_rel);
-  old_offset = r_rel.target_offset;
+  fix = get_bfd_fix (fix_list, input_section, rel->r_offset, r_type);
+  if (fix == NULL)
+    return;
 
-  if (!old_sec || !r_reloc_is_defined (&r_rel))
+  r_reloc_init (&r_rel, input_bfd, rel);
+  old_sec = r_reloc_get_section (&r_rel);
+  old_offset = r_reloc_get_target_offset (&r_rel);
+             
+  if (old_sec == NULL || !r_reloc_is_defined (&r_rel))
     {
-      if (r_type != R_XTENSA_ASM_EXPAND)
-       {
-         (*_bfd_error_handler)
-           (_("%B(%A+0x%lx): unexpected fix for %s relocation"),
-            input_bfd, input_section, rel->r_offset,
-            elf_howto_table[r_type].name);
-         return FALSE;
-       }
+      BFD_ASSERT (r_type == R_XTENSA_ASM_EXPAND);
       /* Leave it be.  Resolution will happen in a later stage.  */
     }
   else
@@ -9027,51 +5351,44 @@ do_fix_for_relocatable_link (Elf_Internal_Rela *rel,
       rel->r_addend += ((sec->output_offset + fix->target_offset)
                        - (old_sec->output_offset + old_offset));
     }
-  return TRUE;
 }
 
 
 static void
-do_fix_for_final_link (Elf_Internal_Rela *rel,
-                      bfd *input_bfd,
-                      asection *input_section,
-                      bfd_byte *contents,
-                      bfd_vma *relocationp)
+do_fix_for_final_link (rel, input_section, relocationp)
+     Elf_Internal_Rela *rel;
+     asection *input_section;
+     bfd_vma *relocationp;
 {
   asection *sec;
   int r_type = ELF32_R_TYPE (rel->r_info);
+  reloc_bfd_fix *fix_list;
   reloc_bfd_fix *fix;
-  bfd_vma fixup_diff;
 
   if (r_type == R_XTENSA_NONE)
     return;
 
-  fix = get_bfd_fix (input_section, rel->r_offset, r_type);
-  if (!fix)
+  fix_list = (get_xtensa_relax_info (input_section))->fix_list;
+  if (fix_list == NULL)
     return;
 
-  sec = fix->target_sec;
-
-  fixup_diff = rel->r_addend;
-  if (elf_howto_table[fix->src_type].partial_inplace)
-    {
-      bfd_vma inplace_val;
-      BFD_ASSERT (fix->src_offset
-                 < bfd_get_section_limit (input_bfd, input_section));
-      inplace_val = bfd_get_32 (input_bfd, &contents[fix->src_offset]);
-      fixup_diff += inplace_val;
-    }
+  fix = get_bfd_fix (fix_list, input_section, rel->r_offset, r_type);
+  if (fix == NULL)
+    return;
 
+  sec = fix->target_sec;
   *relocationp = (sec->output_section->vma
                  + sec->output_offset
-                 + fix->target_offset - fixup_diff);
+                 + fix->target_offset - rel->r_addend);
 }
 
 \f
 /* Miscellaneous utility functions....  */
 
 static asection *
-elf_xtensa_get_plt_section (bfd *dynobj, int chunk)
+elf_xtensa_get_plt_section (dynobj, chunk)
+     bfd *dynobj;
+     int chunk;
 {
   char plt_name[10];
 
@@ -9084,7 +5401,9 @@ elf_xtensa_get_plt_section (bfd *dynobj, int chunk)
 
 
 static asection *
-elf_xtensa_get_gotplt_section (bfd *dynobj, int chunk)
+elf_xtensa_get_gotplt_section (dynobj, chunk)
+     bfd *dynobj;
+     int chunk;
 {
   char got_name[14];
 
@@ -9105,11 +5424,13 @@ elf_xtensa_get_gotplt_section (bfd *dynobj, int chunk)
    . an absolute value, return the absolute section.  */
 
 static asection *
-get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
+get_elf_r_symndx_section (abfd, r_symndx)
+     bfd *abfd;
+     unsigned long r_symndx;
 {
   Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   asection *target_sec = NULL;
-  if (r_symndx < symtab_hdr->sh_info)
+  if (r_symndx < symtab_hdr->sh_info) 
     {
       Elf_Internal_Sym *isymbuf;
       unsigned int section_index;
@@ -9125,7 +5446,7 @@ get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
        target_sec = bfd_abs_section_ptr;
       else if (section_index == SHN_COMMON)
        target_sec = bfd_com_section_ptr;
-      else
+      else 
        /* Who knows?  */
        target_sec = NULL;
     }
@@ -9161,7 +5482,9 @@ get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
 
 
 static struct elf_link_hash_entry *
-get_elf_r_symndx_hash_entry (bfd *abfd, unsigned long r_symndx)
+get_elf_r_symndx_hash_entry (abfd, r_symndx)
+     bfd *abfd;
+     unsigned long r_symndx;
 {
   unsigned long indx;
   struct elf_link_hash_entry *h;
@@ -9169,7 +5492,7 @@ get_elf_r_symndx_hash_entry (bfd *abfd, unsigned long r_symndx)
 
   if (r_symndx < symtab_hdr->sh_info)
     return NULL;
-
+  
   indx = r_symndx - symtab_hdr->sh_info;
   h = elf_sym_hashes (abfd)[indx];
   while (h->root.type == bfd_link_hash_indirect
@@ -9182,12 +5505,14 @@ get_elf_r_symndx_hash_entry (bfd *abfd, unsigned long r_symndx)
 /* Get the section-relative offset for a symbol number.  */
 
 static bfd_vma
-get_elf_r_symndx_offset (bfd *abfd, unsigned long r_symndx)
+get_elf_r_symndx_offset (abfd, r_symndx)
+     bfd *abfd;
+     unsigned long r_symndx;
 {
   Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   bfd_vma offset = 0;
 
-  if (r_symndx < symtab_hdr->sh_info)
+  if (r_symndx < symtab_hdr->sh_info) 
     {
       Elf_Internal_Sym *isymbuf;
       isymbuf = retrieve_local_syms (abfd);
@@ -9211,51 +5536,35 @@ get_elf_r_symndx_offset (bfd *abfd, unsigned long r_symndx)
 
 
 static bfd_boolean
-is_reloc_sym_weak (bfd *abfd, Elf_Internal_Rela *rel)
-{
-  unsigned long r_symndx = ELF32_R_SYM (rel->r_info);
-  struct elf_link_hash_entry *h;
-
-  h = get_elf_r_symndx_hash_entry (abfd, r_symndx);
-  if (h && h->root.type == bfd_link_hash_defweak)
-    return TRUE;
-  return FALSE;
-}
-
-
-static bfd_boolean
-pcrel_reloc_fits (xtensa_opcode opc,
-                 int opnd,
-                 bfd_vma self_address,
-                 bfd_vma dest_address)
+pcrel_reloc_fits (opnd, self_address, dest_address)
+     xtensa_operand opnd;
+     bfd_vma self_address;
+     bfd_vma dest_address;
 {
-  xtensa_isa isa = xtensa_default_isa;
-  uint32 valp = dest_address;
-  if (xtensa_operand_do_reloc (isa, opc, opnd, &valp, self_address)
-      || xtensa_operand_encode (isa, opc, opnd, &valp))
-    return FALSE;
-  return TRUE;
+  uint32 new_address =
+    xtensa_operand_do_reloc (opnd, dest_address, self_address);
+  return (xtensa_operand_encode (opnd, &new_address)
+         == xtensa_encode_result_ok);
 }
 
 
 static int linkonce_len = sizeof (".gnu.linkonce.") - 1;
 static int insn_sec_len = sizeof (XTENSA_INSN_SEC_NAME) - 1;
 static int lit_sec_len = sizeof (XTENSA_LIT_SEC_NAME) - 1;
-static int prop_sec_len = sizeof (XTENSA_PROP_SEC_NAME) - 1;
 
 
 static bfd_boolean 
-xtensa_is_property_section (asection *sec)
+xtensa_is_property_section (sec)
+     asection *sec;
 {
   if (strncmp (XTENSA_INSN_SEC_NAME, sec->name, insn_sec_len) == 0
-      || strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0
-      || strncmp (XTENSA_PROP_SEC_NAME, sec->name, prop_sec_len) == 0)
+      || strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0)
     return TRUE;
 
   if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0
-      && (strncmp (&sec->name[linkonce_len], "x.", 2) == 0
-         || strncmp (&sec->name[linkonce_len], "p.", 2) == 0
-         || strncmp (&sec->name[linkonce_len], "prop.", 5) == 0))
+      && (sec->name[linkonce_len] == 'x'
+         || sec->name[linkonce_len] == 'p')
+      && sec->name[linkonce_len + 1] == '.')
     return TRUE;
 
   return FALSE;
@@ -9263,7 +5572,8 @@ xtensa_is_property_section (asection *sec)
 
 
 static bfd_boolean 
-xtensa_is_littable_section (asection *sec)
+xtensa_is_littable_section (sec)
+     asection *sec;
 {
   if (strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0)
     return TRUE;
@@ -9277,70 +5587,58 @@ xtensa_is_littable_section (asection *sec)
 }
 
 
-static int
-internal_reloc_compare (const void *ap, const void *bp)
+static bfd_boolean
+is_literal_section (sec)
+     asection *sec;
 {
-  const Elf_Internal_Rela *a = (const Elf_Internal_Rela *) ap;
-  const Elf_Internal_Rela *b = (const Elf_Internal_Rela *) bp;
-
-  if (a->r_offset != b->r_offset)
-    return (a->r_offset - b->r_offset);
-
-  /* We don't need to sort on these criteria for correctness,
-     but enforcing a more strict ordering prevents unstable qsort
-     from behaving differently with different implementations.
-     Without the code below we get correct but different results
-     on Solaris 2.7 and 2.8.  We would like to always produce the
-     same results no matter the host.  */
-
-  if (a->r_info != b->r_info)
-    return (a->r_info - b->r_info);
-
-  return (a->r_addend - b->r_addend);
+  /* FIXME: the current definition of this leaves a lot to be desired....  */
+  if (sec == NULL || sec->name == NULL)
+    return FALSE;
+  return (strstr (sec->name, "literal") != NULL);
 }
 
 
 static int
-internal_reloc_matches (const void *ap, const void *bp)
+internal_reloc_compare (ap, bp)
+     const PTR ap;
+     const PTR bp;
 {
   const Elf_Internal_Rela *a = (const Elf_Internal_Rela *) ap;
   const Elf_Internal_Rela *b = (const Elf_Internal_Rela *) bp;
 
-  /* Check if one entry overlaps with the other; this shouldn't happen
-     except when searching for a match.  */
   return (a->r_offset - b->r_offset);
 }
 
 
 char *
-xtensa_get_property_section_name (asection *sec, const char *base_name)
+xtensa_get_property_section_name (sec, base_name)
+     asection *sec;
+     const char *base_name;
 {
   if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0)
     {
       char *prop_sec_name;
       const char *suffix;
-      char *linkonce_kind = 0;
+      char linkonce_kind = 0;
 
       if (strcmp (base_name, XTENSA_INSN_SEC_NAME) == 0) 
-       linkonce_kind = "x";
+       linkonce_kind = 'x';
       else if (strcmp (base_name, XTENSA_LIT_SEC_NAME) == 0) 
-       linkonce_kind = "p";
-      else if (strcmp (base_name, XTENSA_PROP_SEC_NAME) == 0)
-       linkonce_kind = "prop.";
+       linkonce_kind = 'p';
       else
        abort ();
 
-      prop_sec_name = (char *) bfd_malloc (strlen (sec->name)
-                                          + strlen (linkonce_kind) + 1);
+      prop_sec_name = (char *) bfd_malloc (strlen (sec->name) + 1);
       memcpy (prop_sec_name, ".gnu.linkonce.", linkonce_len);
-      strcpy (prop_sec_name + linkonce_len, linkonce_kind);
+      prop_sec_name[linkonce_len] = linkonce_kind;
+      prop_sec_name[linkonce_len + 1] = '.';
 
       suffix = sec->name + linkonce_len;
       /* For backward compatibility, replace "t." instead of inserting
-         the new linkonce_kind (but not for "prop" sections).  */
-      if (strncmp (suffix, "t.", 2) == 0 && linkonce_kind[1] == '.')
-        suffix += 2;
-      strcat (prop_sec_name + linkonce_len, suffix);
+        the new linkonce_kind.  */
+      if (strncmp (suffix, "t.", 2) == 0)
+       suffix += 2;
+      strcpy (prop_sec_name + linkonce_len + 2, suffix);
 
       return prop_sec_name;
     }
@@ -9348,42 +5646,21 @@ xtensa_get_property_section_name (asection *sec, const char *base_name)
   return strdup (base_name);
 }
 
-
-flagword
-xtensa_get_property_predef_flags (asection *sec)
-{
-  if (strcmp (sec->name, XTENSA_INSN_SEC_NAME) == 0
-      || strncmp (sec->name, ".gnu.linkonce.x.",
-                 sizeof ".gnu.linkonce.x." - 1) == 0)
-    return (XTENSA_PROP_INSN
-           | XTENSA_PROP_INSN_NO_TRANSFORM
-           | XTENSA_PROP_INSN_NO_REORDER);
-
-  if (xtensa_is_littable_section (sec))
-    return (XTENSA_PROP_LITERAL
-           | XTENSA_PROP_INSN_NO_TRANSFORM
-           | XTENSA_PROP_INSN_NO_REORDER);
-
-  return 0;
-}
-
 \f
 /* Other functions called directly by the linker.  */
 
 bfd_boolean
-xtensa_callback_required_dependence (bfd *abfd,
-                                    asection *sec,
-                                    struct bfd_link_info *link_info,
-                                    deps_callback_t callback,
-                                    void *closure)
+xtensa_callback_required_dependence (abfd, sec, link_info, callback, closure)
+     bfd *abfd;
+     asection *sec;
+     struct bfd_link_info *link_info;
+     deps_callback_t callback;
+     PTR closure;
 {
   Elf_Internal_Rela *internal_relocs;
   bfd_byte *contents;
   unsigned i;
   bfd_boolean ok = TRUE;
-  bfd_size_type sec_size;
-
-  sec_size = bfd_get_section_limit (abfd, sec);
 
   /* ".plt*" sections have no explicit relocations but they contain L32R
      instructions that reference the corresponding ".got.plt*" sections.  */
@@ -9411,43 +5688,43 @@ xtensa_callback_required_dependence (bfd *abfd,
       /* 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_size, sgotplt, 0, closure);
+      (*callback) (sec, sec->size, sgotplt, 0, closure);
     }
 
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
                                              link_info->keep_memory);
   if (internal_relocs == NULL
-      || sec->reloc_count == 0)
+      || sec->reloc_count == 0) 
     return ok;
 
   /* Cache the contents for the duration of this scan.  */
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
     }
 
-  if (!xtensa_default_isa)
-    xtensa_default_isa = xtensa_isa_init (0, 0);
+  if (xtensa_default_isa == NULL)
+    xtensa_isa_init ();
 
-  for (i = 0; i < sec->reloc_count; i++)
+  for (i = 0; i < sec->reloc_count; i++) 
     {
       Elf_Internal_Rela *irel = &internal_relocs[i];
-      if (is_l32r_relocation (abfd, sec, contents, irel))
+      if (is_l32r_relocation (sec, contents, irel))
        {
          r_reloc l32r_rel;
          asection *target_sec;
          bfd_vma target_offset;
-
-         r_reloc_init (&l32r_rel, abfd, irel, contents, sec_size);
+         
+         r_reloc_init (&l32r_rel, abfd, irel);
          target_sec = NULL;
          target_offset = 0;
          /* L32Rs must be local to the input file.  */
          if (r_reloc_is_defined (&l32r_rel))
            {
              target_sec = r_reloc_get_section (&l32r_rel);
-             target_offset = l32r_rel.target_offset;
+             target_offset = r_reloc_get_target_offset (&l32r_rel);
            }
          (*callback) (sec, irel->r_offset, target_sec, target_offset,
                       closure);
@@ -9484,7 +5761,7 @@ static struct bfd_elf_special_section const elf_xtensa_special_sections[]=
    value so that pre-T1040 tools can read the files.  As soon as we stop
    caring about pre-T1040 tools, the following two values should be
    swapped. At the same time, any other code that uses EM_XTENSA_OLD
-   should be changed to use EM_XTENSA.  */
+   (e.g., prep_headers() in elf.c) should be changed to use EM_XTENSA.  */
 #define ELF_MACHINE_CODE               EM_XTENSA_OLD
 #define ELF_MACHINE_ALT1               EM_XTENSA
 
index 648061265173a523c79583a7088b27354a356bfc..a1f4e03cfb5235a75008c05ccf221e14dfac440b 100644 (file)
@@ -2111,7 +2111,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
 
          /* If the symbol isn't defined in the current module, again
             we can't do anything.  */
-         if (!h->root.def_regular)
+         if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
            {
              /* Except for TLSGD relocs, which can sometimes be
                 relaxed to GOTTPREL relocs.  */
@@ -2450,7 +2450,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
          get_elf_backend_data (abfd)->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   if (info->shared
@@ -2494,7 +2494,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
         FALSE, get_elf_backend_data (abfd)->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   if (info->shared
@@ -2741,9 +2741,10 @@ elf64_alpha_output_extsym (h, data)
 
   if (h->root.indx == -2)
     strip = FALSE;
-  else if ((h->root.def_dynamic || h->root.ref_dynamic)
-          && !h->root.def_regular
-          && !h->root.ref_regular)
+  else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+           || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+          && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+          && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
     strip = TRUE;
   else if (einfo->info->strip == strip_all
           || (einfo->info->strip == strip_some
@@ -2830,7 +2831,7 @@ elf64_alpha_output_extsym (h, data)
       else
        h->esym.asym.value = 0;
     }
-  else if (h->root.needs_plt)
+  else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       /* Set type and value for a symbol with a function stub.  */
       h->esym.asym.st = stProc;
@@ -2997,7 +2998,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
                 || h->root.root.type == bfd_link_hash_warning)
            h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
 
-         h->root.ref_regular = 1;
+         h->root.elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
        }
 
       /* We can only get preliminary data on whether a symbol is
@@ -3007,7 +3008,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
       maybe_dynamic = FALSE;
       if (h && ((info->shared
                 && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
-               || !h->root.def_regular
+               || ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                || h->root.root.type == bfd_link_hash_defweak))
         maybe_dynamic = TRUE;
 
@@ -3113,9 +3114,9 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
                  /* Make a guess as to whether a .plt entry is needed.  */
                  if ((gotent_flags & ALPHA_ELF_LINK_HASH_LU_FUNC)
                      && !(gotent_flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC))
-                   h->root.needs_plt = 1;
+                   h->root.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
                  else
-                   h->root.needs_plt = 0;
+                   h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
                }
            }
        }
@@ -3239,7 +3240,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
         somewhere later.  But for now don't bother.  */
       && ah->got_entries)
     {
-      h->needs_plt = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
       s = bfd_get_section_by_name(dynobj, ".plt");
       if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info))
@@ -3274,17 +3275,17 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
       return TRUE;
     }
   else
-    h->needs_plt = 0;
+    h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -3726,7 +3727,7 @@ elf64_alpha_size_plt_section_1 (h, data)
   struct alpha_elf_got_entry *gotent;
 
   /* If we didn't need an entry before, we still don't.  */
-  if (!h->root.needs_plt)
+  if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT))
     return TRUE;
 
   /* There must still be a LITERAL got entry for the function.  */
@@ -3746,7 +3747,7 @@ elf64_alpha_size_plt_section_1 (h, data)
     }
   else
     {
-      h->root.needs_plt = 0;
+      h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
       h->root.plt.offset = -1;
 
       /* Undo the definition frobbing begun in adjust_dynamic_symbol.  */
@@ -3848,13 +3849,15 @@ elf64_alpha_calc_dynrel_sizes (h, info)
      set.  This is done for dynamic symbols in
      elf_adjust_dynamic_symbol but this is not done for non-dynamic
      symbols, somehow.  */
-  if (!h->root.def_regular
-      && h->root.ref_regular
-      && !h->root.def_dynamic
+  if (((h->root.elf_link_hash_flags
+       & (ELF_LINK_HASH_DEF_REGULAR
+         | ELF_LINK_HASH_REF_REGULAR
+         | ELF_LINK_HASH_DEF_DYNAMIC))
+       == ELF_LINK_HASH_REF_REGULAR)
       && (h->root.root.type == bfd_link_hash_defined
          || h->root.root.type == bfd_link_hash_defweak)
       && !(h->root.root.u.def.section->owner->flags & DYNAMIC))
-    h->root.def_regular = 1;
+    h->root.elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 
   /* If the symbol is dynamic, we'll need all the relocations in their
      natural form.  If this is a shared object, and it has been forced
@@ -4894,7 +4897,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
       bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
 
-      if (!h->def_regular)
+      if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          /* Mark the symbol as undefined, rather than as defined in the
             .plt section.  Leave the value alone.  */
index 8bc830c110342371fd463d7bc80b0b9881d1a73e..25431d410e13bc0c10393bf9357552bc3f20afcc 100644 (file)
@@ -743,7 +743,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
                 || h->root.type == bfd_link_hash_warning)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-         h->ref_regular = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
        }
 
       /* We can only get preliminary data on whether a symbol is
@@ -752,9 +752,8 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
         this may help reduce memory usage and processing time later.  */
       maybe_dynamic = FALSE;
       if (h && ((info->shared
-                && (!info->symbolic
-                    || info->unresolved_syms_in_shared_libs == RM_IGNORE))
-               || !h->def_regular
+                && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+               || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                || h->root.type == bfd_link_hash_defweak))
        maybe_dynamic = TRUE;
 
@@ -914,7 +913,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
          /* This could be a local function that had its address taken, in
             which case H will be NULL.  */
          if (h)
-           h->needs_plt = 1;
+           h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
        }
 
       /* Add a new dynamic relocation to the chain of dynamic
@@ -1015,7 +1014,7 @@ elf64_hppa_mark_exported_functions (h, data)
       dyn_h->want_opd = 1;
       /* Put a flag here for output_symbol_hook.  */
       dyn_h->st_shndx = -1;
-      h->needs_plt = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
     }
 
   return TRUE;
@@ -1559,12 +1558,12 @@ elf64_hppa_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1969,7 +1968,7 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
      the original values (in elf64_hppa_link_output_symbol_hook).  */
   if (dyn_h && dyn_h->want_opd)
     {
-      BFD_ASSERT (sopd != NULL);
+      BFD_ASSERT (sopd != NULL)
 
       /* Save away the original value and section index so that we
         can restore them later.  */
@@ -1993,7 +1992,7 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
       Elf_Internal_Rela rel;
       bfd_byte *loc;
 
-      BFD_ASSERT (splt != NULL && spltrel != NULL);
+      BFD_ASSERT (splt != NULL && spltrel != NULL)
 
       /* We do not actually care about the value in the PLT entry
         if we are creating a shared library and the symbol is
@@ -2043,7 +2042,7 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
       int insn;
       unsigned int max_offset;
 
-      BFD_ASSERT (stub != NULL);
+      BFD_ASSERT (stub != NULL)
 
       /* Install the generic stub template.
 
index dd68f708a67a40570b600f64d0deb957f0bc67c7..ac9f96f97b345108d0e929b91ee030acb33aa4aa 100644 (file)
@@ -2352,8 +2352,6 @@ mips_elf64_write_rel (bfd *abfd, asection *sec,
       sym = *ptr->sym_ptr_ptr;
       if (sym == last_sym)
        n = last_sym_idx;
-      else if (bfd_is_abs_section (sym->section) && sym->value == 0)
-       n = STN_UNDEF;
       else
        {
          last_sym = sym;
@@ -2450,8 +2448,6 @@ mips_elf64_write_rela (bfd *abfd, asection *sec,
       sym = *ptr->sym_ptr_ptr;
       if (sym == last_sym)
        n = last_sym_idx;
-      else if (bfd_is_abs_section (sym->section) && sym->value == 0)
-       n = STN_UNDEF;
       else
        {
          last_sym = sym;
index 6f30194e6ada7792a52d21ff438ee26bd9e03778..b49b6137034366dca4086718df401c77aa970ff4 100644 (file)
@@ -3766,6 +3766,7 @@ ppc64_elf_copy_indirect_symbol
    struct elf_link_hash_entry *ind)
 {
   struct ppc_link_hash_entry *edir, *eind;
+  flagword mask;
 
   edir = (struct ppc_link_hash_entry *) dir;
   eind = (struct ppc_link_hash_entry *) ind;
@@ -3809,18 +3810,18 @@ ppc64_elf_copy_indirect_symbol
   edir->is_func_descriptor |= eind->is_func_descriptor;
   edir->tls_mask |= eind->tls_mask;
 
+  mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR
+         | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF
+         | ELF_LINK_HASH_NEEDS_PLT);
   /* If called to transfer flags for a weakdef during processing
-     of elf_adjust_dynamic_symbol, don't copy NON_GOT_REF.
+     of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
      We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-  if (!(ELIMINATE_COPY_RELOCS
-       && eind->elf.root.type != bfd_link_hash_indirect
-       && edir->elf.dynamic_adjusted))
-    edir->elf.non_got_ref |= eind->elf.non_got_ref;
+  if (ELIMINATE_COPY_RELOCS
+      && eind->elf.root.type != bfd_link_hash_indirect
+      && (edir->elf.elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    mask &= ~ELF_LINK_NON_GOT_REF;
 
-  edir->elf.ref_dynamic |= eind->elf.ref_dynamic;
-  edir->elf.ref_regular |= eind->elf.ref_regular;
-  edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
-  edir->elf.needs_plt |= eind->elf.needs_plt;
+  edir->elf.elf_link_hash_flags |= eind->elf.elf_link_hash_flags & mask;
 
   /* If we were called to copy over info for a weak sym, that's all.  */
   if (eind->elf.root.type != bfd_link_hash_indirect)
@@ -4063,22 +4064,22 @@ ppc64_elf_check_directives (bfd *abfd ATTRIBUTE_UNUSED,
          if (h->type != bfd_link_hash_undefined
              && h->type != bfd_link_hash_common)
            {
-             *pun = h->u.undef.next;
-             h->u.undef.next = NULL;
+             *pun = h->und_next;
+             h->und_next = NULL;
              if (h == htab->elf.root.undefs_tail)
                {
                  if (pun == &htab->elf.root.undefs)
                    htab->elf.root.undefs_tail = NULL;
                  else
-                   /* pun points at an u.undef.next field.  Go back to
+                   /* pun points at an und_next field.  Go back to
                       the start of the link_hash_entry.  */
                    htab->elf.root.undefs_tail = (struct bfd_link_hash_entry *)
-                     ((char *) pun - ((char *) &h->u.undef.next - (char *) h));
+                     ((char *) pun - ((char *) &h->und_next - (char *) h));
                  break;
                }
            }
          else
-           pun = &h->u.undef.next;
+           pun = &h->und_next;
        }
 
       htab->twiddled_syms = 0;
@@ -4154,7 +4155,7 @@ update_plt_info (bfd *abfd, struct ppc_link_hash_entry *eh, bfd_vma addend)
       eh->elf.plt.plist = ent;
     }
   ent->plt.refcount += 1;
-  eh->elf.needs_plt = 1;
+  eh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
   eh->is_func = 1;
   return TRUE;
 }
@@ -4550,7 +4551,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_PPC64_TOC:
          if (h != NULL && !info->shared)
            /* We may need a copy reloc.  */
-           h->non_got_ref = 1;
+           h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
          /* Don't propagate .opd relocs.  */
          if (NO_OPD_RELOCS && opd_sym_map != NULL)
@@ -4583,12 +4584,14 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct ppc_dyn_relocs *p;
              struct ppc_dyn_relocs **head;
@@ -5077,13 +5080,13 @@ sfpr_define (struct bfd_link_info *info, const struct sfpr_def_parms *parm)
       sym[len + 1] = i % 10 + '0';
       h = elf_link_hash_lookup (&htab->elf, sym, FALSE, FALSE, TRUE);
       if (h != NULL
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.type = bfd_link_hash_defined;
          h->root.u.def.section = htab->sfpr;
          h->root.u.def.value = htab->sfpr->size;
          h->type = STT_FUNC;
-         h->def_regular = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          _bfd_elf_link_hash_hide_symbol (info, h, TRUE);
          writing = TRUE;
          if (htab->sfpr->contents == NULL)
@@ -5308,7 +5311,7 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
                          &fh->elf.root.u.def.value) != (bfd_vma) -1)
     {
       fh->elf.root.type = fh->oh->elf.root.type;
-      fh->elf.forced_local = 1;
+      fh->elf.elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
     }
 
   /* If this is a function code symbol, transfer dynamic linking
@@ -5359,26 +5362,27 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
          return FALSE;
        }
       fdh = (struct ppc_link_hash_entry *) bh;
-      fdh->elf.non_elf = 0;
+      fdh->elf.elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
       fdh->elf.size = 24;
       fdh->elf.type = STT_OBJECT;
     }
 
   if (fdh != NULL
-      && !fdh->elf.forced_local
+      && (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
       && (info->shared
-         || fdh->elf.def_dynamic
-         || fdh->elf.ref_dynamic
+         || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+         || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
          || (fdh->elf.root.type == bfd_link_hash_undefweak
              && ELF_ST_VISIBILITY (fdh->elf.other) == STV_DEFAULT)))
     {
       if (fdh->elf.dynindx == -1)
        if (! bfd_elf_link_record_dynamic_symbol (info, &fdh->elf))
          return FALSE;
-      fdh->elf.ref_regular |= fh->elf.ref_regular;
-      fdh->elf.ref_dynamic |= fh->elf.ref_dynamic;
-      fdh->elf.ref_regular_nonweak |= fh->elf.ref_regular_nonweak;
-      fdh->elf.non_got_ref |= fh->elf.non_got_ref;
+      fdh->elf.elf_link_hash_flags
+       |= (fh->elf.elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
+                                     | ELF_LINK_HASH_REF_DYNAMIC
+                                     | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+                                     | ELF_LINK_NON_GOT_REF));
       if (ELF_ST_VISIBILITY (fh->elf.other) == STV_DEFAULT)
        {
          struct plt_entry **ep = &fdh->elf.plt.plist;
@@ -5386,7 +5390,7 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
            ep = &(*ep)->next;
          *ep = fh->elf.plt.plist;
          fh->elf.plt.plist = NULL;
-         fdh->elf.needs_plt = 1;
+         fdh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
        }
       fdh->is_func_descriptor = 1;
       fdh->oh = fh;
@@ -5402,10 +5406,10 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
      linker dragging in a definition from a static library.  */
   force_local
     = (info->shared
-       && (!fh->elf.def_regular
+       && ((fh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
           || fdh == NULL
-          || !fdh->elf.def_regular
-          || fdh->elf.forced_local));
+          || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+          || (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0));
   _bfd_elf_link_hash_hide_symbol (info, &fh->elf, force_local);
 
   return TRUE;
@@ -5475,7 +5479,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* Deal with function syms.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       /* Clear procedure linkage table information for any symbol that
         won't need a .plt entry.  */
@@ -5489,7 +5493,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
              && h->root.type == bfd_link_hash_undefweak))
        {
          h->plt.plist = NULL;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
@@ -5498,14 +5502,16 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -5518,7 +5524,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   if (ELIMINATE_COPY_RELOCS)
@@ -5538,7 +5544,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -5576,7 +5582,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->relbss->size += sizeof (Elf64_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -5806,7 +5812,7 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx,
   if ((h == NULL
        || ((h->root.type == bfd_link_hash_defined
            || h->root.type == bfd_link_hash_defweak)
-          && !h->def_dynamic))
+          && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
       && (next_r == -1 || next_r == -2))
     return 1 - next_r;
   return 1;
@@ -6398,7 +6404,7 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
                ok_tprel = FALSE;
                is_local = FALSE;
                if (h == NULL
-                   || !h->def_dynamic)
+                   || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
                  {
                    is_local = TRUE;
                    value += sym_sec->output_offset;
@@ -6677,13 +6683,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       if (!doneone)
        {
          h->plt.plist = NULL;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.plist = NULL;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   eh = (struct ppc_link_hash_entry *) h;
@@ -6721,14 +6727,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
           Undefined weak syms won't yet be marked as dynamic,
           nor will all TLS symbols.  */
        if (h->dynindx == -1
-           && !h->forced_local)
+           && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
          {
            if (! bfd_elf_link_record_dynamic_symbol (info, h))
              return FALSE;
          }
 
        if ((gent->tls_type & TLS_LD) != 0
-           && !h->def_dynamic)
+           && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
          {
            gent->got.offset = ppc64_tlsld_got (gent->owner)->offset;
            continue;
@@ -6795,14 +6801,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && h->def_dynamic
-         && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -7531,11 +7537,10 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
          h->root.type = bfd_link_hash_defined;
          h->root.u.def.section = stub_entry->stub_sec;
          h->root.u.def.value = stub_entry->stub_offset;
-         h->ref_regular = 1;
-         h->def_regular = 1;
-         h->ref_regular_nonweak = 1;
-         h->forced_local = 1;
-         h->non_elf = 0;
+         h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
+                                   | ELF_LINK_HASH_DEF_REGULAR
+                                   | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+                                   | ELF_LINK_FORCED_LOCAL);
        }
     }
 
@@ -8398,11 +8403,10 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
              h->root.type = bfd_link_hash_defined;
              h->root.u.def.section = htab->glink;
              h->root.u.def.value = 0;
-             h->ref_regular = 1;
-             h->def_regular = 1;
-             h->ref_regular_nonweak = 1;
-             h->forced_local = 1;
-             h->non_elf = 0;
+             h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
+                                       | ELF_LINK_HASH_DEF_REGULAR
+                                       | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+                                       | ELF_LINK_FORCED_LOCAL);
            }
        }
       p = htab->glink->contents;
@@ -9318,7 +9322,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
 
            if (tls_type == (TLS_TLS | TLS_LD)
                && (h == NULL
-                   || !h->elf.def_dynamic))
+                   || (h->elf.elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) == 0))
              offp = &ppc64_tlsld_got (input_bfd)->offset;
            else
              {
@@ -9637,9 +9642,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                  && !info->shared
                  && h != NULL
                  && h->elf.dynindx != -1
-                 && !h->elf.non_got_ref
-                 && h->elf.def_dynamic
-                 && !h->elf.def_regular))
+                 && !(h->elf.elf_link_hash_flags & ELF_LINK_NON_GOT_REF)
+                 && (h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+                 && !(h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
            {
              Elf_Internal_Rela outrel;
              bfd_boolean skip, relocate;
@@ -9892,7 +9897,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->elf.def_dynamic))
+              && (h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
        {
          (*_bfd_error_handler)
            (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
@@ -10030,7 +10035,7 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
        bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
       }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       Elf_Internal_Rela rela;
       bfd_byte *loc;
index 796c4f7c539ac514da730eb79b747292113c4247..821ea51fb4d2cde63c01a4fe63b7fca1c9052c7f 100644 (file)
@@ -852,16 +852,15 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -1029,7 +1028,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
             creating a procedure linkage table entry.  */
          if (h != NULL)
            {
-             h->needs_plt = 1;
+             h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
              h->plt.refcount += 1;
            }
          break;
@@ -1051,7 +1050,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
          if (h != NULL)
            {
              ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++;
-             h->needs_plt = 1;
+             h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
              h->plt.refcount += 1;
            }
          else
@@ -1163,7 +1162,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                 sections have not yet been mapped to output sections.
                 Tentatively set the flag for now, and correct in
                 adjust_dynamic_symbol.  */
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
              /* We may need a .plt entry if the function this reloc
                 refers to is in a shared lib.  */
@@ -1201,13 +1200,15 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf_s390_dyn_relocs *p;
              struct elf_s390_dyn_relocs **head;
@@ -1551,12 +1552,12 @@ elf_s390_adjust_dynamic_symbol (info, h)
      will fill in the contents of the procedure linkage table later
      (although we could actually do it here).  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || (! info->shared
-             && !h->def_dynamic
-             && !h->ref_dynamic
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
              && h->root.type != bfd_link_hash_undefweak
              && h->root.type != bfd_link_hash_undefined))
        {
@@ -1566,7 +1567,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC32 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
        }
 
@@ -1583,14 +1584,16 @@ elf_s390_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -1606,13 +1609,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -1633,7 +1636,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -1656,7 +1659,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf64_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1717,7 +1720,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1741,7 +1744,7 @@ allocate_dynrelocs (h, inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -1760,14 +1763,14 @@ allocate_dynrelocs (h, inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
          elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
       elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
     }
 
@@ -1800,7 +1803,7 @@ allocate_dynrelocs (h, inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1868,9 +1871,9 @@ allocate_dynrelocs (h, inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1878,7 +1881,7 @@ allocate_dynrelocs (h, inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -2342,8 +2345,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                  || (info->shared
                      && (info->symbolic
                          || h->dynindx == -1
-                         || h->forced_local)
-                     && h->def_regular)
+                         || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+                     && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
                  || (ELF_ST_VISIBILITY (h->other)
                      && h->root.type == bfd_link_hash_undefweak))
                {
@@ -2529,9 +2532,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                  && !info->shared
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && ((h->def_dynamic
-                      && !h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (((h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined)))
            {
@@ -2568,7 +2573,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
                           || r_type == R_390_PC64
                           || !info->shared
                           || !info->symbolic
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
                  outrel.r_addend = rel->r_addend;
@@ -2981,7 +2987,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd,
@@ -3131,7 +3137,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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
@@ -3167,8 +3173,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       if (info->shared
          && (info->symbolic
              || h->dynindx == -1
-             || h->forced_local)
-         && h->def_regular)
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          BFD_ASSERT((h->got.offset & 1) != 0);
          rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE);
@@ -3189,7 +3195,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       Elf_Internal_Rela rela;
       bfd_byte *loc;
index c2e1034020df005014c7c745df396ec010377288..ea6f4df34ea991b7f6717170485182a62a9ff7ac 100644 (file)
@@ -1653,7 +1653,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                      && elf_hash_table (info)->dynamic_sections_created
                      && (! info->shared
                          || (! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))
                  /* The cases above are those in which relocation is
                     overwritten in the switch block below.  The cases
                     below are those in which we must defer relocation
@@ -1661,7 +1662,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                     addresses when creating a shared library.  */
                  || (info->shared
                      && ((! info->symbolic && h->dynindx != -1)
-                         || !h->def_regular)
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      && ((r_type == R_SH_64
                           && !(ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
                                || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN))
@@ -1677,7 +1679,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                     thus ld.so will not process them.  */
                  || (sec->output_section == NULL
                      && ((input_section->flags & SEC_DEBUGGING) != 0
-                         && h->def_dynamic)))
+                         && (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
                relocation = 0;
              else if (sec->output_section == NULL)
                {
@@ -1744,7 +1747,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                  || (h != NULL
                      && h->dynindx != -1
                      && (! info->symbolic
-                         || !h->def_regular))))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))))
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
@@ -1803,7 +1807,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                     become local.  */
                  if (h == NULL
                      || ((info->symbolic || h->dynindx == -1)
-                         && h->def_regular))
+                         && (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) != 0))
                    {
                      relocate = TRUE;
                      outrel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64);
@@ -1901,7 +1906,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                      && (info->symbolic || h->dynindx == -1
                          || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
                          || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
-                     && h->def_regular))
+                     && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                {
                  /* This is actually a static link, or it is a
                     -Bsymbolic link and the symbol is defined
@@ -2715,7 +2720,7 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
                return FALSE;
            }
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
          break;
 
@@ -2739,14 +2744,14 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
              || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
            break;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 
          break;
 
        case R_SH_64:
        case R_SH_64_PCREL:
          if (h != NULL)
-           h->non_got_ref = 1;
+           h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
          /* If we are creating a shared library, and this is a reloc
             against a global symbol, or a non PC relative reloc
@@ -2765,7 +2770,8 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
              && (ELF32_R_TYPE (rel->r_info) != R_SH_64_PCREL
                  || (h != NULL
                      && (! info->symbolic
-                         || !h->def_regular))))
+                         || (h->elf_link_hash_flags
+                             & ELF_LINK_HASH_DEF_REGULAR) == 0))))
            {
              /* When creating a shared object, we must copy these
                 reloc types into the output file.  We create a reloc
@@ -2929,7 +2935,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
            }
 
          h = (struct elf_link_hash_entry *) bh;
-         h->non_elf = 0;
+         h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
       else
@@ -3288,7 +3294,7 @@ sh64_elf64_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
        return FALSE;
 
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (info->shared
@@ -3387,28 +3393,31 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! info->shared
-         && !h->def_dynamic
-         && !h->ref_dynamic)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
        {
          /* This case can occur if we saw a PLT reloc in an input
             file, but the symbol was never referred to by a dynamic
             object.  In such a case, we don't actually need to build
             a procedure linkage table, and we can just do a REL64
             reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
          return TRUE;
        }
 
@@ -3433,7 +3442,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (! info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = s->size;
@@ -3463,12 +3472,12 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -3484,7 +3493,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* We must allocate the symbol in our .dynbss section, which will
@@ -3511,7 +3520,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf64_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -3555,7 +3564,7 @@ sh64_elf64_discard_copies (struct elf_sh64_link_hash_entry *h,
     h = (struct elf_sh64_link_hash_entry *) h->root.root.u.i.link;
 
   /* We only discard relocs for symbols defined in a regular object.  */
-  if (!h->root.def_regular)
+  if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return TRUE;
 
   for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
@@ -3863,7 +3872,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
       loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
       bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -3896,7 +3905,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
         initialized in the relocate_section function.  */
       if (info->shared
          && (info->symbolic || h->dynindx == -1)
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          rel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64);
          rel.r_addend = (h->root.u.def.value
@@ -3915,7 +3924,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
       bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rel;
index 6a8977c438ec5e2012ed9607d1f15395a72302b5..ca35eecba2c5b8a92069568be9e75dcda8785cab 100644 (file)
@@ -1265,7 +1265,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
                return FALSE;
            }
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          if (ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT32
              && ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT64)
            break;
@@ -1612,11 +1612,14 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later
@@ -1626,7 +1629,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
      some of their functions as STT_NOTYPE when they really should be
      STT_FUNC.  */
   if (h->type == STT_FUNC
-      || h->needs_plt
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
       || (h->type == STT_NOTYPE
          && (h->root.type == bfd_link_hash_defined
              || h->root.type == bfd_link_hash_defweak)
@@ -1639,7 +1642,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
              In such a case, we don't actually need to build a
              procedure linkage table, and we can just do a WDISP30
              reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
          return TRUE;
        }
 
@@ -1659,7 +1662,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (! info->shared
-         && !h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          h->root.u.def.section = s;
          h->root.u.def.value = sparc64_elf_plt_entry_offset (h->plt.offset);
@@ -1689,12 +1692,12 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1732,7 +1735,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf64_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -2219,7 +2222,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                   become local.  */
                else if (h != NULL && ! is_plt
                         && ((! info->symbolic && h->dynindx != -1)
-                            || !h->def_regular))
+                            || (h->elf_link_hash_flags
+                                & ELF_LINK_HASH_DEF_REGULAR) == 0))
                  {
                    BFD_ASSERT (h->dynindx != -1);
                    outrel.r_info
@@ -2321,8 +2325,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                  || (info->shared
                      && (info->symbolic
                          || h->dynindx == -1
-                         || h->forced_local)
-                     && h->def_regular))
+                         || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+                     && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
                {
                  /* This is actually a static link, or it is a -Bsymbolic
                     link and the symbol is defined locally, or the symbol
@@ -2610,7 +2614,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd, input_section,
@@ -2732,7 +2736,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc += (h->plt.offset - 4) * sizeof (Elf64_External_Rela);
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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.  */
@@ -2741,7 +2745,8 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
             Otherwise, the PLT entry would provide a definition for
             the symbol even if the symbol wasn't defined anywhere,
             and so the symbol would never be NULL.  */
-         if (!h->ref_regular_nonweak)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+             == 0)
            sym->st_value = 0;
        }
     }
@@ -2770,7 +2775,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
         initialized in the relocate_section function.  */
       if (info->shared
          && (info->symbolic || h->dynindx == -1)
-         && h->def_regular)
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
        {
          asection *sec = h->root.u.def.section;
          rela.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
@@ -2791,7 +2796,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
       Elf_Internal_Rela rela;
index f039fa7eb496c898578b188ac12adf33dac20fe4..a5c5c9fedcad5722b8a06583f6301a08a473db46 100644 (file)
@@ -553,17 +553,16 @@ elf64_x86_64_copy_indirect_symbol (const struct elf_backend_data *bed,
 
   if (ELIMINATE_COPY_RELOCS
       && ind->root.type != bfd_link_hash_indirect
-      && dir->dynamic_adjusted)
-    {
-      /* If called to transfer flags for a weakdef during processing
-        of elf_adjust_dynamic_symbol, don't copy non_got_ref.
-        We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
-      dir->ref_dynamic |= ind->ref_dynamic;
-      dir->ref_regular |= ind->ref_regular;
-      dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
-      dir->needs_plt |= ind->needs_plt;
-      dir->pointer_equality_needed |= ind->pointer_equality_needed;
-    }
+      && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+    /* If called to transfer flags for a weakdef during processing
+       of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+       We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
+    dir->elf_link_hash_flags |=
+      (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_POINTER_EQUALITY_NEEDED));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -771,7 +770,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
          if (h == NULL)
            continue;
 
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
          break;
 
@@ -809,13 +808,13 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                 sections have not yet been mapped to output sections.
                 Tentatively set the flag for now, and correct in
                 adjust_dynamic_symbol.  */
-             h->non_got_ref = 1;
+             h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
 
              /* 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->pointer_equality_needed = 1;
+               h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED;
            }
 
          /* If we are creating a shared library, and this is a reloc
@@ -847,13 +846,15 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
-                          || !h->def_regular))))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
              || (ELIMINATE_COPY_RELOCS
                  && !info->shared
                  && (sec->flags & SEC_ALLOC) != 0
                  && h != NULL
                  && (h->root.type == bfd_link_hash_defweak
-                     || !h->def_regular)))
+                     || (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            {
              struct elf64_x86_64_dyn_relocs *p;
              struct elf64_x86_64_dyn_relocs **head;
@@ -1125,7 +1126,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || h->needs_plt)
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (h->plt.refcount <= 0
          || SYMBOL_CALLS_LOCAL (info, h)
@@ -1138,7 +1139,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC32 reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
       return TRUE;
@@ -1154,14 +1155,16 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.         */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
-       h->non_got_ref = h->u.weakdef->non_got_ref;
+       h->elf_link_hash_flags
+         = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+            | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
       return TRUE;
     }
 
@@ -1177,13 +1180,13 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If there are no references to this symbol that do not use the
      GOT, we don't need to generate a copy reloc.  */
-  if (!h->non_got_ref)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
     return TRUE;
 
   /* If -z nocopyreloc was given, we won't generate them either.  */
   if (info->nocopyreloc)
     {
-      h->non_got_ref = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
       return TRUE;
     }
 
@@ -1204,7 +1207,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
         we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
       if (p == NULL)
        {
-         h->non_got_ref = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
          return TRUE;
        }
     }
@@ -1227,7 +1230,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
       htab->srelbss->size += sizeof (Elf64_External_Rela);
-      h->needs_copy = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1284,7 +1287,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1308,7 +1311,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
             pointers compare as equal between the normal executable and
             the shared library.  */
          if (! info->shared
-             && !h->def_regular)
+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              h->root.u.def.section = s;
              h->root.u.def.value = h->plt.offset;
@@ -1327,13 +1330,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       else
        {
          h->plt.offset = (bfd_vma) -1;
-         h->needs_plt = 0;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
     }
   else
     {
       h->plt.offset = (bfd_vma) -1;
-      h->needs_plt = 0;
+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
     }
 
   /* If R_X86_64_GOTTPOFF symbol is now local to the binary,
@@ -1352,7 +1355,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
-         && !h->forced_local)
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        {
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
@@ -1427,9 +1430,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
         symbols which turn out to need copy relocs or are not
         dynamic.  */
 
-      if (!h->non_got_ref
-         && ((h->def_dynamic
-              && !h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+         && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
              || (htab->elf.dynamic_sections_created
                  && (h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined))))
@@ -1437,7 +1440,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
          /* Make sure this symbol is output as a dynamic symbol.
             Undefined weak syms won't yet be marked as dynamic.  */
          if (h->dynindx == -1
-             && !h->forced_local)
+             && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                return FALSE;
@@ -1984,9 +1987,11 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                  && !info->shared
                  && h != NULL
                  && h->dynindx != -1
-                 && !h->non_got_ref
-                 && ((h->def_dynamic
-                      && !h->def_regular)
+                 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+                 && (((h->elf_link_hash_flags
+                       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                      && (h->elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)
                      || h->root.type == bfd_link_hash_undefweak
                      || h->root.type == bfd_link_hash_undefined)))
            {
@@ -2024,7 +2029,8 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                           || r_type == R_X86_64_PC32
                           || !info->shared
                           || !info->symbolic
-                          || !h->def_regular))
+                          || (h->elf_link_hash_flags
+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
                {
                  outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
                  outrel.r_addend = rel->r_addend;
@@ -2398,7 +2404,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
         not process them.  */
       if (unresolved_reloc
          && !((input_section->flags & SEC_DEBUGGING) != 0
-              && h->def_dynamic))
+              && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
           input_bfd,
@@ -2534,7 +2540,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
       loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
 
-      if (!h->def_regular)
+      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 if there were any
@@ -2545,7 +2551,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
             called from a binary, there is no need to slow down
             shared libraries because of that.  */
          sym->st_shndx = SHN_UNDEF;
-         if (!h->pointer_equality_needed)
+         if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0)
            sym->st_value = 0;
        }
     }
@@ -2594,7 +2600,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
       bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if (h->needs_copy)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       Elf_Internal_Rela rela;
       bfd_byte *loc;
@@ -2782,21 +2788,6 @@ elf64_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
   return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
 }
 
-/* Handle an x86-64 specific section when reading an object file.  This
-   is called when elfcode.h finds a section with an unknown type.  */
-
-static bfd_boolean
-elf64_x86_64_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *name)
-{
-  if (hdr->sh_type != SHT_X86_64_UNWIND)
-    return FALSE;
-
-  if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
-    return FALSE;
-
-  return TRUE;
-}
-
 #define TARGET_LITTLE_SYM                  bfd_elf64_x86_64_vec
 #define TARGET_LITTLE_NAME                 "elf64-x86-64"
 #define ELF_ARCH                           bfd_arch_i386
@@ -2834,7 +2825,4 @@ elf64_x86_64_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *n
 #define elf_backend_object_p               elf64_x86_64_elf_object_p
 #define bfd_elf64_mkobject                 elf64_x86_64_mkobject
 
-#define elf_backend_section_from_shdr \
-       elf64_x86_64_section_from_shdr
-
 #include "elf64-target.h"
index 3eb2cbdf59040c4ad4bb4f0dda394d8099809588..aef15d47c598173be0c73f2793de02ff1d1f8b6a 100644 (file)
@@ -636,34 +636,6 @@ static reloc_howto_type elf32_arm_howto_table[] =
         0xffffffff,            /* src_mask */
         0xffffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
-
-  HOWTO (R_ARM_TARGET2,                /* type */
-        0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
-        FALSE,                 /* pc_relative */
-        0,                     /* bitpos */
-        complain_overflow_signed,/* complain_on_overflow */
-        bfd_elf_generic_reloc, /* special_function */
-        "R_ARM_TARGET2",       /* name */
-        FALSE,                 /* partial_inplace */
-        0xffffffff,            /* src_mask */
-        0xffffffff,            /* dst_mask */
-        TRUE),                 /* pcrel_offset */
-
-  HOWTO (R_ARM_PREL31,         /* type */
-        0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        31,                    /* bitsize */
-        TRUE,                  /* pc_relative */
-        0,                     /* bitpos */
-        complain_overflow_signed,/* complain_on_overflow */
-        bfd_elf_generic_reloc, /* special_function */
-        "R_ARM_PREL31",        /* name */
-        FALSE,                 /* partial_inplace */
-        0x7fffffff,            /* src_mask */
-        0x7fffffff,            /* dst_mask */
-        TRUE),                 /* pcrel_offset */
 };
 
   /* GNU extension to record C++ vtable hierarchy */
@@ -730,67 +702,52 @@ static reloc_howto_type elf32_arm_thm_pc9_howto =
         0x000000ff,            /* dst_mask */
         TRUE);                 /* pcrel_offset */
 
-/* Place relative GOT-indirect.  */
-static reloc_howto_type elf32_arm_got_prel =
-  HOWTO (R_ARM_GOT_PREL,       /* type */
-        0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
-        TRUE,                  /* pc_relative */
-        0,                     /* bitpos */
-        complain_overflow_dont,        /* complain_on_overflow */
-        bfd_elf_generic_reloc, /* special_function */
-        "R_ARM_GOT_PREL",      /* name */
-        FALSE,                 /* partial_inplace */
-        0xffffffff,            /* src_mask */
-        0xffffffff,            /* dst_mask */
-        TRUE);                 /* pcrel_offset */
+static void elf32_arm_info_to_howto
+  PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
 
-static reloc_howto_type *
-elf32_arm_howto_from_type (unsigned int r_type)
+static void
+elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
+     bfd * abfd ATTRIBUTE_UNUSED;
+     arelent * bfd_reloc;
+     Elf_Internal_Rela * elf_reloc;
 {
-  if (r_type < NUM_ELEM (elf32_arm_howto_table))
-    return &elf32_arm_howto_table[r_type];
-    
+  unsigned int r_type;
+
+  r_type = ELF32_R_TYPE (elf_reloc->r_info);
+
   switch (r_type)
     {
-    case R_ARM_GOT_PREL:
-      return &elf32_arm_got_prel;
-
     case R_ARM_GNU_VTINHERIT:
-      return &elf32_arm_vtinherit_howto;
+      bfd_reloc->howto = & elf32_arm_vtinherit_howto;
+      break;
 
     case R_ARM_GNU_VTENTRY:
-      return &elf32_arm_vtentry_howto;
+      bfd_reloc->howto = & elf32_arm_vtentry_howto;
+      break;
 
     case R_ARM_THM_PC11:
-      return &elf32_arm_thm_pc11_howto;
+      bfd_reloc->howto = & elf32_arm_thm_pc11_howto;
+      break;
 
     case R_ARM_THM_PC9:
-      return &elf32_arm_thm_pc9_howto;
+      bfd_reloc->howto = & elf32_arm_thm_pc9_howto;
+      break;
 
     default:
-      return NULL;
+      if (r_type >= NUM_ELEM (elf32_arm_howto_table))
+       bfd_reloc->howto = NULL;
+      else
+        bfd_reloc->howto = & elf32_arm_howto_table[r_type];
+      break;
     }
 }
 
-static void
-elf32_arm_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, arelent * bfd_reloc,
-                        Elf_Internal_Rela * elf_reloc)
-{
-  unsigned int r_type;
-
-  r_type = ELF32_R_TYPE (elf_reloc->r_info);
-  bfd_reloc->howto = elf32_arm_howto_from_type (r_type);
-}
-
 struct elf32_arm_reloc_map
   {
     bfd_reloc_code_real_type  bfd_reloc_val;
     unsigned char             elf_reloc_val;
   };
 
-/* All entries in this list must also be present in elf32_arm_howto_table.  */
 static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
   {
     {BFD_RELOC_NONE,                 R_ARM_NONE},
@@ -814,9 +771,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
     {BFD_RELOC_ARM_PLT32,            R_ARM_PLT32},
     {BFD_RELOC_ARM_TARGET1,         R_ARM_TARGET1},
     {BFD_RELOC_ARM_ROSEGREL32,      R_ARM_ROSEGREL32},
-    {BFD_RELOC_ARM_SBREL32,         R_ARM_SBREL32},
-    {BFD_RELOC_ARM_PREL31,          R_ARM_PREL31},
-    {BFD_RELOC_ARM_TARGET2,         R_ARM_TARGET2}
+    {BFD_RELOC_ARM_SBREL32,         R_ARM_SBREL32}
   };
 
 static reloc_howto_type *
index 68435bb23382acc268527dc201a3d48fae25ff27..e4e8dcc721206dfd2cdfa02f2b570d62ab39e969 100644 (file)
@@ -2,21 +2,21 @@
    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 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"
@@ -86,7 +86,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
             bed->got_symbol_offset, NULL, FALSE, bed->collect, &bh)))
        return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (! info->executable
@@ -213,7 +213,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
          get_elf_backend_data (abfd)->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   if (! info->executable
@@ -276,7 +276,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
              FALSE, get_elf_backend_data (abfd)->collect, &bh)))
        return FALSE;
       h = (struct elf_link_hash_entry *) bh;
-      h->def_regular = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (! info->executable
@@ -363,7 +363,7 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
          if (h->root.type != bfd_link_hash_undefined
              && h->root.type != bfd_link_hash_undefweak)
            {
-             h->forced_local = 1;
+             h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
              return TRUE;
            }
 
@@ -439,15 +439,15 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
     h->root.type = bfd_link_hash_new;
 
   if (h->root.type == bfd_link_hash_new)
-    h->non_elf = 0;
+    h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
 
   /* If this symbol is being provided by the linker script, and it is
      currently defined by a dynamic object, but not by a regular
      object, then mark it as undefined so that the generic linker will
      force the correct value.  */
   if (provide
-      && h->def_dynamic
-      && !h->def_regular)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     h->root.type = bfd_link_hash_undefined;
 
   /* If this symbol is not being provided by the linker script, and it is
@@ -455,14 +455,14 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
      then clear out any version information because the symbol will not be
      associated with the dynamic object any more.  */
   if (!provide
-      && h->def_dynamic
-      && !h->def_regular)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     h->verinfo.verdef = NULL;
 
-  h->def_regular = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 
-  if ((h->def_dynamic
-       || h->ref_dynamic
+  if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
+                                 | ELF_LINK_HASH_REF_DYNAMIC)) != 0
        || info->shared)
       && h->dynindx == -1)
     {
@@ -472,10 +472,10 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
       /* If this is a weak defined symbol, and we know a corresponding
         real symbol from the same dynamic object, make sure the real
         symbol is also made into a dynamic symbol.  */
-      if (h->u.weakdef != NULL
-         && h->u.weakdef->dynindx == -1)
+      if (h->weakdef != NULL
+         && h->weakdef->dynindx == -1)
        {
-         if (! bfd_elf_link_record_dynamic_symbol (info, h->u.weakdef))
+         if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
            return FALSE;
        }
     }
@@ -629,7 +629,8 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
          bfd *dynobj = elf_hash_table (info)->dynobj;
 
          if (dynobj != NULL
-             && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL
+             && (ip = bfd_get_section_by_name (dynobj, p->name))
+             != NULL
              && (ip->flags & SEC_LINKER_CREATED)
              && ip->output_section == p)
            return TRUE;
@@ -708,7 +709,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
                       bfd_boolean *type_change_ok,
                       bfd_boolean *size_change_ok)
 {
-  asection *sec, *oldsec;
+  asection *sec;
   struct elf_link_hash_entry *h;
   struct elf_link_hash_entry *flip;
   int bind;
@@ -748,35 +749,30 @@ _bfd_elf_merge_symbol (bfd *abfd,
 
   if (h->root.type == bfd_link_hash_new)
     {
-      h->non_elf = 0;
+      h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
       return TRUE;
     }
 
-  /* OLDBFD and OLDSEC are a BFD and an ASECTION associated with the
-     existing symbol.  */
+  /* OLDBFD is a BFD associated with the existing symbol.  */
 
   switch (h->root.type)
     {
     default:
       oldbfd = NULL;
-      oldsec = NULL;
       break;
 
     case bfd_link_hash_undefined:
     case bfd_link_hash_undefweak:
       oldbfd = h->root.u.undef.abfd;
-      oldsec = NULL;
       break;
 
     case bfd_link_hash_defined:
     case bfd_link_hash_defweak:
       oldbfd = h->root.u.def.section->owner;
-      oldsec = h->root.u.def.section;
       break;
 
     case bfd_link_hash_common:
       oldbfd = h->root.u.c.p->section->owner;
-      oldsec = h->root.u.c.p->section;
       break;
     }
 
@@ -788,7 +784,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
      dynamic object, which we do want to handle here.  */
   if (abfd == oldbfd
       && ((abfd->flags & DYNAMIC) == 0
-         || !h->def_regular))
+         || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
     return TRUE;
 
   /* NEWDYN and OLDDYN indicate whether the new or old symbol,
@@ -844,73 +840,25 @@ _bfd_elf_merge_symbol (bfd *abfd,
   else
     olddef = TRUE;
 
-  /* Check TLS symbol.  */
-  if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
-      && ELF_ST_TYPE (sym->st_info) != h->type)
-    {
-      bfd *ntbfd, *tbfd;
-      bfd_boolean ntdef, tdef;
-      asection *ntsec, *tsec;
-
-      if (h->type == STT_TLS)
-       {
-         ntbfd = abfd; 
-         ntsec = sec;
-         ntdef = newdef;
-         tbfd = oldbfd;
-         tsec = oldsec;
-         tdef = olddef;
-       }
-      else
-       {
-         ntbfd = oldbfd;
-         ntsec = oldsec;
-         ntdef = olddef;
-         tbfd = abfd;
-         tsec = sec;
-         tdef = newdef;
-       }
-
-      if (tdef && ntdef)
-       (*_bfd_error_handler)
-         (_("%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"),
-          tbfd, tsec, ntbfd, ntsec, h->root.root.string);
-      else if (!tdef && !ntdef)
-       (*_bfd_error_handler)
-         (_("%s: TLS reference in %B mismatches non-TLS reference in %B"),
-          tbfd, ntbfd, h->root.root.string);
-      else if (tdef)
-       (*_bfd_error_handler)
-         (_("%s: TLS definition in %B section %A mismatches non-TLS reference in %B"),
-          tbfd, tsec, ntbfd, h->root.root.string);
-      else
-       (*_bfd_error_handler)
-         (_("%s: TLS reference in %B mismatches non-TLS definition in %B section %A"),
-          tbfd, ntbfd, ntsec, h->root.root.string);
-
-      bfd_set_error (bfd_error_bad_value);
-      return FALSE;
-    }
-
   /* We need to remember if a symbol has a definition in a dynamic
      object or is weak in all dynamic objects. Internal and hidden
      visibility will make it unavailable to dynamic objects.  */
-  if (newdyn && !h->dynamic_def)
+  if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
     {
       if (!bfd_is_und_section (sec))
-       h->dynamic_def = 1;
+       h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF;
       else
        {
          /* Check if this symbol is weak in all dynamic objects. If it
             is the first time we see it in a dynamic object, we mark
             if it is weak. Otherwise, we clear it.  */
-         if (!h->ref_dynamic)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
            {
              if (bind == STB_WEAK)
-               h->dynamic_weak = 1;
+               h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK;
            }
          else if (bind != STB_WEAK)
-           h->dynamic_weak = 0;
+           h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK;
        }
     }
 
@@ -922,7 +870,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
     {
       *skip = TRUE;
       /* Make sure this symbol is dynamic.  */
-      h->ref_dynamic = 1;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
       /* A protected symbol has external availability. Make sure it is
         recorded as dynamic.
 
@@ -934,7 +882,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
     }
   else if (!newdyn
           && ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT
-          && h->def_dynamic)
+          && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
     {
       /* If the new symbol with non-default visibility comes from a
         relocatable file and the old definition comes from a dynamic
@@ -942,16 +890,17 @@ _bfd_elf_merge_symbol (bfd *abfd,
       if ((*sym_hash)->root.type == bfd_link_hash_indirect)
        h = *sym_hash;
 
-      if ((h->root.u.undef.next || info->hash->undefs_tail == &h->root)
+      if ((h->root.und_next || info->hash->undefs_tail == &h->root)
          && bfd_is_und_section (sec))
        {
          /* If the new symbol is undefined and the old symbol was
             also undefined before, we need to make sure
             _bfd_generic_link_add_one_symbol doesn't mess
-            up the linker hash table undefs list.  Since the old
+            up the linker hash table undefs list. Since the old
             definition came from a dynamic object, it is still on the
             undefs list.  */
          h->root.type = bfd_link_hash_undefined;
+         /* FIXME: What if the new symbol is weak undefined?  */
          h->root.u.undef.abfd = abfd;
        }
       else
@@ -960,11 +909,11 @@ _bfd_elf_merge_symbol (bfd *abfd,
          h->root.u.undef.abfd = NULL;
        }
 
-      if (h->def_dynamic)
+      if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
        {
-         h->def_dynamic = 0;
-         h->ref_dynamic = 1;
-         h->dynamic_def = 1;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+         h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_DYNAMIC
+                                    | ELF_LINK_DYNAMIC_DEF);
        }
       /* FIXME: Should we check type and size for protected symbol?  */
       h->size = 0;
@@ -1047,7 +996,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
   if (olddyn
       && olddef
       && h->root.type == bfd_link_hash_defined
-      && h->def_dynamic
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
       && (h->root.u.def.section->flags & SEC_ALLOC) != 0
       && (h->root.u.def.section->flags & SEC_LOAD) == 0
       && h->size > 0
@@ -1154,7 +1103,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
                  || h->type == STT_FUNC)))
       && olddyn
       && olddef
-      && h->def_dynamic)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
     {
       /* Change the hash table entry to undefined, and let
         _bfd_generic_link_add_one_symbol do the right thing with the
@@ -1236,10 +1185,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
       h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
       (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h);
       flip->root.u.undef.abfd = h->root.u.undef.abfd;
-      if (h->def_dynamic)
+      if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
        {
-         h->def_dynamic = 0;
-         flip->ref_dynamic = 1;
+         h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+         flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
        }
     }
 
@@ -1362,12 +1311,13 @@ _bfd_elf_add_default_symbol (bfd *abfd,
 
       h->root.type = bfd_link_hash_indirect;
       h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
-      if (h->def_dynamic)
+      if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
        {
-         h->def_dynamic = 0;
-         hi->ref_dynamic = 1;
-         if (hi->ref_regular
-             || hi->def_regular)
+         h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
+         hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+         if (hi->elf_link_hash_flags
+             & (ELF_LINK_HASH_REF_REGULAR
+                | ELF_LINK_HASH_DEF_REGULAR))
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, hi))
                return FALSE;
@@ -1397,12 +1347,14 @@ _bfd_elf_add_default_symbol (bfd *abfd,
          if (! dynamic)
            {
              if (info->shared
-                 || hi->ref_dynamic)
+                 || ((hi->elf_link_hash_flags
+                      & ELF_LINK_HASH_REF_DYNAMIC) != 0))
                *dynsym = TRUE;
            }
          else
            {
-             if (hi->ref_regular)
+             if ((hi->elf_link_hash_flags
+                  & ELF_LINK_HASH_REF_REGULAR) != 0)
                *dynsym = TRUE;
            }
        }
@@ -1466,12 +1418,14 @@ nondefault:
              if (! dynamic)
                {
                  if (info->shared
-                     || hi->ref_dynamic)
+                     || ((hi->elf_link_hash_flags
+                          & ELF_LINK_HASH_REF_DYNAMIC) != 0))
                    *dynsym = TRUE;
                }
              else
                {
-                 if (hi->ref_regular)
+                 if ((hi->elf_link_hash_flags
+                      & ELF_LINK_HASH_REF_REGULAR) != 0)
                    *dynsym = TRUE;
                }
            }
@@ -1497,8 +1451,8 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
   if (h->dynindx == -1
-      && (h->def_regular
-         || h->ref_regular))
+      && (h->elf_link_hash_flags
+         & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
     {
       struct bfd_elf_version_tree *t;
       struct bfd_elf_version_expr *d;
@@ -1553,8 +1507,8 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h,
 
   /* We only care about symbols defined in shared objects with version
      information.  */
-  if (!h->def_dynamic
-      || h->def_regular
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
       || h->dynindx == -1
       || h->verinfo.verdef == NULL)
     return TRUE;
@@ -1644,7 +1598,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
 
   /* We only need version numbers for symbols defined in regular
      objects.  */
-  if (!h->def_regular)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return TRUE;
 
   bed = get_elf_backend_data (sinfo->output_bfd);
@@ -1669,7 +1623,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
       if (*p == '\0')
        {
          if (hidden)
-           h->hidden = 1;
+           h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
          return TRUE;
        }
 
@@ -1764,7 +1718,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
        }
 
       if (hidden)
-       h->hidden = 1;
+       h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
     }
 
   /* If we don't have a version for this symbol, see if we can find
@@ -2142,33 +2096,29 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
      DEF_REGULAR and REF_REGULAR correctly.  This is the only way to
      permit a non-ELF file to correctly refer to a symbol defined in
      an ELF dynamic object.  */
-  if (h->non_elf)
+  if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
     {
       while (h->root.type == bfd_link_hash_indirect)
        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->ref_regular = 1;
-         h->ref_regular_nonweak = 1;
-       }
+       h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+                                  | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
       else
        {
          if (h->root.u.def.section->owner != NULL
              && (bfd_get_flavour (h->root.u.def.section->owner)
                  == bfd_target_elf_flavour))
-           {
-             h->ref_regular = 1;
-             h->ref_regular_nonweak = 1;
-           }
+           h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+                                      | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
          else
-           h->def_regular = 1;
+           h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
        }
 
       if (h->dynindx == -1
-         && (h->def_dynamic
-             || h->ref_dynamic))
+         && ((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))
            {
@@ -2179,7 +2129,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
     }
   else
     {
-      /* Unfortunately, NON_ELF is only correct if the symbol
+      /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
         was first seen in a non-ELF file.  Fortunately, if the symbol
         was first seen in an ELF file, we're probably OK unless the
         symbol was defined in a non-ELF file.  Catch that case here.
@@ -2187,26 +2137,27 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
         a dynamic object, and then later in a non-ELF regular object.  */
       if ((h->root.type == bfd_link_hash_defined
           || h->root.type == bfd_link_hash_defweak)
-         && !h->def_regular
+         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
          && (h->root.u.def.section->owner != NULL
              ? (bfd_get_flavour (h->root.u.def.section->owner)
                 != bfd_target_elf_flavour)
              : (bfd_is_abs_section (h->root.u.def.section)
-                && !h->def_dynamic)))
-       h->def_regular = 1;
+                && (h->elf_link_hash_flags
+                    & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
+       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
     }
 
   /* If this is a final link, and the symbol was defined as a common
      symbol in a regular object file, and there was no definition in
      any dynamic object, then the linker will have allocated space for
-     the symbol in a common section but the DEF_REGULAR
+     the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
      flag will not have been set.  */
   if (h->root.type == bfd_link_hash_defined
-      && !h->def_regular
-      && h->ref_regular
-      && !h->def_dynamic
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
       && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
-    h->def_regular = 1;
+    h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 
   /* If -Bsymbolic was used (which means to bind references to global
      symbols to the definition within the shared object), and this
@@ -2214,12 +2165,12 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
      need a PLT entry.  Likewise, if the symbol has non-default
      visibility.  If the symbol has hidden or internal visibility, we
      will force it local.  */
-  if (h->needs_plt
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
       && eif->info->shared
       && is_elf_hash_table (eif->info->hash)
       && (eif->info->symbolic
          || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
-      && h->def_regular)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
     {
       const struct elf_backend_data *bed;
       bfd_boolean force_local;
@@ -2244,11 +2195,11 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
   /* If this is a weak defined symbol in a dynamic object, and we know
      the real definition in the dynamic object, copy interesting flags
      over to the real definition.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
       struct elf_link_hash_entry *weakdef;
 
-      weakdef = h->u.weakdef;
+      weakdef = h->weakdef;
       if (h->root.type == bfd_link_hash_indirect)
        h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
@@ -2256,13 +2207,13 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
                  || h->root.type == bfd_link_hash_defweak);
       BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
                  || weakdef->root.type == bfd_link_hash_defweak);
-      BFD_ASSERT (weakdef->def_dynamic);
+      BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
 
       /* If the real definition is defined by a regular object file,
         don't do anything special.  See the longer description in
         _bfd_elf_adjust_dynamic_symbol, below.  */
-      if (weakdef->def_regular)
-       h->u.weakdef = NULL;
+      if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+       h->weakdef = NULL;
       else
        {
          const struct elf_backend_data *bed;
@@ -2315,11 +2266,11 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
      to the dynamic symbol table.  FIXME: Do we normally need to worry
      about symbols which are defined by one dynamic object and
      referenced by another one?  */
-  if (!h->needs_plt
-      && (h->def_regular
-         || !h->def_dynamic
-         || (!h->ref_regular
-             && (h->u.weakdef == NULL || h->u.weakdef->dynindx == -1))))
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
+      && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+         || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+         || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
+             && (h->weakdef == NULL || h->weakdef->dynindx == -1))))
     {
       h->plt = elf_hash_table (eif->info)->init_offset;
       return TRUE;
@@ -2327,14 +2278,14 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
 
   /* If we've already adjusted this symbol, don't do it again.  This
      can happen via a recursive call.  */
-  if (h->dynamic_adjusted)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
     return TRUE;
 
   /* Don't look at this symbol again.  Note that we must set this
      after checking the above conditions, because we may look at a
      symbol once, decide not to do anything, and then get called
      recursively later after REF_REGULAR is set below.  */
-  h->dynamic_adjusted = 1;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
 
   /* If this is a weak definition, and we know a real definition, and
      the real symbol is not itself defined by a regular object file,
@@ -2364,15 +2315,15 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
      wind up at different memory locations.  The tzset call will set
      _timezone, leaving timezone unchanged.  */
 
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
       /* If we get to this point, we know there is an implicit
         reference by a regular object file via the weak symbol H.
         FIXME: Is this really true?  What if the traversal finds
-        H->U.WEAKDEF before it finds H?  */
-      h->u.weakdef->ref_regular = 1;
+        H->WEAKDEF before it finds H?  */
+      h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
 
-      if (! _bfd_elf_adjust_dynamic_symbol (h->u.weakdef, eif))
+      if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, eif))
        return FALSE;
     }
 
@@ -2383,7 +2334,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
      code, and the assembly code fails to set the symbol type.  */
   if (h->size == 0
       && h->type == STT_NOTYPE
-      && !h->needs_plt)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
     (*_bfd_error_handler)
       (_("warning: type and size of dynamic symbol `%s' are not defined"),
        h->root.root.string);
@@ -2448,7 +2399,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
   /* If it was forced local, then clearly it's not dynamic.  */
   if (h->dynindx == -1)
     return FALSE;
-  if (h->forced_local)
+  if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
     return FALSE;
 
   /* Identify the cases where name binding rules say that a
@@ -2474,7 +2425,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
     }
 
   /* If it isn't defined locally, then clearly it's dynamic.  */
-  if (!h->def_regular)
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return TRUE;
 
   /* Otherwise, the symbol is dynamic if binding rules don't tell
@@ -2502,11 +2453,11 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
     /* Do nothing.  */;
   /* If we don't have a definition in a regular file, then we can't
      resolve locally.  The sym is either undefined or dynamic.  */
-  else if (!h->def_regular)
+  else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return FALSE;
 
   /* Forced local symbols resolve locally.  */
-  if (h->forced_local)
+  if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
     return TRUE;
 
   /* As do non-dynamic symbols.  */
@@ -2700,10 +2651,6 @@ _bfd_elf_add_dynamic_entry (struct bfd_link_info *info,
   if (! is_elf_hash_table (hash_table))
     return FALSE;
 
-  if (info->warn_shared_textrel && info->shared && tag == DT_TEXTREL)
-    _bfd_error_handler
-      (_("warning: creating a DT_TEXTREL in a shared object."));
-
   bed = get_elf_backend_data (hash_table->dynobj);
   s = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
   BFD_ASSERT (s != NULL);
@@ -3649,7 +3596,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
          && (flags & BSF_WEAK) != 0
          && ELF_ST_TYPE (isym->st_info) != STT_FUNC
          && is_elf_hash_table (hash_table)
-         && h->u.weakdef == NULL)
+         && h->weakdef == NULL)
        {
          /* Keep a list of all weak defined non function symbols from
             a dynamic object, using the weakdef field.  Later in this
@@ -3663,7 +3610,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
             dynamic object, and we will be using that previous
             definition anyhow.  */
 
-         h->u.weakdef = weaks;
+         h->weakdef = weaks;
          weaks = h;
          new_weakdef = TRUE;
        }
@@ -3686,7 +3633,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
 
       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
@@ -3778,14 +3727,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
            (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition,
                                                        dynamic);
 
-         /* If this symbol has default visibility and the user has requested
-            we not re-export it, then mark it as hidden.  */
-         if (definition && !dynamic
-             && (abfd->no_export
-                 || (abfd->my_archive && abfd->my_archive->no_export))
-             && ELF_ST_VISIBILITY (isym->st_other) != STV_INTERNAL)
-           isym->st_other = STV_HIDDEN | (isym->st_other & ~ ELF_ST_VISIBILITY (-1));
-
          if (isym->st_other != 0 && !dynamic)
            {
              unsigned char hvis, symvis, other, nvis;
@@ -3812,36 +3753,39 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
             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)
                {
-                 h->ref_regular = 1;
+                 new_flag = ELF_LINK_HASH_REF_REGULAR;
                  if (bind != STB_WEAK)
-                   h->ref_regular_nonweak = 1;
+                   new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK;
                }
              else
-               h->def_regular = 1;
+               new_flag = ELF_LINK_HASH_DEF_REGULAR;
              if (! info->executable
-                 || h->def_dynamic
-                 || h->ref_dynamic)
+                 || (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC
+                                  | ELF_LINK_HASH_REF_DYNAMIC)) != 0)
                dynsym = TRUE;
            }
          else
            {
              if (! definition)
-               h->ref_dynamic = 1;
+               new_flag = ELF_LINK_HASH_REF_DYNAMIC;
              else
-               h->def_dynamic = 1;
-             if (h->def_regular
-                 || h->ref_regular
-                 || (h->u.weakdef != NULL
+               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->u.weakdef->dynindx != -1))
+                     && 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)
@@ -3871,11 +3815,11 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
            {
              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                goto error_free_vers;
-             if (h->u.weakdef != NULL
+             if (h->weakdef != NULL
                  && ! new_weakdef
-                 && h->u.weakdef->dynindx == -1)
+                 && h->weakdef->dynindx == -1)
                {
-                 if (! bfd_elf_link_record_dynamic_symbol (info, h->u.weakdef))
+                 if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
                    goto error_free_vers;
                }
            }
@@ -3895,7 +3839,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
          if (!add_needed
              && definition
              && dynsym
-             && h->ref_regular)
+             && (h->elf_link_hash_flags
+                 & ELF_LINK_HASH_REF_REGULAR) != 0)
            {
              int ret;
              const char *soname = elf_dt_name (abfd);
@@ -4040,8 +3985,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
          size_t i, j, idx;
 
          hlook = weaks;
-         weaks = hlook->u.weakdef;
-         hlook->u.weakdef = NULL;
+         weaks = hlook->weakdef;
+         hlook->weakdef = NULL;
 
          BFD_ASSERT (hlook->root.type == bfd_link_hash_defined
                      || hlook->root.type == bfd_link_hash_defweak
@@ -4092,7 +4037,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
                break;
              else if (h != hlook)
                {
-                 hlook->u.weakdef = h;
+                 hlook->weakdef = h;
 
                  /* If the weak definition is in the list of dynamic
                     symbols, make sure the real definition is put
@@ -4535,7 +4480,7 @@ elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data)
 
   /* And store it in the struct so that we can put it in the hash table
      later.  */
-  h->u.elf_hash_value = ha;
+  h->elf_hash_value = ha;
 
   if (alc != NULL)
     free (alc);
@@ -4920,7 +4865,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
              /* Mark this version if there is a definition and it is
                 not defined in a shared object.  */
              if (newh != NULL
-                 && !newh->def_dynamic
+                 && ((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;
@@ -4979,8 +4925,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
                                   FALSE, FALSE)
           : NULL);
       if (h != NULL
-         && (h->ref_regular
-             || h->def_regular))
+         && (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;
@@ -4991,8 +4937,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
                                   FALSE, FALSE)
           : NULL);
       if (h != NULL
-         && (h->ref_regular
-             || h->def_regular))
+         && (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;
@@ -5181,8 +5127,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
                      get_elf_backend_data (dynobj)->collect, &bh)))
                return FALSE;
              h = (struct elf_link_hash_entry *) bh;
-             h->non_elf = 0;
-             h->def_regular = 1;
+             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;
 
@@ -5719,14 +5665,6 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
        bfd_byte *erel, *erelend;
        asection *o = lo->u.indirect.section;
 
-       if (o->contents == NULL && o->size != 0)
-         {
-           /* This is a reloc section that is being handled as a normal
-              section.  See bfd_section_from_shdr.  We can't combine
-              relocs in this case.  */
-           free (sort);
-           return 0;
-         }
        erel = o->contents;
        erelend = o->contents + o->size;
        p = sort + o->output_offset / ext_size * sort_elt;
@@ -6054,12 +5992,12 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
   /* Decide whether to output this symbol in this pass.  */
   if (eoinfo->localsyms)
     {
-      if (!h->forced_local)
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
        return TRUE;
     }
   else
     {
-      if (h->forced_local)
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
        return TRUE;
     }
 
@@ -6070,8 +6008,8 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      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->ref_dynamic
-      && !h->ref_regular
+      && (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)
     {
@@ -6088,10 +6026,9 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      shared libraries.  */
   if (! finfo->info->relocatable
       && (! finfo->info->shared)
-      && h->forced_local
-      && h->ref_dynamic
-      && !h->dynamic_def
-      && !h->dynamic_weak
+      && (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)
@@ -6112,10 +6049,10 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      output it.  */
   if (h->indx == -2)
     strip = FALSE;
-  else if ((h->def_dynamic
-           || h->ref_dynamic)
-          && !h->def_regular
-          && !h->ref_regular)
+  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;
@@ -6135,13 +6072,13 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      nothing else to do unless it is a forced local symbol.  */
   if (strip
       && h->dynindx == -1
-      && !h->forced_local)
+      && (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->forced_local)
+  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)
@@ -6228,11 +6165,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      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->forced_local)
+       || (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->forced_local)
+         || (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)
@@ -6250,13 +6187,13 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
      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->ref_regular
+      && (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->ref_regular_nonweak)
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0)
        bindtype = STB_GLOBAL;
       else
        bindtype = STB_WEAK;
@@ -6269,7 +6206,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
       && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
       && ELF_ST_BIND (sym.st_info) != STB_WEAK
       && h->root.type == bfd_link_hash_undefined
-      && !h->def_regular)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     {
       (*_bfd_error_handler)
        (_("%B: %s symbol `%s' isn't defined"),
@@ -6301,7 +6238,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
       bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
 
       bucketcount = elf_hash_table (finfo->info)->bucketcount;
-      bucket = h->u.elf_hash_value % 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
@@ -6317,7 +6254,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
          Elf_Internal_Versym iversym;
          Elf_External_Versym *eversym;
 
-         if (!h->def_regular)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            {
              if (h->verinfo.verdef == NULL)
                iversym.vs_vers = 0;
@@ -6332,7 +6269,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
                iversym.vs_vers = h->verinfo.vertree->vernum + 1;
            }
 
-         if (h->hidden)
+         if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0)
            iversym.vs_vers |= VERSYM_HIDDEN;
 
          eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
@@ -6382,40 +6319,30 @@ elf_section_ignore_discarded_relocs (asection *sec)
   return FALSE;
 }
 
-enum action_discarded
-  {
-    COMPLAIN = 1,
-    PRETEND = 2
-  };
-
-/* Return a mask saying how ld should treat relocations in SEC against
-   symbols defined in discarded sections.  If this function returns
-   COMPLAIN set, ld will issue a warning message.  If this function
-   returns PRETEND set, and the discarded section was link-once and the
-   same size as the kept link-once section, ld will pretend that the
-   symbol was actually defined in the kept section.  Otherwise ld will
-   zero the reloc (at least that is the intent, but some cooperation by
-   the target dependent code is needed, particularly for REL targets).  */
-
-static unsigned int
-elf_action_discarded (asection *sec)
+/* 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 (sec->flags & SEC_DEBUGGING)
-    return PRETEND;
+  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 0;
+    return FALSE;
 
   if (strcmp (".gcc_except_table", sec->name) == 0)
-    return 0;
+    return FALSE;
 
   if (strcmp (".PARISC.unwind", sec->name) == 0)
-    return 0;
+    return FALSE;
 
   if (strcmp (".fixup", sec->name) == 0)
-    return 0;
+    return FALSE;
 
-  return COMPLAIN | PRETEND;
+  return TRUE;
 }
 
 /* Find a match between a section and a member of a section group.  */
@@ -6710,7 +6637,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
          if (!elf_section_ignore_discarded_relocs (o))
            {
              Elf_Internal_Rela *rel, *relend;
-             unsigned int action = elf_action_discarded (o);
+             bfd_boolean complain = elf_section_complain_discarded (o);
 
              rel = internal_relocs;
              relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel;
@@ -6751,10 +6678,44 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                     discarded section.  */
                  if ((sec = *ps) != NULL && elf_discarded_section (sec))
                    {
-                     asection *kept;
+                     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)
+                           {
+                             asection *member;
 
-                     BFD_ASSERT (r_symndx != 0);
-                     if (action & COMPLAIN)
+                             /* Check if it is a linkonce section or
+                                member of a comdat group.  */
+                             if (elf_sec_group (sec) == NULL
+                                 && sec->size == sec->kept_section->size)
+                               {
+                                 *ps = sec->kept_section;
+                                 continue;
+                               }
+                             else if (elf_sec_group (sec) != NULL
+                                      && (member = match_group_member (sec, sec->kept_section))
+                                      && sec->size == member->size)
+                               {
+                                 *ps = member;
+                                 continue;
+                               }
+                           }
+                       }
+                     else if (complain)
                        {
                          (*_bfd_error_handler)
                            (_("`%s' referenced in section `%A' of %B: "
@@ -6762,30 +6723,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                             o, input_bfd, sec, sec->owner, sym_name);
                        }
 
-                     /* Try to do the best we can to support buggy old
-                        versions of gcc.  If we've warned, or this is
-                        debugging info, pretend that the symbol is
-                        really defined in the kept linkonce section.
-                        FIXME: This is quite broken.  Modifying the
-                        symbol here means we will be changing all later
-                        uses of the symbol, not just in this section.
-                        The only thing that makes this half reasonable
-                        is that we warn in non-debug sections, and
-                        debug sections tend to come after other
-                        sections.  */
-                     kept = sec->kept_section;
-                     if (kept != NULL && (action & PRETEND))
-                       {
-                         if (elf_sec_group (sec) != NULL)
-                           kept = match_group_member (sec, kept);
-                         if (kept != NULL
-                             && sec->size == kept->size)
-                           {
-                             *ps = kept;
-                             continue;
-                           }
-                       }
-
                      /* 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,
@@ -8636,26 +8573,26 @@ elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
   /* Those that are not vtables.  */
-  if (h->vtable == NULL || h->vtable->parent == NULL)
+  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)
+  if (h->vtable_parent == (struct elf_link_hash_entry *) -1)
     return TRUE;
 
   /* If we've already been done, exit.  */
-  if (h->vtable->used && h->vtable->used[-1])
+  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);
+  elf_gc_propagate_vtable_entries_used (h->vtable_parent, okp);
 
-  if (h->vtable->used == NULL)
+  if (h->vtable_entries_used == NULL)
     {
       /* None of this table's entries were referenced.  Re-use the
         parent's table.  */
-      h->vtable->used = h->vtable->parent->vtable->used;
-      h->vtable->size = h->vtable->parent->vtable->size;
+      h->vtable_entries_used = h->vtable_parent->vtable_entries_used;
+      h->vtable_entries_size = h->vtable_parent->vtable_entries_size;
     }
   else
     {
@@ -8663,9 +8600,9 @@ elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
       bfd_boolean *cu, *pu;
 
       /* Or the parent's entries into ours.  */
-      cu = h->vtable->used;
+      cu = h->vtable_entries_used;
       cu[-1] = TRUE;
-      pu = h->vtable->parent->vtable->used;
+      pu = h->vtable_parent->vtable_entries_used;
       if (pu != NULL)
        {
          const struct elf_backend_data *bed;
@@ -8673,7 +8610,7 @@ elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
 
          bed = get_elf_backend_data (h->root.u.def.section->owner);
          log_file_align = bed->s->log_file_align;
-         n = h->vtable->parent->vtable->size >> log_file_align;
+         n = h->vtable_parent->vtable_entries_size >> log_file_align;
          while (n--)
            {
              if (*pu)
@@ -8701,7 +8638,7 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
 
   /* Take care of both those symbols that do not describe vtables as
      well as those that are not loaded.  */
-  if (h->vtable == NULL || h->vtable->parent == NULL)
+  if (h->vtable_parent == NULL)
     return TRUE;
 
   BFD_ASSERT (h->root.type == bfd_link_hash_defined
@@ -8723,11 +8660,11 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
     if (rel->r_offset >= hstart && rel->r_offset < hend)
       {
        /* If the entry is in use, do nothing.  */
-       if (h->vtable->used
-           && (rel->r_offset - hstart) < h->vtable->size)
+       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->used[entry])
+           if (h->vtable_entries_used[entry])
              continue;
          }
        /* Otherwise, kill it.  */
@@ -8749,7 +8686,7 @@ elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h,
 
   if ((h->root.type == bfd_link_hash_defined
        || h->root.type == bfd_link_hash_defweak)
-      && h->ref_dynamic)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC))
     h->root.u.def.section->flags |= SEC_KEEP;
 
   return TRUE;
@@ -8870,12 +8807,6 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
   return FALSE;
 
  win:
-  if (!child->vtable)
-    {
-      child->vtable = bfd_zalloc (abfd, sizeof (*child->vtable));
-      if (!child->vtable)
-       return FALSE;
-    }
   if (!h)
     {
       /* This *should* only be the absolute section.  It could potentially
@@ -8883,10 +8814,10 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
         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;
+      child->vtable_parent = (struct elf_link_hash_entry *) -1;
     }
   else
-    child->vtable->parent = h;
+    child->vtable_parent = h;
 
   return TRUE;
 }
@@ -8902,17 +8833,10 @@ bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   unsigned int log_file_align = bed->s->log_file_align;
 
-  if (!h->vtable)
-    {
-      h->vtable = bfd_zalloc (abfd, sizeof (*h->vtable));
-      if (!h->vtable)
-       return FALSE;
-    }
-
-  if (addend >= h->vtable->size)
+  if (addend >= h->vtable_entries_size)
     {
       size_t size, bytes, file_align;
-      bfd_boolean *ptr = h->vtable->used;
+      bfd_boolean *ptr = h->vtable_entries_used;
 
       /* While the symbol is undefined, we have to be prepared to handle
         a zero size.  */
@@ -8943,7 +8867,7 @@ bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
            {
              size_t oldbytes;
 
-             oldbytes = (((h->vtable->size >> log_file_align) + 1)
+             oldbytes = (((h->vtable_entries_size >> log_file_align) + 1)
                          * sizeof (bfd_boolean));
              memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes);
            }
@@ -8955,11 +8879,11 @@ bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
        return FALSE;
 
       /* And arrange for that done flag to be at index -1.  */
-      h->vtable->used = ptr + 1;
-      h->vtable->size = size;
+      h->vtable_entries_used = ptr + 1;
+      h->vtable_entries_size = size;
     }
 
-  h->vtable->used[addend >> log_file_align] = TRUE;
+  h->vtable_entries_used[addend >> log_file_align] = TRUE;
 
   return TRUE;
 }
@@ -9276,11 +9200,88 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
   return ret;
 }
 
+struct already_linked_section
+{
+  asection *sec;
+  asection *linked;
+};
+
+/* Check if the member of a single member comdat group matches a
+   linkonce section and vice versa.  */
+static bfd_boolean
+try_match_symbols_in_sections
+  (struct bfd_section_already_linked_hash_entry *h, void *info)
+{
+  struct bfd_section_already_linked *l;
+  struct already_linked_section *s
+    = (struct already_linked_section *) info;
+
+  if (elf_sec_group (s->sec) == NULL)
+    {
+      /* It is a linkonce section. Try to match it with the member of a
+        single member comdat group. */
+      for (l = h->entry; l != NULL; l = l->next)
+       if ((l->sec->flags & SEC_GROUP))
+         {
+           asection *first = elf_next_in_group (l->sec);
+
+           if (first != NULL
+               && elf_next_in_group (first) == first
+               && bfd_elf_match_symbols_in_sections (first, s->sec))
+             {
+               s->linked = first;
+               return FALSE;
+             }
+         }
+    }
+  else
+    {
+      /* It is the member of a single member comdat group. Try to match
+        it with a linkonce section.  */
+      for (l = h->entry; l != NULL; l = l->next)
+       if ((l->sec->flags & SEC_GROUP) == 0
+           && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL
+           && bfd_elf_match_symbols_in_sections (l->sec, s->sec))
+         {
+           s->linked = l->sec;
+           return FALSE;
+         }
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+already_linked (asection *sec, asection *group)
+{
+  struct already_linked_section result;
+
+  result.sec = sec;
+  result.linked = NULL;
+
+  bfd_section_already_linked_table_traverse
+    (try_match_symbols_in_sections, &result);
+
+  if (result.linked)
+    {
+      sec->output_section = bfd_abs_section_ptr;
+      sec->kept_section = result.linked;
+
+      /* Also discard the group section.  */
+      if (group)
+       group->output_section = bfd_abs_section_ptr;
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
 void
 _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
 {
   flagword flags;
-  const char *name, *p;
+  const char *name;
   struct bfd_section_already_linked *l;
   struct bfd_section_already_linked_hash_entry *already_linked_list;
   asection *group;
@@ -9330,13 +9331,7 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
 
   name = bfd_get_section_name (abfd, sec);
 
-  if (strncmp (name, ".gnu.linkonce.", sizeof (".gnu.linkonce.") - 1) == 0
-      && (p = strchr (name + sizeof (".gnu.linkonce.") - 1, '.')) != NULL)
-    p++;
-  else
-    p = name;
-
-  already_linked_list = bfd_section_already_linked_table_lookup (p);
+  already_linked_list = bfd_section_already_linked_table_lookup (name);
 
   for (l = already_linked_list->entry; l != NULL; l = l->next)
     {
@@ -9346,11 +9341,10 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
         a linkonce section with a linkonce section, and ignore comdat
         section.  */
       if ((flags & SEC_GROUP) == (l->sec->flags & SEC_GROUP)
-         && strcmp (name, l->sec->name) == 0
          && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL)
        {
          /* The section has already been linked.  See if we should
-            issue a warning.  */
+             issue a warning.  */
          switch (flags & SEC_LINK_DUPLICATES)
            {
            default:
@@ -9439,39 +9433,15 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
         section. We only record the discarded comdat group. Otherwise
         the undiscarded group will be discarded incorrectly later since
         itself has been recorded.  */
-      for (l = already_linked_list->entry; l != NULL; l = l->next)
-       if ((l->sec->flags & SEC_GROUP) == 0
-           && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL
-           && bfd_elf_match_symbols_in_sections (l->sec,
-                                                 elf_next_in_group (sec)))
-         {
-           elf_next_in_group (sec)->output_section = bfd_abs_section_ptr;
-           elf_next_in_group (sec)->kept_section = l->sec;
-           group->output_section = bfd_abs_section_ptr;
-           break;
-         }
-      if (l == NULL)
+      if (! already_linked (elf_next_in_group (sec), group))
        return;
     }
   else
     /* There is no direct match. But for linkonce section, we should
        check if there is a match with comdat group member. We always
        record the linkonce section, discarded or not.  */
-    for (l = already_linked_list->entry; l != NULL; l = l->next)
-      if (l->sec->flags & SEC_GROUP)
-       {
-         asection *first = elf_next_in_group (l->sec);
-
-         if (first != NULL
-             && elf_next_in_group (first) == first
-             && bfd_elf_match_symbols_in_sections (first, sec))
-           {
-             sec->output_section = bfd_abs_section_ptr;
-             sec->kept_section = l->sec;
-             break;
-           }
-       }
-
+    already_linked (sec, group);
+  
   /* This is the first section with this name.  Record it.  */
   bfd_section_already_linked_table_insert (already_linked_list, sec);
 }
index 093adbc47c296d4475bb41b98e285c43ad5f1f00..a3a69e4089795b052022f5260915ba1e0a349468 100644 (file)
@@ -924,7 +924,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
             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);
@@ -1125,7 +1125,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
      enough that the data segment moves, which will change the GP.
      Reset the GP so that we re-calculate next round.  We need to
      do this at the _beginning_ of the next round; now will not do.  */
-
+      
   /* Clean up and go home.  */
   while (fixups)
     {
@@ -1641,10 +1641,12 @@ elfNN_ia64_hash_copy_indirect (bed, xdir, xind)
   /* Copy down any references that we may have already seen to the
      symbol which just became indirect.  */
 
-  dir->root.ref_dynamic |= ind->root.ref_dynamic;
-  dir->root.ref_regular |= ind->root.ref_regular;
-  dir->root.ref_regular_nonweak |= ind->root.ref_regular_nonweak;
-  dir->root.needs_plt |= ind->root.needs_plt;
+  dir->root.elf_link_hash_flags |=
+    (ind->root.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));
 
   if (ind->root.root.type != bfd_link_hash_indirect)
     return;
@@ -2233,7 +2235,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
                 || h->root.type == bfd_link_hash_warning)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-         h->ref_regular = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
        }
 
       /* We can only get preliminary data on whether a symbol is
@@ -2242,9 +2244,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
         this may help reduce memory usage and processing time later.  */
       maybe_dynamic = FALSE;
       if (h && ((!info->executable
-                && (!info->symbolic
-                    || info->unresolved_syms_in_shared_libs == RM_IGNORE))
-               || !h->def_regular
+                && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+               || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                || h->root.type == bfd_link_hash_defweak))
        maybe_dynamic = TRUE;
 
@@ -2443,7 +2444,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
        {
           if (!ia64_info->root.dynobj)
            ia64_info->root.dynobj = abfd;
-         h->needs_plt = 1;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          dyn_i->want_plt = 1;
        }
       if (need_entry & NEED_FULL_PLT)
@@ -2458,7 +2459,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
              if (!pltoff)
                return FALSE;
            }
-
+         
          dyn_i->want_pltoff = 1;
        }
       if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
@@ -2650,7 +2651,7 @@ allocate_plt_entries (dyn_i, data)
               || h->root.type == bfd_link_hash_warning)
          h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-      /* ??? Versioned symbols seem to lose NEEDS_PLT.  */
+      /* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT.  */
       if (elfNN_ia64_dynamic_symbol_p (h, x->info, 0))
        {
          bfd_size_type offset = x->ofs;
@@ -2838,12 +2839,12 @@ elfNN_ia64_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                  || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                  || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -4178,7 +4179,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
            dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
            if (dyn_i->want_fptr)
              {
-               BFD_ASSERT (h == NULL || h->dynindx == -1);
+               BFD_ASSERT (h == NULL || h->dynindx == -1)
                if (!undef_weak_ref)
                  value = set_fptr_entry (output_bfd, info, dyn_i, value);
                dynindx = -1;
@@ -4262,7 +4263,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_IA64_PCREL64I:
          /* The PCREL21BI reloc is specifically not intended for use with
             dynamic relocs.  PCREL21F and PCREL21M are used for speculation
-            fixup code, and thus probably ought not be dynamic.  The
+            fixup code, and thus probably ought not be dynamic.  The 
             PCREL22 and PCREL64I relocs aren't emitted as dynamic relocs.  */
          if (dynamic_symbol_p)
            {
@@ -4574,7 +4575,7 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
             plt section.  Leave the value alone.  */
          /* ??? We didn't redefine it in adjust_dynamic_symbol in the
             first place.  But perhaps elflink.c did some for us.  */
-         if (!h->def_regular)
+         if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
            sym->st_shndx = SHN_UNDEF;
        }
 
index 64eff153c477fb87cd632e986c0c37dcccd1b9ec..56d0d78bc701dfa9d20e176853c4bc309d8ee2fe 100644 (file)
@@ -1490,10 +1490,10 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data)
 
   if (h->root.indx == -2)
     strip = FALSE;
-  else if ((h->root.def_dynamic
-           || h->root.ref_dynamic)
-          && !h->root.def_regular
-          && !h->root.ref_regular)
+  else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+           || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+          && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+          && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
     strip = TRUE;
   else if (einfo->info->strip == strip_all
           || (einfo->info->strip == strip_some
@@ -1611,7 +1611,7 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data)
       else
        h->esym.asym.value = 0;
     }
-  else if (h->root.needs_plt)
+  else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       struct mips_elf_link_hash_entry *hd = h;
       bfd_boolean no_fn_stub = h->no_fn_stub;
@@ -2411,8 +2411,10 @@ mips_elf_set_global_got_offset (void **entryp, void *p)
          entry->gotidx = arg->value * (long) g->assigned_gotno++;
          if (arg->info->shared
              || (elf_hash_table (arg->info)->dynamic_sections_created
-                 && entry->d.h->root.def_dynamic
-                 && !entry->d.h->root.def_regular))
+                 && ((entry->d.h->root.elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+                 && ((entry->d.h->root.elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_REGULAR) == 0)))
            ++arg->needed_relocs;
        }
       else
@@ -2762,7 +2764,7 @@ mips_elf_local_relocation_p (bfd *input_bfd,
       while (h->root.root.type == bfd_link_hash_indirect
             || h->root.root.type == bfd_link_hash_warning)
        h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
-      if (h->root.forced_local)
+      if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
        return TRUE;
     }
 
@@ -2908,8 +2910,8 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
     return FALSE;
 
   h = (struct elf_link_hash_entry *) bh;
-  h->non_elf = 0;
-  h->def_regular = 1;
+  h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
   if (info->shared
@@ -3235,7 +3237,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
          if (! elf_hash_table(info)->dynamic_sections_created
              || (info->shared
                  && (info->symbolic || h->root.dynindx == -1)
-                 && h->root.def_regular))
+                 && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
            {
              /* This is a static link or a -Bsymbolic link.  The
                 symbol is defined locally, or was forced to be local.
@@ -3298,8 +3300,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
       if ((info->shared
           || (elf_hash_table (info)->dynamic_sections_created
               && h != NULL
-              && h->root.def_dynamic
-              && !h->root.def_regular))
+              && ((h->root.elf_link_hash_flags
+                   & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+              && ((h->root.elf_link_hash_flags
+                   & ELF_LINK_HASH_DEF_REGULAR) == 0)))
          && r_symndx != 0
          && (input_section->flags & SEC_ALLOC) != 0)
        {
@@ -3853,14 +3857,16 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
       /* We must now calculate the dynamic symbol table index to use
         in the relocation.  */
       if (h != NULL
-         && (! info->symbolic || !h->root.def_regular)
+         && (! info->symbolic || (h->root.elf_link_hash_flags
+                                  & ELF_LINK_HASH_DEF_REGULAR) == 0)
          /* h->root.dynindx may be -1 if this symbol was marked to
             become local.  */
          && h->root.dynindx != -1)
        {
          indx = h->root.dynindx;
          if (SGI_COMPAT (output_bfd))
-           defined_p = h->root.def_regular;
+           defined_p = ((h->root.elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) != 0);
          else
            /* ??? glibc's ld.so just adds the final GOT entry to the
               relocation field.  It therefore treats relocs against
@@ -4807,8 +4813,8 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
        return FALSE;
 
       h = (struct elf_link_hash_entry *) bh;
-      h->non_elf = 0;
-      h->def_regular = 1;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
       if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -4919,8 +4925,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
            return FALSE;
 
          h = (struct elf_link_hash_entry *) bh;
-         h->non_elf = 0;
-         h->def_regular = 1;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_SECTION;
 
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -4964,8 +4970,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
        return FALSE;
 
       h = (struct elf_link_hash_entry *) bh;
-      h->non_elf = 0;
-      h->def_regular = 1;
+      h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_SECTION;
 
       if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -4988,8 +4994,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
            return FALSE;
 
          h = (struct elf_link_hash_entry *) bh;
-         h->non_elf = 0;
-         h->def_regular = 1;
+         h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+         h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
 
          if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -5312,7 +5318,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
              /* We need a stub, not a plt entry for the undefined
                 function.  But we record it as if it needs plt.  See
                 _bfd_elf_adjust_dynamic_symbol.  */
-             h->needs_plt = 1;
+             h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
              h->type = STT_FUNC;
            }
          break;
@@ -5332,9 +5338,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                hmips = (struct mips_elf_link_hash_entry *)
                  hmips->root.root.u.i.link;
 
-             if (hmips->root.def_regular
+             if ((hmips->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                  && ! (info->shared && ! info->symbolic
-                       && ! hmips->root.forced_local))
+                       && ! (hmips->root.elf_link_hash_flags
+                             & ELF_LINK_FORCED_LOCAL)))
                break;
            }
          /* Fall through.  */
@@ -5543,7 +5550,7 @@ _bfd_mips_relax_section (bfd *abfd, asection *sec,
                  || h->root.root.type == bfd_link_hash_defweak)
                 && h->root.root.u.def.section)
              || (link_info->shared && ! link_info->symbolic
-                 && !h->root.forced_local))
+                 && ! (h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)))
            continue;
 
          sym_sec = h->root.root.u.def.section;
@@ -5667,11 +5674,14 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && (h->needs_plt
-                 || h->u.weakdef != NULL
-                 || (h->def_dynamic
-                     && h->ref_regular
-                     && !h->def_regular)));
+             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+                 || h->weakdef != NULL
+                 || ((h->elf_link_hash_flags
+                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_REF_REGULAR) != 0
+                     && (h->elf_link_hash_flags
+                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
   /* If this symbol is defined in a dynamic object, we need to copy
      any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output
@@ -5680,7 +5690,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   if (! info->relocatable
       && hmips->possibly_dynamic_relocs != 0
       && (h->root.type == bfd_link_hash_defweak
-         || !h->def_regular))
+         || (h->elf_link_hash_flags
+             & ELF_LINK_HASH_DEF_REGULAR) == 0))
     {
       mips_elf_allocate_dynamic_relocations (dynobj,
                                             hmips->possibly_dynamic_relocs);
@@ -5692,7 +5703,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* For a function, create a stub, if allowed.  */
   if (! hmips->no_fn_stub
-      && h->needs_plt)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
     {
       if (! elf_hash_table (info)->dynamic_sections_created)
        return TRUE;
@@ -5701,7 +5712,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
         the symbol to the stub location.  This is required to make
         function pointers compare as equal between the normal
         executable and the shared library.  */
-      if (!h->def_regular)
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
        {
          /* We need .stub section.  */
          s = bfd_get_section_by_name (dynobj,
@@ -5723,7 +5734,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
   else if ((h->type == STT_FUNC)
-          && !h->needs_plt)
+          && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
     {
       /* This will set the entry for this symbol in the GOT to 0, and
          the dynamic linker will take care of this.  */
@@ -5734,12 +5745,12 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->weakdef != NULL)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+                 || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -6597,7 +6608,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
     }
 
   BFD_ASSERT (h->dynindx != -1
-             || h->forced_local);
+             || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0);
 
   sgot = mips_elf_got_section (dynobj, FALSE);
   BFD_ASSERT (sgot != NULL);
@@ -6640,8 +6651,10 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
              if (info->shared
                  || (elf_hash_table (info)->dynamic_sections_created
                      && p->d.h != NULL
-                     && p->d.h->root.def_dynamic
-                     && !p->d.h->root.def_regular))
+                     && ((p->d.h->root.elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+                     && ((p->d.h->root.elf_link_hash_flags
+                          & ELF_LINK_HASH_DEF_REGULAR) == 0)))
                {
                  /* Create an R_MIPS_REL32 relocation for this entry.  Due to
                     the various compatibility problems, it's easier to mock
index 81202f8cdeb5ea6ecda05365fab58fec5e0832f3..18a8d0f5d6955b38e50ca96b53a7c1d58a3fa33f 100644 (file)
 #ifndef bfd_elfNN_bfd_is_local_label_name
 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
 #endif
-#ifndef bfd_elfNN_bfd_is_target_special_symbol
-#define bfd_elfNN_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#endif
 
 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
index 2b06b922ce3efff387eb065183646fcbfd0772bd..2954ec8d12e9b437a0ceb573bf328ce7676198fa 100644 (file)
@@ -504,12 +504,12 @@ bfd_hash_traverse (table, func, info)
 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 const bfd_size_type hash_size_primes[] =
+  static bfd_size_type hash_size_primes[] =
     {
       1021, 4051, 8599, 16699
     };
-  size_t index;
 
   /* Work out best prime number near the hash_size.  */
   for (index = 0; index < ARRAY_SIZE (hash_size_primes) - 1; ++index)
index a1a7baa13e796573bdb67e78ede6f570ee25c172..aedcef0fcb5bb57518bbbd35f7a6261f829f9d0b 100644 (file)
@@ -193,7 +193,6 @@ msdos_set_section_contents (abfd, section, location, offset, count)
 #define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info
 #define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define msdos_get_lineno _bfd_nosymbols_get_lineno
-#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols
index c16a1ed15900f77b0ad0ea3986ce41ef4a05f5ec..aaf1f1124b258f66558e94213d3da3fd5e8b5bf1 100644 (file)
@@ -4018,8 +4018,6 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 #define ieee_update_armap_timestamp bfd_true
 #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
 
-#define ieee_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ieee_get_lineno _bfd_nosymbols_get_lineno
 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index c692b03b33abff2f4acd20d1def073a30d34d0b1..1392178fee27c24fe6c81e88355a7bad366176e6 100644 (file)
@@ -968,7 +968,6 @@ ihex_sizeof_headers (abfd, exec)
 #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
 #define ihex_print_symbol _bfd_nosymbols_print_symbol
 #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define ihex_get_lineno _bfd_nosymbols_get_lineno
 #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
index ef9eae1a9d9d32832b3acdff925c315cceed7143..a76289548895ca8a044cc139cec5006cf3dc2070 100644 (file)
@@ -606,11 +606,6 @@ extern bfd_boolean NAME(aout,bfd_free_cached_info)
 #define aout_32_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
-#ifndef aout_32_bfd_is_target_special_symbol
-#define aout_32_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#endif
-
 #ifndef WRITE_HEADERS
 #define WRITE_HEADERS(abfd, execp)                                           \
       {                                                                              \
index 86e6942ed6c1c332d08c9f7748c86bc4664e1489..7b6ca76e05a4429afaba2b78fd457306e783cba2 100644 (file)
@@ -299,8 +299,6 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
   ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
 #define _bfd_nosymbols_bfd_is_local_label_name \
   ((bfd_boolean (*) (bfd *, const char *)) bfd_false)
-#define _bfd_nosymbols_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
   ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
@@ -595,10 +593,10 @@ void bfd_assert
   (const char*,int);
 
 #define BFD_ASSERT(x) \
-  do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
+  { if (!(x)) bfd_assert(__FILE__,__LINE__); }
 
 #define BFD_FAIL() \
-  do { bfd_assert(__FILE__,__LINE__); } while (0)
+  { bfd_assert(__FILE__,__LINE__); }
 
 extern void _bfd_abort
   (const char *, int, const char *) ATTRIBUTE_NORETURN;
index c308d8812462efe78f673a886db43201a45112bf..4e9a4c27291fda4cdc6fa83504c0241ae1f152da 100644 (file)
@@ -304,8 +304,6 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
   ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
 #define _bfd_nosymbols_bfd_is_local_label_name \
   ((bfd_boolean (*) (bfd *, const char *)) bfd_false)
-#define _bfd_nosymbols_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
   ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
@@ -600,10 +598,10 @@ void bfd_assert
   (const char*,int);
 
 #define BFD_ASSERT(x) \
-  do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
+  { if (!(x)) bfd_assert(__FILE__,__LINE__); }
 
 #define BFD_FAIL() \
-  do { bfd_assert(__FILE__,__LINE__); } while (0)
+  { bfd_assert(__FILE__,__LINE__); }
 
 extern void _bfd_abort
   (const char *, int, const char *) ATTRIBUTE_NORETURN;
@@ -1113,7 +1111,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARM_ADRL_IMMEDIATE",
   "BFD_RELOC_ARM_OFFSET_IMM",
   "BFD_RELOC_ARM_SHIFT_IMM",
-  "BFD_RELOC_ARM_SMI",
   "BFD_RELOC_ARM_SWI",
   "BFD_RELOC_ARM_MULTI",
   "BFD_RELOC_ARM_CP_OFF_IMM",
@@ -1140,8 +1137,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARM_TARGET1",
   "BFD_RELOC_ARM_ROSEGREL32",
   "BFD_RELOC_ARM_SBREL32",
-  "BFD_RELOC_ARM_TARGET2",
-  "BFD_RELOC_ARM_PREL31",
   "BFD_RELOC_SH_PCDISP8BY2",
   "BFD_RELOC_SH_PCDISP12BY2",
   "BFD_RELOC_SH_IMM3",
@@ -1652,39 +1647,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_XTENSA_JMP_SLOT",
   "BFD_RELOC_XTENSA_RELATIVE",
   "BFD_RELOC_XTENSA_PLT",
-  "BFD_RELOC_XTENSA_DIFF8",
-  "BFD_RELOC_XTENSA_DIFF16",
-  "BFD_RELOC_XTENSA_DIFF32",
-  "BFD_RELOC_XTENSA_SLOT0_OP",
-  "BFD_RELOC_XTENSA_SLOT1_OP",
-  "BFD_RELOC_XTENSA_SLOT2_OP",
-  "BFD_RELOC_XTENSA_SLOT3_OP",
-  "BFD_RELOC_XTENSA_SLOT4_OP",
-  "BFD_RELOC_XTENSA_SLOT5_OP",
-  "BFD_RELOC_XTENSA_SLOT6_OP",
-  "BFD_RELOC_XTENSA_SLOT7_OP",
-  "BFD_RELOC_XTENSA_SLOT8_OP",
-  "BFD_RELOC_XTENSA_SLOT9_OP",
-  "BFD_RELOC_XTENSA_SLOT10_OP",
-  "BFD_RELOC_XTENSA_SLOT11_OP",
-  "BFD_RELOC_XTENSA_SLOT12_OP",
-  "BFD_RELOC_XTENSA_SLOT13_OP",
-  "BFD_RELOC_XTENSA_SLOT14_OP",
-  "BFD_RELOC_XTENSA_SLOT0_ALT",
-  "BFD_RELOC_XTENSA_SLOT1_ALT",
-  "BFD_RELOC_XTENSA_SLOT2_ALT",
-  "BFD_RELOC_XTENSA_SLOT3_ALT",
-  "BFD_RELOC_XTENSA_SLOT4_ALT",
-  "BFD_RELOC_XTENSA_SLOT5_ALT",
-  "BFD_RELOC_XTENSA_SLOT6_ALT",
-  "BFD_RELOC_XTENSA_SLOT7_ALT",
-  "BFD_RELOC_XTENSA_SLOT8_ALT",
-  "BFD_RELOC_XTENSA_SLOT9_ALT",
-  "BFD_RELOC_XTENSA_SLOT10_ALT",
-  "BFD_RELOC_XTENSA_SLOT11_ALT",
-  "BFD_RELOC_XTENSA_SLOT12_ALT",
-  "BFD_RELOC_XTENSA_SLOT13_ALT",
-  "BFD_RELOC_XTENSA_SLOT14_ALT",
   "BFD_RELOC_XTENSA_OP0",
   "BFD_RELOC_XTENSA_OP1",
   "BFD_RELOC_XTENSA_OP2",
index 495be6363851e9596d6c52d49e1887d994a92c67..b809f3a06618fcadc66257f68bbc737efba2a9ab 100644 (file)
@@ -272,8 +272,6 @@ extern bfd_boolean _bfd_ecoff_write_armap
 #define _bfd_ecoff_get_elt_at_index _bfd_generic_get_elt_at_index
 #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
 #define _bfd_ecoff_update_armap_timestamp bfd_true
-#define _bfd_ecoff_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 
 extern long _bfd_ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd));
 extern long _bfd_ecoff_canonicalize_symtab PARAMS ((bfd *abfd, asymbol **alocation));
index 8abf35967011d6cdd01b42d2d24cd6a110dacceb..aac7da907633e752708f27ad77030733834406cc 100644 (file)
@@ -455,7 +455,7 @@ _bfd_link_hash_newfunc (struct bfd_hash_entry *entry,
 
       /* Initialize the local fields.  */
       h->type = bfd_link_hash_new;
-      h->u.undef.next = NULL;
+      h->und_next = NULL;
     }
 
   return entry;
@@ -616,9 +616,9 @@ void
 bfd_link_add_undef (struct bfd_link_hash_table *table,
                    struct bfd_link_hash_entry *h)
 {
-  BFD_ASSERT (h->u.undef.next == NULL);
+  BFD_ASSERT (h->und_next == NULL);
   if (table->undefs_tail != NULL)
-    table->undefs_tail->u.undef.next = h;
+    table->undefs_tail->und_next = h;
   if (table->undefs == NULL)
     table->undefs = h;
   table->undefs_tail = h;
@@ -990,9 +990,9 @@ _bfd_generic_link_add_archive_symbols
             us to lose track of whether the symbol has been
             referenced).  */
          if (*pundef != info->hash->undefs_tail)
-           *pundef = (*pundef)->u.undef.next;
+           *pundef = (*pundef)->und_next;
          else
-           pundef = &(*pundef)->u.undef.next;
+           pundef = &(*pundef)->und_next;
          continue;
        }
 
@@ -1015,7 +1015,7 @@ _bfd_generic_link_add_archive_symbols
            }
          if (arh == NULL)
            {
-             pundef = &(*pundef)->u.undef.next;
+             pundef = &(*pundef)->und_next;
              continue;
            }
        }
@@ -1064,7 +1064,7 @@ _bfd_generic_link_add_archive_symbols
            }
        }
 
-      pundef = &(*pundef)->u.undef.next;
+      pundef = &(*pundef)->und_next;
     }
 
   archive_hash_table_free (&arsym_hash);
@@ -1694,8 +1694,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
 
        case REF:
          /* A reference to a defined symbol.  */
-         if (h->u.undef.next == NULL && info->hash->undefs_tail != h)
-           h->u.undef.next = h;
+         if (h->und_next == NULL && info->hash->undefs_tail != h)
+           h->und_next = h;
          break;
 
        case BIG:
@@ -1881,8 +1881,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
 
        case REFC:
          /* A reference to an indirect symbol.  */
-         if (h->u.undef.next == NULL && info->hash->undefs_tail != h)
-           h->u.undef.next = h;
+         if (h->und_next == NULL && info->hash->undefs_tail != h)
+           h->und_next = h;
          h = h->u.i.link;
          cycle = TRUE;
          break;
@@ -1897,10 +1897,10 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
        case CWARN:
          /* Warn if this symbol has been referenced already,
             otherwise add a warning.  A symbol has been referenced if
-            the u.undef.next field is not NULL, or it is the tail of the
+            the und_next field is not NULL, or it is the tail of the
             undefined symbol list.  The REF case above helps to
             ensure this.  */
-         if (h->u.undef.next != NULL || info->hash->undefs_tail == h)
+         if (h->und_next != NULL || info->hash->undefs_tail == h)
            {
              if (! (*info->callbacks->warning) (info, string, h->root.string,
                                                 hash_entry_bfd (h), NULL, 0))
index 19a19d4d0f698cfecfeaa320c117dfd5de56db32..c4c05ab84d8b05ddb7f345a67f7a7502e8ed7533 100644 (file)
@@ -44,8 +44,6 @@
 #define bfd_mach_o_new_section_hook _bfd_generic_new_section_hook
 #define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
 #define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
-#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno
 #define bfd_mach_o_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index a7745c1711583687482b0b9cb01d783072d45ec2..1b7eb86a4eebdaf7e058b3b8aeda833ef1550a73 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3255,8 +3255,6 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols)
 /* Perhaps we need to adjust this one; mmo labels (originally) without a
    leading ':' might more appropriately be called local.  */
 #define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define mmo_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 
 /* Is this one really used or defined by anyone?  */
 #define mmo_get_lineno _bfd_nosymbols_get_lineno
index 1c727ed5ca54aa6404e88f8f9895c26c47efc71f..30ae4b101f7e8c66c9c52b99e48c305bafaf270a 100644 (file)
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define nlm_print_symbol nlmNAME(print_symbol)
 #define nlm_get_symbol_info nlmNAME(get_symbol_info)
 #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define nlm_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define nlm_get_lineno _bfd_nosymbols_get_lineno
 #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index 16f6b6d5adff0e3675bc95c8f733338a50b1fbf7..c99919af0a966673de7a2fe8f769914cd0aa954f 100644 (file)
@@ -1489,7 +1489,6 @@ oasys_sizeof_headers (abfd, exec)
 #define oasys_update_armap_timestamp bfd_true
 
 #define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define oasys_get_lineno _bfd_nosymbols_get_lineno
 #define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define oasys_read_minisymbols _bfd_generic_read_minisymbols
index 627364c53ba049b9c4bc68605637a63ef4057a50..e54e099d07d96709e65e93610b7e1d22f3bd2532 100644 (file)
@@ -859,9 +859,9 @@ bfd_release (bfd *abfd, void *block)
 }
 
 
-/*
-   GNU Extension: separate debug-info files
-
+/* 
+   GNU Extension: separate debug-info files 
+   
    The idea here is that a special section called .gnu_debuglink might be
    embedded in a binary file, which indicates that some *other* file
    contains the real debugging information. This special section contains a
@@ -889,7 +889,7 @@ DESCRIPTION
 
 RETURNS
        Return the updated CRC32 value.
-*/
+*/     
 
 unsigned long
 bfd_calc_gnu_debuglink_crc32 (unsigned long crc,
@@ -1092,19 +1092,19 @@ find_separate_debug_file (bfd *abfd, const char *debug_file_directory)
       return NULL;
     }
   BFD_ASSERT (strlen (dir) != 0);
-
+  
   /* Strip off filename part.  */
   for (i = strlen (dir) - 1; i >= 0; i--)
     if (IS_DIR_SEPARATOR (dir[i]))
       break;
 
   dir[i + 1] = '\0';
-  BFD_ASSERT (dir[i] == '/' || dir[0] == '\0');
+  BFD_ASSERT (dir[i] == '/' || dir[0] == '\0')
 
   debugfile = malloc (strlen (debug_file_directory) + 1
                      + strlen (dir)
                      + strlen (".debug/")
-                     + strlen (basename)
+                     + strlen (basename) 
                      + 1);
   if (debugfile == NULL)
     {
@@ -1211,7 +1211,7 @@ DESCRIPTION
 
 RETURNS
        A pointer to the new section is returned if all is ok.  Otherwise <<NULL>> is
-       returned and bfd_error is set.
+       returned and bfd_error is set.  
 */
 
 asection *
@@ -1228,7 +1228,7 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
 
   /* Strip off any path components in filename.  */
   filename = lbasename (filename);
-
+  
   sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK);
   if (sect)
     {
@@ -1246,7 +1246,7 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
     /* XXX Should we delete the section from the bfd ?  */
     return NULL;
 
-
+  
   debuglink_size = strlen (filename) + 1;
   debuglink_size += 3;
   debuglink_size &= ~3;
@@ -1255,7 +1255,7 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
   if (! bfd_set_section_size (abfd, sect, debuglink_size))
     /* XXX Should we delete the section from the bfd ?  */
     return NULL;
-
+  
   return sect;
 }
 
@@ -1277,7 +1277,7 @@ DESCRIPTION
 
 RETURNS
        <<TRUE>> is returned if all is ok.  Otherwise <<FALSE>> is returned
-       and bfd_error is set.
+       and bfd_error is set.  
 */
 
 bfd_boolean
@@ -1320,7 +1320,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *abfd,
   /* Strip off any path components in filename,
      now that we no longer need them.  */
   filename = lbasename (filename);
-
+  
   debuglink_size = strlen (filename) + 1;
   debuglink_size += 3;
   debuglink_size &= ~3;
index d78970ddc937cea1eb2269065aaf3d65dd4e6eb2..be691fd7eebc0c23220a271ba15ee58f53a0e1db 100644 (file)
@@ -34,8 +34,6 @@
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".data"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".text"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
index 9bb3a76f155213171168289ddcb5682dc5a9ce32..b52ae65a0a120627e27a59c3915688f0e98ea8b4 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -37,7 +37,6 @@
 #define bfd_pef_bfd_free_cached_info                _bfd_generic_bfd_free_cached_info
 #define bfd_pef_new_section_hook                    _bfd_generic_new_section_hook
 #define bfd_pef_bfd_is_local_label_name             bfd_generic_is_local_label_name
-#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define bfd_pef_get_lineno                          _bfd_nosymbols_get_lineno
 #define bfd_pef_find_nearest_line                   _bfd_nosymbols_find_nearest_line
 #define bfd_pef_bfd_make_debug_symbol               _bfd_nosymbols_bfd_make_debug_symbol
index 4b36213309d7b0a9a23a74c989bc44b2411f62f4..4a59f143ad012a30e4d775a35028854c112a735e 100644 (file)
@@ -35,8 +35,6 @@
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".data"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".text"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
index cbf2abf6bcbeaccb5e1119975c6ed0a787b9d35e..a48688e171e9d8544ec88239a20c7868f53f7575 100644 (file)
@@ -65,9 +65,7 @@ cpu-alpha.c
 cpu-arc.c
 cpu-arm.c
 cpu-avr.c
-cpu-cr16c.c
 cpu-cris.c
-cpu-crx.c
 cpu-d10v.c
 cpu-d30v.c
 cpu-dlx.c
@@ -128,9 +126,7 @@ elf32-arc.c
 elf32-arm.h
 elf32-avr.c
 elf32.c
-elf32-cr16c.c
 elf32-cris.c
-elf32-crx.c
 elf32-d10v.c
 elf32-d30v.c
 elf32-dlx.c
@@ -163,7 +159,6 @@ elf32-s390.c
 elf32-sh64.c
 elf32-sh64-com.c
 elf32-sh.c
-elf32-sh-symbian.c
 elf32-sparc.c
 elf32-v850.c
 elf32-vax.c
index e26caba2cf55122aaf57aed6c5035548b2467c48..dd37e15cbeafe4b4dfd3a84c5c3fb4ed6a06baa4 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-09-17 15:33+0930\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"
@@ -17,7 +17,8 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 
 #: aout-adobe.c:204
-msgid "%B: Unknown section type in a.out.adobe file: %x\n"
+#, c-format
+msgid "%s: Unknown section type in a.out.adobe file: %x\n"
 msgstr ""
 
 #: aout-cris.c:207
@@ -26,141 +27,143 @@ msgid "%s: Invalid relocation type exported: %d"
 msgstr ""
 
 #: aout-cris.c:251
-msgid "%B: Invalid relocation type imported: %d"
+#, c-format
+msgid "%s: Invalid relocation type imported: %d"
 msgstr ""
 
 #: aout-cris.c:262
-msgid "%B: Bad relocation record imported: %d"
+#, c-format
+msgid "%s: Bad relocation record imported: %d"
 msgstr ""
 
-#: aoutx.h:1299 aoutx.h:1720
+#: aoutx.h:1296 aoutx.h:1717
 #, c-format
 msgid "%s: can not represent section `%s' in a.out object file format"
 msgstr ""
 
-#: aoutx.h:1686
+#: aoutx.h:1683
 #, c-format
 msgid ""
 "%s: can not represent section for symbol `%s' in a.out object file format"
 msgstr ""
 
-#: aoutx.h:1688
+#: aoutx.h:1685
 msgid "*unknown*"
 msgstr ""
 
-#: aoutx.h:3780
+#: aoutx.h:3777
 #, c-format
 msgid "%s: relocatable link from %s to %s not supported"
 msgstr ""
 
-#: archive.c:1764
+#: archive.c:1751
 msgid "Warning: writing archive was slow: rewriting timestamp\n"
 msgstr ""
 
-#: archive.c:2027
+#: archive.c:2014
 msgid "Reading archive file mod timestamp"
 msgstr ""
 
-#: archive.c:2053
+#: archive.c:2040
 msgid "Writing updated armap timestamp"
 msgstr ""
 
-#: bfd.c:276
+#: bfd.c:280
 msgid "No error"
 msgstr ""
 
-#: bfd.c:277
+#: bfd.c:281
 msgid "System call error"
 msgstr ""
 
-#: bfd.c:278
+#: bfd.c:282
 msgid "Invalid bfd target"
 msgstr ""
 
-#: bfd.c:279
+#: bfd.c:283
 msgid "File in wrong format"
 msgstr ""
 
-#: bfd.c:280
+#: bfd.c:284
 msgid "Archive object file in wrong format"
 msgstr ""
 
-#: bfd.c:281
+#: bfd.c:285
 msgid "Invalid operation"
 msgstr ""
 
-#: bfd.c:282
+#: bfd.c:286
 msgid "Memory exhausted"
 msgstr ""
 
-#: bfd.c:283
+#: bfd.c:287
 msgid "No symbols"
 msgstr ""
 
-#: bfd.c:284
+#: bfd.c:288
 msgid "Archive has no index; run ranlib to add one"
 msgstr ""
 
-#: bfd.c:285
+#: bfd.c:289
 msgid "No more archived files"
 msgstr ""
 
-#: bfd.c:286
+#: bfd.c:290
 msgid "Malformed archive"
 msgstr ""
 
-#: bfd.c:287
+#: bfd.c:291
 msgid "File format not recognized"
 msgstr ""
 
-#: bfd.c:288
+#: bfd.c:292
 msgid "File format is ambiguous"
 msgstr ""
 
-#: bfd.c:289
+#: bfd.c:293
 msgid "Section has no contents"
 msgstr ""
 
-#: bfd.c:290
+#: bfd.c:294
 msgid "Nonrepresentable section on output"
 msgstr ""
 
-#: bfd.c:291
+#: bfd.c:295
 msgid "Symbol needs debug section which does not exist"
 msgstr ""
 
-#: bfd.c:292
+#: bfd.c:296
 msgid "Bad value"
 msgstr ""
 
-#: bfd.c:293
+#: bfd.c:297
 msgid "File truncated"
 msgstr ""
 
-#: bfd.c:294
+#: bfd.c:298
 msgid "File too big"
 msgstr ""
 
-#: bfd.c:295
+#: bfd.c:299
 msgid "#<Invalid error code>"
 msgstr ""
 
-#: bfd.c:765
+#: bfd.c:687
 #, c-format
 msgid "BFD %s assertion fail %s:%d"
 msgstr ""
 
-#: bfd.c:781
+#: bfd.c:703
 #, c-format
 msgid "BFD %s internal error, aborting at %s line %d in %s\n"
 msgstr ""
 
-#: bfd.c:785
+#: bfd.c:707
 #, c-format
 msgid "BFD %s internal error, aborting at %s line %d\n"
 msgstr ""
 
-#: bfd.c:787
+#: bfd.c:709
 msgid "Please report this bug.\n"
 msgstr ""
 
@@ -179,8 +182,9 @@ msgstr ""
 msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
 msgstr ""
 
-#: coff64-rs6000.c:2107 coff-rs6000.c:3614
-msgid "%B: symbol `%s' has unrecognized smclas %d"
+#: coff64-rs6000.c:2108 coff-rs6000.c:3615
+#, c-format
+msgid "%s: symbol `%s' has unrecognized smclas %d"
 msgstr ""
 
 #: coff-a29k.c:120
@@ -203,193 +207,196 @@ msgstr ""
 msgid "missing IHIHALF reloc"
 msgstr ""
 
-#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1987 coff-mips.c:985
+#: coff-alpha.c:884 coff-alpha.c:921 coff-alpha.c:1992 coff-mips.c:1397
 msgid "GP relative relocation used when GP not defined"
 msgstr ""
 
-#: coff-alpha.c:1483
+#: coff-alpha.c:1488
 msgid "using multiple gp values"
 msgstr ""
 
-#: coff-arm.c:1066 elf32-arm.h:420
+#: coff-arm.c:1066 elf32-arm.h:465
 #, c-format
-msgid "%B: unable to find THUMB glue '%s' for `%s'"
+msgid "%s: unable to find THUMB glue '%s' for `%s'"
 msgstr ""
 
-#: coff-arm.c:1096 elf32-arm.h:454
+#: coff-arm.c:1096 elf32-arm.h:500
 #, c-format
-msgid "%B: unable to find ARM glue '%s' for `%s'"
+msgid "%s: unable to find ARM glue '%s' for `%s'"
 msgstr ""
 
-#: coff-arm.c:1400 elf32-arm.h:1114
+#: coff-arm.c:1400 coff-arm.c:1495 elf32-arm.h:1063 elf32-arm.h:1170
 #, c-format
-msgid ""
-"%B(%s): warning: interworking not enabled.\n"
-"  first occurrence: %B: arm call to thumb"
+msgid "%s(%s): warning: interworking not enabled."
 msgstr ""
 
-#: coff-arm.c:1490
+#: coff-arm.c:1404 elf32-arm.h:1173
 #, c-format
-msgid ""
-"%B(%s): warning: interworking not enabled.\n"
-"  first occurrence: %B: thumb call to arm\n"
-"  consider relinking with --support-old-code enabled"
+msgid "  first occurrence: %s: arm call to thumb"
 msgstr ""
 
-#: coff-arm.c:1787 cofflink.c:3008 coff-tic80.c:687
-msgid "%B: bad reloc address 0x%lx in section `%A'"
+#: coff-arm.c:1499 elf32-arm.h:1066
+#, c-format
+msgid "  first occurrence: %s: thumb call to arm"
 msgstr ""
 
-#: coff-arm.c:2129
-msgid "%B: illegal symbol index in reloc: %d"
+#: coff-arm.c:1502
+msgid "  consider relinking with --support-old-code enabled"
 msgstr ""
 
-#: coff-arm.c:2262
+#: coff-arm.c:1797 cofflink.c:2987 coff-tic80.c:687
 #, c-format
-msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
+msgid "%s: bad reloc address 0x%lx in section `%s'"
 msgstr ""
 
-#: coff-arm.c:2278 elf32-arm.h:2445
+#: coff-arm.c:2141
+#, c-format
+msgid "%s: illegal symbol index in reloc: %d"
+msgstr ""
+
+#: coff-arm.c:2274
+#, c-format
+msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d"
+msgstr ""
+
+#: coff-arm.c:2289 elf32-arm.h:2482
 #, c-format
 msgid ""
-"ERROR: %B passes floats in float registers, whereas %B passes them in "
+"ERROR: %s passes floats in float registers, whereas %s passes them in "
 "integer registers"
 msgstr ""
 
-#: coff-arm.c:2281 elf32-arm.h:2449
+#: coff-arm.c:2292 elf32-arm.h:2487
 #, c-format
 msgid ""
-"ERROR: %B passes floats in integer registers, whereas %B passes them in "
+"ERROR: %s passes floats in integer registers, whereas %s passes them in "
 "float registers"
 msgstr ""
 
-#: coff-arm.c:2295
+#: coff-arm.c:2307
 #, c-format
 msgid ""
-"ERROR: %B is compiled as position independent code, whereas target %B is "
+"ERROR: %s is compiled as position independent code, whereas target %s is "
 "absolute position"
 msgstr ""
 
-#: coff-arm.c:2298
+#: coff-arm.c:2310
 #, c-format
 msgid ""
-"ERROR: %B is compiled as absolute position code, whereas target %B is "
+"ERROR: %s is compiled as absolute position code, whereas target %s is "
 "position independent"
 msgstr ""
 
-#: coff-arm.c:2326 elf32-arm.h:2514
+#: coff-arm.c:2339 elf32-arm.h:2559
 #, c-format
-msgid "Warning: %B supports interworking, whereas %B does not"
+msgid "Warning: %s supports interworking, whereas %s does not"
 msgstr ""
 
-#: coff-arm.c:2329 elf32-arm.h:2520
+#: coff-arm.c:2342 elf32-arm.h:2566
 #, c-format
-msgid "Warning: %B does not support interworking, whereas %B does"
+msgid "Warning: %s does not support interworking, whereas %s does"
 msgstr ""
 
-#: coff-arm.c:2355
+#: coff-arm.c:2369
 #, c-format
 msgid "private flags = %x:"
 msgstr ""
 
-#: coff-arm.c:2363 elf32-arm.h:2571
+#: coff-arm.c:2377 elf32-arm.h:2621
 #, c-format
 msgid " [floats passed in float registers]"
 msgstr ""
 
-#: coff-arm.c:2365
+#: coff-arm.c:2379
 #, c-format
 msgid " [floats passed in integer registers]"
 msgstr ""
 
-#: coff-arm.c:2368 elf32-arm.h:2574
+#: coff-arm.c:2382 elf32-arm.h:2624
 #, c-format
 msgid " [position independent]"
 msgstr ""
 
-#: coff-arm.c:2370
+#: coff-arm.c:2384
 #, c-format
 msgid " [absolute position]"
 msgstr ""
 
-#: coff-arm.c:2374
+#: coff-arm.c:2388
 #, c-format
 msgid " [interworking flag not initialised]"
 msgstr ""
 
-#: coff-arm.c:2376
+#: coff-arm.c:2390
 #, c-format
 msgid " [interworking supported]"
 msgstr ""
 
-#: coff-arm.c:2378
+#: coff-arm.c:2392
 #, c-format
 msgid " [interworking not supported]"
 msgstr ""
 
-#: coff-arm.c:2426 elf32-arm.h:2256
+#: coff-arm.c:2440 elf32-arm.h:2286
 #, c-format
 msgid ""
-"Warning: Not setting interworking flag of %B since it has already been "
+"Warning: Not setting interworking flag of %s since it has already been "
 "specified as non-interworking"
 msgstr ""
 
-#: coff-arm.c:2430 elf32-arm.h:2260
+#: coff-arm.c:2444 elf32-arm.h:2290
 #, c-format
-msgid "Warning: Clearing the interworking flag of %B due to outside request"
-msgstr ""
-
-#: coffcode.h:859
-msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
-msgstr ""
-
-#. 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.
-#: coffcode.h:1075
-msgid ""
-"%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
+msgid "Warning: Clearing the interworking flag of %s due to outside request"
 msgstr ""
 
-#: coffcode.h:1131
-msgid "%B (%s): Section flag %s (0x%x) ignored"
+#: coffcode.h:1112
+#, c-format
+msgid "%s (%s): Section flag %s (0x%x) ignored"
 msgstr ""
 
-#: coffcode.h:2243
+#: coffcode.h:2224
 #, c-format
 msgid "Unrecognized TI COFF target id '0x%x'"
 msgstr ""
 
-#: coffcode.h:4449
-msgid "%B: warning: line number table read failed"
+#: coffcode.h:4428
+#, c-format
+msgid "%s: warning: line number table read failed"
 msgstr ""
 
-#: coffcode.h:4481
-msgid "%B: warning: illegal symbol index %ld in line numbers"
+#: coffcode.h:4461
+#, c-format
+msgid "%s: warning: illegal symbol index %ld in line numbers"
 msgstr ""
 
-#: coffcode.h:4495
-msgid "%B: warning: duplicate line number information for `%s'"
+#: coffcode.h:4475
+#, c-format
+msgid "%s: warning: duplicate line number information for `%s'"
 msgstr ""
 
-#: coffcode.h:4850
-msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
+#: coffcode.h:4831
+#, c-format
+msgid "%s: Unrecognized storage class %d for %s symbol `%s'"
 msgstr ""
 
-#: coffcode.h:4983
-msgid "warning: %B: local symbol `%s' has no section"
+#: coffcode.h:4964
+#, c-format
+msgid "warning: %s: local symbol `%s' has no section"
 msgstr ""
 
-#: coffcode.h:5089 coff-i860.c:610 coff-tic54x.c:367
-msgid "%B: warning: illegal symbol index %ld in relocs"
+#: coffcode.h:5071 coff-i860.c:610 coff-tic4x.c:218 coff-tic54x.c:366
+#, c-format
+msgid "%s: warning: illegal symbol index %ld in relocs"
 msgstr ""
 
-#: coffcode.h:5127
-msgid "%B: illegal relocation type %d at address 0x%lx"
+#: coffcode.h:5109
+#, c-format
+msgid "%s: illegal relocation type %d at address 0x%lx"
 msgstr ""
 
 #: coffgen.c:1666
-msgid "%B: bad string table size %lu"
+#, c-format
+msgid "%s: bad string table size %lu"
 msgstr ""
 
 #: coff-h8300.c:1124
@@ -406,32 +413,44 @@ msgstr ""
 msgid "uncertain calling convention for non-COFF symbol"
 msgstr ""
 
-#: cofflink.c:507 elflink.c:3711
-msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
+#: cofflink.c:506 elflink.c:3665
+#, c-format
+msgid "Warning: type of symbol `%s' changed from %d to %d in %s"
 msgstr ""
 
-#: cofflink.c:2295
-msgid "%B: relocs in section `%A', but it has no contents"
+#: cofflink.c:2293
+#, c-format
+msgid "%s: relocs in section `%s', but it has no contents"
 msgstr ""
 
-#: cofflink.c:2626 coffswap.h:890
+#: cofflink.c:2629 coffswap.h:890
 #, c-format
 msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
 msgstr ""
 
-#: cofflink.c:2635 coffswap.h:876
+#: cofflink.c:2638 coffswap.h:876
 #, c-format
 msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
 msgstr ""
 
-#: coff-m68k.c:482 elf32-m68k.c:2129
+#: coff-m68k.c:482 coff-mips.c:2394 elf32-m68k.c:2145 elf32-mips.c:1405
 msgid "unsupported reloc type"
 msgstr ""
 
-#: coff-mips.c:686 elf32-mips.c:749 elf64-mips.c:1490 elfn32-mips.c:1301
+#: coff-mips.c:839 elf32-mips.c:795 elf64-mips.c:1490 elfn32-mips.c:1301
 msgid "GP relative relocation when _gp not defined"
 msgstr ""
 
+#. No other sections should appear in -membedded-pic
+#. code.
+#: coff-mips.c:2431
+msgid "reloc against unsupported section"
+msgstr ""
+
+#: coff-mips.c:2439
+msgid "reloc not properly aligned"
+msgstr ""
+
 #: coff-rs6000.c:2789
 #, c-format
 msgid "%s: unsupported relocation type 0x%02x"
@@ -442,582 +461,592 @@ msgstr ""
 msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
 msgstr ""
 
-#: coff-tic4x.c:170 coff-tic54x.c:282 coff-tic80.c:450
+#: coff-tic4x.c:170 coff-tic54x.c:281 coff-tic80.c:450
 #, c-format
 msgid "Unrecognized reloc type 0x%x"
 msgstr ""
 
-#: coff-tic4x.c:218
-#, c-format
-msgid "%s: warning: illegal symbol index %ld in relocs"
-msgstr ""
-
 #: coff-w65.c:364
 #, c-format
 msgid "ignoring reloc %s\n"
 msgstr ""
 
-#: cpu-arm.c:197 cpu-arm.c:206
-msgid "ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"
+#: cpu-arm.c:196 cpu-arm.c:206
+#, c-format
+msgid "ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"
 msgstr ""
 
-#: cpu-arm.c:338
+#: cpu-arm.c:344
 #, c-format
 msgid "warning: unable to update contents of %s section in %s"
 msgstr ""
 
-#: dwarf2.c:290
+#: dwarf2.c:289
 msgid "Dwarf Error: Can't find .debug_str section."
 msgstr ""
 
-#: dwarf2.c:308
+#: dwarf2.c:306
 #, c-format
 msgid ""
 "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str "
 "size (%lu)."
 msgstr ""
 
-#: dwarf2.c:443
+#: dwarf2.c:441
 msgid "Dwarf Error: Can't find .debug_abbrev section."
 msgstr ""
 
-#: dwarf2.c:458
+#: dwarf2.c:456
 #, c-format
 msgid ""
 "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size "
 "(%lu)."
 msgstr ""
 
-#: dwarf2.c:656
+#: dwarf2.c:654
 #, c-format
 msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
 msgstr ""
 
-#: dwarf2.c:828
+#: dwarf2.c:827
 msgid "Dwarf Error: mangled line number section (bad file number)."
 msgstr ""
 
-#: dwarf2.c:921
+#: dwarf2.c:920
 msgid "Dwarf Error: Can't find .debug_line section."
 msgstr ""
 
-#: dwarf2.c:938
+#: dwarf2.c:937
 #, c-format
 msgid ""
 "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%"
 "lu)."
 msgstr ""
 
-#: dwarf2.c:1143
+#: dwarf2.c:1142
 msgid "Dwarf Error: mangled line number section."
 msgstr ""
 
-#: dwarf2.c:1353 dwarf2.c:1502
+#: dwarf2.c:1352 dwarf2.c:1501
 #, c-format
 msgid "Dwarf Error: Could not find abbrev number %u."
 msgstr ""
 
-#: dwarf2.c:1463
+#: dwarf2.c:1462
 #, c-format
 msgid ""
 "Dwarf Error: found dwarf version '%u', this reader only handles version 2 "
 "information."
 msgstr ""
 
-#: dwarf2.c:1470
+#: dwarf2.c:1469
 #, c-format
 msgid ""
 "Dwarf Error: found address size '%u', this reader can not handle sizes "
 "greater than '%u'."
 msgstr ""
 
-#: dwarf2.c:1493
+#: dwarf2.c:1492
 #, c-format
 msgid "Dwarf Error: Bad abbrev number: %u."
 msgstr ""
 
-#: ecoff.c:1336
+#: ecoff.c:1339
 #, c-format
 msgid "Unknown basic type %d"
 msgstr ""
 
-#: ecoff.c:1596
+#: ecoff.c:1599
 #, c-format
 msgid ""
 "\n"
 "      End+1 symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1603 ecoff.c:1606
+#: ecoff.c:1606 ecoff.c:1609
 #, c-format
 msgid ""
 "\n"
 "      First symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1618
+#: ecoff.c:1621
 #, c-format
 msgid ""
 "\n"
 "      End+1 symbol: %-7ld   Type:  %s"
 msgstr ""
 
-#: ecoff.c:1625
+#: ecoff.c:1628
 #, c-format
 msgid ""
 "\n"
 "      Local symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1633
+#: ecoff.c:1636
 #, c-format
 msgid ""
 "\n"
 "      struct; End+1 symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1638
+#: ecoff.c:1641
 #, c-format
 msgid ""
 "\n"
 "      union; End+1 symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1643
+#: ecoff.c:1646
 #, c-format
 msgid ""
 "\n"
 "      enum; End+1 symbol: %ld"
 msgstr ""
 
-#: ecoff.c:1649
+#: ecoff.c:1652
 #, c-format
 msgid ""
 "\n"
 "      Type: %s"
 msgstr ""
 
-#: elf32-arm.h:787
-msgid "%B: BE8 images only valid in big-endian mode."
-msgstr ""
-
-#: elf32-arm.h:1009
-msgid ""
-"%B(%s): warning: interworking not enabled.\n"
-"  first occurrence: %B: thumb call to arm"
-msgstr ""
-
-#: elf32-arm.h:1371
-msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
+#: elf32-arm.h:1416
+#, c-format
+msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'."
 msgstr ""
 
-#: elf32-arm.h:1570
-msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
+#: elf32-arm.h:1612
+#, c-format
+msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'."
 msgstr ""
 
-#: elf32-arm.h:2061 elf32-sh.c:4793 elf64-sh64.c:1596
-msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
+#: 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:2145
-msgid "%B(%A): warning: unresolvable relocation %d against symbol `%s'"
+#: elf32-arm.h:2172
+#, c-format
+msgid ""
+"%s: warning: unresolvable relocation %d against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-arm.h:2196 elf32-avr.c:791 elf32-cr16c.c:770 elf32-cris.c:1371
-#: elf32-crx.c:884 elf32-d10v.c:563 elf32-fr30.c:599 elf32-frv.c:2557
-#: elf32-h8300.c:493 elf32-i860.c:1196 elf32-ip2k.c:1558 elf32-iq2000.c:666
-#: elf32-m32r.c:3252 elf32-m68hc1x.c:1189 elf32-msp430.c:502
-#: elf32-openrisc.c:415 elf32-v850.c:1745 elf32-xstormy16.c:948
-#: elf64-mmix.c:1517 elf-m10200.c:426 elf-m10300.c:1526
+#: 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:2200 elf32-avr.c:795 elf32-cr16c.c:774 elf32-cris.c:1375
-#: elf32-crx.c:888 elf32-d10v.c:567 elf32-fr30.c:603 elf32-frv.c:2561
-#: elf32-h8300.c:497 elf32-i860.c:1200 elf32-iq2000.c:670 elf32-m32r.c:3256
-#: elf32-m68hc1x.c:1193 elf32-msp430.c:506 elf32-openrisc.c:419
-#: elf32-v850.c:1749 elf32-xstormy16.c:952 elf64-mmix.c:1521 elf-m10200.c:430
-#: elf-m10300.c:1530 elfxx-mips.c:6405
+#: 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:2204 elf32-cr16c.c:778 elf32-crx.c:892 elf32-d10v.c:571
-#: elf32-h8300.c:501 elf32-m32r.c:3260 elf32-m68hc1x.c:1197 elf-m10200.c:434
-#: elf-m10300.c:1534
+#: 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:2208 elf32-avr.c:803 elf32-cr16c.c:782 elf32-cris.c:1383
-#: elf32-crx.c:896 elf32-d10v.c:575 elf32-fr30.c:611 elf32-frv.c:2569
-#: elf32-h8300.c:505 elf32-i860.c:1208 elf32-ip2k.c:1573 elf32-iq2000.c:678
-#: elf32-m32r.c:3264 elf32-m68hc1x.c:1201 elf32-msp430.c:514
-#: elf32-openrisc.c:427 elf32-v850.c:1769 elf32-xstormy16.c:960
-#: elf64-mmix.c:1529 elf-m10200.c:438 elf-m10300.c:1538
+#: 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:2306
+#: elf32-arm.h:2338
+#, c-format
 msgid ""
-"Warning: Clearing the interworking flag of %B because non-interworking code "
-"in %B has been linked with it"
+"Warning: Clearing the interworking flag of %s because non-interworking code "
+"in %s has been linked with it"
 msgstr ""
 
-#: elf32-arm.h:2421
+#: elf32-arm.h:2456
+#, c-format
 msgid ""
-"ERROR: %B is compiled for EABI version %d, whereas %B is compiled for "
+"ERROR: %s is compiled for EABI version %d, whereas %s is compiled for "
 "version %d"
 msgstr ""
 
-#: elf32-arm.h:2434
-msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
+#: elf32-arm.h:2470
+#, c-format
+msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"
 msgstr ""
 
-#: elf32-arm.h:2459
-msgid "ERROR: %B uses VFP instructions, whereas %B does not"
+#: elf32-arm.h:2498
+#, c-format
+msgid "ERROR: %s uses VFP instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2463
-msgid "ERROR: %B uses FPA instructions, whereas %B does not"
+#: elf32-arm.h:2503
+#, c-format
+msgid "ERROR: %s uses FPA instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2473
-msgid "ERROR: %B uses Maverick instructions, whereas %B does not"
+#: elf32-arm.h:2514
+#, c-format
+msgid "ERROR: %s uses Maverick instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2477
-msgid "ERROR: %B does not use Maverick instructions, whereas %B does"
+#: elf32-arm.h:2519
+#, c-format
+msgid "ERROR: %s does not use Maverick instructions, whereas %s does"
 msgstr ""
 
-#: elf32-arm.h:2496
-msgid "ERROR: %B uses software FP, whereas %B uses hardware FP"
+#: elf32-arm.h:2539
+#, c-format
+msgid "ERROR: %s uses software FP, whereas %s uses hardware FP"
 msgstr ""
 
-#: elf32-arm.h:2500
-msgid "ERROR: %B uses hardware FP, whereas %B uses software FP"
+#: elf32-arm.h:2544
+#, c-format
+msgid "ERROR: %s uses hardware FP, whereas %s uses software FP"
 msgstr ""
 
 #. 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:2547 elf32-cris.c:2967 elf32-m68hc1x.c:1333 elf32-m68k.c:397
-#: elf32-vax.c:546 elfxx-mips.c:9099
+#: 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:2556
+#: elf32-arm.h:2606
 #, c-format
 msgid " [interworking enabled]"
 msgstr ""
 
-#: elf32-arm.h:2564
+#: elf32-arm.h:2614
 #, c-format
 msgid " [VFP float format]"
 msgstr ""
 
-#: elf32-arm.h:2566
+#: elf32-arm.h:2616
 #, c-format
 msgid " [Maverick float format]"
 msgstr ""
 
-#: elf32-arm.h:2568
+#: elf32-arm.h:2618
 #, c-format
 msgid " [FPA float format]"
 msgstr ""
 
-#: elf32-arm.h:2577
+#: elf32-arm.h:2627
 #, c-format
 msgid " [new ABI]"
 msgstr ""
 
-#: elf32-arm.h:2580
+#: elf32-arm.h:2630
 #, c-format
 msgid " [old ABI]"
 msgstr ""
 
-#: elf32-arm.h:2583
+#: elf32-arm.h:2633
 #, c-format
 msgid " [software FP]"
 msgstr ""
 
-#: elf32-arm.h:2592
+#: elf32-arm.h:2642
 #, c-format
 msgid " [Version1 EABI]"
 msgstr ""
 
-#: elf32-arm.h:2595 elf32-arm.h:2606
+#: elf32-arm.h:2645 elf32-arm.h:2656
 #, c-format
 msgid " [sorted symbol table]"
 msgstr ""
 
-#: elf32-arm.h:2597 elf32-arm.h:2608
+#: elf32-arm.h:2647 elf32-arm.h:2658
 #, c-format
 msgid " [unsorted symbol table]"
 msgstr ""
 
-#: elf32-arm.h:2603
+#: elf32-arm.h:2653
 #, c-format
 msgid " [Version2 EABI]"
 msgstr ""
 
-#: elf32-arm.h:2611
+#: elf32-arm.h:2661
 #, c-format
 msgid " [dynamic symbols use segment index]"
 msgstr ""
 
-#: elf32-arm.h:2614
+#: elf32-arm.h:2664
 #, c-format
 msgid " [mapping symbols precede others]"
 msgstr ""
 
-#: elf32-arm.h:2621
+#: elf32-arm.h:2671
 #, c-format
 msgid " [Version3 EABI]"
 msgstr ""
 
-#: elf32-arm.h:2624
+#: elf32-arm.h:2674
 #, c-format
 msgid " [BE8]"
 msgstr ""
 
-#: elf32-arm.h:2627
+#: elf32-arm.h:2677
 #, c-format
 msgid " [LE8]"
 msgstr ""
 
-#: elf32-arm.h:2633
+#: elf32-arm.h:2683
 #, c-format
 msgid " <EABI version unrecognised>"
 msgstr ""
 
-#: elf32-arm.h:2640
+#: elf32-arm.h:2690
 #, c-format
 msgid " [relocatable executable]"
 msgstr ""
 
-#: elf32-arm.h:2643
+#: elf32-arm.h:2693
 #, c-format
 msgid " [has entry point]"
 msgstr ""
 
-#: elf32-arm.h:2648
+#: elf32-arm.h:2698
 #, c-format
 msgid "<Unrecognised flag bits set>"
 msgstr ""
 
-#: elf32-avr.c:799 elf32-cris.c:1379 elf32-fr30.c:607 elf32-frv.c:2565
-#: elf32-i860.c:1204 elf32-ip2k.c:1569 elf32-iq2000.c:674 elf32-msp430.c:510
-#: elf32-openrisc.c:423 elf32-v850.c:1753 elf32-xstormy16.c:956
-#: elf64-mmix.c:1525
+#: 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:920
-msgid "%B(%A): unresolvable relocation %s against symbol `%s'"
+#: elf32-cris.c:921
+#, c-format
+msgid "%s: unresolvable relocation %s against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:975
-msgid "%B(%A): No PLT nor GOT for relocation %s against symbol `%s'"
+#: 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:977
-msgid "%B(%A): No PLT for relocation %s against symbol `%s'"
+#: elf32-cris.c:980
+#, c-format
+msgid "%s: No PLT for relocation %s against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:983 elf32-cris.c:1115
+#: elf32-cris.c:984 elf32-cris.c:1117
 msgid "[whose name is lost]"
 msgstr ""
 
-#: elf32-cris.c:1101
-msgid "%B(%A): relocation %s with non-zero addend %d against local symbol"
+#: 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:1109
-msgid "%B(%A): relocation %s with non-zero addend %d against symbol `%s'"
+#: 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:1135
-msgid "%B(%A): relocation %s is not allowed for global symbol: `%s'"
+#: elf32-cris.c:1138
+#, c-format
+msgid ""
+"%s: relocation %s is not allowed for global symbol: `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:1150
-msgid "%B: relocation %s in section %A with no GOT created"
+#: elf32-cris.c:1153
+#, c-format
+msgid "%s: relocation %s in section %s with no GOT created"
 msgstr ""
 
-#: elf32-cris.c:1268
-msgid "%B: Internal inconsistency; no relocation section %s"
+#: elf32-cris.c:1272
+#, c-format
+msgid "%s: Internal inconsistency; no relocation section %s"
 msgstr ""
 
-#: elf32-cris.c:2489
+#: elf32-cris.c:2502
+#, c-format
 msgid ""
-"%B, section %A:\n"
+"%s, section %s:\n"
 "  relocation %s should not be used in a shared object; recompile with -fPIC"
 msgstr ""
 
-#: elf32-cris.c:2970
+#: elf32-cris.c:2983
 #, c-format
 msgid " [symbols have a _ prefix]"
 msgstr ""
 
-#: elf32-cris.c:3009
-msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols"
+#: elf32-cris.c:3022
+#, c-format
+msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols"
 msgstr ""
 
-#: elf32-cris.c:3010
-msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"
+#: elf32-cris.c:3023
+#, c-format
+msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"
 msgstr ""
 
-#: elf32-frv.c:2045
-msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"
+#: elf32-frv.c:2013
+msgid "Dynamic relocation references symbol with nonzero addend"
 msgstr ""
 
-#: elf32-frv.c:2059
+#: elf32-frv.c:2026
 msgid "relocation references symbol not defined in the module"
 msgstr ""
 
-#: elf32-frv.c:2155
+#: elf32-frv.c:2120
 msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend"
 msgstr ""
 
-#: elf32-frv.c:2194 elf32-frv.c:2307
+#: elf32-frv.c:2158 elf32-frv.c:2257
 msgid "cannot emit fixups in read-only section"
 msgstr ""
 
-#: elf32-frv.c:2220 elf32-frv.c:2347
+#: elf32-frv.c:2181 elf32-frv.c:2294
 msgid "cannot emit dynamic relocations in read-only section"
 msgstr ""
 
-#: elf32-frv.c:2265
+#: elf32-frv.c:2216
 msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
 msgstr ""
 
-#: elf32-frv.c:2444
+#: elf32-frv.c:2386
 msgid "relocations between different segments are not supported"
 msgstr ""
 
-#: elf32-frv.c:2445
+#: elf32-frv.c:2387
 msgid "warning: relocation references a different segment"
 msgstr ""
 
-#: elf32-frv.c:4236
-msgid "%B: unsupported relocation type %i"
-msgstr ""
-
-#: elf32-frv.c:4554
+#: elf32-frv.c:4390
 #, c-format
 msgid ""
 "%s: compiled with %s and linked with modules that use non-pic relocations"
 msgstr ""
 
-#: elf32-frv.c:4607 elf32-iq2000.c:862
+#: elf32-frv.c:4443 elf32-iq2000.c:862
 #, c-format
 msgid "%s: compiled with %s and linked with modules compiled with %s"
 msgstr ""
 
-#: elf32-frv.c:4619
+#: elf32-frv.c:4455
 #, c-format
 msgid ""
 "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%"
 "lx)"
 msgstr ""
 
-#: elf32-frv.c:4640
-#, c-format
-msgid "%s: cannot link non-fdpic object file into fdpic executable"
-msgstr ""
-
-#: elf32-frv.c:4644
-#, c-format
-msgid "%s: cannot link fdpic object file into non-fdpic executable"
-msgstr ""
-
-#: elf32-frv.c:4669 elf32-iq2000.c:900
+#: elf32-frv.c:4491 elf32-iq2000.c:900
 #, c-format
 msgid "private flags = 0x%lx:"
 msgstr ""
 
 #: elf32-gen.c:83 elf64-gen.c:83
-msgid "%B: Relocations in generic ELF (EM: %d)"
+#, c-format
+msgid "%s: Relocations in generic ELF (EM: %d)"
 msgstr ""
 
-#: elf32-hppa.c:542 elf32-m68hc1x.c:161 elf64-ppc.c:3635
-msgid "%B: cannot create stub entry %s"
+#: 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:3317
-msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
+#: 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:1176
+#: elf32-hppa.c:1167 elf64-x86-64.c:665 elf64-x86-64.c:790
+#, c-format
 msgid ""
-"%B: relocation %s can not be used when making a shared object; recompile "
+"%s: relocation %s can not be used when making a shared object; recompile "
 "with -fPIC"
 msgstr ""
 
-#: elf32-hppa.c:1196
+#: elf32-hppa.c:1187
+#, c-format
 msgid ""
-"%B: relocation %s should not be used when making a shared object; recompile "
+"%s: relocation %s should not be used when making a shared object; recompile "
 "with -fPIC"
 msgstr ""
 
-#: elf32-hppa.c:1384
+#: elf32-hppa.c:1377
 #, c-format
 msgid "Could not find relocation section for %s"
 msgstr ""
 
-#: elf32-hppa.c:2573
-msgid "%B: duplicate export stub %s"
+#: elf32-hppa.c:2572
+#, c-format
+msgid "%s: duplicate export stub %s"
 msgstr ""
 
-#: elf32-hppa.c:3164
+#: elf32-hppa.c:3162
+#, c-format
 msgid ""
-"%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
+"%s(%s+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
 msgstr ""
 
-#: elf32-hppa.c:3194
-msgid "%B(%A+0x%lx): fixing %s"
+#: elf32-hppa.c:3192
+#, c-format
+msgid "%s(%s+0x%lx): fixing %s"
 msgstr ""
 
-#: elf32-hppa.c:3809
-msgid "%B(%A+0x%lx): cannot handle %s for %s"
+#: elf32-hppa.c:3810
+#, c-format
+msgid "%s(%s+0x%lx): cannot handle %s for %s"
 msgstr ""
 
-#: elf32-hppa.c:4102
+#: elf32-hppa.c:4103
 msgid ".got section not immediately after .plt section"
 msgstr ""
 
 #: elf32-i386.c:326
-msgid "%B: invalid relocation type %d"
-msgstr ""
-
-#: elf32-i386.c:865 elf32-s390.c:984 elf32-sparc.c:916 elf32-xtensa.c:644
-#: elf64-s390.c:937 elf64-x86-64.c:645
-msgid "%B: bad symbol index: %d"
+#, c-format
+msgid "%s: invalid relocation type %d"
 msgstr ""
 
-#: elf32-i386.c:973 elf32-s390.c:1161 elf32-sh.c:6568 elf32-sparc.c:1039
-#: elf64-s390.c:1123
-msgid "%B: `%s' accessed both as normal and thread local symbol"
+#: 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:1088 elf32-s390.c:1270 elf64-ppc.c:4616 elf64-s390.c:1235
-#: elf64-x86-64.c:881
-msgid "%B: bad relocation section name `%s'"
+#: 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:2040
-msgid "%B: unrecognized relocation (0x%x) in section `%A'"
+#: 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:2912 elf32-m68k.c:1702 elf32-s390.c:2989 elf32-sparc.c:2845
-#: elf32-xtensa.c:2105 elf64-s390.c:2986 elf64-sparc.c:2615
-#: elf64-x86-64.c:2403
-msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
+#: 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:2951 elf32-m68k.c:1741 elf32-s390.c:3039 elf64-s390.c:3036
-#: elf64-x86-64.c:2446
-msgid "%B(%A+0x%lx): reloc against `%s': error %d"
+#: 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 ""
 
 #: elf32-ip2k.c:565 elf32-ip2k.c:571 elf32-ip2k.c:734 elf32-ip2k.c:740
@@ -1029,151 +1058,155 @@ msgstr ""
 msgid "ip2k relaxer: switch table header corrupt."
 msgstr ""
 
-#: elf32-ip2k.c:1385
+#: elf32-ip2k.c:1395
 #, c-format
 msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)."
 msgstr ""
 
-#: elf32-ip2k.c:1399
+#: elf32-ip2k.c:1409
 #, c-format
 msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)."
 msgstr ""
 
 #. Only if it's not an unresolved symbol.
-#: elf32-ip2k.c:1565
+#: elf32-ip2k.c:1575
 msgid "unsupported relocation between data/insn address spaces"
 msgstr ""
 
-#: elf32-iq2000.c:874
+#: 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 ""
 
-#: elf32-m32r.c:1532
+#: elf32-m32r.c:1487
 msgid "SDA relocation when _SDA_BASE_ not defined"
 msgstr ""
 
-#: elf32-m32r.c:2606 elf64-alpha.c:4179 elf64-alpha.c:4305 elf32-ia64.c:3905
-#: elf64-ia64.c:3905
-msgid "%B: unknown relocation type %d"
+#: 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:2791 elf64-sh64.c:1685 elf-m10300.c:1481
+#: 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:3189
-msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)"
+#: 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:4256
-msgid "%B: Instruction set mismatch with previous modules"
+#: elf32-m32r.c:4211
+#, c-format
+msgid "%s: Instruction set mismatch with previous modules"
 msgstr ""
 
-#: elf32-m32r.c:4278
+#: elf32-m32r.c:4234
 #, c-format
 msgid "private flags = %lx"
 msgstr ""
 
-#: elf32-m32r.c:4283
+#: elf32-m32r.c:4239
 #, c-format
 msgid ": m32r instructions"
 msgstr ""
 
-#: elf32-m32r.c:4284
+#: elf32-m32r.c:4240
 #, c-format
 msgid ": m32rx instructions"
 msgstr ""
 
-#: elf32-m32r.c:4285
+#: elf32-m32r.c:4241
 #, c-format
 msgid ": m32r2 instructions"
 msgstr ""
 
-#: elf32-m68hc1x.c:1101
+#: 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:1124
+#: 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:1143
+#: 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:1276
+#: elf32-m68hc1x.c:1277
+#, c-format
 msgid ""
-"%B: linking files compiled for 16-bit integers (-mshort) and others for 32-"
+"%s: linking files compiled for 16-bit integers (-mshort) and others for 32-"
 "bit integers"
 msgstr ""
 
-#: elf32-m68hc1x.c:1283
+#: elf32-m68hc1x.c:1285
+#, c-format
 msgid ""
-"%B: linking files compiled for 32-bit double (-fshort-double) and others for "
+"%s: linking files compiled for 32-bit double (-fshort-double) and others for "
 "64-bit double"
 msgstr ""
 
-#: elf32-m68hc1x.c:1292
-msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
-msgstr ""
-
-#: elf32-m68hc1x.c:1308 elf32-ppc.c:2321 elf64-sparc.c:3016 elfxx-mips.c:9060
-msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
+#: elf32-m68hc1x.c:1295
+#, c-format
+msgid "%s: linking files compiled for HCS12 with others compiled for HC12"
 msgstr ""
 
-#: elf32-m68hc1x.c:1336
+#: elf32-m68hc1x.c:1341
 #, c-format
 msgid "[abi=32-bit int, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1338
+#: elf32-m68hc1x.c:1343
 #, c-format
 msgid "[abi=16-bit int, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1341
+#: elf32-m68hc1x.c:1346
 #, c-format
 msgid "64-bit double, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1343
+#: elf32-m68hc1x.c:1348
 #, c-format
 msgid "32-bit double, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1346
+#: elf32-m68hc1x.c:1351
 #, c-format
 msgid "cpu=HC11]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1348
+#: elf32-m68hc1x.c:1353
 #, c-format
 msgid "cpu=HCS12]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1350
+#: elf32-m68hc1x.c:1355
 #, c-format
 msgid "cpu=HC12]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1353
+#: elf32-m68hc1x.c:1358
 #, c-format
 msgid " [memory=bank-model]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1355
+#: elf32-m68hc1x.c:1360
 #, c-format
 msgid " [memory=flat]"
 msgstr ""
@@ -1188,299 +1221,320 @@ msgstr ""
 msgid " [m68000]"
 msgstr ""
 
-#: elf32-mcore.c:353 elf32-mcore.c:455
-msgid "%B: Relocation %s (%d) is not currently supported.\n"
+#: elf32-mcore.c:353 elf32-mcore.c:456
+#, c-format
+msgid "%s: Relocation %s (%d) is not currently supported.\n"
 msgstr ""
 
 #: elf32-mcore.c:441
-msgid "%B: Unknown relocation type %d\n"
+#, c-format
+msgid "%s: Unknown relocation type %d\n"
 msgstr ""
 
-#: elf32-mips.c:922 elf64-mips.c:1693 elfn32-mips.c:1488
+#: elf32-mips.c:968 elf64-mips.c:1693 elfn32-mips.c:1488
 #, c-format
 msgid "Linking mips16 objects into %s format is not supported"
 msgstr ""
 
-#: elf32-ppc.c:2204
+#: elf32-ppc.c:2174
 #, c-format
 msgid "generic linker can't handle %s"
 msgstr ""
 
-#: elf32-ppc.c:2286
+#: elf32-ppc.c:2256
+#, c-format
 msgid ""
-"%B: compiled with -mrelocatable and linked with modules compiled normally"
+"%s: compiled with -mrelocatable and linked with modules compiled normally"
 msgstr ""
 
-#: elf32-ppc.c:2294
+#: elf32-ppc.c:2265
+#, c-format
 msgid ""
-"%B: compiled normally and linked with modules compiled with -mrelocatable"
+"%s: compiled normally and linked with modules compiled with -mrelocatable"
 msgstr ""
 
-#: elf32-ppc.c:3558
-msgid "%B: relocation %s cannot be used when making a shared object"
+#: elf32-ppc.c:3534
+#, c-format
+msgid "%s: relocation %s cannot be used when making a shared object"
 msgstr ""
 
-#. It does not make sense to have a procedure linkage
-#. table entry for a local symbol.
-#: elf32-ppc.c:3763
-msgid "%B(%A+0x%lx): %s reloc against local symbol"
+#: elf32-ppc.c:3740
+#, c-format
+msgid "%s(%s+0x%lx): %s reloc against local symbol"
 msgstr ""
 
-#: elf32-ppc.c:4964 elf64-ppc.c:9259
-msgid "%B: unknown relocation type %d for symbol %s"
+#: elf32-ppc.c:4945 elf64-ppc.c:8022
+#, c-format
+msgid "%s: unknown relocation type %d for symbol %s"
 msgstr ""
 
-#: elf32-ppc.c:5213
-msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"
+#: elf32-ppc.c:5196
+#, c-format
+msgid "%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"
 msgstr ""
 
-#: elf32-ppc.c:5524 elf32-ppc.c:5550 elf32-ppc.c:5609
+#: elf32-ppc.c:5507 elf32-ppc.c:5533 elf32-ppc.c:5592
+#, c-format
 msgid ""
-"%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
+"%s: the target (%s) of a %s relocation is in the wrong output section (%s)"
 msgstr ""
 
-#: elf32-ppc.c:5664
-msgid "%B: relocation %s is not yet supported for symbol %s."
+#: elf32-ppc.c:5647
+#, c-format
+msgid "%s: relocation %s is not yet supported for symbol %s."
 msgstr ""
 
-#: elf32-ppc.c:5719 elf64-ppc.c:9898
-msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
+#: 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:5769 elf64-ppc.c:9944
-msgid "%B(%A+0x%lx): %s reloc against `%s': error %d"
+#: 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:6012
-msgid "corrupt or empty %s section in %B"
+#: elf32-ppc.c:5996
+#, c-format
+msgid "corrupt or empty %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6019
-msgid "unable to read in %s section from %B"
+#: elf32-ppc.c:6003
+#, c-format
+msgid "unable to read in %s section from %s"
 msgstr ""
 
-#: elf32-ppc.c:6025
-msgid "corrupt %s section in %B"
+#: elf32-ppc.c:6009
+#, c-format
+msgid "corrupt %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6068
-msgid "warning: unable to set size of %s section in %B"
+#: elf32-ppc.c:6052
+#, c-format
+msgid "warning: unable to set size of %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6117
+#: elf32-ppc.c:6102
 msgid "failed to allocate space for new APUinfo section."
 msgstr ""
 
-#: elf32-ppc.c:6136
+#: elf32-ppc.c:6121
 msgid "failed to compute new APUinfo section."
 msgstr ""
 
-#: elf32-ppc.c:6139
+#: elf32-ppc.c:6124
 msgid "failed to install new APUinfo section."
 msgstr ""
 
-#: elf32-s390.c:2230 elf64-s390.c:2201
-msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
+#: 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:217 elf64-sh64.c:2377
+#: 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:220 elf64-sh64.c:2380
+#: 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:222 elf64-sh64.c:2382
+#: 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:444 elf64-sh64.c:2948
+#: elf32-sh64.c:442 elf64-sh64.c:2955
 #, c-format
 msgid "%s: encountered datalabel symbol in input"
 msgstr ""
 
-#: elf32-sh64.c:521
+#: elf32-sh64.c:519
 msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
 msgstr ""
 
-#: elf32-sh64.c:524
+#: elf32-sh64.c:522
 msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
 msgstr ""
 
-#: elf32-sh64.c:542
+#: elf32-sh64.c:540
 #, c-format
 msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
 msgstr ""
 
-#: elf32-sh64.c:591 elf64-sh64.c:1732
+#: elf32-sh64.c:589 elf64-sh64.c:1736
 #, c-format
 msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
 msgstr ""
 
-#: elf32-sh64.c:667
+#: elf32-sh64.c:670
 #, c-format
 msgid "%s: could not write out added .cranges entries"
 msgstr ""
 
-#: elf32-sh64.c:727
+#: elf32-sh64.c:732
 #, c-format
 msgid "%s: could not write out sorted .cranges entries"
 msgstr ""
 
-#: elf32-sh.c:2245
-msgid "%B: 0x%lx: warning: bad R_SH_USES offset"
+#: elf32-sh.c:2252
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES offset"
 msgstr ""
 
-#: elf32-sh.c:2257
-msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
+#: elf32-sh.c:2264
+#, c-format
+msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
 msgstr ""
 
-#: elf32-sh.c:2274
-msgid "%B: 0x%lx: warning: bad R_SH_USES load offset"
+#: elf32-sh.c:2281
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES load offset"
 msgstr ""
 
-#: elf32-sh.c:2289
-msgid "%B: 0x%lx: warning: could not find expected reloc"
+#: elf32-sh.c:2296
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected reloc"
 msgstr ""
 
-#: elf32-sh.c:2317
-msgid "%B: 0x%lx: warning: symbol in unexpected section"
+#: elf32-sh.c:2324
+#, c-format
+msgid "%s: 0x%lx: warning: symbol in unexpected section"
 msgstr ""
 
-#: elf32-sh.c:2442
-msgid "%B: 0x%lx: warning: could not find expected COUNT reloc"
+#: elf32-sh.c:2449
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected COUNT reloc"
 msgstr ""
 
-#: elf32-sh.c:2451
-msgid "%B: 0x%lx: warning: bad count"
+#: elf32-sh.c:2458
+#, c-format
+msgid "%s: 0x%lx: warning: bad count"
 msgstr ""
 
-#: elf32-sh.c:2846 elf32-sh.c:3216
-msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
+#: elf32-sh.c:2858 elf32-sh.c:3227
+#, c-format
+msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
 msgstr ""
 
-#: elf32-sh.c:4741 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:4892
-msgid "%B(%A): unresolvable relocation against symbol `%s'"
-msgstr ""
-
-#: elf32-sh.c:4962
-msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
-msgstr ""
-
-#: elf32-sh.c:4995 elf32-sh.c:5010
-msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
-msgstr ""
-
-#: elf32-sh.c:5024
-msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
+#: elf32-sh.c:4913
+#, c-format
+msgid "%s: unresolvable relocation against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-sh.c:5038
-msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
+#: elf32-sh.c:4984
+#, c-format
+msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"
 msgstr ""
 
-#: elf32-sh.c:6779 elf64-alpha.c:4723
-msgid "%B: TLS local exec code cannot be linked into shared objects"
+#: elf32-sh.c:5017 elf32-sh.c:5032
+#, c-format
+msgid "%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"
 msgstr ""
 
-#: elf32-sh-symbian.c:128
-msgid "%B: IMPORT AS directive for %s conceals previous IMPORT AS"
+#: elf32-sh.c:5046
+#, c-format
+msgid "%s: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
 msgstr ""
 
-#: elf32-sh-symbian.c:380
-msgid "%B: Unrecognised .directive command: %s"
+#: elf32-sh.c:5060
+#, c-format
+msgid "%s: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
 msgstr ""
 
-#: elf32-sh-symbian.c:498
-msgid "%B: Failed to add renamed symbol %s"
+#: 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:2487 elf64-sparc.c:2271
-msgid "%B: probably compiled without -fPIC?"
+#: elf32-sparc.c:2499 elf64-sparc.c:2270
+#, c-format
+msgid "%s: probably compiled without -fPIC?"
 msgstr ""
 
-#: elf32-sparc.c:3309
-msgid "%B: compiled for a 64 bit system and target is 32 bit"
+#: elf32-sparc.c:3325
+#, c-format
+msgid "%s: compiled for a 64 bit system and target is 32 bit"
 msgstr ""
 
-#: elf32-sparc.c:3322
-msgid "%B: linking little endian files with big endian files"
+#: elf32-sparc.c:3339
+#, c-format
+msgid "%s: linking little endian files with big endian files"
 msgstr ""
 
-#: elf32-v850.c:752
+#: elf32-v850.c:753
 #, c-format
 msgid "Variable `%s' cannot occupy in multiple small data regions"
 msgstr ""
 
-#: elf32-v850.c:755
+#: elf32-v850.c:756
 #, c-format
 msgid ""
 "Variable `%s' can only be in one of the small, zero, and tiny data regions"
 msgstr ""
 
-#: elf32-v850.c:758
+#: elf32-v850.c:759
 #, c-format
 msgid ""
 "Variable `%s' cannot be in both small and zero data regions simultaneously"
 msgstr ""
 
-#: elf32-v850.c:761
+#: elf32-v850.c:762
 #, c-format
 msgid ""
 "Variable `%s' cannot be in both small and tiny data regions simultaneously"
 msgstr ""
 
-#: elf32-v850.c:764
+#: elf32-v850.c:765
 #, c-format
 msgid ""
 "Variable `%s' cannot be in both zero and tiny data regions simultaneously"
 msgstr ""
 
-#: elf32-v850.c:1143
+#: elf32-v850.c:1144
 #, c-format
 msgid "FAILED to find previous HI16 reloc\n"
 msgstr ""
 
-#: elf32-v850.c:1757
+#: elf32-v850.c:1758
 msgid "could not locate special linker symbol __gp"
 msgstr ""
 
-#: elf32-v850.c:1761
+#: elf32-v850.c:1762
 msgid "could not locate special linker symbol __ep"
 msgstr ""
 
-#: elf32-v850.c:1765
+#: elf32-v850.c:1766
 msgid "could not locate special linker symbol __ctbp"
 msgstr ""
 
-#: elf32-v850.c:1950
-msgid "%B: Architecture mismatch with previous modules"
+#: elf32-v850.c:1951
+#, c-format
+msgid "%s: Architecture mismatch with previous modules"
 msgstr ""
 
-#: elf32-v850.c:1971
+#: elf32-v850.c:1972
 #, c-format
 msgid "private flags = %lx: "
 msgstr ""
 
-#: elf32-v850.c:1976
+#: elf32-v850.c:1977
 #, c-format
 msgid "v850 architecture"
 msgstr ""
 
-#: elf32-v850.c:1977
+#: elf32-v850.c:1978
 #, c-format
 msgid "v850e architecture"
 msgstr ""
 
-#: elf32-v850.c:1978
+#: elf32-v850.c:1979
 #, c-format
 msgid "v850e1 architecture"
 msgstr ""
@@ -1507,75 +1561,83 @@ msgid ""
 "%ld"
 msgstr ""
 
-#: elf32-vax.c:1637
+#: elf32-vax.c:1645
 #, c-format
 msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored"
 msgstr ""
 
-#: elf32-vax.c:1761
+#: elf32-vax.c:1771
 #, c-format
 msgid "%s: warning: %s relocation against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-vax.c:1767
+#: elf32-vax.c:1777
 #, c-format
 msgid "%s: warning: %s relocation to 0x%x from %s section"
 msgstr ""
 
-#: elf32-xstormy16.c:462 elf32-ia64.c:2389 elf64-ia64.c:2389
+#: elf32-xstormy16.c:462 elf32-ia64.c:2418 elf64-ia64.c:2418
 msgid "non-zero addend in @fptr reloc"
 msgstr ""
 
-#: elf32-xtensa.c:2050
+#: elf32-xtensa.c:2051
 msgid "dynamic relocation in read-only section"
 msgstr ""
 
-#: elf64-alpha.c:1069
+#: elf64-alpha.c:1067
 msgid "GPDISP relocation did not find ldah and lda instructions"
 msgstr ""
 
-#: elf64-alpha.c:3555
+#: elf64-alpha.c:3565
 #, c-format
 msgid "Symbol %s has no GOT subsection for offset 0x%x"
 msgstr ""
 
-#: elf64-alpha.c:3640
-msgid "%B: .got subsegment exceeds 64K (size %d)"
+#: elf64-alpha.c:3651
+#, c-format
+msgid "%s: .got subsegment exceeds 64K (size %d)"
 msgstr ""
 
-#: elf64-alpha.c:4477 elf64-alpha.c:4489
-msgid "%B: gp-relative relocation against dynamic symbol %s"
+#: elf64-alpha.c:4498 elf64-alpha.c:4510
+#, c-format
+msgid "%s: gp-relative relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf64-alpha.c:4515 elf64-alpha.c:4648
-msgid "%B: pc-relative relocation against dynamic symbol %s"
+#: elf64-alpha.c:4536 elf64-alpha.c:4669
+#, c-format
+msgid "%s: pc-relative relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf64-alpha.c:4543
-msgid "%B: change in gp: BRSGP %s"
+#: elf64-alpha.c:4564
+#, c-format
+msgid "%s: change in gp: BRSGP %s"
 msgstr ""
 
-#: elf64-alpha.c:4568
+#: elf64-alpha.c:4589
 msgid "<unknown>"
 msgstr ""
 
-#: elf64-alpha.c:4573
-msgid "%B: !samegp reloc against symbol without .prologue: %s"
+#: elf64-alpha.c:4594
+#, c-format
+msgid "%s: !samegp reloc against symbol without .prologue: %s"
 msgstr ""
 
-#: elf64-alpha.c:4624
-msgid "%B: unhandled dynamic relocation against %s"
+#: elf64-alpha.c:4645
+#, c-format
+msgid "%s: unhandled dynamic relocation against %s"
 msgstr ""
 
-#: elf64-alpha.c:4707
-msgid "%B: dtp-relative relocation against dynamic symbol %s"
+#: elf64-alpha.c:4728
+#, c-format
+msgid "%s: dtp-relative relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf64-alpha.c:4730
-msgid "%B: tp-relative relocation against dynamic symbol %s"
+#: elf64-alpha.c:4751
+#, c-format
+msgid "%s: tp-relative relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf64-hppa.c:2084
+#: elf64-hppa.c:2083
 #, c-format
 msgid "stub entry for %s cannot load .plt, dp offset = %ld"
 msgstr ""
@@ -1584,7 +1646,7 @@ msgstr ""
 msgid "32bits gp relative relocation occurs for an external symbol"
 msgstr ""
 
-#: elf64-mmix.c:1163
+#: elf64-mmix.c:1171
 #, c-format
 msgid ""
 "%s: Internal inconsistency error for value for\n"
@@ -1592,111 +1654,116 @@ msgid ""
 "08lx\n"
 msgstr ""
 
-#: elf64-mmix.c:1602
+#: elf64-mmix.c:1603
 #, c-format
 msgid ""
 "%s: base-plus-offset relocation against register symbol: (unknown) in %s"
 msgstr ""
 
-#: elf64-mmix.c:1607
+#: elf64-mmix.c:1608
 #, c-format
 msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
 msgstr ""
 
-#: elf64-mmix.c:1651
+#: elf64-mmix.c:1652
 #, c-format
 msgid "%s: register relocation against non-register symbol: (unknown) in %s"
 msgstr ""
 
-#: elf64-mmix.c:1656
+#: elf64-mmix.c:1657
 #, c-format
 msgid "%s: register relocation against non-register symbol: %s in %s"
 msgstr ""
 
-#: elf64-mmix.c:1693
+#: elf64-mmix.c:1694
 #, c-format
 msgid "%s: directive LOCAL valid only with a register or absolute value"
 msgstr ""
 
-#: elf64-mmix.c:1721
+#: 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:2201
+#: 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:2260
+#: elf64-mmix.c:2261
 msgid "Register section has contents\n"
 msgstr ""
 
-#: elf64-mmix.c:2453
+#: elf64-mmix.c:2467
 #, c-format
 msgid ""
 "Internal inconsistency: remaining %u != max %u.\n"
 "  Please report this bug."
 msgstr ""
 
-#: elf64-ppc.c:2487 libbfd.c:826
-msgid "%B: compiled for a big endian system and target is little endian"
+#: 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:2490 libbfd.c:828
-msgid "%B: compiled for a little endian system and target is big endian"
+#: 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:5554
+#: 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:5954
-msgid "%B: .opd is not a regular array of opd entries"
+#: elf64-ppc.c:5027
+#, c-format
+msgid "%s: .opd is not a regular array of opd entries"
 msgstr ""
 
-#: elf64-ppc.c:5963
-msgid "%B: unexpected reloc type %u in .opd section"
+#: elf64-ppc.c:5037
+#, c-format
+msgid "%s: unexpected reloc type %u in .opd section"
 msgstr ""
 
-#: elf64-ppc.c:5983
-msgid "%B: undefined sym `%s' in .opd section"
+#: elf64-ppc.c:5057
+#, c-format
+msgid "%s: undefined sym `%s' in .opd section"
 msgstr ""
 
-#: elf64-ppc.c:7374
+#: elf64-ppc.c:6272
 #, c-format
 msgid "can't find branch stub `%s'"
 msgstr ""
 
-#: elf64-ppc.c:7413 elf64-ppc.c:7489
+#: elf64-ppc.c:6311 elf64-ppc.c:6386
 #, c-format
 msgid "linkage table error against `%s'"
 msgstr ""
 
-#: elf64-ppc.c:7618
+#: elf64-ppc.c:6503
 #, c-format
 msgid "can't build branch stub `%s'"
 msgstr ""
 
-#: elf64-ppc.c:8385
+#: elf64-ppc.c:7222
 msgid ".glink and .plt too far apart"
 msgstr ""
 
-#: elf64-ppc.c:8498
+#: elf64-ppc.c:7334
 msgid "stubs don't match calculated size"
 msgstr ""
 
-#: elf64-ppc.c:8510
+#: elf64-ppc.c:7346
 #, c-format
 msgid ""
-"linker stubs in %u group%s\n"
+"linker stubs in %u groups\n"
 "  branch       %lu\n"
 "  toc adjust   %lu\n"
 "  long branch  %lu\n"
@@ -1704,457 +1771,443 @@ msgid ""
 "  plt call     %lu"
 msgstr ""
 
-#: elf64-ppc.c:8747
-msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
+#: elf64-ppc.c:7544
+#, c-format
+msgid "%s(%s+0x%lx): %s used with TLS symbol %s"
 msgstr ""
 
-#: elf64-ppc.c:8748
-msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
+#: elf64-ppc.c:7545
+#, c-format
+msgid "%s(%s+0x%lx): %s used with non-TLS symbol %s"
 msgstr ""
 
-#: elf64-ppc.c:9148
+#: elf64-ppc.c:7956
+#, c-format
 msgid ""
-"%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; "
+"%s(%s+0x%lx): automatic multiple TOCs not supported using your crt files; "
 "recompile with -mminimal-toc or upgrade gcc"
 msgstr ""
 
-#: elf64-ppc.c:9156
+#: elf64-ppc.c:7964
+#, c-format
 msgid ""
-"%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic "
+"%s(%s+0x%lx): sibling call optimization to `%s' does not allow automatic "
 "multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, "
 "or make `%s' extern"
 msgstr ""
 
-#: elf64-ppc.c:9800
-msgid "%B: relocation %s is not supported for symbol %s."
+#: elf64-ppc.c:8562
+#, c-format
+msgid "%s: relocation %s is not supported for symbol %s."
 msgstr ""
 
-#: elf64-ppc.c:9879
-msgid "%B: error: relocation %s not a multiple of %d"
+#: elf64-ppc.c:8641
+#, c-format
+msgid "%s: error: relocation %s not a multiple of %d"
 msgstr ""
 
 #: elf64-sparc.c:1371
-msgid "%B: check_relocs: unhandled reloc type %d"
-msgstr ""
-
-#: elf64-sparc.c:1407
-msgid "%B: Only registers %%g[2367] can be declared using STT_REGISTER"
+#, c-format
+msgid "%s: check_relocs: unhandled reloc type %d"
 msgstr ""
 
-#: elf64-sparc.c:1427
-msgid "Register %%g%d used incompatibly: %s in %B, previously %s in %B"
+#: elf64-sparc.c:1408
+#, c-format
+msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER"
 msgstr ""
 
-#: elf64-sparc.c:1450
-msgid "Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"
+#: elf64-sparc.c:1428
+#, c-format
+msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s"
 msgstr ""
 
-#: elf64-sparc.c:1495
-msgid "Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"
+#: elf64-sparc.c:1451
+#, c-format
+msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s"
 msgstr ""
 
-#: elf64-sparc.c:2997
-msgid "%B: linking UltraSPARC specific with HAL specific code"
+#: elf64-sparc.c:1497
+#, c-format
+msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s"
 msgstr ""
 
-#: elf64-x86-64.c:666 elf64-x86-64.c:791 elf64-x86-64.c:1952
-msgid ""
-"%B: relocation %s against `%s' can not be used when making a shared object; "
-"recompile with -fPIC"
+#: elf64-sparc.c:3009
+#, c-format
+msgid "%s: linking UltraSPARC specific with HAL specific code"
 msgstr ""
 
-#: elf64-x86-64.c:734
-msgid "%B: %s' accessed both as normal and thread local symbol"
+#: elf64-x86-64.c:732
+#, c-format
+msgid "%s: %s' accessed both as normal and thread local symbol"
 msgstr ""
 
 #: elf.c:295
-msgid "%B: invalid string offset %u >= %lu for section `%s'"
+#, c-format
+msgid "%s: invalid string offset %u >= %lu for section `%s'"
 msgstr ""
 
 #: elf.c:538
-msgid "%B: invalid SHT_GROUP entry"
-msgstr ""
-
-#: elf.c:608
-msgid "%B: no group info for section %A"
+#, c-format
+msgid "%s: invalid SHT_GROUP entry"
 msgstr ""
 
-#: elf.c:645
-msgid "%B: unknown [%d] section `%s' in group [%s]"
+#: elf.c:609
+#, c-format
+msgid "%s: no group info for section %s"
 msgstr ""
 
-#: elf.c:1026
+#: elf.c:952
 #, c-format
 msgid ""
 "\n"
 "Program Header:\n"
 msgstr ""
 
-#: elf.c:1078
+#: elf.c:1003
 #, c-format
 msgid ""
 "\n"
 "Dynamic Section:\n"
 msgstr ""
 
-#: elf.c:1203
+#: elf.c:1131
 #, c-format
 msgid ""
 "\n"
 "Version definitions:\n"
 msgstr ""
 
-#: elf.c:1226
+#: elf.c:1154
 #, c-format
 msgid ""
 "\n"
 "Version References:\n"
 msgstr ""
 
-#: elf.c:1231
+#: elf.c:1159
 #, c-format
 msgid "  required from %s:\n"
 msgstr ""
 
-#: elf.c:1896
-msgid "%B: invalid link %lu for reloc section %s (index %u)"
-msgstr ""
-
-#: elf.c:2889
-msgid "%B: warning: sh_link not set for section `%S'"
-msgstr ""
-
-#: elf.c:3869
+#: elf.c:1826
 #, c-format
-msgid "%s: Not enough room for program headers (allocated %u, need %u)"
+msgid "%s: invalid link %lu for reloc section %s (index %u)"
 msgstr ""
 
-#: elf.c:3944
+#: elf.c:3684
 #, c-format
-msgid ""
-"%s: The first section in the PT_DYNAMIC segment is not the .dynamic section"
+msgid "%s: Not enough room for program headers (allocated %u, need %u)"
 msgstr ""
 
-#: elf.c:3988
+#: elf.c:3791
 #, c-format
 msgid "%s: Not enough room for program headers, try linking with -N"
 msgstr ""
 
-#: elf.c:4121
+#: elf.c:3924
 #, c-format
 msgid ""
 "Error: First section in segment (%s) starts at 0x%x whereas the segment "
 "starts at 0x%x"
 msgstr ""
 
-#: elf.c:4496
+#: elf.c:4243
 #, c-format
 msgid "%s: warning: allocated section `%s' not in segment"
 msgstr ""
 
-#: elf.c:4810
-msgid "%B: symbol `%s' required but not present"
+#: elf.c:4557
+#, c-format
+msgid "%s: symbol `%s' required but not present"
 msgstr ""
 
-#: elf.c:5098
-msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
+#: elf.c:4845
+#, c-format
+msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n"
 msgstr ""
 
-#: elf.c:5737
+#: elf.c:5479
 #, c-format
 msgid ""
 "Unable to find equivalent output section for symbol '%s' from section '%s'"
 msgstr ""
 
-#: elf.c:6522
-msgid "%B: unsupported relocation type %s"
+#: elf.c:6264
+#, c-format
+msgid "%s: unsupported relocation type %s"
 msgstr ""
 
-#: elfcode.h:1056
+#: elfcode.h:1050
 #, c-format
 msgid "%s: version count (%ld) does not match symbol count (%ld)"
 msgstr ""
 
-#: elfcode.h:1282
+#: elfcode.h:1276
 #, c-format
 msgid "%s(%s): relocation %d has invalid symbol index %ld"
 msgstr ""
 
-#: elf-hppa.h:1402 elf-hppa.h:1428 elf-hppa.h:1443
-msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
-msgstr ""
-
-#: elflink.c:1390
-msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
+#: elflink.c:1350
+#, c-format
+msgid "%s: warning: unexpected redefinition of indirect versioned symbol `%s'"
 msgstr ""
 
-#: elflink.c:1707
-msgid "%B: undefined versioned symbol name %s"
+#: elflink.c:1669
+#, c-format
+msgid "%s: undefined versioned symbol name %s"
 msgstr ""
 
-#: elflink.c:1856
+#: elflink.c:1818
+#, c-format
 msgid ""
-"%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
+"%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"
 msgstr ""
 
-#: elflink.c:2046
-msgid "%B: relocation size mismatch in %B section %A"
+#: elflink.c:2007
+#, c-format
+msgid "%s: relocation size mismatch in %s section %s"
 msgstr ""
 
-#: elflink.c:2336
+#: elflink.c:2296
 #, c-format
 msgid "warning: type and size of dynamic symbol `%s' are not defined"
 msgstr ""
 
-#: elflink.c:2966
+#: elflink.c:2917
 msgid "warning: "
 msgstr ""
 
-#: elflink.c:3461
-msgid "%B: %s: invalid version %u (max %d)"
-msgstr ""
-
-#: elflink.c:3502
-msgid "%B: %s: invalid needed version %d"
+#: elflink.c:3411
+#, c-format
+msgid "%s: %s: invalid version %u (max %d)"
 msgstr ""
 
-#: elflink.c:3675
-msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
+#: elflink.c:3452
+#, c-format
+msgid "%s: %s: invalid needed version %d"
 msgstr ""
 
-#: elflink.c:3687
-msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
+#: elflink.c:3627
+#, c-format
+msgid "Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"
 msgstr ""
 
-#: elflink.c:3846
+#: elflink.c:3641
 #, c-format
-msgid "%s: invalid DSO for symbol `%s' definition"
+msgid "Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"
 msgstr ""
 
-#: elflink.c:4886
+#: elflink.c:4837
 #, c-format
 msgid "%s: undefined version: %s"
 msgstr ""
 
-#: elflink.c:4952
-msgid "%B: .preinit_array section is not allowed in DSO"
+#: elflink.c:4903
+#, c-format
+msgid "%s: .preinit_array section is not allowed in DSO"
 msgstr ""
 
-#: elflink.c:5643
+#: elflink.c:5594
 msgid "Not enough memory to sort relocations"
 msgstr ""
 
-#: elflink.c:6026
-msgid "%B: %s symbol `%s' in %B is referenced by DSO"
-msgstr ""
-
-#: elflink.c:6106
-msgid "%B: could not find output section %A for input section %A"
+#: elflink.c:5976
+#, c-format
+msgid "%s: %s symbol `%s' in %s is referenced by DSO"
 msgstr ""
 
-#: elflink.c:6203
-msgid "%B: %s symbol `%s' isn't defined"
+#: elflink.c:6057
+#, c-format
+msgid "%s: could not find output section %s for input section %s"
 msgstr ""
 
-#: elflink.c:6712
-msgid ""
-"`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %"
-"B\n"
+#: elflink.c:6156
+#, c-format
+msgid "%s: %s symbol `%s' isn't defined"
 msgstr ""
 
-#: elflink.c:7221
-msgid "%B: warning: sh_link not set for section `%A'"
+#: elflink.c:6575 elflink.c:6616
+msgid "%T: discarded in section `%s' from %s\n"
 msgstr ""
 
-#: elflink.c:7294
+#: elflink.c:7870 elflink.c:7912
 #, c-format
-msgid "%A has both ordered and unordered sections"
+msgid "%s: could not find output section %s"
 msgstr ""
 
-#: elflink.c:8123 elflink.c:8164
-msgid "%B: could not find output section %s"
-msgstr ""
-
-#: elflink.c:8128
+#: elflink.c:7876
 #, c-format
 msgid "warning: %s section has zero size"
 msgstr ""
 
-#: elflink.c:8703
+#: elflink.c:8427
 msgid "Warning: gc-sections option ignored"
 msgstr ""
 
-#: elflink.c:9362
-msgid "%B: ignoring duplicate section `%A'\n"
-msgstr ""
-
-#: elflink.c:9369 elflink.c:9376
-msgid "%B: duplicate section `%A' has different size\n"
-msgstr ""
-
-#: elflink.c:9384 elflink.c:9389
-msgid "%B: warning: could not read contents of section `%A'\n"
-msgstr ""
-
-#: elflink.c:9393
-msgid "%B: warning: duplicate section `%A' has different contents\n"
-msgstr ""
-
-#: elfxx-mips.c:887
+#: elfxx-mips.c:890
 msgid "static procedure (no name)"
 msgstr ""
 
-#: elfxx-mips.c:1993
+#: elfxx-mips.c:2028
 msgid "not enough GOT space for local GOT entries"
 msgstr ""
 
-#: elfxx-mips.c:3718
-msgid "%B: %A+0x%lx: jump to stub routine which is not jal"
+#: elfxx-mips.c:3775
+#, c-format
+msgid "%s: %s+0x%lx: jump to stub routine which is not jal"
 msgstr ""
 
-#: elfxx-mips.c:5223
-msgid "%B: Malformed reloc detected for section %s"
+#: elfxx-mips.c:5260
+#, c-format
+msgid "%s: Malformed reloc detected for section %s"
 msgstr ""
 
-#: elfxx-mips.c:5297
-msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
+#: elfxx-mips.c:5334
+#, c-format
+msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
 msgstr ""
 
-#: elfxx-mips.c:8562
+#: elfxx-mips.c:8631
 #, c-format
 msgid "%s: illegal section name `%s'"
 msgstr ""
 
-#: elfxx-mips.c:8885
-msgid "%B: endianness incompatible with that of the selected emulation"
+#: elfxx-mips.c:8954
+#, c-format
+msgid "%s: endianness incompatible with that of the selected emulation"
 msgstr ""
 
-#: elfxx-mips.c:8897
-msgid "%B: ABI is incompatible with that of the selected emulation"
+#: elfxx-mips.c:8966
+#, c-format
+msgid "%s: ABI is incompatible with that of the selected emulation"
 msgstr ""
 
-#: elfxx-mips.c:8969
-msgid "%B: warning: linking PIC files with non-PIC files"
+#: elfxx-mips.c:9038
+#, c-format
+msgid "%s: warning: linking PIC files with non-PIC files"
 msgstr ""
 
-#: elfxx-mips.c:8986
-msgid "%B: linking 32-bit code with 64-bit code"
+#: elfxx-mips.c:9055
+#, c-format
+msgid "%s: linking 32-bit code with 64-bit code"
 msgstr ""
 
-#: elfxx-mips.c:9014
-msgid "%B: linking %s module with previous %s modules"
+#: elfxx-mips.c:9083
+#, c-format
+msgid "%s: linking %s module with previous %s modules"
 msgstr ""
 
-#: elfxx-mips.c:9037
-msgid "%B: ABI mismatch: linking %s module with previous %s modules"
+#: elfxx-mips.c:9106
+#, c-format
+msgid "%s: ABI mismatch: linking %s module with previous %s modules"
 msgstr ""
 
-#: elfxx-mips.c:9102
+#: elfxx-mips.c:9171
 #, c-format
 msgid " [abi=O32]"
 msgstr ""
 
-#: elfxx-mips.c:9104
+#: elfxx-mips.c:9173
 #, c-format
 msgid " [abi=O64]"
 msgstr ""
 
-#: elfxx-mips.c:9106
+#: elfxx-mips.c:9175
 #, c-format
 msgid " [abi=EABI32]"
 msgstr ""
 
-#: elfxx-mips.c:9108
+#: elfxx-mips.c:9177
 #, c-format
 msgid " [abi=EABI64]"
 msgstr ""
 
-#: elfxx-mips.c:9110
+#: elfxx-mips.c:9179
 #, c-format
 msgid " [abi unknown]"
 msgstr ""
 
-#: elfxx-mips.c:9112
+#: elfxx-mips.c:9181
 #, c-format
 msgid " [abi=N32]"
 msgstr ""
 
-#: elfxx-mips.c:9114
+#: elfxx-mips.c:9183
 #, c-format
 msgid " [abi=64]"
 msgstr ""
 
-#: elfxx-mips.c:9116
+#: elfxx-mips.c:9185
 #, c-format
 msgid " [no abi set]"
 msgstr ""
 
-#: elfxx-mips.c:9119
+#: elfxx-mips.c:9188
 #, c-format
 msgid " [mips1]"
 msgstr ""
 
-#: elfxx-mips.c:9121
+#: elfxx-mips.c:9190
 #, c-format
 msgid " [mips2]"
 msgstr ""
 
-#: elfxx-mips.c:9123
+#: elfxx-mips.c:9192
 #, c-format
 msgid " [mips3]"
 msgstr ""
 
-#: elfxx-mips.c:9125
+#: elfxx-mips.c:9194
 #, c-format
 msgid " [mips4]"
 msgstr ""
 
-#: elfxx-mips.c:9127
+#: elfxx-mips.c:9196
 #, c-format
 msgid " [mips5]"
 msgstr ""
 
-#: elfxx-mips.c:9129
+#: elfxx-mips.c:9198
 #, c-format
 msgid " [mips32]"
 msgstr ""
 
-#: elfxx-mips.c:9131
+#: elfxx-mips.c:9200
 #, c-format
 msgid " [mips64]"
 msgstr ""
 
-#: elfxx-mips.c:9133
+#: elfxx-mips.c:9202
 #, c-format
 msgid " [mips32r2]"
 msgstr ""
 
-#: elfxx-mips.c:9135
+#: elfxx-mips.c:9204
 #, c-format
 msgid " [mips64r2]"
 msgstr ""
 
-#: elfxx-mips.c:9137
+#: elfxx-mips.c:9206
 #, c-format
 msgid " [unknown ISA]"
 msgstr ""
 
-#: elfxx-mips.c:9140
+#: elfxx-mips.c:9209
 #, c-format
 msgid " [mdmx]"
 msgstr ""
 
-#: elfxx-mips.c:9143
+#: elfxx-mips.c:9212
 #, c-format
 msgid " [mips16]"
 msgstr ""
 
-#: elfxx-mips.c:9146
+#: elfxx-mips.c:9215
 #, c-format
 msgid " [32bitmode]"
 msgstr ""
 
-#: elfxx-mips.c:9148
+#: elfxx-mips.c:9217
 #, c-format
 msgid " [not 32bitmode]"
 msgstr ""
@@ -2190,70 +2243,83 @@ msgid "%s: unrecognized symbol `%s' flags 0x%x"
 msgstr ""
 
 #: ieee.c:938
-msgid "%B: unimplemented ATI record %u for symbol %u"
+#, c-format
+msgid "%s: unimplemented ATI record %u for symbol %u"
 msgstr ""
 
-#: ieee.c:962
-msgid "%B: unexpected ATN type %d in external part"
+#: ieee.c:963
+#, c-format
+msgid "%s: unexpected ATN type %d in external part"
 msgstr ""
 
-#: ieee.c:984
-msgid "%B: unexpected type after ATN"
+#: ieee.c:985
+#, c-format
+msgid "%s: unexpected type after ATN"
 msgstr ""
 
 #: ihex.c:264
-msgid "%B:%d: unexpected character `%s' in Intel Hex file"
+#, c-format
+msgid "%s:%d: unexpected character `%s' in Intel Hex file\n"
 msgstr ""
 
 #: ihex.c:372
-msgid "%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"
+#, c-format
+msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"
 msgstr ""
 
 #: ihex.c:426
-msgid "%B:%u: bad extended address record length in Intel Hex file"
+#, c-format
+msgid "%s:%u: bad extended address record length in Intel Hex file"
 msgstr ""
 
 #: ihex.c:443
-msgid "%B:%u: bad extended start address length in Intel Hex file"
+#, c-format
+msgid "%s:%u: bad extended start address length in Intel Hex file"
 msgstr ""
 
 #: ihex.c:460
-msgid "%B:%u: bad extended linear address record length in Intel Hex file"
+#, c-format
+msgid "%s:%u: bad extended linear address record length in Intel Hex file"
 msgstr ""
 
 #: ihex.c:477
-msgid "%B:%u: bad extended linear start address length in Intel Hex file"
+#, c-format
+msgid "%s:%u: bad extended linear start address length in Intel Hex file"
 msgstr ""
 
 #: ihex.c:494
-msgid "%B:%u: unrecognized ihex type %u in Intel Hex file"
+#, c-format
+msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n"
 msgstr ""
 
 #: ihex.c:619
-msgid "%B: internal error in ihex_read_section"
+#, c-format
+msgid "%s: internal error in ihex_read_section"
 msgstr ""
 
-#: ihex.c:653
-msgid "%B: bad section length in ihex_read_section"
+#: ihex.c:654
+#, c-format
+msgid "%s: bad section length in ihex_read_section"
 msgstr ""
 
-#: ihex.c:870
+#: ihex.c:872
 #, c-format
 msgid "%s: address 0x%s out of range for Intel Hex file"
 msgstr ""
 
-#: libbfd.c:856
+#: libbfd.c:851
 #, c-format
 msgid "Deprecated %s called at %s line %d in %s\n"
 msgstr ""
 
-#: libbfd.c:859
+#: libbfd.c:854
 #, c-format
 msgid "Deprecated %s called\n"
 msgstr ""
 
 #: linker.c:1831
-msgid "%B: indirect symbol `%s' to `%s' is a loop"
+#, c-format
+msgid "%s: indirect symbol `%s' to `%s' is a loop"
 msgstr ""
 
 #: linker.c:2699
@@ -2261,17 +2327,9 @@ msgstr ""
 msgid "Attempt to do relocatable link with %s input and %s output"
 msgstr ""
 
-#: linker.c:2996
-msgid "%B: warning: ignoring duplicate section `%A'\n"
-msgstr ""
-
-#: linker.c:3010
-msgid "%B: warning: duplicate section `%A' has different size\n"
-msgstr ""
-
-#: merge.c:795
+#: merge.c:797
 #, c-format
-msgid "%s: access beyond end of merged section (%ld)"
+msgid "%s: access beyond end of merged section (%ld + %ld)"
 msgstr ""
 
 #: mmo.c:503
@@ -2284,132 +2342,132 @@ msgstr ""
 msgid "%s: No core to allocate a symbol %d bytes long\n"
 msgstr ""
 
-#: mmo.c:1286
+#: mmo.c:1287
 #, c-format
 msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n"
 msgstr ""
 
-#: mmo.c:1432
+#: mmo.c:1433
 #, c-format
 msgid ""
 "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name "
 "starting with `%s'\n"
 msgstr ""
 
-#: mmo.c:1672
+#: mmo.c:1674
 #, c-format
 msgid "%s: invalid mmo file: unsupported lopcode `%d'\n"
 msgstr ""
 
-#: mmo.c:1682
+#: mmo.c:1684
 #, c-format
 msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"
 msgstr ""
 
-#: mmo.c:1718
+#: mmo.c:1720
 #, c-format
 msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"
 msgstr ""
 
-#: mmo.c:1764
+#: mmo.c:1766
 #, c-format
 msgid ""
 "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"
 msgstr ""
 
-#: mmo.c:1803
+#: mmo.c:1805
 #, c-format
 msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"
 msgstr ""
 
-#: mmo.c:1812
+#: mmo.c:1814
 #, c-format
 msgid ""
 "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"
 msgstr ""
 
-#: mmo.c:1835
+#: mmo.c:1837
 #, c-format
 msgid ""
 "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d "
 "for lop_fixrx\n"
 msgstr ""
 
-#: mmo.c:1858
+#: mmo.c:1860
 #, c-format
 msgid "%s: cannot allocate file name for file number %d, %d bytes\n"
 msgstr ""
 
-#: mmo.c:1878
+#: mmo.c:1880
 #, c-format
 msgid ""
 "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n"
 msgstr ""
 
-#: mmo.c:1891
+#: mmo.c:1893
 #, c-format
 msgid ""
 "%s: invalid mmo file: file name for number %d was not specified before use\n"
 msgstr ""
 
-#: mmo.c:1997
+#: mmo.c:1999
 #, c-format
 msgid ""
 "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n"
 msgstr ""
 
-#: mmo.c:2033
+#: mmo.c:2035
 #, c-format
 msgid "%s: invalid mmo file: lop_end not last item in file\n"
 msgstr ""
 
-#: mmo.c:2046
+#: mmo.c:2048
 #, c-format
 msgid ""
 "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras "
 "to the preceding lop_stab (%ld)\n"
 msgstr ""
 
-#: mmo.c:2696
+#: mmo.c:2698
 #, c-format
 msgid "%s: invalid symbol table: duplicate symbol `%s'\n"
 msgstr ""
 
-#: mmo.c:2947
+#: mmo.c:2949
 #, c-format
 msgid ""
 "%s: Bad symbol definition: `Main' set to %s rather than the start address %"
 "s\n"
 msgstr ""
 
-#: mmo.c:3037
+#: mmo.c:3039
 #, c-format
 msgid ""
 "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: "
 "%d.  Only `Main' will be emitted.\n"
 msgstr ""
 
-#: mmo.c:3082
+#: mmo.c:3084
 #, c-format
 msgid "%s: internal error, symbol table changed size from %d to %d words\n"
 msgstr ""
 
-#: mmo.c:3137
+#: mmo.c:3139
 #, c-format
 msgid "%s: internal error, internal register section %s had contents\n"
 msgstr ""
 
-#: mmo.c:3189
+#: mmo.c:3191
 #, c-format
 msgid "%s: no initialized registers; section length 0\n"
 msgstr ""
 
-#: mmo.c:3195
+#: mmo.c:3197
 #, c-format
 msgid "%s: too many initialized registers; section length %ld\n"
 msgstr ""
 
-#: mmo.c:3200
+#: mmo.c:3202
 #, c-format
 msgid ""
 "%s: invalid start address for initialized registers of length %ld: 0x%lx%"
@@ -2428,37 +2486,45 @@ msgstr ""
 
 #. XXX code yet to be written.
 #: peicode.h:787
-msgid "%B: Unhandled import type; %x"
+#, c-format
+msgid "%s: Unhandled import type; %x"
 msgstr ""
 
 #: peicode.h:792
-msgid "%B: Unrecognised import type; %x"
+#, c-format
+msgid "%s: Unrecognised import type; %x"
 msgstr ""
 
 #: peicode.h:806
-msgid "%B: Unrecognised import name type; %x"
+#, c-format
+msgid "%s: Unrecognised import name type; %x"
 msgstr ""
 
-#: peicode.h:1193
-msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive"
+#: peicode.h:1194
+#, c-format
+msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive"
 msgstr ""
 
-#: peicode.h:1205
+#: peicode.h:1206
+#, c-format
 msgid ""
-"%B: Recognised but unhandled machine type (0x%x) in Import Library Format "
+"%s: Recognised but unhandled machine type (0x%x) in Import Library Format "
 "archive"
 msgstr ""
 
 #: peicode.h:1223
-msgid "%B: size field is zero in Import Library Format header"
+#, c-format
+msgid "%s: size field is zero in Import Library Format header"
 msgstr ""
 
-#: peicode.h:1253
-msgid "%B: string not null terminated in ILF object file."
+#: peicode.h:1254
+#, c-format
+msgid "%s: string not null terminated in ILF object file."
 msgstr ""
 
-#: pe-mips.c:636
-msgid "%B: `ld -r' not supported with PE MIPS objects\n"
+#: pe-mips.c:659
+#, c-format
+msgid "%s: `ld -r' not supported with PE MIPS objects\n"
 msgstr ""
 
 #. OK, at this point the following variables are set up:
@@ -2466,16 +2532,19 @@ msgstr ""
 #. mem = pointer to memory we're fixing up
 #. val = VMA of what we need to refer to
 #.
-#: pe-mips.c:770
-msgid "%B: unimplemented %s\n"
+#: pe-mips.c:795
+#, c-format
+msgid "%s: unimplemented %s\n"
 msgstr ""
 
-#: pe-mips.c:796
-msgid "%B: jump too far away\n"
+#: pe-mips.c:821
+#, c-format
+msgid "%s: jump too far away\n"
 msgstr ""
 
-#: pe-mips.c:822
-msgid "%B: bad pair/reflo after refhi\n"
+#: pe-mips.c:848
+#, c-format
+msgid "%s: bad pair/reflo after refhi\n"
 msgstr ""
 
 #: ppcboot.c:416
@@ -2527,19 +2596,21 @@ msgstr ""
 msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
 msgstr ""
 
-#: som.c:5490
+#: som.c:5422
 msgid "som_sizeof_headers unimplemented"
 msgstr ""
 
 #: srec.c:302
-msgid "%B:%d: Unexpected character `%s' in S-record file\n"
+#, c-format
+msgid "%s:%d: Unexpected character `%s' in S-record file\n"
 msgstr ""
 
-#: stabs.c:296
-msgid "%B(%A+0x%lx): Stabs entry has invalid string index."
+#: stabs.c:326
+#, c-format
+msgid "%s(%s+0x%lx): Stabs entry has invalid string index."
 msgstr ""
 
-#: syms.c:1027
+#: syms.c:1019
 msgid "Unsupported .stab relocation"
 msgstr ""
 
@@ -2558,7 +2629,7 @@ msgstr ""
 msgid "Size mismatch section %s=%lx, %s=%lx"
 msgstr ""
 
-#: vms-gsd.c:702
+#: vms-gsd.c:704
 #, c-format
 msgid "unknown gsd/egsd subtype %d"
 msgstr ""
@@ -2608,7 +2679,7 @@ msgstr ""
 msgid "unsupported STA cmd %s"
 msgstr ""
 
-#: vms-tir.c:401 vms-tir.c:1260
+#: vms-tir.c:401 vms-tir.c:1261
 #, c-format
 msgid "reserved STA cmd %d"
 msgstr ""
@@ -2623,38 +2694,38 @@ msgstr ""
 #. Redefine symbol to current location.
 #. Define a literal.
 #: vms-tir.c:602 vms-tir.c:714 vms-tir.c:824 vms-tir.c:842 vms-tir.c:850
-#: vms-tir.c:859 vms-tir.c:1583
+#: vms-tir.c:859 vms-tir.c:1584
 #, c-format
 msgid "%s: not supported"
 msgstr ""
 
-#: vms-tir.c:607 vms-tir.c:1438
+#: vms-tir.c:607 vms-tir.c:1439
 #, c-format
 msgid "%s: not implemented"
 msgstr ""
 
-#: vms-tir.c:611 vms-tir.c:1442
+#: vms-tir.c:611 vms-tir.c:1443
 #, c-format
 msgid "reserved STO cmd %d"
 msgstr ""
 
-#: vms-tir.c:729 vms-tir.c:1588
+#: vms-tir.c:729 vms-tir.c:1589
 #, c-format
 msgid "reserved OPR cmd %d"
 msgstr ""
 
-#: vms-tir.c:797 vms-tir.c:1652
+#: vms-tir.c:797 vms-tir.c:1653
 #, c-format
 msgid "reserved CTL cmd %d"
 msgstr ""
 
 #. stack byte from image
 #. arg: none.
-#: vms-tir.c:1168
+#: vms-tir.c:1169
 msgid "stack-from-image not implemented"
 msgstr ""
 
-#: vms-tir.c:1186
+#: vms-tir.c:1187
 msgid "stack-entry-mask not fully implemented"
 msgstr ""
 
@@ -2665,272 +2736,278 @@ msgstr ""
 #.
 #. compare argument descriptor with symbol argument (ARG$V_PASSMECH)
 #. and stack TRUE (args match) or FALSE (args dont match) value.
-#: vms-tir.c:1200
+#: vms-tir.c:1201
 msgid "PASSMECH not fully implemented"
 msgstr ""
 
-#: vms-tir.c:1219
+#: vms-tir.c:1220
 msgid "stack-local-symbol not fully implemented"
 msgstr ""
 
-#: vms-tir.c:1232
+#: vms-tir.c:1233
 msgid "stack-literal not fully implemented"
 msgstr ""
 
-#: vms-tir.c:1253
+#: vms-tir.c:1254
 msgid "stack-local-symbol-entry-point-mask not fully implemented"
 msgstr ""
 
-#: vms-tir.c:1530 vms-tir.c:1542 vms-tir.c:1554 vms-tir.c:1566 vms-tir.c:1631
-#: vms-tir.c:1639 vms-tir.c:1647
+#: vms-tir.c:1531 vms-tir.c:1543 vms-tir.c:1555 vms-tir.c:1567 vms-tir.c:1632
+#: vms-tir.c:1640 vms-tir.c:1648
 #, c-format
 msgid "%s: not fully implemented"
 msgstr ""
 
-#: vms-tir.c:1704
+#: vms-tir.c:1705
 #, c-format
 msgid "obj code %d not found"
 msgstr ""
 
-#: vms-tir.c:2042
+#: vms-tir.c:2043
 #, c-format
 msgid "SEC_RELOC with no relocs in section %s"
 msgstr ""
 
-#: vms-tir.c:2330
+#: vms-tir.c:2331
 #, c-format
 msgid "Unhandled relocation %s"
 msgstr ""
 
-#: xcofflink.c:1243
-msgid "%B: `%s' has line numbers but no enclosing section"
+#: xcofflink.c:1244
+#, c-format
+msgid "%s: `%s' has line numbers but no enclosing section"
 msgstr ""
 
-#: xcofflink.c:1296
-msgid "%B: class %d symbol `%s' has no aux entries"
+#: xcofflink.c:1297
+#, c-format
+msgid "%s: class %d symbol `%s' has no aux entries"
 msgstr ""
 
-#: xcofflink.c:1319
-msgid "%B: symbol `%s' has unrecognized csect type %d"
+#: xcofflink.c:1320
+#, c-format
+msgid "%s: symbol `%s' has unrecognized csect type %d"
 msgstr ""
 
-#: xcofflink.c:1331
-msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
+#: xcofflink.c:1332
+#, c-format
+msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
 msgstr ""
 
-#: xcofflink.c:1367
-msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d"
+#: xcofflink.c:1368
+#, c-format
+msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d"
 msgstr ""
 
-#: xcofflink.c:1518
-msgid "%B: csect `%s' not in enclosing section"
+#: xcofflink.c:1520
+#, c-format
+msgid "%s: csect `%s' not in enclosing section"
 msgstr ""
 
-#: xcofflink.c:1625
-msgid "%B: misplaced XTY_LD `%s'"
+#: xcofflink.c:1627
+#, c-format
+msgid "%s: misplaced XTY_LD `%s'"
 msgstr ""
 
-#: xcofflink.c:1956
-msgid "%B: reloc %s:%d not in csect"
+#: xcofflink.c:1958
+#, c-format
+msgid "%s: reloc %s:%d not in csect"
 msgstr ""
 
-#: xcofflink.c:2093
+#: xcofflink.c:2095
 #, c-format
 msgid "%s: XCOFF shared object when not producing XCOFF output"
 msgstr ""
 
-#: xcofflink.c:2114
+#: xcofflink.c:2116
 #, c-format
 msgid "%s: dynamic object with no .loader section"
 msgstr ""
 
-#: xcofflink.c:2759
+#: xcofflink.c:2761
 #, c-format
 msgid "%s: no such symbol"
 msgstr ""
 
-#: xcofflink.c:2892
+#: xcofflink.c:2894
 msgid "error: undefined symbol __rtinit"
 msgstr ""
 
-#: xcofflink.c:3449
+#: xcofflink.c:3455
 #, c-format
 msgid "warning: attempt to export undefined symbol `%s'"
 msgstr ""
 
-#: xcofflink.c:4444
+#: xcofflink.c:4448
 #, c-format
 msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
 msgstr ""
 
-#: xcofflink.c:5285
-msgid "%B: loader reloc in unrecognized section `%A'"
-msgstr ""
-
-#: xcofflink.c:5306
-msgid "%B: `%s' in loader reloc but not loader sym"
-msgstr ""
-
-#: xcofflink.c:5321
-msgid "%B: loader reloc in read-only section %A"
-msgstr ""
-
-#: xcofflink.c:5747 xcofflink.c:5809 xcofflink.c:6111
+#: xcofflink.c:5288 xcofflink.c:5755 xcofflink.c:5817 xcofflink.c:6119
 #, c-format
 msgid "%s: loader reloc in unrecognized section `%s'"
 msgstr ""
 
-#: xcofflink.c:6122
+#: xcofflink.c:5310 xcofflink.c:6130
 #, c-format
 msgid "%s: `%s' in loader reloc but not loader sym"
 msgstr ""
 
-#: elf32-ia64.c:980 elf64-ia64.c:980
-msgid ""
-"%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect "
-"branch."
+#: xcofflink.c:5325
+#, c-format
+msgid "%s: loader reloc in read-only section %s"
 msgstr ""
 
-#: elf32-ia64.c:2334 elf64-ia64.c:2334
+#: elf32-ia64.c:2363 elf64-ia64.c:2363
 msgid "@pltoff reloc against local symbol"
 msgstr ""
 
-#: elf32-ia64.c:3752 elf64-ia64.c:3752
+#: elf32-ia64.c:3768 elf64-ia64.c:3768
 #, c-format
 msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
 msgstr ""
 
-#: elf32-ia64.c:3763 elf64-ia64.c:3763
+#: elf32-ia64.c:3779 elf64-ia64.c:3779
 #, c-format
 msgid "%s: __gp does not cover short data segment"
 msgstr ""
 
-#: elf32-ia64.c:4010 elf64-ia64.c:4010
-msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
+#: 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:4075 elf64-ia64.c:4075
-msgid "%B: @gprel relocation against dynamic symbol %s"
+#: elf32-ia64.c:4092 elf64-ia64.c:4092
+#, c-format
+msgid "%s: @gprel relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4135 elf64-ia64.c:4135
-msgid "%B: linking non-pic code in a position independent executable"
+#: 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:4272 elf64-ia64.c:4272
-msgid "%B: @internal branch to dynamic symbol %s"
+#: elf32-ia64.c:4289 elf64-ia64.c:4289
+#, c-format
+msgid "%s: @internal branch to dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4274 elf64-ia64.c:4274
-msgid "%B: speculation fixup to dynamic symbol %s"
+#: elf32-ia64.c:4291 elf64-ia64.c:4291
+#, c-format
+msgid "%s: speculation fixup to dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4276 elf64-ia64.c:4276
-msgid "%B: @pcrel relocation against dynamic symbol %s"
+#: elf32-ia64.c:4293 elf64-ia64.c:4293
+#, c-format
+msgid "%s: @pcrel relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4484 elf64-ia64.c:4484
+#: elf32-ia64.c:4505 elf64-ia64.c:4505
 msgid "unsupported reloc"
 msgstr ""
 
-#: elf32-ia64.c:4761 elf64-ia64.c:4761
-msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
+#: 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:4770 elf64-ia64.c:4770
-msgid "%B: linking big-endian files with little-endian files"
+#: elf32-ia64.c:4793 elf64-ia64.c:4793
+#, c-format
+msgid "%s: linking big-endian files with little-endian files"
 msgstr ""
 
-#: elf32-ia64.c:4779 elf64-ia64.c:4779
-msgid "%B: linking 64-bit files with 32-bit files"
+#: elf32-ia64.c:4802 elf64-ia64.c:4802
+#, c-format
+msgid "%s: linking 64-bit files with 32-bit files"
 msgstr ""
 
-#: elf32-ia64.c:4788 elf64-ia64.c:4788
-msgid "%B: linking constant-gp files with non-constant-gp files"
+#: 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:4798 elf64-ia64.c:4798
-msgid "%B: linking auto-pic files with non-auto-pic files"
+#: elf32-ia64.c:4821 elf64-ia64.c:4821
+#, c-format
+msgid "%s: linking auto-pic files with non-auto-pic files"
 msgstr ""
 
-#: peigen.c:1033 pepigen.c:1033
+#: peigen.c:1031 pepigen.c:1031
 #, c-format
 msgid "%s: line number overflow: 0x%lx > 0xffff"
 msgstr ""
 
-#: peigen.c:1054 pepigen.c:1054
+#: peigen.c:1052 pepigen.c:1052
 #, c-format
 msgid "%s: reloc overflow 1: 0x%lx > 0xffff"
 msgstr ""
 
-#: peigen.c:1068 pepigen.c:1068
+#: peigen.c:1066 pepigen.c:1066
 msgid "Export Directory [.edata (or where ever we found it)]"
 msgstr ""
 
-#: peigen.c:1069 pepigen.c:1069
+#: peigen.c:1067 pepigen.c:1067
 msgid "Import Directory [parts of .idata]"
 msgstr ""
 
-#: peigen.c:1070 pepigen.c:1070
+#: peigen.c:1068 pepigen.c:1068
 msgid "Resource Directory [.rsrc]"
 msgstr ""
 
-#: peigen.c:1071 pepigen.c:1071
+#: peigen.c:1069 pepigen.c:1069
 msgid "Exception Directory [.pdata]"
 msgstr ""
 
-#: peigen.c:1072 pepigen.c:1072
+#: peigen.c:1070 pepigen.c:1070
 msgid "Security Directory"
 msgstr ""
 
-#: peigen.c:1073 pepigen.c:1073
+#: peigen.c:1071 pepigen.c:1071
 msgid "Base Relocation Directory [.reloc]"
 msgstr ""
 
-#: peigen.c:1074 pepigen.c:1074
+#: peigen.c:1072 pepigen.c:1072
 msgid "Debug Directory"
 msgstr ""
 
-#: peigen.c:1075 pepigen.c:1075
+#: peigen.c:1073 pepigen.c:1073
 msgid "Description Directory"
 msgstr ""
 
-#: peigen.c:1076 pepigen.c:1076
+#: peigen.c:1074 pepigen.c:1074
 msgid "Special Directory"
 msgstr ""
 
-#: peigen.c:1077 pepigen.c:1077
+#: peigen.c:1075 pepigen.c:1075
 msgid "Thread Storage Directory [.tls]"
 msgstr ""
 
-#: peigen.c:1078 pepigen.c:1078
+#: peigen.c:1076 pepigen.c:1076
 msgid "Load Configuration Directory"
 msgstr ""
 
-#: peigen.c:1079 pepigen.c:1079
+#: peigen.c:1077 pepigen.c:1077
 msgid "Bound Import Directory"
 msgstr ""
 
-#: peigen.c:1080 pepigen.c:1080
+#: peigen.c:1078 pepigen.c:1078
 msgid "Import Address Table Directory"
 msgstr ""
 
-#: peigen.c:1081 pepigen.c:1081
+#: peigen.c:1079 pepigen.c:1079
 msgid "Delay Import Directory"
 msgstr ""
 
-#: peigen.c:1082 peigen.c:1083 pepigen.c:1082 pepigen.c:1083
+#: peigen.c:1080 peigen.c:1081 pepigen.c:1080 pepigen.c:1081
 msgid "Reserved"
 msgstr ""
 
-#: peigen.c:1145 pepigen.c:1145
+#: peigen.c:1144 pepigen.c:1144
 #, c-format
 msgid ""
 "\n"
 "There is an import table, but the section containing it could not be found\n"
 msgstr ""
 
-#: peigen.c:1150 pepigen.c:1150
+#: peigen.c:1149 pepigen.c:1149
 #, c-format
 msgid ""
 "\n"
@@ -2949,61 +3026,61 @@ msgstr ""
 msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
 msgstr ""
 
-#: peigen.c:1197 pepigen.c:1197
+#: peigen.c:1195 pepigen.c:1195
 #, c-format
 msgid ""
 "\n"
 "No reldata section! Function descriptor not decoded.\n"
 msgstr ""
 
-#: peigen.c:1202 pepigen.c:1202
+#: peigen.c:1200 pepigen.c:1200
 #, c-format
 msgid ""
 "\n"
 "The Import Tables (interpreted %s section contents)\n"
 msgstr ""
 
-#: peigen.c:1205 pepigen.c:1205
+#: peigen.c:1203 pepigen.c:1203
 #, c-format
 msgid ""
 " vma:            Hint    Time      Forward  DLL       First\n"
 "                 Table   Stamp     Chain    Name      Thunk\n"
 msgstr ""
 
-#: peigen.c:1255 pepigen.c:1255
+#: peigen.c:1254 pepigen.c:1254
 #, c-format
 msgid ""
 "\n"
 "\tDLL Name: %s\n"
 msgstr ""
 
-#: peigen.c:1266 pepigen.c:1266
+#: peigen.c:1265 pepigen.c:1265
 #, c-format
 msgid "\tvma:  Hint/Ord Member-Name Bound-To\n"
 msgstr ""
 
-#: peigen.c:1291 pepigen.c:1291
+#: peigen.c:1290 pepigen.c:1290
 #, c-format
 msgid ""
 "\n"
 "There is a first thunk, but the section containing it could not be found\n"
 msgstr ""
 
-#: peigen.c:1431 pepigen.c:1431
+#: peigen.c:1430 pepigen.c:1430
 #, c-format
 msgid ""
 "\n"
 "There is an export table, but the section containing it could not be found\n"
 msgstr ""
 
-#: peigen.c:1436 pepigen.c:1436
+#: peigen.c:1435 pepigen.c:1435
 #, c-format
 msgid ""
 "\n"
 "There is an export table in %s at 0x%lx\n"
 msgstr ""
 
-#: peigen.c:1467 pepigen.c:1467
+#: peigen.c:1466 pepigen.c:1466
 #, c-format
 msgid ""
 "\n"
@@ -3011,128 +3088,128 @@ msgid ""
 "\n"
 msgstr ""
 
-#: peigen.c:1471 pepigen.c:1471
+#: peigen.c:1470 pepigen.c:1470
 #, c-format
 msgid "Export Flags \t\t\t%lx\n"
 msgstr ""
 
-#: peigen.c:1474 pepigen.c:1474
+#: peigen.c:1473 pepigen.c:1473
 #, c-format
 msgid "Time/Date stamp \t\t%lx\n"
 msgstr ""
 
-#: peigen.c:1477 pepigen.c:1477
+#: peigen.c:1476 pepigen.c:1476
 #, c-format
 msgid "Major/Minor \t\t\t%d/%d\n"
 msgstr ""
 
-#: peigen.c:1480 pepigen.c:1480
+#: peigen.c:1479 pepigen.c:1479
 #, c-format
 msgid "Name \t\t\t\t"
 msgstr ""
 
-#: peigen.c:1486 pepigen.c:1486
+#: peigen.c:1485 pepigen.c:1485
 #, c-format
 msgid "Ordinal Base \t\t\t%ld\n"
 msgstr ""
 
-#: peigen.c:1489 pepigen.c:1489
+#: peigen.c:1488 pepigen.c:1488
 #, c-format
 msgid "Number in:\n"
 msgstr ""
 
-#: peigen.c:1492 pepigen.c:1492
+#: peigen.c:1491 pepigen.c:1491
 #, c-format
 msgid "\tExport Address Table \t\t%08lx\n"
 msgstr ""
 
-#: peigen.c:1496 pepigen.c:1496
+#: peigen.c:1495 pepigen.c:1495
 #, c-format
 msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n"
 msgstr ""
 
-#: peigen.c:1499 pepigen.c:1499
+#: peigen.c:1498 pepigen.c:1498
 #, c-format
 msgid "Table Addresses\n"
 msgstr ""
 
-#: peigen.c:1502 pepigen.c:1502
+#: peigen.c:1501 pepigen.c:1501
 #, c-format
 msgid "\tExport Address Table \t\t"
 msgstr ""
 
-#: peigen.c:1507 pepigen.c:1507
+#: peigen.c:1506 pepigen.c:1506
 #, c-format
 msgid "\tName Pointer Table \t\t"
 msgstr ""
 
-#: peigen.c:1512 pepigen.c:1512
+#: peigen.c:1511 pepigen.c:1511
 #, c-format
 msgid "\tOrdinal Table \t\t\t"
 msgstr ""
 
-#: peigen.c:1527 pepigen.c:1527
+#: peigen.c:1526 pepigen.c:1526
 #, c-format
 msgid ""
 "\n"
 "Export Address Table -- Ordinal Base %ld\n"
 msgstr ""
 
-#: peigen.c:1546 pepigen.c:1546
+#: peigen.c:1545 pepigen.c:1545
 msgid "Forwarder RVA"
 msgstr ""
 
-#: peigen.c:1557 pepigen.c:1557
+#: peigen.c:1556 pepigen.c:1556
 msgid "Export RVA"
 msgstr ""
 
-#: peigen.c:1564 pepigen.c:1564
+#: peigen.c:1563 pepigen.c:1563
 #, c-format
 msgid ""
 "\n"
 "[Ordinal/Name Pointer] Table\n"
 msgstr ""
 
-#: peigen.c:1619 pepigen.c:1619
+#: peigen.c:1618 pepigen.c:1618
 #, c-format
 msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
 msgstr ""
 
-#: peigen.c:1623 pepigen.c:1623
+#: peigen.c:1622 pepigen.c:1622
 #, c-format
 msgid ""
 "\n"
 "The Function Table (interpreted .pdata section contents)\n"
 msgstr ""
 
-#: peigen.c:1626 pepigen.c:1626
+#: peigen.c:1625 pepigen.c:1625
 #, c-format
 msgid " vma:\t\t\tBegin Address    End Address      Unwind Info\n"
 msgstr ""
 
-#: peigen.c:1628 pepigen.c:1628
+#: peigen.c:1627 pepigen.c:1627
 #, c-format
 msgid ""
 " vma:\t\tBegin    End      EH       EH       PrologEnd  Exception\n"
 "     \t\tAddress  Address  Handler  Data     Address    Mask\n"
 msgstr ""
 
-#: peigen.c:1698 pepigen.c:1698
+#: peigen.c:1697 pepigen.c:1697
 #, c-format
 msgid " Register save millicode"
 msgstr ""
 
-#: peigen.c:1701 pepigen.c:1701
+#: peigen.c:1700 pepigen.c:1700
 #, c-format
 msgid " Register restore millicode"
 msgstr ""
 
-#: peigen.c:1704 pepigen.c:1704
+#: peigen.c:1703 pepigen.c:1703
 #, c-format
 msgid " Glue code sequence"
 msgstr ""
 
-#: peigen.c:1756 pepigen.c:1756
+#: peigen.c:1755 pepigen.c:1755
 #, c-format
 msgid ""
 "\n"
@@ -3140,14 +3217,14 @@ msgid ""
 "PE File Base Relocations (interpreted .reloc section contents)\n"
 msgstr ""
 
-#: peigen.c:1786 pepigen.c:1786
+#: peigen.c:1785 pepigen.c:1785
 #, c-format
 msgid ""
 "\n"
 "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"
 msgstr ""
 
-#: peigen.c:1799 pepigen.c:1799
+#: peigen.c:1798 pepigen.c:1798
 #, c-format
 msgid "\treloc %4d offset %4x [%4lx] %s"
 msgstr ""
@@ -3155,7 +3232,7 @@ msgstr ""
 #. The MS dumpbin program reportedly ands with 0xff0f before
 #. printing the characteristics field.  Not sure why.  No reason to
 #. emulate it here.
-#: peigen.c:1839 pepigen.c:1839
+#: peigen.c:1838 pepigen.c:1838
 #, c-format
 msgid ""
 "\n"
index 3444caa8be7b8c1b03a3417037fc12a259d309cf..49f81402149e72f8551ee5187fdd0fb2ab0e4c55 100644 (file)
@@ -345,8 +345,6 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret)
   bfd_symbol_info (symbol, ret);
 }
 
-#define ppcboot_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ppcboot_get_lineno _bfd_nosymbols_get_lineno
 #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
index 1df18408fee8dd369e40337df2e06036a82620a1..1c95d7ec44b1032f6819802509286a6efa08acff 100644 (file)
@@ -2559,8 +2559,6 @@ ENUMX
   BFD_RELOC_ARM_OFFSET_IMM
 ENUMX
   BFD_RELOC_ARM_SHIFT_IMM
-ENUMX
-  BFD_RELOC_ARM_SMI
 ENUMX
   BFD_RELOC_ARM_SWI
 ENUMX
@@ -2623,16 +2621,6 @@ ENUM
   BFD_RELOC_ARM_SBREL32
 ENUMDOC
   Data segment base relative address.
-ENUM
-  BFD_RELOC_ARM_TARGET2
-ENUMDOC
-  This reloc is used for References to RTTI dta from exception handling
-  tables.  The actual definition depends on the target.  It may be a
-  pc-relative or some form of GOT-indirect relocation.
-ENUM
-  BFD_RELOC_ARM_PREL31
-ENUMDOC
-  31-bit PC relative address.
 
 ENUM
   BFD_RELOC_SH_PCDISP8BY2
@@ -4142,87 +4130,6 @@ ENUM
 ENUMDOC
   Xtensa relocation used in ELF object files for symbols that may require
   PLT entries.  Otherwise, this is just a generic 32-bit relocation.
-ENUM
-  BFD_RELOC_XTENSA_DIFF8
-ENUMX
-  BFD_RELOC_XTENSA_DIFF16
-ENUMX
-  BFD_RELOC_XTENSA_DIFF32
-ENUMDOC
-  Xtensa relocations to mark the difference of two local symbols.
-  These are only needed to support linker relaxation and can be ignored
-  when not relaxing.  The field is set to the value of the difference
-  assuming no relaxation.  The relocation encodes the position of the
-  first symbol so the linker can determine whether to adjust the field
-  value.
-ENUM
-  BFD_RELOC_XTENSA_SLOT0_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT1_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT2_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT3_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT4_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT5_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT6_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT7_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT8_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT9_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT10_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT11_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT12_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT13_OP
-ENUMX
-  BFD_RELOC_XTENSA_SLOT14_OP
-ENUMDOC
-  Generic Xtensa relocations for instruction operands.  Only the slot
-  number is encoded in the relocation.  The relocation applies to the
-  last PC-relative immediate operand, or if there are no PC-relative
-  immediates, to the last immediate operand.
-ENUM
-  BFD_RELOC_XTENSA_SLOT0_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT1_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT2_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT3_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT4_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT5_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT6_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT7_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT8_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT9_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT10_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT11_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT12_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT13_ALT
-ENUMX
-  BFD_RELOC_XTENSA_SLOT14_ALT
-ENUMDOC
-  Alternate Xtensa relocations.  Only the slot is encoded in the
-  relocation.  The meaning of these relocations is opcode-specific.
 ENUM
   BFD_RELOC_XTENSA_OP0
 ENUMX
@@ -4230,8 +4137,9 @@ ENUMX
 ENUMX
   BFD_RELOC_XTENSA_OP2
 ENUMDOC
-  Xtensa relocations for backward compatibility.  These have all been
-  replaced by BFD_RELOC_XTENSA_SLOT0_OP.
+  Generic Xtensa relocations.  Only the operand number is encoded
+  in the relocation.  The details are determined by extracting the
+  instruction opcode.
 ENUM
   BFD_RELOC_XTENSA_ASM_EXPAND
 ENUMDOC
index 41aa950955aa31a76bcf0d9d9286200e1fb45540..5039911dcfdf1356793a6df6a83bdfcc33019ea3 100644 (file)
@@ -92,12 +92,8 @@ simple_save_output_info (bfd *abfd ATTRIBUTE_UNUSED,
   struct saved_output_info *output_info = ptr;
   output_info[section->index].offset = section->output_offset;
   output_info[section->index].section = section->output_section;
-  if ((section->flags & SEC_DEBUGGING) != 0
-      || section->output_section == NULL)
-    {
-      section->output_offset = 0;
-      section->output_section = section;
-    }
+  section->output_offset = 0;
+  section->output_section = section;
 }
 
 static void
@@ -121,10 +117,13 @@ SYNOPSIS
 DESCRIPTION
        Returns the relocated contents of section @var{sec}.  The symbols in
        @var{symbol_table} will be used, or the symbols from @var{abfd} if
-       @var{symbol_table} is NULL.  The output offsets for debug sections will
+       @var{symbol_table} is NULL.  The output offsets for all sections will
        be temporarily reset to 0.  The result will be stored at @var{outbuf}
        or allocated with @code{bfd_malloc} if @var{outbuf} is @code{NULL}.
 
+       Generally all sections in @var{abfd} should have their
+       @code{output_section} pointing back to the original section.
+
        Returns @code{NULL} on a fatal error; ignores errors applying
        particular relocations.
 */
index 879e0b77b4b758ab17e06257e7bebc46ea4a9983..c35b344f1d0a5aa448815cb8ca02fe579303588b 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -6402,8 +6402,6 @@ som_bfd_link_split_section (abfd, sec)
 #define som_update_armap_timestamp     bfd_true
 #define som_bfd_print_private_bfd_data  _bfd_generic_bfd_print_private_bfd_data
 
-#define som_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define som_get_lineno                 _bfd_nosymbols_get_lineno
 #define som_bfd_make_debug_symbol      _bfd_nosymbols_bfd_make_debug_symbol
 #define som_read_minisymbols           _bfd_generic_read_minisymbols
index e184a20eaa3b3e01e44ededcf6b08080c9685c33..19dfaa9fd836e1b0abfe4ad3583073638e005de8 100644 (file)
@@ -1262,7 +1262,6 @@ srec_print_symbol (abfd, afile, symbol, how)
 #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define srec_new_section_hook _bfd_generic_new_section_hook
 
-#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define srec_get_lineno _bfd_nosymbols_get_lineno
 #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
index 245369d20d770e6ce610e9309423d1e847a31fbb..6b615a2b5f4bec35c901e2f59cd423972f6b4b49 100644 (file)
@@ -355,7 +355,7 @@ bfd_is_local_label (bfd *abfd, asymbol *sym)
   /* The BSF_SECTION_SYM check is needed for IA-64, where every label that
      starts with '.' is local.  This would accidentally catch section names
      if we didn't reject them here.  */
-  if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_FILE | BSF_SECTION_SYM)) != 0)
+  if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0)
     return FALSE;
   if (sym->name == NULL)
     return FALSE;
@@ -380,23 +380,6 @@ DESCRIPTION
 .
 */
 
-/*
-FUNCTION
-       bfd_is_target_special_symbol
-
-SYNOPSIS
-        bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
-
-DESCRIPTION
-       Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
-       special to the particular target represented by the BFD.  Such symbols
-       should normally not be mentioned to the user.
-
-.#define bfd_is_target_special_symbol(abfd, sym) \
-.  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
-.
-*/
-
 /*
 FUNCTION
        bfd_canonicalize_symtab
@@ -1033,10 +1016,6 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              asymbol *sym;
 
              r = *pr;
-             /* Ignore R_*_NONE relocs.  */
-             if (r->howto->dst_mask == 0)
-               continue;
-
              if (r->howto->rightshift != 0
                  || r->howto->size != 2
                  || r->howto->bitsize != 32
index 6b5c00cf28b2b3e796bee97d5a692608f378df7e..05832d82abd4efc8a03388e01de8aa5b0ae8aa18 100644 (file)
@@ -338,7 +338,6 @@ BFD_JUMP_TABLE macros.
 .  NAME##_print_symbol, \
 .  NAME##_get_symbol_info, \
 .  NAME##_bfd_is_local_label_name, \
-.  NAME##_bfd_is_target_special_symbol, \
 .  NAME##_get_lineno, \
 .  NAME##_find_nearest_line, \
 .  NAME##_bfd_make_debug_symbol, \
@@ -357,7 +356,7 @@ BFD_JUMP_TABLE macros.
 .    (bfd *, struct bfd_symbol *, symbol_info *);
 .#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
 .  bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
-.  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
+.
 .  alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
 .  bfd_boolean (*_bfd_find_nearest_line)
 .    (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
index df1dab5f125faf80e14d7a2786e77d5ac832d079..a7a925470fcb6d9110a8ac6a0e81aa14b2405c3f 100644 (file)
@@ -989,7 +989,6 @@ tekhex_print_symbol (abfd, filep, symbol, how)
 #define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define tekhex_new_section_hook _bfd_generic_new_section_hook
 
-#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define tekhex_get_lineno _bfd_nosymbols_get_lineno
 #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
index 68678c860da83134a6397155777e46506b01c6c0..50b3487fbcd4a2dbfc90bfad5e9c82e89660f102 100644 (file)
@@ -855,8 +855,6 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols)
 #define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define versados_new_section_hook _bfd_generic_new_section_hook
 
-#define versados_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define versados_get_lineno _bfd_nosymbols_get_lineno
 #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
index 2f0befaac7f2a33faae363de29995609732d2cc0..b491758b2a21e896ebcf858777eeec52252dcd00 100644 (file)
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20041018
+#define BFD_VERSION_DATE 20040915
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING @bfd_version_string@
index 15ab5b08ce48d37491a11d9d696ce841930c9985..640d0eb6c98d59d3561762976e3f8525daa5e416 100644 (file)
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -164,7 +164,6 @@ static bfd_boolean vms_bfd_merge_private_bfd_data
 static bfd_boolean vms_bfd_set_private_flags
   PARAMS ((bfd *abfd, flagword flags));
 
-#define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #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
index 78de54ac89cf0422baa8e91e5bd37cc324aae9d4..9b80e3c5ac29ce9b28e6d01e737b92bf6be35b59 100644 (file)
@@ -43,7 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define coff_mkobject _bfd_xcoff_mkobject
 #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
 #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
-#define coff_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
 #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
 
index ccb9c90558940b975899924daee201470ff7b579..ec737d12a4d01865bf020f84e57e7ad43dd6045d 100644 (file)
@@ -1825,7 +1825,7 @@ xcoff_link_add_symbols (abfd, info)
                      section = bfd_und_section_ptr;
                      value = 0;
                    }
-                 else if ((*sym_hash)->root.u.undef.next != NULL
+                 else if ((*sym_hash)->root.und_next != NULL
                           || info->hash->undefs_tail == &(*sym_hash)->root)
                    {
                      /* This symbol has been referenced.  In this
index 252be999d56c12039e76fba650d29d2e7ab6dc1e..3c4c84da9adc34eef30e22b213c7491b2ad3b9b9 100644 (file)
@@ -27,7 +27,6 @@
 #define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define bfd_sym_new_section_hook _bfd_generic_new_section_hook
 #define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
 #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index 30ad80cfd6b6dfaec779c82f4f221de67a0cf3f6..761e5c6bb697efb8c2dce150ce040ff5900d720b 100644 (file)
@@ -1,5 +1,5 @@
 /* Configurable Xtensa ISA support.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    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 <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <string.h>
+
 #include "xtensa-isa.h"
 #include "xtensa-isa-internal.h"
 
-xtensa_isa_status xtisa_errno;
-char xtisa_error_msg[1024];
-
-
-xtensa_isa_status
-xtensa_isa_errno (xtensa_isa isa __attribute__ ((unused)))
-{
-  return xtisa_errno;
-}
-
+xtensa_isa xtensa_default_isa = NULL;
 
-char *
-xtensa_isa_error_msg (xtensa_isa isa __attribute__ ((unused)))
+static int
+opname_lookup_compare (const void *v1, const void *v2)
 {
-  return xtisa_error_msg;
-}
+  opname_lookup_entry *e1 = (opname_lookup_entry *)v1;
+  opname_lookup_entry *e2 = (opname_lookup_entry *)v2;
 
-
-#define CHECK_ALLOC(MEM,ERRVAL) \
-  do { \
-    if ((MEM) == 0) \
-      { \
-       xtisa_errno = xtensa_isa_out_of_memory; \
-       strcpy (xtisa_error_msg, "out of memory"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-#define CHECK_ALLOC_FOR_INIT(MEM,ERRVAL,ERRNO_P,ERROR_MSG_P) \
-  do { \
-    if ((MEM) == 0) \
-      { \
-       xtisa_errno = xtensa_isa_out_of_memory; \
-       strcpy (xtisa_error_msg, "out of memory"); \
-       if (ERRNO_P) *(ERRNO_P) = xtisa_errno; \
-       if (ERROR_MSG_P) *(ERROR_MSG_P) = xtisa_error_msg; \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-\f
-/* Instruction buffers.  */
-
-int
-xtensa_insnbuf_size (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->insnbuf_size;
+  return strcmp (e1->key, e2->key);
 }
 
 
-xtensa_insnbuf
-xtensa_insnbuf_alloc (xtensa_isa isa)
-{
-  xtensa_insnbuf result = (xtensa_insnbuf)
-    malloc (xtensa_insnbuf_size (isa) * sizeof (xtensa_insnbuf_word));
-  CHECK_ALLOC (result, 0);
-  return result;
-}
-
-
-void
-xtensa_insnbuf_free (xtensa_isa isa __attribute__ ((unused)),
-                    xtensa_insnbuf buf)
-{
-  free (buf);
-}
-
-
-/* Given <byte_index>, the index of a byte in a xtensa_insnbuf, our
-   internal representation of a xtensa instruction word, return the index of
-   its word and the bit index of its low order byte in the xtensa_insnbuf.  */
-
-static inline int
-byte_to_word_index (int byte_index)
-{
-  return byte_index / sizeof (xtensa_insnbuf_word);
-}
-
-
-static inline int
-byte_to_bit_index (int byte_index)
-{
-  return (byte_index & 0x3) * 8;
-}
-
-
-/* Copy an instruction in the 32-bit words pointed at by "insn" to
-   characters pointed at by "cp".  This is more complicated than you
-   might think because we want 16-bit instructions in bytes 2 & 3 for
-   big-endian configurations.  This function allows us to specify
-   which byte in "insn" to start with and which way to increment,
-   allowing trivial implementation for both big- and little-endian
-   configurations....and it seems to make pretty good code for
-   both.  */
-
-int
-xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn, char *cp,
-                        int num_chars)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int insn_size = xtensa_isa_maxlength (isa);
-  int fence_post, start, increment, i, byte_count;
-  xtensa_format fmt;
-
-  if (num_chars == 0)
-    num_chars = insn_size;
-
-  if (intisa->is_big_endian)
-    {
-      start = insn_size - 1;
-      increment = -1;
-    }
-  else
-    {
-      start = 0;
-      increment = 1;
-    }
-
-  /* Find the instruction format.  Do nothing if the buffer does not contain
-     a valid instruction since we need to know how many bytes to copy.  */
-  fmt = xtensa_format_decode (isa, insn);
-  if (fmt == XTENSA_UNDEFINED)
-    return XTENSA_UNDEFINED;
-
-  byte_count = xtensa_format_length (isa, fmt);
-  if (byte_count == XTENSA_UNDEFINED)
-    return XTENSA_UNDEFINED;
-
-  if (byte_count > num_chars)
-    {
-      xtisa_errno = xtensa_isa_buffer_overflow;
-      strcpy (xtisa_error_msg, "output buffer too small for instruction");
-      return XTENSA_UNDEFINED;
-    }
-
-  fence_post = start + (byte_count * increment);
-
-  for (i = start; i != fence_post; i += increment, ++cp)
-    {
-      int word_inx = byte_to_word_index (i);
-      int bit_inx = byte_to_bit_index (i);
-
-      *cp = (insn[word_inx] >> bit_inx) & 0xff;
-    }
-
-  return byte_count;
-}
-
-
-/* Inward conversion from byte stream to xtensa_insnbuf.  See
-   xtensa_insnbuf_to_chars for a discussion of why this is complicated
-   by endianness.  */
-    
-void
-xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn, const char *cp,
-                          int num_chars)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int max_size, insn_size, fence_post, start, increment, i;
-
-  max_size = xtensa_isa_maxlength (isa);
-
-  /* Decode the instruction length so we know how many bytes to read.  */
-  insn_size = (intisa->length_decode_fn) (cp);
-  if (insn_size == XTENSA_UNDEFINED)
-    {
-      /* This should never happen when the byte stream contains a
-        valid instruction.  Just read the maximum number of bytes....  */
-      insn_size = max_size;
-    }
-
-  if (num_chars == 0 || num_chars > insn_size)
-    num_chars = insn_size;
-
-  if (intisa->is_big_endian)
-    {
-      start = max_size - 1;
-      increment = -1;
-    }
-  else
-    {
-      start = 0;
-      increment = 1;
-    }
-
-  fence_post = start + (num_chars * increment);
-  memset (insn, 0, xtensa_insnbuf_size (isa) * sizeof (xtensa_insnbuf_word));
-
-  for (i = start; i != fence_post; i += increment, ++cp)
-    {
-      int word_inx = byte_to_word_index (i);
-      int bit_inx = byte_to_bit_index (i);
-
-      insn[word_inx] |= (*cp & 0xff) << bit_inx;
-    }
-}
-
-
-\f
-/* ISA information.  */
-
-extern xtensa_isa_internal xtensa_modules;
-
 xtensa_isa
-xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p)
-{
-  xtensa_isa_internal *isa = &xtensa_modules;
-  int n, is_user;
-
-  /* Set up the opcode name lookup table.  */
-  isa->opname_lookup_table =
-    bfd_malloc (isa->num_opcodes * sizeof (xtensa_lookup_entry));
-  CHECK_ALLOC_FOR_INIT (isa->opname_lookup_table, NULL, errno_p, error_msg_p);
-  for (n = 0; n < isa->num_opcodes; n++)
-    {
-      isa->opname_lookup_table[n].key = isa->opcodes[n].name;
-      isa->opname_lookup_table[n].u.opcode = n;
-    }
-  qsort (isa->opname_lookup_table, isa->num_opcodes,
-        sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  /* Set up the state name lookup table.  */
-  isa->state_lookup_table =
-    bfd_malloc (isa->num_states * sizeof (xtensa_lookup_entry));
-  CHECK_ALLOC_FOR_INIT (isa->state_lookup_table, NULL, errno_p, error_msg_p);
-  for (n = 0; n < isa->num_states; n++)
-    {
-      isa->state_lookup_table[n].key = isa->states[n].name;
-      isa->state_lookup_table[n].u.state = n;
-    }
-  qsort (isa->state_lookup_table, isa->num_states,
-        sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  /* Set up the sysreg name lookup table.  */
-  isa->sysreg_lookup_table =
-    bfd_malloc (isa->num_sysregs * sizeof (xtensa_lookup_entry));
-  CHECK_ALLOC_FOR_INIT (isa->sysreg_lookup_table, NULL, errno_p, error_msg_p);
-  for (n = 0; n < isa->num_sysregs; n++)
-    {
-      isa->sysreg_lookup_table[n].key = isa->sysregs[n].name;
-      isa->sysreg_lookup_table[n].u.sysreg = n;
-    }
-  qsort (isa->sysreg_lookup_table, isa->num_sysregs,
-        sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  /* Set up the user & system sysreg number tables.  */
-  for (is_user = 0; is_user < 2; is_user++)
-    {
-      isa->sysreg_table[is_user] =
-       bfd_malloc ((isa->max_sysreg_num[is_user] + 1)
-                   * sizeof (xtensa_sysreg));
-      CHECK_ALLOC_FOR_INIT (isa->sysreg_table[is_user], NULL,
-                           errno_p, error_msg_p);
-
-      for (n = 0; n <= isa->max_sysreg_num[is_user]; n++)
-       isa->sysreg_table[is_user][n] = XTENSA_UNDEFINED;
-    }
-  for (n = 0; n < isa->num_sysregs; n++)
-    {
-      xtensa_sysreg_internal *sreg = &isa->sysregs[n];
-      is_user = sreg->is_user;
-
-      isa->sysreg_table[is_user][sreg->number] = n;
-    }
-
-  /* Set up the interface lookup table.  */
-  isa->interface_lookup_table = 
-    bfd_malloc (isa->num_interfaces * sizeof (xtensa_lookup_entry));
-  CHECK_ALLOC_FOR_INIT (isa->interface_lookup_table, NULL, errno_p,
-                       error_msg_p);
-  for (n = 0; n < isa->num_interfaces; n++)
-    {
-      isa->interface_lookup_table[n].key = isa->interfaces[n].name;
-      isa->interface_lookup_table[n].u.intf = n;
-    }
-  qsort (isa->interface_lookup_table, isa->num_interfaces,
-        sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  /* Set up the funcUnit lookup table.  */
-  isa->funcUnit_lookup_table = 
-    bfd_malloc (isa->num_funcUnits * sizeof (xtensa_lookup_entry));
-  CHECK_ALLOC_FOR_INIT (isa->funcUnit_lookup_table, NULL, errno_p,
-                       error_msg_p);
-  for (n = 0; n < isa->num_funcUnits; n++)
-    {
-      isa->funcUnit_lookup_table[n].key = isa->funcUnits[n].name;
-      isa->funcUnit_lookup_table[n].u.fun = n;
-    }
-  qsort (isa->funcUnit_lookup_table, isa->num_funcUnits,
-        sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  isa->insnbuf_size = ((isa->insn_size + sizeof (xtensa_insnbuf_word) - 1) /
-                      sizeof (xtensa_insnbuf_word));
-
-  return (xtensa_isa) isa;
-}
-
-
-void
-xtensa_isa_free (xtensa_isa isa)
+xtensa_isa_init (void)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int n;
+  xtensa_isa isa;
+  int mod;
 
-  /* With this version of the code, the xtensa_isa structure is not
-     dynamically allocated, so this function is not essential.  Free
-     the memory allocated by xtensa_isa_init and restore the xtensa_isa
-     structure to its initial state.  */
-
-  if (intisa->opname_lookup_table)
+  isa = xtensa_load_isa (0);
+  if (isa == 0)
     {
-      free (intisa->opname_lookup_table);
-      intisa->opname_lookup_table = 0;
-    }
-
-  if (intisa->state_lookup_table)
-    {
-      free (intisa->state_lookup_table);
-      intisa->state_lookup_table = 0;
+      fprintf (stderr, "Failed to initialize Xtensa base ISA module\n");
+      return NULL;
     }
 
-  if (intisa->sysreg_lookup_table)
-    {
-      free (intisa->sysreg_lookup_table);
-      intisa->sysreg_lookup_table = 0;
-    }
-  for (n = 0; n < 2; n++)
+  for (mod = 1; xtensa_isa_modules[mod].get_num_opcodes_fn; mod++)
     {
-      if (intisa->sysreg_table[n])
+      if (!xtensa_extend_isa (isa, mod))
        {
-         free (intisa->sysreg_table[n]);
-         intisa->sysreg_table[n] = 0;
+         fprintf (stderr, "Failed to initialize Xtensa TIE ISA module\n");
+         return NULL;
        }
     }
-
-  if (intisa->interface_lookup_table)
-    {
-      free (intisa->interface_lookup_table);
-      intisa->interface_lookup_table = 0;
-    }
-
-  if (intisa->funcUnit_lookup_table)
-    {
-      free (intisa->funcUnit_lookup_table);
-      intisa->funcUnit_lookup_table = 0;
-    }
-}
-
-
-int
-xtensa_isa_name_compare (const void *v1, const void *v2)
-{
-  xtensa_lookup_entry *e1 = (xtensa_lookup_entry *) v1;
-  xtensa_lookup_entry *e2 = (xtensa_lookup_entry *) v2;
-
-  return strcasecmp (e1->key, e2->key);
-}
-
-
-int
-xtensa_isa_maxlength (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->insn_size;
-}
-
-
-int
-xtensa_isa_length_from_chars (xtensa_isa isa, const char *cp)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return (intisa->length_decode_fn) (cp);
-}
-
-
-int
-xtensa_isa_num_pipe_stages (xtensa_isa isa) 
-{
-  int num_opcodes, num_uses;
-  xtensa_opcode opcode;
-  xtensa_funcUnit_use *use;
-  int i, stage, max_stage = XTENSA_UNDEFINED;
-
-  num_opcodes = xtensa_isa_num_opcodes (isa);
-  for (opcode = 0; opcode < num_opcodes; opcode++)
-    {
-      num_uses = xtensa_opcode_num_funcUnit_uses (isa, opcode);
-      for (i = 0; i < num_uses; i++)
-       {
-         use = xtensa_opcode_funcUnit_use (isa, opcode, i);
-         stage = use->stage;
-         if (stage > max_stage)
-           max_stage = stage;
-       }
-    }
-
-  return max_stage + 1;
-}
-
-
-int
-xtensa_isa_num_formats (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_formats;
-}
-
-
-int
-xtensa_isa_num_opcodes (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_opcodes;
-}
-
-
-int
-xtensa_isa_num_regfiles (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_regfiles;
-}
-
-
-int
-xtensa_isa_num_states (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_states;
-}
-
-
-int
-xtensa_isa_num_sysregs (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_sysregs;
-}
-
-
-int
-xtensa_isa_num_interfaces (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_interfaces;
-}
-
-
-int
-xtensa_isa_num_funcUnits (xtensa_isa isa)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  return intisa->num_funcUnits;
-}
-
-
-\f
-/* Instruction formats.  */
-
-
-#define CHECK_FORMAT(INTISA,FMT,ERRVAL) \
-  do { \
-    if ((FMT) < 0 || (FMT) >= (INTISA)->num_formats) \
-      { \
-       xtisa_errno = xtensa_isa_bad_format; \
-       strcpy (xtisa_error_msg, "invalid format specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-#define CHECK_SLOT(INTISA,FMT,SLOT,ERRVAL) \
-  do { \
-    if ((SLOT) < 0 || (SLOT) >= (INTISA)->formats[FMT].num_slots) \
-      { \
-       xtisa_errno = xtensa_isa_bad_slot; \
-       strcpy (xtisa_error_msg, "invalid slot specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-const char *
-xtensa_format_name (xtensa_isa isa, xtensa_format fmt)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FORMAT (intisa, fmt, NULL);
-  return intisa->formats[fmt].name;
-}
-
-
-xtensa_format
-xtensa_format_lookup (xtensa_isa isa, const char *fmtname)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int fmt;
-
-  if (!fmtname || !*fmtname)
-    {
-      xtisa_errno = xtensa_isa_bad_format;
-      strcpy (xtisa_error_msg, "invalid format name");
-      return XTENSA_UNDEFINED;
-    }
-
-  for (fmt = 0; fmt < intisa->num_formats; fmt++)
-    {
-      if (strcasecmp (fmtname, intisa->formats[fmt].name) == 0)
-       return fmt;
-    }
-  
-  xtisa_errno = xtensa_isa_bad_format;
-  sprintf (xtisa_error_msg, "format \"%s\" not recognized", fmtname);
-  return XTENSA_UNDEFINED;
-}
-
-
-xtensa_format
-xtensa_format_decode (xtensa_isa isa, const xtensa_insnbuf insn)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_format fmt;
-
-  fmt = (intisa->format_decode_fn) (insn);
-  if (fmt != XTENSA_UNDEFINED)
-    return fmt;
-
-  xtisa_errno = xtensa_isa_bad_format;
-  strcpy (xtisa_error_msg, "cannot decode instruction format");
-  return XTENSA_UNDEFINED;
-}
-
-
-int
-xtensa_format_encode (xtensa_isa isa, xtensa_format fmt, xtensa_insnbuf insn)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FORMAT (intisa, fmt, -1);
-  (*intisa->formats[fmt].encode_fn) (insn);
-  return 0;
-}
-
-
-int
-xtensa_format_length (xtensa_isa isa, xtensa_format fmt)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
-  return intisa->formats[fmt].length;
-}
-
-
-int
-xtensa_format_num_slots (xtensa_isa isa, xtensa_format fmt)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
-  return intisa->formats[fmt].num_slots;
-}
-
-
-xtensa_opcode
-xtensa_format_slot_nop_opcode (xtensa_isa isa, xtensa_format fmt, int slot)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int slot_id;
-
-  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
-  CHECK_SLOT (intisa, fmt, slot, XTENSA_UNDEFINED);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  return xtensa_opcode_lookup (isa, intisa->slots[slot_id].nop_name);
-}
-
-
-int
-xtensa_format_get_slot (xtensa_isa isa, xtensa_format fmt, int slot,
-                       const xtensa_insnbuf insn, xtensa_insnbuf slotbuf)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int slot_id;
-
-  CHECK_FORMAT (intisa, fmt, -1);
-  CHECK_SLOT (intisa, fmt, slot, -1);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  (*intisa->slots[slot_id].get_fn) (insn, slotbuf);
-  return 0;
-}
-
-
-int
-xtensa_format_set_slot (xtensa_isa isa, xtensa_format fmt, int slot,
-                       xtensa_insnbuf insn, const xtensa_insnbuf slotbuf)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int slot_id;
-
-  CHECK_FORMAT (intisa, fmt, -1);
-  CHECK_SLOT (intisa, fmt, slot, -1);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  (*intisa->slots[slot_id].set_fn) (insn, slotbuf);
-  return 0;
-}
-
-
-\f
-/* Opcode information.  */
-
-
-#define CHECK_OPCODE(INTISA,OPC,ERRVAL) \
-  do { \
-    if ((OPC) < 0 || (OPC) >= (INTISA)->num_opcodes) \
-      { \
-       xtisa_errno = xtensa_isa_bad_opcode; \
-       strcpy (xtisa_error_msg, "invalid opcode specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-xtensa_opcode
-xtensa_opcode_lookup (xtensa_isa isa, const char *opname)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_lookup_entry entry, *result;
-
-  if (!opname || !*opname)
-    {
-      xtisa_errno = xtensa_isa_bad_opcode;
-      strcpy (xtisa_error_msg, "invalid opcode name");
-      return XTENSA_UNDEFINED;
-    }
-
-  entry.key = opname;
-  result = bsearch (&entry, intisa->opname_lookup_table, intisa->num_opcodes,
-                   sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  if (!result)
-    {
-      xtisa_errno = xtensa_isa_bad_opcode;
-      sprintf (xtisa_error_msg, "opcode \"%s\" not recognized", opname);
-      return XTENSA_UNDEFINED;
-    }
-
-  return result->u.opcode;
-}
-
-
-xtensa_opcode
-xtensa_opcode_decode (xtensa_isa isa, xtensa_format fmt, int slot,
-                     const xtensa_insnbuf slotbuf)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int slot_id;
-  xtensa_opcode opc;
-
-  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
-  CHECK_SLOT (intisa, fmt, slot, XTENSA_UNDEFINED);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-
-  opc = (intisa->slots[slot_id].opcode_decode_fn) (slotbuf);
-  if (opc == XTENSA_UNDEFINED)
-    {
-      xtisa_errno = xtensa_isa_bad_opcode;
-      strcpy (xtisa_error_msg, "cannot decode opcode");
-    }
-  return opc;
-}
-
-
-int
-xtensa_opcode_encode (xtensa_isa isa, xtensa_format fmt, int slot,
-                     xtensa_insnbuf slotbuf, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int slot_id;
-  xtensa_opcode_encode_fn encode_fn;
-
-  CHECK_FORMAT (intisa, fmt, -1);
-  CHECK_SLOT (intisa, fmt, slot, -1);
-  CHECK_OPCODE (intisa, opc, -1);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  encode_fn = intisa->opcodes[opc].encode_fns[slot_id];
-  if (!encode_fn)
-    {
-      xtisa_errno = xtensa_isa_wrong_slot;
-      sprintf (xtisa_error_msg,
-              "opcode \"%s\" is not allowed in slot %d of format \"%s\"",
-              intisa->opcodes[opc].name, slot, intisa->formats[fmt].name);
-      return -1;
-    }
-  (*encode_fn) (slotbuf);
-  return 0;
-}
-
-
-const char *
-xtensa_opcode_name (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, NULL);
-  return intisa->opcodes[opc].name;
-}
-
-
-int
-xtensa_opcode_is_branch (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_BRANCH) != 0)
-    return 1;
-  return 0;
-}
-
-
-int
-xtensa_opcode_is_jump (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_JUMP) != 0)
-    return 1;
-  return 0;
-}
-
-
-int
-xtensa_opcode_is_loop (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_LOOP) != 0)
-    return 1;
-  return 0;
-}
-
-
-int
-xtensa_opcode_is_call (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_CALL) != 0)
-    return 1;
-  return 0;
-}
-
-
-int
-xtensa_opcode_num_operands (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  return intisa->iclasses[iclass_id].num_operands;
-}
-
-
-int
-xtensa_opcode_num_stateOperands (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  return intisa->iclasses[iclass_id].num_stateOperands;
-}
-
-
-int
-xtensa_opcode_num_interfaceOperands (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  return intisa->iclasses[iclass_id].num_interfaceOperands;
-}
-
-
-int
-xtensa_opcode_num_funcUnit_uses (xtensa_isa isa, xtensa_opcode opc)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  return intisa->opcodes[opc].num_funcUnit_uses;
-}
-
-
-xtensa_funcUnit_use *
-xtensa_opcode_funcUnit_use (xtensa_isa isa, xtensa_opcode opc, int u)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_OPCODE (intisa, opc, NULL);
-  if (u < 0 || u >= intisa->opcodes[opc].num_funcUnit_uses)
-    {
-      xtisa_errno = xtensa_isa_bad_funcUnit;
-      sprintf (xtisa_error_msg, "invalid functional unit use number (%d); "
-              "opcode \"%s\" has %d", u, intisa->opcodes[opc].name,
-              intisa->opcodes[opc].num_funcUnit_uses);
-      return NULL;
-    }
-  return &intisa->opcodes[opc].funcUnit_uses[u];
-}
-
-
-\f
-/* Operand information.  */
-
-
-#define CHECK_OPERAND(INTISA,OPC,ICLASS,OPND,ERRVAL) \
-  do { \
-    if ((OPND) < 0 || (OPND) >= (ICLASS)->num_operands) \
-      { \
-       xtisa_errno = xtensa_isa_bad_operand; \
-       sprintf (xtisa_error_msg, "invalid operand number (%d); " \
-                "opcode \"%s\" has %d operands", (OPND), \
-                (INTISA)->opcodes[(OPC)].name, (ICLASS)->num_operands); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-static xtensa_operand_internal *
-get_operand (xtensa_isa_internal *intisa, xtensa_opcode opc, int opnd)
-{
-  xtensa_iclass_internal *iclass;
-  int iclass_id, operand_id;
-
-  CHECK_OPCODE (intisa, opc, NULL);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_OPERAND (intisa, opc, iclass, opnd, NULL);
-  operand_id = iclass->operands[opnd].u.operand_id;
-  return &intisa->operands[operand_id];
-}
-
-
-const char *
-xtensa_operand_name (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return NULL;
-  return intop->name;
-}
-
-
-int
-xtensa_operand_is_visible (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_iclass_internal *iclass;
-  int iclass_id, operand_id;
-  xtensa_operand_internal *intop;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_OPERAND (intisa, opc, iclass, opnd, XTENSA_UNDEFINED);
-
-  /* Special case for "sout" operands.  */
-  if (iclass->operands[opnd].inout == 's')
-    return 0;
-
-  operand_id = iclass->operands[opnd].u.operand_id;
-  intop = &intisa->operands[operand_id];
-
-  if ((intop->flags & XTENSA_OPERAND_IS_INVISIBLE) == 0)
-    return 1;
-  return 0;
-}
-
-
-char
-xtensa_operand_inout (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_iclass_internal *iclass;
-  int iclass_id;
-  char inout;
-
-  CHECK_OPCODE (intisa, opc, 0);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_OPERAND (intisa, opc, iclass, opnd, 0);
-  inout = iclass->operands[opnd].inout;
-
-  /* Special case for "sout" operands.  */
-  if (inout == 's')
-    return 'o';
-
-  return inout;
-}
-
-
-int
-xtensa_operand_get_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                         xtensa_format fmt, int slot,
-                         const xtensa_insnbuf slotbuf, uint32 *valp)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-  int slot_id;
-  xtensa_get_field_fn get_fn;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
-
-  CHECK_FORMAT (intisa, fmt, -1);
-  CHECK_SLOT (intisa, fmt, slot, -1);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  if (intop->field_id == XTENSA_UNDEFINED)
-    {
-      xtisa_errno = xtensa_isa_no_field;
-      strcpy (xtisa_error_msg, "implicit operand has no field");
-      return -1;
-    }
-  get_fn = intisa->slots[slot_id].get_field_fns[intop->field_id];
-  if (!get_fn)
-    {
-      xtisa_errno = xtensa_isa_wrong_slot;
-      sprintf (xtisa_error_msg,
-              "operand \"%s\" does not exist in slot %d of format \"%s\"",
-              intop->name, slot, intisa->formats[fmt].name);
-      return -1;
-    }
-  *valp = (*get_fn) (slotbuf);
-  return 0;
-}
-
-
-int
-xtensa_operand_set_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                         xtensa_format fmt, int slot,
-                         xtensa_insnbuf slotbuf, uint32 val)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-  int slot_id;
-  xtensa_set_field_fn set_fn;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
-
-  CHECK_FORMAT (intisa, fmt, -1);
-  CHECK_SLOT (intisa, fmt, slot, -1);
-
-  slot_id = intisa->formats[fmt].slot_id[slot];
-  if (intop->field_id == XTENSA_UNDEFINED)
-    {
-      xtisa_errno = xtensa_isa_no_field;
-      strcpy (xtisa_error_msg, "implicit operand has no field");
-      return -1;
-    }
-  set_fn = intisa->slots[slot_id].set_field_fns[intop->field_id];
-  if (!set_fn)
-    {
-      xtisa_errno = xtensa_isa_wrong_slot;
-      sprintf (xtisa_error_msg,
-              "operand \"%s\" does not exist in slot %d of format \"%s\"",
-              intop->name, slot, intisa->formats[fmt].name);
-      return -1;
-    }
-  (*set_fn) (slotbuf, val);
-  return 0;
+
+  return isa;
 }
 
+/* ISA information.  */
 
-int
-xtensa_operand_encode (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                      uint32 *valp)
+static int
+xtensa_check_isa_config (xtensa_isa_internal *isa,
+                        struct config_struct *config_table)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-  uint32 test_val, orig_val;
+  int i, j;
 
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
-
-  if (!intop->encode)
+  if (!config_table)
     {
-      /* This is a default operand for a field.  How can we tell if the
-        value fits in the field?  Write the value into the field,
-        read it back, and then make sure we get the same value.  */
+      fprintf (stderr, "Error: Empty configuration table in ISA DLL\n");
+      return 0;
+    }
 
-      xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-      static xtensa_insnbuf tmpbuf = 0;
-      int slot_id;
+  /* For the first module, save a pointer to the table and record the
+     specified endianness and availability of the density option.  */
 
-      if (!tmpbuf)
-       {
-         tmpbuf = xtensa_insnbuf_alloc (isa);
-         CHECK_ALLOC (tmpbuf, -1);
-       }
+  if (isa->num_modules == 0)
+    {
+      int found_memory_order = 0;
 
-      /* A default operand is always associated with a field,
-        but check just to be sure....  */
-      if (intop->field_id == XTENSA_UNDEFINED)
-       {
-         xtisa_errno = xtensa_isa_internal_error;
-         strcpy (xtisa_error_msg, "operand has no field");
-         return -1;
-       }
+      isa->config = config_table;
+      isa->has_density = 1;  /* Default to have density option.  */
 
-      /* Find some slot that includes the field.  */
-      for (slot_id = 0; slot_id < intisa->num_slots; slot_id++)
+      for (i = 0; config_table[i].param_name; i++)
        {
-         xtensa_get_field_fn get_fn =
-           intisa->slots[slot_id].get_field_fns[intop->field_id];
-         xtensa_set_field_fn set_fn =
-           intisa->slots[slot_id].set_field_fns[intop->field_id];
-
-         if (get_fn && set_fn)
+         if (!strcmp (config_table[i].param_name, "IsaMemoryOrder"))
            {
-             (*set_fn) (tmpbuf, *valp);
-             return ((*get_fn) (tmpbuf) != *valp);
+             isa->is_big_endian =
+               (strcmp (config_table[i].param_value, "BigEndian") == 0);
+             found_memory_order = 1;
            }
+         if (!strcmp (config_table[i].param_name, "IsaUseDensityInstruction"))
+           {
+             isa->has_density = atoi (config_table[i].param_value);
+           }
+       }
+      if (!found_memory_order)
+       {
+         fprintf (stderr, "Error: \"IsaMemoryOrder\" missing from "
+                  "configuration table in ISA DLL\n");
+         return 0;
        }
 
-      /* Couldn't find any slot containing the field....  */
-      xtisa_errno = xtensa_isa_no_field;
-      strcpy (xtisa_error_msg, "field does not exist in any slot");
-      return -1;
+      return 1;
     }
 
-  /* Encode the value.  In some cases, the encoding function may detect
-     errors, but most of the time the only way to determine if the value
-     was successfully encoded is to decode it and check if it matches
-     the original value.  */
-  orig_val = *valp;
-  if ((*intop->encode) (valp) ||
-      (test_val = *valp, (*intop->decode) (&test_val)) ||
-      test_val != orig_val)
+  /* For subsequent modules, check that the parameters match.  Note: This
+     code is sufficient to handle the current model where there are never
+     more than 2 modules; we might at some point want to handle cases where
+     module N > 0 specifies some parameters not included in the base table,
+     and we would then add those to isa->config so that subsequent modules
+     would check against them. */
+
+  for (i = 0; config_table[i].param_name; i++)
     {
-      xtisa_errno = xtensa_isa_bad_value;
-      sprintf (xtisa_error_msg, "cannot encode operand value 0x%08x", *valp);
-      return -1;
+      for (j = 0; isa->config[j].param_name; j++)
+       {
+         if (!strcmp (config_table[i].param_name, isa->config[j].param_name))
+           {
+             int mismatch;
+             if (!strcmp (config_table[i].param_name, "IsaCoprocessorCount"))
+               {
+                 /* Only require the coprocessor count to be <= the base.  */
+                 int tiecnt = atoi (config_table[i].param_value);
+                 int basecnt = atoi (isa->config[j].param_value);
+                 mismatch = (tiecnt > basecnt);
+               }
+             else
+               mismatch = strcmp (config_table[i].param_value,
+                                  isa->config[j].param_value);
+             if (mismatch)
+               {
+#define MISMATCH_MESSAGE \
+"Error: Configuration mismatch in the \"%s\" parameter:\n\
+the configuration used when the TIE file was compiled had a value of\n\
+\"%s\", while the current configuration has a value of\n\
+\"%s\". Please rerun the TIE compiler with a matching\n\
+configuration.\n"
+                 fprintf (stderr, MISMATCH_MESSAGE,
+                          config_table[i].param_name,
+                          config_table[i].param_value,
+                          isa->config[j].param_value);
+                 return 0;
+               }
+             break;
+           }
+       }
     }
 
-  return 0;
+  return 1;
 }
 
 
-int
-xtensa_operand_decode (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                      uint32 *valp)
+static int
+xtensa_add_isa (xtensa_isa_internal *isa, libisa_module_specifier libisa)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
+  int (*get_num_opcodes_fn) (void);
+  struct config_struct *(*get_config_table_fn) (void);
+  xtensa_opcode_internal **(*get_opcodes_fn) (void);
+  int (*decode_insn_fn) (const xtensa_insnbuf);
+  xtensa_opcode_internal **opcodes;
+  int opc, insn_size, prev_num_opcodes, new_num_opcodes, this_module;
 
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
+  get_num_opcodes_fn = xtensa_isa_modules[libisa].get_num_opcodes_fn;
+  get_opcodes_fn = xtensa_isa_modules[libisa].get_opcodes_fn;
+  decode_insn_fn = xtensa_isa_modules[libisa].decode_insn_fn;
+  get_config_table_fn = xtensa_isa_modules[libisa].get_config_table_fn;
 
-  /* Use identity function for "default" operands.  */
-  if (!intop->decode)
+  if (!get_num_opcodes_fn || !get_opcodes_fn || !decode_insn_fn
+      || (!get_config_table_fn && isa->num_modules == 0))
     return 0;
 
-  if ((*intop->decode) (valp))
-    {
-      xtisa_errno = xtensa_isa_bad_value;
-      sprintf (xtisa_error_msg, "cannot decode operand value 0x%08x", *valp);
-      return -1;
-    }
-  return 0;
-}
+  if (get_config_table_fn
+      && !xtensa_check_isa_config (isa, get_config_table_fn ()))
+    return 0;
 
+  prev_num_opcodes = isa->num_opcodes;
+  new_num_opcodes = (*get_num_opcodes_fn) ();
 
-int
-xtensa_operand_is_register (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
+  isa->num_opcodes += new_num_opcodes;
+  isa->opcode_table = (xtensa_opcode_internal **)
+    realloc (isa->opcode_table, isa->num_opcodes *
+            sizeof (xtensa_opcode_internal *));
+  isa->opname_lookup_table = (opname_lookup_entry *)
+    realloc (isa->opname_lookup_table, isa->num_opcodes *
+            sizeof (opname_lookup_entry));
 
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return XTENSA_UNDEFINED;
+  opcodes = (*get_opcodes_fn) ();
 
-  if ((intop->flags & XTENSA_OPERAND_IS_REGISTER) != 0)
-    return 1;
-  return 0;
-}
+  insn_size = isa->insn_size;
+  for (opc = 0; opc < new_num_opcodes; opc++)
+    {
+      xtensa_opcode_internal *intopc = opcodes[opc];
+      int newopc = prev_num_opcodes + opc;
+      isa->opcode_table[newopc] = intopc;
+      isa->opname_lookup_table[newopc].key = intopc->name;
+      isa->opname_lookup_table[newopc].opcode = newopc;
+      if (intopc->length > insn_size)
+       insn_size = intopc->length;
+    }
 
+  isa->insn_size = insn_size;
+  isa->insnbuf_size = ((isa->insn_size + sizeof (xtensa_insnbuf_word) - 1) /
+                      sizeof (xtensa_insnbuf_word));
 
-xtensa_regfile
-xtensa_operand_regfile (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
+  qsort (isa->opname_lookup_table, isa->num_opcodes,
+        sizeof (opname_lookup_entry), opname_lookup_compare);
 
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return XTENSA_UNDEFINED;
+  /* Check for duplicate opcode names.  */
+  for (opc = 1; opc < isa->num_opcodes; opc++)
+    {
+      if (!opname_lookup_compare (&isa->opname_lookup_table[opc-1],
+                                 &isa->opname_lookup_table[opc]))
+       {
+         fprintf (stderr, "Error: Duplicate TIE opcode \"%s\"\n",
+                  isa->opname_lookup_table[opc].key);
+         return 0;
+       }
+    }
 
-  return intop->regfile;
-}
+  this_module = isa->num_modules;
+  isa->num_modules += 1;
 
+  isa->module_opcode_base = (int *) realloc (isa->module_opcode_base,
+                                            isa->num_modules * sizeof (int));
+  isa->module_decode_fn = (xtensa_insn_decode_fn *)
+    realloc (isa->module_decode_fn, isa->num_modules *
+            sizeof (xtensa_insn_decode_fn));
 
-int
-xtensa_operand_num_regs (xtensa_isa isa, xtensa_opcode opc, int opnd)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
+  isa->module_opcode_base[this_module] = prev_num_opcodes;
+  isa->module_decode_fn[this_module] = decode_insn_fn;
 
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return XTENSA_UNDEFINED;
+  xtensa_default_isa = isa;
 
-  return intop->num_regs;
+  return 1;    /* Library was successfully added.  */
 }
 
 
-int
-xtensa_operand_is_known_reg (xtensa_isa isa, xtensa_opcode opc, int opnd)
+xtensa_isa
+xtensa_load_isa (libisa_module_specifier libisa)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return XTENSA_UNDEFINED;
+  xtensa_isa_internal *isa;
 
-  if ((intop->flags & XTENSA_OPERAND_IS_UNKNOWN) == 0)
-    return 1;
-  return 0;
+  isa = (xtensa_isa_internal *) malloc (sizeof (xtensa_isa_internal));
+  memset (isa, 0, sizeof (xtensa_isa_internal));
+  if (!xtensa_add_isa (isa, libisa))
+    {
+      xtensa_isa_free (isa);
+      return NULL;
+    }
+  return (xtensa_isa) isa;
 }
 
 
 int
-xtensa_operand_is_PCrelative (xtensa_isa isa, xtensa_opcode opc, int opnd)
+xtensa_extend_isa (xtensa_isa isa, libisa_module_specifier libisa)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return XTENSA_UNDEFINED;
-
-  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) != 0)
-    return 1;
-  return 0;
+  return xtensa_add_isa (intisa, libisa);
 }
 
 
-int
-xtensa_operand_do_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                        uint32 *valp, uint32 pc)
+void
+xtensa_isa_free (xtensa_isa isa)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
-
-  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) == 0)
-    return 0;
-
-  if (!intop->do_reloc)
-    {
-      xtisa_errno = xtensa_isa_internal_error;
-      strcpy (xtisa_error_msg, "operand missing do_reloc function");
-      return -1;
-    }
-
-  if ((*intop->do_reloc) (valp, pc))
-    {
-      xtisa_errno = xtensa_isa_bad_value;
-      sprintf (xtisa_error_msg,
-              "do_reloc failed for value 0x%08x at PC 0x%08x", *valp, pc);
-      return -1;
-    }
-
-  return 0;
+  if (intisa->opcode_table)
+    free (intisa->opcode_table);
+  if (intisa->opname_lookup_table)
+    free (intisa->opname_lookup_table);
+  if (intisa->module_opcode_base)
+    free (intisa->module_opcode_base);
+  if (intisa->module_decode_fn)
+    free (intisa->module_decode_fn);
+  free (intisa);
 }
 
 
 int
-xtensa_operand_undo_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                          uint32 *valp, uint32 pc)
+xtensa_insn_maxlength (xtensa_isa isa)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_operand_internal *intop;
-
-  intop = get_operand (intisa, opc, opnd);
-  if (!intop) return -1;
-
-  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) == 0)
-    return 0;
-
-  if (!intop->undo_reloc)
-    {
-      xtisa_errno = xtensa_isa_internal_error;
-      strcpy (xtisa_error_msg, "operand missing undo_reloc function");
-      return -1;
-    }
-
-  if ((*intop->undo_reloc) (valp, pc))
-    {
-      xtisa_errno = xtensa_isa_bad_value;
-      sprintf (xtisa_error_msg,
-              "undo_reloc failed for value 0x%08x at PC 0x%08x", *valp, pc);
-      return -1;
-    }
-
-  return 0;
+  return intisa->insn_size;
 }
 
 
-\f
-/* State Operands.  */
-
-
-#define CHECK_STATE_OPERAND(INTISA,OPC,ICLASS,STOP,ERRVAL) \
-  do { \
-    if ((STOP) < 0 || (STOP) >= (ICLASS)->num_stateOperands) \
-      { \
-       xtisa_errno = xtensa_isa_bad_operand; \
-       sprintf (xtisa_error_msg, "invalid state operand number (%d); " \
-                "opcode \"%s\" has %d state operands", (STOP), \
-                (INTISA)->opcodes[(OPC)].name, (ICLASS)->num_stateOperands); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-xtensa_state
-xtensa_stateOperand_state (xtensa_isa isa, xtensa_opcode opc, int stOp)
+int
+xtensa_insnbuf_size (xtensa_isa isa)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_iclass_internal *iclass;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_STATE_OPERAND (intisa, opc, iclass, stOp, XTENSA_UNDEFINED);
-  return iclass->stateOperands[stOp].u.state;
+  xtensa_isa_internal *intisa = (xtensa_isa_internal *)isa;
+  return intisa->insnbuf_size;
 }
 
 
-char
-xtensa_stateOperand_inout (xtensa_isa isa, xtensa_opcode opc, int stOp)
+int
+xtensa_num_opcodes (xtensa_isa isa)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_iclass_internal *iclass;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, 0);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_STATE_OPERAND (intisa, opc, iclass, stOp, 0);
-  return iclass->stateOperands[stOp].inout;
+  return intisa->num_opcodes;
 }
 
-\f
-/* Interface Operands.  */
 
-
-#define CHECK_INTERFACE_OPERAND(INTISA,OPC,ICLASS,IFOP,ERRVAL) \
-  do { \
-    if ((IFOP) < 0 || (IFOP) >= (ICLASS)->num_interfaceOperands) \
-      { \
-       xtisa_errno = xtensa_isa_bad_operand; \
-       sprintf (xtisa_error_msg, "invalid interface operand number (%d); " \
-                "opcode \"%s\" has %d interface operands", (IFOP), \
-                (INTISA)->opcodes[(OPC)].name, \
-                (ICLASS)->num_interfaceOperands); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-xtensa_interface
-xtensa_interfaceOperand_interface (xtensa_isa isa, xtensa_opcode opc,
-                                  int ifOp)
+xtensa_opcode
+xtensa_opcode_lookup (xtensa_isa isa, const char *opname)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_iclass_internal *iclass;
-  int iclass_id;
-
-  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
-  iclass_id = intisa->opcodes[opc].iclass_id;
-  iclass = &intisa->iclasses[iclass_id];
-  CHECK_INTERFACE_OPERAND (intisa, opc, iclass, ifOp, XTENSA_UNDEFINED);
-  return iclass->interfaceOperands[ifOp];
-}
-
-
-\f
-/* Register Files.  */
+  opname_lookup_entry entry, *result;
 
-
-#define CHECK_REGFILE(INTISA,RF,ERRVAL) \
-  do { \
-    if ((RF) < 0 || (RF) >= (INTISA)->num_regfiles) \
-      { \
-       xtisa_errno = xtensa_isa_bad_regfile; \
-       strcpy (xtisa_error_msg, "invalid regfile specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
+  entry.key = opname;
+  result = bsearch (&entry, intisa->opname_lookup_table, intisa->num_opcodes,
+                   sizeof (opname_lookup_entry), opname_lookup_compare);
+  if (!result) return XTENSA_UNDEFINED;
+  return result->opcode;
+}
 
 
-xtensa_regfile
-xtensa_regfile_lookup (xtensa_isa isa, const char *name)
+xtensa_opcode
+xtensa_decode_insn (xtensa_isa isa, const xtensa_insnbuf insn)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  int n;
-
-  if (!name || !*name)
-    {
-      xtisa_errno = xtensa_isa_bad_regfile;
-      strcpy (xtisa_error_msg, "invalid regfile name");
-      return XTENSA_UNDEFINED;
-    }
-
-  /* The expected number of regfiles is small; use a linear search.  */
-  for (n = 0; n < intisa->num_regfiles; n++)
-    {
-      if (!strcmp (intisa->regfiles[n].name, name))
-       return n;
-    }
-
-  xtisa_errno = xtensa_isa_bad_regfile;
-  sprintf (xtisa_error_msg, "regfile \"%s\" not recognized", name);
+  int n, opc;
+  for (n = 0; n < intisa->num_modules; n++) {
+    opc = (intisa->module_decode_fn[n]) (insn);
+    if (opc != XTENSA_UNDEFINED)
+      return intisa->module_opcode_base[n] + opc;
+  }
   return XTENSA_UNDEFINED;
 }
 
 
-xtensa_regfile
-xtensa_regfile_lookup_shortname (xtensa_isa isa, const char *shortname)
+/* Opcode information.  */
+
+void
+xtensa_encode_insn (xtensa_isa isa, xtensa_opcode opc, xtensa_insnbuf insn)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
+  xtensa_insnbuf template = intisa->opcode_table[opc]->template();
+  int len = intisa->opcode_table[opc]->length;
   int n;
 
-  if (!shortname || !*shortname)
-    {
-      xtisa_errno = xtensa_isa_bad_regfile;
-      strcpy (xtisa_error_msg, "invalid regfile shortname");
-      return XTENSA_UNDEFINED;
-    }
+  /* Convert length to 32-bit words.  */
+  len = (len + 3) / 4;
 
-  /* The expected number of regfiles is small; use a linear search.  */
-  for (n = 0; n < intisa->num_regfiles; n++)
-    {
-      /* Ignore regfile views since they always have the same shortnames
-        as their parents.  */
-      if (intisa->regfiles[n].parent != n)
-       continue;
-      if (!strcmp (intisa->regfiles[n].shortname, shortname))
-       return n;
-    }
+  /* Copy the template.  */
+  for (n = 0; n < len; n++)
+    insn[n] = template[n];
 
-  xtisa_errno = xtensa_isa_bad_regfile;
-  sprintf (xtisa_error_msg, "regfile shortname \"%s\" not recognized",
-          shortname);
-  return XTENSA_UNDEFINED;
+  /* Fill any unused buffer space with zeros.  */
+  for ( ; n < intisa->insnbuf_size; n++)
+    insn[n] = 0;
 }
 
 
 const char *
-xtensa_regfile_name (xtensa_isa isa, xtensa_regfile rf)
+xtensa_opcode_name (xtensa_isa isa, xtensa_opcode opc)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_REGFILE (intisa, rf, NULL);
-  return intisa->regfiles[rf].name;
+  return intisa->opcode_table[opc]->name;
 }
 
 
-const char *
-xtensa_regfile_shortname (xtensa_isa isa, xtensa_regfile rf)
+int
+xtensa_insn_length (xtensa_isa isa, xtensa_opcode opc)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_REGFILE (intisa, rf, NULL);
-  return intisa->regfiles[rf].shortname;
+  return intisa->opcode_table[opc]->length;
 }
 
 
-xtensa_regfile
-xtensa_regfile_view_parent (xtensa_isa isa, xtensa_regfile rf)
+int
+xtensa_insn_length_from_first_byte (xtensa_isa isa, char first_byte)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
-  return intisa->regfiles[rf].parent;
+  int is_density = (first_byte & (intisa->is_big_endian ? 0x80 : 0x08)) != 0;
+  return (intisa->has_density && is_density ? 2 : 3);
 }
 
 
 int
-xtensa_regfile_num_bits (xtensa_isa isa, xtensa_regfile rf)
+xtensa_num_operands (xtensa_isa isa, xtensa_opcode opc)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
-  return intisa->regfiles[rf].num_bits;
+  return intisa->opcode_table[opc]->iclass->num_operands;
 }
 
 
-int
-xtensa_regfile_num_entries (xtensa_isa isa, xtensa_regfile rf)
+xtensa_operand
+xtensa_get_operand (xtensa_isa isa, xtensa_opcode opc, int opnd)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
-  return intisa->regfiles[rf].num_entries;
+  xtensa_iclass_internal *iclass = intisa->opcode_table[opc]->iclass;
+  if (opnd >= iclass->num_operands)
+    return NULL;
+  return (xtensa_operand) iclass->operands[opnd];
 }
 
-\f
-/* Processor States.  */
-
-
-#define CHECK_STATE(INTISA,ST,ERRVAL) \
-  do { \
-    if ((ST) < 0 || (ST) >= (INTISA)->num_states) \
-      { \
-       xtisa_errno = xtensa_isa_bad_state; \
-       strcpy (xtisa_error_msg, "invalid state specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
 
+/* Operand information.  */
 
-xtensa_state
-xtensa_state_lookup (xtensa_isa isa, const char *name)
+char *
+xtensa_operand_kind (xtensa_operand opnd)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_lookup_entry entry, *result;
-
-  if (!name || !*name)
-    {
-      xtisa_errno = xtensa_isa_bad_state;
-      strcpy (xtisa_error_msg, "invalid state name");
-      return XTENSA_UNDEFINED;
-    }
-
-  entry.key = name;
-  result = bsearch (&entry, intisa->state_lookup_table, intisa->num_states,
-                   sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  if (!result)
-    {
-      xtisa_errno = xtensa_isa_bad_state;
-      sprintf (xtisa_error_msg, "state \"%s\" not recognized", name);
-      return XTENSA_UNDEFINED;
-    }
-
-  return result->u.state;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return intop->operand_kind;
 }
 
 
-const char *
-xtensa_state_name (xtensa_isa isa, xtensa_state st)
+char
+xtensa_operand_inout (xtensa_operand opnd)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_STATE (intisa, st, NULL);
-  return intisa->states[st].name;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return intop->inout;
 }
 
 
-int
-xtensa_state_num_bits (xtensa_isa isa, xtensa_state st)
+uint32
+xtensa_operand_get_field (xtensa_operand opnd, const xtensa_insnbuf insn)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
-  return intisa->states[st].num_bits;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return (*intop->get_field) (insn);
 }
 
 
-int
-xtensa_state_is_exported (xtensa_isa isa, xtensa_state st)
+void
+xtensa_operand_set_field (xtensa_operand opnd, xtensa_insnbuf insn, uint32 val)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
-  if ((intisa->states[st].flags & XTENSA_STATE_IS_EXPORTED) != 0)
-    return 1;
-  return 0;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return (*intop->set_field) (insn, val);
 }
 
-\f
-/* Sysregs.  */
-
 
-#define CHECK_SYSREG(INTISA,SYSREG,ERRVAL) \
-  do { \
-    if ((SYSREG) < 0 || (SYSREG) >= (INTISA)->num_sysregs) \
-      { \
-       xtisa_errno = xtensa_isa_bad_sysreg; \
-       strcpy (xtisa_error_msg, "invalid sysreg specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
-
-
-xtensa_sysreg
-xtensa_sysreg_lookup (xtensa_isa isa, int num, int is_user)
+xtensa_encode_result
+xtensa_operand_encode (xtensa_operand opnd, uint32 *valp)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-
-  if (is_user != 0)
-    is_user = 1;
-
-  if (num < 0 || num > intisa->max_sysreg_num[is_user]
-      || intisa->sysreg_table[is_user][num] == XTENSA_UNDEFINED)
-    {
-      xtisa_errno = xtensa_isa_bad_sysreg;
-      strcpy (xtisa_error_msg, "sysreg not recognized");
-      return XTENSA_UNDEFINED;
-    }
-
-  return intisa->sysreg_table[is_user][num];
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return (*intop->encode) (valp);
 }
 
 
-xtensa_sysreg
-xtensa_sysreg_lookup_name (xtensa_isa isa, const char *name)
+uint32
+xtensa_operand_decode (xtensa_operand opnd, uint32 val)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_lookup_entry entry, *result;
-
-  if (!name || !*name)
-    {
-      xtisa_errno = xtensa_isa_bad_sysreg;
-      strcpy (xtisa_error_msg, "invalid sysreg name");
-      return XTENSA_UNDEFINED;
-    }
-
-  entry.key = name;
-  result = bsearch (&entry, intisa->sysreg_lookup_table, intisa->num_sysregs,
-                   sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  if (!result)
-    {
-      xtisa_errno = xtensa_isa_bad_sysreg;
-      sprintf (xtisa_error_msg, "sysreg \"%s\" not recognized", name);
-      return XTENSA_UNDEFINED;
-    }
-
-  return result->u.sysreg;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return (*intop->decode) (val);
 }
 
 
-const char *
-xtensa_sysreg_name (xtensa_isa isa, xtensa_sysreg sysreg)
+int
+xtensa_operand_isPCRelative (xtensa_operand opnd)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_SYSREG (intisa, sysreg, NULL);
-  return intisa->sysregs[sysreg].name;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  return intop->isPCRelative;
 }
 
 
-int
-xtensa_sysreg_number (xtensa_isa isa, xtensa_sysreg sysreg)
+uint32
+xtensa_operand_do_reloc (xtensa_operand opnd, uint32 addr, uint32 pc)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_SYSREG (intisa, sysreg, XTENSA_UNDEFINED);
-  return intisa->sysregs[sysreg].number;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  if (!intop->isPCRelative)
+    return addr;
+  return (*intop->do_reloc) (addr, pc);
 }
 
 
-int
-xtensa_sysreg_is_user (xtensa_isa isa, xtensa_sysreg sysreg)
+uint32
+xtensa_operand_undo_reloc (xtensa_operand opnd, uint32 offset, uint32 pc)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_SYSREG (intisa, sysreg, XTENSA_UNDEFINED);
-  if (intisa->sysregs[sysreg].is_user)
-    return 1;
-  return 0;
+  xtensa_operand_internal *intop = (xtensa_operand_internal *) opnd;
+  if (!intop->isPCRelative)
+    return offset;
+  return (*intop->undo_reloc) (offset, pc);
 }
 
-\f
-/* Interfaces.  */
-
-
-#define CHECK_INTERFACE(INTISA,INTF,ERRVAL) \
-  do { \
-    if ((INTF) < 0 || (INTF) >= (INTISA)->num_interfaces) \
-      { \
-       xtisa_errno = xtensa_isa_bad_interface; \
-       strcpy (xtisa_error_msg, "invalid interface specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
 
+/* Instruction buffers.  */
 
-xtensa_interface
-xtensa_interface_lookup (xtensa_isa isa, const char *ifname)
+xtensa_insnbuf
+xtensa_insnbuf_alloc (xtensa_isa isa)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_lookup_entry entry, *result;
-
-  if (!ifname || !*ifname)
-    {
-      xtisa_errno = xtensa_isa_bad_interface;
-      strcpy (xtisa_error_msg, "invalid interface name");
-      return XTENSA_UNDEFINED;
-    }
-
-  entry.key = ifname;
-  result = bsearch (&entry, intisa->interface_lookup_table,
-                   intisa->num_interfaces,
-                   sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
-
-  if (!result)
-    {
-      xtisa_errno = xtensa_isa_bad_interface;
-      sprintf (xtisa_error_msg, "interface \"%s\" not recognized", ifname);
-      return XTENSA_UNDEFINED;
-    }
-
-  return result->u.intf;
+  return (xtensa_insnbuf) malloc (xtensa_insnbuf_size (isa) *
+                                 sizeof (xtensa_insnbuf_word));
 }
 
 
-const char *
-xtensa_interface_name (xtensa_isa isa, xtensa_interface intf)
+void
+xtensa_insnbuf_free (xtensa_insnbuf buf)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_INTERFACE (intisa, intf, NULL);
-  return intisa->interfaces[intf].name;
+  free( buf );
 }
 
 
-int
-xtensa_interface_num_bits (xtensa_isa isa, xtensa_interface intf)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_INTERFACE (intisa, intf, XTENSA_UNDEFINED);
-  return intisa->interfaces[intf].num_bits;
-}
-
+/* Given <byte_index>, the index of a byte in a xtensa_insnbuf, our
+   internal representation of a xtensa instruction word, return the index of
+   its word and the bit index of its low order byte in the xtensa_insnbuf.  */
 
-char
-xtensa_interface_inout (xtensa_isa isa, xtensa_interface intf)
+static inline int
+byte_to_word_index (int byte_index)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_INTERFACE (intisa, intf, 0);
-  return intisa->interfaces[intf].inout;
+  return byte_index / sizeof (xtensa_insnbuf_word);
 }
 
 
-int
-xtensa_interface_has_side_effect (xtensa_isa isa, xtensa_interface intf)
+static inline int
+byte_to_bit_index (int byte_index)
 {
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_INTERFACE (intisa, intf, XTENSA_UNDEFINED);
-  if ((intisa->interfaces[intf].flags & XTENSA_INTERFACE_HAS_SIDE_EFFECT) != 0)
-    return 1;
-  return 0;
+  return (byte_index & 0x3) * 8;
 }
 
-\f
-/* Functional Units.  */
-
 
-#define CHECK_FUNCUNIT(INTISA,FUN,ERRVAL) \
-  do { \
-    if ((FUN) < 0 || (FUN) >= (INTISA)->num_funcUnits) \
-      { \
-       xtisa_errno = xtensa_isa_bad_funcUnit; \
-       strcpy (xtisa_error_msg, "invalid functional unit specifier"); \
-       return (ERRVAL); \
-      } \
-  } while (0)
+/* Copy an instruction in the 32 bit words pointed at by <insn> to characters
+   pointed at by <cp>.  This is more complicated than you might think because
+   we want 16 bit instructions in bytes 2,3 for big endian. This function
+   allows us to specify which byte in <insn> to start with and which way to
+   increment, allowing trivial implementation for both big and little endian.
+   And it seems to make pretty good code for both.  */
 
-
-xtensa_funcUnit
-xtensa_funcUnit_lookup (xtensa_isa isa, const char *fname)
+void
+xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn, char *cp)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  xtensa_lookup_entry entry, *result;
+  int insn_size = xtensa_insn_maxlength (intisa);
+  int fence_post, start, increment, i, byte_count;
+  xtensa_opcode opc;
 
-  if (!fname || !*fname)
+  if (intisa->is_big_endian)
+    {
+      start = insn_size - 1;
+      increment = -1;
+    }
+  else
     {
-      xtisa_errno = xtensa_isa_bad_funcUnit;
-      strcpy (xtisa_error_msg, "invalid functional unit name");
-      return XTENSA_UNDEFINED;
+      start = 0;
+      increment = 1;
     }
 
-  entry.key = fname;
-  result = bsearch (&entry, intisa->funcUnit_lookup_table,
-                   intisa->num_funcUnits,
-                   sizeof (xtensa_lookup_entry), xtensa_isa_name_compare);
+  /* Find the opcode; do nothing if the buffer does not contain a valid
+     instruction since we need to know how many bytes to copy.  */
+  opc = xtensa_decode_insn (isa, insn);
+  if (opc == XTENSA_UNDEFINED)
+    return;
+
+  byte_count = xtensa_insn_length (isa, opc);
+  fence_post = start + (byte_count * increment);
 
-  if (!result)
+  for (i = start; i != fence_post; i += increment, ++cp)
     {
-      xtisa_errno = xtensa_isa_bad_funcUnit;
-      sprintf (xtisa_error_msg,
-              "functional unit \"%s\" not recognized", fname);
-      return XTENSA_UNDEFINED;
-    }
+      int word_inx = byte_to_word_index (i);
+      int bit_inx = byte_to_bit_index (i);
 
-  return result->u.fun;
+      *cp = (insn[word_inx] >> bit_inx) & 0xff;
+    }
 }
 
-
-const char *
-xtensa_funcUnit_name (xtensa_isa isa, xtensa_funcUnit fun)
+/* Inward conversion from byte stream to xtensa_insnbuf.  See
+   xtensa_insnbuf_to_chars for a discussion of why this is
+   complicated by endianness.  */
+    
+void
+xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn, const char* cp)
 {
   xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FUNCUNIT (intisa, fun, NULL);
-  return intisa->funcUnits[fun].name;
-}
+  int insn_size = xtensa_insn_maxlength (intisa);
+  int fence_post, start, increment, i;
+
+  if (intisa->is_big_endian)
+    {
+      start = insn_size - 1;
+      increment = -1;
+    }
+  else
+    {
+      start = 0;
+      increment = 1;
+    }
 
+  fence_post = start + (insn_size * increment);
+  memset (insn, 0, xtensa_insnbuf_size (isa) * sizeof (xtensa_insnbuf_word));
 
-int
-xtensa_funcUnit_num_copies (xtensa_isa isa, xtensa_funcUnit fun)
-{
-  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
-  CHECK_FUNCUNIT (intisa, fun, XTENSA_UNDEFINED);
-  return intisa->funcUnits[fun].num_copies;
+  for ( i = start; i != fence_post; i += increment, ++cp )
+    {
+      int word_inx = byte_to_word_index (i);
+      int bit_inx = byte_to_bit_index (i);
+
+      insn[word_inx] |= (*cp & 0xff) << bit_inx;
+    }
 }
 
index bc0cf734c4ce9235698933b4e5d688b9c29167da..e5d7682f09a3b97885eb994851c6b91420a8c31e 100644 (file)
 /* Xtensa configuration-specific ISA information.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 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 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.
+   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.  */
 
-#include "ansidecl.h"
 #include <xtensa-isa.h>
 #include "xtensa-isa-internal.h"
+#include "ansidecl.h"
 
-\f
-/* Sysregs.  */
-
-static xtensa_sysreg_internal sysregs[] = {
-  { "LBEG", 0, 0 },
-  { "LEND", 1, 0 },
-  { "LCOUNT", 2, 0 },
-  { "DDR", 104, 0 },
-  { "176", 176, 0 },
-  { "208", 208, 0 },
-  { "INTERRUPT", 226, 0 },
-  { "INTCLEAR", 227, 0 },
-  { "CCOUNT", 234, 0 },
-  { "PRID", 235, 0 },
-  { "ICOUNT", 236, 0 },
-  { "CCOMPARE0", 240, 0 },
-  { "CCOMPARE1", 241, 0 },
-  { "CCOMPARE2", 242, 0 },
-  { "EPC1", 177, 0 },
-  { "EPC2", 178, 0 },
-  { "EPC3", 179, 0 },
-  { "EPC4", 180, 0 },
-  { "EXCSAVE1", 209, 0 },
-  { "EXCSAVE2", 210, 0 },
-  { "EXCSAVE3", 211, 0 },
-  { "EXCSAVE4", 212, 0 },
-  { "EPS2", 194, 0 },
-  { "EPS3", 195, 0 },
-  { "EPS4", 196, 0 },
-  { "EXCCAUSE", 232, 0 },
-  { "DEPC", 192, 0 },
-  { "EXCVADDR", 238, 0 },
-  { "WINDOWBASE", 72, 0 },
-  { "WINDOWSTART", 73, 0 },
-  { "SAR", 3, 0 },
-  { "LITBASE", 5, 0 },
-  { "PS", 230, 0 },
-  { "MISC0", 244, 0 },
-  { "MISC1", 245, 0 },
-  { "INTENABLE", 228, 0 },
-  { "DBREAKA0", 144, 0 },
-  { "DBREAKC0", 160, 0 },
-  { "DBREAKA1", 145, 0 },
-  { "DBREAKC1", 161, 0 },
-  { "IBREAKA0", 128, 0 },
-  { "IBREAKA1", 129, 0 },
-  { "IBREAKENABLE", 96, 0 },
-  { "ICOUNTLEVEL", 237, 0 },
-  { "DEBUGCAUSE", 233, 0 }
-};
-
-#define NUM_SYSREGS 45
-#define MAX_SPECIAL_REG 245
-#define MAX_USER_REG 0
-
-\f
-/* Processor states.  */
-
-static xtensa_state_internal states[] = {
-  { "LCOUNT", 32, 0 },
-  { "PC", 32, 0 },
-  { "ICOUNT", 32, 0 },
-  { "DDR", 32, 0 },
-  { "INTERRUPT", 17, 0 },
-  { "CCOUNT", 32, 0 },
-  { "XTSYNC", 1, 0 },
-  { "EPC1", 32, 0 },
-  { "EPC2", 32, 0 },
-  { "EPC3", 32, 0 },
-  { "EPC4", 32, 0 },
-  { "EXCSAVE1", 32, 0 },
-  { "EXCSAVE2", 32, 0 },
-  { "EXCSAVE3", 32, 0 },
-  { "EXCSAVE4", 32, 0 },
-  { "EPS2", 13, 0 },
-  { "EPS3", 13, 0 },
-  { "EPS4", 13, 0 },
-  { "EXCCAUSE", 6, 0 },
-  { "PSINTLEVEL", 4, 0 },
-  { "PSUM", 1, 0 },
-  { "PSWOE", 1, 0 },
-  { "PSEXCM", 1, 0 },
-  { "DEPC", 32, 0 },
-  { "EXCVADDR", 32, 0 },
-  { "WindowBase", 4, 0 },
-  { "WindowStart", 16, 0 },
-  { "PSCALLINC", 2, 0 },
-  { "PSOWB", 4, 0 },
-  { "LBEG", 32, 0 },
-  { "LEND", 32, 0 },
-  { "SAR", 6, 0 },
-  { "LITBADDR", 20, 0 },
-  { "LITBEN", 1, 0 },
-  { "MISC0", 32, 0 },
-  { "MISC1", 32, 0 },
-  { "InOCDMode", 1, 0 },
-  { "INTENABLE", 17, 0 },
-  { "DBREAKA0", 32, 0 },
-  { "DBREAKC0", 8, 0 },
-  { "DBREAKA1", 32, 0 },
-  { "DBREAKC1", 8, 0 },
-  { "IBREAKA0", 32, 0 },
-  { "IBREAKA1", 32, 0 },
-  { "IBREAKENABLE", 2, 0 },
-  { "ICOUNTLEVEL", 4, 0 },
-  { "DEBUGCAUSE", 6, 0 },
-  { "DBNUM", 4, 0 },
-  { "CCOMPARE0", 32, 0 },
-  { "CCOMPARE1", 32, 0 },
-  { "CCOMPARE2", 32, 0 }
-};
-
-#define NUM_STATES 51
-
-/* Macros for xtensa_state numbers (for use in iclasses because the
-   state numbers are not available when the iclass table is generated).  */
-
-#define STATE_LCOUNT 0
-#define STATE_PC 1
-#define STATE_ICOUNT 2
-#define STATE_DDR 3
-#define STATE_INTERRUPT 4
-#define STATE_CCOUNT 5
-#define STATE_XTSYNC 6
-#define STATE_EPC1 7
-#define STATE_EPC2 8
-#define STATE_EPC3 9
-#define STATE_EPC4 10
-#define STATE_EXCSAVE1 11
-#define STATE_EXCSAVE2 12
-#define STATE_EXCSAVE3 13
-#define STATE_EXCSAVE4 14
-#define STATE_EPS2 15
-#define STATE_EPS3 16
-#define STATE_EPS4 17
-#define STATE_EXCCAUSE 18
-#define STATE_PSINTLEVEL 19
-#define STATE_PSUM 20
-#define STATE_PSWOE 21
-#define STATE_PSEXCM 22
-#define STATE_DEPC 23
-#define STATE_EXCVADDR 24
-#define STATE_WindowBase 25
-#define STATE_WindowStart 26
-#define STATE_PSCALLINC 27
-#define STATE_PSOWB 28
-#define STATE_LBEG 29
-#define STATE_LEND 30
-#define STATE_SAR 31
-#define STATE_LITBADDR 32
-#define STATE_LITBEN 33
-#define STATE_MISC0 34
-#define STATE_MISC1 35
-#define STATE_InOCDMode 36
-#define STATE_INTENABLE 37
-#define STATE_DBREAKA0 38
-#define STATE_DBREAKC0 39
-#define STATE_DBREAKA1 40
-#define STATE_DBREAKC1 41
-#define STATE_IBREAKA0 42
-#define STATE_IBREAKA1 43
-#define STATE_IBREAKENABLE 44
-#define STATE_ICOUNTLEVEL 45
-#define STATE_DEBUGCAUSE 46
-#define STATE_DBNUM 47
-#define STATE_CCOMPARE0 48
-#define STATE_CCOMPARE1 49
-#define STATE_CCOMPARE2 50
-
-\f
-/* Field definitions.  */
-
-static unsigned
-Field_t_Slot_inst_get (const xtensa_insnbuf insn)
-{
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
-  return tie_t;
-}
-
-static void
-Field_t_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
-{
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
-}
-
-static unsigned
-Field_s_Slot_inst_get (const xtensa_insnbuf insn)
-{
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
-}
+#define BPW 32
+#define WINDEX(_n) ((_n) / BPW)
+#define BINDEX(_n) ((_n) %% BPW)
+
+static uint32 tie_do_reloc_l (uint32, uint32) ATTRIBUTE_UNUSED;
+static uint32 tie_undo_reloc_l (uint32, uint32) ATTRIBUTE_UNUSED;
+
+static uint32
+tie_do_reloc_l (uint32 addr, uint32 pc)
+{
+  return (addr - pc);
+}
+
+static uint32
+tie_undo_reloc_l (uint32 offset, uint32 pc)
+{
+  return (pc + offset);
+}
+
+xtensa_opcode_internal** get_opcodes (void);
+int get_num_opcodes (void);
+int decode_insn (const xtensa_insnbuf);
+int interface_version (void);
+
+uint32 get_bbi_field (const xtensa_insnbuf);
+void set_bbi_field (xtensa_insnbuf, uint32);
+uint32 get_bbi4_field (const xtensa_insnbuf);
+void set_bbi4_field (xtensa_insnbuf, uint32);
+uint32 get_i_field (const xtensa_insnbuf);
+void set_i_field (xtensa_insnbuf, uint32);
+uint32 get_imm12_field (const xtensa_insnbuf);
+void set_imm12_field (xtensa_insnbuf, uint32);
+uint32 get_imm12b_field (const xtensa_insnbuf);
+void set_imm12b_field (xtensa_insnbuf, uint32);
+uint32 get_imm16_field (const xtensa_insnbuf);
+void set_imm16_field (xtensa_insnbuf, uint32);
+uint32 get_imm4_field (const xtensa_insnbuf);
+void set_imm4_field (xtensa_insnbuf, uint32);
+uint32 get_imm6_field (const xtensa_insnbuf);
+void set_imm6_field (xtensa_insnbuf, uint32);
+uint32 get_imm6hi_field (const xtensa_insnbuf);
+void set_imm6hi_field (xtensa_insnbuf, uint32);
+uint32 get_imm6lo_field (const xtensa_insnbuf);
+void set_imm6lo_field (xtensa_insnbuf, uint32);
+uint32 get_imm7_field (const xtensa_insnbuf);
+void set_imm7_field (xtensa_insnbuf, uint32);
+uint32 get_imm7hi_field (const xtensa_insnbuf);
+void set_imm7hi_field (xtensa_insnbuf, uint32);
+uint32 get_imm7lo_field (const xtensa_insnbuf);
+void set_imm7lo_field (xtensa_insnbuf, uint32);
+uint32 get_imm8_field (const xtensa_insnbuf);
+void set_imm8_field (xtensa_insnbuf, uint32);
+uint32 get_m_field (const xtensa_insnbuf);
+void set_m_field (xtensa_insnbuf, uint32);
+uint32 get_mn_field (const xtensa_insnbuf);
+void set_mn_field (xtensa_insnbuf, uint32);
+uint32 get_n_field (const xtensa_insnbuf);
+void set_n_field (xtensa_insnbuf, uint32);
+uint32 get_none_field (const xtensa_insnbuf);
+void set_none_field (xtensa_insnbuf, uint32);
+uint32 get_offset_field (const xtensa_insnbuf);
+void set_offset_field (xtensa_insnbuf, uint32);
+uint32 get_op0_field (const xtensa_insnbuf);
+void set_op0_field (xtensa_insnbuf, uint32);
+uint32 get_op1_field (const xtensa_insnbuf);
+void set_op1_field (xtensa_insnbuf, uint32);
+uint32 get_op2_field (const xtensa_insnbuf);
+void set_op2_field (xtensa_insnbuf, uint32);
+uint32 get_r_field (const xtensa_insnbuf);
+void set_r_field (xtensa_insnbuf, uint32);
+uint32 get_s_field (const xtensa_insnbuf);
+void set_s_field (xtensa_insnbuf, uint32);
+uint32 get_sa4_field (const xtensa_insnbuf);
+void set_sa4_field (xtensa_insnbuf, uint32);
+uint32 get_sae_field (const xtensa_insnbuf);
+void set_sae_field (xtensa_insnbuf, uint32);
+uint32 get_sae4_field (const xtensa_insnbuf);
+void set_sae4_field (xtensa_insnbuf, uint32);
+uint32 get_sal_field (const xtensa_insnbuf);
+void set_sal_field (xtensa_insnbuf, uint32);
+uint32 get_sar_field (const xtensa_insnbuf);
+void set_sar_field (xtensa_insnbuf, uint32);
+uint32 get_sas_field (const xtensa_insnbuf);
+void set_sas_field (xtensa_insnbuf, uint32);
+uint32 get_sas4_field (const xtensa_insnbuf);
+void set_sas4_field (xtensa_insnbuf, uint32);
+uint32 get_sr_field (const xtensa_insnbuf);
+void set_sr_field (xtensa_insnbuf, uint32);
+uint32 get_t_field (const xtensa_insnbuf);
+void set_t_field (xtensa_insnbuf, uint32);
+uint32 get_thi3_field (const xtensa_insnbuf);
+void set_thi3_field (xtensa_insnbuf, uint32);
+uint32 get_z_field (const xtensa_insnbuf);
+void set_z_field (xtensa_insnbuf, uint32);
 
-static void
-Field_s_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
-{
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-}
 
-static unsigned
-Field_r_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_bbi_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf0000) >> 16) |
+         ((insn[0] & 0x100) >> 4);
 }
 
-static void
-Field_r_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_bbi_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
+  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
+  insn[0] = (insn[0] & 0xfffffeff) | ((val << 4) & 0x100);
 }
 
-static unsigned
-Field_op2_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_bbi4_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x100) >> 8);
 }
 
-static void
-Field_op2_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_bbi4_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xfffffeff) | ((val << 8) & 0x100);
 }
 
-static unsigned
-Field_op1_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_i_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x80000) >> 19);
 }
 
-static void
-Field_op1_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_i_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xfff7ffff) | ((val << 19) & 0x80000);
 }
 
-static unsigned
-Field_op0_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_imm12_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 8) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xfff));
 }
 
-static void
-Field_op0_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm12_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00000) | (tie_t << 20);
+  insn[0] = (insn[0] & 0xfffff000) | (val & 0xfff);
 }
 
-static unsigned
-Field_n_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_imm12b_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 12) >> 30);
-  return tie_t;
+  return ((insn[0] & 0xff)) |
+         ((insn[0] & 0xf000) >> 4);
 }
 
-static void
-Field_n_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm12b_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 30) >> 30;
-  insn[0] = (insn[0] & ~0xc0000) | (tie_t << 18);
+  insn[0] = (insn[0] & 0xffffff00) | (val & 0xff);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 4) & 0xf000);
 }
 
-static unsigned
-Field_m_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_imm16_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 14) >> 30);
-  return tie_t;
+  return ((insn[0] & 0xffff));
 }
 
-static void
-Field_m_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm16_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 30) >> 30;
-  insn[0] = (insn[0] & ~0x30000) | (tie_t << 16);
+  insn[0] = (insn[0] & 0xffff0000) | (val & 0xffff);
 }
 
-static unsigned
-Field_sr_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_imm4_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8);
 }
 
-static void
-Field_sr_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm4_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
 }
 
-static unsigned
-Field_thi3_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_imm6_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 3) | ((insn[0] << 12) >> 29);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8) |
+         ((insn[0] & 0x30000) >> 12);
 }
 
-static void
-Field_thi3_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm6_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 29) >> 29;
-  insn[0] = (insn[0] & ~0xe0000) | (tie_t << 17);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
+  insn[0] = (insn[0] & 0xfffcffff) | ((val << 12) & 0x30000);
 }
 
-static unsigned
-Field_op0_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+get_imm6hi_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x30000) >> 16);
 }
 
-static void
-Field_op0_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm6hi_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
+  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
 }
 
-static unsigned
-Field_t_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_imm6lo_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8);
 }
 
-static void
-Field_t_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm6lo_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
 }
 
-static unsigned
-Field_r_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_imm7_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8) |
+         ((insn[0] & 0x70000) >> 12);
 }
 
-static void
-Field_r_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm7_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
+  insn[0] = (insn[0] & 0xfff8ffff) | ((val << 12) & 0x70000);
 }
 
-static unsigned
-Field_op0_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_imm7hi_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x70000) >> 16);
 }
 
-static void
-Field_op0_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm7hi_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
+  insn[0] = (insn[0] & 0xfff8ffff) | ((val << 16) & 0x70000);
 }
 
-static unsigned
-Field_z_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_imm7lo_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 21) >> 31);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8);
 }
 
-static void
-Field_z_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm7lo_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x400) | (tie_t << 10);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
 }
 
-static unsigned
-Field_i_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_imm8_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 20) >> 31);
-  return tie_t;
+  return ((insn[0] & 0xff));
 }
 
-static void
-Field_i_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_imm8_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x800) | (tie_t << 11);
+  insn[0] = (insn[0] & 0xffffff00) | (val & 0xff);
 }
 
-static unsigned
-Field_s_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_m_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x30000) >> 16);
 }
 
-static void
-Field_s_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_m_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
 }
 
-static unsigned
-Field_t_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+get_mn_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x30000) >> 16) |
+         ((insn[0] & 0xc0000) >> 16);
 }
 
-static void
-Field_t_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+void
+set_mn_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
+  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
+  insn[0] = (insn[0] & 0xfff3ffff) | ((val << 16) & 0xc0000);
 }
 
-static unsigned
-Field_bbi4_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_n_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 23) >> 31);
-  return tie_t;
+  return ((insn[0] & 0xc0000) >> 18);
 }
 
-static void
-Field_bbi4_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_n_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x100) | (tie_t << 8);
+  insn[0] = (insn[0] & 0xfff3ffff) | ((val << 18) & 0xc0000);
 }
 
-static unsigned
-Field_bbi_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_none_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 23) >> 31);
-  tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x0));
 }
 
-static void
-Field_bbi_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_none_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
-  tie_t = (val << 27) >> 31;
-  insn[0] = (insn[0] & ~0x100) | (tie_t << 8);
+  insn[0] = (insn[0] & 0xffffffff) | (val & 0x0);
 }
 
-static unsigned
-Field_imm12_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_offset_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 12) | ((insn[0] << 20) >> 20);
-  return tie_t;
+  return ((insn[0] & 0x3ffff));
 }
 
-static void
-Field_imm12_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_offset_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 20) >> 20;
-  insn[0] = (insn[0] & ~0xfff) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xfffc0000) | (val & 0x3ffff);
 }
 
-static unsigned
-Field_imm8_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_op0_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 8) | ((insn[0] << 24) >> 24);
-  return tie_t;
+  return ((insn[0] & 0xf00000) >> 20);
 }
 
-static void
-Field_imm8_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_op0_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 24) >> 24;
-  insn[0] = (insn[0] & ~0xff) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xff0fffff) | ((val << 20) & 0xf00000);
 }
 
-static unsigned
-Field_s_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+get_op1_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf0) >> 4);
 }
 
-static void
-Field_s_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+void
+set_op1_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xffffff0f) | ((val << 4) & 0xf0);
 }
 
-static unsigned
-Field_imm12b_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_op2_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  tie_t = (tie_t << 8) | ((insn[0] << 24) >> 24);
-  return tie_t;
+  return ((insn[0] & 0xf));
 }
 
-static void
-Field_imm12b_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_op2_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 24) >> 24;
-  insn[0] = (insn[0] & ~0xff) | (tie_t << 0);
-  tie_t = (val << 20) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
+  insn[0] = (insn[0] & 0xfffffff0) | (val & 0xf);
 }
 
-static unsigned
-Field_imm16_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_r_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 16) | ((insn[0] << 16) >> 16);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8);
 }
 
-static void
-Field_imm16_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_r_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 16) >> 16;
-  insn[0] = (insn[0] & ~0xffff) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
 }
 
-static unsigned
-Field_offset_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_s_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 18) | ((insn[0] << 14) >> 14);
-  return tie_t;
+  return ((insn[0] & 0xf000) >> 12);
 }
 
-static void
-Field_offset_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_s_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 14) >> 14;
-  insn[0] = (insn[0] & ~0x3ffff) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
 }
 
-static unsigned
-Field_r_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+get_sa4_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x1));
 }
 
-static void
-Field_r_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sa4_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xfffffffe) | (val & 0x1);
 }
 
-static unsigned
-Field_sa4_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sae_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31);
-  return tie_t;
+  return ((insn[0] & 0xf000) >> 12) |
+         ((insn[0] & 0x10));
 }
 
-static void
-Field_sa4_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sae_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x1) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
+  insn[0] = (insn[0] & 0xffffffef) | (val & 0x10);
 }
 
-static unsigned
-Field_sae4_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sae4_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 27) >> 31);
-  return tie_t;
+  return ((insn[0] & 0x10) >> 4);
 }
 
-static void
-Field_sae4_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sae4_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x10) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xffffffef) | ((val << 4) & 0x10);
 }
 
-static unsigned
-Field_sae_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sal_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 27) >> 31);
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf0000) >> 16) |
+         ((insn[0] & 0x1) << 4);
 }
 
-static void
-Field_sae_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sal_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-  tie_t = (val << 27) >> 31;
-  insn[0] = (insn[0] & ~0x10) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
+  insn[0] = (insn[0] & 0xfffffffe) | ((val >> 4) & 0x1);
 }
 
-static unsigned
-Field_sal_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sar_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31);
-  tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf000) >> 12) |
+         ((insn[0] & 0x1) << 4);
 }
 
-static void
-Field_sal_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sar_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
-  tie_t = (val << 27) >> 31;
-  insn[0] = (insn[0] & ~0x1) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
+  insn[0] = (insn[0] & 0xfffffffe) | ((val >> 4) & 0x1);
 }
 
-static unsigned
-Field_sargt_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sas_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31);
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf000) >> 12) |
+         ((insn[0] & 0x10000) >> 12);
 }
 
-static void
-Field_sargt_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sas_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-  tie_t = (val << 27) >> 31;
-  insn[0] = (insn[0] & ~0x1) | (tie_t << 0);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
+  insn[0] = (insn[0] & 0xfffeffff) | ((val << 12) & 0x10000);
 }
 
-static unsigned
-Field_sas4_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sas4_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 15) >> 31);
-  return tie_t;
+  return ((insn[0] & 0x10000) >> 16);
 }
 
-static void
-Field_sas4_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sas4_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x10000) | (tie_t << 16);
+  insn[0] = (insn[0] & 0xfffeffff) | ((val << 16) & 0x10000);
 }
 
-static unsigned
-Field_sas_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_sr_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 15) >> 31);
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf00) >> 8) |
+         ((insn[0] & 0xf000) >> 8);
 }
 
-static void
-Field_sas_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+void
+set_sr_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-  tie_t = (val << 27) >> 31;
-  insn[0] = (insn[0] & ~0x10000) | (tie_t << 16);
+  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
+  insn[0] = (insn[0] & 0xffff0fff) | ((val << 8) & 0xf000);
 }
 
-static unsigned
-Field_sr_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+get_t_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xf0000) >> 16);
 }
 
-static void
-Field_sr_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+void
+set_t_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
 }
 
-static unsigned
-Field_sr_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+get_thi3_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return ((insn[0] & 0xe0000) >> 17);
 }
 
-static void
-Field_sr_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+void
+set_thi3_field (xtensa_insnbuf insn, uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  insn[0] = (insn[0] & 0xfff1ffff) | ((val << 17) & 0xe0000);
 }
 
-static unsigned
-Field_st_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+get_z_field (const xtensa_insnbuf insn)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
-  return tie_t;
+  return ((insn[0] & 0x40000) >> 18);
 }
 
-static void
-Field_st_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
-{
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-}
+void
+set_z_field (xtensa_insnbuf insn, uint32 val)
+{
+  insn[0] = (insn[0] & 0xfffbffff) | ((val << 18) & 0x40000);
+}
+
+uint32 decode_b4constu (uint32);
+xtensa_encode_result encode_b4constu (uint32 *);
+uint32 decode_simm8x256 (uint32);
+xtensa_encode_result encode_simm8x256 (uint32 *);
+uint32 decode_soffset (uint32);
+xtensa_encode_result encode_soffset (uint32 *);
+uint32 decode_imm4 (uint32);
+xtensa_encode_result encode_imm4 (uint32 *);
+uint32 decode_op0 (uint32);
+xtensa_encode_result encode_op0 (uint32 *);
+uint32 decode_op1 (uint32);
+xtensa_encode_result encode_op1 (uint32 *);
+uint32 decode_imm6 (uint32);
+xtensa_encode_result encode_imm6 (uint32 *);
+uint32 decode_op2 (uint32);
+xtensa_encode_result encode_op2 (uint32 *);
+uint32 decode_imm7 (uint32);
+xtensa_encode_result encode_imm7 (uint32 *);
+uint32 decode_simm4 (uint32);
+xtensa_encode_result encode_simm4 (uint32 *);
+uint32 decode_ai4const (uint32);
+xtensa_encode_result encode_ai4const (uint32 *);
+uint32 decode_imm8 (uint32);
+xtensa_encode_result encode_imm8 (uint32 *);
+uint32 decode_sae (uint32);
+xtensa_encode_result encode_sae (uint32 *);
+uint32 decode_imm7lo (uint32);
+xtensa_encode_result encode_imm7lo (uint32 *);
+uint32 decode_simm7 (uint32);
+xtensa_encode_result encode_simm7 (uint32 *);
+uint32 decode_simm8 (uint32);
+xtensa_encode_result encode_simm8 (uint32 *);
+uint32 decode_uimm12x8 (uint32);
+xtensa_encode_result encode_uimm12x8 (uint32 *);
+uint32 decode_sal (uint32);
+xtensa_encode_result encode_sal (uint32 *);
+uint32 decode_uimm6 (uint32);
+xtensa_encode_result encode_uimm6 (uint32 *);
+uint32 decode_sas4 (uint32);
+xtensa_encode_result encode_sas4 (uint32 *);
+uint32 decode_uimm8 (uint32);
+xtensa_encode_result encode_uimm8 (uint32 *);
+uint32 decode_uimm16x4 (uint32);
+xtensa_encode_result encode_uimm16x4 (uint32 *);
+uint32 decode_sar (uint32);
+xtensa_encode_result encode_sar (uint32 *);
+uint32 decode_sa4 (uint32);
+xtensa_encode_result encode_sa4 (uint32 *);
+uint32 decode_sas (uint32);
+xtensa_encode_result encode_sas (uint32 *);
+uint32 decode_imm6hi (uint32);
+xtensa_encode_result encode_imm6hi (uint32 *);
+uint32 decode_bbi (uint32);
+xtensa_encode_result encode_bbi (uint32 *);
+uint32 decode_uimm8x2 (uint32);
+xtensa_encode_result encode_uimm8x2 (uint32 *);
+uint32 decode_uimm8x4 (uint32);
+xtensa_encode_result encode_uimm8x4 (uint32 *);
+uint32 decode_msalp32 (uint32);
+xtensa_encode_result encode_msalp32 (uint32 *);
+uint32 decode_bbi4 (uint32);
+xtensa_encode_result encode_bbi4 (uint32 *);
+uint32 decode_op2p1 (uint32);
+xtensa_encode_result encode_op2p1 (uint32 *);
+uint32 decode_soffsetx4 (uint32);
+xtensa_encode_result encode_soffsetx4 (uint32 *);
+uint32 decode_imm6lo (uint32);
+xtensa_encode_result encode_imm6lo (uint32 *);
+uint32 decode_imm12 (uint32);
+xtensa_encode_result encode_imm12 (uint32 *);
+uint32 decode_b4const (uint32);
+xtensa_encode_result encode_b4const (uint32 *);
+uint32 decode_i (uint32);
+xtensa_encode_result encode_i (uint32 *);
+uint32 decode_imm16 (uint32);
+xtensa_encode_result encode_imm16 (uint32 *);
+uint32 decode_mn (uint32);
+xtensa_encode_result encode_mn (uint32 *);
+uint32 decode_m (uint32);
+xtensa_encode_result encode_m (uint32 *);
+uint32 decode_n (uint32);
+xtensa_encode_result encode_n (uint32 *);
+uint32 decode_none (uint32);
+xtensa_encode_result encode_none (uint32 *);
+uint32 decode_imm12b (uint32);
+xtensa_encode_result encode_imm12b (uint32 *);
+uint32 decode_r (uint32);
+xtensa_encode_result encode_r (uint32 *);
+uint32 decode_s (uint32);
+xtensa_encode_result encode_s (uint32 *);
+uint32 decode_t (uint32);
+xtensa_encode_result encode_t (uint32 *);
+uint32 decode_thi3 (uint32);
+xtensa_encode_result encode_thi3 (uint32 *);
+uint32 decode_sae4 (uint32);
+xtensa_encode_result encode_sae4 (uint32 *);
+uint32 decode_offset (uint32);
+xtensa_encode_result encode_offset (uint32 *);
+uint32 decode_imm7hi (uint32);
+xtensa_encode_result encode_imm7hi (uint32 *);
+uint32 decode_uimm4x16 (uint32);
+xtensa_encode_result encode_uimm4x16 (uint32 *);
+uint32 decode_simm12b (uint32);
+xtensa_encode_result encode_simm12b (uint32 *);
+uint32 decode_lsi4x4 (uint32);
+xtensa_encode_result encode_lsi4x4 (uint32 *);
+uint32 decode_z (uint32);
+xtensa_encode_result encode_z (uint32 *);
+uint32 decode_simm12 (uint32);
+xtensa_encode_result encode_simm12 (uint32 *);
+uint32 decode_sr (uint32);
+xtensa_encode_result encode_sr (uint32 *);
+uint32 decode_nimm4x2 (uint32);
+xtensa_encode_result encode_nimm4x2 (uint32 *);
+
+
+static const uint32 b4constu_table[] = {
+  32768,
+  65536,
+  2,
+  3,
+  4,
+  5,
+  6,
+  7,
+  8,
+  10,
+  12,
+  16,
+  32,
+  64,
+  128,
+  256
+};
 
-static unsigned
-Field_st_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+decode_b4constu (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  val = b4constu_table[val];
+  return val;
 }
 
-static void
-Field_st_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_b4constu (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  uint32 val = *valp;
+  unsigned i;
+  for (i = 0; i < (1 << 4); i += 1)
+    if (b4constu_table[i] == val) goto found;
+  return xtensa_encode_result_not_in_table;
+ found:
+  val = i;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_st_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+decode_simm8x256 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28);
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  val = (val ^ 0x80) - 0x80;
+  val <<= 8;
+  return val;
 }
 
-static void
-Field_st_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_simm8x256 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
-  tie_t = (val << 24) >> 28;
-  insn[0] = (insn[0] & ~0xf0) | (tie_t << 4);
+  uint32 val = *valp;
+  if ((val & ((1 << 8) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 8;
+  if (((val + (1 << 7)) >> 8) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm4_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+decode_soffset (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28);
-  return tie_t;
+  val = (val ^ 0x20000) - 0x20000;
+  return val;
 }
 
-static void
-Field_imm4_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_soffset (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf00) | (tie_t << 8);
+  uint32 val = *valp;
+  if (((val + (1 << 17)) >> 18) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm4_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+decode_imm4 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_imm4_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_imm4 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm4_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+decode_op0 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_imm4_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_op0 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_mn_Slot_inst_get (const xtensa_insnbuf insn)
+uint32
+decode_op1 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 12) >> 30);
-  tie_t = (tie_t << 2) | ((insn[0] << 14) >> 30);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_mn_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_op1 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 30) >> 30;
-  insn[0] = (insn[0] & ~0x30000) | (tie_t << 16);
-  tie_t = (val << 28) >> 30;
-  insn[0] = (insn[0] & ~0xc0000) | (tie_t << 18);
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_i_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+decode_imm6 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 20) >> 31);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_i_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_imm6 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x800) | (tie_t << 11);
+  uint32 val = *valp;
+  if ((val >> 6) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm6lo_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+decode_op2 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_imm6lo_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_op2 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm6lo_Slot_inst16b_get (const xtensa_insnbuf insn)
+uint32
+decode_imm7 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  return val;
 }
 
-static void
-Field_imm6lo_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_imm7 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  uint32 val = *valp;
+  if ((val >> 7) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm6hi_Slot_inst16a_get (const xtensa_insnbuf insn)
+uint32
+decode_simm4 (uint32 val)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30);
-  return tie_t;
+  val = (val ^ 0x8) - 0x8;
+  return val;
 }
 
-static void
-Field_imm6hi_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+xtensa_encode_result
+encode_simm4 (uint32 *valp)
 {
-  uint32 tie_t;
-  tie_t = (val << 30) >> 30;
-  insn[0] = (insn[0] & ~0x300) | (tie_t << 8);
+  uint32 val = *valp;
+  if (((val + (1 << 3)) >> 4) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Field_imm6hi_Slot_inst16b_get (const xtensa_insnbuf insn)
-{
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30);
-  return tie_t;
-}
+static const uint32 ai4const_table[] = {
+  -1,
+  1,
+  2,
+  3,
+  4,
+  5,
+  6,
+  7,
+  8,
+  9,
+  10,
+  11,
+  12,
+  13,
+  14,
+  15
+};
 
-static void
-Field_imm6hi_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_ai4const (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 30) >> 30;
-  insn[0] = (insn[0] & ~0x300) | (tie_t << 8);
+  val = ai4const_table[val];
+  return val;
 }
 
-static unsigned
-Field_imm7lo_Slot_inst16a_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_ai4const (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  unsigned i;
+  for (i = 0; i < (1 << 4); i += 1)
+    if (ai4const_table[i] == val) goto found;
+  return xtensa_encode_result_not_in_table;
+ found:
+  val = i;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7lo_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_imm8 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  return val;
 }
 
-static unsigned
-Field_imm7lo_Slot_inst16b_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_imm8 (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val >> 8) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7lo_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_sae (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
+  return val;
 }
 
-static unsigned
-Field_imm7hi_Slot_inst16a_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_sae (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val >> 5) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7hi_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_imm7lo (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 29) >> 29;
-  insn[0] = (insn[0] & ~0x700) | (tie_t << 8);
+  return val;
 }
 
-static unsigned
-Field_imm7hi_Slot_inst16b_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_imm7lo (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7hi_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_simm7 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 29) >> 29;
-  insn[0] = (insn[0] & ~0x700) | (tie_t << 8);
+  if (val > 95)
+      val |= -32;
+  return val;
 }
 
-static unsigned
-Field_z_Slot_inst16a_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_simm7 (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 1) | ((insn[0] << 21) >> 31);
-  return tie_t;
+  uint32 val = *valp;
+  if ((signed int) val < -32)
+    return xtensa_encode_result_too_low;
+  if ((signed int) val > 95)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_z_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_simm8 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 31) >> 31;
-  insn[0] = (insn[0] & ~0x400) | (tie_t << 10);
+  val = (val ^ 0x80) - 0x80;
+  return val;
 }
 
-static unsigned
-Field_imm6_Slot_inst16a_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_simm8 (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  if (((val + (1 << 7)) >> 8) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm6_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_uimm12x8 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 26) >> 30;
-  insn[0] = (insn[0] & ~0x300) | (tie_t << 8);
+  val <<= 3;
+  return val;
 }
 
-static unsigned
-Field_imm6_Slot_inst16b_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_uimm12x8 (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val & ((1 << 3) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 3;
+  if ((val >> 12) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm6_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_sal (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 26) >> 30;
-  insn[0] = (insn[0] & ~0x300) | (tie_t << 8);
+  return val;
 }
 
-static unsigned
-Field_imm7_Slot_inst16a_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_sal (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val >> 5) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_uimm6 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 25) >> 29;
-  insn[0] = (insn[0] & ~0x700) | (tie_t << 8);
+  return val;
 }
 
-static unsigned
-Field_imm7_Slot_inst16b_get (const xtensa_insnbuf insn)
+xtensa_encode_result
+encode_uimm6 (uint32 *valp)
 {
-  unsigned tie_t = 0;
-  tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29);
-  tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28);
-  return tie_t;
+  uint32 val = *valp;
+  if ((val >> 6) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static void
-Field_imm7_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
+uint32
+decode_sas4 (uint32 val)
 {
-  uint32 tie_t;
-  tie_t = (val << 28) >> 28;
-  insn[0] = (insn[0] & ~0xf) | (tie_t << 0);
-  tie_t = (val << 25) >> 29;
-  insn[0] = (insn[0] & ~0x700) | (tie_t << 8);
+  return val;
 }
 
-static void
-Implicit_Field_set (xtensa_insnbuf insn ATTRIBUTE_UNUSED,
-                   uint32 val ATTRIBUTE_UNUSED)
+xtensa_encode_result
+encode_sas4 (uint32 *valp)
 {
-  /* Do nothing.  */
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Implicit_Field_ar0_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED)
+uint32
+decode_uimm8 (uint32 val)
 {
-  return 0;
+  return val;
 }
 
-static unsigned
-Implicit_Field_ar4_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED)
+xtensa_encode_result
+encode_uimm8 (uint32 *valp)
 {
-  return 4;
+  uint32 val = *valp;
+  if ((val >> 8) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static unsigned
-Implicit_Field_ar8_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED)
+uint32
+decode_uimm16x4 (uint32 val)
 {
-  return 8;
+  val |= -1 << 16;
+  val <<= 2;
+  return val;
 }
 
-static unsigned
-Implicit_Field_ar12_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED)
+xtensa_encode_result
+encode_uimm16x4 (uint32 *valp)
 {
-  return 12;
+  uint32 val = *valp;
+  if ((val & ((1 << 2) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 2;
+  if ((signed int) val >> 16 != -1)
+    {
+      if ((signed int) val >= 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-\f
-/* Functional units.  */
-
-static xtensa_funcUnit_internal funcUnits[] = {
-
-};
-
-\f
-/* Register files.  */
-
-static xtensa_regfile_internal regfiles[] = {
-  { "AR", "a", 0, 32, 64 }
-};
-
-\f
-/* Interfaces.  */
-
-static xtensa_interface_internal interfaces[] = {
-
-};
-
-\f
-/* Constant tables.  */
-
-/* constant table ai4c */
-static const unsigned CONST_TBL_ai4c_0[] = {
-  0xffffffff,
-  0x1,
-  0x2,
-  0x3,
-  0x4,
-  0x5,
-  0x6,
-  0x7,
-  0x8,
-  0x9,
-  0xa,
-  0xb,
-  0xc,
-  0xd,
-  0xe,
-  0xf,
-  0
-};
-
-/* constant table b4c */
-static const unsigned CONST_TBL_b4c_0[] = {
-  0xffffffff,
-  0x1,
-  0x2,
-  0x3,
-  0x4,
-  0x5,
-  0x6,
-  0x7,
-  0x8,
-  0xa,
-  0xc,
-  0x10,
-  0x20,
-  0x40,
-  0x80,
-  0x100,
-  0
-};
-
-/* constant table b4cu */
-static const unsigned CONST_TBL_b4cu_0[] = {
-  0x8000,
-  0x10000,
-  0x2,
-  0x3,
-  0x4,
-  0x5,
-  0x6,
-  0x7,
-  0x8,
-  0xa,
-  0xc,
-  0x10,
-  0x20,
-  0x40,
-  0x80,
-  0x100,
-  0
-};
-
-\f
-/* Instruction operands.  */
-
-static int
-Operand_soffsetx4_decode (uint32 *valp)
+uint32
+decode_sar (uint32 val)
 {
-  unsigned soffsetx4_0, offset_0;
-  offset_0 = *valp & 0x3ffff;
-  soffsetx4_0 = 0x4 + ((((int) offset_0 << 14) >> 14) << 2);
-  *valp = soffsetx4_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_soffsetx4_encode (uint32 *valp)
+xtensa_encode_result
+encode_sar (uint32 *valp)
 {
-  unsigned offset_0, soffsetx4_0;
-  soffsetx4_0 = *valp;
-  offset_0 = ((soffsetx4_0 - 0x4) >> 2) & 0x3ffff;
-  *valp = offset_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 5) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_soffsetx4_ator (uint32 *valp, uint32 pc)
+uint32
+decode_sa4 (uint32 val)
 {
-  *valp -= (pc & ~0x3);
-  return 0;
+  return val;
 }
 
-static int
-Operand_soffsetx4_rtoa (uint32 *valp, uint32 pc)
+xtensa_encode_result
+encode_sa4 (uint32 *valp)
 {
-  *valp += (pc & ~0x3);
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm12x8_decode (uint32 *valp)
+uint32
+decode_sas (uint32 val)
 {
-  unsigned uimm12x8_0, imm12_0;
-  imm12_0 = *valp & 0xfff;
-  uimm12x8_0 = imm12_0 << 3;
-  *valp = uimm12x8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm12x8_encode (uint32 *valp)
+xtensa_encode_result
+encode_sas (uint32 *valp)
 {
-  unsigned imm12_0, uimm12x8_0;
-  uimm12x8_0 = *valp;
-  imm12_0 = ((uimm12x8_0 >> 3) & 0xfff);
-  *valp = imm12_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 5) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_simm4_decode (uint32 *valp)
+uint32
+decode_imm6hi (uint32 val)
 {
-  unsigned simm4_0, mn_0;
-  mn_0 = *valp & 0xf;
-  simm4_0 = ((int) mn_0 << 28) >> 28;
-  *valp = simm4_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_simm4_encode (uint32 *valp)
+xtensa_encode_result
+encode_imm6hi (uint32 *valp)
 {
-  unsigned mn_0, simm4_0;
-  simm4_0 = *valp;
-  mn_0 = (simm4_0 & 0xf);
-  *valp = mn_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 2) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED)
+uint32
+decode_bbi (uint32 val)
 {
-  return 0;
+  return val;
 }
 
-static int
-Operand_arr_encode (uint32 *valp)
+xtensa_encode_result
+encode_bbi (uint32 *valp)
 {
-  int error;
-  error = (*valp & ~0xf) != 0;
-  return error;
+  uint32 val = *valp;
+  if ((val >> 5) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED)
+uint32
+decode_uimm8x2 (uint32 val)
 {
-  return 0;
+  val <<= 1;
+  return val;
 }
 
-static int
-Operand_ars_encode (uint32 *valp)
+xtensa_encode_result
+encode_uimm8x2 (uint32 *valp)
 {
-  int error;
-  error = (*valp & ~0xf) != 0;
-  return error;
+  uint32 val = *valp;
+  if ((val & ((1 << 1) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 1;
+  if ((val >> 8) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED)
+uint32
+decode_uimm8x4 (uint32 val)
 {
-  return 0;
+  val <<= 2;
+  return val;
 }
 
-static int
-Operand_art_encode (uint32 *valp)
+xtensa_encode_result
+encode_uimm8x4 (uint32 *valp)
 {
-  int error;
-  error = (*valp & ~0xf) != 0;
-  return error;
+  uint32 val = *valp;
+  if ((val & ((1 << 2) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 2;
+  if ((val >> 8) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED)
-{
-  return 0;
-}
+static const uint32 mip32const_table[] = {
+  32,
+  31,
+  30,
+  29,
+  28,
+  27,
+  26,
+  25,
+  24,
+  23,
+  22,
+  21,
+  20,
+  19,
+  18,
+  17,
+  16,
+  15,
+  14,
+  13,
+  12,
+  11,
+  10,
+  9,
+  8,
+  7,
+  6,
+  5,
+  4,
+  3,
+  2,
+  1
+};
 
-static int
-Operand_ar0_encode (uint32 *valp)
+uint32
+decode_msalp32 (uint32 val)
 {
-  int error;
-  error = (*valp & ~0x3f) != 0;
-  return error;
+  val = mip32const_table[val];
+  return val;
 }
 
-static int
-Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED)
+xtensa_encode_result
+encode_msalp32 (uint32 *valp)
 {
-  return 0;
+  uint32 val = *valp;
+  unsigned i;
+  for (i = 0; i < (1 << 5); i += 1)
+    if (mip32const_table[i] == val) goto found;
+  return xtensa_encode_result_not_in_table;
+ found:
+  val = i;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ar4_encode (uint32 *valp)
+uint32
+decode_bbi4 (uint32 val)
 {
-  int error;
-  error = (*valp & ~0x3f) != 0;
-  return error;
+  return val;
 }
 
-static int
-Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED)
+xtensa_encode_result
+encode_bbi4 (uint32 *valp)
 {
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ar8_encode (uint32 *valp)
-{
-  int error;
-  error = (*valp & ~0x3f) != 0;
-  return error;
+static const uint32 i4p1const_table[] = {
+  1,
+  2,
+  3,
+  4,
+  5,
+  6,
+  7,
+  8,
+  9,
+  10,
+  11,
+  12,
+  13,
+  14,
+  15,
+  16
+};
+
+uint32
+decode_op2p1 (uint32 val)
+{
+  val = i4p1const_table[val];
+  return val;
+}
+
+xtensa_encode_result
+encode_op2p1 (uint32 *valp)
+{
+  uint32 val = *valp;
+  unsigned i;
+  for (i = 0; i < (1 << 4); i += 1)
+    if (i4p1const_table[i] == val) goto found;
+  return xtensa_encode_result_not_in_table;
+ found:
+  val = i;
+  *valp = val;
+  return xtensa_encode_result_ok;
+}
+
+uint32
+decode_soffsetx4 (uint32 val)
+{
+  val = (val ^ 0x20000) - 0x20000;
+  val <<= 2;
+  return val;
+}
+
+xtensa_encode_result
+encode_soffsetx4 (uint32 *valp)
+{
+  uint32 val = *valp;
+  if ((val & ((1 << 2) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 2;
+  if (((val + (1 << 17)) >> 18) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED)
+uint32
+decode_imm6lo (uint32 val)
 {
-  return 0;
+  return val;
 }
 
-static int
-Operand_ar12_encode (uint32 *valp)
+xtensa_encode_result
+encode_imm6lo (uint32 *valp)
 {
-  int error;
-  error = (*valp & ~0x3f) != 0;
-  return error;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED)
+uint32
+decode_imm12 (uint32 val)
 {
-  return 0;
+  return val;
 }
 
-static int
-Operand_ars_entry_encode (uint32 *valp)
+xtensa_encode_result
+encode_imm12 (uint32 *valp)
 {
-  int error;
-  error = (*valp & ~0x3f) != 0;
-  return error;
+  uint32 val = *valp;
+  if ((val >> 12) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_immrx4_decode (uint32 *valp)
-{
-  unsigned immrx4_0, r_0;
-  r_0 = *valp & 0xf;
-  immrx4_0 = ((((0xfffffff)) << 4) | r_0) << 2;
-  *valp = immrx4_0;
-  return 0;
-}
+static const uint32 b4const_table[] = {
+  -1,
+  1,
+  2,
+  3,
+  4,
+  5,
+  6,
+  7,
+  8,
+  10,
+  12,
+  16,
+  32,
+  64,
+  128,
+  256
+};
 
-static int
-Operand_immrx4_encode (uint32 *valp)
+uint32
+decode_b4const (uint32 val)
 {
-  unsigned r_0, immrx4_0;
-  immrx4_0 = *valp;
-  r_0 = ((immrx4_0 >> 2) & 0xf);
-  *valp = r_0;
-  return 0;
+  val = b4const_table[val];
+  return val;
 }
 
-static int
-Operand_lsi4x4_decode (uint32 *valp)
+xtensa_encode_result
+encode_b4const (uint32 *valp)
 {
-  unsigned lsi4x4_0, r_0;
-  r_0 = *valp & 0xf;
-  lsi4x4_0 = r_0 << 2;
-  *valp = lsi4x4_0;
-  return 0;
+  uint32 val = *valp;
+  unsigned i;
+  for (i = 0; i < (1 << 4); i += 1)
+    if (b4const_table[i] == val) goto found;
+  return xtensa_encode_result_not_in_table;
+ found:
+  val = i;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_lsi4x4_encode (uint32 *valp)
+uint32
+decode_i (uint32 val)
 {
-  unsigned r_0, lsi4x4_0;
-  lsi4x4_0 = *valp;
-  r_0 = ((lsi4x4_0 >> 2) & 0xf);
-  *valp = r_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_simm7_decode (uint32 *valp)
+xtensa_encode_result
+encode_i (uint32 *valp)
 {
-  unsigned simm7_0, imm7_0;
-  imm7_0 = *valp & 0x7f;
-  simm7_0 = ((((-((((imm7_0 >> 6) & 1)) & (((imm7_0 >> 5) & 1)))) & 0x1ffffff)) << 7) | imm7_0;
-  *valp = simm7_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_simm7_encode (uint32 *valp)
+uint32
+decode_imm16 (uint32 val)
 {
-  unsigned imm7_0, simm7_0;
-  simm7_0 = *valp;
-  imm7_0 = (simm7_0 & 0x7f);
-  *valp = imm7_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm6_decode (uint32 *valp)
+xtensa_encode_result
+encode_imm16 (uint32 *valp)
 {
-  unsigned uimm6_0, imm6_0;
-  imm6_0 = *valp & 0x3f;
-  uimm6_0 = 0x4 + ((((0)) << 6) | imm6_0);
-  *valp = uimm6_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 16) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm6_encode (uint32 *valp)
+uint32
+decode_mn (uint32 val)
 {
-  unsigned imm6_0, uimm6_0;
-  uimm6_0 = *valp;
-  imm6_0 = (uimm6_0 - 0x4) & 0x3f;
-  *valp = imm6_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm6_ator (uint32 *valp, uint32 pc)
+xtensa_encode_result
+encode_mn (uint32 *valp)
 {
-  *valp -= pc;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm6_rtoa (uint32 *valp, uint32 pc)
+uint32
+decode_m (uint32 val)
 {
-  *valp += pc;
-  return 0;
+  return val;
 }
 
-static int
-Operand_ai4const_decode (uint32 *valp)
+xtensa_encode_result
+encode_m (uint32 *valp)
 {
-  unsigned ai4const_0, t_0;
-  t_0 = *valp & 0xf;
-  ai4const_0 = CONST_TBL_ai4c_0[t_0 & 0xf];
-  *valp = ai4const_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 2) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ai4const_encode (uint32 *valp)
+uint32
+decode_n (uint32 val)
 {
-  unsigned t_0, ai4const_0;
-  ai4const_0 = *valp;
-  switch (ai4const_0)
-    {
-    case 0xffffffff: t_0 = 0; break;
-    case 0x1: t_0 = 0x1; break;
-    case 0x2: t_0 = 0x2; break;
-    case 0x3: t_0 = 0x3; break;
-    case 0x4: t_0 = 0x4; break;
-    case 0x5: t_0 = 0x5; break;
-    case 0x6: t_0 = 0x6; break;
-    case 0x7: t_0 = 0x7; break;
-    case 0x8: t_0 = 0x8; break;
-    case 0x9: t_0 = 0x9; break;
-    case 0xa: t_0 = 0xa; break;
-    case 0xb: t_0 = 0xb; break;
-    case 0xc: t_0 = 0xc; break;
-    case 0xd: t_0 = 0xd; break;
-    case 0xe: t_0 = 0xe; break;
-    default: t_0 = 0xf; break;
-    }
-  *valp = t_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_b4const_decode (uint32 *valp)
+xtensa_encode_result
+encode_n (uint32 *valp)
 {
-  unsigned b4const_0, r_0;
-  r_0 = *valp & 0xf;
-  b4const_0 = CONST_TBL_b4c_0[r_0 & 0xf];
-  *valp = b4const_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 2) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_b4const_encode (uint32 *valp)
+uint32
+decode_none (uint32 val)
 {
-  unsigned r_0, b4const_0;
-  b4const_0 = *valp;
-  switch (b4const_0)
-    {
-    case 0xffffffff: r_0 = 0; break;
-    case 0x1: r_0 = 0x1; break;
-    case 0x2: r_0 = 0x2; break;
-    case 0x3: r_0 = 0x3; break;
-    case 0x4: r_0 = 0x4; break;
-    case 0x5: r_0 = 0x5; break;
-    case 0x6: r_0 = 0x6; break;
-    case 0x7: r_0 = 0x7; break;
-    case 0x8: r_0 = 0x8; break;
-    case 0xa: r_0 = 0x9; break;
-    case 0xc: r_0 = 0xa; break;
-    case 0x10: r_0 = 0xb; break;
-    case 0x20: r_0 = 0xc; break;
-    case 0x40: r_0 = 0xd; break;
-    case 0x80: r_0 = 0xe; break;
-    default: r_0 = 0xf; break;
-    }
-  *valp = r_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_b4constu_decode (uint32 *valp)
+xtensa_encode_result
+encode_none (uint32 *valp)
 {
-  unsigned b4constu_0, r_0;
-  r_0 = *valp & 0xf;
-  b4constu_0 = CONST_TBL_b4cu_0[r_0 & 0xf];
-  *valp = b4constu_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 0) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_b4constu_encode (uint32 *valp)
+uint32
+decode_imm12b (uint32 val)
 {
-  unsigned r_0, b4constu_0;
-  b4constu_0 = *valp;
-  switch (b4constu_0)
-    {
-    case 0x8000: r_0 = 0; break;
-    case 0x10000: r_0 = 0x1; break;
-    case 0x2: r_0 = 0x2; break;
-    case 0x3: r_0 = 0x3; break;
-    case 0x4: r_0 = 0x4; break;
-    case 0x5: r_0 = 0x5; break;
-    case 0x6: r_0 = 0x6; break;
-    case 0x7: r_0 = 0x7; break;
-    case 0x8: r_0 = 0x8; break;
-    case 0xa: r_0 = 0x9; break;
-    case 0xc: r_0 = 0xa; break;
-    case 0x10: r_0 = 0xb; break;
-    case 0x20: r_0 = 0xc; break;
-    case 0x40: r_0 = 0xd; break;
-    case 0x80: r_0 = 0xe; break;
-    default: r_0 = 0xf; break;
-    }
-  *valp = r_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm8_decode (uint32 *valp)
+xtensa_encode_result
+encode_imm12b (uint32 *valp)
 {
-  unsigned uimm8_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  uimm8_0 = imm8_0;
-  *valp = uimm8_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 12) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm8_encode (uint32 *valp)
+uint32
+decode_r (uint32 val)
 {
-  unsigned imm8_0, uimm8_0;
-  uimm8_0 = *valp;
-  imm8_0 = (uimm8_0 & 0xff);
-  *valp = imm8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm8x2_decode (uint32 *valp)
+xtensa_encode_result
+encode_r (uint32 *valp)
 {
-  unsigned uimm8x2_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  uimm8x2_0 = imm8_0 << 1;
-  *valp = uimm8x2_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm8x2_encode (uint32 *valp)
+uint32
+decode_s (uint32 val)
 {
-  unsigned imm8_0, uimm8x2_0;
-  uimm8x2_0 = *valp;
-  imm8_0 = ((uimm8x2_0 >> 1) & 0xff);
-  *valp = imm8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm8x4_decode (uint32 *valp)
+xtensa_encode_result
+encode_s (uint32 *valp)
 {
-  unsigned uimm8x4_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  uimm8x4_0 = imm8_0 << 2;
-  *valp = uimm8x4_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm8x4_encode (uint32 *valp)
+uint32
+decode_t (uint32 val)
 {
-  unsigned imm8_0, uimm8x4_0;
-  uimm8x4_0 = *valp;
-  imm8_0 = ((uimm8x4_0 >> 2) & 0xff);
-  *valp = imm8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_uimm4x16_decode (uint32 *valp)
+xtensa_encode_result
+encode_t (uint32 *valp)
 {
-  unsigned uimm4x16_0, op2_0;
-  op2_0 = *valp & 0xf;
-  uimm4x16_0 = op2_0 << 4;
-  *valp = uimm4x16_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_uimm4x16_encode (uint32 *valp)
+uint32
+decode_thi3 (uint32 val)
 {
-  unsigned op2_0, uimm4x16_0;
-  uimm4x16_0 = *valp;
-  op2_0 = ((uimm4x16_0 >> 4) & 0xf);
-  *valp = op2_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_simm8_decode (uint32 *valp)
+xtensa_encode_result
+encode_thi3 (uint32 *valp)
 {
-  unsigned simm8_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  simm8_0 = ((int) imm8_0 << 24) >> 24;
-  *valp = simm8_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 3) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_simm8_encode (uint32 *valp)
+uint32
+decode_sae4 (uint32 val)
 {
-  unsigned imm8_0, simm8_0;
-  simm8_0 = *valp;
-  imm8_0 = (simm8_0 & 0xff);
-  *valp = imm8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_simm8x256_decode (uint32 *valp)
+xtensa_encode_result
+encode_sae4 (uint32 *valp)
 {
-  unsigned simm8x256_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  simm8x256_0 = (((int) imm8_0 << 24) >> 24) << 8;
-  *valp = simm8x256_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_simm8x256_encode (uint32 *valp)
+uint32
+decode_offset (uint32 val)
 {
-  unsigned imm8_0, simm8x256_0;
-  simm8x256_0 = *valp;
-  imm8_0 = ((simm8x256_0 >> 8) & 0xff);
-  *valp = imm8_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_simm12b_decode (uint32 *valp)
+xtensa_encode_result
+encode_offset (uint32 *valp)
 {
-  unsigned simm12b_0, imm12b_0;
-  imm12b_0 = *valp & 0xfff;
-  simm12b_0 = ((int) imm12b_0 << 20) >> 20;
-  *valp = simm12b_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 18) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_simm12b_encode (uint32 *valp)
+uint32
+decode_imm7hi (uint32 val)
 {
-  unsigned imm12b_0, simm12b_0;
-  simm12b_0 = *valp;
-  imm12b_0 = (simm12b_0 & 0xfff);
-  *valp = imm12b_0;
-  return 0;
+  return val;
 }
 
-static int
-Operand_msalp32_decode (uint32 *valp)
+xtensa_encode_result
+encode_imm7hi (uint32 *valp)
 {
-  unsigned msalp32_0, sal_0;
-  sal_0 = *valp & 0x1f;
-  msalp32_0 = 0x20 - sal_0;
-  *valp = msalp32_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 3) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_msalp32_encode (uint32 *valp)
+uint32
+decode_uimm4x16 (uint32 val)
 {
-  unsigned sal_0, msalp32_0;
-  msalp32_0 = *valp;
-  sal_0 = (0x20 - msalp32_0) & 0x1f;
-  *valp = sal_0;
-  return 0;
+  val <<= 4;
+  return val;
 }
 
-static int
-Operand_op2p1_decode (uint32 *valp)
+xtensa_encode_result
+encode_uimm4x16 (uint32 *valp)
 {
-  unsigned op2p1_0, op2_0;
-  op2_0 = *valp & 0xf;
-  op2p1_0 = op2_0 + 0x1;
-  *valp = op2p1_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val & ((1 << 4) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 4;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_op2p1_encode (uint32 *valp)
+uint32
+decode_simm12b (uint32 val)
 {
-  unsigned op2_0, op2p1_0;
-  op2p1_0 = *valp;
-  op2_0 = (op2p1_0 - 0x1) & 0xf;
-  *valp = op2_0;
-  return 0;
+  val = (val ^ 0x800) - 0x800;
+  return val;
 }
 
-static int
-Operand_label8_decode (uint32 *valp)
+xtensa_encode_result
+encode_simm12b (uint32 *valp)
 {
-  unsigned label8_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  label8_0 = 0x4 + (((int) imm8_0 << 24) >> 24);
-  *valp = label8_0;
-  return 0;
+  uint32 val = *valp;
+  if (((val + (1 << 11)) >> 12) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_label8_encode (uint32 *valp)
+uint32
+decode_lsi4x4 (uint32 val)
 {
-  unsigned imm8_0, label8_0;
-  label8_0 = *valp;
-  imm8_0 = (label8_0 - 0x4) & 0xff;
-  *valp = imm8_0;
-  return 0;
+  val <<= 2;
+  return val;
 }
 
-static int
-Operand_label8_ator (uint32 *valp, uint32 pc)
+xtensa_encode_result
+encode_lsi4x4 (uint32 *valp)
 {
-  *valp -= pc;
-  return 0;
+  uint32 val = *valp;
+  if ((val & ((1 << 2) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 2;
+  if ((val >> 4) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_label8_rtoa (uint32 *valp, uint32 pc)
+uint32
+decode_z (uint32 val)
 {
-  *valp += pc;
-  return 0;
+  return val;
 }
 
-static int
-Operand_ulabel8_decode (uint32 *valp)
+xtensa_encode_result
+encode_z (uint32 *valp)
 {
-  unsigned ulabel8_0, imm8_0;
-  imm8_0 = *valp & 0xff;
-  ulabel8_0 = 0x4 + ((((0)) << 8) | imm8_0);
-  *valp = ulabel8_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 1) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ulabel8_encode (uint32 *valp)
+uint32
+decode_simm12 (uint32 val)
 {
-  unsigned imm8_0, ulabel8_0;
-  ulabel8_0 = *valp;
-  imm8_0 = (ulabel8_0 - 0x4) & 0xff;
-  *valp = imm8_0;
-  return 0;
+  val = (val ^ 0x800) - 0x800;
+  return val;
 }
 
-static int
-Operand_ulabel8_ator (uint32 *valp, uint32 pc)
+xtensa_encode_result
+encode_simm12 (uint32 *valp)
 {
-  *valp -= pc;
-  return 0;
+  uint32 val = *valp;
+  if (((val + (1 << 11)) >> 12) != 0)
+    {
+      if ((signed int) val > 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_ulabel8_rtoa (uint32 *valp, uint32 pc)
+uint32
+decode_sr (uint32 val)
 {
-  *valp += pc;
-  return 0;
+  return val;
 }
 
-static int
-Operand_label12_decode (uint32 *valp)
+xtensa_encode_result
+encode_sr (uint32 *valp)
 {
-  unsigned label12_0, imm12_0;
-  imm12_0 = *valp & 0xfff;
-  label12_0 = 0x4 + (((int) imm12_0 << 20) >> 20);
-  *valp = label12_0;
-  return 0;
+  uint32 val = *valp;
+  if ((val >> 8) != 0)
+    return xtensa_encode_result_too_high;
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_label12_encode (uint32 *valp)
+uint32
+decode_nimm4x2 (uint32 val)
 {
-  unsigned imm12_0, label12_0;
-  label12_0 = *valp;
-  imm12_0 = (label12_0 - 0x4) & 0xfff;
-  *valp = imm12_0;
-  return 0;
+  val |= -1 << 4;
+  val <<= 2;
+  return val;
 }
 
-static int
-Operand_label12_ator (uint32 *valp, uint32 pc)
+xtensa_encode_result
+encode_nimm4x2 (uint32 *valp)
 {
-  *valp -= pc;
-  return 0;
+  uint32 val = *valp;
+  if ((val & ((1 << 2) - 1)) != 0)
+    return xtensa_encode_result_align;
+  val = (signed int) val >> 2;
+  if ((signed int) val >> 4 != -1)
+    {
+      if ((signed int) val >= 0)
+        return xtensa_encode_result_too_high;
+      else
+        return xtensa_encode_result_too_low;
+    }
+  *valp = val;
+  return xtensa_encode_result_ok;
 }
 
-static int
-Operand_label12_rtoa (uint32 *valp, uint32 pc)
-{
-  *valp += pc;
-  return 0;
-}
 
-static int
-Operand_soffset_decode (uint32 *valp)
-{
-  unsigned soffset_0, offset_0;
-  offset_0 = *valp & 0x3ffff;
-  soffset_0 = 0x4 + (((int) offset_0 << 14) >> 14);
-  *valp = soffset_0;
-  return 0;
-}
 
-static int
-Operand_soffset_encode (uint32 *valp)
+uint32 do_reloc_l (uint32, uint32);
+uint32 undo_reloc_l (uint32, uint32);
+uint32 do_reloc_L (uint32, uint32);
+uint32 undo_reloc_L (uint32, uint32);
+uint32 do_reloc_r (uint32, uint32);
+uint32 undo_reloc_r (uint32, uint32);
+
+
+uint32
+do_reloc_l (uint32 addr, uint32 pc)
 {
-  unsigned offset_0, soffset_0;
-  soffset_0 = *valp;
-  offset_0 = (soffset_0 - 0x4) & 0x3ffff;
-  *valp = offset_0;
-  return 0;
+  return addr - pc - 4;
 }
 
-static int
-Operand_soffset_ator (uint32 *valp, uint32 pc)
+uint32
+undo_reloc_l (uint32 offset, uint32 pc)
 {
-  *valp -= pc;
-  return 0;
+  return pc + offset + 4;
 }
 
-static int
-Operand_soffset_rtoa (uint32 *valp, uint32 pc)
+uint32
+do_reloc_L (uint32 addr, uint32 pc)
 {
-  *valp += pc;
-  return 0;
+  return addr - (pc & -4) - 4;
 }
 
-static int
-Operand_uimm16x4_decode (uint32 *valp)
+uint32
+undo_reloc_L (uint32 offset, uint32 pc)
 {
-  unsigned uimm16x4_0, imm16_0;
-  imm16_0 = *valp & 0xffff;
-  uimm16x4_0 = ((((0xffff)) << 16) | imm16_0) << 2;
-  *valp = uimm16x4_0;
-  return 0;
+  return (pc & -4) + offset + 4;
 }
 
-static int
-Operand_uimm16x4_encode (uint32 *valp)
+uint32
+do_reloc_r (uint32 addr, uint32 pc)
 {
-  unsigned imm16_0, uimm16x4_0;
-  uimm16x4_0 = *valp;
-  imm16_0 = (uimm16x4_0 >> 2) & 0xffff;
-  *valp = imm16_0;
-  return 0;
+  return addr - ((pc+3) & -4);
 }
 
-static int
-Operand_uimm16x4_ator (uint32 *valp, uint32 pc)
+uint32
+undo_reloc_r (uint32 offset, uint32 pc)
 {
-  *valp -= ((pc + 3) & ~0x3);
-  return 0;
+  return ((pc+3) & -4) + offset;
 }
 
-static int
-Operand_uimm16x4_rtoa (uint32 *valp, uint32 pc)
-{
-  *valp += ((pc + 3) & ~0x3);
-  return 0;
-}
-
-static int
-Operand_immt_decode (uint32 *valp)
-{
-  unsigned immt_0, t_0;
-  t_0 = *valp & 0xf;
-  immt_0 = t_0;
-  *valp = immt_0;
-  return 0;
-}
-
-static int
-Operand_immt_encode (uint32 *valp)
-{
-  unsigned t_0, immt_0;
-  immt_0 = *valp;
-  t_0 = immt_0 & 0xf;
-  *valp = t_0;
-  return 0;
-}
-
-static int
-Operand_imms_decode (uint32 *valp)
-{
-  unsigned imms_0, s_0;
-  s_0 = *valp & 0xf;
-  imms_0 = s_0;
-  *valp = imms_0;
-  return 0;
-}
-
-static int
-Operand_imms_encode (uint32 *valp)
-{
-  unsigned s_0, imms_0;
-  imms_0 = *valp;
-  s_0 = imms_0 & 0xf;
-  *valp = s_0;
-  return 0;
-}
-
-static xtensa_operand_internal operands[] = {
-  { "soffsetx4", 10, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_soffsetx4_encode, Operand_soffsetx4_decode,
-    Operand_soffsetx4_ator, Operand_soffsetx4_rtoa },
-  { "uimm12x8", 3, -1, 0,
-    0,
-    Operand_uimm12x8_encode, Operand_uimm12x8_decode,
-    0, 0 },
-  { "simm4", 26, -1, 0,
-    0,
-    Operand_simm4_encode, Operand_simm4_decode,
-    0, 0 },
-  { "arr", 14, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER,
-    Operand_arr_encode, Operand_arr_decode,
-    0, 0 },
-  { "ars", 5, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER,
-    Operand_ars_encode, Operand_ars_decode,
-    0, 0 },
-  { "*ars_invisible", 5, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
-    Operand_ars_encode, Operand_ars_decode,
-    0, 0 },
-  { "art", 0, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER,
-    Operand_art_encode, Operand_art_decode,
-    0, 0 },
-  { "ar0", 35, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
-    Operand_ar0_encode, Operand_ar0_decode,
-    0, 0 },
-  { "ar4", 36, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
-    Operand_ar4_encode, Operand_ar4_decode,
-    0, 0 },
-  { "ar8", 37, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
-    Operand_ar8_encode, Operand_ar8_decode,
-    0, 0 },
-  { "ar12", 38, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
-    Operand_ar12_encode, Operand_ar12_decode,
-    0, 0 },
-  { "ars_entry", 5, 0, 1,
-    XTENSA_OPERAND_IS_REGISTER,
-    Operand_ars_entry_encode, Operand_ars_entry_decode,
-    0, 0 },
-  { "immrx4", 14, -1, 0,
-    0,
-    Operand_immrx4_encode, Operand_immrx4_decode,
-    0, 0 },
-  { "lsi4x4", 14, -1, 0,
-    0,
-    Operand_lsi4x4_encode, Operand_lsi4x4_decode,
-    0, 0 },
-  { "simm7", 34, -1, 0,
-    0,
-    Operand_simm7_encode, Operand_simm7_decode,
-    0, 0 },
-  { "uimm6", 33, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_uimm6_encode, Operand_uimm6_decode,
-    Operand_uimm6_ator, Operand_uimm6_rtoa },
-  { "ai4const", 0, -1, 0,
-    0,
-    Operand_ai4const_encode, Operand_ai4const_decode,
-    0, 0 },
-  { "b4const", 14, -1, 0,
-    0,
-    Operand_b4const_encode, Operand_b4const_decode,
-    0, 0 },
-  { "b4constu", 14, -1, 0,
-    0,
-    Operand_b4constu_encode, Operand_b4constu_decode,
-    0, 0 },
-  { "uimm8", 4, -1, 0,
-    0,
-    Operand_uimm8_encode, Operand_uimm8_decode,
-    0, 0 },
-  { "uimm8x2", 4, -1, 0,
-    0,
-    Operand_uimm8x2_encode, Operand_uimm8x2_decode,
-    0, 0 },
-  { "uimm8x4", 4, -1, 0,
-    0,
-    Operand_uimm8x4_encode, Operand_uimm8x4_decode,
-    0, 0 },
-  { "uimm4x16", 13, -1, 0,
-    0,
-    Operand_uimm4x16_encode, Operand_uimm4x16_decode,
-    0, 0 },
-  { "simm8", 4, -1, 0,
-    0,
-    Operand_simm8_encode, Operand_simm8_decode,
-    0, 0 },
-  { "simm8x256", 4, -1, 0,
-    0,
-    Operand_simm8x256_encode, Operand_simm8x256_decode,
-    0, 0 },
-  { "simm12b", 6, -1, 0,
-    0,
-    Operand_simm12b_encode, Operand_simm12b_decode,
-    0, 0 },
-  { "msalp32", 18, -1, 0,
-    0,
-    Operand_msalp32_encode, Operand_msalp32_decode,
-    0, 0 },
-  { "op2p1", 13, -1, 0,
-    0,
-    Operand_op2p1_encode, Operand_op2p1_decode,
-    0, 0 },
-  { "label8", 4, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_label8_encode, Operand_label8_decode,
-    Operand_label8_ator, Operand_label8_rtoa },
-  { "ulabel8", 4, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_ulabel8_encode, Operand_ulabel8_decode,
-    Operand_ulabel8_ator, Operand_ulabel8_rtoa },
-  { "label12", 3, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_label12_encode, Operand_label12_decode,
-    Operand_label12_ator, Operand_label12_rtoa },
-  { "soffset", 10, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_soffset_encode, Operand_soffset_decode,
-    Operand_soffset_ator, Operand_soffset_rtoa },
-  { "uimm16x4", 7, -1, 0,
-    XTENSA_OPERAND_IS_PCRELATIVE,
-    Operand_uimm16x4_encode, Operand_uimm16x4_decode,
-    Operand_uimm16x4_ator, Operand_uimm16x4_rtoa },
-  { "immt", 0, -1, 0,
-    0,
-    Operand_immt_encode, Operand_immt_decode,
-    0, 0 },
-  { "imms", 5, -1, 0,
-    0,
-    Operand_imms_encode, Operand_imms_decode,
-    0, 0 },
-  { "t", 0, -1, 0, 0, 0, 0, 0, 0 },
-  { "bbi4", 1, -1, 0, 0, 0, 0, 0, 0 },
-  { "bbi", 2, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm12", 3, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm8", 4, -1, 0, 0, 0, 0, 0, 0 },
-  { "s", 5, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm12b", 6, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm16", 7, -1, 0, 0, 0, 0, 0, 0 },
-  { "m", 8, -1, 0, 0, 0, 0, 0, 0 },
-  { "n", 9, -1, 0, 0, 0, 0, 0, 0 },
-  { "offset", 10, -1, 0, 0, 0, 0, 0, 0 },
-  { "op0", 11, -1, 0, 0, 0, 0, 0, 0 },
-  { "op1", 12, -1, 0, 0, 0, 0, 0, 0 },
-  { "op2", 13, -1, 0, 0, 0, 0, 0, 0 },
-  { "r", 14, -1, 0, 0, 0, 0, 0, 0 },
-  { "sa4", 15, -1, 0, 0, 0, 0, 0, 0 },
-  { "sae4", 16, -1, 0, 0, 0, 0, 0, 0 },
-  { "sae", 17, -1, 0, 0, 0, 0, 0, 0 },
-  { "sal", 18, -1, 0, 0, 0, 0, 0, 0 },
-  { "sargt", 19, -1, 0, 0, 0, 0, 0, 0 },
-  { "sas4", 20, -1, 0, 0, 0, 0, 0, 0 },
-  { "sas", 21, -1, 0, 0, 0, 0, 0, 0 },
-  { "sr", 22, -1, 0, 0, 0, 0, 0, 0 },
-  { "st", 23, -1, 0, 0, 0, 0, 0, 0 },
-  { "thi3", 24, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm4", 25, -1, 0, 0, 0, 0, 0, 0 },
-  { "mn", 26, -1, 0, 0, 0, 0, 0, 0 },
-  { "i", 27, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm6lo", 28, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm6hi", 29, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm7lo", 30, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm7hi", 31, -1, 0, 0, 0, 0, 0, 0 },
-  { "z", 32, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm6", 33, -1, 0, 0, 0, 0, 0, 0 },
-  { "imm7", 34, -1, 0, 0, 0, 0, 0, 0 }
-};
-
-\f
-/* Iclass table.  */
-
-static xtensa_arg_internal Iclass_xt_iclass_rfe_stateArgs[] = {
-  { { STATE_PSEXCM }, 'o' },
-  { { STATE_EPC1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rfde_stateArgs[] = {
-  { { STATE_DEPC }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_call12_args[] = {
-  { { 0 /* soffsetx4 */ }, 'i' },
-  { { 10 /* ar12 */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_call12_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_call8_args[] = {
-  { { 0 /* soffsetx4 */ }, 'i' },
-  { { 9 /* ar8 */ }, 'o' }
+static xtensa_operand_internal iib4const_operand = {
+  "i",
+  '<',
+  0,
+  get_r_field,
+  set_r_field,
+  encode_b4const,
+  decode_b4const,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_call8_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
+static xtensa_operand_internal iiuimm8_operand = {
+  "i",
+  '<',
+  0,
+  get_imm8_field,
+  set_imm8_field,
+  encode_uimm8,
+  decode_uimm8,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_call4_args[] = {
-  { { 0 /* soffsetx4 */ }, 'i' },
-  { { 8 /* ar4 */ }, 'o' }
+static xtensa_operand_internal lisoffsetx4_operand = {
+  "L",
+  '<',
+  1,
+  get_offset_field,
+  set_offset_field,
+  encode_soffsetx4,
+  decode_soffsetx4,
+  do_reloc_L,
+  undo_reloc_L,
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_call4_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
+static xtensa_operand_internal iisimm8x256_operand = {
+  "i",
+  '<',
+  0,
+  get_imm8_field,
+  set_imm8_field,
+  encode_simm8x256,
+  decode_simm8x256,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx12_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 10 /* ar12 */ }, 'o' }
+static xtensa_operand_internal lisimm12_operand = {
+  "l",
+  '<',
+  1,
+  get_imm12_field,
+  set_imm12_field,
+  encode_simm12,
+  decode_simm12,
+  do_reloc_l,
+  undo_reloc_l,
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx12_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
+static xtensa_operand_internal iiop2p1_operand = {
+  "i",
+  '<',
+  0,
+  get_op2_field,
+  set_op2_field,
+  encode_op2p1,
+  decode_op2p1,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx8_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 9 /* ar8 */ }, 'o' }
+static xtensa_operand_internal iisae_operand = {
+  "i",
+  '<',
+  0,
+  get_sae_field,
+  set_sae_field,
+  encode_sae,
+  decode_sae,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx8_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
+static xtensa_operand_internal iis_operand = {
+  "i",
+  '<',
+  0,
+  get_s_field,
+  set_s_field,
+  encode_s,
+  decode_s,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx4_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 8 /* ar4 */ }, 'o' }
+static xtensa_operand_internal iit_operand = {
+  "i",
+  '<',
+  0,
+  get_t_field,
+  set_t_field,
+  encode_t,
+  decode_t,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx4_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'o' }
+static xtensa_operand_internal iisimm12b_operand = {
+  "i",
+  '<',
+  0,
+  get_imm12b_field,
+  set_imm12b_field,
+  encode_simm12b,
+  decode_simm12b,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_entry_args[] = {
-  { { 11 /* ars_entry */ }, 's' },
-  { { 4 /* ars */ }, 'i' },
-  { { 1 /* uimm12x8 */ }, 'i' }
+static xtensa_operand_internal iinimm4x2_operand = {
+  "i",
+  '<',
+  0,
+  get_imm4_field,
+  set_imm4_field,
+  encode_nimm4x2,
+  decode_nimm4x2,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_entry_stateArgs[] = {
-  { { STATE_PSCALLINC }, 'i' },
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSWOE }, 'i' },
-  { { STATE_WindowBase }, 'm' },
-  { { STATE_WindowStart }, 'm' }
+static xtensa_operand_internal iiuimm4x16_operand = {
+  "i",
+  '<',
+  0,
+  get_op2_field,
+  set_op2_field,
+  encode_uimm4x16,
+  decode_uimm4x16,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_movsp_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
+static xtensa_operand_internal abs_operand = {
+  "a",
+  '=',
+  0,
+  get_s_field,
+  set_s_field,
+  encode_s,
+  decode_s,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_movsp_stateArgs[] = {
-  { { STATE_WindowBase }, 'i' },
-  { { STATE_WindowStart }, 'i' }
+static xtensa_operand_internal iisar_operand = {
+  "i",
+  '<',
+  0,
+  get_sar_field,
+  set_sar_field,
+  encode_sar,
+  decode_sar,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rotw_args[] = {
-  { { 2 /* simm4 */ }, 'i' }
+static xtensa_operand_internal abt_operand = {
+  "a",
+  '=',
+  0,
+  get_t_field,
+  set_t_field,
+  encode_t,
+  decode_t,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rotw_stateArgs[] = {
-  { { STATE_WindowBase }, 'm' }
+static xtensa_operand_internal iisas_operand = {
+  "i",
+  '<',
+  0,
+  get_sas_field,
+  set_sas_field,
+  encode_sas,
+  decode_sas,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_retw_args[] = {
-  { { 5 /* *ars_invisible */ }, 'i' }
+static xtensa_operand_internal amr_operand = {
+  "a",
+  '=',
+  0,
+  get_r_field,
+  set_r_field,
+  encode_r,
+  decode_r,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_retw_stateArgs[] = {
-  { { STATE_WindowBase }, 'm' },
-  { { STATE_WindowStart }, 'm' },
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSWOE }, 'i' }
+static xtensa_operand_internal iib4constu_operand = {
+  "i",
+  '<',
+  0,
+  get_r_field,
+  set_r_field,
+  encode_b4constu,
+  decode_b4constu,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rfwou_stateArgs[] = {
-  { { STATE_EPC1 }, 'i' },
-  { { STATE_PSEXCM }, 'o' },
-  { { STATE_WindowBase }, 'm' },
-  { { STATE_WindowStart }, 'm' },
-  { { STATE_PSOWB }, 'i' }
+static xtensa_operand_internal iisr_operand = {
+  "i",
+  '<',
+  0,
+  get_sr_field,
+  set_sr_field,
+  encode_sr,
+  decode_sr,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l32e_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 12 /* immrx4 */ }, 'i' }
+static xtensa_operand_internal iibbi_operand = {
+  "i",
+  '<',
+  0,
+  get_bbi_field,
+  set_bbi_field,
+  encode_bbi,
+  decode_bbi,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_s32e_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' },
-  { { 12 /* immrx4 */ }, 'i' }
+static xtensa_operand_internal iiai4const_operand = {
+  "i",
+  '<',
+  0,
+  get_t_field,
+  set_t_field,
+  encode_ai4const,
+  decode_ai4const,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal iiuimm12x8_operand = {
+  "i",
+  '<',
+  0,
+  get_imm12_field,
+  set_imm12_field,
+  encode_uimm12x8,
+  decode_uimm12x8,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_stateArgs[] = {
-  { { STATE_WindowBase }, 'i' }
+static xtensa_operand_internal riuimm16x4_operand = {
+  "r",
+  '<',
+  1,
+  get_imm16_field,
+  set_imm16_field,
+  encode_uimm16x4,
+  decode_uimm16x4,
+  do_reloc_r,
+  undo_reloc_r,
+};
+
+static xtensa_operand_internal lisimm8_operand = {
+  "l",
+  '<',
+  1,
+  get_imm8_field,
+  set_imm8_field,
+  encode_simm8,
+  decode_simm8,
+  do_reloc_l,
+  undo_reloc_l,
+};
+
+static xtensa_operand_internal iilsi4x4_operand = {
+  "i",
+  '<',
+  0,
+  get_r_field,
+  set_r_field,
+  encode_lsi4x4,
+  decode_lsi4x4,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal iiuimm8x2_operand = {
+  "i",
+  '<',
+  0,
+  get_imm8_field,
+  set_imm8_field,
+  encode_uimm8x2,
+  decode_uimm8x2,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_stateArgs[] = {
-  { { STATE_WindowBase }, 'o' }
+static xtensa_operand_internal iisimm4_operand = {
+  "i",
+  '<',
+  0,
+  get_mn_field,
+  set_mn_field,
+  encode_simm4,
+  decode_simm4,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal iimsalp32_operand = {
+  "i",
+  '<',
+  0,
+  get_sal_field,
+  set_sal_field,
+  encode_msalp32,
+  decode_msalp32,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_stateArgs[] = {
-  { { STATE_WindowBase }, 'm' }
+static xtensa_operand_internal liuimm6_operand = {
+  "l",
+  '<',
+  1,
+  get_imm6_field,
+  set_imm6_field,
+  encode_uimm6,
+  decode_uimm6,
+  do_reloc_l,
+  undo_reloc_l,
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal iiuimm8x4_operand = {
+  "i",
+  '<',
+  0,
+  get_imm8_field,
+  set_imm8_field,
+  encode_uimm8x4,
+  decode_uimm8x4,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_stateArgs[] = {
-  { { STATE_WindowStart }, 'i' }
+static xtensa_operand_internal lisoffset_operand = {
+  "l",
+  '<',
+  1,
+  get_offset_field,
+  set_offset_field,
+  encode_soffset,
+  decode_soffset,
+  do_reloc_l,
+  undo_reloc_l,
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal iisimm7_operand = {
+  "i",
+  '<',
+  0,
+  get_imm7_field,
+  set_imm7_field,
+  encode_simm7,
+  decode_simm7,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_stateArgs[] = {
-  { { STATE_WindowStart }, 'o' }
+static xtensa_operand_internal ais_operand = {
+  "a",
+  '<',
+  0,
+  get_s_field,
+  set_s_field,
+  encode_s,
+  decode_s,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal liuimm8_operand = {
+  "l",
+  '<',
+  1,
+  get_imm8_field,
+  set_imm8_field,
+  encode_uimm8,
+  decode_uimm8,
+  do_reloc_l,
+  undo_reloc_l,
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_stateArgs[] = {
-  { { STATE_WindowStart }, 'm' }
+static xtensa_operand_internal ait_operand = {
+  "a",
+  '<',
+  0,
+  get_t_field,
+  set_t_field,
+  encode_t,
+  decode_t,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_add_n_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal iisimm8_operand = {
+  "i",
+  '<',
+  0,
+  get_imm8_field,
+  set_imm8_field,
+  encode_simm8,
+  decode_simm8,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_addi_n_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 16 /* ai4const */ }, 'i' }
+static xtensa_operand_internal aor_operand = {
+  "a",
+  '>',
+  0,
+  get_r_field,
+  set_r_field,
+  encode_r,
+  decode_r,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bz6_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 15 /* uimm6 */ }, 'i' }
+static xtensa_operand_internal aos_operand = {
+  "a",
+  '>',
+  0,
+  get_s_field,
+  set_s_field,
+  encode_s,
+  decode_s,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_loadi4_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 13 /* lsi4x4 */ }, 'i' }
+static xtensa_operand_internal aot_operand = {
+  "a",
+  '>',
+  0,
+  get_t_field,
+  set_t_field,
+  encode_t,
+  decode_t,
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_mov_n_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
+static xtensa_iclass_internal nopn_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_movi_n_args[] = {
-  { { 4 /* ars */ }, 'o' },
-  { { 14 /* simm7 */ }, 'i' }
+static xtensa_operand_internal *movi_operand_list[] = {
+  &aot_operand,
+  &iisimm12b_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_retn_args[] = {
-  { { 5 /* *ars_invisible */ }, 'i' }
+static xtensa_iclass_internal movi_iclass = {
+  2,
+  &movi_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_storei4_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' },
-  { { 13 /* lsi4x4 */ }, 'i' }
+static xtensa_operand_internal *bsi8u_operand_list[] = {
+  &ais_operand,
+  &iib4constu_operand,
+  &lisimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_addi_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 23 /* simm8 */ }, 'i' }
+static xtensa_iclass_internal bsi8u_iclass = {
+  3,
+  &bsi8u_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_addmi_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 24 /* simm8x256 */ }, 'i' }
+static xtensa_operand_internal *itlb_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_addsub_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal itlb_iclass = {
+  1,
+  &itlb_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bit_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *shiftst_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bsi8_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 17 /* b4const */ }, 'i' },
-  { { 28 /* label8 */ }, 'i' }
+static xtensa_iclass_internal shiftst_iclass = {
+  3,
+  &shiftst_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bsi8b_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 37 /* bbi */ }, 'i' },
-  { { 28 /* label8 */ }, 'i' }
+static xtensa_operand_internal *l32r_operand_list[] = {
+  &aot_operand,
+  &riuimm16x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bsi8u_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 18 /* b4constu */ }, 'i' },
-  { { 28 /* label8 */ }, 'i' }
+static xtensa_iclass_internal l32r_iclass = {
+  2,
+  &l32r_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bst8_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' },
-  { { 28 /* label8 */ }, 'i' }
+static xtensa_iclass_internal rfe_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_bsz12_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 30 /* label12 */ }, 'i' }
+static xtensa_operand_internal *wait_operand_list[] = {
+  &iis_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_call0_args[] = {
-  { { 0 /* soffsetx4 */ }, 'i' },
-  { { 7 /* ar0 */ }, 'o' }
+static xtensa_iclass_internal wait_iclass = {
+  1,
+  &wait_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_callx0_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 7 /* ar0 */ }, 'o' }
+static xtensa_operand_internal *rfi_operand_list[] = {
+  &iis_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_exti_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 6 /* art */ }, 'i' },
-  { { 52 /* sae */ }, 'i' },
-  { { 27 /* op2p1 */ }, 'i' }
+static xtensa_iclass_internal rfi_iclass = {
+  1,
+  &rfi_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_jump_args[] = {
-  { { 31 /* soffset */ }, 'i' }
+static xtensa_operand_internal *movz_operand_list[] = {
+  &amr_operand,
+  &ais_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_jumpx_args[] = {
-  { { 4 /* ars */ }, 'i' }
+static xtensa_iclass_internal movz_iclass = {
+  3,
+  &movz_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l16ui_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 20 /* uimm8x2 */ }, 'i' }
+static xtensa_operand_internal *callx_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l16si_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 20 /* uimm8x2 */ }, 'i' }
+static xtensa_iclass_internal callx_iclass = {
+  1,
+  &callx_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l32i_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
+static xtensa_operand_internal *mov_n_operand_list[] = {
+  &aot_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l32r_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 32 /* uimm16x4 */ }, 'i' }
+static xtensa_iclass_internal mov_n_iclass = {
+  2,
+  &mov_n_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l32r_stateArgs[] = {
-  { { STATE_LITBADDR }, 'i' },
-  { { STATE_LITBEN }, 'i' }
+static xtensa_operand_internal *loadi4_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iilsi4x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_l8i_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 19 /* uimm8 */ }, 'i' }
+static xtensa_iclass_internal loadi4_iclass = {
+  3,
+  &loadi4_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_loop_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 29 /* ulabel8 */ }, 'i' }
+static xtensa_operand_internal *exti_operand_list[] = {
+  &aor_operand,
+  &ait_operand,
+  &iisae_operand,
+  &iiop2p1_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_loop_stateArgs[] = {
-  { { STATE_LBEG }, 'o' },
-  { { STATE_LEND }, 'o' },
-  { { STATE_LCOUNT }, 'o' }
+static xtensa_iclass_internal exti_iclass = {
+  4,
+  &exti_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_loopz_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 29 /* ulabel8 */ }, 'i' }
+static xtensa_operand_internal *break_operand_list[] = {
+  &iis_operand,
+  &iit_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_loopz_stateArgs[] = {
-  { { STATE_LBEG }, 'o' },
-  { { STATE_LEND }, 'o' },
-  { { STATE_LCOUNT }, 'o' }
+static xtensa_iclass_internal break_iclass = {
+  2,
+  &break_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_movi_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 25 /* simm12b */ }, 'i' }
+static xtensa_operand_internal *slli_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &iimsalp32_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_movz_args[] = {
-  { { 3 /* arr */ }, 'm' },
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal slli_iclass = {
+  3,
+  &slli_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_neg_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *s16i_operand_list[] = {
+  &ait_operand,
+  &ais_operand,
+  &iiuimm8x2_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_return_args[] = {
-  { { 5 /* *ars_invisible */ }, 'i' }
+static xtensa_iclass_internal s16i_iclass = {
+  3,
+  &s16i_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_s16i_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' },
-  { { 20 /* uimm8x2 */ }, 'i' }
+static xtensa_operand_internal *call_operand_list[] = {
+  &lisoffsetx4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_s32i_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
+static xtensa_iclass_internal call_iclass = {
+  1,
+  &call_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_s8i_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' },
-  { { 19 /* uimm8 */ }, 'i' }
+static xtensa_operand_internal *shifts_operand_list[] = {
+  &aor_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_sar_args[] = {
-  { { 4 /* ars */ }, 'i' }
+static xtensa_iclass_internal shifts_iclass = {
+  2,
+  &shifts_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_sar_stateArgs[] = {
-  { { STATE_SAR }, 'o' }
+static xtensa_operand_internal *shiftt_operand_list[] = {
+  &aor_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_sari_args[] = {
-  { { 56 /* sas */ }, 'i' }
+static xtensa_iclass_internal shiftt_iclass = {
+  2,
+  &shiftt_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_sari_stateArgs[] = {
-  { { STATE_SAR }, 'o' }
+static xtensa_operand_internal *rotw_operand_list[] = {
+  &iisimm4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shifts_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
+static xtensa_iclass_internal rotw_iclass = {
+  1,
+  &rotw_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shifts_stateArgs[] = {
-  { { STATE_SAR }, 'i' }
+static xtensa_operand_internal *addsub_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shiftst_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal addsub_iclass = {
+  3,
+  &addsub_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shiftst_stateArgs[] = {
-  { { STATE_SAR }, 'i' }
+static xtensa_operand_internal *l8i_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iiuimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shiftt_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal l8i_iclass = {
+  3,
+  &l8i_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_shiftt_stateArgs[] = {
-  { { STATE_SAR }, 'i' }
+static xtensa_operand_internal *sari_operand_list[] = {
+  &iisas_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_slli_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 4 /* ars */ }, 'i' },
-  { { 26 /* msalp32 */ }, 'i' }
+static xtensa_iclass_internal sari_iclass = {
+  1,
+  &sari_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_srai_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 6 /* art */ }, 'i' },
-  { { 54 /* sargt */ }, 'i' }
+static xtensa_operand_internal *xsr_operand_list[] = {
+  &abt_operand,
+  &iisr_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_srli_args[] = {
-  { { 3 /* arr */ }, 'o' },
-  { { 6 /* art */ }, 'i' },
-  { { 40 /* s */ }, 'i' }
+static xtensa_iclass_internal xsr_iclass = {
+  2,
+  &xsr_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_sync_stateArgs[] = {
-  { { STATE_XTSYNC }, 'i' }
+static xtensa_operand_internal *rsil_operand_list[] = {
+  &aot_operand,
+  &iis_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsil_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 40 /* s */ }, 'i' }
+static xtensa_iclass_internal rsil_iclass = {
+  2,
+  &rsil_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsil_stateArgs[] = {
-  { { STATE_PSWOE }, 'i' },
-  { { STATE_PSCALLINC }, 'i' },
-  { { STATE_PSOWB }, 'i' },
-  { { STATE_PSUM }, 'i' },
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSINTLEVEL }, 'm' }
+static xtensa_operand_internal *bst8_operand_list[] = {
+  &ais_operand,
+  &ait_operand,
+  &lisimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lend_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal bst8_iclass = {
+  3,
+  &bst8_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lend_stateArgs[] = {
-  { { STATE_LEND }, 'i' }
+static xtensa_operand_internal *addi_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iisimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lend_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal addi_iclass = {
+  3,
+  &addi_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lend_stateArgs[] = {
-  { { STATE_LEND }, 'o' }
+static xtensa_operand_internal *callx12_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lend_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal callx12_iclass = {
+  1,
+  &callx12_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lend_stateArgs[] = {
-  { { STATE_LEND }, 'm' }
+static xtensa_operand_internal *bsi8_operand_list[] = {
+  &ais_operand,
+  &iib4const_operand,
+  &lisimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lcount_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal bsi8_iclass = {
+  3,
+  &bsi8_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lcount_stateArgs[] = {
-  { { STATE_LCOUNT }, 'i' }
+static xtensa_operand_internal *jumpx_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lcount_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal jumpx_iclass = {
+  1,
+  &jumpx_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lcount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_LCOUNT }, 'o' }
+static xtensa_iclass_internal retn_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lcount_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *nsa_operand_list[] = {
+  &aot_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lcount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_LCOUNT }, 'm' }
+static xtensa_iclass_internal nsa_iclass = {
+  2,
+  &nsa_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lbeg_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *storei4_operand_list[] = {
+  &ait_operand,
+  &ais_operand,
+  &iilsi4x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_lbeg_stateArgs[] = {
-  { { STATE_LBEG }, 'i' }
+static xtensa_iclass_internal storei4_iclass = {
+  3,
+  &storei4_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lbeg_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *wtlb_operand_list[] = {
+  &ait_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_lbeg_stateArgs[] = {
-  { { STATE_LBEG }, 'o' }
+static xtensa_iclass_internal wtlb_iclass = {
+  2,
+  &wtlb_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lbeg_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *dce_operand_list[] = {
+  &ais_operand,
+  &iiuimm4x16_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_lbeg_stateArgs[] = {
-  { { STATE_LBEG }, 'm' }
+static xtensa_iclass_internal dce_iclass = {
+  2,
+  &dce_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_sar_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *l16i_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iiuimm8x2_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_sar_stateArgs[] = {
-  { { STATE_SAR }, 'i' }
+static xtensa_iclass_internal l16i_iclass = {
+  3,
+  &l16i_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_sar_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *callx4_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_sar_stateArgs[] = {
-  { { STATE_SAR }, 'o' },
-  { { STATE_XTSYNC }, 'o' }
+static xtensa_iclass_internal callx4_iclass = {
+  1,
+  &callx4_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_sar_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *callx8_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_sar_stateArgs[] = {
-  { { STATE_SAR }, 'm' }
+static xtensa_iclass_internal callx8_iclass = {
+  1,
+  &callx8_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_litbase_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *movsp_operand_list[] = {
+  &aot_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_litbase_stateArgs[] = {
-  { { STATE_LITBADDR }, 'i' },
-  { { STATE_LITBEN }, 'i' }
+static xtensa_iclass_internal movsp_iclass = {
+  2,
+  &movsp_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_litbase_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *wsr_operand_list[] = {
+  &ait_operand,
+  &iisr_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_litbase_stateArgs[] = {
-  { { STATE_LITBADDR }, 'o' },
-  { { STATE_LITBEN }, 'o' }
+static xtensa_iclass_internal wsr_iclass = {
+  2,
+  &wsr_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_litbase_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *call12_operand_list[] = {
+  &lisoffsetx4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_litbase_stateArgs[] = {
-  { { STATE_LITBADDR }, 'm' },
-  { { STATE_LITBEN }, 'm' }
+static xtensa_iclass_internal call12_iclass = {
+  1,
+  &call12_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_176_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *call4_operand_list[] = {
+  &lisoffsetx4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_208_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal call4_iclass = {
+  1,
+  &call4_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ps_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *addmi_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iisimm8x256_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ps_stateArgs[] = {
-  { { STATE_PSWOE }, 'i' },
-  { { STATE_PSCALLINC }, 'i' },
-  { { STATE_PSOWB }, 'i' },
-  { { STATE_PSUM }, 'i' },
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSINTLEVEL }, 'i' }
+static xtensa_iclass_internal addmi_iclass = {
+  3,
+  &addmi_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ps_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *bit_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ps_stateArgs[] = {
-  { { STATE_PSWOE }, 'o' },
-  { { STATE_PSCALLINC }, 'o' },
-  { { STATE_PSOWB }, 'o' },
-  { { STATE_PSUM }, 'o' },
-  { { STATE_PSEXCM }, 'o' },
-  { { STATE_PSINTLEVEL }, 'o' }
+static xtensa_iclass_internal bit_iclass = {
+  3,
+  &bit_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ps_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *call8_operand_list[] = {
+  &lisoffsetx4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ps_stateArgs[] = {
-  { { STATE_PSWOE }, 'm' },
-  { { STATE_PSCALLINC }, 'm' },
-  { { STATE_PSOWB }, 'm' },
-  { { STATE_PSUM }, 'm' },
-  { { STATE_PSEXCM }, 'm' },
-  { { STATE_PSINTLEVEL }, 'm' }
+static xtensa_iclass_internal call8_iclass = {
+  1,
+  &call8_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc1_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal itlba_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc1_stateArgs[] = {
-  { { STATE_EPC1 }, 'i' }
+static xtensa_operand_internal *break_n_operand_list[] = {
+  &iis_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc1_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal break_n_iclass = {
+  1,
+  &break_n_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc1_stateArgs[] = {
-  { { STATE_EPC1 }, 'o' }
+static xtensa_operand_internal *sar_operand_list[] = {
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc1_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal sar_iclass = {
+  1,
+  &sar_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc1_stateArgs[] = {
-  { { STATE_EPC1 }, 'm' }
+static xtensa_operand_internal *s32e_operand_list[] = {
+  &ait_operand,
+  &ais_operand,
+  &iinimm4x2_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave1_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal s32e_iclass = {
+  3,
+  &s32e_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave1_stateArgs[] = {
-  { { STATE_EXCSAVE1 }, 'i' }
+static xtensa_operand_internal *bz6_operand_list[] = {
+  &ais_operand,
+  &liuimm6_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave1_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal bz6_iclass = {
+  2,
+  &bz6_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave1_stateArgs[] = {
-  { { STATE_EXCSAVE1 }, 'o' }
+static xtensa_operand_internal *loop_operand_list[] = {
+  &ais_operand,
+  &liuimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave1_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal loop_iclass = {
+  2,
+  &loop_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave1_stateArgs[] = {
-  { { STATE_EXCSAVE1 }, 'm' }
+static xtensa_operand_internal *rsr_operand_list[] = {
+  &aot_operand,
+  &iisr_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc2_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal rsr_iclass = {
+  2,
+  &rsr_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc2_stateArgs[] = {
-  { { STATE_EPC2 }, 'i' }
+static xtensa_operand_internal *icache_operand_list[] = {
+  &ais_operand,
+  &iiuimm8x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc2_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal icache_iclass = {
+  2,
+  &icache_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc2_stateArgs[] = {
-  { { STATE_EPC2 }, 'o' }
+static xtensa_operand_internal *s8i_operand_list[] = {
+  &ait_operand,
+  &ais_operand,
+  &iiuimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc2_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal s8i_iclass = {
+  3,
+  &s8i_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc2_stateArgs[] = {
-  { { STATE_EPC2 }, 'm' }
+static xtensa_iclass_internal return_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave2_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *dcache_operand_list[] = {
+  &ais_operand,
+  &iiuimm8x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave2_stateArgs[] = {
-  { { STATE_EXCSAVE2 }, 'i' }
+static xtensa_iclass_internal dcache_iclass = {
+  2,
+  &dcache_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave2_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_operand_internal *s32i_operand_list[] = {
+  &ait_operand,
+  &ais_operand,
+  &iiuimm8x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave2_stateArgs[] = {
-  { { STATE_EXCSAVE2 }, 'o' }
+static xtensa_iclass_internal s32i_iclass = {
+  3,
+  &s32i_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave2_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_operand_internal *jump_operand_list[] = {
+  &lisoffset_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave2_stateArgs[] = {
-  { { STATE_EXCSAVE2 }, 'm' }
+static xtensa_iclass_internal jump_iclass = {
+  1,
+  &jump_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc3_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *addi_n_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &iiai4const_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc3_stateArgs[] = {
-  { { STATE_EPC3 }, 'i' }
+static xtensa_iclass_internal addi_n_iclass = {
+  3,
+  &addi_n_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc3_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal sync_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc3_stateArgs[] = {
-  { { STATE_EPC3 }, 'o' }
+static xtensa_operand_internal *neg_operand_list[] = {
+  &aor_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc3_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal neg_iclass = {
+  2,
+  &neg_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc3_stateArgs[] = {
-  { { STATE_EPC3 }, 'm' }
+static xtensa_iclass_internal syscall_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave3_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_operand_internal *bsz12_operand_list[] = {
+  &ais_operand,
+  &lisimm12_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave3_stateArgs[] = {
-  { { STATE_EXCSAVE3 }, 'i' }
+static xtensa_iclass_internal bsz12_iclass = {
+  2,
+  &bsz12_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave3_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal excw_iclass = {
+  0,
+  0
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave3_stateArgs[] = {
-  { { STATE_EXCSAVE3 }, 'o' }
+static xtensa_operand_internal *movi_n_operand_list[] = {
+  &aos_operand,
+  &iisimm7_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave3_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal movi_n_iclass = {
+  2,
+  &movi_n_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave3_stateArgs[] = {
-  { { STATE_EXCSAVE3 }, 'm' }
+static xtensa_operand_internal *rtlb_operand_list[] = {
+  &aot_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc4_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal rtlb_iclass = {
+  2,
+  &rtlb_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_epc4_stateArgs[] = {
-  { { STATE_EPC4 }, 'i' }
+static xtensa_operand_internal *actl_operand_list[] = {
+  &aot_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc4_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal actl_iclass = {
+  2,
+  &actl_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_epc4_stateArgs[] = {
-  { { STATE_EPC4 }, 'o' }
+static xtensa_operand_internal *srli_operand_list[] = {
+  &aor_operand,
+  &ait_operand,
+  &iis_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc4_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal srli_iclass = {
+  3,
+  &srli_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_epc4_stateArgs[] = {
-  { { STATE_EPC4 }, 'm' }
+static xtensa_operand_internal *bsi8b_operand_list[] = {
+  &ais_operand,
+  &iibbi_operand,
+  &lisimm8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave4_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal bsi8b_iclass = {
+  3,
+  &bsi8b_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave4_stateArgs[] = {
-  { { STATE_EXCSAVE4 }, 'i' }
+static xtensa_operand_internal *acts_operand_list[] = {
+  &ait_operand,
+  &ais_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave4_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal acts_iclass = {
+  2,
+  &acts_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave4_stateArgs[] = {
-  { { STATE_EXCSAVE4 }, 'o' }
+static xtensa_operand_internal *add_n_operand_list[] = {
+  &aor_operand,
+  &ais_operand,
+  &ait_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave4_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal add_n_iclass = {
+  3,
+  &add_n_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave4_stateArgs[] = {
-  { { STATE_EXCSAVE4 }, 'm' }
+static xtensa_operand_internal *srai_operand_list[] = {
+  &aor_operand,
+  &ait_operand,
+  &iisar_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps2_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal srai_iclass = {
+  3,
+  &srai_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps2_stateArgs[] = {
-  { { STATE_EPS2 }, 'i' }
+static xtensa_operand_internal *entry_operand_list[] = {
+  &abs_operand,
+  &iiuimm12x8_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps2_args[] = {
-  { { 6 /* art */ }, 'i' }
+static xtensa_iclass_internal entry_iclass = {
+  2,
+  &entry_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps2_stateArgs[] = {
-  { { STATE_EPS2 }, 'o' }
+static xtensa_operand_internal *l32e_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iinimm4x2_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps2_args[] = {
-  { { 6 /* art */ }, 'm' }
+static xtensa_iclass_internal l32e_iclass = {
+  3,
+  &l32e_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps2_stateArgs[] = {
-  { { STATE_EPS2 }, 'm' }
+static xtensa_operand_internal *dpf_operand_list[] = {
+  &ais_operand,
+  &iiuimm8x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps3_args[] = {
-  { { 6 /* art */ }, 'o' }
+static xtensa_iclass_internal dpf_iclass = {
+  2,
+  &dpf_operand_list[0]
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps3_stateArgs[] = {
-  { { STATE_EPS3 }, 'i' }
+static xtensa_operand_internal *l32i_operand_list[] = {
+  &aot_operand,
+  &ais_operand,
+  &iiuimm8x4_operand
 };
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps3_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
+static xtensa_iclass_internal l32i_iclass = {
+  3,
+  &l32i_operand_list[0]
+};
+
+static xtensa_insnbuf abs_template (void);
+static xtensa_insnbuf add_template (void);
+static xtensa_insnbuf add_n_template (void);
+static xtensa_insnbuf addi_template (void);
+static xtensa_insnbuf addi_n_template (void);
+static xtensa_insnbuf addmi_template (void);
+static xtensa_insnbuf addx2_template (void);
+static xtensa_insnbuf addx4_template (void);
+static xtensa_insnbuf addx8_template (void);
+static xtensa_insnbuf and_template (void);
+static xtensa_insnbuf ball_template (void);
+static xtensa_insnbuf bany_template (void);
+static xtensa_insnbuf bbc_template (void);
+static xtensa_insnbuf bbci_template (void);
+static xtensa_insnbuf bbs_template (void);
+static xtensa_insnbuf bbsi_template (void);
+static xtensa_insnbuf beq_template (void);
+static xtensa_insnbuf beqi_template (void);
+static xtensa_insnbuf beqz_template (void);
+static xtensa_insnbuf beqz_n_template (void);
+static xtensa_insnbuf bge_template (void);
+static xtensa_insnbuf bgei_template (void);
+static xtensa_insnbuf bgeu_template (void);
+static xtensa_insnbuf bgeui_template (void);
+static xtensa_insnbuf bgez_template (void);
+static xtensa_insnbuf blt_template (void);
+static xtensa_insnbuf blti_template (void);
+static xtensa_insnbuf bltu_template (void);
+static xtensa_insnbuf bltui_template (void);
+static xtensa_insnbuf bltz_template (void);
+static xtensa_insnbuf bnall_template (void);
+static xtensa_insnbuf bne_template (void);
+static xtensa_insnbuf bnei_template (void);
+static xtensa_insnbuf bnez_template (void);
+static xtensa_insnbuf bnez_n_template (void);
+static xtensa_insnbuf bnone_template (void);
+static xtensa_insnbuf break_template (void);
+static xtensa_insnbuf break_n_template (void);
+static xtensa_insnbuf call0_template (void);
+static xtensa_insnbuf call12_template (void);
+static xtensa_insnbuf call4_template (void);
+static xtensa_insnbuf call8_template (void);
+static xtensa_insnbuf callx0_template (void);
+static xtensa_insnbuf callx12_template (void);
+static xtensa_insnbuf callx4_template (void);
+static xtensa_insnbuf callx8_template (void);
+static xtensa_insnbuf dhi_template (void);
+static xtensa_insnbuf dhwb_template (void);
+static xtensa_insnbuf dhwbi_template (void);
+static xtensa_insnbuf dii_template (void);
+static xtensa_insnbuf diwb_template (void);
+static xtensa_insnbuf diwbi_template (void);
+static xtensa_insnbuf dpfr_template (void);
+static xtensa_insnbuf dpfro_template (void);
+static xtensa_insnbuf dpfw_template (void);
+static xtensa_insnbuf dpfwo_template (void);
+static xtensa_insnbuf dsync_template (void);
+static xtensa_insnbuf entry_template (void);
+static xtensa_insnbuf esync_template (void);
+static xtensa_insnbuf excw_template (void);
+static xtensa_insnbuf extui_template (void);
+static xtensa_insnbuf idtlb_template (void);
+static xtensa_insnbuf idtlba_template (void);
+static xtensa_insnbuf ihi_template (void);
+static xtensa_insnbuf iii_template (void);
+static xtensa_insnbuf iitlb_template (void);
+static xtensa_insnbuf iitlba_template (void);
+static xtensa_insnbuf ipf_template (void);
+static xtensa_insnbuf isync_template (void);
+static xtensa_insnbuf j_template (void);
+static xtensa_insnbuf jx_template (void);
+static xtensa_insnbuf l16si_template (void);
+static xtensa_insnbuf l16ui_template (void);
+static xtensa_insnbuf l32e_template (void);
+static xtensa_insnbuf l32i_template (void);
+static xtensa_insnbuf l32i_n_template (void);
+static xtensa_insnbuf l32r_template (void);
+static xtensa_insnbuf l8ui_template (void);
+static xtensa_insnbuf ldct_template (void);
+static xtensa_insnbuf lict_template (void);
+static xtensa_insnbuf licw_template (void);
+static xtensa_insnbuf loop_template (void);
+static xtensa_insnbuf loopgtz_template (void);
+static xtensa_insnbuf loopnez_template (void);
+static xtensa_insnbuf memw_template (void);
+static xtensa_insnbuf mov_n_template (void);
+static xtensa_insnbuf moveqz_template (void);
+static xtensa_insnbuf movgez_template (void);
+static xtensa_insnbuf movi_template (void);
+static xtensa_insnbuf movi_n_template (void);
+static xtensa_insnbuf movltz_template (void);
+static xtensa_insnbuf movnez_template (void);
+static xtensa_insnbuf movsp_template (void);
+static xtensa_insnbuf neg_template (void);
+static xtensa_insnbuf nop_n_template (void);
+static xtensa_insnbuf nsa_template (void);
+static xtensa_insnbuf nsau_template (void);
+static xtensa_insnbuf or_template (void);
+static xtensa_insnbuf pdtlb_template (void);
+static xtensa_insnbuf pitlb_template (void);
+static xtensa_insnbuf rdtlb0_template (void);
+static xtensa_insnbuf rdtlb1_template (void);
+static xtensa_insnbuf ret_template (void);
+static xtensa_insnbuf ret_n_template (void);
+static xtensa_insnbuf retw_template (void);
+static xtensa_insnbuf retw_n_template (void);
+static xtensa_insnbuf rfde_template (void);
+static xtensa_insnbuf rfe_template (void);
+static xtensa_insnbuf rfi_template (void);
+static xtensa_insnbuf rfwo_template (void);
+static xtensa_insnbuf rfwu_template (void);
+static xtensa_insnbuf ritlb0_template (void);
+static xtensa_insnbuf ritlb1_template (void);
+static xtensa_insnbuf rotw_template (void);
+static xtensa_insnbuf rsil_template (void);
+static xtensa_insnbuf rsr_template (void);
+static xtensa_insnbuf rsync_template (void);
+static xtensa_insnbuf s16i_template (void);
+static xtensa_insnbuf s32e_template (void);
+static xtensa_insnbuf s32i_template (void);
+static xtensa_insnbuf s32i_n_template (void);
+static xtensa_insnbuf s8i_template (void);
+static xtensa_insnbuf sdct_template (void);
+static xtensa_insnbuf sict_template (void);
+static xtensa_insnbuf sicw_template (void);
+static xtensa_insnbuf simcall_template (void);
+static xtensa_insnbuf sll_template (void);
+static xtensa_insnbuf slli_template (void);
+static xtensa_insnbuf sra_template (void);
+static xtensa_insnbuf srai_template (void);
+static xtensa_insnbuf src_template (void);
+static xtensa_insnbuf srl_template (void);
+static xtensa_insnbuf srli_template (void);
+static xtensa_insnbuf ssa8b_template (void);
+static xtensa_insnbuf ssa8l_template (void);
+static xtensa_insnbuf ssai_template (void);
+static xtensa_insnbuf ssl_template (void);
+static xtensa_insnbuf ssr_template (void);
+static xtensa_insnbuf sub_template (void);
+static xtensa_insnbuf subx2_template (void);
+static xtensa_insnbuf subx4_template (void);
+static xtensa_insnbuf subx8_template (void);
+static xtensa_insnbuf syscall_template (void);
+static xtensa_insnbuf waiti_template (void);
+static xtensa_insnbuf wdtlb_template (void);
+static xtensa_insnbuf witlb_template (void);
+static xtensa_insnbuf wsr_template (void);
+static xtensa_insnbuf xor_template (void);
+static xtensa_insnbuf xsr_template (void);
+
+static xtensa_insnbuf
+abs_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00001006 };
+  return &template[0];
+}
+
+static xtensa_insnbuf
+add_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000008 };
+  return &template[0];
+}
+
+static xtensa_insnbuf
+add_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00a00000 };
+  return &template[0];
+}
 
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps3_stateArgs[] = {
-  { { STATE_EPS3 }, 'o' }
-};
+static xtensa_insnbuf
+addi_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00200c00 };
+  return &template[0];
+}
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps3_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
+static xtensa_insnbuf
+addi_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00b00000 };
+  return &template[0];
+}
 
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps3_stateArgs[] = {
-  { { STATE_EPS3 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps4_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_eps4_stateArgs[] = {
-  { { STATE_EPS4 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps4_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_eps4_stateArgs[] = {
-  { { STATE_EPS4 }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps4_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_eps4_stateArgs[] = {
-  { { STATE_EPS4 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excvaddr_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_excvaddr_stateArgs[] = {
-  { { STATE_EXCVADDR }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excvaddr_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_excvaddr_stateArgs[] = {
-  { { STATE_EXCVADDR }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excvaddr_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_excvaddr_stateArgs[] = {
-  { { STATE_EXCVADDR }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_depc_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_depc_stateArgs[] = {
-  { { STATE_DEPC }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_depc_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_depc_stateArgs[] = {
-  { { STATE_DEPC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_depc_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_depc_stateArgs[] = {
-  { { STATE_DEPC }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_exccause_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_exccause_stateArgs[] = {
-  { { STATE_EXCCAUSE }, 'i' },
-  { { STATE_XTSYNC }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_exccause_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_exccause_stateArgs[] = {
-  { { STATE_EXCCAUSE }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_exccause_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_exccause_stateArgs[] = {
-  { { STATE_EXCCAUSE }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_misc0_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_misc0_stateArgs[] = {
-  { { STATE_MISC0 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_misc0_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_misc0_stateArgs[] = {
-  { { STATE_MISC0 }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_misc0_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_misc0_stateArgs[] = {
-  { { STATE_MISC0 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_misc1_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_misc1_stateArgs[] = {
-  { { STATE_MISC1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_misc1_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_misc1_stateArgs[] = {
-  { { STATE_MISC1 }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_misc1_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_misc1_stateArgs[] = {
-  { { STATE_MISC1 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_prid_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rfi_args[] = {
-  { { 40 /* s */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rfi_stateArgs[] = {
-  { { STATE_PSWOE }, 'o' },
-  { { STATE_PSCALLINC }, 'o' },
-  { { STATE_PSOWB }, 'o' },
-  { { STATE_PSUM }, 'o' },
-  { { STATE_PSEXCM }, 'o' },
-  { { STATE_PSINTLEVEL }, 'o' },
-  { { STATE_EPC1 }, 'i' },
-  { { STATE_EPC2 }, 'i' },
-  { { STATE_EPC3 }, 'i' },
-  { { STATE_EPC4 }, 'i' },
-  { { STATE_EPS2 }, 'i' },
-  { { STATE_EPS3 }, 'i' },
-  { { STATE_EPS4 }, 'i' },
-  { { STATE_InOCDMode }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wait_args[] = {
-  { { 40 /* s */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wait_stateArgs[] = {
-  { { STATE_PSINTLEVEL }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_interrupt_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_interrupt_stateArgs[] = {
-  { { STATE_INTERRUPT }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intset_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intset_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intclear_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intclear_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_intenable_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_intenable_stateArgs[] = {
-  { { STATE_INTENABLE }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intenable_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_intenable_stateArgs[] = {
-  { { STATE_INTENABLE }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_intenable_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_intenable_stateArgs[] = {
-  { { STATE_INTENABLE }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_break_args[] = {
-  { { 34 /* imms */ }, 'i' },
-  { { 33 /* immt */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_break_stateArgs[] = {
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSINTLEVEL }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_break_n_args[] = {
-  { { 34 /* imms */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_break_n_stateArgs[] = {
-  { { STATE_PSEXCM }, 'i' },
-  { { STATE_PSINTLEVEL }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka0_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka0_stateArgs[] = {
-  { { STATE_DBREAKA0 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka0_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka0_stateArgs[] = {
-  { { STATE_DBREAKA0 }, 'o' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka0_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka0_stateArgs[] = {
-  { { STATE_DBREAKA0 }, 'm' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc0_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc0_stateArgs[] = {
-  { { STATE_DBREAKC0 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc0_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc0_stateArgs[] = {
-  { { STATE_DBREAKC0 }, 'o' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc0_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc0_stateArgs[] = {
-  { { STATE_DBREAKC0 }, 'm' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka1_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka1_stateArgs[] = {
-  { { STATE_DBREAKA1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka1_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka1_stateArgs[] = {
-  { { STATE_DBREAKA1 }, 'o' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka1_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka1_stateArgs[] = {
-  { { STATE_DBREAKA1 }, 'm' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc1_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc1_stateArgs[] = {
-  { { STATE_DBREAKC1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc1_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc1_stateArgs[] = {
-  { { STATE_DBREAKC1 }, 'o' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc1_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc1_stateArgs[] = {
-  { { STATE_DBREAKC1 }, 'm' },
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka0_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka0_stateArgs[] = {
-  { { STATE_IBREAKA0 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka0_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka0_stateArgs[] = {
-  { { STATE_IBREAKA0 }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka0_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka0_stateArgs[] = {
-  { { STATE_IBREAKA0 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka1_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka1_stateArgs[] = {
-  { { STATE_IBREAKA1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka1_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka1_stateArgs[] = {
-  { { STATE_IBREAKA1 }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka1_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka1_stateArgs[] = {
-  { { STATE_IBREAKA1 }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreakenable_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreakenable_stateArgs[] = {
-  { { STATE_IBREAKENABLE }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreakenable_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreakenable_stateArgs[] = {
-  { { STATE_IBREAKENABLE }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreakenable_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreakenable_stateArgs[] = {
-  { { STATE_IBREAKENABLE }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_debugcause_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_debugcause_stateArgs[] = {
-  { { STATE_DEBUGCAUSE }, 'i' },
-  { { STATE_DBNUM }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_debugcause_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_debugcause_stateArgs[] = {
-  { { STATE_DEBUGCAUSE }, 'o' },
-  { { STATE_DBNUM }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_debugcause_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_debugcause_stateArgs[] = {
-  { { STATE_DEBUGCAUSE }, 'm' },
-  { { STATE_DBNUM }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_icount_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_icount_stateArgs[] = {
-  { { STATE_ICOUNT }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_icount_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_icount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_ICOUNT }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_icount_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_icount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_ICOUNT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_icountlevel_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_icountlevel_stateArgs[] = {
-  { { STATE_ICOUNTLEVEL }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_icountlevel_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_icountlevel_stateArgs[] = {
-  { { STATE_ICOUNTLEVEL }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_icountlevel_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_icountlevel_stateArgs[] = {
-  { { STATE_ICOUNTLEVEL }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ddr_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ddr_stateArgs[] = {
-  { { STATE_DDR }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ddr_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ddr_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_DDR }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ddr_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ddr_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_DDR }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rfdo_stateArgs[] = {
-  { { STATE_InOCDMode }, 'm' },
-  { { STATE_EPC4 }, 'i' },
-  { { STATE_PSWOE }, 'o' },
-  { { STATE_PSCALLINC }, 'o' },
-  { { STATE_PSOWB }, 'o' },
-  { { STATE_PSUM }, 'o' },
-  { { STATE_PSEXCM }, 'o' },
-  { { STATE_PSINTLEVEL }, 'o' },
-  { { STATE_EPS4 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rfdd_stateArgs[] = {
-  { { STATE_InOCDMode }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccount_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccount_stateArgs[] = {
-  { { STATE_CCOUNT }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccount_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_CCOUNT }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccount_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccount_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' },
-  { { STATE_CCOUNT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare0_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare0_stateArgs[] = {
-  { { STATE_CCOMPARE0 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare0_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare0_stateArgs[] = {
-  { { STATE_CCOMPARE0 }, 'o' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare0_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare0_stateArgs[] = {
-  { { STATE_CCOMPARE0 }, 'm' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare1_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare1_stateArgs[] = {
-  { { STATE_CCOMPARE1 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare1_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare1_stateArgs[] = {
-  { { STATE_CCOMPARE1 }, 'o' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare1_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare1_stateArgs[] = {
-  { { STATE_CCOMPARE1 }, 'm' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare2_args[] = {
-  { { 6 /* art */ }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare2_stateArgs[] = {
-  { { STATE_CCOMPARE2 }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare2_args[] = {
-  { { 6 /* art */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare2_stateArgs[] = {
-  { { STATE_CCOMPARE2 }, 'o' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare2_args[] = {
-  { { 6 /* art */ }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare2_stateArgs[] = {
-  { { STATE_CCOMPARE2 }, 'm' },
-  { { STATE_INTERRUPT }, 'm' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_icache_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_icache_inv_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_licx_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_sicx_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_dcache_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_dcache_ind_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 22 /* uimm4x16 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_dcache_inv_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_dpf_args[] = {
-  { { 4 /* ars */ }, 'i' },
-  { { 21 /* uimm8x4 */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_sdct_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_ldct_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_idtlb_args[] = {
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_idtlb_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_rdtlb_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wdtlb_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_wdtlb_stateArgs[] = {
-  { { STATE_XTSYNC }, 'o' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_iitlb_args[] = {
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_ritlb_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_witlb_args[] = {
-  { { 6 /* art */ }, 'i' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_arg_internal Iclass_xt_iclass_nsa_args[] = {
-  { { 6 /* art */ }, 'o' },
-  { { 4 /* ars */ }, 'i' }
-};
-
-static xtensa_iclass_internal iclasses[] = {
-  { 0, 0 /* xt_iclass_excw */,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_rfe */,
-    2, Iclass_xt_iclass_rfe_stateArgs, 0, 0 },
-  { 0, 0 /* xt_iclass_rfde */,
-    1, Iclass_xt_iclass_rfde_stateArgs, 0, 0 },
-  { 0, 0 /* xt_iclass_syscall */,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_simcall */,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_call12_args,
-    1, Iclass_xt_iclass_call12_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_call8_args,
-    1, Iclass_xt_iclass_call8_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_call4_args,
-    1, Iclass_xt_iclass_call4_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_callx12_args,
-    1, Iclass_xt_iclass_callx12_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_callx8_args,
-    1, Iclass_xt_iclass_callx8_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_callx4_args,
-    1, Iclass_xt_iclass_callx4_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_entry_args,
-    5, Iclass_xt_iclass_entry_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_movsp_args,
-    2, Iclass_xt_iclass_movsp_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rotw_args,
-    1, Iclass_xt_iclass_rotw_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_retw_args,
-    4, Iclass_xt_iclass_retw_stateArgs, 0, 0 },
-  { 0, 0 /* xt_iclass_rfwou */,
-    5, Iclass_xt_iclass_rfwou_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_l32e_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_s32e_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_windowbase_args,
-    1, Iclass_xt_iclass_rsr_windowbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_windowbase_args,
-    1, Iclass_xt_iclass_wsr_windowbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_windowbase_args,
-    1, Iclass_xt_iclass_xsr_windowbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_windowstart_args,
-    1, Iclass_xt_iclass_rsr_windowstart_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_windowstart_args,
-    1, Iclass_xt_iclass_wsr_windowstart_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_windowstart_args,
-    1, Iclass_xt_iclass_xsr_windowstart_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_add_n_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_addi_n_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_bz6_args,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_ill_n */,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_loadi4_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_mov_n_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_movi_n_args,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_nopn */,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_retn_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_storei4_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_addi_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_addmi_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_addsub_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_bit_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_bsi8_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_bsi8b_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_bsi8u_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_bst8_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_bsz12_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_call0_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_callx0_args,
-    0, 0, 0, 0 },
-  { 4, Iclass_xt_iclass_exti_args,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_ill */,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_jump_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_jumpx_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_l16ui_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_l16si_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_l32i_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_l32r_args,
-    2, Iclass_xt_iclass_l32r_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_l8i_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_loop_args,
-    3, Iclass_xt_iclass_loop_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_loopz_args,
-    3, Iclass_xt_iclass_loopz_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_movi_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_movz_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_neg_args,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_nop */,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_return_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_s16i_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_s32i_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_s8i_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_sar_args,
-    1, Iclass_xt_iclass_sar_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_sari_args,
-    1, Iclass_xt_iclass_sari_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_shifts_args,
-    1, Iclass_xt_iclass_shifts_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_shiftst_args,
-    1, Iclass_xt_iclass_shiftst_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_shiftt_args,
-    1, Iclass_xt_iclass_shiftt_stateArgs, 0, 0 },
-  { 3, Iclass_xt_iclass_slli_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_srai_args,
-    0, 0, 0, 0 },
-  { 3, Iclass_xt_iclass_srli_args,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_memw */,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_extw */,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_isync */,
-    0, 0, 0, 0 },
-  { 0, 0 /* xt_iclass_sync */,
-    1, Iclass_xt_iclass_sync_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_rsil_args,
-    6, Iclass_xt_iclass_rsil_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_lend_args,
-    1, Iclass_xt_iclass_rsr_lend_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_lend_args,
-    1, Iclass_xt_iclass_wsr_lend_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_lend_args,
-    1, Iclass_xt_iclass_xsr_lend_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_lcount_args,
-    1, Iclass_xt_iclass_rsr_lcount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_lcount_args,
-    2, Iclass_xt_iclass_wsr_lcount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_lcount_args,
-    2, Iclass_xt_iclass_xsr_lcount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_lbeg_args,
-    1, Iclass_xt_iclass_rsr_lbeg_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_lbeg_args,
-    1, Iclass_xt_iclass_wsr_lbeg_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_lbeg_args,
-    1, Iclass_xt_iclass_xsr_lbeg_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_sar_args,
-    1, Iclass_xt_iclass_rsr_sar_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_sar_args,
-    2, Iclass_xt_iclass_wsr_sar_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_sar_args,
-    1, Iclass_xt_iclass_xsr_sar_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_litbase_args,
-    2, Iclass_xt_iclass_rsr_litbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_litbase_args,
-    2, Iclass_xt_iclass_wsr_litbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_litbase_args,
-    2, Iclass_xt_iclass_xsr_litbase_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_176_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_208_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ps_args,
-    6, Iclass_xt_iclass_rsr_ps_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ps_args,
-    6, Iclass_xt_iclass_wsr_ps_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ps_args,
-    6, Iclass_xt_iclass_xsr_ps_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_epc1_args,
-    1, Iclass_xt_iclass_rsr_epc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_epc1_args,
-    1, Iclass_xt_iclass_wsr_epc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_epc1_args,
-    1, Iclass_xt_iclass_xsr_epc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_excsave1_args,
-    1, Iclass_xt_iclass_rsr_excsave1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_excsave1_args,
-    1, Iclass_xt_iclass_wsr_excsave1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_excsave1_args,
-    1, Iclass_xt_iclass_xsr_excsave1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_epc2_args,
-    1, Iclass_xt_iclass_rsr_epc2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_epc2_args,
-    1, Iclass_xt_iclass_wsr_epc2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_epc2_args,
-    1, Iclass_xt_iclass_xsr_epc2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_excsave2_args,
-    1, Iclass_xt_iclass_rsr_excsave2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_excsave2_args,
-    1, Iclass_xt_iclass_wsr_excsave2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_excsave2_args,
-    1, Iclass_xt_iclass_xsr_excsave2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_epc3_args,
-    1, Iclass_xt_iclass_rsr_epc3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_epc3_args,
-    1, Iclass_xt_iclass_wsr_epc3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_epc3_args,
-    1, Iclass_xt_iclass_xsr_epc3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_excsave3_args,
-    1, Iclass_xt_iclass_rsr_excsave3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_excsave3_args,
-    1, Iclass_xt_iclass_wsr_excsave3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_excsave3_args,
-    1, Iclass_xt_iclass_xsr_excsave3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_epc4_args,
-    1, Iclass_xt_iclass_rsr_epc4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_epc4_args,
-    1, Iclass_xt_iclass_wsr_epc4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_epc4_args,
-    1, Iclass_xt_iclass_xsr_epc4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_excsave4_args,
-    1, Iclass_xt_iclass_rsr_excsave4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_excsave4_args,
-    1, Iclass_xt_iclass_wsr_excsave4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_excsave4_args,
-    1, Iclass_xt_iclass_xsr_excsave4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_eps2_args,
-    1, Iclass_xt_iclass_rsr_eps2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_eps2_args,
-    1, Iclass_xt_iclass_wsr_eps2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_eps2_args,
-    1, Iclass_xt_iclass_xsr_eps2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_eps3_args,
-    1, Iclass_xt_iclass_rsr_eps3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_eps3_args,
-    1, Iclass_xt_iclass_wsr_eps3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_eps3_args,
-    1, Iclass_xt_iclass_xsr_eps3_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_eps4_args,
-    1, Iclass_xt_iclass_rsr_eps4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_eps4_args,
-    1, Iclass_xt_iclass_wsr_eps4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_eps4_args,
-    1, Iclass_xt_iclass_xsr_eps4_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_excvaddr_args,
-    1, Iclass_xt_iclass_rsr_excvaddr_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_excvaddr_args,
-    1, Iclass_xt_iclass_wsr_excvaddr_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_excvaddr_args,
-    1, Iclass_xt_iclass_xsr_excvaddr_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_depc_args,
-    1, Iclass_xt_iclass_rsr_depc_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_depc_args,
-    1, Iclass_xt_iclass_wsr_depc_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_depc_args,
-    1, Iclass_xt_iclass_xsr_depc_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_exccause_args,
-    2, Iclass_xt_iclass_rsr_exccause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_exccause_args,
-    1, Iclass_xt_iclass_wsr_exccause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_exccause_args,
-    1, Iclass_xt_iclass_xsr_exccause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_misc0_args,
-    1, Iclass_xt_iclass_rsr_misc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_misc0_args,
-    1, Iclass_xt_iclass_wsr_misc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_misc0_args,
-    1, Iclass_xt_iclass_xsr_misc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_misc1_args,
-    1, Iclass_xt_iclass_rsr_misc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_misc1_args,
-    1, Iclass_xt_iclass_wsr_misc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_misc1_args,
-    1, Iclass_xt_iclass_xsr_misc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_prid_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_rfi_args,
-    14, Iclass_xt_iclass_rfi_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wait_args,
-    1, Iclass_xt_iclass_wait_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_interrupt_args,
-    1, Iclass_xt_iclass_rsr_interrupt_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_intset_args,
-    2, Iclass_xt_iclass_wsr_intset_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_intclear_args,
-    2, Iclass_xt_iclass_wsr_intclear_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_intenable_args,
-    1, Iclass_xt_iclass_rsr_intenable_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_intenable_args,
-    1, Iclass_xt_iclass_wsr_intenable_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_intenable_args,
-    1, Iclass_xt_iclass_xsr_intenable_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_break_args,
-    2, Iclass_xt_iclass_break_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_break_n_args,
-    2, Iclass_xt_iclass_break_n_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_dbreaka0_args,
-    1, Iclass_xt_iclass_rsr_dbreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_dbreaka0_args,
-    2, Iclass_xt_iclass_wsr_dbreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_dbreaka0_args,
-    2, Iclass_xt_iclass_xsr_dbreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_dbreakc0_args,
-    1, Iclass_xt_iclass_rsr_dbreakc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_dbreakc0_args,
-    2, Iclass_xt_iclass_wsr_dbreakc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_dbreakc0_args,
-    2, Iclass_xt_iclass_xsr_dbreakc0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_dbreaka1_args,
-    1, Iclass_xt_iclass_rsr_dbreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_dbreaka1_args,
-    2, Iclass_xt_iclass_wsr_dbreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_dbreaka1_args,
-    2, Iclass_xt_iclass_xsr_dbreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_dbreakc1_args,
-    1, Iclass_xt_iclass_rsr_dbreakc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_dbreakc1_args,
-    2, Iclass_xt_iclass_wsr_dbreakc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_dbreakc1_args,
-    2, Iclass_xt_iclass_xsr_dbreakc1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ibreaka0_args,
-    1, Iclass_xt_iclass_rsr_ibreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ibreaka0_args,
-    1, Iclass_xt_iclass_wsr_ibreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ibreaka0_args,
-    1, Iclass_xt_iclass_xsr_ibreaka0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ibreaka1_args,
-    1, Iclass_xt_iclass_rsr_ibreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ibreaka1_args,
-    1, Iclass_xt_iclass_wsr_ibreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ibreaka1_args,
-    1, Iclass_xt_iclass_xsr_ibreaka1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ibreakenable_args,
-    1, Iclass_xt_iclass_rsr_ibreakenable_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ibreakenable_args,
-    1, Iclass_xt_iclass_wsr_ibreakenable_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ibreakenable_args,
-    1, Iclass_xt_iclass_xsr_ibreakenable_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_debugcause_args,
-    2, Iclass_xt_iclass_rsr_debugcause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_debugcause_args,
-    2, Iclass_xt_iclass_wsr_debugcause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_debugcause_args,
-    2, Iclass_xt_iclass_xsr_debugcause_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_icount_args,
-    1, Iclass_xt_iclass_rsr_icount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_icount_args,
-    2, Iclass_xt_iclass_wsr_icount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_icount_args,
-    2, Iclass_xt_iclass_xsr_icount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_icountlevel_args,
-    1, Iclass_xt_iclass_rsr_icountlevel_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_icountlevel_args,
-    1, Iclass_xt_iclass_wsr_icountlevel_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_icountlevel_args,
-    1, Iclass_xt_iclass_xsr_icountlevel_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ddr_args,
-    1, Iclass_xt_iclass_rsr_ddr_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ddr_args,
-    2, Iclass_xt_iclass_wsr_ddr_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ddr_args,
-    2, Iclass_xt_iclass_xsr_ddr_stateArgs, 0, 0 },
-  { 0, 0 /* xt_iclass_rfdo */,
-    9, Iclass_xt_iclass_rfdo_stateArgs, 0, 0 },
-  { 0, 0 /* xt_iclass_rfdd */,
-    1, Iclass_xt_iclass_rfdd_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ccount_args,
-    1, Iclass_xt_iclass_rsr_ccount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ccount_args,
-    2, Iclass_xt_iclass_wsr_ccount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ccount_args,
-    2, Iclass_xt_iclass_xsr_ccount_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ccompare0_args,
-    1, Iclass_xt_iclass_rsr_ccompare0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ccompare0_args,
-    2, Iclass_xt_iclass_wsr_ccompare0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ccompare0_args,
-    2, Iclass_xt_iclass_xsr_ccompare0_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ccompare1_args,
-    1, Iclass_xt_iclass_rsr_ccompare1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ccompare1_args,
-    2, Iclass_xt_iclass_wsr_ccompare1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ccompare1_args,
-    2, Iclass_xt_iclass_xsr_ccompare1_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_rsr_ccompare2_args,
-    1, Iclass_xt_iclass_rsr_ccompare2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_wsr_ccompare2_args,
-    2, Iclass_xt_iclass_wsr_ccompare2_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_xsr_ccompare2_args,
-    2, Iclass_xt_iclass_xsr_ccompare2_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_icache_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_icache_inv_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_licx_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_sicx_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_dcache_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_dcache_ind_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_dcache_inv_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_dpf_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_sdct_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_ldct_args,
-    0, 0, 0, 0 },
-  { 1, Iclass_xt_iclass_idtlb_args,
-    1, Iclass_xt_iclass_idtlb_stateArgs, 0, 0 },
-  { 2, Iclass_xt_iclass_rdtlb_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_wdtlb_args,
-    1, Iclass_xt_iclass_wdtlb_stateArgs, 0, 0 },
-  { 1, Iclass_xt_iclass_iitlb_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_ritlb_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_witlb_args,
-    0, 0, 0, 0 },
-  { 2, Iclass_xt_iclass_nsa_args,
-    0, 0, 0, 0 }
-};
-
-\f
-/*  Opcode encodings.  */
-
-static void
-Opcode_excw_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x80200;
-}
-
-static void
-Opcode_rfe_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x300;
-}
-
-static void
-Opcode_rfde_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x2300;
-}
-
-static void
-Opcode_syscall_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x500;
-}
-
-static void
-Opcode_simcall_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x1500;
-}
-
-static void
-Opcode_call12_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x5c0000;
-}
-
-static void
-Opcode_call8_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x580000;
-}
-
-static void
-Opcode_call4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x540000;
-}
-
-static void
-Opcode_callx12_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf0000;
-}
-
-static void
-Opcode_callx8_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb0000;
-}
-
-static void
-Opcode_callx4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x70000;
-}
-
-static void
-Opcode_entry_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6c0000;
-}
-
-static void
-Opcode_movsp_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x100;
-}
-
-static void
-Opcode_rotw_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x804;
-}
-
-static void
-Opcode_retw_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x60000;
-}
-
-static void
-Opcode_retw_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd10f;
-}
-
-static void
-Opcode_rfwo_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4300;
-}
-
-static void
-Opcode_rfwu_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x5300;
-}
-
-static void
-Opcode_l32e_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x90;
-}
-
-static void
-Opcode_s32e_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x94;
-}
-
-static void
-Opcode_rsr_windowbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4830;
-}
-
-static void
-Opcode_wsr_windowbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4831;
-}
-
-static void
-Opcode_xsr_windowbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4816;
-}
-
-static void
-Opcode_rsr_windowstart_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4930;
-}
-
-static void
-Opcode_wsr_windowstart_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4931;
-}
-
-static void
-Opcode_xsr_windowstart_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4916;
-}
-
-static void
-Opcode_add_n_Slot_inst16a_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xa000;
-}
-
-static void
-Opcode_addi_n_Slot_inst16a_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb000;
-}
-
-static void
-Opcode_beqz_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc800;
-}
-
-static void
-Opcode_bnez_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xcc00;
-}
-
-static void
-Opcode_ill_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd60f;
-}
-
-static void
-Opcode_l32i_n_Slot_inst16a_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x8000;
-}
-
-static void
-Opcode_mov_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd000;
-}
-
-static void
-Opcode_movi_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc000;
-}
-
-static void
-Opcode_nop_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd30f;
-}
-
-static void
-Opcode_ret_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd00f;
-}
-
-static void
-Opcode_s32i_n_Slot_inst16a_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x9000;
-}
-
-static void
-Opcode_addi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200c00;
-}
-
-static void
-Opcode_addmi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200d00;
-}
-
-static void
-Opcode_add_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x8;
-}
-
-static void
-Opcode_sub_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc;
-}
-
-static void
-Opcode_addx2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x9;
-}
-
-static void
-Opcode_addx4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xa;
-}
-
-static void
-Opcode_addx8_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb;
-}
-
-static void
-Opcode_subx2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd;
-}
-
-static void
-Opcode_subx4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe;
-}
-
-static void
-Opcode_subx8_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf;
-}
-
-static void
-Opcode_and_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x1;
-}
-
-static void
-Opcode_or_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x2;
-}
-
-static void
-Opcode_xor_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x3;
-}
-
-static void
-Opcode_beqi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x680000;
-}
-
-static void
-Opcode_bnei_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x690000;
-}
-
-static void
-Opcode_bgei_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6b0000;
-}
-
-static void
-Opcode_blti_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6a0000;
-}
-
-static void
-Opcode_bbci_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700600;
-}
-
-static void
-Opcode_bbsi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700e00;
-}
-
-static void
-Opcode_bgeui_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6f0000;
-}
-
-static void
-Opcode_bltui_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6e0000;
-}
-
-static void
-Opcode_beq_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700100;
-}
-
-static void
-Opcode_bne_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700900;
-}
-
-static void
-Opcode_bge_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700a00;
-}
-
-static void
-Opcode_blt_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700200;
-}
-
-static void
-Opcode_bgeu_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700b00;
-}
-
-static void
-Opcode_bltu_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700300;
-}
-
-static void
-Opcode_bany_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700800;
-}
-
-static void
-Opcode_bnone_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700000;
-}
-
-static void
-Opcode_ball_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700400;
-}
-
-static void
-Opcode_bnall_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700c00;
-}
-
-static void
-Opcode_bbc_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700500;
-}
-
-static void
-Opcode_bbs_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700d00;
-}
-
-static void
-Opcode_beqz_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x640000;
-}
-
-static void
-Opcode_bnez_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x650000;
-}
-
-static void
-Opcode_bgez_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x670000;
-}
-
-static void
-Opcode_bltz_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x660000;
-}
-
-static void
-Opcode_call0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x500000;
-}
-
-static void
-Opcode_callx0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x30000;
-}
-
-static void
-Opcode_extui_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x40;
-}
-
-static void
-Opcode_ill_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0;
-}
-
-static void
-Opcode_j_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x600000;
-}
-
-static void
-Opcode_jx_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xa0000;
-}
-
-static void
-Opcode_l16ui_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200100;
-}
-
-static void
-Opcode_l16si_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200900;
-}
-
-static void
-Opcode_l32i_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200200;
-}
-
-static void
-Opcode_l32r_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x100000;
-}
-
-static void
-Opcode_l8ui_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200000;
-}
-
-static void
-Opcode_loop_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6d0800;
-}
-
-static void
-Opcode_loopnez_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6d0900;
-}
-
-static void
-Opcode_loopgtz_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6d0a00;
-}
-
-static void
-Opcode_movi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200a00;
-}
-
-static void
-Opcode_moveqz_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x38;
-}
-
-static void
-Opcode_movnez_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x39;
-}
-
-static void
-Opcode_movltz_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x3a;
-}
-
-static void
-Opcode_movgez_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x3b;
-}
-
-static void
-Opcode_neg_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x6;
-}
-
-static void
-Opcode_abs_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x1006;
-}
-
-static void
-Opcode_nop_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf0200;
-}
-
-static void
-Opcode_ret_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x20000;
-}
-
-static void
-Opcode_s16i_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200500;
-}
-
-static void
-Opcode_s32i_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200600;
-}
-
-static void
-Opcode_s8i_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200400;
-}
-
-static void
-Opcode_ssr_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x4;
-}
-
-static void
-Opcode_ssl_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x104;
-}
-
-static void
-Opcode_ssa8l_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x204;
-}
-
-static void
-Opcode_ssa8b_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x304;
-}
-
-static void
-Opcode_ssai_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x404;
-}
-
-static void
-Opcode_sll_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x1a;
-}
-
-static void
-Opcode_src_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x18;
-}
-
-static void
-Opcode_srl_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x19;
-}
-
-static void
-Opcode_sra_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x1b;
-}
-
-static void
-Opcode_slli_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x10;
-}
-
-static void
-Opcode_srai_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x12;
-}
-
-static void
-Opcode_srli_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x14;
-}
-
-static void
-Opcode_memw_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc0200;
-}
-
-static void
-Opcode_extw_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd0200;
-}
-
-static void
-Opcode_isync_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x200;
-}
-
-static void
-Opcode_rsync_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x10200;
-}
-
-static void
-Opcode_esync_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x20200;
-}
-
-static void
-Opcode_dsync_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x30200;
-}
-
-static void
-Opcode_rsil_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x600;
-}
-
-static void
-Opcode_rsr_lend_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x130;
-}
-
-static void
-Opcode_wsr_lend_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x131;
-}
-
-static void
-Opcode_xsr_lend_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x116;
-}
-
-static void
-Opcode_rsr_lcount_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x230;
-}
-
-static void
-Opcode_wsr_lcount_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x231;
-}
-
-static void
-Opcode_xsr_lcount_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x216;
-}
-
-static void
-Opcode_rsr_lbeg_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x30;
-}
-
-static void
-Opcode_wsr_lbeg_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x31;
-}
-
-static void
-Opcode_xsr_lbeg_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x16;
-}
-
-static void
-Opcode_rsr_sar_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x330;
-}
-
-static void
-Opcode_wsr_sar_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x331;
-}
-
-static void
-Opcode_xsr_sar_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x316;
-}
-
-static void
-Opcode_rsr_litbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x530;
-}
-
-static void
-Opcode_wsr_litbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x531;
-}
-
-static void
-Opcode_xsr_litbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x516;
-}
-
-static void
-Opcode_rsr_176_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb030;
-}
-
-static void
-Opcode_rsr_208_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd030;
-}
-
-static void
-Opcode_rsr_ps_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe630;
-}
-
-static void
-Opcode_wsr_ps_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe631;
-}
-
-static void
-Opcode_xsr_ps_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe616;
-}
-
-static void
-Opcode_rsr_epc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb130;
-}
-
-static void
-Opcode_wsr_epc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb131;
-}
-
-static void
-Opcode_xsr_epc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb116;
-}
-
-static void
-Opcode_rsr_excsave1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd130;
-}
-
-static void
-Opcode_wsr_excsave1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd131;
-}
-
-static void
-Opcode_xsr_excsave1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd116;
-}
-
-static void
-Opcode_rsr_epc2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb230;
-}
-
-static void
-Opcode_wsr_epc2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb231;
-}
-
-static void
-Opcode_xsr_epc2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb216;
-}
-
-static void
-Opcode_rsr_excsave2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd230;
-}
-
-static void
-Opcode_wsr_excsave2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd231;
-}
-
-static void
-Opcode_xsr_excsave2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd216;
-}
-
-static void
-Opcode_rsr_epc3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb330;
-}
-
-static void
-Opcode_wsr_epc3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb331;
-}
-
-static void
-Opcode_xsr_epc3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb316;
-}
-
-static void
-Opcode_rsr_excsave3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd330;
-}
-
-static void
-Opcode_wsr_excsave3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd331;
-}
-
-static void
-Opcode_xsr_excsave3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd316;
-}
-
-static void
-Opcode_rsr_epc4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb430;
-}
-
-static void
-Opcode_wsr_epc4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb431;
-}
-
-static void
-Opcode_xsr_epc4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xb416;
-}
-
-static void
-Opcode_rsr_excsave4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd430;
-}
-
-static void
-Opcode_wsr_excsave4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd431;
-}
-
-static void
-Opcode_xsr_excsave4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd416;
-}
-
-static void
-Opcode_rsr_eps2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc230;
-}
-
-static void
-Opcode_wsr_eps2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc231;
-}
-
-static void
-Opcode_xsr_eps2_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc216;
-}
-
-static void
-Opcode_rsr_eps3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc330;
-}
-
-static void
-Opcode_wsr_eps3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc331;
-}
-
-static void
-Opcode_xsr_eps3_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc316;
-}
-
-static void
-Opcode_rsr_eps4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc430;
-}
-
-static void
-Opcode_wsr_eps4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc431;
-}
-
-static void
-Opcode_xsr_eps4_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc416;
-}
-
-static void
-Opcode_rsr_excvaddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xee30;
-}
-
-static void
-Opcode_wsr_excvaddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xee31;
-}
-
-static void
-Opcode_xsr_excvaddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xee16;
-}
-
-static void
-Opcode_rsr_depc_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc030;
-}
-
-static void
-Opcode_wsr_depc_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc031;
-}
-
-static void
-Opcode_xsr_depc_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xc016;
-}
-
-static void
-Opcode_rsr_exccause_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe830;
-}
-
-static void
-Opcode_wsr_exccause_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe831;
-}
-
-static void
-Opcode_xsr_exccause_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe816;
-}
-
-static void
-Opcode_rsr_misc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf430;
-}
-
-static void
-Opcode_wsr_misc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf431;
-}
-
-static void
-Opcode_xsr_misc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf416;
-}
-
-static void
-Opcode_rsr_misc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf530;
-}
-
-static void
-Opcode_wsr_misc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf531;
-}
-
-static void
-Opcode_xsr_misc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xf516;
-}
-
-static void
-Opcode_rsr_prid_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xeb30;
-}
-
-static void
-Opcode_rfi_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x10300;
-}
-
-static void
-Opcode_waiti_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x700;
-}
-
-static void
-Opcode_rsr_interrupt_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe230;
-}
-
-static void
-Opcode_wsr_intset_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe231;
-}
-
-static void
-Opcode_wsr_intclear_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe331;
-}
-
-static void
-Opcode_rsr_intenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe430;
-}
-
-static void
-Opcode_wsr_intenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe431;
-}
-
-static void
-Opcode_xsr_intenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xe416;
-}
-
-static void
-Opcode_break_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x400;
-}
-
-static void
-Opcode_break_n_Slot_inst16b_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0xd20f;
-}
-
-static void
-Opcode_rsr_dbreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = 0x9030;
-}
-
-static void
-Opcode_wsr_dbreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+addmi_template (void)
 {
-  slotbuf[0] = 0x9031;
+  static xtensa_insnbuf_word template[] = { 0x00200d00 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_dbreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+addx2_template (void)
 {
-  slotbuf[0] = 0x9016;
+  static xtensa_insnbuf_word template[] = { 0x00000009 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_dbreakc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+addx4_template (void)
 {
-  slotbuf[0] = 0xa030;
+  static xtensa_insnbuf_word template[] = { 0x0000000a };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_dbreakc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+addx8_template (void)
 {
-  slotbuf[0] = 0xa031;
+  static xtensa_insnbuf_word template[] = { 0x0000000b };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_dbreakc0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+and_template (void)
 {
-  slotbuf[0] = 0xa016;
+  static xtensa_insnbuf_word template[] = { 0x00000001 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_dbreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+ball_template (void)
 {
-  slotbuf[0] = 0x9130;
+  static xtensa_insnbuf_word template[] = { 0x00700400 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_dbreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bany_template (void)
 {
-  slotbuf[0] = 0x9131;
+  static xtensa_insnbuf_word template[] = { 0x00700800 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_dbreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bbc_template (void)
 {
-  slotbuf[0] = 0x9116;
+  static xtensa_insnbuf_word template[] = { 0x00700500 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_dbreakc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bbci_template (void)
 {
-  slotbuf[0] = 0xa130;
+  static xtensa_insnbuf_word template[] = { 0x00700600 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_dbreakc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bbs_template (void)
 {
-  slotbuf[0] = 0xa131;
+  static xtensa_insnbuf_word template[] = { 0x00700d00 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_dbreakc1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bbsi_template (void)
 {
-  slotbuf[0] = 0xa116;
+  static xtensa_insnbuf_word template[] = { 0x00700e00 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ibreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+beq_template (void)
 {
-  slotbuf[0] = 0x8030;
+  static xtensa_insnbuf_word template[] = { 0x00700100 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ibreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+beqi_template (void)
 {
-  slotbuf[0] = 0x8031;
+  static xtensa_insnbuf_word template[] = { 0x00680000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ibreaka0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+beqz_template (void)
 {
-  slotbuf[0] = 0x8016;
+  static xtensa_insnbuf_word template[] = { 0x00640000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ibreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+beqz_n_template (void)
 {
-  slotbuf[0] = 0x8130;
+  static xtensa_insnbuf_word template[] = { 0x00c80000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ibreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bge_template (void)
 {
-  slotbuf[0] = 0x8131;
+  static xtensa_insnbuf_word template[] = { 0x00700a00 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ibreaka1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bgei_template (void)
 {
-  slotbuf[0] = 0x8116;
+  static xtensa_insnbuf_word template[] = { 0x006b0000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ibreakenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bgeu_template (void)
 {
-  slotbuf[0] = 0x6030;
+  static xtensa_insnbuf_word template[] = { 0x00700b00 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ibreakenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bgeui_template (void)
 {
-  slotbuf[0] = 0x6031;
+  static xtensa_insnbuf_word template[] = { 0x006f0000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ibreakenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bgez_template (void)
 {
-  slotbuf[0] = 0x6016;
+  static xtensa_insnbuf_word template[] = { 0x00670000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_debugcause_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+blt_template (void)
 {
-  slotbuf[0] = 0xe930;
+  static xtensa_insnbuf_word template[] = { 0x00700200 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_debugcause_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+blti_template (void)
 {
-  slotbuf[0] = 0xe931;
+  static xtensa_insnbuf_word template[] = { 0x006a0000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_debugcause_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bltu_template (void)
 {
-  slotbuf[0] = 0xe916;
+  static xtensa_insnbuf_word template[] = { 0x00700300 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_icount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bltui_template (void)
 {
-  slotbuf[0] = 0xec30;
+  static xtensa_insnbuf_word template[] = { 0x006e0000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_icount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bltz_template (void)
 {
-  slotbuf[0] = 0xec31;
+  static xtensa_insnbuf_word template[] = { 0x00660000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_icount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bnall_template (void)
 {
-  slotbuf[0] = 0xec16;
+  static xtensa_insnbuf_word template[] = { 0x00700c00 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_icountlevel_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bne_template (void)
 {
-  slotbuf[0] = 0xed30;
+  static xtensa_insnbuf_word template[] = { 0x00700900 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_icountlevel_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bnei_template (void)
 {
-  slotbuf[0] = 0xed31;
+  static xtensa_insnbuf_word template[] = { 0x00690000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_icountlevel_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bnez_template (void)
 {
-  slotbuf[0] = 0xed16;
+  static xtensa_insnbuf_word template[] = { 0x00650000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bnez_n_template (void)
 {
-  slotbuf[0] = 0x6830;
+  static xtensa_insnbuf_word template[] = { 0x00cc0000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+bnone_template (void)
 {
-  slotbuf[0] = 0x6831;
+  static xtensa_insnbuf_word template[] = { 0x00700000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+break_template (void)
 {
-  slotbuf[0] = 0x6816;
+  static xtensa_insnbuf_word template[] = { 0x00000400 };
+  return &template[0];
 }
 
-static void
-Opcode_rfdo_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+break_n_template (void)
 {
-  slotbuf[0] = 0xe1f;
+  static xtensa_insnbuf_word template[] = { 0x00d20f00 };
+  return &template[0];
 }
 
-static void
-Opcode_rfdd_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+call0_template (void)
 {
-  slotbuf[0] = 0x10e1f;
+  static xtensa_insnbuf_word template[] = { 0x00500000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ccount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+call12_template (void)
 {
-  slotbuf[0] = 0xea30;
+  static xtensa_insnbuf_word template[] = { 0x005c0000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ccount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+call4_template (void)
 {
-  slotbuf[0] = 0xea31;
+  static xtensa_insnbuf_word template[] = { 0x00540000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ccount_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+call8_template (void)
 {
-  slotbuf[0] = 0xea16;
+  static xtensa_insnbuf_word template[] = { 0x00580000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ccompare0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+callx0_template (void)
 {
-  slotbuf[0] = 0xf030;
+  static xtensa_insnbuf_word template[] = { 0x00030000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ccompare0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+callx12_template (void)
 {
-  slotbuf[0] = 0xf031;
+  static xtensa_insnbuf_word template[] = { 0x000f0000 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ccompare0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+callx4_template (void)
 {
-  slotbuf[0] = 0xf016;
+  static xtensa_insnbuf_word template[] = { 0x00070000 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ccompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+callx8_template (void)
 {
-  slotbuf[0] = 0xf130;
+  static xtensa_insnbuf_word template[] = { 0x000b0000 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ccompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dhi_template (void)
 {
-  slotbuf[0] = 0xf131;
+  static xtensa_insnbuf_word template[] = { 0x00260700 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ccompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dhwb_template (void)
 {
-  slotbuf[0] = 0xf116;
+  static xtensa_insnbuf_word template[] = { 0x00240700 };
+  return &template[0];
 }
 
-static void
-Opcode_rsr_ccompare2_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dhwbi_template (void)
 {
-  slotbuf[0] = 0xf230;
+  static xtensa_insnbuf_word template[] = { 0x00250700 };
+  return &template[0];
 }
 
-static void
-Opcode_wsr_ccompare2_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dii_template (void)
 {
-  slotbuf[0] = 0xf231;
+  static xtensa_insnbuf_word template[] = { 0x00270700 };
+  return &template[0];
 }
 
-static void
-Opcode_xsr_ccompare2_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+diwb_template (void)
 {
-  slotbuf[0] = 0xf216;
+  static xtensa_insnbuf_word template[] = { 0x00280740 };
+  return &template[0];
 }
 
-static void
-Opcode_ipf_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+diwbi_template (void)
 {
-  slotbuf[0] = 0x2c0700;
+  static xtensa_insnbuf_word template[] = { 0x00280750 };
+  return &template[0];
 }
 
-static void
-Opcode_ihi_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dpfr_template (void)
 {
-  slotbuf[0] = 0x2e0700;
+  static xtensa_insnbuf_word template[] = { 0x00200700 };
+  return &template[0];
 }
 
-static void
-Opcode_iii_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dpfro_template (void)
 {
-  slotbuf[0] = 0x2f0700;
+  static xtensa_insnbuf_word template[] = { 0x00220700 };
+  return &template[0];
 }
 
-static void
-Opcode_lict_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dpfw_template (void)
 {
-  slotbuf[0] = 0x1f;
+  static xtensa_insnbuf_word template[] = { 0x00210700 };
+  return &template[0];
 }
 
-static void
-Opcode_licw_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dpfwo_template (void)
 {
-  slotbuf[0] = 0x21f;
+  static xtensa_insnbuf_word template[] = { 0x00230700 };
+  return &template[0];
 }
 
-static void
-Opcode_sict_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+dsync_template (void)
 {
-  slotbuf[0] = 0x11f;
+  static xtensa_insnbuf_word template[] = { 0x00030200 };
+  return &template[0];
 }
 
-static void
-Opcode_sicw_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+entry_template (void)
 {
-  slotbuf[0] = 0x31f;
+  static xtensa_insnbuf_word template[] = { 0x006c0000 };
+  return &template[0];
 }
 
-static void
-Opcode_dhwb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+esync_template (void)
 {
-  slotbuf[0] = 0x240700;
+  static xtensa_insnbuf_word template[] = { 0x00020200 };
+  return &template[0];
 }
 
-static void
-Opcode_dhwbi_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+excw_template (void)
 {
-  slotbuf[0] = 0x250700;
+  static xtensa_insnbuf_word template[] = { 0x00080200 };
+  return &template[0];
 }
 
-static void
-Opcode_diwb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+extui_template (void)
 {
-  slotbuf[0] = 0x280740;
+  static xtensa_insnbuf_word template[] = { 0x00000040 };
+  return &template[0];
 }
 
-static void
-Opcode_diwbi_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+idtlb_template (void)
 {
-  slotbuf[0] = 0x280750;
+  static xtensa_insnbuf_word template[] = { 0x00000c05 };
+  return &template[0];
 }
 
-static void
-Opcode_dhi_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+idtlba_template (void)
 {
-  slotbuf[0] = 0x260700;
+  static xtensa_insnbuf_word template[] = { 0x00000805 };
+  return &template[0];
 }
 
-static void
-Opcode_dii_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+ihi_template (void)
 {
-  slotbuf[0] = 0x270700;
+  static xtensa_insnbuf_word template[] = { 0x002e0700 };
+  return &template[0];
 }
 
-static void
-Opcode_dpfr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+iii_template (void)
 {
-  slotbuf[0] = 0x200700;
+  static xtensa_insnbuf_word template[] = { 0x002f0700 };
+  return &template[0];
 }
 
-static void
-Opcode_dpfw_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+iitlb_template (void)
 {
-  slotbuf[0] = 0x210700;
+  static xtensa_insnbuf_word template[] = { 0x00000405 };
+  return &template[0];
 }
 
-static void
-Opcode_dpfro_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+iitlba_template (void)
 {
-  slotbuf[0] = 0x220700;
+  static xtensa_insnbuf_word template[] = { 0x00000005 };
+  return &template[0];
 }
 
-static void
-Opcode_dpfwo_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+ipf_template (void)
 {
-  slotbuf[0] = 0x230700;
+  static xtensa_insnbuf_word template[] = { 0x002c0700 };
+  return &template[0];
 }
 
-static void
-Opcode_sdct_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+isync_template (void)
 {
-  slotbuf[0] = 0x91f;
+  static xtensa_insnbuf_word template[] = { 0x00000200 };
+  return &template[0];
 }
 
-static void
-Opcode_ldct_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+j_template (void)
 {
-  slotbuf[0] = 0x81f;
+  static xtensa_insnbuf_word template[] = { 0x00600000 };
+  return &template[0];
 }
 
-static void
-Opcode_idtlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+jx_template (void)
 {
-  slotbuf[0] = 0xc05;
+  static xtensa_insnbuf_word template[] = { 0x000a0000 };
+  return &template[0];
 }
 
-static void
-Opcode_pdtlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l16si_template (void)
 {
-  slotbuf[0] = 0xd05;
+  static xtensa_insnbuf_word template[] = { 0x00200900 };
+  return &template[0];
 }
 
-static void
-Opcode_rdtlb0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l16ui_template (void)
 {
-  slotbuf[0] = 0xb05;
+  static xtensa_insnbuf_word template[] = { 0x00200100 };
+  return &template[0];
 }
 
-static void
-Opcode_rdtlb1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l32e_template (void)
 {
-  slotbuf[0] = 0xf05;
+  static xtensa_insnbuf_word template[] = { 0x00000090 };
+  return &template[0];
 }
 
-static void
-Opcode_wdtlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l32i_template (void)
 {
-  slotbuf[0] = 0xe05;
+  static xtensa_insnbuf_word template[] = { 0x00200200 };
+  return &template[0];
 }
 
-static void
-Opcode_iitlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l32i_n_template (void)
 {
-  slotbuf[0] = 0x405;
+  static xtensa_insnbuf_word template[] = { 0x00800000 };
+  return &template[0];
 }
 
-static void
-Opcode_pitlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l32r_template (void)
 {
-  slotbuf[0] = 0x505;
+  static xtensa_insnbuf_word template[] = { 0x00100000 };
+  return &template[0];
 }
 
-static void
-Opcode_ritlb0_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+l8ui_template (void)
 {
-  slotbuf[0] = 0x305;
+  static xtensa_insnbuf_word template[] = { 0x00200000 };
+  return &template[0];
 }
 
-static void
-Opcode_ritlb1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+ldct_template (void)
 {
-  slotbuf[0] = 0x705;
+  static xtensa_insnbuf_word template[] = { 0x0000081f };
+  return &template[0];
 }
 
-static void
-Opcode_witlb_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+lict_template (void)
 {
-  slotbuf[0] = 0x605;
+  static xtensa_insnbuf_word template[] = { 0x0000001f };
+  return &template[0];
 }
 
-static void
-Opcode_nsa_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+licw_template (void)
 {
-  slotbuf[0] = 0xe04;
+  static xtensa_insnbuf_word template[] = { 0x0000021f };
+  return &template[0];
 }
 
-static void
-Opcode_nsau_Slot_inst_encode (xtensa_insnbuf slotbuf)
+static xtensa_insnbuf
+loop_template (void)
 {
-  slotbuf[0] = 0xf04;
+  static xtensa_insnbuf_word template[] = { 0x006d0800 };
+  return &template[0];
 }
 
-xtensa_opcode_encode_fn Opcode_excw_encode_fns[] = {
-  Opcode_excw_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rfe_encode_fns[] = {
-  Opcode_rfe_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rfde_encode_fns[] = {
-  Opcode_rfde_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_syscall_encode_fns[] = {
-  Opcode_syscall_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_simcall_encode_fns[] = {
-  Opcode_simcall_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_call12_encode_fns[] = {
-  Opcode_call12_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_call8_encode_fns[] = {
-  Opcode_call8_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_call4_encode_fns[] = {
-  Opcode_call4_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_callx12_encode_fns[] = {
-  Opcode_callx12_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_callx8_encode_fns[] = {
-  Opcode_callx8_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_callx4_encode_fns[] = {
-  Opcode_callx4_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_entry_encode_fns[] = {
-  Opcode_entry_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_movsp_encode_fns[] = {
-  Opcode_movsp_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rotw_encode_fns[] = {
-  Opcode_rotw_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_retw_encode_fns[] = {
-  Opcode_retw_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_retw_n_encode_fns[] = {
-  0, 0, Opcode_retw_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_rfwo_encode_fns[] = {
-  Opcode_rfwo_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rfwu_encode_fns[] = {
-  Opcode_rfwu_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_l32e_encode_fns[] = {
-  Opcode_l32e_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_s32e_encode_fns[] = {
-  Opcode_s32e_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rsr_windowbase_encode_fns[] = {
-  Opcode_rsr_windowbase_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_wsr_windowbase_encode_fns[] = {
-  Opcode_wsr_windowbase_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_xsr_windowbase_encode_fns[] = {
-  Opcode_xsr_windowbase_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_rsr_windowstart_encode_fns[] = {
-  Opcode_rsr_windowstart_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_wsr_windowstart_encode_fns[] = {
-  Opcode_wsr_windowstart_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_xsr_windowstart_encode_fns[] = {
-  Opcode_xsr_windowstart_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_add_n_encode_fns[] = {
-  0, Opcode_add_n_Slot_inst16a_encode, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addi_n_encode_fns[] = {
-  0, Opcode_addi_n_Slot_inst16a_encode, 0
-};
-
-xtensa_opcode_encode_fn Opcode_beqz_n_encode_fns[] = {
-  0, 0, Opcode_beqz_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_bnez_n_encode_fns[] = {
-  0, 0, Opcode_bnez_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_ill_n_encode_fns[] = {
-  0, 0, Opcode_ill_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_l32i_n_encode_fns[] = {
-  0, Opcode_l32i_n_Slot_inst16a_encode, 0
-};
-
-xtensa_opcode_encode_fn Opcode_mov_n_encode_fns[] = {
-  0, 0, Opcode_mov_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_movi_n_encode_fns[] = {
-  0, 0, Opcode_movi_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_nop_n_encode_fns[] = {
-  0, 0, Opcode_nop_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_ret_n_encode_fns[] = {
-  0, 0, Opcode_ret_n_Slot_inst16b_encode
-};
-
-xtensa_opcode_encode_fn Opcode_s32i_n_encode_fns[] = {
-  0, Opcode_s32i_n_Slot_inst16a_encode, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addi_encode_fns[] = {
-  Opcode_addi_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addmi_encode_fns[] = {
-  Opcode_addmi_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_add_encode_fns[] = {
-  Opcode_add_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_sub_encode_fns[] = {
-  Opcode_sub_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addx2_encode_fns[] = {
-  Opcode_addx2_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addx4_encode_fns[] = {
-  Opcode_addx4_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_addx8_encode_fns[] = {
-  Opcode_addx8_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_subx2_encode_fns[] = {
-  Opcode_subx2_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_subx4_encode_fns[] = {
-  Opcode_subx4_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_subx8_encode_fns[] = {
-  Opcode_subx8_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_and_encode_fns[] = {
-  Opcode_and_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_or_encode_fns[] = {
-  Opcode_or_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_xor_encode_fns[] = {
-  Opcode_xor_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_beqi_encode_fns[] = {
-  Opcode_beqi_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bnei_encode_fns[] = {
-  Opcode_bnei_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bgei_encode_fns[] = {
-  Opcode_bgei_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_blti_encode_fns[] = {
-  Opcode_blti_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bbci_encode_fns[] = {
-  Opcode_bbci_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bbsi_encode_fns[] = {
-  Opcode_bbsi_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bgeui_encode_fns[] = {
-  Opcode_bgeui_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bltui_encode_fns[] = {
-  Opcode_bltui_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_beq_encode_fns[] = {
-  Opcode_beq_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bne_encode_fns[] = {
-  Opcode_bne_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_bge_encode_fns[] = {
-  Opcode_bge_Slot_inst_encode, 0, 0
-};
-
-xtensa_opcode_encode_fn Opcode_blt_encode_fns[] = {
-  Opcode_blt_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+loopgtz_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x006d0a00 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bgeu_encode_fns[] = {
-  Opcode_bgeu_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+loopnez_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x006d0900 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bltu_encode_fns[] = {
-  Opcode_bltu_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+memw_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x000c0200 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bany_encode_fns[] = {
-  Opcode_bany_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+mov_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00d00000 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bnone_encode_fns[] = {
-  Opcode_bnone_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+moveqz_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000038 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ball_encode_fns[] = {
-  Opcode_ball_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movgez_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000003b };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bnall_encode_fns[] = {
-  Opcode_bnall_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movi_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00200a00 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bbc_encode_fns[] = {
-  Opcode_bbc_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movi_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00c00000 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bbs_encode_fns[] = {
-  Opcode_bbs_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movltz_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000003a };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_beqz_encode_fns[] = {
-  Opcode_beqz_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movnez_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000039 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bnez_encode_fns[] = {
-  Opcode_bnez_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+movsp_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000100 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bgez_encode_fns[] = {
-  Opcode_bgez_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+neg_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000006 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_bltz_encode_fns[] = {
-  Opcode_bltz_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+nop_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00d30f00 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_call0_encode_fns[] = {
-  Opcode_call0_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+nsa_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000e04 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_callx0_encode_fns[] = {
-  Opcode_callx0_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+nsau_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000f04 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_extui_encode_fns[] = {
-  Opcode_extui_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+or_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000002 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ill_encode_fns[] = {
-  Opcode_ill_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+pdtlb_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000d05 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_j_encode_fns[] = {
-  Opcode_j_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+pitlb_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000505 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_jx_encode_fns[] = {
-  Opcode_jx_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rdtlb0_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000b05 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_l16ui_encode_fns[] = {
-  Opcode_l16ui_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rdtlb1_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000f05 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_l16si_encode_fns[] = {
-  Opcode_l16si_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ret_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00020000 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_l32i_encode_fns[] = {
-  Opcode_l32i_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ret_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00d00f00 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_l32r_encode_fns[] = {
-  Opcode_l32r_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+retw_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00060000 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_l8ui_encode_fns[] = {
-  Opcode_l8ui_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+retw_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00d10f00 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_loop_encode_fns[] = {
-  Opcode_loop_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rfde_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00002300 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_loopnez_encode_fns[] = {
-  Opcode_loopnez_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rfe_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000300 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_loopgtz_encode_fns[] = {
-  Opcode_loopgtz_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rfi_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00010300 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_movi_encode_fns[] = {
-  Opcode_movi_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rfwo_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00004300 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_moveqz_encode_fns[] = {
-  Opcode_moveqz_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rfwu_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00005300 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_movnez_encode_fns[] = {
-  Opcode_movnez_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ritlb0_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000305 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_movltz_encode_fns[] = {
-  Opcode_movltz_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ritlb1_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000705 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_movgez_encode_fns[] = {
-  Opcode_movgez_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rotw_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000804 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_neg_encode_fns[] = {
-  Opcode_neg_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rsil_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000600 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_abs_encode_fns[] = {
-  Opcode_abs_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rsr_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000030 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_nop_encode_fns[] = {
-  Opcode_nop_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+rsync_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00010200 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ret_encode_fns[] = {
-  Opcode_ret_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+s16i_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00200500 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_s16i_encode_fns[] = {
-  Opcode_s16i_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+s32e_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000094 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_s32i_encode_fns[] = {
-  Opcode_s32i_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+s32i_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00200600 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_s8i_encode_fns[] = {
-  Opcode_s8i_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+s32i_n_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00900000 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ssr_encode_fns[] = {
-  Opcode_ssr_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+s8i_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00200400 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ssl_encode_fns[] = {
-  Opcode_ssl_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sdct_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000091f };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ssa8l_encode_fns[] = {
-  Opcode_ssa8l_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sict_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000011f };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ssa8b_encode_fns[] = {
-  Opcode_ssa8b_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sicw_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000031f };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_ssai_encode_fns[] = {
-  Opcode_ssai_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+simcall_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00001500 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_sll_encode_fns[] = {
-  Opcode_sll_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sll_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000001a };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_src_encode_fns[] = {
-  Opcode_src_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+slli_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000010 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_srl_encode_fns[] = {
-  Opcode_srl_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sra_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000001b };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_sra_encode_fns[] = {
-  Opcode_sra_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+srai_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000012 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_slli_encode_fns[] = {
-  Opcode_slli_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+src_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000018 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_srai_encode_fns[] = {
-  Opcode_srai_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+srl_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000019 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_srli_encode_fns[] = {
-  Opcode_srli_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+srli_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000014 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_memw_encode_fns[] = {
-  Opcode_memw_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ssa8b_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000304 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_extw_encode_fns[] = {
-  Opcode_extw_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ssa8l_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000204 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_isync_encode_fns[] = {
-  Opcode_isync_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ssai_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000404 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsync_encode_fns[] = {
-  Opcode_rsync_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ssl_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000104 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_esync_encode_fns[] = {
-  Opcode_esync_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+ssr_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000004 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_dsync_encode_fns[] = {
-  Opcode_dsync_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+sub_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000000c };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsil_encode_fns[] = {
-  Opcode_rsil_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+subx2_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000000d };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsr_lend_encode_fns[] = {
-  Opcode_rsr_lend_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+subx4_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000000e };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_wsr_lend_encode_fns[] = {
-  Opcode_wsr_lend_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+subx8_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x0000000f };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_xsr_lend_encode_fns[] = {
-  Opcode_xsr_lend_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+syscall_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000500 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsr_lcount_encode_fns[] = {
-  Opcode_rsr_lcount_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+waiti_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000700 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_wsr_lcount_encode_fns[] = {
-  Opcode_wsr_lcount_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+wdtlb_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000e05 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_xsr_lcount_encode_fns[] = {
-  Opcode_xsr_lcount_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+witlb_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000605 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsr_lbeg_encode_fns[] = {
-  Opcode_rsr_lbeg_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+wsr_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000031 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_wsr_lbeg_encode_fns[] = {
-  Opcode_wsr_lbeg_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+xor_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000003 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_xsr_lbeg_encode_fns[] = {
-  Opcode_xsr_lbeg_Slot_inst_encode, 0, 0
-};
+static xtensa_insnbuf
+xsr_template (void)
+{
+  static xtensa_insnbuf_word template[] = { 0x00000016 };
+  return &template[0];
+}
 
-xtensa_opcode_encode_fn Opcode_rsr_sar_encode_fns[] = {
-  Opcode_rsr_sar_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal abs_opcode = {
+  "abs",
+  3,
+  abs_template,
+  &neg_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_sar_encode_fns[] = {
-  Opcode_wsr_sar_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal add_opcode = {
+  "add",
+  3,
+  add_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_sar_encode_fns[] = {
-  Opcode_xsr_sar_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal add_n_opcode = {
+  "add.n",
+  2,
+  add_n_template,
+  &add_n_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_litbase_encode_fns[] = {
-  Opcode_rsr_litbase_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addi_opcode = {
+  "addi",
+  3,
+  addi_template,
+  &addi_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_litbase_encode_fns[] = {
-  Opcode_wsr_litbase_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addi_n_opcode = {
+  "addi.n",
+  2,
+  addi_n_template,
+  &addi_n_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_litbase_encode_fns[] = {
-  Opcode_xsr_litbase_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addmi_opcode = {
+  "addmi",
+  3,
+  addmi_template,
+  &addmi_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_176_encode_fns[] = {
-  Opcode_rsr_176_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addx2_opcode = {
+  "addx2",
+  3,
+  addx2_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_208_encode_fns[] = {
-  Opcode_rsr_208_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addx4_opcode = {
+  "addx4",
+  3,
+  addx4_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ps_encode_fns[] = {
-  Opcode_rsr_ps_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal addx8_opcode = {
+  "addx8",
+  3,
+  addx8_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ps_encode_fns[] = {
-  Opcode_wsr_ps_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal and_opcode = {
+  "and",
+  3,
+  and_template,
+  &bit_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ps_encode_fns[] = {
-  Opcode_xsr_ps_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ball_opcode = {
+  "ball",
+  3,
+  ball_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_epc1_encode_fns[] = {
-  Opcode_rsr_epc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bany_opcode = {
+  "bany",
+  3,
+  bany_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_epc1_encode_fns[] = {
-  Opcode_wsr_epc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bbc_opcode = {
+  "bbc",
+  3,
+  bbc_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_epc1_encode_fns[] = {
-  Opcode_xsr_epc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bbci_opcode = {
+  "bbci",
+  3,
+  bbci_template,
+  &bsi8b_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_excsave1_encode_fns[] = {
-  Opcode_rsr_excsave1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bbs_opcode = {
+  "bbs",
+  3,
+  bbs_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_excsave1_encode_fns[] = {
-  Opcode_wsr_excsave1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bbsi_opcode = {
+  "bbsi",
+  3,
+  bbsi_template,
+  &bsi8b_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_excsave1_encode_fns[] = {
-  Opcode_xsr_excsave1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal beq_opcode = {
+  "beq",
+  3,
+  beq_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_epc2_encode_fns[] = {
-  Opcode_rsr_epc2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal beqi_opcode = {
+  "beqi",
+  3,
+  beqi_template,
+  &bsi8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_epc2_encode_fns[] = {
-  Opcode_wsr_epc2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal beqz_opcode = {
+  "beqz",
+  3,
+  beqz_template,
+  &bsz12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_epc2_encode_fns[] = {
-  Opcode_xsr_epc2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal beqz_n_opcode = {
+  "beqz.n",
+  2,
+  beqz_n_template,
+  &bz6_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_excsave2_encode_fns[] = {
-  Opcode_rsr_excsave2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bge_opcode = {
+  "bge",
+  3,
+  bge_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_excsave2_encode_fns[] = {
-  Opcode_wsr_excsave2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bgei_opcode = {
+  "bgei",
+  3,
+  bgei_template,
+  &bsi8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_excsave2_encode_fns[] = {
-  Opcode_xsr_excsave2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bgeu_opcode = {
+  "bgeu",
+  3,
+  bgeu_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_epc3_encode_fns[] = {
-  Opcode_rsr_epc3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bgeui_opcode = {
+  "bgeui",
+  3,
+  bgeui_template,
+  &bsi8u_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_epc3_encode_fns[] = {
-  Opcode_wsr_epc3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bgez_opcode = {
+  "bgez",
+  3,
+  bgez_template,
+  &bsz12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_epc3_encode_fns[] = {
-  Opcode_xsr_epc3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal blt_opcode = {
+  "blt",
+  3,
+  blt_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_excsave3_encode_fns[] = {
-  Opcode_rsr_excsave3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal blti_opcode = {
+  "blti",
+  3,
+  blti_template,
+  &bsi8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_excsave3_encode_fns[] = {
-  Opcode_wsr_excsave3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bltu_opcode = {
+  "bltu",
+  3,
+  bltu_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_excsave3_encode_fns[] = {
-  Opcode_xsr_excsave3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bltui_opcode = {
+  "bltui",
+  3,
+  bltui_template,
+  &bsi8u_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_epc4_encode_fns[] = {
-  Opcode_rsr_epc4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bltz_opcode = {
+  "bltz",
+  3,
+  bltz_template,
+  &bsz12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_epc4_encode_fns[] = {
-  Opcode_wsr_epc4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bnall_opcode = {
+  "bnall",
+  3,
+  bnall_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_epc4_encode_fns[] = {
-  Opcode_xsr_epc4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bne_opcode = {
+  "bne",
+  3,
+  bne_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_excsave4_encode_fns[] = {
-  Opcode_rsr_excsave4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bnei_opcode = {
+  "bnei",
+  3,
+  bnei_template,
+  &bsi8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_excsave4_encode_fns[] = {
-  Opcode_wsr_excsave4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bnez_opcode = {
+  "bnez",
+  3,
+  bnez_template,
+  &bsz12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_excsave4_encode_fns[] = {
-  Opcode_xsr_excsave4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bnez_n_opcode = {
+  "bnez.n",
+  2,
+  bnez_n_template,
+  &bz6_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_eps2_encode_fns[] = {
-  Opcode_rsr_eps2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal bnone_opcode = {
+  "bnone",
+  3,
+  bnone_template,
+  &bst8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_eps2_encode_fns[] = {
-  Opcode_wsr_eps2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal break_opcode = {
+  "break",
+  3,
+  break_template,
+  &break_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_eps2_encode_fns[] = {
-  Opcode_xsr_eps2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal break_n_opcode = {
+  "break.n",
+  2,
+  break_n_template,
+  &break_n_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_eps3_encode_fns[] = {
-  Opcode_rsr_eps3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal call0_opcode = {
+  "call0",
+  3,
+  call0_template,
+  &call_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_eps3_encode_fns[] = {
-  Opcode_wsr_eps3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal call12_opcode = {
+  "call12",
+  3,
+  call12_template,
+  &call12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_eps3_encode_fns[] = {
-  Opcode_xsr_eps3_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal call4_opcode = {
+  "call4",
+  3,
+  call4_template,
+  &call4_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_eps4_encode_fns[] = {
-  Opcode_rsr_eps4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal call8_opcode = {
+  "call8",
+  3,
+  call8_template,
+  &call8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_eps4_encode_fns[] = {
-  Opcode_wsr_eps4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal callx0_opcode = {
+  "callx0",
+  3,
+  callx0_template,
+  &callx_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_eps4_encode_fns[] = {
-  Opcode_xsr_eps4_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal callx12_opcode = {
+  "callx12",
+  3,
+  callx12_template,
+  &callx12_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_excvaddr_encode_fns[] = {
-  Opcode_rsr_excvaddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal callx4_opcode = {
+  "callx4",
+  3,
+  callx4_template,
+  &callx4_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_excvaddr_encode_fns[] = {
-  Opcode_wsr_excvaddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal callx8_opcode = {
+  "callx8",
+  3,
+  callx8_template,
+  &callx8_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_excvaddr_encode_fns[] = {
-  Opcode_xsr_excvaddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dhi_opcode = {
+  "dhi",
+  3,
+  dhi_template,
+  &dcache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_depc_encode_fns[] = {
-  Opcode_rsr_depc_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dhwb_opcode = {
+  "dhwb",
+  3,
+  dhwb_template,
+  &dcache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_depc_encode_fns[] = {
-  Opcode_wsr_depc_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dhwbi_opcode = {
+  "dhwbi",
+  3,
+  dhwbi_template,
+  &dcache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_depc_encode_fns[] = {
-  Opcode_xsr_depc_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dii_opcode = {
+  "dii",
+  3,
+  dii_template,
+  &dcache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_exccause_encode_fns[] = {
-  Opcode_rsr_exccause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal diwb_opcode = {
+  "diwb",
+  3,
+  diwb_template,
+  &dce_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_exccause_encode_fns[] = {
-  Opcode_wsr_exccause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal diwbi_opcode = {
+  "diwbi",
+  3,
+  diwbi_template,
+  &dce_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_exccause_encode_fns[] = {
-  Opcode_xsr_exccause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dpfr_opcode = {
+  "dpfr",
+  3,
+  dpfr_template,
+  &dpf_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_misc0_encode_fns[] = {
-  Opcode_rsr_misc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dpfro_opcode = {
+  "dpfro",
+  3,
+  dpfro_template,
+  &dpf_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_misc0_encode_fns[] = {
-  Opcode_wsr_misc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dpfw_opcode = {
+  "dpfw",
+  3,
+  dpfw_template,
+  &dpf_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_misc0_encode_fns[] = {
-  Opcode_xsr_misc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dpfwo_opcode = {
+  "dpfwo",
+  3,
+  dpfwo_template,
+  &dpf_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_misc1_encode_fns[] = {
-  Opcode_rsr_misc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal dsync_opcode = {
+  "dsync",
+  3,
+  dsync_template,
+  &sync_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_misc1_encode_fns[] = {
-  Opcode_wsr_misc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal entry_opcode = {
+  "entry",
+  3,
+  entry_template,
+  &entry_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_misc1_encode_fns[] = {
-  Opcode_xsr_misc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal esync_opcode = {
+  "esync",
+  3,
+  esync_template,
+  &sync_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_prid_encode_fns[] = {
-  Opcode_rsr_prid_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal excw_opcode = {
+  "excw",
+  3,
+  excw_template,
+  &excw_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rfi_encode_fns[] = {
-  Opcode_rfi_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal extui_opcode = {
+  "extui",
+  3,
+  extui_template,
+  &exti_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_waiti_encode_fns[] = {
-  Opcode_waiti_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal idtlb_opcode = {
+  "idtlb",
+  3,
+  idtlb_template,
+  &itlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_interrupt_encode_fns[] = {
-  Opcode_rsr_interrupt_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal idtlba_opcode = {
+  "idtlba",
+  3,
+  idtlba_template,
+  &itlba_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_intset_encode_fns[] = {
-  Opcode_wsr_intset_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ihi_opcode = {
+  "ihi",
+  3,
+  ihi_template,
+  &icache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_intclear_encode_fns[] = {
-  Opcode_wsr_intclear_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal iii_opcode = {
+  "iii",
+  3,
+  iii_template,
+  &icache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_intenable_encode_fns[] = {
-  Opcode_rsr_intenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal iitlb_opcode = {
+  "iitlb",
+  3,
+  iitlb_template,
+  &itlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_intenable_encode_fns[] = {
-  Opcode_wsr_intenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal iitlba_opcode = {
+  "iitlba",
+  3,
+  iitlba_template,
+  &itlba_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_intenable_encode_fns[] = {
-  Opcode_xsr_intenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ipf_opcode = {
+  "ipf",
+  3,
+  ipf_template,
+  &icache_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_break_encode_fns[] = {
-  Opcode_break_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal isync_opcode = {
+  "isync",
+  3,
+  isync_template,
+  &sync_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_break_n_encode_fns[] = {
-  0, 0, Opcode_break_n_Slot_inst16b_encode
+static xtensa_opcode_internal j_opcode = {
+  "j",
+  3,
+  j_template,
+  &jump_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_dbreaka0_encode_fns[] = {
-  Opcode_rsr_dbreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal jx_opcode = {
+  "jx",
+  3,
+  jx_template,
+  &jumpx_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_dbreaka0_encode_fns[] = {
-  Opcode_wsr_dbreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l16si_opcode = {
+  "l16si",
+  3,
+  l16si_template,
+  &l16i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_dbreaka0_encode_fns[] = {
-  Opcode_xsr_dbreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l16ui_opcode = {
+  "l16ui",
+  3,
+  l16ui_template,
+  &l16i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_dbreakc0_encode_fns[] = {
-  Opcode_rsr_dbreakc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l32e_opcode = {
+  "l32e",
+  3,
+  l32e_template,
+  &l32e_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_dbreakc0_encode_fns[] = {
-  Opcode_wsr_dbreakc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l32i_opcode = {
+  "l32i",
+  3,
+  l32i_template,
+  &l32i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_dbreakc0_encode_fns[] = {
-  Opcode_xsr_dbreakc0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l32i_n_opcode = {
+  "l32i.n",
+  2,
+  l32i_n_template,
+  &loadi4_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_dbreaka1_encode_fns[] = {
-  Opcode_rsr_dbreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l32r_opcode = {
+  "l32r",
+  3,
+  l32r_template,
+  &l32r_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_dbreaka1_encode_fns[] = {
-  Opcode_wsr_dbreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal l8ui_opcode = {
+  "l8ui",
+  3,
+  l8ui_template,
+  &l8i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_dbreaka1_encode_fns[] = {
-  Opcode_xsr_dbreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ldct_opcode = {
+  "ldct",
+  3,
+  ldct_template,
+  &actl_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_dbreakc1_encode_fns[] = {
-  Opcode_rsr_dbreakc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal lict_opcode = {
+  "lict",
+  3,
+  lict_template,
+  &actl_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_dbreakc1_encode_fns[] = {
-  Opcode_wsr_dbreakc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal licw_opcode = {
+  "licw",
+  3,
+  licw_template,
+  &actl_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_dbreakc1_encode_fns[] = {
-  Opcode_xsr_dbreakc1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal loop_opcode = {
+  "loop",
+  3,
+  loop_template,
+  &loop_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ibreaka0_encode_fns[] = {
-  Opcode_rsr_ibreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal loopgtz_opcode = {
+  "loopgtz",
+  3,
+  loopgtz_template,
+  &loop_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ibreaka0_encode_fns[] = {
-  Opcode_wsr_ibreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal loopnez_opcode = {
+  "loopnez",
+  3,
+  loopnez_template,
+  &loop_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ibreaka0_encode_fns[] = {
-  Opcode_xsr_ibreaka0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal memw_opcode = {
+  "memw",
+  3,
+  memw_template,
+  &sync_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ibreaka1_encode_fns[] = {
-  Opcode_rsr_ibreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal mov_n_opcode = {
+  "mov.n",
+  2,
+  mov_n_template,
+  &mov_n_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ibreaka1_encode_fns[] = {
-  Opcode_wsr_ibreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal moveqz_opcode = {
+  "moveqz",
+  3,
+  moveqz_template,
+  &movz_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ibreaka1_encode_fns[] = {
-  Opcode_xsr_ibreaka1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movgez_opcode = {
+  "movgez",
+  3,
+  movgez_template,
+  &movz_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ibreakenable_encode_fns[] = {
-  Opcode_rsr_ibreakenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movi_opcode = {
+  "movi",
+  3,
+  movi_template,
+  &movi_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ibreakenable_encode_fns[] = {
-  Opcode_wsr_ibreakenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movi_n_opcode = {
+  "movi.n",
+  2,
+  movi_n_template,
+  &movi_n_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ibreakenable_encode_fns[] = {
-  Opcode_xsr_ibreakenable_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movltz_opcode = {
+  "movltz",
+  3,
+  movltz_template,
+  &movz_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_debugcause_encode_fns[] = {
-  Opcode_rsr_debugcause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movnez_opcode = {
+  "movnez",
+  3,
+  movnez_template,
+  &movz_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_debugcause_encode_fns[] = {
-  Opcode_wsr_debugcause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal movsp_opcode = {
+  "movsp",
+  3,
+  movsp_template,
+  &movsp_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_debugcause_encode_fns[] = {
-  Opcode_xsr_debugcause_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal neg_opcode = {
+  "neg",
+  3,
+  neg_template,
+  &neg_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_icount_encode_fns[] = {
-  Opcode_rsr_icount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal nop_n_opcode = {
+  "nop.n",
+  2,
+  nop_n_template,
+  &nopn_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_icount_encode_fns[] = {
-  Opcode_wsr_icount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal nsa_opcode = {
+  "nsa",
+  3,
+  nsa_template,
+  &nsa_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_icount_encode_fns[] = {
-  Opcode_xsr_icount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal nsau_opcode = {
+  "nsau",
+  3,
+  nsau_template,
+  &nsa_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_icountlevel_encode_fns[] = {
-  Opcode_rsr_icountlevel_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal or_opcode = {
+  "or",
+  3,
+  or_template,
+  &bit_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_icountlevel_encode_fns[] = {
-  Opcode_wsr_icountlevel_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal pdtlb_opcode = {
+  "pdtlb",
+  3,
+  pdtlb_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_icountlevel_encode_fns[] = {
-  Opcode_xsr_icountlevel_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal pitlb_opcode = {
+  "pitlb",
+  3,
+  pitlb_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ddr_encode_fns[] = {
-  Opcode_rsr_ddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rdtlb0_opcode = {
+  "rdtlb0",
+  3,
+  rdtlb0_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ddr_encode_fns[] = {
-  Opcode_wsr_ddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rdtlb1_opcode = {
+  "rdtlb1",
+  3,
+  rdtlb1_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ddr_encode_fns[] = {
-  Opcode_xsr_ddr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ret_opcode = {
+  "ret",
+  3,
+  ret_template,
+  &return_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rfdo_encode_fns[] = {
-  Opcode_rfdo_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ret_n_opcode = {
+  "ret.n",
+  2,
+  ret_n_template,
+  &retn_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rfdd_encode_fns[] = {
-  Opcode_rfdd_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal retw_opcode = {
+  "retw",
+  3,
+  retw_template,
+  &return_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ccount_encode_fns[] = {
-  Opcode_rsr_ccount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal retw_n_opcode = {
+  "retw.n",
+  2,
+  retw_n_template,
+  &retn_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ccount_encode_fns[] = {
-  Opcode_wsr_ccount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rfde_opcode = {
+  "rfde",
+  3,
+  rfde_template,
+  &rfe_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ccount_encode_fns[] = {
-  Opcode_xsr_ccount_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rfe_opcode = {
+  "rfe",
+  3,
+  rfe_template,
+  &rfe_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ccompare0_encode_fns[] = {
-  Opcode_rsr_ccompare0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rfi_opcode = {
+  "rfi",
+  3,
+  rfi_template,
+  &rfi_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ccompare0_encode_fns[] = {
-  Opcode_wsr_ccompare0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rfwo_opcode = {
+  "rfwo",
+  3,
+  rfwo_template,
+  &rfe_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ccompare0_encode_fns[] = {
-  Opcode_xsr_ccompare0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rfwu_opcode = {
+  "rfwu",
+  3,
+  rfwu_template,
+  &rfe_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ccompare1_encode_fns[] = {
-  Opcode_rsr_ccompare1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ritlb0_opcode = {
+  "ritlb0",
+  3,
+  ritlb0_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ccompare1_encode_fns[] = {
-  Opcode_wsr_ccompare1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ritlb1_opcode = {
+  "ritlb1",
+  3,
+  ritlb1_template,
+  &rtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ccompare1_encode_fns[] = {
-  Opcode_xsr_ccompare1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rotw_opcode = {
+  "rotw",
+  3,
+  rotw_template,
+  &rotw_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rsr_ccompare2_encode_fns[] = {
-  Opcode_rsr_ccompare2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rsil_opcode = {
+  "rsil",
+  3,
+  rsil_template,
+  &rsil_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wsr_ccompare2_encode_fns[] = {
-  Opcode_wsr_ccompare2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rsr_opcode = {
+  "rsr",
+  3,
+  rsr_template,
+  &rsr_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_xsr_ccompare2_encode_fns[] = {
-  Opcode_xsr_ccompare2_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal rsync_opcode = {
+  "rsync",
+  3,
+  rsync_template,
+  &sync_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_ipf_encode_fns[] = {
-  Opcode_ipf_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal s16i_opcode = {
+  "s16i",
+  3,
+  s16i_template,
+  &s16i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_ihi_encode_fns[] = {
-  Opcode_ihi_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal s32e_opcode = {
+  "s32e",
+  3,
+  s32e_template,
+  &s32e_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_iii_encode_fns[] = {
-  Opcode_iii_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal s32i_opcode = {
+  "s32i",
+  3,
+  s32i_template,
+  &s32i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_lict_encode_fns[] = {
-  Opcode_lict_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal s32i_n_opcode = {
+  "s32i.n",
+  2,
+  s32i_n_template,
+  &storei4_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_licw_encode_fns[] = {
-  Opcode_licw_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal s8i_opcode = {
+  "s8i",
+  3,
+  s8i_template,
+  &s8i_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_sict_encode_fns[] = {
-  Opcode_sict_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sdct_opcode = {
+  "sdct",
+  3,
+  sdct_template,
+  &acts_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_sicw_encode_fns[] = {
-  Opcode_sicw_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sict_opcode = {
+  "sict",
+  3,
+  sict_template,
+  &acts_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dhwb_encode_fns[] = {
-  Opcode_dhwb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sicw_opcode = {
+  "sicw",
+  3,
+  sicw_template,
+  &acts_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dhwbi_encode_fns[] = {
-  Opcode_dhwbi_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal simcall_opcode = {
+  "simcall",
+  3,
+  simcall_template,
+  &syscall_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_diwb_encode_fns[] = {
-  Opcode_diwb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sll_opcode = {
+  "sll",
+  3,
+  sll_template,
+  &shifts_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_diwbi_encode_fns[] = {
-  Opcode_diwbi_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal slli_opcode = {
+  "slli",
+  3,
+  slli_template,
+  &slli_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dhi_encode_fns[] = {
-  Opcode_dhi_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sra_opcode = {
+  "sra",
+  3,
+  sra_template,
+  &shiftt_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dii_encode_fns[] = {
-  Opcode_dii_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal srai_opcode = {
+  "srai",
+  3,
+  srai_template,
+  &srai_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dpfr_encode_fns[] = {
-  Opcode_dpfr_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal src_opcode = {
+  "src",
+  3,
+  src_template,
+  &shiftst_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dpfw_encode_fns[] = {
-  Opcode_dpfw_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal srl_opcode = {
+  "srl",
+  3,
+  srl_template,
+  &shiftt_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dpfro_encode_fns[] = {
-  Opcode_dpfro_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal srli_opcode = {
+  "srli",
+  3,
+  srli_template,
+  &srli_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_dpfwo_encode_fns[] = {
-  Opcode_dpfwo_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ssa8b_opcode = {
+  "ssa8b",
+  3,
+  ssa8b_template,
+  &sar_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_sdct_encode_fns[] = {
-  Opcode_sdct_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ssa8l_opcode = {
+  "ssa8l",
+  3,
+  ssa8l_template,
+  &sar_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_ldct_encode_fns[] = {
-  Opcode_ldct_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ssai_opcode = {
+  "ssai",
+  3,
+  ssai_template,
+  &sari_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_idtlb_encode_fns[] = {
-  Opcode_idtlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ssl_opcode = {
+  "ssl",
+  3,
+  ssl_template,
+  &sar_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_pdtlb_encode_fns[] = {
-  Opcode_pdtlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal ssr_opcode = {
+  "ssr",
+  3,
+  ssr_template,
+  &sar_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rdtlb0_encode_fns[] = {
-  Opcode_rdtlb0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal sub_opcode = {
+  "sub",
+  3,
+  sub_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_rdtlb1_encode_fns[] = {
-  Opcode_rdtlb1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal subx2_opcode = {
+  "subx2",
+  3,
+  subx2_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_wdtlb_encode_fns[] = {
-  Opcode_wdtlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal subx4_opcode = {
+  "subx4",
+  3,
+  subx4_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_iitlb_encode_fns[] = {
-  Opcode_iitlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal subx8_opcode = {
+  "subx8",
+  3,
+  subx8_template,
+  &addsub_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_pitlb_encode_fns[] = {
-  Opcode_pitlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal syscall_opcode = {
+  "syscall",
+  3,
+  syscall_template,
+  &syscall_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_ritlb0_encode_fns[] = {
-  Opcode_ritlb0_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal waiti_opcode = {
+  "waiti",
+  3,
+  waiti_template,
+  &wait_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_ritlb1_encode_fns[] = {
-  Opcode_ritlb1_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal wdtlb_opcode = {
+  "wdtlb",
+  3,
+  wdtlb_template,
+  &wtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_witlb_encode_fns[] = {
-  Opcode_witlb_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal witlb_opcode = {
+  "witlb",
+  3,
+  witlb_template,
+  &wtlb_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_nsa_encode_fns[] = {
-  Opcode_nsa_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal wsr_opcode = {
+  "wsr",
+  3,
+  wsr_template,
+  &wsr_iclass
 };
 
-xtensa_opcode_encode_fn Opcode_nsau_encode_fns[] = {
-  Opcode_nsau_Slot_inst_encode, 0, 0
+static xtensa_opcode_internal xor_opcode = {
+  "xor",
+  3,
+  xor_template,
+  &bit_iclass
 };
 
-\f
-/* Opcode table.  */
-
-static xtensa_opcode_internal opcodes[] = {
-  { "excw", 0 /* xt_iclass_excw */,
-    0,
-    Opcode_excw_encode_fns, 0, 0 },
-  { "rfe", 1 /* xt_iclass_rfe */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfe_encode_fns, 0, 0 },
-  { "rfde", 2 /* xt_iclass_rfde */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfde_encode_fns, 0, 0 },
-  { "syscall", 3 /* xt_iclass_syscall */,
-    0,
-    Opcode_syscall_encode_fns, 0, 0 },
-  { "simcall", 4 /* xt_iclass_simcall */,
-    0,
-    Opcode_simcall_encode_fns, 0, 0 },
-  { "call12", 5 /* xt_iclass_call12 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_call12_encode_fns, 0, 0 },
-  { "call8", 6 /* xt_iclass_call8 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_call8_encode_fns, 0, 0 },
-  { "call4", 7 /* xt_iclass_call4 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_call4_encode_fns, 0, 0 },
-  { "callx12", 8 /* xt_iclass_callx12 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_callx12_encode_fns, 0, 0 },
-  { "callx8", 9 /* xt_iclass_callx8 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_callx8_encode_fns, 0, 0 },
-  { "callx4", 10 /* xt_iclass_callx4 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_callx4_encode_fns, 0, 0 },
-  { "entry", 11 /* xt_iclass_entry */,
-    0,
-    Opcode_entry_encode_fns, 0, 0 },
-  { "movsp", 12 /* xt_iclass_movsp */,
-    0,
-    Opcode_movsp_encode_fns, 0, 0 },
-  { "rotw", 13 /* xt_iclass_rotw */,
-    0,
-    Opcode_rotw_encode_fns, 0, 0 },
-  { "retw", 14 /* xt_iclass_retw */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_retw_encode_fns, 0, 0 },
-  { "retw.n", 14 /* xt_iclass_retw */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_retw_n_encode_fns, 0, 0 },
-  { "rfwo", 15 /* xt_iclass_rfwou */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfwo_encode_fns, 0, 0 },
-  { "rfwu", 15 /* xt_iclass_rfwou */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfwu_encode_fns, 0, 0 },
-  { "l32e", 16 /* xt_iclass_l32e */,
-    0,
-    Opcode_l32e_encode_fns, 0, 0 },
-  { "s32e", 17 /* xt_iclass_s32e */,
-    0,
-    Opcode_s32e_encode_fns, 0, 0 },
-  { "rsr.windowbase", 18 /* xt_iclass_rsr.windowbase */,
-    0,
-    Opcode_rsr_windowbase_encode_fns, 0, 0 },
-  { "wsr.windowbase", 19 /* xt_iclass_wsr.windowbase */,
-    0,
-    Opcode_wsr_windowbase_encode_fns, 0, 0 },
-  { "xsr.windowbase", 20 /* xt_iclass_xsr.windowbase */,
-    0,
-    Opcode_xsr_windowbase_encode_fns, 0, 0 },
-  { "rsr.windowstart", 21 /* xt_iclass_rsr.windowstart */,
-    0,
-    Opcode_rsr_windowstart_encode_fns, 0, 0 },
-  { "wsr.windowstart", 22 /* xt_iclass_wsr.windowstart */,
-    0,
-    Opcode_wsr_windowstart_encode_fns, 0, 0 },
-  { "xsr.windowstart", 23 /* xt_iclass_xsr.windowstart */,
-    0,
-    Opcode_xsr_windowstart_encode_fns, 0, 0 },
-  { "add.n", 24 /* xt_iclass_add.n */,
-    0,
-    Opcode_add_n_encode_fns, 0, 0 },
-  { "addi.n", 25 /* xt_iclass_addi.n */,
-    0,
-    Opcode_addi_n_encode_fns, 0, 0 },
-  { "beqz.n", 26 /* xt_iclass_bz6 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_beqz_n_encode_fns, 0, 0 },
-  { "bnez.n", 26 /* xt_iclass_bz6 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bnez_n_encode_fns, 0, 0 },
-  { "ill.n", 27 /* xt_iclass_ill.n */,
-    0,
-    Opcode_ill_n_encode_fns, 0, 0 },
-  { "l32i.n", 28 /* xt_iclass_loadi4 */,
-    0,
-    Opcode_l32i_n_encode_fns, 0, 0 },
-  { "mov.n", 29 /* xt_iclass_mov.n */,
-    0,
-    Opcode_mov_n_encode_fns, 0, 0 },
-  { "movi.n", 30 /* xt_iclass_movi.n */,
-    0,
-    Opcode_movi_n_encode_fns, 0, 0 },
-  { "nop.n", 31 /* xt_iclass_nopn */,
-    0,
-    Opcode_nop_n_encode_fns, 0, 0 },
-  { "ret.n", 32 /* xt_iclass_retn */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_ret_n_encode_fns, 0, 0 },
-  { "s32i.n", 33 /* xt_iclass_storei4 */,
-    0,
-    Opcode_s32i_n_encode_fns, 0, 0 },
-  { "addi", 34 /* xt_iclass_addi */,
-    0,
-    Opcode_addi_encode_fns, 0, 0 },
-  { "addmi", 35 /* xt_iclass_addmi */,
-    0,
-    Opcode_addmi_encode_fns, 0, 0 },
-  { "add", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_add_encode_fns, 0, 0 },
-  { "sub", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_sub_encode_fns, 0, 0 },
-  { "addx2", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_addx2_encode_fns, 0, 0 },
-  { "addx4", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_addx4_encode_fns, 0, 0 },
-  { "addx8", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_addx8_encode_fns, 0, 0 },
-  { "subx2", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_subx2_encode_fns, 0, 0 },
-  { "subx4", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_subx4_encode_fns, 0, 0 },
-  { "subx8", 36 /* xt_iclass_addsub */,
-    0,
-    Opcode_subx8_encode_fns, 0, 0 },
-  { "and", 37 /* xt_iclass_bit */,
-    0,
-    Opcode_and_encode_fns, 0, 0 },
-  { "or", 37 /* xt_iclass_bit */,
-    0,
-    Opcode_or_encode_fns, 0, 0 },
-  { "xor", 37 /* xt_iclass_bit */,
-    0,
-    Opcode_xor_encode_fns, 0, 0 },
-  { "beqi", 38 /* xt_iclass_bsi8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_beqi_encode_fns, 0, 0 },
-  { "bnei", 38 /* xt_iclass_bsi8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bnei_encode_fns, 0, 0 },
-  { "bgei", 38 /* xt_iclass_bsi8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bgei_encode_fns, 0, 0 },
-  { "blti", 38 /* xt_iclass_bsi8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_blti_encode_fns, 0, 0 },
-  { "bbci", 39 /* xt_iclass_bsi8b */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bbci_encode_fns, 0, 0 },
-  { "bbsi", 39 /* xt_iclass_bsi8b */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bbsi_encode_fns, 0, 0 },
-  { "bgeui", 40 /* xt_iclass_bsi8u */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bgeui_encode_fns, 0, 0 },
-  { "bltui", 40 /* xt_iclass_bsi8u */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bltui_encode_fns, 0, 0 },
-  { "beq", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_beq_encode_fns, 0, 0 },
-  { "bne", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bne_encode_fns, 0, 0 },
-  { "bge", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bge_encode_fns, 0, 0 },
-  { "blt", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_blt_encode_fns, 0, 0 },
-  { "bgeu", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bgeu_encode_fns, 0, 0 },
-  { "bltu", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bltu_encode_fns, 0, 0 },
-  { "bany", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bany_encode_fns, 0, 0 },
-  { "bnone", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bnone_encode_fns, 0, 0 },
-  { "ball", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_ball_encode_fns, 0, 0 },
-  { "bnall", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bnall_encode_fns, 0, 0 },
-  { "bbc", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bbc_encode_fns, 0, 0 },
-  { "bbs", 41 /* xt_iclass_bst8 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bbs_encode_fns, 0, 0 },
-  { "beqz", 42 /* xt_iclass_bsz12 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_beqz_encode_fns, 0, 0 },
-  { "bnez", 42 /* xt_iclass_bsz12 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bnez_encode_fns, 0, 0 },
-  { "bgez", 42 /* xt_iclass_bsz12 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bgez_encode_fns, 0, 0 },
-  { "bltz", 42 /* xt_iclass_bsz12 */,
-    XTENSA_OPCODE_IS_BRANCH,
-    Opcode_bltz_encode_fns, 0, 0 },
-  { "call0", 43 /* xt_iclass_call0 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_call0_encode_fns, 0, 0 },
-  { "callx0", 44 /* xt_iclass_callx0 */,
-    XTENSA_OPCODE_IS_CALL,
-    Opcode_callx0_encode_fns, 0, 0 },
-  { "extui", 45 /* xt_iclass_exti */,
-    0,
-    Opcode_extui_encode_fns, 0, 0 },
-  { "ill", 46 /* xt_iclass_ill */,
-    0,
-    Opcode_ill_encode_fns, 0, 0 },
-  { "j", 47 /* xt_iclass_jump */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_j_encode_fns, 0, 0 },
-  { "jx", 48 /* xt_iclass_jumpx */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_jx_encode_fns, 0, 0 },
-  { "l16ui", 49 /* xt_iclass_l16ui */,
-    0,
-    Opcode_l16ui_encode_fns, 0, 0 },
-  { "l16si", 50 /* xt_iclass_l16si */,
-    0,
-    Opcode_l16si_encode_fns, 0, 0 },
-  { "l32i", 51 /* xt_iclass_l32i */,
-    0,
-    Opcode_l32i_encode_fns, 0, 0 },
-  { "l32r", 52 /* xt_iclass_l32r */,
-    0,
-    Opcode_l32r_encode_fns, 0, 0 },
-  { "l8ui", 53 /* xt_iclass_l8i */,
-    0,
-    Opcode_l8ui_encode_fns, 0, 0 },
-  { "loop", 54 /* xt_iclass_loop */,
-    XTENSA_OPCODE_IS_LOOP,
-    Opcode_loop_encode_fns, 0, 0 },
-  { "loopnez", 55 /* xt_iclass_loopz */,
-    XTENSA_OPCODE_IS_LOOP,
-    Opcode_loopnez_encode_fns, 0, 0 },
-  { "loopgtz", 55 /* xt_iclass_loopz */,
-    XTENSA_OPCODE_IS_LOOP,
-    Opcode_loopgtz_encode_fns, 0, 0 },
-  { "movi", 56 /* xt_iclass_movi */,
-    0,
-    Opcode_movi_encode_fns, 0, 0 },
-  { "moveqz", 57 /* xt_iclass_movz */,
-    0,
-    Opcode_moveqz_encode_fns, 0, 0 },
-  { "movnez", 57 /* xt_iclass_movz */,
-    0,
-    Opcode_movnez_encode_fns, 0, 0 },
-  { "movltz", 57 /* xt_iclass_movz */,
-    0,
-    Opcode_movltz_encode_fns, 0, 0 },
-  { "movgez", 57 /* xt_iclass_movz */,
-    0,
-    Opcode_movgez_encode_fns, 0, 0 },
-  { "neg", 58 /* xt_iclass_neg */,
-    0,
-    Opcode_neg_encode_fns, 0, 0 },
-  { "abs", 58 /* xt_iclass_neg */,
-    0,
-    Opcode_abs_encode_fns, 0, 0 },
-  { "nop", 59 /* xt_iclass_nop */,
-    0,
-    Opcode_nop_encode_fns, 0, 0 },
-  { "ret", 60 /* xt_iclass_return */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_ret_encode_fns, 0, 0 },
-  { "s16i", 61 /* xt_iclass_s16i */,
-    0,
-    Opcode_s16i_encode_fns, 0, 0 },
-  { "s32i", 62 /* xt_iclass_s32i */,
-    0,
-    Opcode_s32i_encode_fns, 0, 0 },
-  { "s8i", 63 /* xt_iclass_s8i */,
-    0,
-    Opcode_s8i_encode_fns, 0, 0 },
-  { "ssr", 64 /* xt_iclass_sar */,
-    0,
-    Opcode_ssr_encode_fns, 0, 0 },
-  { "ssl", 64 /* xt_iclass_sar */,
-    0,
-    Opcode_ssl_encode_fns, 0, 0 },
-  { "ssa8l", 64 /* xt_iclass_sar */,
-    0,
-    Opcode_ssa8l_encode_fns, 0, 0 },
-  { "ssa8b", 64 /* xt_iclass_sar */,
-    0,
-    Opcode_ssa8b_encode_fns, 0, 0 },
-  { "ssai", 65 /* xt_iclass_sari */,
-    0,
-    Opcode_ssai_encode_fns, 0, 0 },
-  { "sll", 66 /* xt_iclass_shifts */,
-    0,
-    Opcode_sll_encode_fns, 0, 0 },
-  { "src", 67 /* xt_iclass_shiftst */,
-    0,
-    Opcode_src_encode_fns, 0, 0 },
-  { "srl", 68 /* xt_iclass_shiftt */,
-    0,
-    Opcode_srl_encode_fns, 0, 0 },
-  { "sra", 68 /* xt_iclass_shiftt */,
-    0,
-    Opcode_sra_encode_fns, 0, 0 },
-  { "slli", 69 /* xt_iclass_slli */,
-    0,
-    Opcode_slli_encode_fns, 0, 0 },
-  { "srai", 70 /* xt_iclass_srai */,
-    0,
-    Opcode_srai_encode_fns, 0, 0 },
-  { "srli", 71 /* xt_iclass_srli */,
-    0,
-    Opcode_srli_encode_fns, 0, 0 },
-  { "memw", 72 /* xt_iclass_memw */,
-    0,
-    Opcode_memw_encode_fns, 0, 0 },
-  { "extw", 73 /* xt_iclass_extw */,
-    0,
-    Opcode_extw_encode_fns, 0, 0 },
-  { "isync", 74 /* xt_iclass_isync */,
-    0,
-    Opcode_isync_encode_fns, 0, 0 },
-  { "rsync", 75 /* xt_iclass_sync */,
-    0,
-    Opcode_rsync_encode_fns, 0, 0 },
-  { "esync", 75 /* xt_iclass_sync */,
-    0,
-    Opcode_esync_encode_fns, 0, 0 },
-  { "dsync", 75 /* xt_iclass_sync */,
-    0,
-    Opcode_dsync_encode_fns, 0, 0 },
-  { "rsil", 76 /* xt_iclass_rsil */,
-    0,
-    Opcode_rsil_encode_fns, 0, 0 },
-  { "rsr.lend", 77 /* xt_iclass_rsr.lend */,
-    0,
-    Opcode_rsr_lend_encode_fns, 0, 0 },
-  { "wsr.lend", 78 /* xt_iclass_wsr.lend */,
-    0,
-    Opcode_wsr_lend_encode_fns, 0, 0 },
-  { "xsr.lend", 79 /* xt_iclass_xsr.lend */,
-    0,
-    Opcode_xsr_lend_encode_fns, 0, 0 },
-  { "rsr.lcount", 80 /* xt_iclass_rsr.lcount */,
-    0,
-    Opcode_rsr_lcount_encode_fns, 0, 0 },
-  { "wsr.lcount", 81 /* xt_iclass_wsr.lcount */,
-    0,
-    Opcode_wsr_lcount_encode_fns, 0, 0 },
-  { "xsr.lcount", 82 /* xt_iclass_xsr.lcount */,
-    0,
-    Opcode_xsr_lcount_encode_fns, 0, 0 },
-  { "rsr.lbeg", 83 /* xt_iclass_rsr.lbeg */,
-    0,
-    Opcode_rsr_lbeg_encode_fns, 0, 0 },
-  { "wsr.lbeg", 84 /* xt_iclass_wsr.lbeg */,
-    0,
-    Opcode_wsr_lbeg_encode_fns, 0, 0 },
-  { "xsr.lbeg", 85 /* xt_iclass_xsr.lbeg */,
-    0,
-    Opcode_xsr_lbeg_encode_fns, 0, 0 },
-  { "rsr.sar", 86 /* xt_iclass_rsr.sar */,
-    0,
-    Opcode_rsr_sar_encode_fns, 0, 0 },
-  { "wsr.sar", 87 /* xt_iclass_wsr.sar */,
-    0,
-    Opcode_wsr_sar_encode_fns, 0, 0 },
-  { "xsr.sar", 88 /* xt_iclass_xsr.sar */,
-    0,
-    Opcode_xsr_sar_encode_fns, 0, 0 },
-  { "rsr.litbase", 89 /* xt_iclass_rsr.litbase */,
-    0,
-    Opcode_rsr_litbase_encode_fns, 0, 0 },
-  { "wsr.litbase", 90 /* xt_iclass_wsr.litbase */,
-    0,
-    Opcode_wsr_litbase_encode_fns, 0, 0 },
-  { "xsr.litbase", 91 /* xt_iclass_xsr.litbase */,
-    0,
-    Opcode_xsr_litbase_encode_fns, 0, 0 },
-  { "rsr.176", 92 /* xt_iclass_rsr.176 */,
-    0,
-    Opcode_rsr_176_encode_fns, 0, 0 },
-  { "rsr.208", 93 /* xt_iclass_rsr.208 */,
-    0,
-    Opcode_rsr_208_encode_fns, 0, 0 },
-  { "rsr.ps", 94 /* xt_iclass_rsr.ps */,
-    0,
-    Opcode_rsr_ps_encode_fns, 0, 0 },
-  { "wsr.ps", 95 /* xt_iclass_wsr.ps */,
-    0,
-    Opcode_wsr_ps_encode_fns, 0, 0 },
-  { "xsr.ps", 96 /* xt_iclass_xsr.ps */,
-    0,
-    Opcode_xsr_ps_encode_fns, 0, 0 },
-  { "rsr.epc1", 97 /* xt_iclass_rsr.epc1 */,
-    0,
-    Opcode_rsr_epc1_encode_fns, 0, 0 },
-  { "wsr.epc1", 98 /* xt_iclass_wsr.epc1 */,
-    0,
-    Opcode_wsr_epc1_encode_fns, 0, 0 },
-  { "xsr.epc1", 99 /* xt_iclass_xsr.epc1 */,
-    0,
-    Opcode_xsr_epc1_encode_fns, 0, 0 },
-  { "rsr.excsave1", 100 /* xt_iclass_rsr.excsave1 */,
-    0,
-    Opcode_rsr_excsave1_encode_fns, 0, 0 },
-  { "wsr.excsave1", 101 /* xt_iclass_wsr.excsave1 */,
-    0,
-    Opcode_wsr_excsave1_encode_fns, 0, 0 },
-  { "xsr.excsave1", 102 /* xt_iclass_xsr.excsave1 */,
-    0,
-    Opcode_xsr_excsave1_encode_fns, 0, 0 },
-  { "rsr.epc2", 103 /* xt_iclass_rsr.epc2 */,
-    0,
-    Opcode_rsr_epc2_encode_fns, 0, 0 },
-  { "wsr.epc2", 104 /* xt_iclass_wsr.epc2 */,
-    0,
-    Opcode_wsr_epc2_encode_fns, 0, 0 },
-  { "xsr.epc2", 105 /* xt_iclass_xsr.epc2 */,
-    0,
-    Opcode_xsr_epc2_encode_fns, 0, 0 },
-  { "rsr.excsave2", 106 /* xt_iclass_rsr.excsave2 */,
-    0,
-    Opcode_rsr_excsave2_encode_fns, 0, 0 },
-  { "wsr.excsave2", 107 /* xt_iclass_wsr.excsave2 */,
-    0,
-    Opcode_wsr_excsave2_encode_fns, 0, 0 },
-  { "xsr.excsave2", 108 /* xt_iclass_xsr.excsave2 */,
-    0,
-    Opcode_xsr_excsave2_encode_fns, 0, 0 },
-  { "rsr.epc3", 109 /* xt_iclass_rsr.epc3 */,
-    0,
-    Opcode_rsr_epc3_encode_fns, 0, 0 },
-  { "wsr.epc3", 110 /* xt_iclass_wsr.epc3 */,
-    0,
-    Opcode_wsr_epc3_encode_fns, 0, 0 },
-  { "xsr.epc3", 111 /* xt_iclass_xsr.epc3 */,
-    0,
-    Opcode_xsr_epc3_encode_fns, 0, 0 },
-  { "rsr.excsave3", 112 /* xt_iclass_rsr.excsave3 */,
-    0,
-    Opcode_rsr_excsave3_encode_fns, 0, 0 },
-  { "wsr.excsave3", 113 /* xt_iclass_wsr.excsave3 */,
-    0,
-    Opcode_wsr_excsave3_encode_fns, 0, 0 },
-  { "xsr.excsave3", 114 /* xt_iclass_xsr.excsave3 */,
-    0,
-    Opcode_xsr_excsave3_encode_fns, 0, 0 },
-  { "rsr.epc4", 115 /* xt_iclass_rsr.epc4 */,
-    0,
-    Opcode_rsr_epc4_encode_fns, 0, 0 },
-  { "wsr.epc4", 116 /* xt_iclass_wsr.epc4 */,
-    0,
-    Opcode_wsr_epc4_encode_fns, 0, 0 },
-  { "xsr.epc4", 117 /* xt_iclass_xsr.epc4 */,
-    0,
-    Opcode_xsr_epc4_encode_fns, 0, 0 },
-  { "rsr.excsave4", 118 /* xt_iclass_rsr.excsave4 */,
-    0,
-    Opcode_rsr_excsave4_encode_fns, 0, 0 },
-  { "wsr.excsave4", 119 /* xt_iclass_wsr.excsave4 */,
-    0,
-    Opcode_wsr_excsave4_encode_fns, 0, 0 },
-  { "xsr.excsave4", 120 /* xt_iclass_xsr.excsave4 */,
-    0,
-    Opcode_xsr_excsave4_encode_fns, 0, 0 },
-  { "rsr.eps2", 121 /* xt_iclass_rsr.eps2 */,
-    0,
-    Opcode_rsr_eps2_encode_fns, 0, 0 },
-  { "wsr.eps2", 122 /* xt_iclass_wsr.eps2 */,
-    0,
-    Opcode_wsr_eps2_encode_fns, 0, 0 },
-  { "xsr.eps2", 123 /* xt_iclass_xsr.eps2 */,
-    0,
-    Opcode_xsr_eps2_encode_fns, 0, 0 },
-  { "rsr.eps3", 124 /* xt_iclass_rsr.eps3 */,
-    0,
-    Opcode_rsr_eps3_encode_fns, 0, 0 },
-  { "wsr.eps3", 125 /* xt_iclass_wsr.eps3 */,
-    0,
-    Opcode_wsr_eps3_encode_fns, 0, 0 },
-  { "xsr.eps3", 126 /* xt_iclass_xsr.eps3 */,
-    0,
-    Opcode_xsr_eps3_encode_fns, 0, 0 },
-  { "rsr.eps4", 127 /* xt_iclass_rsr.eps4 */,
-    0,
-    Opcode_rsr_eps4_encode_fns, 0, 0 },
-  { "wsr.eps4", 128 /* xt_iclass_wsr.eps4 */,
-    0,
-    Opcode_wsr_eps4_encode_fns, 0, 0 },
-  { "xsr.eps4", 129 /* xt_iclass_xsr.eps4 */,
-    0,
-    Opcode_xsr_eps4_encode_fns, 0, 0 },
-  { "rsr.excvaddr", 130 /* xt_iclass_rsr.excvaddr */,
-    0,
-    Opcode_rsr_excvaddr_encode_fns, 0, 0 },
-  { "wsr.excvaddr", 131 /* xt_iclass_wsr.excvaddr */,
-    0,
-    Opcode_wsr_excvaddr_encode_fns, 0, 0 },
-  { "xsr.excvaddr", 132 /* xt_iclass_xsr.excvaddr */,
-    0,
-    Opcode_xsr_excvaddr_encode_fns, 0, 0 },
-  { "rsr.depc", 133 /* xt_iclass_rsr.depc */,
-    0,
-    Opcode_rsr_depc_encode_fns, 0, 0 },
-  { "wsr.depc", 134 /* xt_iclass_wsr.depc */,
-    0,
-    Opcode_wsr_depc_encode_fns, 0, 0 },
-  { "xsr.depc", 135 /* xt_iclass_xsr.depc */,
-    0,
-    Opcode_xsr_depc_encode_fns, 0, 0 },
-  { "rsr.exccause", 136 /* xt_iclass_rsr.exccause */,
-    0,
-    Opcode_rsr_exccause_encode_fns, 0, 0 },
-  { "wsr.exccause", 137 /* xt_iclass_wsr.exccause */,
-    0,
-    Opcode_wsr_exccause_encode_fns, 0, 0 },
-  { "xsr.exccause", 138 /* xt_iclass_xsr.exccause */,
-    0,
-    Opcode_xsr_exccause_encode_fns, 0, 0 },
-  { "rsr.misc0", 139 /* xt_iclass_rsr.misc0 */,
-    0,
-    Opcode_rsr_misc0_encode_fns, 0, 0 },
-  { "wsr.misc0", 140 /* xt_iclass_wsr.misc0 */,
-    0,
-    Opcode_wsr_misc0_encode_fns, 0, 0 },
-  { "xsr.misc0", 141 /* xt_iclass_xsr.misc0 */,
-    0,
-    Opcode_xsr_misc0_encode_fns, 0, 0 },
-  { "rsr.misc1", 142 /* xt_iclass_rsr.misc1 */,
-    0,
-    Opcode_rsr_misc1_encode_fns, 0, 0 },
-  { "wsr.misc1", 143 /* xt_iclass_wsr.misc1 */,
-    0,
-    Opcode_wsr_misc1_encode_fns, 0, 0 },
-  { "xsr.misc1", 144 /* xt_iclass_xsr.misc1 */,
-    0,
-    Opcode_xsr_misc1_encode_fns, 0, 0 },
-  { "rsr.prid", 145 /* xt_iclass_rsr.prid */,
-    0,
-    Opcode_rsr_prid_encode_fns, 0, 0 },
-  { "rfi", 146 /* xt_iclass_rfi */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfi_encode_fns, 0, 0 },
-  { "waiti", 147 /* xt_iclass_wait */,
-    0,
-    Opcode_waiti_encode_fns, 0, 0 },
-  { "rsr.interrupt", 148 /* xt_iclass_rsr.interrupt */,
-    0,
-    Opcode_rsr_interrupt_encode_fns, 0, 0 },
-  { "wsr.intset", 149 /* xt_iclass_wsr.intset */,
-    0,
-    Opcode_wsr_intset_encode_fns, 0, 0 },
-  { "wsr.intclear", 150 /* xt_iclass_wsr.intclear */,
-    0,
-    Opcode_wsr_intclear_encode_fns, 0, 0 },
-  { "rsr.intenable", 151 /* xt_iclass_rsr.intenable */,
-    0,
-    Opcode_rsr_intenable_encode_fns, 0, 0 },
-  { "wsr.intenable", 152 /* xt_iclass_wsr.intenable */,
-    0,
-    Opcode_wsr_intenable_encode_fns, 0, 0 },
-  { "xsr.intenable", 153 /* xt_iclass_xsr.intenable */,
-    0,
-    Opcode_xsr_intenable_encode_fns, 0, 0 },
-  { "break", 154 /* xt_iclass_break */,
-    0,
-    Opcode_break_encode_fns, 0, 0 },
-  { "break.n", 155 /* xt_iclass_break.n */,
-    0,
-    Opcode_break_n_encode_fns, 0, 0 },
-  { "rsr.dbreaka0", 156 /* xt_iclass_rsr.dbreaka0 */,
-    0,
-    Opcode_rsr_dbreaka0_encode_fns, 0, 0 },
-  { "wsr.dbreaka0", 157 /* xt_iclass_wsr.dbreaka0 */,
-    0,
-    Opcode_wsr_dbreaka0_encode_fns, 0, 0 },
-  { "xsr.dbreaka0", 158 /* xt_iclass_xsr.dbreaka0 */,
-    0,
-    Opcode_xsr_dbreaka0_encode_fns, 0, 0 },
-  { "rsr.dbreakc0", 159 /* xt_iclass_rsr.dbreakc0 */,
-    0,
-    Opcode_rsr_dbreakc0_encode_fns, 0, 0 },
-  { "wsr.dbreakc0", 160 /* xt_iclass_wsr.dbreakc0 */,
-    0,
-    Opcode_wsr_dbreakc0_encode_fns, 0, 0 },
-  { "xsr.dbreakc0", 161 /* xt_iclass_xsr.dbreakc0 */,
-    0,
-    Opcode_xsr_dbreakc0_encode_fns, 0, 0 },
-  { "rsr.dbreaka1", 162 /* xt_iclass_rsr.dbreaka1 */,
-    0,
-    Opcode_rsr_dbreaka1_encode_fns, 0, 0 },
-  { "wsr.dbreaka1", 163 /* xt_iclass_wsr.dbreaka1 */,
-    0,
-    Opcode_wsr_dbreaka1_encode_fns, 0, 0 },
-  { "xsr.dbreaka1", 164 /* xt_iclass_xsr.dbreaka1 */,
-    0,
-    Opcode_xsr_dbreaka1_encode_fns, 0, 0 },
-  { "rsr.dbreakc1", 165 /* xt_iclass_rsr.dbreakc1 */,
-    0,
-    Opcode_rsr_dbreakc1_encode_fns, 0, 0 },
-  { "wsr.dbreakc1", 166 /* xt_iclass_wsr.dbreakc1 */,
-    0,
-    Opcode_wsr_dbreakc1_encode_fns, 0, 0 },
-  { "xsr.dbreakc1", 167 /* xt_iclass_xsr.dbreakc1 */,
-    0,
-    Opcode_xsr_dbreakc1_encode_fns, 0, 0 },
-  { "rsr.ibreaka0", 168 /* xt_iclass_rsr.ibreaka0 */,
-    0,
-    Opcode_rsr_ibreaka0_encode_fns, 0, 0 },
-  { "wsr.ibreaka0", 169 /* xt_iclass_wsr.ibreaka0 */,
-    0,
-    Opcode_wsr_ibreaka0_encode_fns, 0, 0 },
-  { "xsr.ibreaka0", 170 /* xt_iclass_xsr.ibreaka0 */,
-    0,
-    Opcode_xsr_ibreaka0_encode_fns, 0, 0 },
-  { "rsr.ibreaka1", 171 /* xt_iclass_rsr.ibreaka1 */,
-    0,
-    Opcode_rsr_ibreaka1_encode_fns, 0, 0 },
-  { "wsr.ibreaka1", 172 /* xt_iclass_wsr.ibreaka1 */,
-    0,
-    Opcode_wsr_ibreaka1_encode_fns, 0, 0 },
-  { "xsr.ibreaka1", 173 /* xt_iclass_xsr.ibreaka1 */,
-    0,
-    Opcode_xsr_ibreaka1_encode_fns, 0, 0 },
-  { "rsr.ibreakenable", 174 /* xt_iclass_rsr.ibreakenable */,
-    0,
-    Opcode_rsr_ibreakenable_encode_fns, 0, 0 },
-  { "wsr.ibreakenable", 175 /* xt_iclass_wsr.ibreakenable */,
-    0,
-    Opcode_wsr_ibreakenable_encode_fns, 0, 0 },
-  { "xsr.ibreakenable", 176 /* xt_iclass_xsr.ibreakenable */,
-    0,
-    Opcode_xsr_ibreakenable_encode_fns, 0, 0 },
-  { "rsr.debugcause", 177 /* xt_iclass_rsr.debugcause */,
-    0,
-    Opcode_rsr_debugcause_encode_fns, 0, 0 },
-  { "wsr.debugcause", 178 /* xt_iclass_wsr.debugcause */,
-    0,
-    Opcode_wsr_debugcause_encode_fns, 0, 0 },
-  { "xsr.debugcause", 179 /* xt_iclass_xsr.debugcause */,
-    0,
-    Opcode_xsr_debugcause_encode_fns, 0, 0 },
-  { "rsr.icount", 180 /* xt_iclass_rsr.icount */,
-    0,
-    Opcode_rsr_icount_encode_fns, 0, 0 },
-  { "wsr.icount", 181 /* xt_iclass_wsr.icount */,
-    0,
-    Opcode_wsr_icount_encode_fns, 0, 0 },
-  { "xsr.icount", 182 /* xt_iclass_xsr.icount */,
-    0,
-    Opcode_xsr_icount_encode_fns, 0, 0 },
-  { "rsr.icountlevel", 183 /* xt_iclass_rsr.icountlevel */,
-    0,
-    Opcode_rsr_icountlevel_encode_fns, 0, 0 },
-  { "wsr.icountlevel", 184 /* xt_iclass_wsr.icountlevel */,
-    0,
-    Opcode_wsr_icountlevel_encode_fns, 0, 0 },
-  { "xsr.icountlevel", 185 /* xt_iclass_xsr.icountlevel */,
-    0,
-    Opcode_xsr_icountlevel_encode_fns, 0, 0 },
-  { "rsr.ddr", 186 /* xt_iclass_rsr.ddr */,
-    0,
-    Opcode_rsr_ddr_encode_fns, 0, 0 },
-  { "wsr.ddr", 187 /* xt_iclass_wsr.ddr */,
-    0,
-    Opcode_wsr_ddr_encode_fns, 0, 0 },
-  { "xsr.ddr", 188 /* xt_iclass_xsr.ddr */,
-    0,
-    Opcode_xsr_ddr_encode_fns, 0, 0 },
-  { "rfdo", 189 /* xt_iclass_rfdo */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfdo_encode_fns, 0, 0 },
-  { "rfdd", 190 /* xt_iclass_rfdd */,
-    XTENSA_OPCODE_IS_JUMP,
-    Opcode_rfdd_encode_fns, 0, 0 },
-  { "rsr.ccount", 191 /* xt_iclass_rsr.ccount */,
-    0,
-    Opcode_rsr_ccount_encode_fns, 0, 0 },
-  { "wsr.ccount", 192 /* xt_iclass_wsr.ccount */,
-    0,
-    Opcode_wsr_ccount_encode_fns, 0, 0 },
-  { "xsr.ccount", 193 /* xt_iclass_xsr.ccount */,
-    0,
-    Opcode_xsr_ccount_encode_fns, 0, 0 },
-  { "rsr.ccompare0", 194 /* xt_iclass_rsr.ccompare0 */,
-    0,
-    Opcode_rsr_ccompare0_encode_fns, 0, 0 },
-  { "wsr.ccompare0", 195 /* xt_iclass_wsr.ccompare0 */,
-    0,
-    Opcode_wsr_ccompare0_encode_fns, 0, 0 },
-  { "xsr.ccompare0", 196 /* xt_iclass_xsr.ccompare0 */,
-    0,
-    Opcode_xsr_ccompare0_encode_fns, 0, 0 },
-  { "rsr.ccompare1", 197 /* xt_iclass_rsr.ccompare1 */,
-    0,
-    Opcode_rsr_ccompare1_encode_fns, 0, 0 },
-  { "wsr.ccompare1", 198 /* xt_iclass_wsr.ccompare1 */,
-    0,
-    Opcode_wsr_ccompare1_encode_fns, 0, 0 },
-  { "xsr.ccompare1", 199 /* xt_iclass_xsr.ccompare1 */,
-    0,
-    Opcode_xsr_ccompare1_encode_fns, 0, 0 },
-  { "rsr.ccompare2", 200 /* xt_iclass_rsr.ccompare2 */,
-    0,
-    Opcode_rsr_ccompare2_encode_fns, 0, 0 },
-  { "wsr.ccompare2", 201 /* xt_iclass_wsr.ccompare2 */,
-    0,
-    Opcode_wsr_ccompare2_encode_fns, 0, 0 },
-  { "xsr.ccompare2", 202 /* xt_iclass_xsr.ccompare2 */,
-    0,
-    Opcode_xsr_ccompare2_encode_fns, 0, 0 },
-  { "ipf", 203 /* xt_iclass_icache */,
-    0,
-    Opcode_ipf_encode_fns, 0, 0 },
-  { "ihi", 203 /* xt_iclass_icache */,
-    0,
-    Opcode_ihi_encode_fns, 0, 0 },
-  { "iii", 204 /* xt_iclass_icache_inv */,
-    0,
-    Opcode_iii_encode_fns, 0, 0 },
-  { "lict", 205 /* xt_iclass_licx */,
-    0,
-    Opcode_lict_encode_fns, 0, 0 },
-  { "licw", 205 /* xt_iclass_licx */,
-    0,
-    Opcode_licw_encode_fns, 0, 0 },
-  { "sict", 206 /* xt_iclass_sicx */,
-    0,
-    Opcode_sict_encode_fns, 0, 0 },
-  { "sicw", 206 /* xt_iclass_sicx */,
-    0,
-    Opcode_sicw_encode_fns, 0, 0 },
-  { "dhwb", 207 /* xt_iclass_dcache */,
-    0,
-    Opcode_dhwb_encode_fns, 0, 0 },
-  { "dhwbi", 207 /* xt_iclass_dcache */,
-    0,
-    Opcode_dhwbi_encode_fns, 0, 0 },
-  { "diwb", 208 /* xt_iclass_dcache_ind */,
-    0,
-    Opcode_diwb_encode_fns, 0, 0 },
-  { "diwbi", 208 /* xt_iclass_dcache_ind */,
-    0,
-    Opcode_diwbi_encode_fns, 0, 0 },
-  { "dhi", 209 /* xt_iclass_dcache_inv */,
-    0,
-    Opcode_dhi_encode_fns, 0, 0 },
-  { "dii", 209 /* xt_iclass_dcache_inv */,
-    0,
-    Opcode_dii_encode_fns, 0, 0 },
-  { "dpfr", 210 /* xt_iclass_dpf */,
-    0,
-    Opcode_dpfr_encode_fns, 0, 0 },
-  { "dpfw", 210 /* xt_iclass_dpf */,
-    0,
-    Opcode_dpfw_encode_fns, 0, 0 },
-  { "dpfro", 210 /* xt_iclass_dpf */,
-    0,
-    Opcode_dpfro_encode_fns, 0, 0 },
-  { "dpfwo", 210 /* xt_iclass_dpf */,
-    0,
-    Opcode_dpfwo_encode_fns, 0, 0 },
-  { "sdct", 211 /* xt_iclass_sdct */,
-    0,
-    Opcode_sdct_encode_fns, 0, 0 },
-  { "ldct", 212 /* xt_iclass_ldct */,
-    0,
-    Opcode_ldct_encode_fns, 0, 0 },
-  { "idtlb", 213 /* xt_iclass_idtlb */,
-    0,
-    Opcode_idtlb_encode_fns, 0, 0 },
-  { "pdtlb", 214 /* xt_iclass_rdtlb */,
-    0,
-    Opcode_pdtlb_encode_fns, 0, 0 },
-  { "rdtlb0", 214 /* xt_iclass_rdtlb */,
-    0,
-    Opcode_rdtlb0_encode_fns, 0, 0 },
-  { "rdtlb1", 214 /* xt_iclass_rdtlb */,
-    0,
-    Opcode_rdtlb1_encode_fns, 0, 0 },
-  { "wdtlb", 215 /* xt_iclass_wdtlb */,
-    0,
-    Opcode_wdtlb_encode_fns, 0, 0 },
-  { "iitlb", 216 /* xt_iclass_iitlb */,
-    0,
-    Opcode_iitlb_encode_fns, 0, 0 },
-  { "pitlb", 217 /* xt_iclass_ritlb */,
-    0,
-    Opcode_pitlb_encode_fns, 0, 0 },
-  { "ritlb0", 217 /* xt_iclass_ritlb */,
-    0,
-    Opcode_ritlb0_encode_fns, 0, 0 },
-  { "ritlb1", 217 /* xt_iclass_ritlb */,
-    0,
-    Opcode_ritlb1_encode_fns, 0, 0 },
-  { "witlb", 218 /* xt_iclass_witlb */,
-    0,
-    Opcode_witlb_encode_fns, 0, 0 },
-  { "nsa", 219 /* xt_iclass_nsa */,
-    0,
-    Opcode_nsa_encode_fns, 0, 0 },
-  { "nsau", 219 /* xt_iclass_nsa */,
-    0,
-    Opcode_nsau_encode_fns, 0, 0 }
-};
-
-\f
-/* Slot-specific opcode decode functions.  */
-
-static int
-Slot_inst_decode (const xtensa_insnbuf insn)
-{
-  switch (Field_op0_Slot_inst_get (insn))
-    {
-    case 0:
-      switch (Field_op1_Slot_inst_get (insn))
-       {
-       case 0:
-         switch (Field_op2_Slot_inst_get (insn))
-           {
-           case 0:
-             switch (Field_r_Slot_inst_get (insn))
-               {
-               case 0:
-                 switch (Field_m_Slot_inst_get (insn))
-                   {
-                   case 0:
-                     return 77; /* ill */
-                   case 2:
-                     switch (Field_n_Slot_inst_get (insn))
-                       {
-                       case 0:
-                         return 96; /* ret */
-                       case 1:
-                         return 14; /* retw */
-                       case 2:
-                         return 79; /* jx */
-                       }
-                     break;
-                   case 3:
-                     switch (Field_n_Slot_inst_get (insn))
-                       {
-                       case 0:
-                         return 75; /* callx0 */
-                       case 1:
-                         return 10; /* callx4 */
-                       case 2:
-                         return 9; /* callx8 */
-                       case 3:
-                         return 8; /* callx12 */
-                       }
-                     break;
-                   }
-                 break;
-               case 1:
-                 return 12; /* movsp */
-               case 2:
-                 if (Field_s_Slot_inst_get (insn) == 0)
-                   {
-                     switch (Field_t_Slot_inst_get (insn))
-                       {
-                       case 0:
-                         return 114; /* isync */
-                       case 1:
-                         return 115; /* rsync */
-                       case 2:
-                         return 116; /* esync */
-                       case 3:
-                         return 117; /* dsync */
-                       case 8:
-                         return 0; /* excw */
-                       case 12:
-                         return 112; /* memw */
-                       case 13:
-                         return 113; /* extw */
-                       case 15:
-                         return 95; /* nop */
-                       }
-                   }
-                 break;
-               case 3:
-                 switch (Field_t_Slot_inst_get (insn))
-                   {
-                   case 0:
-                     switch (Field_s_Slot_inst_get (insn))
-                       {
-                       case 0:
-                         return 1; /* rfe */
-                       case 2:
-                         return 2; /* rfde */
-                       case 4:
-                         return 16; /* rfwo */
-                       case 5:
-                         return 17; /* rfwu */
-                       }
-                     break;
-                   case 1:
-                     return 188; /* rfi */
-                   }
-                 break;
-               case 4:
-                 return 196; /* break */
-               case 5:
-                 switch (Field_s_Slot_inst_get (insn))
-                   {
-                   case 0:
-                     if (Field_t_Slot_inst_get (insn) == 0)
-                       return 3; /* syscall */
-                     break;
-                   case 1:
-                     if (Field_t_Slot_inst_get (insn) == 0)
-                       return 4; /* simcall */
-                     break;
-                   }
-                 break;
-               case 6:
-                 return 118; /* rsil */
-               case 7:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 189; /* waiti */
-                 break;
-               }
-             break;
-           case 1:
-             return 47; /* and */
-           case 2:
-             return 48; /* or */
-           case 3:
-             return 49; /* xor */
-           case 4:
-             switch (Field_r_Slot_inst_get (insn))
-               {
-               case 0:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 100; /* ssr */
-                 break;
-               case 1:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 101; /* ssl */
-                 break;
-               case 2:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 102; /* ssa8l */
-                 break;
-               case 3:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 103; /* ssa8b */
-                 break;
-               case 4:
-                 if (Field_thi3_Slot_inst_get (insn) == 0)
-                   return 104; /* ssai */
-                 break;
-               case 8:
-                 if (Field_s_Slot_inst_get (insn) == 0)
-                   return 13; /* rotw */
-                 break;
-               case 14:
-                 return 274; /* nsa */
-               case 15:
-                 return 275; /* nsau */
-               }
-             break;
-           case 5:
-             switch (Field_r_Slot_inst_get (insn))
-               {
-               case 3:
-                 return 271; /* ritlb0 */
-               case 4:
-                 return 269; /* iitlb */
-               case 5:
-                 return 270; /* pitlb */
-               case 6:
-                 return 273; /* witlb */
-               case 7:
-                 return 272; /* ritlb1 */
-               case 11:
-                 return 266; /* rdtlb0 */
-               case 12:
-                 return 264; /* idtlb */
-               case 13:
-                 return 265; /* pdtlb */
-               case 14:
-                 return 268; /* wdtlb */
-               case 15:
-                 return 267; /* rdtlb1 */
-               }
-             break;
-           case 6:
-             switch (Field_s_Slot_inst_get (insn))
-               {
-               case 0:
-                 return 93; /* neg */
-               case 1:
-                 return 94; /* abs */
-               }
-             break;
-           case 8:
-             return 39; /* add */
-           case 9:
-             return 41; /* addx2 */
-           case 10:
-             return 42; /* addx4 */
-           case 11:
-             return 43; /* addx8 */
-           case 12:
-             return 40; /* sub */
-           case 13:
-             return 44; /* subx2 */
-           case 14:
-             return 45; /* subx4 */
-           case 15:
-             return 46; /* subx8 */
-           }
-         break;
-       case 1:
-         switch (Field_op2_Slot_inst_get (insn))
-           {
-           case 0:
-           case 1:
-             return 109; /* slli */
-           case 2:
-           case 3:
-             return 110; /* srai */
-           case 4:
-             return 111; /* srli */
-           case 6:
-             switch (Field_sr_Slot_inst_get (insn))
-               {
-               case 0:
-                 return 127; /* xsr.lbeg */
-               case 1:
-                 return 121; /* xsr.lend */
-               case 2:
-                 return 124; /* xsr.lcount */
-               case 3:
-                 return 130; /* xsr.sar */
-               case 5:
-                 return 133; /* xsr.litbase */
-               case 72:
-                 return 22; /* xsr.windowbase */
-               case 73:
-                 return 25; /* xsr.windowstart */
-               case 96:
-                 return 218; /* xsr.ibreakenable */
-               case 104:
-                 return 230; /* xsr.ddr */
-               case 128:
-                 return 212; /* xsr.ibreaka0 */
-               case 129:
-                 return 215; /* xsr.ibreaka1 */
-               case 144:
-                 return 200; /* xsr.dbreaka0 */
-               case 145:
-                 return 206; /* xsr.dbreaka1 */
-               case 160:
-                 return 203; /* xsr.dbreakc0 */
-               case 161:
-                 return 209; /* xsr.dbreakc1 */
-               case 177:
-                 return 141; /* xsr.epc1 */
-               case 178:
-                 return 147; /* xsr.epc2 */
-               case 179:
-                 return 153; /* xsr.epc3 */
-               case 180:
-                 return 159; /* xsr.epc4 */
-               case 192:
-                 return 177; /* xsr.depc */
-               case 194:
-                 return 165; /* xsr.eps2 */
-               case 195:
-                 return 168; /* xsr.eps3 */
-               case 196:
-                 return 171; /* xsr.eps4 */
-               case 209:
-                 return 144; /* xsr.excsave1 */
-               case 210:
-                 return 150; /* xsr.excsave2 */
-               case 211:
-                 return 156; /* xsr.excsave3 */
-               case 212:
-                 return 162; /* xsr.excsave4 */
-               case 228:
-                 return 195; /* xsr.intenable */
-               case 230:
-                 return 138; /* xsr.ps */
-               case 232:
-                 return 180; /* xsr.exccause */
-               case 233:
-                 return 221; /* xsr.debugcause */
-               case 234:
-                 return 235; /* xsr.ccount */
-               case 236:
-                 return 224; /* xsr.icount */
-               case 237:
-                 return 227; /* xsr.icountlevel */
-               case 238:
-                 return 174; /* xsr.excvaddr */
-               case 240:
-                 return 238; /* xsr.ccompare0 */
-               case 241:
-                 return 241; /* xsr.ccompare1 */
-               case 242:
-                 return 244; /* xsr.ccompare2 */
-               case 244:
-                 return 183; /* xsr.misc0 */
-               case 245:
-                 return 186; /* xsr.misc1 */
-               }
-             break;
-           case 8:
-             return 106; /* src */
-           case 9:
-             if (Field_s_Slot_inst_get (insn) == 0)
-               return 107; /* srl */
-             break;
-           case 10:
-             if (Field_t_Slot_inst_get (insn) == 0)
-               return 105; /* sll */
-             break;
-           case 11:
-             if (Field_s_Slot_inst_get (insn) == 0)
-               return 108; /* sra */
-             break;
-           case 15:
-             switch (Field_r_Slot_inst_get (insn))
-               {
-               case 0:
-                 return 248; /* lict */
-               case 1:
-                 return 250; /* sict */
-               case 2:
-                 return 249; /* licw */
-               case 3:
-                 return 251; /* sicw */
-               case 8:
-                 return 263; /* ldct */
-               case 9:
-                 return 262; /* sdct */
-               case 14:
-                 if (Field_t_Slot_inst_get (insn) == 0)
-                   return 231; /* rfdo */
-                 if (Field_t_Slot_inst_get (insn) == 1)
-                   return 232; /* rfdd */
-                 break;
-               }
-             break;
-           }
-         break;
-       case 3:
-         switch (Field_op2_Slot_inst_get (insn))
-           {
-           case 0:
-             switch (Field_sr_Slot_inst_get (insn))
-               {
-               case 0:
-                 return 125; /* rsr.lbeg */
-               case 1:
-                 return 119; /* rsr.lend */
-               case 2:
-                 return 122; /* rsr.lcount */
-               case 3:
-                 return 128; /* rsr.sar */
-               case 5:
-                 return 131; /* rsr.litbase */
-               case 72:
-                 return 20; /* rsr.windowbase */
-               case 73:
-                 return 23; /* rsr.windowstart */
-               case 96:
-                 return 216; /* rsr.ibreakenable */
-               case 104:
-                 return 228; /* rsr.ddr */
-               case 128:
-                 return 210; /* rsr.ibreaka0 */
-               case 129:
-                 return 213; /* rsr.ibreaka1 */
-               case 144:
-                 return 198; /* rsr.dbreaka0 */
-               case 145:
-                 return 204; /* rsr.dbreaka1 */
-               case 160:
-                 return 201; /* rsr.dbreakc0 */
-               case 161:
-                 return 207; /* rsr.dbreakc1 */
-               case 176:
-                 return 134; /* rsr.176 */
-               case 177:
-                 return 139; /* rsr.epc1 */
-               case 178:
-                 return 145; /* rsr.epc2 */
-               case 179:
-                 return 151; /* rsr.epc3 */
-               case 180:
-                 return 157; /* rsr.epc4 */
-               case 192:
-                 return 175; /* rsr.depc */
-               case 194:
-                 return 163; /* rsr.eps2 */
-               case 195:
-                 return 166; /* rsr.eps3 */
-               case 196:
-                 return 169; /* rsr.eps4 */
-               case 208:
-                 return 135; /* rsr.208 */
-               case 209:
-                 return 142; /* rsr.excsave1 */
-               case 210:
-                 return 148; /* rsr.excsave2 */
-               case 211:
-                 return 154; /* rsr.excsave3 */
-               case 212:
-                 return 160; /* rsr.excsave4 */
-               case 226:
-                 return 190; /* rsr.interrupt */
-               case 228:
-                 return 193; /* rsr.intenable */
-               case 230:
-                 return 136; /* rsr.ps */
-               case 232:
-                 return 178; /* rsr.exccause */
-               case 233:
-                 return 219; /* rsr.debugcause */
-               case 234:
-                 return 233; /* rsr.ccount */
-               case 235:
-                 return 187; /* rsr.prid */
-               case 236:
-                 return 222; /* rsr.icount */
-               case 237:
-                 return 225; /* rsr.icountlevel */
-               case 238:
-                 return 172; /* rsr.excvaddr */
-               case 240:
-                 return 236; /* rsr.ccompare0 */
-               case 241:
-                 return 239; /* rsr.ccompare1 */
-               case 242:
-                 return 242; /* rsr.ccompare2 */
-               case 244:
-                 return 181; /* rsr.misc0 */
-               case 245:
-                 return 184; /* rsr.misc1 */
-               }
-             break;
-           case 1:
-             switch (Field_sr_Slot_inst_get (insn))
-               {
-               case 0:
-                 return 126; /* wsr.lbeg */
-               case 1:
-                 return 120; /* wsr.lend */
-               case 2:
-                 return 123; /* wsr.lcount */
-               case 3:
-                 return 129; /* wsr.sar */
-               case 5:
-                 return 132; /* wsr.litbase */
-               case 72:
-                 return 21; /* wsr.windowbase */
-               case 73:
-                 return 24; /* wsr.windowstart */
-               case 96:
-                 return 217; /* wsr.ibreakenable */
-               case 104:
-                 return 229; /* wsr.ddr */
-               case 128:
-                 return 211; /* wsr.ibreaka0 */
-               case 129:
-                 return 214; /* wsr.ibreaka1 */
-               case 144:
-                 return 199; /* wsr.dbreaka0 */
-               case 145:
-                 return 205; /* wsr.dbreaka1 */
-               case 160:
-                 return 202; /* wsr.dbreakc0 */
-               case 161:
-                 return 208; /* wsr.dbreakc1 */
-               case 177:
-                 return 140; /* wsr.epc1 */
-               case 178:
-                 return 146; /* wsr.epc2 */
-               case 179:
-                 return 152; /* wsr.epc3 */
-               case 180:
-                 return 158; /* wsr.epc4 */
-               case 192:
-                 return 176; /* wsr.depc */
-               case 194:
-                 return 164; /* wsr.eps2 */
-               case 195:
-                 return 167; /* wsr.eps3 */
-               case 196:
-                 return 170; /* wsr.eps4 */
-               case 209:
-                 return 143; /* wsr.excsave1 */
-               case 210:
-                 return 149; /* wsr.excsave2 */
-               case 211:
-                 return 155; /* wsr.excsave3 */
-               case 212:
-                 return 161; /* wsr.excsave4 */
-               case 226:
-                 return 191; /* wsr.intset */
-               case 227:
-                 return 192; /* wsr.intclear */
-               case 228:
-                 return 194; /* wsr.intenable */
-               case 230:
-                 return 137; /* wsr.ps */
-               case 232:
-                 return 179; /* wsr.exccause */
-               case 233:
-                 return 220; /* wsr.debugcause */
-               case 234:
-                 return 234; /* wsr.ccount */
-               case 236:
-                 return 223; /* wsr.icount */
-               case 237:
-                 return 226; /* wsr.icountlevel */
-               case 238:
-                 return 173; /* wsr.excvaddr */
-               case 240:
-                 return 237; /* wsr.ccompare0 */
-               case 241:
-                 return 240; /* wsr.ccompare1 */
-               case 242:
-                 return 243; /* wsr.ccompare2 */
-               case 244:
-                 return 182; /* wsr.misc0 */
-               case 245:
-                 return 185; /* wsr.misc1 */
-               }
-             break;
-           case 8:
-             return 89; /* moveqz */
-           case 9:
-             return 90; /* movnez */
-           case 10:
-             return 91; /* movltz */
-           case 11:
-             return 92; /* movgez */
-           }
-         break;
-       case 4:
-       case 5:
-         return 76; /* extui */
-       case 9:
-         switch (Field_op2_Slot_inst_get (insn))
-           {
-           case 0:
-             return 18; /* l32e */
-           case 4:
-             return 19; /* s32e */
-           }
-         break;
-       }
+static xtensa_opcode_internal xsr_opcode = {
+  "xsr",
+  3,
+  xsr_template,
+  &xsr_iclass
+};
+
+static xtensa_opcode_internal * opcodes[149] = {
+  &abs_opcode,
+  &add_opcode,
+  &add_n_opcode,
+  &addi_opcode,
+  &addi_n_opcode,
+  &addmi_opcode,
+  &addx2_opcode,
+  &addx4_opcode,
+  &addx8_opcode,
+  &and_opcode,
+  &ball_opcode,
+  &bany_opcode,
+  &bbc_opcode,
+  &bbci_opcode,
+  &bbs_opcode,
+  &bbsi_opcode,
+  &beq_opcode,
+  &beqi_opcode,
+  &beqz_opcode,
+  &beqz_n_opcode,
+  &bge_opcode,
+  &bgei_opcode,
+  &bgeu_opcode,
+  &bgeui_opcode,
+  &bgez_opcode,
+  &blt_opcode,
+  &blti_opcode,
+  &bltu_opcode,
+  &bltui_opcode,
+  &bltz_opcode,
+  &bnall_opcode,
+  &bne_opcode,
+  &bnei_opcode,
+  &bnez_opcode,
+  &bnez_n_opcode,
+  &bnone_opcode,
+  &break_opcode,
+  &break_n_opcode,
+  &call0_opcode,
+  &call12_opcode,
+  &call4_opcode,
+  &call8_opcode,
+  &callx0_opcode,
+  &callx12_opcode,
+  &callx4_opcode,
+  &callx8_opcode,
+  &dhi_opcode,
+  &dhwb_opcode,
+  &dhwbi_opcode,
+  &dii_opcode,
+  &diwb_opcode,
+  &diwbi_opcode,
+  &dpfr_opcode,
+  &dpfro_opcode,
+  &dpfw_opcode,
+  &dpfwo_opcode,
+  &dsync_opcode,
+  &entry_opcode,
+  &esync_opcode,
+  &excw_opcode,
+  &extui_opcode,
+  &idtlb_opcode,
+  &idtlba_opcode,
+  &ihi_opcode,
+  &iii_opcode,
+  &iitlb_opcode,
+  &iitlba_opcode,
+  &ipf_opcode,
+  &isync_opcode,
+  &j_opcode,
+  &jx_opcode,
+  &l16si_opcode,
+  &l16ui_opcode,
+  &l32e_opcode,
+  &l32i_opcode,
+  &l32i_n_opcode,
+  &l32r_opcode,
+  &l8ui_opcode,
+  &ldct_opcode,
+  &lict_opcode,
+  &licw_opcode,
+  &loop_opcode,
+  &loopgtz_opcode,
+  &loopnez_opcode,
+  &memw_opcode,
+  &mov_n_opcode,
+  &moveqz_opcode,
+  &movgez_opcode,
+  &movi_opcode,
+  &movi_n_opcode,
+  &movltz_opcode,
+  &movnez_opcode,
+  &movsp_opcode,
+  &neg_opcode,
+  &nop_n_opcode,
+  &nsa_opcode,
+  &nsau_opcode,
+  &or_opcode,
+  &pdtlb_opcode,
+  &pitlb_opcode,
+  &rdtlb0_opcode,
+  &rdtlb1_opcode,
+  &ret_opcode,
+  &ret_n_opcode,
+  &retw_opcode,
+  &retw_n_opcode,
+  &rfde_opcode,
+  &rfe_opcode,
+  &rfi_opcode,
+  &rfwo_opcode,
+  &rfwu_opcode,
+  &ritlb0_opcode,
+  &ritlb1_opcode,
+  &rotw_opcode,
+  &rsil_opcode,
+  &rsr_opcode,
+  &rsync_opcode,
+  &s16i_opcode,
+  &s32e_opcode,
+  &s32i_opcode,
+  &s32i_n_opcode,
+  &s8i_opcode,
+  &sdct_opcode,
+  &sict_opcode,
+  &sicw_opcode,
+  &simcall_opcode,
+  &sll_opcode,
+  &slli_opcode,
+  &sra_opcode,
+  &srai_opcode,
+  &src_opcode,
+  &srl_opcode,
+  &srli_opcode,
+  &ssa8b_opcode,
+  &ssa8l_opcode,
+  &ssai_opcode,
+  &ssl_opcode,
+  &ssr_opcode,
+  &sub_opcode,
+  &subx2_opcode,
+  &subx4_opcode,
+  &subx8_opcode,
+  &syscall_opcode,
+  &waiti_opcode,
+  &wdtlb_opcode,
+  &witlb_opcode,
+  &wsr_opcode,
+  &xor_opcode,
+  &xsr_opcode
+};
+
+xtensa_opcode_internal **
+get_opcodes (void)
+{
+  return &opcodes[0];
+}
+
+int
+get_num_opcodes (void)
+{
+  return 149;
+}
+
+#define xtensa_abs_op 0
+#define xtensa_add_op 1
+#define xtensa_add_n_op 2
+#define xtensa_addi_op 3
+#define xtensa_addi_n_op 4
+#define xtensa_addmi_op 5
+#define xtensa_addx2_op 6
+#define xtensa_addx4_op 7
+#define xtensa_addx8_op 8
+#define xtensa_and_op 9
+#define xtensa_ball_op 10
+#define xtensa_bany_op 11
+#define xtensa_bbc_op 12
+#define xtensa_bbci_op 13
+#define xtensa_bbs_op 14
+#define xtensa_bbsi_op 15
+#define xtensa_beq_op 16
+#define xtensa_beqi_op 17
+#define xtensa_beqz_op 18
+#define xtensa_beqz_n_op 19
+#define xtensa_bge_op 20
+#define xtensa_bgei_op 21
+#define xtensa_bgeu_op 22
+#define xtensa_bgeui_op 23
+#define xtensa_bgez_op 24
+#define xtensa_blt_op 25
+#define xtensa_blti_op 26
+#define xtensa_bltu_op 27
+#define xtensa_bltui_op 28
+#define xtensa_bltz_op 29
+#define xtensa_bnall_op 30
+#define xtensa_bne_op 31
+#define xtensa_bnei_op 32
+#define xtensa_bnez_op 33
+#define xtensa_bnez_n_op 34
+#define xtensa_bnone_op 35
+#define xtensa_break_op 36
+#define xtensa_break_n_op 37
+#define xtensa_call0_op 38
+#define xtensa_call12_op 39
+#define xtensa_call4_op 40
+#define xtensa_call8_op 41
+#define xtensa_callx0_op 42
+#define xtensa_callx12_op 43
+#define xtensa_callx4_op 44
+#define xtensa_callx8_op 45
+#define xtensa_dhi_op 46
+#define xtensa_dhwb_op 47
+#define xtensa_dhwbi_op 48
+#define xtensa_dii_op 49
+#define xtensa_diwb_op 50
+#define xtensa_diwbi_op 51
+#define xtensa_dpfr_op 52
+#define xtensa_dpfro_op 53
+#define xtensa_dpfw_op 54
+#define xtensa_dpfwo_op 55
+#define xtensa_dsync_op 56
+#define xtensa_entry_op 57
+#define xtensa_esync_op 58
+#define xtensa_excw_op 59
+#define xtensa_extui_op 60
+#define xtensa_idtlb_op 61
+#define xtensa_idtlba_op 62
+#define xtensa_ihi_op 63
+#define xtensa_iii_op 64
+#define xtensa_iitlb_op 65
+#define xtensa_iitlba_op 66
+#define xtensa_ipf_op 67
+#define xtensa_isync_op 68
+#define xtensa_j_op 69
+#define xtensa_jx_op 70
+#define xtensa_l16si_op 71
+#define xtensa_l16ui_op 72
+#define xtensa_l32e_op 73
+#define xtensa_l32i_op 74
+#define xtensa_l32i_n_op 75
+#define xtensa_l32r_op 76
+#define xtensa_l8ui_op 77
+#define xtensa_ldct_op 78
+#define xtensa_lict_op 79
+#define xtensa_licw_op 80
+#define xtensa_loop_op 81
+#define xtensa_loopgtz_op 82
+#define xtensa_loopnez_op 83
+#define xtensa_memw_op 84
+#define xtensa_mov_n_op 85
+#define xtensa_moveqz_op 86
+#define xtensa_movgez_op 87
+#define xtensa_movi_op 88
+#define xtensa_movi_n_op 89
+#define xtensa_movltz_op 90
+#define xtensa_movnez_op 91
+#define xtensa_movsp_op 92
+#define xtensa_neg_op 93
+#define xtensa_nop_n_op 94
+#define xtensa_nsa_op 95
+#define xtensa_nsau_op 96
+#define xtensa_or_op 97
+#define xtensa_pdtlb_op 98
+#define xtensa_pitlb_op 99
+#define xtensa_rdtlb0_op 100
+#define xtensa_rdtlb1_op 101
+#define xtensa_ret_op 102
+#define xtensa_ret_n_op 103
+#define xtensa_retw_op 104
+#define xtensa_retw_n_op 105
+#define xtensa_rfde_op 106
+#define xtensa_rfe_op 107
+#define xtensa_rfi_op 108
+#define xtensa_rfwo_op 109
+#define xtensa_rfwu_op 110
+#define xtensa_ritlb0_op 111
+#define xtensa_ritlb1_op 112
+#define xtensa_rotw_op 113
+#define xtensa_rsil_op 114
+#define xtensa_rsr_op 115
+#define xtensa_rsync_op 116
+#define xtensa_s16i_op 117
+#define xtensa_s32e_op 118
+#define xtensa_s32i_op 119
+#define xtensa_s32i_n_op 120
+#define xtensa_s8i_op 121
+#define xtensa_sdct_op 122
+#define xtensa_sict_op 123
+#define xtensa_sicw_op 124
+#define xtensa_simcall_op 125
+#define xtensa_sll_op 126
+#define xtensa_slli_op 127
+#define xtensa_sra_op 128
+#define xtensa_srai_op 129
+#define xtensa_src_op 130
+#define xtensa_srl_op 131
+#define xtensa_srli_op 132
+#define xtensa_ssa8b_op 133
+#define xtensa_ssa8l_op 134
+#define xtensa_ssai_op 135
+#define xtensa_ssl_op 136
+#define xtensa_ssr_op 137
+#define xtensa_sub_op 138
+#define xtensa_subx2_op 139
+#define xtensa_subx4_op 140
+#define xtensa_subx8_op 141
+#define xtensa_syscall_op 142
+#define xtensa_waiti_op 143
+#define xtensa_wdtlb_op 144
+#define xtensa_witlb_op 145
+#define xtensa_wsr_op 146
+#define xtensa_xor_op 147
+#define xtensa_xsr_op 148
+
+int
+decode_insn (const xtensa_insnbuf insn)
+{
+  switch (get_op0_field (insn)) {
+  case 0: /* QRST: op0=0000 */
+    switch (get_op1_field (insn)) {
+    case 3: /* RST3: op1=0011 */
+      switch (get_op2_field (insn)) {
+      case 8: /* MOVEQZ: op2=1000 */
+        return xtensa_moveqz_op;
+      case 9: /* MOVNEZ: op2=1001 */
+        return xtensa_movnez_op;
+      case 10: /* MOVLTZ: op2=1010 */
+        return xtensa_movltz_op;
+      case 11: /* MOVGEZ: op2=1011 */
+        return xtensa_movgez_op;
+      case 0: /* RSR: op2=0000 */
+        return xtensa_rsr_op;
+      case 1: /* WSR: op2=0001 */
+        return xtensa_wsr_op;
+      }
       break;
-    case 1:
-      return 83; /* l32r */
-    case 2:
-      switch (Field_r_Slot_inst_get (insn))
-       {
-       case 0:
-         return 84; /* l8ui */
-       case 1:
-         return 80; /* l16ui */
-       case 2:
-         return 82; /* l32i */
-       case 4:
-         return 99; /* s8i */
-       case 5:
-         return 97; /* s16i */
-       case 6:
-         return 98; /* s32i */
-       case 7:
-         switch (Field_t_Slot_inst_get (insn))
-           {
-           case 0:
-             return 258; /* dpfr */
-           case 1:
-             return 259; /* dpfw */
-           case 2:
-             return 260; /* dpfro */
-           case 3:
-             return 261; /* dpfwo */
-           case 4:
-             return 252; /* dhwb */
-           case 5:
-             return 253; /* dhwbi */
-           case 6:
-             return 256; /* dhi */
-           case 7:
-             return 257; /* dii */
-           case 8:
-             switch (Field_op1_Slot_inst_get (insn))
-               {
-               case 4:
-                 return 254; /* diwb */
-               case 5:
-                 return 255; /* diwbi */
-               }
-             break;
-           case 12:
-             return 245; /* ipf */
-           case 14:
-             return 246; /* ihi */
-           case 15:
-             return 247; /* iii */
-           }
-         break;
-       case 9:
-         return 81; /* l16si */
-       case 10:
-         return 88; /* movi */
-       case 12:
-         return 37; /* addi */
-       case 13:
-         return 38; /* addmi */
-       }
+    case 9: /* LSI4: op1=1001 */
+      switch (get_op2_field (insn)) {
+      case 4: /* S32E: op2=0100 */
+        return xtensa_s32e_op;
+      case 0: /* L32E: op2=0000 */
+        return xtensa_l32e_op;
+      }
       break;
-    case 5:
-      switch (Field_n_Slot_inst_get (insn))
-       {
-       case 0:
-         return 74; /* call0 */
-       case 1:
-         return 7; /* call4 */
-       case 2:
-         return 6; /* call8 */
-       case 3:
-         return 5; /* call12 */
-       }
+    case 4: /* EXTUI: op1=010x */
+    case 5: /* EXTUI: op1=010x */
+      return xtensa_extui_op;
+    case 0: /* RST0: op1=0000 */
+      switch (get_op2_field (insn)) {
+      case 15: /* SUBX8: op2=1111 */
+        return xtensa_subx8_op;
+      case 0: /* ST0: op2=0000 */
+        switch (get_r_field (insn)) {
+        case 0: /* SNM0: r=0000 */
+          switch (get_m_field (insn)) {
+          case 2: /* JR: m=10 */
+            switch (get_n_field (insn)) {
+            case 0: /* RET: n=00 */
+              return xtensa_ret_op;
+            case 1: /* RETW: n=01 */
+              return xtensa_retw_op;
+            case 2: /* JX: n=10 */
+              return xtensa_jx_op;
+            }
+            break;
+          case 3: /* CALLX: m=11 */
+            switch (get_n_field (insn)) {
+            case 0: /* CALLX0: n=00 */
+              return xtensa_callx0_op;
+            case 1: /* CALLX4: n=01 */
+              return xtensa_callx4_op;
+            case 2: /* CALLX8: n=10 */
+              return xtensa_callx8_op;
+            case 3: /* CALLX12: n=11 */
+              return xtensa_callx12_op;
+            }
+            break;
+          }
+          break;
+        case 1: /* MOVSP: r=0001 */
+          return xtensa_movsp_op;
+        case 2: /* SYNC: r=0010 */
+          switch (get_s_field (insn)) {
+          case 0: /* SYNCT: s=0000 */
+            switch (get_t_field (insn)) {
+            case 2: /* ESYNC: t=0010 */
+              return xtensa_esync_op;
+            case 3: /* DSYNC: t=0011 */
+              return xtensa_dsync_op;
+            case 8: /* EXCW: t=1000 */
+              return xtensa_excw_op;
+            case 12: /* MEMW: t=1100 */
+              return xtensa_memw_op;
+            case 0: /* ISYNC: t=0000 */
+              return xtensa_isync_op;
+            case 1: /* RSYNC: t=0001 */
+              return xtensa_rsync_op;
+            }
+            break;
+          }
+          break;
+        case 4: /* BREAK: r=0100 */
+          return xtensa_break_op;
+        case 3: /* RFEI: r=0011 */
+          switch (get_t_field (insn)) {
+          case 0: /* RFET: t=0000 */
+            switch (get_s_field (insn)) {
+            case 2: /* RFDE: s=0010 */
+              return xtensa_rfde_op;
+            case 4: /* RFWO: s=0100 */
+              return xtensa_rfwo_op;
+            case 5: /* RFWU: s=0101 */
+              return xtensa_rfwu_op;
+            case 0: /* RFE: s=0000 */
+              return xtensa_rfe_op;
+            }
+            break;
+          case 1: /* RFI: t=0001 */
+            return xtensa_rfi_op;
+          }
+          break;
+        case 5: /* SCALL: r=0101 */
+          switch (get_s_field (insn)) {
+          case 0: /* SYSCALL: s=0000 */
+            return xtensa_syscall_op;
+          case 1: /* SIMCALL: s=0001 */
+            return xtensa_simcall_op;
+          }
+          break;
+        case 6: /* RSIL: r=0110 */
+          return xtensa_rsil_op;
+        case 7: /* WAITI: r=0111 */
+          return xtensa_waiti_op;
+        }
+        break;
+      case 1: /* AND: op2=0001 */
+        return xtensa_and_op;
+      case 2: /* OR: op2=0010 */
+        return xtensa_or_op;
+      case 3: /* XOR: op2=0011 */
+        return xtensa_xor_op;
+      case 4: /* ST1: op2=0100 */
+        switch (get_r_field (insn)) {
+        case 15: /* NSAU: r=1111 */
+          return xtensa_nsau_op;
+        case 0: /* SSR: r=0000 */
+          return xtensa_ssr_op;
+        case 1: /* SSL: r=0001 */
+          return xtensa_ssl_op;
+        case 2: /* SSA8L: r=0010 */
+          return xtensa_ssa8l_op;
+        case 3: /* SSA8B: r=0011 */
+          return xtensa_ssa8b_op;
+        case 4: /* SSAI: r=0100 */
+          return xtensa_ssai_op;
+        case 8: /* ROTW: r=1000 */
+          return xtensa_rotw_op;
+        case 14: /* NSA: r=1110 */
+          return xtensa_nsa_op;
+        }
+        break;
+      case 8: /* ADD: op2=1000 */
+        return xtensa_add_op;
+      case 5: /* ST4: op2=0101 */
+        switch (get_r_field (insn)) {
+        case 15: /* RDTLB1: r=1111 */
+          return xtensa_rdtlb1_op;
+        case 0: /* IITLBA: r=0000 */
+          return xtensa_iitlba_op;
+        case 3: /* RITLB0: r=0011 */
+          return xtensa_ritlb0_op;
+        case 4: /* IITLB: r=0100 */
+          return xtensa_iitlb_op;
+        case 8: /* IDTLBA: r=1000 */
+          return xtensa_idtlba_op;
+        case 5: /* PITLB: r=0101 */
+          return xtensa_pitlb_op;
+        case 6: /* WITLB: r=0110 */
+          return xtensa_witlb_op;
+        case 7: /* RITLB1: r=0111 */
+          return xtensa_ritlb1_op;
+        case 11: /* RDTLB0: r=1011 */
+          return xtensa_rdtlb0_op;
+        case 12: /* IDTLB: r=1100 */
+          return xtensa_idtlb_op;
+        case 13: /* PDTLB: r=1101 */
+          return xtensa_pdtlb_op;
+        case 14: /* WDTLB: r=1110 */
+          return xtensa_wdtlb_op;
+        }
+        break;
+      case 6: /* RT0: op2=0110 */
+        switch (get_s_field (insn)) {
+        case 0: /* NEG: s=0000 */
+          return xtensa_neg_op;
+        case 1: /* ABS: s=0001 */
+          return xtensa_abs_op;
+        }
+        break;
+      case 9: /* ADDX2: op2=1001 */
+        return xtensa_addx2_op;
+      case 10: /* ADDX4: op2=1010 */
+        return xtensa_addx4_op;
+      case 11: /* ADDX8: op2=1011 */
+        return xtensa_addx8_op;
+      case 12: /* SUB: op2=1100 */
+        return xtensa_sub_op;
+      case 13: /* SUBX2: op2=1101 */
+        return xtensa_subx2_op;
+      case 14: /* SUBX4: op2=1110 */
+        return xtensa_subx4_op;
+      }
       break;
-    case 6:
-      switch (Field_n_Slot_inst_get (insn))
-       {
-       case 0:
-         return 78; /* j */
-       case 1:
-         switch (Field_m_Slot_inst_get (insn))
-           {
-           case 0:
-             return 70; /* beqz */
-           case 1:
-             return 71; /* bnez */
-           case 2:
-             return 73; /* bltz */
-           case 3:
-             return 72; /* bgez */
-           }
-         break;
-       case 2:
-         switch (Field_m_Slot_inst_get (insn))
-           {
-           case 0:
-             return 50; /* beqi */
-           case 1:
-             return 51; /* bnei */
-           case 2:
-             return 53; /* blti */
-           case 3:
-             return 52; /* bgei */
-           }
-         break;
-       case 3:
-         switch (Field_m_Slot_inst_get (insn))
-           {
-           case 0:
-             return 11; /* entry */
-           case 1:
-             switch (Field_r_Slot_inst_get (insn))
-               {
-               case 8:
-                 return 85; /* loop */
-               case 9:
-                 return 86; /* loopnez */
-               case 10:
-                 return 87; /* loopgtz */
-               }
-             break;
-           case 2:
-             return 57; /* bltui */
-           case 3:
-             return 56; /* bgeui */
-           }
-         break;
-       }
+    case 1: /* RST1: op1=0001 */
+      switch (get_op2_field (insn)) {
+      case 15: /* IMP: op2=1111 */
+        switch (get_r_field (insn)) {
+        case 0: /* LICT: r=0000 */
+          return xtensa_lict_op;
+        case 1: /* SICT: r=0001 */
+          return xtensa_sict_op;
+        case 2: /* LICW: r=0010 */
+          return xtensa_licw_op;
+        case 3: /* SICW: r=0011 */
+          return xtensa_sicw_op;
+        case 8: /* LDCT: r=1000 */
+          return xtensa_ldct_op;
+        case 9: /* SDCT: r=1001 */
+          return xtensa_sdct_op;
+        }
+        break;
+      case 0: /* SLLI: op2=000x */
+      case 1: /* SLLI: op2=000x */
+        return xtensa_slli_op;
+      case 2: /* SRAI: op2=001x */
+      case 3: /* SRAI: op2=001x */
+        return xtensa_srai_op;
+      case 4: /* SRLI: op2=0100 */
+        return xtensa_srli_op;
+      case 8: /* SRC: op2=1000 */
+        return xtensa_src_op;
+      case 9: /* SRL: op2=1001 */
+        return xtensa_srl_op;
+      case 6: /* XSR: op2=0110 */
+        return xtensa_xsr_op;
+      case 10: /* SLL: op2=1010 */
+        return xtensa_sll_op;
+      case 11: /* SRA: op2=1011 */
+        return xtensa_sra_op;
+      }
       break;
-    case 7:
-      switch (Field_r_Slot_inst_get (insn))
-       {
-       case 0:
-         return 65; /* bnone */
-       case 1:
-         return 58; /* beq */
-       case 2:
-         return 61; /* blt */
-       case 3:
-         return 63; /* bltu */
-       case 4:
-         return 66; /* ball */
-       case 5:
-         return 68; /* bbc */
-       case 6:
-       case 7:
-         return 54; /* bbci */
-       case 8:
-         return 64; /* bany */
-       case 9:
-         return 59; /* bne */
-       case 10:
-         return 60; /* bge */
-       case 11:
-         return 62; /* bgeu */
-       case 12:
-         return 67; /* bnall */
-       case 13:
-         return 69; /* bbs */
-       case 14:
-       case 15:
-         return 55; /* bbsi */
-       }
+    }
+    break;
+  case 1: /* L32R: op0=0001 */
+    return xtensa_l32r_op;
+  case 2: /* LSAI: op0=0010 */
+    switch (get_r_field (insn)) {
+    case 0: /* L8UI: r=0000 */
+      return xtensa_l8ui_op;
+    case 1: /* L16UI: r=0001 */
+      return xtensa_l16ui_op;
+    case 2: /* L32I: r=0010 */
+      return xtensa_l32i_op;
+    case 4: /* S8I: r=0100 */
+      return xtensa_s8i_op;
+    case 5: /* S16I: r=0101 */
+      return xtensa_s16i_op;
+    case 9: /* L16SI: r=1001 */
+      return xtensa_l16si_op;
+    case 6: /* S32I: r=0110 */
+      return xtensa_s32i_op;
+    case 7: /* CACHE: r=0111 */
+      switch (get_t_field (insn)) {
+      case 15: /* III: t=1111 */
+        return xtensa_iii_op;
+      case 0: /* DPFR: t=0000 */
+        return xtensa_dpfr_op;
+      case 1: /* DPFW: t=0001 */
+        return xtensa_dpfw_op;
+      case 2: /* DPFRO: t=0010 */
+        return xtensa_dpfro_op;
+      case 4: /* DHWB: t=0100 */
+        return xtensa_dhwb_op;
+      case 3: /* DPFWO: t=0011 */
+        return xtensa_dpfwo_op;
+      case 8: /* DCE: t=1000 */
+        switch (get_op1_field (insn)) {
+        case 4: /* DIWB: op1=0100 */
+          return xtensa_diwb_op;
+        case 5: /* DIWBI: op1=0101 */
+          return xtensa_diwbi_op;
+        }
+        break;
+      case 5: /* DHWBI: t=0101 */
+        return xtensa_dhwbi_op;
+      case 6: /* DHI: t=0110 */
+        return xtensa_dhi_op;
+      case 7: /* DII: t=0111 */
+        return xtensa_dii_op;
+      case 12: /* IPF: t=1100 */
+        return xtensa_ipf_op;
+      case 14: /* IHI: t=1110 */
+        return xtensa_ihi_op;
+      }
       break;
+    case 10: /* MOVI: r=1010 */
+      return xtensa_movi_op;
+    case 12: /* ADDI: r=1100 */
+      return xtensa_addi_op;
+    case 13: /* ADDMI: r=1101 */
+      return xtensa_addmi_op;
     }
-  return 0;
-}
-
-static int
-Slot_inst16b_decode (const xtensa_insnbuf insn)
-{
-  switch (Field_op0_Slot_inst16b_get (insn))
-    {
-    case 12:
-      switch (Field_i_Slot_inst16b_get (insn))
-       {
-       case 0:
-         return 33; /* movi.n */
-       case 1:
-         switch (Field_z_Slot_inst16b_get (insn))
-           {
-           case 0:
-             return 28; /* beqz.n */
-           case 1:
-             return 29; /* bnez.n */
-           }
-         break;
-       }
+    break;
+  case 8: /* L32I.N: op0=1000 */
+    return xtensa_l32i_n_op;
+  case 5: /* CALL: op0=0101 */
+    switch (get_n_field (insn)) {
+    case 0: /* CALL0: n=00 */
+      return xtensa_call0_op;
+    case 1: /* CALL4: n=01 */
+      return xtensa_call4_op;
+    case 2: /* CALL8: n=10 */
+      return xtensa_call8_op;
+    case 3: /* CALL12: n=11 */
+      return xtensa_call12_op;
+    }
+    break;
+  case 6: /* SI: op0=0110 */
+    switch (get_n_field (insn)) {
+    case 0: /* J: n=00 */
+      return xtensa_j_op;
+    case 1: /* BZ: n=01 */
+      switch (get_m_field (insn)) {
+      case 0: /* BEQZ: m=00 */
+        return xtensa_beqz_op;
+      case 1: /* BNEZ: m=01 */
+        return xtensa_bnez_op;
+      case 2: /* BLTZ: m=10 */
+        return xtensa_bltz_op;
+      case 3: /* BGEZ: m=11 */
+        return xtensa_bgez_op;
+      }
+      break;
+    case 2: /* BI0: n=10 */
+      switch (get_m_field (insn)) {
+      case 0: /* BEQI: m=00 */
+        return xtensa_beqi_op;
+      case 1: /* BNEI: m=01 */
+        return xtensa_bnei_op;
+      case 2: /* BLTI: m=10 */
+        return xtensa_blti_op;
+      case 3: /* BGEI: m=11 */
+        return xtensa_bgei_op;
+      }
       break;
-    case 13:
-      switch (Field_r_Slot_inst16b_get (insn))
-       {
-       case 0:
-         return 32; /* mov.n */
-       case 15:
-         switch (Field_t_Slot_inst16b_get (insn))
-           {
-           case 0:
-             return 35; /* ret.n */
-           case 1:
-             return 15; /* retw.n */
-           case 2:
-             return 197; /* break.n */
-           case 3:
-             if (Field_s_Slot_inst16b_get (insn) == 0)
-               return 34; /* nop.n */
-             break;
-           case 6:
-             return 30; /* ill.n */
-           }
-         break;
-       }
+    case 3: /* BI1: n=11 */
+      switch (get_m_field (insn)) {
+      case 0: /* ENTRY: m=00 */
+        return xtensa_entry_op;
+      case 1: /* B1: m=01 */
+        switch (get_r_field (insn)) {
+        case 8: /* LOOP: r=1000 */
+          return xtensa_loop_op;
+        case 9: /* LOOPNEZ: r=1001 */
+          return xtensa_loopnez_op;
+        case 10: /* LOOPGTZ: r=1010 */
+          return xtensa_loopgtz_op;
+        }
+        break;
+      case 2: /* BLTUI: m=10 */
+        return xtensa_bltui_op;
+      case 3: /* BGEUI: m=11 */
+        return xtensa_bgeui_op;
+      }
       break;
     }
-  return 0;
-}
-
-static int
-Slot_inst16a_decode (const xtensa_insnbuf insn)
-{
-  switch (Field_op0_Slot_inst16a_get (insn))
-    {
-    case 8:
-      return 31; /* l32i.n */
-    case 9:
-      return 36; /* s32i.n */
-    case 10:
-      return 26; /* add.n */
-    case 11:
-      return 27; /* addi.n */
+    break;
+  case 9: /* S32I.N: op0=1001 */
+    return xtensa_s32i_n_op;
+  case 10: /* ADD.N: op0=1010 */
+    return xtensa_add_n_op;
+  case 7: /* B: op0=0111 */
+    switch (get_r_field (insn)) {
+    case 6: /* BBCI: r=011x */
+    case 7: /* BBCI: r=011x */
+      return xtensa_bbci_op;
+    case 0: /* BNONE: r=0000 */
+      return xtensa_bnone_op;
+    case 1: /* BEQ: r=0001 */
+      return xtensa_beq_op;
+    case 2: /* BLT: r=0010 */
+      return xtensa_blt_op;
+    case 4: /* BALL: r=0100 */
+      return xtensa_ball_op;
+    case 14: /* BBSI: r=111x */
+    case 15: /* BBSI: r=111x */
+      return xtensa_bbsi_op;
+    case 3: /* BLTU: r=0011 */
+      return xtensa_bltu_op;
+    case 5: /* BBC: r=0101 */
+      return xtensa_bbc_op;
+    case 8: /* BANY: r=1000 */
+      return xtensa_bany_op;
+    case 9: /* BNE: r=1001 */
+      return xtensa_bne_op;
+    case 10: /* BGE: r=1010 */
+      return xtensa_bge_op;
+    case 11: /* BGEU: r=1011 */
+      return xtensa_bgeu_op;
+    case 12: /* BNALL: r=1100 */
+      return xtensa_bnall_op;
+    case 13: /* BBS: r=1101 */
+      return xtensa_bbs_op;
     }
-  return 0;
-}
-
-\f
-/* Instruction slots.  */
-
-static void
-Slot_x24_Format_inst_0_get (const xtensa_insnbuf insn,
-                           xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = (insn[0] & 0xffffff);
-}
-
-static void
-Slot_x24_Format_inst_0_set (xtensa_insnbuf insn,
-                           const xtensa_insnbuf slotbuf)
-{
-  insn[0] = (insn[0] & ~0xffffff) | (slotbuf[0] & 0xffffff);
-}
-
-static void
-Slot_x16a_Format_inst16a_0_get (const xtensa_insnbuf insn,
-                               xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = ((insn[0] & 0xffff00) >> 8);
-}
-
-static void
-Slot_x16a_Format_inst16a_0_set (xtensa_insnbuf insn,
-                               const xtensa_insnbuf slotbuf)
-{
-  insn[0] = (insn[0] & ~0xffff00) | ((slotbuf[0] & 0xffff) << 8);
-}
-
-static void
-Slot_x16b_Format_inst16b_0_get (const xtensa_insnbuf insn,
-                               xtensa_insnbuf slotbuf)
-{
-  slotbuf[0] = ((insn[0] & 0xffff00) >> 8);
-}
-
-static void
-Slot_x16b_Format_inst16b_0_set (xtensa_insnbuf insn,
-                               const xtensa_insnbuf slotbuf)
-{
-  insn[0] = (insn[0] & ~0xffff00) | ((slotbuf[0] & 0xffff) << 8);
-}
-
-static xtensa_get_field_fn
-Slot_inst_get_field_fns[] = {
-  Field_t_Slot_inst_get,
-  Field_bbi4_Slot_inst_get,
-  Field_bbi_Slot_inst_get,
-  Field_imm12_Slot_inst_get,
-  Field_imm8_Slot_inst_get,
-  Field_s_Slot_inst_get,
-  Field_imm12b_Slot_inst_get,
-  Field_imm16_Slot_inst_get,
-  Field_m_Slot_inst_get,
-  Field_n_Slot_inst_get,
-  Field_offset_Slot_inst_get,
-  Field_op0_Slot_inst_get,
-  Field_op1_Slot_inst_get,
-  Field_op2_Slot_inst_get,
-  Field_r_Slot_inst_get,
-  Field_sa4_Slot_inst_get,
-  Field_sae4_Slot_inst_get,
-  Field_sae_Slot_inst_get,
-  Field_sal_Slot_inst_get,
-  Field_sargt_Slot_inst_get,
-  Field_sas4_Slot_inst_get,
-  Field_sas_Slot_inst_get,
-  Field_sr_Slot_inst_get,
-  Field_st_Slot_inst_get,
-  Field_thi3_Slot_inst_get,
-  Field_imm4_Slot_inst_get,
-  Field_mn_Slot_inst_get,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Implicit_Field_ar0_get,
-  Implicit_Field_ar4_get,
-  Implicit_Field_ar8_get,
-  Implicit_Field_ar12_get
-};
-
-static xtensa_set_field_fn
-Slot_inst_set_field_fns[] = {
-  Field_t_Slot_inst_set,
-  Field_bbi4_Slot_inst_set,
-  Field_bbi_Slot_inst_set,
-  Field_imm12_Slot_inst_set,
-  Field_imm8_Slot_inst_set,
-  Field_s_Slot_inst_set,
-  Field_imm12b_Slot_inst_set,
-  Field_imm16_Slot_inst_set,
-  Field_m_Slot_inst_set,
-  Field_n_Slot_inst_set,
-  Field_offset_Slot_inst_set,
-  Field_op0_Slot_inst_set,
-  Field_op1_Slot_inst_set,
-  Field_op2_Slot_inst_set,
-  Field_r_Slot_inst_set,
-  Field_sa4_Slot_inst_set,
-  Field_sae4_Slot_inst_set,
-  Field_sae_Slot_inst_set,
-  Field_sal_Slot_inst_set,
-  Field_sargt_Slot_inst_set,
-  Field_sas4_Slot_inst_set,
-  Field_sas_Slot_inst_set,
-  Field_sr_Slot_inst_set,
-  Field_st_Slot_inst_set,
-  Field_thi3_Slot_inst_set,
-  Field_imm4_Slot_inst_set,
-  Field_mn_Slot_inst_set,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set
-};
-
-static xtensa_get_field_fn
-Slot_inst16a_get_field_fns[] = {
-  Field_t_Slot_inst16a_get,
-  0,
-  0,
-  0,
-  0,
-  Field_s_Slot_inst16a_get,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_op0_Slot_inst16a_get,
-  0,
-  0,
-  Field_r_Slot_inst16a_get,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_sr_Slot_inst16a_get,
-  Field_st_Slot_inst16a_get,
-  0,
-  Field_imm4_Slot_inst16a_get,
-  0,
-  Field_i_Slot_inst16a_get,
-  Field_imm6lo_Slot_inst16a_get,
-  Field_imm6hi_Slot_inst16a_get,
-  Field_imm7lo_Slot_inst16a_get,
-  Field_imm7hi_Slot_inst16a_get,
-  Field_z_Slot_inst16a_get,
-  Field_imm6_Slot_inst16a_get,
-  Field_imm7_Slot_inst16a_get,
-  Implicit_Field_ar0_get,
-  Implicit_Field_ar4_get,
-  Implicit_Field_ar8_get,
-  Implicit_Field_ar12_get
-};
-
-static xtensa_set_field_fn
-Slot_inst16a_set_field_fns[] = {
-  Field_t_Slot_inst16a_set,
-  0,
-  0,
-  0,
-  0,
-  Field_s_Slot_inst16a_set,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_op0_Slot_inst16a_set,
-  0,
-  0,
-  Field_r_Slot_inst16a_set,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_sr_Slot_inst16a_set,
-  Field_st_Slot_inst16a_set,
-  0,
-  Field_imm4_Slot_inst16a_set,
-  0,
-  Field_i_Slot_inst16a_set,
-  Field_imm6lo_Slot_inst16a_set,
-  Field_imm6hi_Slot_inst16a_set,
-  Field_imm7lo_Slot_inst16a_set,
-  Field_imm7hi_Slot_inst16a_set,
-  Field_z_Slot_inst16a_set,
-  Field_imm6_Slot_inst16a_set,
-  Field_imm7_Slot_inst16a_set,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set
-};
-
-static xtensa_get_field_fn
-Slot_inst16b_get_field_fns[] = {
-  Field_t_Slot_inst16b_get,
-  0,
-  0,
-  0,
-  0,
-  Field_s_Slot_inst16b_get,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_op0_Slot_inst16b_get,
-  0,
-  0,
-  Field_r_Slot_inst16b_get,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_sr_Slot_inst16b_get,
-  Field_st_Slot_inst16b_get,
-  0,
-  Field_imm4_Slot_inst16b_get,
-  0,
-  Field_i_Slot_inst16b_get,
-  Field_imm6lo_Slot_inst16b_get,
-  Field_imm6hi_Slot_inst16b_get,
-  Field_imm7lo_Slot_inst16b_get,
-  Field_imm7hi_Slot_inst16b_get,
-  Field_z_Slot_inst16b_get,
-  Field_imm6_Slot_inst16b_get,
-  Field_imm7_Slot_inst16b_get,
-  Implicit_Field_ar0_get,
-  Implicit_Field_ar4_get,
-  Implicit_Field_ar8_get,
-  Implicit_Field_ar12_get
-};
-
-static xtensa_set_field_fn
-Slot_inst16b_set_field_fns[] = {
-  Field_t_Slot_inst16b_set,
-  0,
-  0,
-  0,
-  0,
-  Field_s_Slot_inst16b_set,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_op0_Slot_inst16b_set,
-  0,
-  0,
-  Field_r_Slot_inst16b_set,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  Field_sr_Slot_inst16b_set,
-  Field_st_Slot_inst16b_set,
-  0,
-  Field_imm4_Slot_inst16b_set,
-  0,
-  Field_i_Slot_inst16b_set,
-  Field_imm6lo_Slot_inst16b_set,
-  Field_imm6hi_Slot_inst16b_set,
-  Field_imm7lo_Slot_inst16b_set,
-  Field_imm7hi_Slot_inst16b_set,
-  Field_z_Slot_inst16b_set,
-  Field_imm6_Slot_inst16b_set,
-  Field_imm7_Slot_inst16b_set,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set,
-  Implicit_Field_set
-};
-
-static xtensa_slot_internal slots[] = {
-  { "Inst", "x24", 0,
-    Slot_x24_Format_inst_0_get, Slot_x24_Format_inst_0_set,
-    Slot_inst_get_field_fns, Slot_inst_set_field_fns,
-    Slot_inst_decode, "nop" },
-  { "Inst16a", "x16a", 0,
-    Slot_x16a_Format_inst16a_0_get, Slot_x16a_Format_inst16a_0_set,
-    Slot_inst16a_get_field_fns, Slot_inst16a_set_field_fns,
-    Slot_inst16a_decode, "" },
-  { "Inst16b", "x16b", 0,
-    Slot_x16b_Format_inst16b_0_get, Slot_x16b_Format_inst16b_0_set,
-    Slot_inst16b_get_field_fns, Slot_inst16b_set_field_fns,
-    Slot_inst16b_decode, "nop.n" }
-};
-
-\f
-/* Instruction formats.  */
-
-static void
-Format_x24_encode (xtensa_insnbuf insn)
-{
-  insn[0] = 0;
-}
-
-static void
-Format_x16a_encode (xtensa_insnbuf insn)
-{
-  insn[0] = 0x800000;
+    break;
+  case 11: /* ADDI.N: op0=1011 */
+    return xtensa_addi_n_op;
+  case 12: /* ST2: op0=1100 */
+    switch (get_i_field (insn)) {
+    case 0: /* MOVI.N: i=0 */
+      return xtensa_movi_n_op;
+    case 1: /* BZ6: i=1 */
+      switch (get_z_field (insn)) {
+      case 0: /* BEQZ.N: z=0 */
+        return xtensa_beqz_n_op;
+      case 1: /* BNEZ.N: z=1 */
+        return xtensa_bnez_n_op;
+      }
+      break;
+    }
+    break;
+  case 13: /* ST3: op0=1101 */
+    switch (get_r_field (insn)) {
+    case 15: /* S3: r=1111 */
+      switch (get_t_field (insn)) {
+      case 0: /* RET.N: t=0000 */
+        return xtensa_ret_n_op;
+      case 1: /* RETW.N: t=0001 */
+        return xtensa_retw_n_op;
+      case 2: /* BREAK.N: t=0010 */
+        return xtensa_break_n_op;
+      case 3: /* NOP.N: t=0011 */
+        return xtensa_nop_n_op;
+      }
+      break;
+    case 0: /* MOV.N: r=0000 */
+      return xtensa_mov_n_op;
+    }
+    break;
+  }
+  return XTENSA_UNDEFINED;
 }
 
-static void
-Format_x16b_encode (xtensa_insnbuf insn)
+int
+interface_version (void)
 {
-  insn[0] = 0xc00000;
+  return 3;
 }
 
-static int Format_x24_slots[] = { 0 };
-
-static int Format_x16a_slots[] = { 1 };
-
-static int Format_x16b_slots[] = { 2 };
-
-static xtensa_format_internal formats[] = {
-  { "x24", 3, Format_x24_encode, 1, Format_x24_slots },
-  { "x16a", 2, Format_x16a_encode, 1, Format_x16a_slots },
-  { "x16b", 2, Format_x16b_encode, 1, Format_x16b_slots }
+static struct config_struct config_table[] = {
+  {"IsaMemoryOrder", "BigEndian"},
+  {"PIFReadDataBits", "128"},
+  {"PIFWriteDataBits", "128"},
+  {"IsaCoprocessorCount", "0"},
+  {"IsaUseBooleans", "0"},
+  {"IsaUseDensityInstruction", "1"},
+  {0, 0}
 };
 
+struct config_struct * get_config_table (void);
 
-static int
-format_decoder (const xtensa_insnbuf insn)
+struct config_struct *
+get_config_table (void)
 {
-  if ((insn[0] & 0x800000) == 0)
-    return 0; /* x24 */
-  if ((insn[0] & 0xc00000) == 0x800000)
-    return 1; /* x16a */
-  if ((insn[0] & 0xe00000) == 0xc00000)
-    return 2; /* x16b */
-  return -1;
+  return config_table;
 }
 
-static int length_table[16] = {
-  3,
-  3,
-  3,
-  3,
-  3,
-  3,
-  3,
-  3,
-  2,
-  2,
-  2,
-  2,
-  2,
-  2,
-  -1,
-  -1
-};
-
-static int
-length_decoder (const char *insn)
-{
-  int op0 = (insn[0] >> 4) & 0xf;
-  return length_table[op0];
-}
-
-\f
-/* Top-level ISA structure.  */
-
-xtensa_isa_internal xtensa_modules = {
-  1 /* big-endian */,
-  3 /* insn_size */, 0,
-  3, formats, format_decoder, length_decoder,
-  3, slots,
-  39 /* num_fields */,
-  70, operands,
-  220, iclasses,
-  276, opcodes, 0,
-  1, regfiles,
-  NUM_STATES, states, 0,
-  NUM_SYSREGS, sysregs, 0,
-  { MAX_SPECIAL_REG, MAX_USER_REG }, { 0, 0 },
-  0, interfaces, 0,
-  0, funcUnits, 0
+xtensa_isa_module xtensa_isa_modules[] = {
+  { get_num_opcodes, get_opcodes, decode_insn, get_config_table },
+  { 0, 0, 0, 0 }
 };
index 7d0185e019ed6b83bca92431ff478d7e19b0037e..3826ba124bda812afa9676c3b7a532b82f3a026d 100755 (executable)
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
-timestamp='2004-09-07'
+timestamp='2004-08-29'
 
 # 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
@@ -827,9 +827,6 @@ EOF
     crisv32:Linux:*:*)
        echo crisv32-axis-linux-gnu
        exit 0 ;;
-    frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
-       exit 0 ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit 0 ;;
index 5e417bdd259a6ec5f5c23eb4d67264ee01fb297f..e935a928b5e75b678e55dac82161179f1cb79ca7 100644 (file)
@@ -1,20 +1,3 @@
-2004-09-24  Zack Weinberg  <zack@codesourcery.com>
-
-       * warnings.m4: New file.
-
-2004-09-23  H.J. Lu  <hongjiu.lu@intel.com>
-
-       PR bootstrap/17369
-       * gcc-lib-path.m4: New file.
-
-2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
-
-       * gettext-sister.m4: Renamed from gettext.m4
-       * codeset.m4, gettext.m4, glibc21.m4, iconv.m4, intdiv0.m4, po.m4,
-       inttypes.m4, inttypes-pri.m4, inttypes_h.m4, lcmessage.m4, lib-ld.m4,
-       lib-link.m4, lib-prefix.m4, nls.m4, progtest.m4, stdint_h.m4,
-       uintmax_t.m4, ulonglong.m4: Import from gettext-0.12.1 sources.
-
 2004-08-31  Robert Bowdidge <bowdidge@apple.com>
 
        * mh-ppc-darwin: Add file, and override BOOT_CFLAGS.
diff --git a/config/codeset.m4 b/config/codeset.m4
deleted file mode 100644 (file)
index 59535eb..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# codeset.m4 serial AM1 (gettext-0.10.40)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([AM_LANGINFO_CODESET],
-[
-  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
-    [AC_TRY_LINK([#include <langinfo.h>],
-      [char* cs = nl_langinfo(CODESET);],
-      am_cv_langinfo_codeset=yes,
-      am_cv_langinfo_codeset=no)
-    ])
-  if test $am_cv_langinfo_codeset = yes; then
-    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
-      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
-  fi
-])
diff --git a/config/gcc-lib-path.m4 b/config/gcc-lib-path.m4
deleted file mode 100644 (file)
index 88c4023..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-AC_DEFUN([TL_AC_GNU_MAKE_GCC_LIB_PATH],
-[
-if test x"$SET_GCC_LIB_PATH_CMD" != x; then
-  # SET_GCC_LIB_PATH_CMD is "XXX=path; export XXX;". It is expanded to
-  #
-  #    eval "set_gcc_lib_path=XXX=path; export XXX;"
-  #
-  eval "set_gcc_lib_path=$SET_GCC_LIB_PATH_CMD"
-  # It will set set_gcc_lib_path to "export XXX=path" for GNU make.
-  set_gcc_lib_path="export $set_gcc_lib_path"
-else
-  set_gcc_lib_path=
-fi
-AC_SUBST(set_gcc_lib_path)
-])dnl
diff --git a/config/gettext-sister.m4 b/config/gettext-sister.m4
deleted file mode 100644 (file)
index d10aae8..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# intl sister-directory configuration rules.
-#
-
-# The idea behind this macro is that there's no need to repeat all the
-# autoconf probes done by the intl directory - it's already done them
-# for us.  In fact, there's no need even to look at the cache for the
-# answers.  All we need to do is nab a few pieces of information.
-# The intl directory is set up to make this easy, by generating a
-# small file which can be sourced as a shell script; then we produce
-# the necessary substitutions and definitions for this directory.
-
-AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR],
-[# If we haven't got the data from the intl directory,
-# assume NLS is disabled.
-USE_NLS=no     AC_SUBST(USE_NLS)
-LIBINTL=       AC_SUBST(LIBINTL)
-LIBINTL_DEP=   AC_SUBST(LIBINTL_DEP)
-INCINTL=       AC_SUBST(INCINTL)
-XGETTEXT=      AC_SUBST(XGETTEXT)
-GMSGFMT=       AC_SUBST(GMSGFMT)
-POSUB=         AC_SUBST(POSUB)
-if test -f ../intl/config.intl; then
-  . ../intl/config.intl
-fi
-AC_MSG_CHECKING([whether NLS is requested])
-if test x"$USE_NLS" != xyes; then
-  AC_MSG_RESULT(no)
-else
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(ENABLE_NLS, 1, 
- [Define to 1 if translation of program messages to the 
-  user's native language is requested.])
-
-  AC_MSG_CHECKING(for catalogs to be installed)
-  # Look for .po and .gmo files in the source directory.
-  CATALOGS=  AC_SUBST(CATALOGS)
-  XLINGUAS=
-  for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
-    # If there aren't any .gmo files the shell will give us the
-    # literal string "../path/to/srcdir/po/*.gmo" which has to be
-    # weeded out.
-    case "$cat" in *\**)
-      continue;;
-    esac
-    # The quadruple backslash is collapsed to a double backslash
-    # by the backticks, then collapsed again by the double quotes,
-    # leaving us with one backslash in the sed expression (right
-    # before the dot that mustn't act as a wildcard).
-    cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
-    lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
-    # The user is allowed to set LINGUAS to a list of languages to
-    # install catalogs for.  If it's empty that means "all of them."
-    if test "x$LINGUAS" = x; then
-      CATALOGS="$CATALOGS $cat"
-      XLINGUAS="$XLINGUAS $lang"
-    else
-      case "$LINGUAS" in *$lang*)
-        CATALOGS="$CATALOGS $cat"
-        XLINGUAS="$XLINGUAS $lang"
-        ;;
-      esac
-    fi
-  done
-  LINGUAS="$XLINGUAS"
-  AC_MSG_RESULT($LINGUAS)
-fi])
index 16070b40a99c5d99dffdf3e43672e75901355334..d10aae80b6b271db994c0cbd76b19db5896ef22e 100644 (file)
-# gettext.m4 serial 20 (gettext-0.12)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-
-dnl Macro to add for using GNU gettext.
-
-dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
-dnl    default (if it is not specified or empty) is 'no-libtool'.
-dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
-dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
-dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
-dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
-dnl    depending on --{enable,disable}-{shared,static} and on the presence of
-dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
-dnl    $(top_builddir)/intl/libintl.a will be created.
-dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
-dnl    implementations (in libc or libintl) without the ngettext() function
-dnl    will be ignored.  If NEEDSYMBOL is specified and is
-dnl    'need-formatstring-macros', then GNU gettext implementations that don't
-dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
-dnl INTLDIR is used to find the intl libraries.  If empty,
-dnl    the value `$(top_builddir)/intl/' is used.
-dnl
-dnl The result of the configuration is one of three cases:
-dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
-dnl    and used.
-dnl    Catalog format: GNU --> install in $(datadir)
-dnl    Catalog extension: .mo after installation, .gmo in source tree
-dnl 2) GNU gettext has been found in the system's C library.
-dnl    Catalog format: GNU --> install in $(datadir)
-dnl    Catalog extension: .mo after installation, .gmo in source tree
-dnl 3) No internationalization, always use English msgid.
-dnl    Catalog format: none
-dnl    Catalog extension: none
-dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
-dnl The use of .gmo is historical (it was needed to avoid overwriting the
-dnl GNU format catalogs when building on a platform with an X/Open gettext),
-dnl but we keep it in order not to force irrelevant filename changes on the
-dnl maintainers.
-dnl
-AC_DEFUN([AM_GNU_GETTEXT],
-[
-  dnl Argument checking.
-  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
-    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])])
-  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
-    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
-])])])])
-  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
-  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
-
-  AC_REQUIRE([AM_PO_SUBDIRS])dnl
-  ifelse(gt_included_intl, yes, [
-    AC_REQUIRE([AM_INTL_SUBDIR])dnl
-  ])
-
-  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-
-  dnl Sometimes libintl requires libiconv, so first search for libiconv.
-  dnl Ideally we would do this search only after the
-  dnl      if test "$USE_NLS" = "yes"; then
-  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
-  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
-  dnl the configure script would need to contain the same shell code
-  dnl again, outside any 'if'. There are two solutions:
-  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
-  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
-  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
-  dnl documented, we avoid it.
-  ifelse(gt_included_intl, yes, , [
-    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
-  ])
-
-  dnl Set USE_NLS.
-  AM_NLS
-
-  ifelse(gt_included_intl, yes, [
-    BUILD_INCLUDED_LIBINTL=no
-    USE_INCLUDED_LIBINTL=no
-  ])
-  LIBINTL=
-  LTLIBINTL=
-  POSUB=
-
-  dnl If we use NLS figure out what method
-  if test "$USE_NLS" = "yes"; then
-    gt_use_preinstalled_gnugettext=no
-    ifelse(gt_included_intl, yes, [
-      AC_MSG_CHECKING([whether included gettext is requested])
-      AC_ARG_WITH(included-gettext,
-        [  --with-included-gettext use the GNU gettext library included here],
-        nls_cv_force_use_gnu_gettext=$withval,
-        nls_cv_force_use_gnu_gettext=no)
-      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
-
-      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
-      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
-    ])
-        dnl User does not insist on using GNU NLS library.  Figure out what
-        dnl to use.  If GNU gettext is available we use this.  Else we have
-        dnl to fall back to GNU NLS library.
-
-        dnl Add a version number to the cache macros.
-        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
-        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
-        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
-
-        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
-         [AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;],
-            [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
-            gt_cv_func_gnugettext_libc=yes,
-            gt_cv_func_gnugettext_libc=no)])
-
-        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
-          dnl Sometimes libintl requires libiconv, so first search for libiconv.
-          ifelse(gt_included_intl, yes, , [
-            AM_ICONV_LINK
-          ])
-          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
-          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
-          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
-          dnl even if libiconv doesn't exist.
-          AC_LIB_LINKFLAGS_BODY([intl])
-          AC_CACHE_CHECK([for GNU gettext in libintl],
-            gt_cv_func_gnugettext_libintl,
-           [gt_save_CPPFLAGS="$CPPFLAGS"
-            CPPFLAGS="$CPPFLAGS $INCINTL"
-            gt_save_LIBS="$LIBS"
-            LIBS="$LIBS $LIBINTL"
-            dnl Now see whether libintl exists and does not depend on libiconv.
-            AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias ();],
-              [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
-              gt_cv_func_gnugettext_libintl=yes,
-              gt_cv_func_gnugettext_libintl=no)
-            dnl Now see whether libintl exists and depends on libiconv.
-            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
-              LIBS="$LIBS $LIBICONV"
-              AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias ();],
-                [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
-               [LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                gt_cv_func_gnugettext_libintl=yes
-               ])
-            fi
-            CPPFLAGS="$gt_save_CPPFLAGS"
-            LIBS="$gt_save_LIBS"])
-        fi
-
-        dnl If an already present or preinstalled GNU gettext() is found,
-        dnl use it.  But if this macro is used in GNU gettext, and GNU
-        dnl gettext is already preinstalled in libintl, we update this
-        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
-        if test "$gt_cv_func_gnugettext_libc" = "yes" \
-           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
-                && test "$PACKAGE" != gettext-runtime \
-                && test "$PACKAGE" != gettext-tools; }; then
-          gt_use_preinstalled_gnugettext=yes
-        else
-          dnl Reset the values set by searching for libintl.
-          LIBINTL=
-          LTLIBINTL=
-          INCINTL=
-        fi
-
-    ifelse(gt_included_intl, yes, [
-        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
-          dnl GNU gettext is not found in the C library.
-          dnl Fall back on included GNU gettext library.
-          nls_cv_use_gnu_gettext=yes
-        fi
-      fi
-
-      if test "$nls_cv_use_gnu_gettext" = "yes"; then
-        dnl Mark actions used to generate GNU NLS library.
-        BUILD_INCLUDED_LIBINTL=yes
-        USE_INCLUDED_LIBINTL=yes
-        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
-        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
-        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
-      fi
-
-      if test "$gt_use_preinstalled_gnugettext" = "yes" \
-         || test "$nls_cv_use_gnu_gettext" = "yes"; then
-        dnl Mark actions to use GNU gettext tools.
-        CATOBJEXT=.gmo
-      fi
-    ])
-
-    if test "$gt_use_preinstalled_gnugettext" = "yes" \
-       || test "$nls_cv_use_gnu_gettext" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1,
-        [Define to 1 if translation of program messages to the user's native language
-   is requested.])
-    else
-      USE_NLS=no
-    fi
-  fi
-
-  AC_MSG_CHECKING([whether to use NLS])
-  AC_MSG_RESULT([$USE_NLS])
-  if test "$USE_NLS" = "yes"; then
-    AC_MSG_CHECKING([where the gettext function comes from])
-    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
-        gt_source="external libintl"
-      else
-        gt_source="libc"
-      fi
+# intl sister-directory configuration rules.
+#
+
+# The idea behind this macro is that there's no need to repeat all the
+# autoconf probes done by the intl directory - it's already done them
+# for us.  In fact, there's no need even to look at the cache for the
+# answers.  All we need to do is nab a few pieces of information.
+# The intl directory is set up to make this easy, by generating a
+# small file which can be sourced as a shell script; then we produce
+# the necessary substitutions and definitions for this directory.
+
+AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR],
+[# If we haven't got the data from the intl directory,
+# assume NLS is disabled.
+USE_NLS=no     AC_SUBST(USE_NLS)
+LIBINTL=       AC_SUBST(LIBINTL)
+LIBINTL_DEP=   AC_SUBST(LIBINTL_DEP)
+INCINTL=       AC_SUBST(INCINTL)
+XGETTEXT=      AC_SUBST(XGETTEXT)
+GMSGFMT=       AC_SUBST(GMSGFMT)
+POSUB=         AC_SUBST(POSUB)
+if test -f ../intl/config.intl; then
+  . ../intl/config.intl
+fi
+AC_MSG_CHECKING([whether NLS is requested])
+if test x"$USE_NLS" != xyes; then
+  AC_MSG_RESULT(no)
+else
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(ENABLE_NLS, 1, 
+ [Define to 1 if translation of program messages to the 
+  user's native language is requested.])
+
+  AC_MSG_CHECKING(for catalogs to be installed)
+  # Look for .po and .gmo files in the source directory.
+  CATALOGS=  AC_SUBST(CATALOGS)
+  XLINGUAS=
+  for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
+    # If there aren't any .gmo files the shell will give us the
+    # literal string "../path/to/srcdir/po/*.gmo" which has to be
+    # weeded out.
+    case "$cat" in *\**)
+      continue;;
+    esac
+    # The quadruple backslash is collapsed to a double backslash
+    # by the backticks, then collapsed again by the double quotes,
+    # leaving us with one backslash in the sed expression (right
+    # before the dot that mustn't act as a wildcard).
+    cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
+    lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
+    # The user is allowed to set LINGUAS to a list of languages to
+    # install catalogs for.  If it's empty that means "all of them."
+    if test "x$LINGUAS" = x; then
+      CATALOGS="$CATALOGS $cat"
+      XLINGUAS="$XLINGUAS $lang"
     else
-      gt_source="included intl directory"
+      case "$LINGUAS" in *$lang*)
+        CATALOGS="$CATALOGS $cat"
+        XLINGUAS="$XLINGUAS $lang"
+        ;;
+      esac
     fi
-    AC_MSG_RESULT([$gt_source])
-  fi
-
-  if test "$USE_NLS" = "yes"; then
-
-    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
-        AC_MSG_CHECKING([how to link with libintl])
-        AC_MSG_RESULT([$LIBINTL])
-        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
-      fi
-
-      dnl For backward compatibility. Some packages may be using this.
-      AC_DEFINE(HAVE_GETTEXT, 1,
-       [Define if the GNU gettext() function is already present or preinstalled.])
-      AC_DEFINE(HAVE_DCGETTEXT, 1,
-       [Define if the GNU dcgettext() function is already present or preinstalled.])
-    fi
-
-    dnl We need to process the po/ directory.
-    POSUB=po
-  fi
-
-  ifelse(gt_included_intl, yes, [
-    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
-    dnl to 'yes' because some of the testsuite requires it.
-    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
-      BUILD_INCLUDED_LIBINTL=yes
-    fi
-
-    dnl Make all variables we use known to autoconf.
-    AC_SUBST(BUILD_INCLUDED_LIBINTL)
-    AC_SUBST(USE_INCLUDED_LIBINTL)
-    AC_SUBST(CATOBJEXT)
-
-    dnl For backward compatibility. Some configure.ins may be using this.
-    nls_cv_header_intl=
-    nls_cv_header_libgt=
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    DATADIRNAME=share
-    AC_SUBST(DATADIRNAME)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    INSTOBJEXT=.mo
-    AC_SUBST(INSTOBJEXT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    GENCAT=gencat
-    AC_SUBST(GENCAT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    if test "$USE_INCLUDED_LIBINTL" = yes; then
-      INTLOBJS="\$(GETTOBJS)"
-    fi
-    AC_SUBST(INTLOBJS)
-
-    dnl Enable libtool support if the surrounding package wishes it.
-    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
-    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
-  ])
-
-  dnl For backward compatibility. Some Makefiles may be using this.
-  INTLLIBS="$LIBINTL"
-  AC_SUBST(INTLLIBS)
-
-  dnl Make all documented variables known to autoconf.
-  AC_SUBST(LIBINTL)
-  AC_SUBST(LTLIBINTL)
-  AC_SUBST(POSUB)
-])
-
-
-dnl Checks for all prerequisites of the intl subdirectory,
-dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
-dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
-AC_DEFUN([AM_INTL_SUBDIR],
-[
-  AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
-  AC_REQUIRE([AC_PROG_CC])dnl
-  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-  AC_REQUIRE([AC_PROG_RANLIB])dnl
-  AC_REQUIRE([AC_ISC_POSIX])dnl
-  AC_REQUIRE([AC_HEADER_STDC])dnl
-  AC_REQUIRE([AC_C_CONST])dnl
-  AC_REQUIRE([AC_C_INLINE])dnl
-  AC_REQUIRE([AC_TYPE_OFF_T])dnl
-  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
-  AC_REQUIRE([AC_FUNC_MMAP])dnl
-  AC_REQUIRE([jm_GLIBC21])dnl
-  AC_REQUIRE([gt_INTDIV0])dnl
-  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
-  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
-  AC_REQUIRE([gt_INTTYPES_PRI])dnl
-
-  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
-  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
-geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
-strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
-__fsetlocking])
-
-  AM_ICONV
-  AM_LANGINFO_CODESET
-  if test $ac_cv_header_locale_h = yes; then
-    AM_LC_MESSAGES
-  fi
-
-  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
-  dnl because plural.y uses bison specific features. It requires at least
-  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
-  dnl compile.
-  dnl bison is only needed for the maintainer (who touches plural.y). But in
-  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
-  dnl the rule in general Makefile. Now, some people carelessly touch the
-  dnl files or have a broken "make" program, hence the plural.c rule will
-  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
-  dnl present or too old.
-  AC_CHECK_PROGS([INTLBISON], [bison])
-  if test -z "$INTLBISON"; then
-    ac_verc_fail=yes
-  else
-    dnl Found it, now check the version.
-    AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
-    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-    case $ac_prog_version in
-      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
-         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-    esac
-    AC_MSG_RESULT([$ac_prog_version])
-  fi
-  if test $ac_verc_fail = yes; then
-    INTLBISON=:
-  fi
-])
-
-
-dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
-AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+  done
+  LINGUAS="$XLINGUAS"
+  AC_MSG_RESULT($LINGUAS)
+fi])
diff --git a/config/glibc21.m4 b/config/glibc21.m4
deleted file mode 100644 (file)
index 9c9f3db..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
-
-AC_DEFUN([jm_GLIBC21],
-  [
-    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
-      ac_cv_gnu_library_2_1,
-      [AC_EGREP_CPP([Lucky GNU user],
-       [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-       ],
-       ac_cv_gnu_library_2_1=yes,
-       ac_cv_gnu_library_2_1=no)
-      ]
-    )
-    AC_SUBST(GLIBC21)
-    GLIBC21="$ac_cv_gnu_library_2_1"
-  ]
-)
diff --git a/config/iconv.m4 b/config/iconv.m4
deleted file mode 100644 (file)
index c5f3579..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-# iconv.m4 serial AM4 (gettext-0.11.3)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
-[
-  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-
-  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
-  dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([iconv])
-])
-
-AC_DEFUN([AM_ICONV_LINK],
-[
-  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
-  dnl those with the standalone portable GNU libiconv installed).
-
-  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
-  dnl accordingly.
-  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
-
-  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed libiconv and not disabled its use
-  dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
-  am_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
-
-  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
-    am_cv_func_iconv="no, consider installing GNU libiconv"
-    am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
-      am_cv_func_iconv=yes)
-    if test "$am_cv_func_iconv" != yes; then
-      am_save_LIBS="$LIBS"
-      LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-        am_cv_lib_iconv=yes
-        am_cv_func_iconv=yes)
-      LIBS="$am_save_LIBS"
-    fi
-  ])
-  if test "$am_cv_func_iconv" = yes; then
-    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
-  fi
-  if test "$am_cv_lib_iconv" = yes; then
-    AC_MSG_CHECKING([how to link with libiconv])
-    AC_MSG_RESULT([$LIBICONV])
-  else
-    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
-    dnl either.
-    CPPFLAGS="$am_save_CPPFLAGS"
-    LIBICONV=
-    LTLIBICONV=
-  fi
-  AC_SUBST(LIBICONV)
-  AC_SUBST(LTLIBICONV)
-])
-
-AC_DEFUN([AM_ICONV],
-[
-  AM_ICONV_LINK
-  if test "$am_cv_func_iconv" = yes; then
-    AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL(am_cv_proto_iconv, [
-      AC_TRY_COMPILE([
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
-    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([$]{ac_t:-
-         }[$]am_cv_proto_iconv)
-    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
-      [Define as const if the declaration of iconv() needs const.])
-  fi
-])
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
deleted file mode 100644 (file)
index 55dddcf..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# intdiv0.m4 serial 1 (gettext-0.11.3)
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([gt_INTDIV0],
-[
-  AC_REQUIRE([AC_PROG_CC])dnl
-  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-
-  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
-    gt_cv_int_divbyzero_sigfpe,
-    [
-      AC_TRY_RUN([
-#include <stdlib.h>
-#include <signal.h>
-
-static void
-#ifdef __cplusplus
-sigfpe_handler (int sig)
-#else
-sigfpe_handler (sig) int sig;
-#endif
-{
-  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
-  exit (sig != SIGFPE);
-}
-
-int x = 1;
-int y = 0;
-int z;
-int nan;
-
-int main ()
-{
-  signal (SIGFPE, sigfpe_handler);
-/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
-#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
-  signal (SIGTRAP, sigfpe_handler);
-#endif
-/* Linux/SPARC yields signal SIGILL.  */
-#if defined (__sparc__) && defined (__linux__)
-  signal (SIGILL, sigfpe_handler);
-#endif
-
-  z = x / y;
-  nan = y / y;
-  exit (1);
-}
-], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
-        [
-          # Guess based on the CPU.
-          case "$host_cpu" in
-            alpha* | i[34567]86 | m68k | s390*)
-              gt_cv_int_divbyzero_sigfpe="guessing yes";;
-            *)
-              gt_cv_int_divbyzero_sigfpe="guessing no";;
-          esac
-        ])
-    ])
-  case "$gt_cv_int_divbyzero_sigfpe" in
-    *yes) value=1;;
-    *) value=0;;
-  esac
-  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
-    [Define if integer division by zero raises signal SIGFPE.])
-])
diff --git a/config/inttypes-pri.m4 b/config/inttypes-pri.m4
deleted file mode 100644 (file)
index fd007c3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# inttypes-pri.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
-# macros to non-string values.  This is the case on AIX 4.3.3.
-
-AC_DEFUN([gt_INTTYPES_PRI],
-[
-  AC_REQUIRE([gt_HEADER_INTTYPES_H])
-  if test $gt_cv_header_inttypes_h = yes; then
-    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
-      gt_cv_inttypes_pri_broken,
-      [
-        AC_TRY_COMPILE([#include <inttypes.h>
-#ifdef PRId32
-char *p = PRId32;
-#endif
-], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
-      ])
-  fi
-  if test "$gt_cv_inttypes_pri_broken" = yes; then
-    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
-      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
-  fi
-])
diff --git a/config/inttypes.m4 b/config/inttypes.m4
deleted file mode 100644 (file)
index ab370ff..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# inttypes.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
-# <sys/types.h>.
-
-AC_DEFUN([gt_HEADER_INTTYPES_H],
-[
-  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
-  [
-    AC_TRY_COMPILE(
-      [#include <sys/types.h>
-#include <inttypes.h>],
-      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
-  ])
-  if test $gt_cv_header_inttypes_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
-      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
-  fi
-])
diff --git a/config/inttypes_h.m4 b/config/inttypes_h.m4
deleted file mode 100644 (file)
index f342eba..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# inttypes_h.m4 serial 5 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
-[
-  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <inttypes.h>],
-    [uintmax_t i = (uintmax_t) -1;],
-    jm_ac_cv_header_inttypes_h=yes,
-    jm_ac_cv_header_inttypes_h=no)])
-  if test $jm_ac_cv_header_inttypes_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
-      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
-       and declares uintmax_t. ])
-  fi
-])
diff --git a/config/lcmessage.m4 b/config/lcmessage.m4
deleted file mode 100644 (file)
index ffd4008..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# lcmessage.m4 serial 3 (gettext-0.11.3)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-
-AC_DEFUN([AM_LC_MESSAGES],
-[
-  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
-    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
-       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
-  if test $am_cv_val_LC_MESSAGES = yes; then
-    AC_DEFINE(HAVE_LC_MESSAGES, 1,
-      [Define if your <locale.h> file defines LC_MESSAGES.])
-  fi
-])
diff --git a/config/lib-ld.m4 b/config/lib-ld.m4
deleted file mode 100644 (file)
index 11d0ce7..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# lib-ld.m4 serial 2 (gettext-0.12)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
-
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  acl_cv_prog_gnu_ld=yes
-else
-  acl_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$acl_cv_prog_gnu_ld
-])
-
-dnl From libtool-1.4. Sets the variable LD.
-AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]* | [A-Za-z]:[\\/]*)]
-      [re_direlt='/[^/][^/]*/\.\./']
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(acl_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_LIB_PROG_LD_GNU
-])
diff --git a/config/lib-link.m4 b/config/lib-link.m4
deleted file mode 100644 (file)
index eeb200d..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-# lib-link.m4 serial 4 (gettext-0.12)
-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
-dnl augments the CPPFLAGS variable.
-AC_DEFUN([AC_LIB_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
-    AC_LIB_LINKFLAGS_BODY([$1], [$2])
-    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
-    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
-    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-  ])
-  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
-  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
-  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
-  dnl results of this search when this library appears as a dependency.
-  HAVE_LIB[]NAME=yes
-  undefine([Name])
-  undefine([NAME])
-])
-
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
-dnl searches for libname and the libraries corresponding to explicit and
-dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
-dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
-dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-
-  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
-  dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([$1], [$2])
-
-  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed lib[]Name and not disabled its use
-  dnl via --without-lib[]Name-prefix, he wants to use it.
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-
-  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
-    ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIB[]NAME"
-    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
-    LIBS="$ac_save_LIBS"
-  ])
-  if test "$ac_cv_lib[]Name" = yes; then
-    HAVE_LIB[]NAME=yes
-    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
-    AC_MSG_CHECKING([how to link with lib[]$1])
-    AC_MSG_RESULT([$LIB[]NAME])
-  else
-    HAVE_LIB[]NAME=no
-    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
-    dnl $INC[]NAME either.
-    CPPFLAGS="$ac_save_CPPFLAGS"
-    LIB[]NAME=
-    LTLIB[]NAME=
-  fi
-  AC_SUBST([HAVE_LIB]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  undefine([Name])
-  undefine([NAME])
-])
-
-dnl Determine the platform dependent parameters needed to use rpath:
-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
-dnl hardcode_direct, hardcode_minus_L.
-AC_DEFUN([AC_LIB_RPATH],
-[
-  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
-  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
-  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
-  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
-  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
-    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-    . ./conftest.sh
-    rm -f ./conftest.sh
-    acl_cv_rpath=done
-  ])
-  wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
-  dnl Determine whether the user wants rpath handling at all.
-  AC_ARG_ENABLE(rpath,
-    [  --disable-rpath         do not hardcode runtime library paths],
-    :, enable_rpath=yes)
-])
-
-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
-[
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_LIB_ARG_WITH([lib$1-prefix],
-[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
-])
-  dnl Search the library and its dependencies in $additional_libdir and
-  dnl $LDFLAGS. Using breadth-first-seach.
-  LIB[]NAME=
-  LTLIB[]NAME=
-  INC[]NAME=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='$1 $2'
-  while test -n "$names_next_round"; do
-    names_this_round="$names_next_round"
-    names_next_round=
-    for name in $names_this_round; do
-      already_handled=
-      for n in $names_already_handled; do
-        if test "$n" = "$name"; then
-          already_handled=yes
-          break
-        fi
-      done
-      if test -z "$already_handled"; then
-        names_already_handled="$names_already_handled $name"
-        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
-        dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
-        eval value=\"\$HAVE_LIB$uppername\"
-        if test -n "$value"; then
-          if test "$value" = yes; then
-            eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
-          else
-            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
-            dnl that this library doesn't exist. So just drop it.
-            :
-          fi
-        else
-          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
-          dnl and the already constructed $LIBNAME/$LTLIBNAME.
-          found_dir=
-          found_la=
-          found_so=
-          found_a=
-          if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
-                fi
-              fi
-            fi
-          fi
-          if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIB[]NAME; do
-              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
-                      found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
-                      fi
-                    fi
-                  fi
-                  ;;
-              esac
-              if test "X$found_dir" != "X"; then
-                break
-              fi
-            done
-          fi
-          if test "X$found_dir" != "X"; then
-            dnl Found the library.
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
-            if test "X$found_so" != "X"; then
-              dnl Linking with a shared library. We attempt to hardcode its
-              dnl directory into the executable's runpath, unless it's the
-              dnl standard /usr/lib.
-              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
-                dnl No hardcoding is needed.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-              else
-                dnl Use an explicit option to hardcode DIR into the resulting
-                dnl binary.
-                dnl Potentially add DIR to ltrpathdirs.
-                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                haveit=
-                for x in $ltrpathdirs; do
-                  if test "X$x" = "X$found_dir"; then
-                    haveit=yes
-                    break
-                  fi
-                done
-                if test -z "$haveit"; then
-                  ltrpathdirs="$ltrpathdirs $found_dir"
-                fi
-                dnl The hardcoding into $LIBNAME is system dependent.
-                if test "$hardcode_direct" = yes; then
-                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-                  dnl resulting binary.
-                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-                    dnl Use an explicit option to hardcode DIR into the resulting
-                    dnl binary.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    dnl Potentially add DIR to rpathdirs.
-                    dnl The rpathdirs will be appended to $LIBNAME at the end.
-                    haveit=
-                    for x in $rpathdirs; do
-                      if test "X$x" = "X$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      rpathdirs="$rpathdirs $found_dir"
-                    fi
-                  else
-                    dnl Rely on "-L$found_dir".
-                    dnl But don't add it if it's already contained in the LDFLAGS
-                    dnl or the already constructed $LIBNAME
-                    haveit=
-                    for x in $LDFLAGS $LIB[]NAME; do
-                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                      if test "X$x" = "X-L$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-                    fi
-                    if test "$hardcode_minus_L" != no; then
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    else
-                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
-                      dnl here, because this doesn't fit in flags passed to the
-                      dnl compiler. So give up. No hardcoding. This affects only
-                      dnl very old systems.
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                dnl Linking with a static library.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
-              else
-                dnl We shouldn't come here, but anyway it's good to have a
-                dnl fallback.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
-              fi
-            fi
-            dnl Assume the include files are nearby.
-            additional_includedir=
-            case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
-                additional_includedir="$basedir/include"
-                ;;
-            esac
-            if test "X$additional_includedir" != "X"; then
-              dnl Potentially add $additional_includedir to $INCNAME.
-              dnl But don't add it
-              dnl   1. if it's the standard /usr/include,
-              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
-              dnl   3. if it's already present in $CPPFLAGS or the already
-              dnl      constructed $INCNAME,
-              dnl   4. if it doesn't exist as a directory.
-              if test "X$additional_includedir" != "X/usr/include"; then
-                haveit=
-                if test "X$additional_includedir" = "X/usr/local/include"; then
-                  if test -n "$GCC"; then
-                    case $host_os in
-                      linux*) haveit=yes;;
-                    esac
-                  fi
-                fi
-                if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INC[]NAME; do
-                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                    if test "X$x" = "X-I$additional_includedir"; then
-                      haveit=yes
-                      break
-                    fi
-                  done
-                  if test -z "$haveit"; then
-                    if test -d "$additional_includedir"; then
-                      dnl Really add $additional_includedir to $INCNAME.
-                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
-                    fi
-                  fi
-                fi
-              fi
-            fi
-            dnl Look for dependencies.
-            if test -n "$found_la"; then
-              dnl Read the .la file. It defines the variables
-              dnl dlname, library_names, old_library, dependency_libs, current,
-              dnl age, revision, installed, dlopen, dlpreopen, libdir.
-              save_libdir="$libdir"
-              case "$found_la" in
-                */* | *\\*) . "$found_la" ;;
-                *) . "./$found_la" ;;
-              esac
-              libdir="$save_libdir"
-              dnl We use only dependency_libs.
-              for dep in $dependency_libs; do
-                case "$dep" in
-                  -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
-                    dnl But don't add it
-                    dnl   1. if it's the standard /usr/lib,
-                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
-                    dnl   3. if it's already present in $LDFLAGS or the already
-                    dnl      constructed $LIBNAME,
-                    dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/lib"; then
-                      haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
-                        if test -n "$GCC"; then
-                          case $host_os in
-                            linux*) haveit=yes;;
-                          esac
-                        fi
-                      fi
-                      if test -z "$haveit"; then
-                        haveit=
-                        for x in $LDFLAGS $LIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                        haveit=
-                        for x in $LDFLAGS $LTLIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                      fi
-                    fi
-                    ;;
-                  -R*)
-                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-                    if test "$enable_rpath" != no; then
-                      dnl Potentially add DIR to rpathdirs.
-                      dnl The rpathdirs will be appended to $LIBNAME at the end.
-                      haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $dir"
-                      fi
-                      dnl Potentially add DIR to ltrpathdirs.
-                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                      haveit=
-                      for x in $ltrpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        ltrpathdirs="$ltrpathdirs $dir"
-                      fi
-                    fi
-                    ;;
-                  -l*)
-                    dnl Handle this in the next round.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-                    ;;
-                  *.la)
-                    dnl Handle this in the next round. Throw away the .la's
-                    dnl directory; it is already contained in a preceding -L
-                    dnl option.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                    ;;
-                  *)
-                    dnl Most likely an immediate library name.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
-                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
-                    ;;
-                esac
-              done
-            fi
-          else
-            dnl Didn't find the library; assume it is in the system directories
-            dnl known to the linker and runtime loader. (All the system
-            dnl directories known to the linker should also be known to the
-            dnl runtime loader, otherwise the system is severely misconfigured.)
-            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
-          fi
-        fi
-      fi
-    done
-  done
-  if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
-      dnl Weird platform: only the last -rpath option counts, the user must
-      dnl pass all path elements in one option. We can arrange that for a
-      dnl single library, but not when more than one $LIBNAMEs are used.
-      alldirs=
-      for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
-      done
-      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
-      acl_save_libdir="$libdir"
-      libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
-      libdir="$acl_save_libdir"
-      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-    else
-      dnl The -rpath options are cumulative.
-      for found_dir in $rpathdirs; do
-        acl_save_libdir="$libdir"
-        libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
-        libdir="$acl_save_libdir"
-        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-      done
-    fi
-  fi
-  if test "X$ltrpathdirs" != "X"; then
-    dnl When using libtool, the option that works for both libraries and
-    dnl executables is -R. The -R options are cumulative.
-    for found_dir in $ltrpathdirs; do
-      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
-    done
-  fi
-])
-
-dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
-dnl unless already present in VAR.
-dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
-dnl contains two or three consecutive elements that belong together.
-AC_DEFUN([AC_LIB_APPENDTOVAR],
-[
-  for element in [$2]; do
-    haveit=
-    for x in $[$1]; do
-      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      [$1]="${[$1]}${[$1]:+ }$element"
-    fi
-  done
-])
diff --git a/config/lib-prefix.m4 b/config/lib-prefix.m4
deleted file mode 100644 (file)
index c719bc8..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-# lib-prefix.m4 serial 2 (gettext-0.12)
-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
-dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
-dnl to access previously installed libraries. The basic assumption is that
-dnl a user will want packages to use other packages he previously installed
-dnl with the same --prefix option.
-dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
-dnl libraries, but is otherwise very convenient.
-AC_DEFUN([AC_LIB_PREFIX],
-[
-  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_LIB_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
-])
-  if test $use_additional = yes; then
-    dnl Potentially add $additional_includedir to $CPPFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/include,
-    dnl   2. if it's already present in $CPPFLAGS,
-    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_includedir" != "X/usr/include"; then
-      haveit=
-      for x in $CPPFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-I$additional_includedir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_includedir" = "X/usr/local/include"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux*) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_includedir"; then
-            dnl Really add $additional_includedir to $CPPFLAGS.
-            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
-          fi
-        fi
-      fi
-    fi
-    dnl Potentially add $additional_libdir to $LDFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/lib,
-    dnl   2. if it's already present in $LDFLAGS,
-    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_libdir" != "X/usr/lib"; then
-      haveit=
-      for x in $LDFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-L$additional_libdir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_libdir" = "X/usr/local/lib"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux*) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_libdir"; then
-            dnl Really add $additional_libdir to $LDFLAGS.
-            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
-          fi
-        fi
-      fi
-    fi
-  fi
-])
-
-dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
-dnl acl_final_exec_prefix, containing the values to which $prefix and
-dnl $exec_prefix will expand at the end of the configure script.
-AC_DEFUN([AC_LIB_PREPARE_PREFIX],
-[
-  dnl Unfortunately, prefix and exec_prefix get only finally determined
-  dnl at the end of configure.
-  if test "X$prefix" = "XNONE"; then
-    acl_final_prefix="$ac_default_prefix"
-  else
-    acl_final_prefix="$prefix"
-  fi
-  if test "X$exec_prefix" = "XNONE"; then
-    acl_final_exec_prefix='${prefix}'
-  else
-    acl_final_exec_prefix="$exec_prefix"
-  fi
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-  prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
-dnl variables prefix and exec_prefix bound to the values they will have
-dnl at the end of the configure script.
-AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
-[
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  $1
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-])
diff --git a/config/mh-x86omitfp b/config/mh-x86omitfp
deleted file mode 100644 (file)
index 563f02b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add -fomit-frame-pointer to the usual BOOT_CFLAGS to speed up the compiler.
-BOOT_CFLAGS = -O2 -g -fomit-frame-pointer
diff --git a/config/nls.m4 b/config/nls.m4
deleted file mode 100644 (file)
index 36bc493..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# nls.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-
-AC_DEFUN([AM_NLS],
-[
-  AC_MSG_CHECKING([whether NLS is requested])
-  dnl Default is enabled NLS
-  AC_ARG_ENABLE(nls,
-    [  --disable-nls           do not use Native Language Support],
-    USE_NLS=$enableval, USE_NLS=yes)
-  AC_MSG_RESULT($USE_NLS)
-  AC_SUBST(USE_NLS)
-])
-
-AC_DEFUN([AM_MKINSTALLDIRS],
-[
-  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
-  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
-  dnl Try to locate it.
-  MKINSTALLDIRS=
-  if test -n "$ac_aux_dir"; then
-    case "$ac_aux_dir" in
-      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
-      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
-    esac
-  fi
-  if test -z "$MKINSTALLDIRS"; then
-    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
-  fi
-  AC_SUBST(MKINSTALLDIRS)
-])
diff --git a/config/po.m4 b/config/po.m4
deleted file mode 100644 (file)
index 861e3de..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-# po.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-
-dnl Checks for all prerequisites of the po subdirectory.
-AC_DEFUN([AM_PO_SUBDIRS],
-[
-  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-  AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
-  AC_REQUIRE([AM_NLS])dnl
-
-  dnl Perform the following tests also if --disable-nls has been given,
-  dnl because they are needed for "make dist" to work.
-
-  dnl Search for GNU msgfmt in the PATH.
-  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
-  dnl The second test excludes FreeBSD msgfmt.
-  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
-     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-    :)
-  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-
-  dnl Search for GNU xgettext 0.12 or newer in the PATH.
-  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
-  dnl The second test excludes FreeBSD xgettext.
-  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
-     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-    :)
-  dnl Remove leftover from FreeBSD xgettext call.
-  rm -f messages.po
-
-  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
-  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
-    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
-
-  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
-  dnl Test whether we really found GNU msgfmt.
-  if test "$GMSGFMT" != ":"; then
-    dnl If it is no GNU msgfmt we define it as : so that the
-    dnl Makefiles still can work.
-    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
-       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
-    else
-      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
-      AC_MSG_RESULT(
-        [found $GMSGFMT program is not GNU msgfmt; ignore it])
-      GMSGFMT=":"
-    fi
-  fi
-
-  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
-  dnl Test whether we really found GNU xgettext.
-  if test "$XGETTEXT" != ":"; then
-    dnl If it is no GNU xgettext we define it as : so that the
-    dnl Makefiles still can work.
-    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
-       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
-    else
-      AC_MSG_RESULT(
-        [found xgettext program is not GNU xgettext; ignore it])
-      XGETTEXT=":"
-    fi
-    dnl Remove leftover from FreeBSD xgettext call.
-    rm -f messages.po
-  fi
-
-  AC_OUTPUT_COMMANDS([
-    for ac_file in $CONFIG_FILES; do
-      # Support "outfile[:infile[:infile...]]"
-      case "$ac_file" in
-        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-      esac
-      # PO directories have a Makefile.in generated from Makefile.in.in.
-      case "$ac_file" in */Makefile.in)
-        # Adjust a relative srcdir.
-        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
-        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
-        # In autoconf-2.13 it is called $ac_given_srcdir.
-        # In autoconf-2.50 it is called $srcdir.
-        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
-        case "$ac_given_srcdir" in
-          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
-          /*) top_srcdir="$ac_given_srcdir" ;;
-          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
-        esac
-        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
-          rm -f "$ac_dir/POTFILES"
-          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
-          POMAKEFILEDEPS="POTFILES.in"
-          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
-          # on $ac_dir but don't depend on user-specified configuration
-          # parameters.
-          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
-            # The LINGUAS file contains the set of available languages.
-            if test -n "$OBSOLETE_ALL_LINGUAS"; then
-              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
-            fi
-            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
-            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
-          else
-            # The set of available languages was given in configure.in.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
-          fi
-          case "$ac_given_srcdir" in
-            .) srcdirpre= ;;
-            *) srcdirpre='$(srcdir)/' ;;
-          esac
-          POFILES=
-          GMOFILES=
-          UPDATEPOFILES=
-          DUMMYPOFILES=
-          for lang in $ALL_LINGUAS; do
-            POFILES="$POFILES $srcdirpre$lang.po"
-            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
-            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
-          done
-          # CATALOGS depends on both $ac_dir and the user's LINGUAS
-          # environment variable.
-          INST_LINGUAS=
-          if test -n "$ALL_LINGUAS"; then
-            for presentlang in $ALL_LINGUAS; do
-              useit=no
-              if test "%UNSET%" != "$LINGUAS"; then
-                desiredlanguages="$LINGUAS"
-              else
-                desiredlanguages="$ALL_LINGUAS"
-              fi
-              for desiredlang in $desiredlanguages; do
-                # Use the presentlang catalog if desiredlang is
-                #   a. equal to presentlang, or
-                #   b. a variant of presentlang (because in this case,
-                #      presentlang can be used as a fallback for messages
-                #      which are not translated in the desiredlang catalog).
-                case "$desiredlang" in
-                  "$presentlang"*) useit=yes;;
-                esac
-              done
-              if test $useit = yes; then
-                INST_LINGUAS="$INST_LINGUAS $presentlang"
-              fi
-            done
-          fi
-          CATALOGS=
-          if test -n "$INST_LINGUAS"; then
-            for lang in $INST_LINGUAS; do
-              CATALOGS="$CATALOGS $lang.gmo"
-            done
-          fi
-          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
-          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
-          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
-            if test -f "$f"; then
-              case "$f" in
-                *.orig | *.bak | *~) ;;
-                *) cat "$f" >> "$ac_dir/Makefile" ;;
-              esac
-            fi
-          done
-        fi
-        ;;
-      esac
-    done],
-   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
-    # from automake.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
-    # Capture the value of LINGUAS because we need it to compute CATALOGS.
-    LINGUAS="${LINGUAS-%UNSET%}"
-   ])
-])
diff --git a/config/stdint_h.m4 b/config/stdint_h.m4
deleted file mode 100644 (file)
index 32ba7ae..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# stdint_h.m4 serial 3 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([jm_AC_HEADER_STDINT_H],
-[
-  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <stdint.h>],
-    [uintmax_t i = (uintmax_t) -1;],
-    jm_ac_cv_header_stdint_h=yes,
-    jm_ac_cv_header_stdint_h=no)])
-  if test $jm_ac_cv_header_stdint_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
-      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
-       and declares uintmax_t. ])
-  fi
-])
diff --git a/config/uintmax_t.m4 b/config/uintmax_t.m4
deleted file mode 100644 (file)
index b5f28d4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# uintmax_t.m4 serial 7 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-AC_PREREQ(2.13)
-
-# Define uintmax_t to 'unsigned long' or 'unsigned long long'
-# if it is not already defined in <stdint.h> or <inttypes.h>.
-
-AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
-[
-  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
-  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
-    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
-    test $ac_cv_type_unsigned_long_long = yes \
-      && ac_type='unsigned long long' \
-      || ac_type='unsigned long'
-    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
-      [Define to unsigned long or unsigned long long
-       if <stdint.h> and <inttypes.h> don't define.])
-  else
-    AC_DEFINE(HAVE_UINTMAX_T, 1,
-      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
-  fi
-])
diff --git a/config/ulonglong.m4 b/config/ulonglong.m4
deleted file mode 100644 (file)
index c375e47..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
-dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
-[
-  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
-  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
-    [unsigned long long ullmax = (unsigned long long) -1;
-     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
-    ac_cv_type_unsigned_long_long=yes,
-    ac_cv_type_unsigned_long_long=no)])
-  if test $ac_cv_type_unsigned_long_long = yes; then
-    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
-      [Define if you have the unsigned long long type.])
-  fi
-])
diff --git a/config/warnings.m4 b/config/warnings.m4
deleted file mode 100644 (file)
index 5501be9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# Autoconf include file defining macros related to compile-time warnings.
-
-# Copyright 2004 Free Software Foundation, Inc.
-
-#This file is part of GCC.
-
-#GCC 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.
-
-#GCC 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 GCC; see the file COPYING.  If not, write to the Free
-#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-# ACX_PROG_CC_WARNING_OPTS([-Wfoo -Wbar -Wbaz])
-#   Sets @WARN_CFLAGS@ to the subset of the given options which the
-#   compiler accepts.
-AC_DEFUN([ACX_PROG_CC_WARNING_OPTS],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_SUBST([WARN_CFLAGS])dnl
-WARN_CFLAGS=
-save_CFLAGS="$CFLAGS"
-for option in $1; do
-  AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
-  AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
-    [CFLAGS="$option"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
-      [AS_VAR_SET(acx_Woption, yes)],
-      [AS_VAR_SET(acx_Woption, no)])
-  ])
-  AS_IF([test AS_VAR_GET(acx_Woption) = yes],
-        [WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"])
-  AS_VAR_POPDEF([acx_Woption])dnl
-done
-CFLAGS="$save_CFLAGS"
-])# ACX_PROG_CC_WARNING_OPTS
-
-# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...])
-#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler
-#   accepts all of those options simultaneously, otherwise to nothing.
-AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_SUBST([WARN_PEDANTIC])dnl
-AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
-WARN_PEDANTIC=
-AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
-[save_CFLAGS="$CFLAGS"
-CFLAGS="-pedantic $1"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
-   [AS_VAR_SET(acx_Pedantic, yes)],
-   [AS_VAR_SET(acx_Pedantic, no)])
-CFLAGS="$save_CFLAGS"])
-AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
-      [WARN_PEDANTIC="-pedantic $1"])
-AS_VAR_POPDEF([acx_Pedantic])dnl
-])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
-
-# ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z])
-#   sets WERROR to "-Werror" if the compiler is GCC >=x.y.z, or if
-#   --enable-werror-always was given on the command line, otherwise
-#   to nothing.
-#   If the argument is the word "manual" instead of a version number,
-#   then WERROR will be set to -Werror only if --enable-werror-always
-#   appeared on the configure command line.
-AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_SUBST([WERROR])dnl
-WERROR=
-AC_ARG_ENABLE(werror-always, 
-    AS_HELP_STRING([--enable-werror-always],
-                  [enable -Werror despite compiler version]),
-[], [enable_werror_always=no])
-AS_IF([test $enable_werror_always = yes],
-      [WERROR=-Werror],
- m4_if($1, [manual],,
- [AS_VAR_PUSHDEF([acx_GCCvers], [acx_cv_prog_cc_gcc_$1_or_newer])dnl
-  AC_CACHE_CHECK([whether $CC is GCC >=$1], acx_GCCvers,
-    [set fnord `echo $1 | tr '.' ' '`
-     shift
-     AC_PREPROC_IFELSE(
-[#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
-  < [$]1 * 10000 + [$]2 * 100 + [$]3
-#error insufficient
-#endif],
-   [AS_VAR_SET(acx_GCCvers, yes)],
-   [AS_VAR_SET(acx_GCCvers, no)])])
- AS_IF([test AS_VAR_GET(acx_GCCvers) = yes],
-       [WERROR=-WerrorB])
-  AS_VAR_POPDEF([acx_GCCvers])]))
-])# ACX_PROG_CC_WARNINGS_ARE_ERRORS
index 1d5e393fe6c3d1171120f9658cce200d47d0b827..35c07a2104e6afad789ffe6288b83d3a996af19c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1024,8 +1024,8 @@ esac
 
 # If both --with-headers and --with-libs are specified, default to
 # --without-newlib.
-if test x"${with_headers}" != x && test x"${with_headers}" != xno \
-   && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+   && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
   if test x"${with_newlib}" = x ; then
     with_newlib=no
   fi
@@ -1141,10 +1141,11 @@ case "${target}" in
     ;;
   powerpc-*-darwin*)
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+    noconfigdirs="$noconfigdirs target-libobjc"
     ;;
   *-*-darwin*)
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
-    noconfigdirs="$noconfigdirs ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
     ;;
   *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -1281,7 +1282,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
     ;;
   crx-*-*)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss target-libstdc++-v3 target-mudflap ${libgcj}"
     ;;
   d10v-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
@@ -1368,9 +1369,10 @@ case "${target}" in
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
     # always build newlib if winsup directory is present.
-    if test -d "$srcdir/winsup"; then
+    if test -d "$srcdir/winsup"
+    then
       skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
-    elif test -d "$srcdir/newlib"; then
+    else
       echo "Warning: winsup is missing so newlib can't be built."
     fi
 
@@ -1714,11 +1716,6 @@ case "${host}" in
   *-*-sysv4*)
     host_makefile_frag="config/mh-sysv4"
     ;;
-  # This is placed last to prevent interfering with the cases above.
-  i[3456789]86-*-*)
-    # Build the stage2 and stage3 compilers with -fomit-frame-pointer.
-    host_makefile_frag="config/mh-x86omitfp"
-    ;;
 esac
 fi
 
@@ -1774,7 +1771,7 @@ else
   # 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:1778: checking for $ac_word" >&5
+echo "configure:1775: 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
@@ -1804,7 +1801,7 @@ if test -z "$CC"; then
   # 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:1808: checking for $ac_word" >&5
+echo "configure:1805: 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
@@ -1855,7 +1852,7 @@ fi
       # 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:1859: checking for $ac_word" >&5
+echo "configure:1856: 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
@@ -1887,7 +1884,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1891: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1888: 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.
@@ -1898,12 +1895,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1902 "configure"
+#line 1899 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1904: \"$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
@@ -1929,12 +1926,12 @@ if test $ac_cv_prog_cc_works = no; then
   { 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:1933: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1930: 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:1938: checking whether we are using GNU C" >&5
+echo "configure:1935: 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
@@ -1943,7 +1940,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1947: \"$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:1944: \"$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
@@ -1962,7 +1959,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1966: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1963: 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
@@ -2029,7 +2026,7 @@ 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:2033: checking for $ac_word" >&5
+echo "configure:2030: 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
@@ -2061,7 +2058,7 @@ if test -n "$ac_tool_prefix"; then
   # 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:2065: checking for $ac_word" >&5
+echo "configure:2062: 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
@@ -2094,7 +2091,7 @@ fi
 fi
 
 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2098: checking whether compiler driver understands Ada" >&5
+echo "configure:2095: 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
@@ -2127,7 +2124,7 @@ else
 fi
 
 echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
-echo "configure:2131: checking how to compare bootstrapped objects" >&5
+echo "configure:2128: 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
@@ -2225,9 +2222,9 @@ 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:2229: checking for correct version of gmp.h" >&5
+echo "configure:2226: checking for correct version of gmp.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2231 "configure"
+#line 2228 "configure"
 #include "confdefs.h"
 #include "gmp.h"
 int main() {
@@ -2238,7 +2235,7 @@ choke me
 
 ; return 0; }
 EOF
-if { (eval echo configure:2242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2251,12 +2248,12 @@ rm -f conftest*
 
 if test x"$have_gmp" = xyes; then
   echo $ac_n "checking for MPFR""... $ac_c" 1>&6
-echo "configure:2255: checking for MPFR" >&5
+echo "configure:2252: checking for MPFR" >&5
 
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
   cat > conftest.$ac_ext <<EOF
-#line 2260 "configure"
+#line 2257 "configure"
 #include "confdefs.h"
 #include <gmp.h>
 #include <mpfr.h>
@@ -2264,7 +2261,7 @@ int main() {
 mpfr_t n; mpfr_init(n);
 ; return 0; }
 EOF
-if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2265: \"$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
@@ -2741,7 +2738,7 @@ 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:2745: checking for $ac_word" >&5
+echo "configure:2742: 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
@@ -2776,7 +2773,7 @@ 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:2780: checking for $ac_word" >&5
+echo "configure:2777: 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
@@ -2811,7 +2808,7 @@ 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:2815: checking for $ac_word" >&5
+echo "configure:2812: 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
@@ -2846,7 +2843,7 @@ 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:2850: checking for $ac_word" >&5
+echo "configure:2847: 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
@@ -2881,7 +2878,7 @@ 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:2885: checking for $ac_word" >&5
+echo "configure:2882: 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
@@ -2916,7 +2913,7 @@ 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:2920: checking for $ac_word" >&5
+echo "configure:2917: 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
@@ -3550,7 +3547,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
   # 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:3554: checking for $ac_word" >&5
+echo "configure:3551: 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
@@ -3583,7 +3580,7 @@ if test -z "$ac_cv_prog_AR" ; then
     # 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:3587: checking for $ac_word" >&5
+echo "configure:3584: 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
@@ -3622,7 +3619,7 @@ fi
   # 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:3626: checking for $ac_word" >&5
+echo "configure:3623: 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
@@ -3655,7 +3652,7 @@ if test -z "$ac_cv_prog_AS" ; then
     # 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:3659: checking for $ac_word" >&5
+echo "configure:3656: 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
@@ -3694,7 +3691,7 @@ fi
   # 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:3698: checking for $ac_word" >&5
+echo "configure:3695: 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
@@ -3727,7 +3724,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
     # 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:3731: checking for $ac_word" >&5
+echo "configure:3728: 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
@@ -3766,7 +3763,7 @@ fi
   # 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:3770: checking for $ac_word" >&5
+echo "configure:3767: 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
@@ -3799,7 +3796,7 @@ if test -z "$ac_cv_prog_LD" ; then
     # 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:3803: checking for $ac_word" >&5
+echo "configure:3800: 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
@@ -3838,7 +3835,7 @@ fi
   # 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:3842: checking for $ac_word" >&5
+echo "configure:3839: 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
@@ -3871,7 +3868,7 @@ if test -z "$ac_cv_prog_NM" ; then
     # 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:3875: checking for $ac_word" >&5
+echo "configure:3872: 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
@@ -3910,7 +3907,7 @@ fi
   # 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:3914: checking for $ac_word" >&5
+echo "configure:3911: 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
@@ -3943,7 +3940,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
     # 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:3947: checking for $ac_word" >&5
+echo "configure:3944: 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
@@ -3982,7 +3979,7 @@ fi
   # 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:3986: checking for $ac_word" >&5
+echo "configure:3983: 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
@@ -4015,7 +4012,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
     # 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:4019: checking for $ac_word" >&5
+echo "configure:4016: 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
@@ -4054,7 +4051,7 @@ fi
   # 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:4058: checking for $ac_word" >&5
+echo "configure:4055: 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
@@ -4087,7 +4084,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
     # 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:4091: checking for $ac_word" >&5
+echo "configure:4088: 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
@@ -4126,7 +4123,7 @@ fi
   # 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:4130: checking for $ac_word" >&5
+echo "configure:4127: 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
@@ -4159,7 +4156,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
     # 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:4163: checking for $ac_word" >&5
+echo "configure:4160: 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
@@ -4205,7 +4202,7 @@ fi
   # 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:4209: checking for $ac_word" >&5
+echo "configure:4206: 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
@@ -4238,7 +4235,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then
     # 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:4242: checking for $ac_word" >&5
+echo "configure:4239: 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
@@ -4277,7 +4274,7 @@ fi
   # 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:4281: checking for $ac_word" >&5
+echo "configure:4278: 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
@@ -4310,7 +4307,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then
     # 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:4314: checking for $ac_word" >&5
+echo "configure:4311: 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
@@ -4349,7 +4346,7 @@ fi
   # 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:4353: checking for $ac_word" >&5
+echo "configure:4350: 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
@@ -4382,7 +4379,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then
     # 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:4386: checking for $ac_word" >&5
+echo "configure:4383: 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
@@ -4421,7 +4418,7 @@ fi
   # 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:4425: checking for $ac_word" >&5
+echo "configure:4422: 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
@@ -4454,7 +4451,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then
     # 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:4458: checking for $ac_word" >&5
+echo "configure:4455: 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
@@ -4493,7 +4490,7 @@ fi
   # 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:4497: checking for $ac_word" >&5
+echo "configure:4494: 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
@@ -4526,7 +4523,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then
     # 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:4530: checking for $ac_word" >&5
+echo "configure:4527: 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
@@ -4565,7 +4562,7 @@ fi
   # 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:4569: checking for $ac_word" >&5
+echo "configure:4566: 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
@@ -4598,7 +4595,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then
     # 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:4602: checking for $ac_word" >&5
+echo "configure:4599: 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
@@ -4637,7 +4634,7 @@ fi
   # 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:4641: checking for $ac_word" >&5
+echo "configure:4638: 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
@@ -4670,7 +4667,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then
     # 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:4674: checking for $ac_word" >&5
+echo "configure:4671: 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
@@ -4755,7 +4752,7 @@ 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:4759: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4756: 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"
@@ -4802,7 +4799,7 @@ esac
 # gcc for stageN-gcc and stagePREV-gcc 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:4806: checking if symbolic links between directories work" >&5
+echo "configure:4803: 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
@@ -4850,26 +4847,6 @@ case ${enable_werror} in
 esac
 
 
-# If gcc is built natively with shared library enabled, set
-# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
-# used.
-SET_GCC_LIB_PATH=
-if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
-  case "${enable_shared}" in
-    no | "") ;;
-    *)
-      eval "d=\$$RPATH_ENVVAR"
-      if test x"$d" != x; then
-       d="$pwd/gcc:$d"
-      else
-       d="$pwd/gcc"
-    fi
-    SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
-    ;;
-  esac
-fi
-
-
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -4936,15 +4913,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[    `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\),-D\1=\2,g
+t quote
+s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[    `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
 
 
 # Without the "./", some shells look in PATH for config.status.
@@ -5139,7 +5135,6 @@ s%@stage1_cflags@%$stage1_cflags%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
-s%@SET_GCC_LIB_PATH@%$SET_GCC_LIB_PATH%g
 
 CEOF
 EOF
index 0ac43043abd7c3a10333d5afeb038f2b11405f52..9c32e1209164339eba40b618a43f1a69e1988ce0 100644 (file)
@@ -250,8 +250,8 @@ esac
 
 # If both --with-headers and --with-libs are specified, default to
 # --without-newlib.
-if test x"${with_headers}" != x && test x"${with_headers}" != xno \
-   && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+   && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
   if test x"${with_newlib}" = x ; then
     with_newlib=no
   fi
@@ -363,10 +363,11 @@ case "${target}" in
     ;;
   powerpc-*-darwin*)
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+    noconfigdirs="$noconfigdirs target-libobjc"
     ;;
   *-*-darwin*)
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
-    noconfigdirs="$noconfigdirs ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
     ;;
   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -503,7 +504,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
     ;;
   crx-*-*)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss target-libstdc++-v3 target-mudflap ${libgcj}"
     ;;
   d10v-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
@@ -590,9 +591,10 @@ case "${target}" in
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
     # always build newlib if winsup directory is present.
-    if test -d "$srcdir/winsup"; then
+    if test -d "$srcdir/winsup"
+    then
       skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
-    elif test -d "$srcdir/newlib"; then
+    else
       echo "Warning: winsup is missing so newlib can't be built."
     fi
 
@@ -936,11 +938,6 @@ case "${host}" in
   *-*-sysv4*)
     host_makefile_frag="config/mh-sysv4"
     ;;
-  # This is placed last to prevent interfering with the cases above.
-  i[[3456789]]86-*-*)
-    # Build the stage2 and stage3 compilers with -fomit-frame-pointer.
-    host_makefile_frag="config/mh-x86omitfp"
-    ;;
 esac
 fi
 
@@ -2296,24 +2293,4 @@ case ${enable_werror} in
 esac
 AC_SUBST(stage2_werror_flag)
 
-# If gcc is built natively with shared library enabled, set
-# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
-# used.
-SET_GCC_LIB_PATH=
-if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
-  case "${enable_shared}" in
-    no | "") ;;
-    *)
-      eval "d=\$$RPATH_ENVVAR"
-      if test x"$d" != x; then
-       d="$pwd/gcc:$d"
-      else
-       d="$pwd/gcc"
-    fi
-    SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
-    ;;
-  esac
-fi
-AC_SUBST(SET_GCC_LIB_PATH)
-
 AC_OUTPUT(Makefile)
index 5ddba9ee5b195cab1be94cbcec91307f380a1774..7043f68e1074bda8e52ad850bac017c0ea0b7d09 100644 (file)
-2004-10-15  Joel Brobecker  <brobecker@gnat.com>
-
-       * dwarf2read.c (set_cu_language): Set language to Ada for
-       DW_LANG_Ada83 and DW_LANG_Ada95.
-
-2004-10-15  Michael Chastain  <mec.gnu@mindspring.com>
-
-       From Andreas Schwab <schwab@suse.de>:
-       * Makefile.in (.y.c, .l.c.): Fix the substitutions for
-       for xmalloc and xrealloc.
-
-2004-10-15  Andrew Cagney  <cagney@gnu.org>
-
-       * ada-exp.y, ada-lex.l: Use xmalloc and xrealloc through out.
-       * inf-ptrace.c: Include "gdb_wait.h" instead of <wait.h>.
-       * Makefile.in (.y.c, .l.c): Don't replace xmalloc with xxmalloc.
-       Update dependencies.
-
-2004-10-15  Paul Hilfinger  <Hilfinger@gnat.com>
-
-       * ada-lang.c (ada_lookup_symbol): Correct comment.
-       (ada_evaluate_subexp): Change error message for
-       OP_FUNCALL case so as not to indicate an internal error.
-       
-2004-10-15  Joel Brobecker  <brobecker@gnat.com>
-
-       Committed by Paul Hilfinger.
-       * ada-lang.c (ada_template_to_fixed_record_type_1): Detect bogus
-       type sizes in XVE/XVU types, and emit a warning when that happens,
-       instead of rounding up the size of the resulting type.
-       Some minor reformatting.
-       (ada_is_aligner_type): Do not consider a type as an aligner type 
-       if there is a corresponding XVS type as well.
-       (ada_evaluate_subexp): For TERNOP_SLICE, handle cases where we 
-       have several levels of pointer indirection to the array.
-       
-2004-10-15  Jerome Guitton  <guitton@gnat.com>
-
-       Committed by Paul Hilfinger.
-       * ada-lang.c (check_size): New function.
-       (coerce_unspec_val_to_type): call check_size to make sure
-       that the object size is reasonable.
-       (ada_evaluate_subexp): in UNOP_IND: Ditto. In TERNOP_SLICE:
-       Implements the case when we get a reference when we evaluate
-       the expression of one of the bounds of the slice.
-       (ada_value_struct_elt): when a packed array field is
-       a reference, use ada_coerce_ref to dereference it; use 
-       ada_value_ind only if it is a pointer.
-
-2004-10-15  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips32_scan_prologue): Move the implementation up
-       a bit to avoid the necessity of an advance declaration. Remove
-       declaration.
-       (set_reg_offset): Move implemenation up.
-       (mips16_get_imm): Likewise.
-       (mips16_scan_prologue): Likewise.
-       (reset_saved_regs): Likewise.
-       (mips32_scan_prologue): Likewise.
-
-2004-10-14  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips32_scan_prologue): Add advance declaration.
-       Remove sp as a parameter, compute it internally instead. Move
-       prologue scanning limit from heuristic_proc_desc to here.
-       (mips16_scan_prologue): Likewise.
-       (mips_insn16_frame_cache): Replace call to heuristic_proc_desc
-       by call to mips16_scan_prologue.
-       (mips_insn32_frame_cache): Replace call to heuristic_proc_desc
-       by call to mips32_scan_prologue.
-       (heuristic_proc_desc): Remove code that's no longer necessary.
-       Update calls to mips16_scan_prologue and mips32_scan_prologue.
-       (mips_skip_prologue): Update calls to mips16_scan_prologue
-       and mips32_scan_prologue.
-
-2004-10-14  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips16_scan_prologue): Merge code from
-       mips16_skip_prologue.  Now return the address of the first
-       instruction past the function prologue.
-       (mips16_skip_prologue): Remove, no longer necessary.
-       (mips_skip_prologue): Replace call to mips16_skip_prologue
-       by call to mips16_scan_prologue.
-
-2004-10-14  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips32_scan_prologue): Merge code from
-       mips32_skip_prologue.  Now return the address of the first
-       instruction past the function prologue.
-       (mips32_skip_prologue): Remove.  No longer necessary.
-       (mips16_skip_prologue): Add parameter end_pc instead of
-       computing it.
-       (mips_skip_prologue): Compute the upper limit for the
-       prologue scanning. Update call to mips16_skip_prologue.
-       Replace call to mips32_skip_prologue by call to
-       mips32_scan_prologue.
-
-2004-10-14  Mark Kettenis  <kettenis@gnu.org>
-
-       * hppa-tdep.c (hppa_frame_cache): Add support for OpenBSD and
-       NetBSD system call stubs that store %rp in the ERP slot of the
-       stack frame.
-
-       * source.c: Always define O_BINARY to 0 if not defined already.
-       (openp): Unconditionally use O_BINARY.
-
-       * top.c (gdb_readline): Always accept "\r\n" as a line-ending.
-       * event-top.c (gdb_readline2): Likewise.
-
-2004-10-14  Orjan Friberg  <orjanf@axis.com>
-
-       * cris-tdep.c (_initialize_cris_tdep): Re-add call to
-       deprecated_add_core_fns which was removed by mistake.
-
-2004-10-13  Kevin Buettner  <kevinb@redhat.com>
-
-       * ia64-linux-nat.c (fill_gregset, fill_fpregset): Replace
-       references to deprecated_registers[] with equivalent code.
-
-2004-10-13  Kevin Buettner  <kevinb@redhat.com>
-
-       * rs6000-tdep.c (rs6000_push_dummy_call): Replace references to
-       ``deprecated_registers'' with equivalent code.  Use gdb_assert()
-       instead of explicit test and print statement.
-
-2004-10-12  Mark Kettenis  <kettenis@gnu.org>
-
-       * sparc-nat.c: Include "inf-ptrace.h".
-       (sparc_target): New function.
-       * sparc-nat.h: Update copyright year.
-       (sparc_target): New prototype.
-       * sparcnbsd-nat.c: Don't include "gdbcore.h", include "target.h".
-       (_initialize_sparcnbsd_nat): Construct and add target vector.
-       * sparc64nbsd-nat.c: Include "target.h".
-       (_initialize_sparc64nbsd_nat): Construct and add target vector.
-       * Makefile.in (sparc-nat.o, sparcnbsd-nat.o, sparc64nbsd-nat.o):
-       Update dependencies.
-       * config/sparc/nbsd64.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o, add inf-ptrace.o.
-       * config/sparc/nbsdaout.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o, add inf-ptrace.o and bsd-kvm.o.
-       (NAT_FILE): Set to nm-bsd.h.
-       (LOADLIBES): New variable.
-       * config/sparc/nbsdelf.mh (NATDEPFILES): Remove infptrace.o and
-       infarg.o, add inf-ptrace.o.
-       * config/sparc/nm-nbsdaout.h: Remove file.
-       * config/sparc/fbsd.mh (NATDEPFILES): Add inf-ptrace.o.
-       * config/sparc/linux.mh (NATDEPFILES): Add inf-ptrace.o.
-       * config/sparc/linux64.mh (NATDEPFILES): Add inf-ptrace.o.
-
-       * defs.h [!FOPEN_RB]: Include "fopen-bin.h" instead of
-       "fopen-same.h".  Update comment.
-
-2004-10-11  Mark Kettenis  <kettenis@gnu.org>
-
-       * i386gnu-nat.c: Include "gdb_string.h".
-       (fetch_fpregs): Use i387_supply_fxsave to fill the floating-point
-       registers when the floating-point state isn't initialized.
-       * Makefile.in (i386gnu-nat.o): Update dependencies.
-
-2004-10-11  David Anderson  <davea@sgi.com>
-
-       * regcache.c (regcache_raw_read): Comment was missing "to".
-       Extraneous ' removed.
-       * gdb_thread_db.h (struct td_thrinfo): ti_lid field
-       comment now describes use.
-
-2004-10-11  Orjan Friberg  <orjanf@axis.com>
-
-       * cris-tdep.c (cris_sigtramp_start, cris_rt_sigtramp_start)
-       (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache)
-       (cris_sigtramp_frame_this_id, cris_sigtramp_frame_prev_register)
-       (cris_sigtramp_frame_sniffer): New functions.
-       (cris_gdbarch_init): Hook in signal trampoline unwinder.
-       (cris_dwarf2_reg_to_regnum, cris_dwarf2_frame_init_reg): New functions.
-       (cris_gdbarch_init): Hook in Dwarf-2 unwinder.
-       (struct gdbarch_tdep, set_cris_dwarf2_cfi, cris_dump_tdep)
-       (cris_gdbarch_init, _initialize_cris_tdep): Add CRIS Dwarf-2 CFI usage
-       command.
-       (cris_version_update): Remove, replace with ...
-       (set_cris_version): New function.
-       (struct gdbarch_tdep, cris_mode, cris_mode_update)
-       (cris_cannot_store_register, cris_dump_tdep, cris_gdbarch_init)
-       (_initialize_cris_tdep): Remove CRIS mode command.
-       (cris_fpless_backtrace, _initialize_cris_tdep): Remove 
-       cris-fpless-backtrace command.
-       (cris_scan_prologue): Fix prologue scanning limit.
-       (cris_register_type): Update to reflect actual registers.
-       (cris_register_bytes_ok) Remove.
-       (cris_gdbarch_init): Remove support for CRIS v8 and v9.
-       Remove set_gdbarch_deprecated_register_size,
-       set_gdbarch_deprecated_register_byte, set_gdbarch_register_bytes_ok.
-       
-2004-10-10  Andrew Cagney  <cagney@gnu.org>
-
-       * ada-lang.c (lim_warning): Add ATTR_FORMAT prototype and FIXME
-       comment.
-
-2004-10-10  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips16_scan_prologue): Remove redundant code.
-
-2004-10-10  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips16_scan_prologue): Renames
-       mips16_heuristic_proc_desc. Update comment.
-       (mips32_scan_prologue): Renames mips32_heuristic_proc_desc.
-       (heuristic_proc_desc): Update calls to the 2 functions above.
-
-2004-10-10  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips_insn16_frame_cache): Remove unused variables.
-       Update comments. Also immediately return empty cache when the start
-       address of our function could not be found.
-       (mips_insn32_frame_cache): Likewise.
-
-2004-10-10  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips16_decode_reg_save): Delete, no longer used.
-       (mips_insn16_frame_cache): Pass frame cache in call to
-       heuristic_proc_desc. Move some code to mips16_heuristic_proc_desc.
-       Remove code that became redundant as a consequence.
-       (mips32_heuristic_proc_desc): No longer compute a fake
-       procedure descriptor. Compute the full frame cache instead.
-       Some minor comment reformatting.
-
-2004-10-10  Jim Blandy  <jimb@redhat.com>
-
-       * MAINTAINERS (generic symtabs, dwarf readers, elf reader, stabs
-       reader, tracing bytecode stuff): Remove self.
-
-2004-10-10  Mark Kettenis  <kettenis@gnu.org>
-
-       * sparc64-linux-tdep.c: Update copyright year.  Don't include
-       "solib-svr4.h".
-       (sparc64_linux_svr4_fetch_link_map_offsets): Remove function.
-       (sparc64_linux_init_abi): Don't set solib_svr4_link_map_offsets.
-       * Makefile.in (sparc64-linux-tdep.o): Update dependencies.
-
-       * sparc-linux-tdep.c: Update copyright year.
-       (sparc_linux_sigtramp_start): Change first argument from CORE_ADDR
-       to struct frame_info *.  Use safe_frame_unwind_memory instead of
-       deprecated_read_memory_nobpt.
-       (sparc32_linux_sigtramp_start, sparc32_linux_rt_sigtramp_start):
-       Change argumen from CORE_ADDR to struct frame_info *.  Adjust for
-       changed signature of sparc_linux_sigtramp_start.
-       (sparc32_linux_pc_in_sigtramp): Remove function.
-       (sparc32_linux_sigtramp_p): New function.
-       (sparc32_linux_sigtramp_frame_sniffer): Use
-       sparc32_linux_sigtramp_p instead of sparc32_linux_pc_in_sigtramp.
-
-       * sparc-linux-tdep.c (sparc32_linux_svr4_fetch_link_map_offsets):
-       Remove function.
-       (sparc32_linux_init_abi): Don't set solib_svr4_link_map_offsets.
-
-       * ada-lang.c (lim_warning): Re-implement as a varargs function.
-       (decode_packed_array_type, value_subscript_packed)
-       (ada_evaluate_subexp, to_fixed_range_type): Remove redundant
-       argument in call to lim_warning.
-
-       * configure.in: Really disable the TUI if an enhanced curses
-       library isn't found.
-       * configure: Regenerate.
-
-2004-10-09  Mark Kettenis  <kettenis@gnu.org>
-
-       * config/i386/nbsdaout.mh (NAT_FILE): Set to solib.h.
-       * config/i386/nbsdelf.mh (NAT_FILE): Set to solib.h.
-       * config/i386/nm-nbsdaout.h: Remove file.
-       * config/i386/nm-fbsd.h (link_object, lo_name, lo_library)
-       (lo_unused, lo_major, lo_minor, lo_next, link_map, lm_addr)
-       (lm_name, lm_next, lm_lop, lm_lob, lm_rwt, lm_ld, lm_lpd)
-       (link_dynamic_2, ld_loaded, ld_need, ld_rules, ld_got, ld_plt)
-       (ld_rel, ld_hash, ld_stab, ld_stab_hash, ld_buckets, ld_symbols)
-       (ld_symb_size, ld_text, ld_plt_sz, rtc_symb, rtc_sp, rtc_next)
-       (ld_debug, ldd_version, ldd_in_debugger, ldd_sym_loaded)
-       (ldd_bp_addr, ldd_bp_inst, ldd_cp, link_dynamic, ld_version)
-       (ldd, ld_un, ld_2): Remove defines.
-       * config/i386/nm-obsd.h: Likewise.
-
-2004-10-09  Paul Hilfinger  <hilfingr@nile.gnat.com>
-
-       * ada-lex.l: Remove useless rule whose right-context clause
-       causes unreferenced static function warning for yyrealloc.
-       (ada_flex_use): Remove the artificial reference to yyrealloc.
-
-2004-10-08  Andrew Cagney  <cagney@gnu.org>
-
-       * target.h (struct target_ops): Rename to_xfer_memory to
-       deprecated_xfer_memory.
-       * target.c: Update.
-       (deprecated_debug_xfer_memory): Rename debug_to_xfer_memory.
-       * wince.c: Update.
-       * win32-nat.c: Update.
-       * v850ice.c: Update.
-       * uw-thread.c: Update.
-       * thread-db.c: Update.
-       * sol-thread.c: Update.
-       * remote.c: Update.
-       * remote-vx.c: Update.
-       * remote-st.c: Update.
-       * remote-sim.c: Update.
-       * remote-sds.c: Update.
-       * remote-rdp.c: Update.
-       * remote-rdi.c: Update.
-       * remote-mips.c: Update.
-       * remote-m32r-sdi.c: Update.
-       * remote-e7000.c: Update.
-       * procfs.c: Update.
-       * ppc-bdm.c: Update.
-       * nto-procfs.c: Update.
-       * monitor.c: Update.
-       * linux-nat.c: Update.
-       * inftarg.c: Update.
-       * hpux-thread.c: Update.
-       * go32-nat.c: Update.
-       * gnu-nat.c: Update.
-       * exec.c: Update.
-       * corelow.c: Update.
-       * bsd-kvm.c: Update.
-       * aix-thread.c: Update.
-
-2004-10-08  Andrew Cagney  <cagney@gnu.org>
-
-       * target.c (debug_target): Move to near start of file.
-       (target_stopped_data_address_p): Re-org logic, add casts.
-
-2004-10-02  Mark Kettenis  <kettenis@gnu.org>
-
-       * solib-sunos.c [HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS] (link_map)
-       (lm_addr, lm_name, lm_next, link_dynamic_2, ld_loaded, rtc_symb)
-       (rtc_sp, rtc_next, ld_debug, ldd_in_debugger, ldd_bp_addr)
-       (ldd_bp_inst, ldd_cp, link_dynamic, ld_version, ldd, ld_un, ld_2):
-       New defines.
-
-2004-10-08  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * target.h (to_stopped_data_address): Change prototype to
-       take a CORE_ADDR pointer and return an int.
-       * target.c (update_current_target): Change to_stopped_data_address
-       to match new prototype.
-       (debug_to_stopped_data_address): Change appropriately.
-       * breakpoint.c (bpstat_stop_status): Change call to
-       target_stopped_data_address to use new prototype.
-       * frv-tdep.c (frv_have_stopped_data_address): New function.
-       (frv_stopped_data_address): Change to new prototype and
-       functionality.
-       * ia64-linux-nat.c (ia64_stopped_data_address): Change to new
-       prototype and functionality.
-       (ia64_stopped_by_watchpoint): New function.
-       * i386-nat.c (i386_stopped_data_address): Change to new
-       prototype and functionality.
-       (i386_stopped_by_watchpoint): New function.
-       * remote.c (remote_stopped_data_address): Change to new prototype
-       and functionality.
-       * remote-m32r-sdi.c (m32r_stopped_data_address): Ditto.
-       * config/frv/tm-frv.h (frv_stopped_data_address): Change prototype.
-       (STOPPED_BY_WATCHPOINT): Change to use frv_have_stopped_data_address.
-       * config/i386/nm-i386.h (STOPPED_BY_WATCHPOINT): Change to use
-       new i386_stopped_by_watchpoint function.
-       (i386_stopped_by_watchpoint): New prototype.
-       (i386_stoppped_data_address): Change to new prototype.
-       * config/ia64/nm-linux.h (STOPPED_BY_WATCHPOINT): Change to use
-       new ia64_stopped_by_watchpoint function.
-       (ia64_stopped_by_watchpoint): New prototype.
-       (ia64_stopped_data_address): Ditto.
-
-2004-10-08  Paul Hilfinger  <Hilfinger@gnat.com>
-
-       * ada-typeprint.c (ada_print_type): Use int_string for printing
-       modulus of modular type.
-       * ada-lang.h (ada_modulus): Change return type to unsigned.
-       * ada-lang.c (ada_language_arch_info): Correct type of 
-       string_char_type.
-       (ada_modulus): Return unsigned result.
-       (ada_lookup_symbol): Remove user disambiguation and modify comment 
-       accordingly.
-       
-2004-10-08 Eric Botcazou  <ebotcazou@act-europe.fr>    
-
-       Committed by Paul Hilfinger.
-       * ada-lang.c (decode_packed_array): On big-endian targets, 
-       left-justify the value if it comes with a modular type.
-
-2004-10-08  Joel Brobecker  <brobecker@gnat.com>       
-
-       Committed by Paul Hilfinger.
-        * ada-lang.c (template_to_static_fixed_type): Fix a small typo.
-       (is_name_suffix): Add support for "___JM" suffixes.
-       (ada_check_typedef): Renames ada_completed_type. 
-       Update all users of CHECK_TYPEDEF, check_typedef, and 
-       ada_complete_type to call ada_check_typedef.
-       * ada-typeprint.c: Likewise.
-       * ada-valprint.c: Likewise.
-
-2004-10-08  Corinna Vinschen  <vinschen@redhat.com>
-
-       * infcall.c (call_function_by_hand): Use correct VALUE_TYPE macro.
-
-2004-10-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * MAINTAINERS: Update e-mail address.
-
-2004-10-07  Daniel Jacobowitz  <dan@debian.org>
-
-       From Maciej W. Rozycki  <macro@mips.com>:
-       * mips-tdep.c (mips32_next_pc): Check the register's contents,
-       not its number for BLEZ/BLEZL and BGTZ/BGTZL.
-
-2004-10-07  Kei Sakamoto  <sakamoto.kei@renesas.com>
-
-       * m32r-tdep.c (decode_prologue): Support functions written
-       in assembler language. Recognize trap instructions as the
-       end of prologue.
-       (m32r_frame_unwind_cache): Ditto.
-       (m32r_skip_prologue): Extend search limit. Quit analyzing
-       prologue if pc's location is not readable.
-
-2004-10-06  Paul N. Hilfinger  <Hilfinger@gnat.com>
-
-       * Makefile.in (.l.c): Do conversions of names of alloc and free 
-       functions that are done for .y.c files, plus special one
-       for yy_flex_realloc.  Also, correct missing-file tests here.
-       * ada-lex.l (malloc, free): Remove macros.
-       (resize_tempbuf): Use "realloc"; rely on sed changes to convert to
-       xrealloc.
-       (ada_flex_use): Dummy definition to remove warnings about unused
-       functions.
-       * ada-exp.y (dummy_string_to_ada_operator): Temporary definition
-       to suppress warning.
-       
-2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
-
-       * sh-tdep.c (sh_return_value_nofpu): New function, implementing
-       RETURN_VALUE.
-       (sh_return_value_fpu): Ditto for CPUs with FPU.
-       (sh_gdbarch_init): Remove STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE,
-       RETURN_VALUE_ON_STACK and USE_STRUCT_CONVENTION throughout.
-       Install sh_return_value_nofpu resp. sh_return_value_fpu as
-       RETURN_VALUE functions.
-
-2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
-
-       * sh-tdep.c (sh_pseudo_register_read): Add PSEUDO_BANK_REGNUM handling. 
-       (sh_pseudo_register_write): Ditto.
-
-2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
-
-       * sh-tdep.c (IS_MACL_STS): New define.
-       (IS_MOVI20): Ditto.
-       (IS_MACL_LDS): Ditto.
-       (sh_analyze_prologue): Recognize STS.L MACL,@-r15 and MOVI20
-       instructions in prologue.
-       (sh_in_function_epilogue_p): Recognize LDS.L @r15+,MACL and MOVI20
-       instructions in epilogue.
-
-2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
-
-       * sh-tdep.c (SH_NUM_REGS): Define as 67.
-       (sh_sh_register_name): Add eight empty register names.
-       (sh_sh3_register_name): Ditto.
-       (sh_sh3e_register_name): Ditto.
-       (sh_sh2e_register_name): Ditto.
-       (sh_sh2a_register_name): New function, defining SH2A register set.
-       (sh_sh2a_nofpu_register_name): New function, defining SH2A register set
-       in nofpu case.
-       (sh_sh_dsp_register_name): Add eight empty register names.
-       (sh_sh3_dsp_register_name): Ditto.
-       (sh_sh4_register_name): Ditto.
-       (sh_sh4_nofpu_register_name): Ditto.
-       (sh_sh4al_dsp_register_name): Ditto.
-       (sh2a_show_regs): New function.
-       (sh2a_nofpu_show_regs): New function.
-       (sh_sh2a_register_type): New function.
-       (do_bank_register_info): New function.
-       (sh_print_pseudo_register): Call do_bank_register_info.
-       Call sh_print_pseudo_register for valid "bank" register.
-       (sh_sh2a_register_sim_regno): New function.
-       (sh_gdbarch_init): Add bfd_mach_sh2a and bfd_mach_sh2a_nofpu handling.
-       Increment pseudo register count by one for all sh variants with
-       pseudo registers to accomodate pseudo bank register.
-       * sh-tdep.h: Add register numbers for R0_BANK0_REGNUM, MACHB_REGNUM,
-       IVNB_REGNUM, PRB_REGNUM, GBRB_REGNUM, MACLB_REGNUM, BANK_REGNUM,
-       IBCR_REGNUM, IBNR_REGNUM, TBR_REGNUM and PSEUDO_BANK_REGNUM. 
-       Increment pseudo register numbers.
-
-2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
-
-       * dwarf2read.c (read_subroutine_type): Call make_function_type
-       instead of lookup_function_type.
-
-2004-10-05  Jim Blandy  <jimb@redhat.com>
-
-       * linux-nat.c (_initialize_linux_nat): Rename child_ops.
-       (Previous change missed some uses.)
-
-2004-10-05  Andrew Cagney  <cagney@gnu.org>
-
-       * target.h (deprecated_child_ops): Rename child_ops.
-       * wince.c: Update copyright.  Rename child_ops.
-       * win32-nat.c: Rename child_ops.
-       * target.c: Rename child_ops.
-       * rs6000-nat.c: Rename child_ops.
-       * linux-nat.c: Rename child_ops.
-       * infttrace.c: Rename child_ops.
-       * inftarg.c: Rename child_ops.
-       * infptrace.c: Rename child_ops.
-       * hppah-nat.c: Update copyright.  Rename child_ops.
-       * hpux-thread.c: Update copyright.  Rename child_ops.
-
-2004-10-05  Daniel Jacobowitz  <dan@debian.org>
-
-       * remote.c (remote_xfer_partial): Handle TARGET_OBJECT_MEMORY.
-
-2004-10-05  Andrew Cagney  <cagney@gnu.org>
-
-       * version.in: Bump to version 6.2.50_YYYY-MM-DD-cvs.
-
-2004-10-05  Daniel Jacobowitz  <dan@debian.org>
-
-       * dwarf2read.c (REF_HASH_SIZE): Move earlier.
-       (die_ref_table): Remove.
-       (struct dwarf2_cu): Add DIES, DEPENDENCIES, and DIE_REF_TABLE.
-       (struct dwarf2_per_cu_data): Add PSYMTAB.  Add a comment describing
-       the usage of this type.
-       (struct dwarf2_per_objfile): Update comment for ALL_COMP_UNITS.
-       (struct dwarf2_pinfo, PST_PRIVATE, DWARF_INFO_OFFSET): Remove.
-       (struct dwarf2_queue_item, dwarf2_queue, dwarf2_queue_tail): New.
-       (dwarf2_create_include_psymtab): Update comment.
-       (find_partial_die): Remove third argument.  Remove unreachable call
-       to error ().
-       (dwarf2_find_containing_comp_unit): Update comments.  Change one
-       assertion to an error.  Remove an unreachable error.
-       (dwarf2_find_comp_unit): Update comments.
-       (type_at_offset): Remove dead code.
-       (make_cleanup_free_die_list, dwarf2_empty_hash_tables): Remove.
-       (store_in_ref_table): Add CU argument.
-       (follow_die_ref): Take DIE, attribute, and CU arguments.  Handle
-       inter-compilation-unit references.
-       (load_full_comp_unit, process_full_comp_unit): New functions, based
-       on psymtab_to_symtab_1.
-       (psymtab_to_symtab_1): Use them.
-       (dwarf2_add_dependence): New function.
-       (dwarf2_build_psymtabs_hard): Set the psymtab in per_cu.  Always create
-       a per_cu structure, and save it in READ_PSYMTAB_PRIVATE.
-       (partial_die_parent_scope, guess_structure_name): Update for changes
-       to find_partial_die.
-       (dwarf2_psymtab_to_symtab): Initialize dwarf2_per_objfile here.
-       (queue_comp_unit, process_queue, dwarf2_release_queue): New.
-       (read_comp_unit): Don't call dwarf2_empty_hash_tables.
-       (read_die_and_children): Update call to store_in_ref_table.
-       (do_free_die_list_cleanup): Remove.
-       (fixup_partial_die): Update for changes to find_partial_die.
-       (read_full_die): Handle queueing absolute references.
-       (read_attribute_value): Use DW_ADDR for all DW_FORM_ref* forms.
-       (dwarf2_attr, die_specification, die_type)
-       (die_containing_type, dwarf2_extension): Update calls to
-       follow_die_ref.
-       (dump_die): Update DW_FORM_ref* handling.
-       (dwarf2_get_ref_die_offset): Likewise.
-       (free_one_comp_unit): Release the dies list.
-       (dwarf2_mark_helper): New function.
-       (dwarf2_mark): Use it.
-
-2004-10-05  Mark Kettenis  <kettenis@jive.nl>
-
-       * procfs.c (procfs_xfer_partial): Use WRITEBUF instead of READBUF
-       when writing to memory.
-
-2004-10-05  Kei Sakamoto  <sakamoto.kei@renesas.com>
-
-       * m32r-tdep.c (m32r_use_struct_convention): Delete function.
-       (m32r_extract_struct_value_address): Delete function.
-       (m32r_return_value): New function.
-       (m32r_gdbarch_init): Instead of store_return_value,
-       extract_return_value, deprecated_extract_struct_value_address
-       and deprecated_use_struct_convention, set return_value.
-
-2004-10-03  Daniel Jacobowitz  <dan@debian.org>
-
-       * dwarf2read.c (read_subrange_type): Add comment for variable
-       sized arrays.
-
-2004-10-03  Paul Hilfinger  <hilfingr@nile.gnat.com>
-
-       * Makefile.in (.l.c): Modify rule for compatibility with recent
-       versions of flex, and remove most command-line options.
-       * ada-lex.l: Add %options line in place of -I -i and -s command-line
-       options.
-
-2004-10-02  Paul N. Hilfinger  <Hilfinger@gnat.com>
-
-        Turn on initial Ada support (mainly expression evaluation).
-       
-        * Makefile.in (SFILES): Remove ada-tasks.c.
-       (HFILES_NO_SRCDIR): Add ada-lang.h.
-       (COMMON_OBS): Add ada-lang.o, ada-typeprint.o, ada-valprint.o.
-       (YYOBJ): Add ada-exp.o.
-       (rule .l.c): Generalize to not mention ada.
-       * symtab.c: Include ada-lang.h.
-       (symbol_natural_name, symbol_demangled_name)
-       (symbol_search_name): Add Ada case.
-
-2004-10-01  Andrew Cagney  <cagney@gnu.org>
-
-       * Makefile.in (COMMON_OBS): Add inf-child.o.
-       * config/vax/obsd.mh (NATDEPFILES): Remove inf-child.o.
-       * config/vax/nbsdelf.mh (NATDEPFILES): Remove inf-child.o.
-       * config/vax/nbsdaout.mh (NATDEPFILES): Remove inf-child.o.
-       * config/powerpc/nbsd.mh (NATDEPFILES): Remove inf-child.o.
-       * config/m88k/obsd.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/obsdaout.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/obsd64.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/obsd.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/nbsdelf.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/nbsdaout.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/nbsd64.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/fbsd64.mh (NATDEPFILES): Remove inf-child.o.
-       * config/i386/fbsd.mh (NATDEPFILES): Remove inf-child.o.
-
-       * target.c (xfer_using_stratum): Change return type to LONGEST.
-       On each iteration offset, readbuf and writebuf.
-       * inf-ptrace.c (inf_ptrace_xfer_partial): Simplify computation of
-       partial_length, and read/modify/write predicate, update comments.
-       Pass buffer.word to ptrace write.
-
-2004-10-01  Paul N. Hilfinger  <Hilfinger@gnat.com>
-
-       * symfile.c (init_filename_language_table): Add extensions for
-       Ada.
-       * defs.h (enum language): Add language_ada.
-       * gdbtypes.h (TYPE_FLAG_FIXED_INSTANCE): Define.
-       * ada-lang.c: Strip code that is conditionalized out by GNAT_GDB.
-       (add_symbols_from_enclosing_procs): Make a no-op for now.
-       (ada_unqualified_name,add_angle_brackets,function_name_from_pc)
-       (extended_canonical_line_spec, find_sal_from_funcs_and_line)
-       (find_line_in_linetable, find_next_line_in_linetable)
-       (read_all_symtabs, is_plausible_func_for_line)
-       (adjust_pc_past_prologue, error_breakpoint_runtime_sym_not_found)
-       (is_runtime_sym_defined, check_size): Remove declaration.
-       (function_name_from_pc, ada_translate_error_message)
-       (ada_lookup_minimal_symbol): Remove definition.
-       (ada_add_block_symbols): Remove useless label.
-       * ada-lang.h (ada_maybe_exception_partial_symbol): Remove 
-       useless declaration.
-       (ada_is_exception_sym): Likewise.
-
-2004-09-30    Kei Sakamoto  <sakamoto.kei@renesas.com>
-
-       Add m32r-linux support.
-       * configure.tgt: Add m32r*-*-linux*.
-       * Makefile.in (ALLDEPFILES): Add m32r-tdep.c, m32r-linux-nat.c
-       and m32r-linux-tdep.c.
-       (m32r-linux-nat.o, m32r-linux-tdep.o): New dependencies.
-       * m32r-tdep.c: Move some definitions to m32r-tdep.h.
-       * config/djgpp/fnchange.lst: Add m32r-linux-nat.c and
-       m32r-linux-tdep.c.
-       * m32r-tdep.h, m32r-linux-nat.c, m32r-linux-tdep.c,
-       config/m32r/linux.mh, config/m32r/linux.mt,
-       config/m32r/nm-linux.h: New files.
-
-2004-09-30  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips32_decode_reg_save): Remove, unused.
-       (mips32_fetch_instruction): Remove, unused.
-
-2004-09-30  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips_insn16_frame_cache): Remove dead code or
-       conditions that will always be true.
-
-2004-09-30  Mark Kettenis  <kettenis@gnu.org>
-
-       * vaxbsd-nat.c: Include "target,h" and "inf-ptrace.h".
-       (vaxbsd_fetch_inferior_registers): Rename from
-       fetch_inferior_registers.  Make static.
-       (vaxbsd_store_inferior_registers): Rename from
-       store_inferior_registers.  Make static.
-       (_initialize_vaxbsd_nat): Construct and add target vector.
-       * config/vax/nbsdaout.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o.  Add inf-child.o and inf-ptrace.o.
-       * config/vax/nbsdelf.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o.  Add inf-child.o and inf-ptrace.o.
-       (NAT_FILE): Remove.
-       * config/vax/obsd.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o.  Add inf-child.o and inf-ptrace.o.
-       (NAT_FILE): Remove.
-       * Makefile.in (vaxbsd-nat.o): Update dependencies.
-
-       * m88kbsd-nat.c: Include "target.h" and "inf-ptrace.h".
-       (m88kbsd_fetch_inferior_registers): Rename from
-       fetch_inferior_registers.  Make static.
-       (m88kbsd_store_inferior_registers): Rename from
-       store_inferior_registers.  Make static.
-       (_initialize_m88kbsd_nat): New prototype and function.
-       * config/m88k/obsd.mh (NATDEPFILES): Remove infptrace.o and
-       inftarg.o.  Add inf-child.o and inf-ptrace.o.
-       (NAT_FILE): Remove.
-       * Makefile.in (m88kbsd-nat.o): Update dependencies.
-
-2004-09-30  Andrew Cagney  <cagney@gnu.org>
-
-       * target.c (target_xfer_partial): New function.
-       (target_read_memory_partial, target_write_memory_partial) 
-       (default_xfer_partial, target_read_partial, target_write_partial) 
-       (xfer_using_stratum): Use.
-       (debug_to_xfer_partial): Delete function.
-       (setup_target_debug): Do not override to_xfer_partial.
-
-2004-09-30  Mark Kettenis  <kettenis@chello.nl>
-
-       * fork-child.c: Update copyright year.  Fix coding style.
-
-2004-09-29  Mark Kettenis  <kettenis@gnu.org>
-
-       * defs.h (msavestring, mstrsave): Remove prototypes.
-       * utils.c (msavestring, mstrsave): Remove functions.
-       * objfiles.c (allocate_objfile): Use xstrdup instead of mstrsave.
-       * solib-sunos.c (allocate_rt_common_objfile): Use xstrdup instead
-       of mstrsave.
-       * source.c (find_and_open_source): Use xstrdup instead of
-       mstrsave.
-
-2004-09-30  Andrew Cagney  <cagney@gnu.org>
-
-       * inf-ptrace.c (inf_ptrace_target): Do not set to_xfer_memory.
-       (inf_ptrace_xfer_memory): Delete.
-       * target.c (target_xfer_partial_p, xfer_using_stratum): New.
-       (target_read_memory, target_write_memory): Use xfer_using_stratum
-       when target_xfer_partial_p.
-       (debug_target): Move to start of file.
-       (target_read_memory_partial, target_write_memory_partial): Use
-       to_xfer_partial when target_xfer_partial_p.
-
-       * inf-ptrace.c (inf_ptrace_xfer_partial): Replace call to
-       inf_ptrace_xfer_memory with equivalent code.
-       * inftarg.c (child_xfer_partial): When performing a write, pass
-       writebuf to child_xfer_memory.
-
-       * target.c (target_read_string): Use target_read_memory instead of
-       target_xfer_memory.
-
-2004-09-29  Andrew Cagney  <cagney@gnu.org>
-
-       * infptrace.c (kill_inferior): Fix typo, in previous inline.  Pass
-       the address of status.
-
-       * infptrace.c (ptrace_wait): Mention problem with HPUX.
-       (kill_inferior): Inline ptrace_wait call.
-       * linux-nat.c (kill_inferior): Inline ptrace_wait call.
-       * inftarg.c (child_wait): Inline ptrace_wait call.
-
-       * target.h (struct target_ops): Delete field to_post_wait.
-       (target_post_wait): Delete macro.
-       (child_post_wait): Delete declaration.
-       * target.c (update_current_target, update_current_target)
-       (debug_to_post_wait, setup_target_debug): Delete functions and
-       references.
-       * infttrace.c (ptrace_wait): Delete call to target_post_wait.
-       * inftarg.c (child_post_wait): Delete.
-       (init_child_ops): Do not set to_post_wait.
-       * infptrace.c (ptrace_wait): Delete call to target_post_wait.
-       * inf-ptrace.c (inf_ptrace_wait): Delete call to target_post_wait.
-       * inf-child.c (inf_child_post_wait): Delete.
-       (inf_child_target): Do not set to_post_wait.
-       * inf-ptrace.c (inf_ptrace_post_wait): Delete.
-       (inf_ptrace_target): Do not set to_post_wait.
-
-       * wince.c (child_ops): Delete.
-       * win32-nat.c (child_ops): Delete.
-
-       * inftarg.c (inftarg_set_find_memory_regions) 
-       (inftarg_set_make_corefile_notes): Delete functions.
-       (_initialize_linux_nat): Inline calls.
-
-       * target.h (child_ops): Declare.
-       * inftarg.c (child_ops): Move from here ...
-       * target.c (child_ops): ... to here.
-       * wince.c (child_ops): Delete extern declaration.
-       * win32-nat.c (child_ops): Delete extern declaration.
-       * linux-nat.c (child_ops): Delete extern declaration.
-       * hpux-thread.c (child_ops): Delete extern declaration.
-
-2004-09-28  Mark Kettenis  <kettenis@gnu.org>
-
-       * configure.tgt: Set default OS/ABI for OpenBSD ELF targets.
-
-2004-09-28  Mark Kettenis  <kettenis@gnu.org>
-
-       * configure.in: Only set host_makefile_frag when building a native
-       debugger.
-       * configure: Regenerate.
-
-       * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Register OS/ABI
-       for OpenBSD ELF.
-
-2004-09-28  Andrew Cagney  <cagney@gnu.org>
-
-       Problem identified by Paul Hilfinger.
-       * Makefile.in (ada_lex_c): Define.
-       (ada-lex.o): Delete rule.
-
-       * linux-proc.c: Delete file.
-       * Makefile.in: Update.
-       * config/sparc/linux64.mh (NATDEPFILES): 
-       * config/sparc/linux.mh (NATDEPFILES): Update.
-       * config/s390/s390.mh (NATDEPFILES): Update.
-       * config/powerpc/ppc64-linux.mh (NATDEPFILES): Update.
-       * config/powerpc/linux.mh (NATDEPFILES): Update.
-       * config/pa/linux.mh (NATDEPFILES): Update.
-       * config/mips/linux.mh (NATDEPFILES): Update.
-       * config/m68k/linux.mh (NATDEPFILES): Update.
-       * config/ia64/linux.mh (NATDEPFILES): Update.
-       * config/i386/linux64.mh (NATDEPFILES): Update.
-       * config/i386/linux.mh (NATDEPFILES): Update.
-       * config/arm/linux.mh (NATDEPFILES): Update.
-       * config/alpha/alpha-linux.mh (NATDEPFILES): Update.
-       * linux-nat.c: Update copyright.  Include <sys/param.h>,
-       <sys/procfs.h>, "elf-bfd.h", "gregset.h", <ctype.h>,
-       "gdbthread.h", "gdb_stat.h", <fcntl.h>.
-       (O_LARGEFILE): Possibly define.
-       (_initialize_linux_nat, linux_proc_pending_signals)
-       (add_line_to_sigset, linux_proc_xfer_memory)
-       (linux_nat_info_proc_cmd, linux_nat_make_corefile_notes)
-       (linux_nat_do_registers, linux_nat_corefile_thread_callback)
-       (struct linux_corefile_thread_data)
-       (linux_nat_do_thread_registers, linux_nat_find_memory_regions)
-       (child_pid_to_exec_file): Insert code previously in linux-proc.c.
-
-2004-09-16  Andrew Cagney  <cagney@gnu.org>
-
-       * lin-lwp.c: Delete file.
-       * linux-nat.c: Include "gdb_assert.h", "gdb_string.h", <unistd.h>,
-       <sys/syscall.h>, "gdbthread.h", "gdbcmd.h", "regcache.h".
-       (status_to_str, init_lwp_list, add_lwp, delete_lwp)
-       (find_lwp_pid, iterate_over_lwps, lin_lwp_attach_lwp)
-       (linux_nat_attach, detach_callback, linux_nat_detach)
-       (resume_callback, resume_clear_callback, linux_nat_resume)
-       (kill_lwp, linux_nat_handle_extended, wait_lwp, stop_callback)
-       (stop_wait_callback, linux_nat_has_pending, flush_callback)
-       (status_callback, running_callback, count_events_callback)
-       (select_singlestep_lwp_callback, select_event_lwp_callback)
-       (cancel_breakpoints_callback, select_event_lwp, resumed_callback)
-       (child_wait, stop_and_resume_callback, linux_nat_wait)
-       (kill_callback, kill_wait_callback, linux_nat_kill)
-       (linux_nat_create_inferior, linux_nat_mourn_inferior)
-       (linux_nat_xfer_memory, linux_nat_thread_alive)
-       (linux_nat_pid_to_str, init_linux_nat_ops, sigchld_handler)
-       (_initialize_linux_nat): New functions.
-       * Makefile.in: Update all dependencies.
-       * config/sparc/linux64.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/sparc/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/s390/s390.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/powerpc/ppc64-linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/powerpc/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/pa/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/mips/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/m68k/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/ia64/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/i386/linux64.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/i386/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/arm/linux.mh (NATDEPFILES): Remove lin-lwp.o.
-       * config/alpha/alpha-linux.mh (NATDEPFILES): Remove lin-lwp.o.
-
-2004-09-27  Mark Kettenis  <kettenis@gnu.org>
-
-       * config/i386/fbsd64.mh, config/i386/nbsd64.mh,
-       config/i386/obsd64.mh (NAT_FILE): Remove variable.
-
-       * configure.in: Don't comment out NATDEPFILES in the generated
-       Makefile if NAT_FILE is unset.
-       * configure: Regenerate.
-
-2004-09-27  Andrew Cagney  <cagney@gnu.org>
-
-       * infrun.c (check_for_old_step_resume_breakpoint): Delete.
-       (insert_step_resume_breakpoint): Delete.
-       (insert_step_resume_breakpoint_at_frame): New function.
-       (insert_step_resume_breakpoint_at_sal): New function.
-       (handle_inferior_event, step_into_function)
-       (insert_step_resume_breakpoint): Simplify by using same.
-
-       * gdb_indent.sh (types): Add caddr_t to list of predefined types.
-
-2004-09-26  Mark Kettenis  <kettenis@gnu.org>
-
-       * fbsd-proc.c: Remove file.
-       * Makefile.in (fbsd-proc.o): Remove dependency.
-
-       * i386fbsd-nat.c (_initialize_i386fbsd_nat): Group target related
-       code together.
-
-       * config/i386/nm-fbsd64.h: Remove file.
-       * config/i386/fbsd64.mh (NAT_FILE): Set to config/nm-nbsd.h.
-
-2004-09-26  Mark Kettenis  <kettenis@gnu.org>
-
-       * amd64-nat.h: Update copyright year.
-       (amd64bsd_target): New prototype.
-       * amd64bsd-nat.c: Include "target.h" and "inf-ptrace.h".
-       (amd64bsd_target): New function.
-       (amd64bsd_fetch_inferior_registers): Rename from
-       fetch_inferior_registers.  Make static.
-       (amd64bsd_store_inferior_registers): Rename from
-       store_inferior_registers.  Make static.
-       * amd64fbsd-nat.c: Include "target.h" and "fbsd-nat.h".
-       (_initialize_amd64fbsd_nat): Construct and add target vector.
-       * amd64nbsd-nat.o: Include "target.h".
-       (_initialize_amd64nbsd_nat): Construct and add target vector.
-       * amd64obsd-nat.c: Include "target.h".
-       (_initialize_amd64obsd_nat): Construct and add target vector.
-       * config/i386/nm-fbsd64.h (CHILD_PID_TO_EXEC_FILE): Remove define.
-       * config/i386/fbsd64.mh (NATDEPFILES): Remove infptrace.o,
-       inftarg.o and fbsd-proc.o.  Add inf-child.o, inf-ptrace.o and
-       fbsd-nat.o.
-       * config/i386/nbsd64.mh, config/i386/obsd64.mh (NATDEPFILES):
-       Remove infptrace.o and inftarg.o.  Add inf-child.o and
-       inf-ptrace.o.
-       * Makefile.in (amd64bsd-nat.o, amd64fbsd-nat.o, amd64nbsd-nat.o)
-       (amd64obsd-nat.o): Update dependencies.
-
-2004-09-25  Mark Kettenis  <kettenis@gnu.org>
-
-       * config/i386/fbsd.mh (NATDEPFILES): Remove infptrace.o.
-       * config/i386/nbsdaout.mh (NATDEPFILES): Remove infptrace.o.
-       * config/i386/nbsdelf.mh (NATDEPFILES): Remove infptrace.o.
-       * config/i386/obsd.mh (NATDEPFILES): Remove infptrace.o.
-       * config/i386/obsdaout.mh (NATDEPFILES): Remove infptrace.o.
-
-       * inf-ptrace.c (inf_ptrace_attach): Remove redundant parenthesis.
-       Inline attach call.
-       (inf_ptrace_detach): Inline detach call.
-
-       * configure.in: Check for waddstr instead of mvwaddstr when
-       searching for curses library.  Check for wborder.
-       * configure, config.in: Regenerate.
-       * tui/tui-wingeneral.c (box_win): Use box if wborder isn't
-       available.
-
-       * inf-ptrace.c (inf_ptrace_xfer_memory): Fix gdb_indent.sh wart.
-
-2004-09-24  Robert Picco <Robert.Picco@hp.com>
-
-       Committed by Andrew Cagney.
-       * remote.c (set_remote_protocol_p_packet_cmd, remote_protocol_p)
-       (show_remote_protocol_p_packet_cmd): New.  Implement 'p' packet.
-       configuration.
-       (fetch_register_using_p): Implement 'p' packet.  Based on code by
-       Fernando Nasser.
-       (remote_fetch_registers): Call fetch_register_using_p.
-       (init_all_packet_configs, show_remote_cmd)
-       (_initialize_remote): Add p-packet.
-
-2004-09-24  Mark Kettenis  <kettenis@gnu.org>
-
-       * inf-ptrace.c (inf_ptrace_kill_inferior): Call ptrace directly
-       instead of call_ptrace.  Call wait directly instead of
-       ptrace_wait.
-       (inf_ptrace_me): Call ptrace directly instead of call_ptrace.
-       (inf_ptrace_wait): Inline ptrace_wait call.
-
-2004-09-24  Paul Hilfinger  <hilfingr@nile.gnat.com>
-
-       * Makefile.in (.y.c): Revert previous change.  ../ylwrap was 
-       rolled back instead.
-
-2004-09-24  Paul Hilfinger  <hilfingr@nile.gnat.com>
-
-       * Makefile.in (.y.c): Modify $(YLWRAP) invocation to use
-       the new argument order.
-
-2004-09-23  Corinna Vinschen  <vinschen@redhat.com>
-
-       * MAINTAINERS: Remove "broken" from XStormy16 entry.
-       * xstormy16-tdep.c: Convert XStormy16 target to latest GDB methods.
-       (struct gdbarch_tdep): Remove.
-       (struct xstormy16_frame_cache): New frame cache structure.
-       (xstormy16_register_byte, xstormy16_register_raw_size)
-       (xstormy16_reg_virtual_type, xstormy16_register_type)
-       (xstormy16_push_arguments, xstormy16_push_return_address)
-       (xstormy16_pop_frame, xstormy16_store_struct_return)
-       (xstormy16_store_return_value, xstormy16_extract_struct_value_address)
-       (xstormy16_frame_saved_register, xstormy16_get_saved_register)
-       (xstormy16_scan_prologue, xstormy16_frame_init_saved_regs)
-       (xstormy16_frame_saved_pc, xstormy16_init_extra_frame_info)
-       (xstormy16_frame_chain, xstormy16_frame_chain_valid,
-       (xstormy16_saved_pc_after_call, xstormy16_save_dummy_frame_to): Remove.
-       (xstormy16_use_struct_convention): Drop gcc_p parameter.
-       (xstormy16_extract_return_value, xstormy16_store_return_value):
-       Regcachify.  Drop useless struct convention handling.
-       (xstormy16_register_type, xstormy16_return_value)
-       (xstormy16_push_dummy_call, xstormy16_analyze_prologue)
-       (xstormy16_alloc_frame_cache, xstormy16_frame_cache)
-       (xstormy16_frame_prev_register, xstormy16_frame_this_id)
-       (xstormy16_frame_base_address, xstormy16_frame_sniffer)
-       (xstormy16_unwind_sp, xstormy16_unwind_pc)
-       (xstormy16_unwind_dummy_id) : New functions.
-       (xstormy16_skip_prologue): Call xstormy16_analyze_prologue instead
-       of xstormy16_scan_prologue.
-       (xstormy16_frame_unwind): New frame_unwind structure.
-       (xstormy16_frame_base): New frame_base structure.
-       (xstormy16_gdbarch_init): Accomodate all of the above changes.
-       Reshuffle for better readability.  Also add dwarf2_frame_sniffer.
-
-2004-09-22  Mark Kettenis  <kettenis@gnu.org>
-
-       * language.c (language_gdbarch_post_init): Fix off-by one error.
-
-2004-09-21  Daniel Jacobowitz  <dan@debian.org>
-
-       * dwarf2read.c (struct dwarf2_per_cu_data): New field type_hash.
-       (struct dwarf2_offset_and_type): New.
-       (set_die_type, reset_die_and_siblings_types, get_die_type)
-       (offset_and_type_hash, offset_and_type_eq): New functions.
-       (read_structure_type, read_enumeration_type, read_array_type)
-       (read_namespace, read_tag_pointer_type, read_tag_ptr_to_member_type)
-       (read_tag_reference_type, read_tag_const_type)
-       (read_tag_volatile_type, read_tag_string_type, read_subroutine_type)
-       (read_typedef, read_base_type, read_subrange_type): Use
-       set_die_type.
-
-2004-09-20  Daniel Jacobowitz  <dan@debian.org>
-
-       * Makefile.in (dwarf2read.o): Update dependencies.
-       * dwarf2read.c: Include "command.h" and "gdbcmd.h".
-       (struct dwarf2_per_objfile): Add all_comp_units, n_comp_units,
-       and read_in_chain.
-       (struct dwarf2_cu): Add read_in_chain, per_cu, last_used,
-       mark, and has_form_ref_addr.
-       (struct dwarf2_per_cu_data): New.
-       (dwarf2_max_cache_age): New.
-       (dwarf2_build_psymtabs_hard): Free cached compilation units
-       after loading.  Create and manage the list of compilation units.
-       Remove unnecessary NULL initialization.  Fix indentation.
-       (psymtab_to_symtab_1): Initialize all of CU.
-       (dwarf2_read_abbrevs): Set has_form_ref_addr.
-       (find_partial_die): Use dwarf2_find_containing_comp_unit
-       and load_comp_unit.
-       (free_stack_comp_unit): Update comments.  Clear the per-cu
-       pointer.  Handle aging.
-       (dwarf2_find_containing_comp_unit, free_cached_comp_units)
-       (age_cached_comp_units, free_one_cached_comp_unit)
-       (dwarf2_mark, dwarf2_clear_marks, create_all_comp_units)
-       (load_comp_unit, dwarf2_find_comp_unit, free_one_comp_unit)
-       (set_dwarf2_cmdlist, show_dwarf2_cmdlist, set_dwarf2_cmd)
-       (show_dwarf2_cmd): New.
-       (_initialize_dwarf2_read): Provide "maint set dwarf2 max-cache-age"
-       and "maint show dwarf2 max-cache-age".
-       * gdbcmd.h (maintenance_set_cmdlist, maintenance_show_cmdlist): New
-       externs.
-       * maint.c (maintenance_set_cmdlist, maintenance_show_cmdlist): Make
-       global.
-
-2004-09-20  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * dwarf2read.c (typename_concat): Change prototype to accept obstack
-       and dwarf2_cu struct pointer as arguments.  Change function to use
-       obstack if provided and use dwarf2_cu to determine language-specific
-       separator.
-       (partial_die_parent_scope): Change comment to include java.  Use
-       new version of typename_concat instead of obconcat.
-       (partial_die_full_name): Use typename_concat.
-       (read_namespace): Ditto.
-       (read_enumeration_type): Use typename_concat instead of obconcat.
-       (new_symbol): Ditto.
-       (add_partial_symbol): Enhance tests for C++ to also test for Java.
-       (guess_structure_name): Ditto.
-       (read_subroutine_type): Ditto.
-       (read_structure_type): Ditto.
-       (is_vtable_name): Add Java support.
-       (determine_class_name): Switch to new typename_concat call.
-       (determine_prefix): Switch to new typename_concat call.
-       * jv-exp.y (FuncStart): New pattern.
-       (MethodInvocation): Add support for simple function calls.  Change
-       warning message for other forms of inferior call currently not
-       supported.
-       * valarith.c (value_subscript): Treat an array with upper-bound
-       of -1 as unknown size.
-
-2004-09-20  Daniel Jacobowitz  <dan@debian.org>
-
-       * symtab.c (lookup_partial_symtab): Use psymtab_to_fullname.
-       (lookup_partial_symtab): Use symtab_to_fullname.
-
-2004-09-19  Jim Blandy  <jimb@redhat.com>
-
-       * minsyms.c (lookup_minimal_symbol): Doc fix.
-
-2004-09-20  Andrew Cagney  <cagney@gnu.org>
-
-       * config/nm-lynx.h (DEPRECATED_CHILD_RESUME): Deprecate
-       CHILD_RESUME.
-       * config/i386/nm-linux.h (DEPRECATED_CHILD_RESUME): Ditto.
-       * config/nm-linux.h (DEPRECATED_KILL_INFERIOR): Deprecate
-       KILL_INFERIOR.
-       * infptrace.c: Update.
-
-2004-09-19  Daniel Jacobowitz  <dan@debian.org>
-
-       * symtab.c (output_source_filename): Mark first argument as const.
-       (sources_info): Use symtab_to_fullname and psymtab_to_fullname
-       for "info sources" output.
-
-2004-09-20  Mark Kettenis  <kettenis@gnu.org>
-
-       * config/i386/nm-fbsd.h, config/i386/nm-obsd.h: Don't include
-       <machine/vmparam.h>.
-       (KERNEL_U_ADDR, REGISTER_U_ADDR): Remove defines.
-       (register_u_addr): Remove prototype.
-
-2004-09-19  Mark Kettenis  <kettenis@gnu.org>
-
-       * i386bsd-nat.c: Include "i386bsd-nat.h" and "inf-ptrace.h".
-       (i386bsd_fetch_inferior_registers): Rename from
-       fetch_inferior_registers.  Make static.
-       (i386bsd_store_inferior_registers): Rename from
-       store_inferior_registers.  Make static.
-       (i386bsd_target): New function.
-       * i386bsd-nat.h: New file.
-       * i386fbsd-nat.c: Include "target.h", "fbsd-nat.h" and
-       "i386bsd-nat.h".
-       (i386fbsd_resume): Rename from child_resume.  Make static.
-       (_initialize_i386fbsd_nat): Construct and add target vector.
-       * i386nbsd-nat.c: Include "target.h" and "i386bsd-nat.h".
-       (_initialize_i386nbsd_nat): Construct and add target vector.
-       * config/i386/nm-fbsd.h: (CHILD_RESUME, CHILD_PID_TO_EXEC_FILE):
-       Remove defines.
-       * config/i386/fbsd.mh (NATDEPFILES): Add inf-child.o, inf-ptrace.o
-       and fbsd-nat.o.  Remove inftarg.o and fbsd-proc.o.
-       * config/i386/nbsdaout.mh (NATDEPFILES): Add inf-child.o,
-       inf-ptrace.o, i386bsd-nat.o and bsd-kvm.o.  Remove inftarg.o.
-       (LOADLIBES): New variable.
-       * config/i386/nbsdelf.mh (NATDEPFILES): Add inf-child.o and
-       inf-ptrace.o.  Remove inftarg.o.
-       * config/i386/obsd.mh (NATDEPFILES): Add inf-child.o and
-       inf-ptrace.o. Remove inftarg.o.
-       * config/i386/obsdaout.mh (NATDEPFILES): Add inf-child.o,
-       inf-ptrace.o, i386nbsd-nat.o and bsd-kvm.o.  Remove inftarg.o.
-       (LOADLIBES): New variable.
-       * Makefile.in (i386bsd_nat_h): New variable.
-       (i386bsd-nat.o, i386fbsd-nat.o, i386nbsd-nat.o): Update
-       dependencies.
-
-       * sparc64nbsd-tdep.c: Include "objfiles.h".
-       (sparc64nbsd_init_abi): Set in_solib_call_trampoline and
-       skip_trampoline_code.  Set solib_svr4_fetch_link_map_offsets to
-       svr4_lp64_fetch_link_map_offsets.
-       * sparc64obsd-tdep.c: Include "objfiles.h".  Don't include
-       "nbsd-tdep.h".
-       (sparc64obsd_init_abi): Set in_solib_call_trampoline and
-       skip_trampoline_code.  Set solib_svr4_fetch_link_map_offsets to
-       svr4_lp64_fetch_link_map_offsets.
-       * Makefile.in (sparc64nbsd-tdep.o, sparc64obsd-tdep.o): Update
-       dependencies.
-
-       * fbsd-nat.c: New files with cleaned up contents of fbsd-proc.c.
-       * fbsd-nat.h: New file.
-       * Makefile.in (ALLDEPFILES): Add fbsd-nat.c.
-       (fbsd_nat_h): New variable.
-       (fbsd-nat.o): New dependency.
-
-       * config/sparc/nbsd64.mt, config/sparc/obsd.mt,
-       config/sparc/obsd64.mt (DEPRECATED_TM_FILE): Set to solib.h.
-
-       * inf-child.c (inf_child_post_wait): Remove stray whitespace in
-       comment.
-
-2004-09-18  Paul N. Hilfinger  <hilfinger@gnat.com>
-       
-       * ada-exp.y (type_int): New function to add layer of abstraction
-       around references to expression types.
-       (type_long): Ditto.
-       (type_long_long): Ditto.
-       (type_float): Ditto.
-       (type_double): Ditto.
-       (type_long_double): Ditto.
-       (type_char): Ditto.
-       (type_system_address): Ditto.
-       (simple_exp): Use type_* functions in place of builtin_* 
-       variables.
-       (exp): Ditto.
-       (write_var_from_name): Ditto.
-       (write_object_renaming): Ditto.
-       * ada-lang.c (ada_create_fundamental_type): Remove redundant
-       declaration.
-       (build_ada_types): Remove, replacing with...
-       (ada_language_arch_info): New function to initialize primitive
-       type vector in language_arch_info.
-       (ada_array_length): Remove use of builtin_type_ada_int.
-       (value_pos_atr): Ditto.
-       (ada_evaluate_subexp): Ditto.
-       (builtin_type_ada_int, builtin_type_ada_short, builtin_type_ada_long,
-       builtin_type_ada_long_long, builtin_type_ada_char, 
-       builtin_type_ada_float, builtin_type_ada_double, 
-       builtin_type_ada_long_double, builtin_type_ada_natural,
-       builtin_type_ada_positive, builtin_type_ada_system_address): Remove.
-       (ada_builtin_types): Remove.
-       (ada_language_defn): Remove entries for la_builtin_type_vector and
-       string_char_type and use ada_language_arch_info.
-       (_initialize_ada_language): Do type-vector initialization along
-       the lines of c-lang.c.
-       (ada_create_fundamental_type): Break up line.
-       (ada_dump_symtab): Remove unused function.
-       (enum ada_primitive_types): Define.
-       * ada-lang.h (builtin_type_ada_int, builtin_type_ada_short, 
-       builtin_type_ada_long,builtin_type_ada_long_long,builtin_type_ada_char, 
-       builtin_type_ada_float, builtin_type_ada_double, 
-       builtin_type_ada_long_double, builtin_type_ada_natural,
-       builtin_type_ada_positive, builtin_type_ada_system_address): Remove.
-       * ada-lex.l: Use type_* functions in place of builtin_* variables.
-       (processInt): Ditto.
-       (processReal): Ditto.
-       (name_lookup): Ditto.
-       * ada-typeprint.c (print_range): Use builtin_type_int, not
-       builtin_type_ada_int.
-       
-2004-09-18  Mark Kettenis  <kettenis@gnu.org>
-
-       * i386-tdep.c (i386_register_name): Rename regno to regnum.
-
-       * config/pa/hpux1020.mh (MH_CFLAGS): Remove -D__HP_CURSES.
-       * config/pa/hpux11.mh (MH_CFLAGS): Likewise.
-       * config/pa/hpux11w.mh (MH_CFLAGS): Likewise.
-       * configure.in: Improve checks for curses library by checking for
-       mvwaddstr instead of initscr.  Drop HP curses in favour of
-       standard curses on HP-UX.
-       * configure: Regenerated.
-
-2004-09-18  Paul N. Hilfinger  <hilfinger@gnat.com>
-
-       * ada-lang.c: (ada_main_name, ada_value_slice_ptr, ada_value_slice,
-       ada_breakpoint_rewrite, ada_template_to_fixed_record_type_1): 
-       Minor formatting changes.
-       (empty_array): Slight rewrite for formatting.
-       (emit_char,parse,ada_language_defn,build_ada_types,
-       ada_is_exception_sym, _initialize_ada_language): Move 
-       definitions around.
-       (ada_dump_symtab): Remove unused definition.
-       (ada_maybe_exception_partial_symbol): Remove unused definition.
-
-2004-09-16  Andrew Cagney  <cagney@gnu.org>
-
-       * inf-child.c: Include "gdb_string.h".
-       (inf_child_core_file_to_sym_file): Delete.
-       (inf_child_target): Set to_fetch_registers and to_store_registers.
-       * inf-ptrace.c: Include "gdb_string.h".
-       * Makefile.in: Update all dependencies.
-
-       * Makefile.in (gnu-v3-abi.o): Add explict rule to avoid -Werror
-       problem.
-
-2004-09-14  Joel Brobecker  <brobecker@gnat.com>
-
-       * mips-tdep.c (mips_insn32_frame_cache): Pass frame cache in
-       call to heuristic_proc_desc. Remove code that became redundant
-       as a consequence.
-       (read_next_frame_reg): Remove special case for SP_REGNUM.
-       (set_reg_offset): Fix small typo.
-       (reset_saved_regs): New procedure.
-       (mips32_heuristic_proc_desc): No longer compute a fake
-       procedure descriptor. Compute the full frame cache instead.
-       Some minor comment reformatting.
-
 2004-09-14  Andrew Cagney  <cagney@gnu.org>
 
        * MAINTAINERS: Add Michael Chastain as the backup gdb.threads
index 30a305f532791c708225a2c5f0c0bf1c9f63f2b7..e24a577325380925e54b78e04b19742df62ad9f6 100644 (file)
@@ -150,7 +150,7 @@ maintainer works with the native maintainer when resolving API issues.
        x86-64          --target=x86_64-linux-gnu ,-Werror
                        Maintenance only
 
-       xstormy16       --target=xstormy16-elf
+       xstormy16       --target=xstormy16-elf broken
                        Corinna Vinschen        vinschen@redhat.com
 
        z8k             Deleted.
@@ -217,17 +217,22 @@ event loop                Elena Zannoni           ezannoni@redhat.com
                         For the part of top.c related to the event loop,
                         send questions to ezannoni@redhat.com
 
-generic symtabs                Elena Zannoni           ezannoni@redhat.com
-  dwarf readers                Elena Zannoni           ezannoni@redhat.com
-  elf reader           Elena Zannoni           ezannoni@redhat.com
-  stabs reader         Elena Zannoni           ezannoni@redhat.com
+generic symtabs                Jim Blandy              jimb@redhat.com
+                       Elena Zannoni           ezannoni@redhat.com
+  dwarf readers                Jim Blandy              jimb@redhat.com
+                       Elena Zannoni           ezannoni@redhat.com
+  elf reader           Jim Blandy              jimb@redhat.com
+                       Elena Zannoni           ezannoni@redhat.com
+  stabs reader         Jim Blandy              jimb@redhat.com
+                       Elena Zannoni           ezannoni@redhat.com
   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>
   HP/UX readers                Any [past] maintainer can modify this.
                        Please send tricky ones to the symtabs maintainers.
 
-tracing bytecode stuff  (Global 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
@@ -381,7 +386,7 @@ Hans-Peter Nilsson                          hp@bitrange.com
 David O'Brien                                  obrien@freebsd.org
 Alexandre Oliva                                        aoliva@redhat.com
 Tom Rix                                                trix@redhat.com
-Nick Roberts                                   nickrob@snap.net.nz
+Nick Roberts                                   nick@nick.uklinux.net
 Bob Rossi                                      bob_rossi@cox.net
 Theodore A. Roth                               troth@openavr.org
 Ian Roxborough                                 irox@redhat.com
index 354611341a2d065bd3814f7aa6910a0e6a64ace9..7ad1e9b774d6d50c52f5d914ce8feec246cc853b 100644 (file)
@@ -510,7 +510,7 @@ TARGET_FLAGS_TO_PASS = \
 # Links made at configuration time should not be specified here, since
 # SFILES is used in building the distribution archive.
 
-SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c  \
+SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
        ax-general.c ax-gdb.c \
        bcache.c \
        bfd-target.c \
@@ -625,7 +625,6 @@ nm_h =              @nm_h@
 #
 
 ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h) $(breakpoint_h)
-ada_lex_c = ada-lex.c $(gdb_string_h)
 alphabsd_tdep_h = alphabsd-tdep.h
 alpha_tdep_h = alpha-tdep.h
 amd64_nat_h = amd64-nat.h
@@ -656,7 +655,7 @@ cp_support_h = cp-support.h $(symtab_h)
 dcache_h = dcache.h
 defs_h = defs.h $(config_h) $(ansidecl_h) $(gdb_locale_h) $(gdb_signals_h) \
        $(libiberty_h) $(bfd_h) $(ui_file_h) $(xm_h) $(nm_h) $(tm_h) \
-       $(fopen_bin_h) $(gdbarch_h)
+       $(fopen_same_h) $(gdbarch_h)
 dictionary_h = dictionary.h
 disasm_h = disasm.h
 doublest_h = doublest.h $(floatformat_h)
@@ -669,7 +668,6 @@ event_loop_h = event-loop.h
 event_top_h = event-top.h
 exec_h = exec.h $(target_h)
 expression_h = expression.h $(symtab_h) $(doublest_h)
-fbsd_nat_h = fbsd-nat.h
 f_lang_h = f-lang.h
 frame_base_h = frame-base.h
 frame_h = frame.h
@@ -700,7 +698,6 @@ glibc_tdep_h = glibc-tdep.h
 gnu_nat_h = gnu-nat.h
 gregset_h = gregset.h
 hppa_tdep_h = hppa-tdep.h
-i386bsd_nat_h = i386bsd-nat.h
 i386_linux_tdep_h = i386-linux-tdep.h
 i386_tdep_h = i386-tdep.h
 i387_tdep_h = i387-tdep.h
@@ -720,7 +717,6 @@ libunwind_frame_h = libunwind-frame.h $(libunwind_h)
 linespec_h = linespec.h
 linux_nat_h = linux-nat.h $(target_h)
 m2_lang_h = m2-lang.h
-m32r_tdep_h = m32r-tdep.h
 m68k_tdep_h = m68k-tdep.h
 m88k_tdep_h = m88k-tdep.h
 macroexp_h = macroexp.h
@@ -848,7 +844,7 @@ HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
        symfile.h symfile-mem.h stabsread.h target.h terminal.h typeprint.h \
        xcoffsolib.h \
        macrotab.h macroexp.h macroscope.h \
-       ada-lang.h c-lang.h f-lang.h \
+       c-lang.h f-lang.h \
        jv-lang.h \
        m2-lang.h  p-lang.h \
        complaints.h valprint.h \
@@ -895,7 +891,6 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
        infcall.o \
        infcmd.o infrun.o \
        expprint.o environ.o stack.o thread.o \
-       inf-child.o \
        interps.o \
        main.o \
        macrotab.o macrocmd.o macroexp.o macroscope.o \
@@ -910,7 +905,7 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
        dbxread.o coffread.o coff-pe-read.o elfread.o \
        dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
        dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
-       ada-lang.o c-lang.o f-lang.o objc-lang.o \
+       c-lang.o f-lang.o objc-lang.o \
        ui-out.o cli-out.o \
        varobj.o wrapper.o \
        jv-lang.o jv-valprint.o jv-typeprint.o \
@@ -918,8 +913,8 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
        scm-exp.o scm-lang.o scm-valprint.o \
        sentinel-frame.o \
        complaints.o typeprint.o \
-       ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o \
-       ada-valprint.o c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
+       c-typeprint.o f-typeprint.o m2-typeprint.o \
+       c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
        nlmread.o serial.o mdebugread.o top.o utils.o \
        ui-file.o \
        user-regs.o \
@@ -943,7 +938,6 @@ YYFILES = c-exp.c \
        f-exp.c m2-exp.c p-exp.c
 YYOBJ = c-exp.o \
        objc-exp.o \
-       ada-exp.o \
        jv-exp.o \
        f-exp.o m2-exp.o p-exp.o
 
@@ -1364,9 +1358,7 @@ ALLDEPFILES = \
        bsd-kvm.c \
        coff-solib.c \
        core-regset.c core-aout.c corelow.c \
-       dcache.c exec.c \
-       fbsd-nat.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 \
@@ -1385,8 +1377,6 @@ ALLDEPFILES = \
        libunwind-frame.c \
        lynx-nat.c m3-nat.c \
        m68hc11-tdep.c \
-       m32r-tdep.c \
-       m32r-linux-nat.c m32r-linux-tdep.c \
        m68k-tdep.c \
        m68kbsd-nat.c m68kbsd-tdep.c \
        m88k-tdep.c m88kbsd-nat.c \
@@ -1442,14 +1432,6 @@ main.o: main.c
        $(CC) -c $(INTERNAL_CFLAGS) $(TARGET_SYSTEM_ROOT_DEFINE) \
                -DBINDIR=\"$(bindir)\" $(srcdir)/main.c
 
-# FIXME: cagney/2004-09-16: "gnu-v3-abi.c", with a GCC 3.4 compiler,
-# gets a "assignment from incompatible pointer type" warning.  The
-# return types - "enum gnu_v3_dtor_kinds" vs "enum ctor_kinds" -
-# conflict.
-gnu-v3-abi.o: $(srcdir)/gnu-v3-abi.c
-       $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
-               $(srcdir)/gnu-v3-abi.c
-
 # FIXME: cagney/2003-08-10: "monitor.c" gets -Wformat-nonliteral
 # errors.  It turns out that that is the least of monitor.c's
 # problems.  The function print_vsprintf appears to be using
@@ -1575,31 +1557,21 @@ po/$(PACKAGE).pot: force
             -e '/extern.*realloc/d' \
             -e '/extern.*free/d' \
             -e '/include.*malloc.h/d' \
-            -e 's/\([^x]\)malloc/\1xmalloc/g' \
-            -e 's/\([^x]\)realloc/\1xrealloc/g' \
+            -e 's/malloc/xmalloc/g' \
+            -e 's/realloc/xrealloc/g' \
             -e '/^#line.*y.tab.c/d' \
          < $@.tmp > $@.new
        -rm $@.tmp
        mv $@.new ./$*.c
 .l.c:
-       if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
-           $(FLEX) -o$@ $< && \
-           rm -f $@.new && \
-           sed -e '/extern.*malloc/d' \
-               -e '/extern.*realloc/d' \
-               -e '/extern.*free/d' \
-               -e '/include.*malloc.h/d' \
-               -e 's/\([^x]\)malloc/\1xmalloc/g' \
-               -e 's/\([^x]\)realloc/\1xrealloc/g' \
-               -e 's/yy_flex_xrealloc/yyxrealloc/g' \
-             < $@ > $@.new && \
-           rm -f $@ && \
-           mv $@.new $@; \
-       elif [ -f $@ ]; then \
-           echo "Warning: $*.c older than $*.l and flex not available."; \
-       else \
-           echo "$@ missing and flex not available."; \
+       @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
+           echo $(FLEX) -Isit $< ">" $@; \
+           $(FLEX) -Isit $< > $@; \
+       elif [ ! -f $@ -a ! -f $< ]; then \
+           echo "ada-lex.c missing and flex not available."; \
            false; \
+       elif [ ! -f $@ ]; then \
+           echo "Warning: $*.c older than $*.l and flex not available."; \
        fi
 
 .PRECIOUS: ada-exp.c ada-lex.c
@@ -1626,6 +1598,7 @@ ada-lang.o: ada-lang.c $(defs_h) $(gdb_string_h) $(demangle_h) \
        $(gdbcore_h) $(hashtab_h) $(gdb_obstack_h) $(ada_lang_h) \
        $(completer_h) $(gdb_stat_h) $(ui_out_h) $(block_h) $(infcall_h) \
        $(dictionary_h)
+ada-lex.o: ada-lex.c $(gdb_string_h)
 ada-typeprint.o: ada-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \
        $(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \
        $(target_h) $(command_h) $(gdbcmd_h) $(language_h) $(demangle_h) \
@@ -1661,11 +1634,9 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \
        $(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \
        $(infcall_h) $(elf_bfd_h) $(alpha_tdep_h)
 amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-       $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) \
-       $(inf_ptrace_h)
+       $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h)
 amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-       $(target_h) $(gdb_assert_h) $(fbsd_nat_h) $(amd64_tdep_h) \
-       $(amd64_nat_h) $(bsd_kvm_h)
+       $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) $(bsd_kvm_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)
@@ -1678,14 +1649,13 @@ amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_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) $(target_h) $(gdb_assert_h) \
-       $(amd64_tdep_h) $(amd64_nat_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) $(symtab_h) $(gdb_assert_h) $(amd64_tdep_h) \
        $(nbsd_tdep_h) $(solib_svr4_h)
 amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
-       $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) \
-       $(bsd_kvm_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) \
        $(symtab_h) $(objfiles_h) $(osabi_h) $(regset_h) $(target_h) \
        $(gdb_assert_h) $(gdb_string_h) $(amd64_tdep_h) $(i387_tdep_h) \
@@ -1866,8 +1836,7 @@ dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \
        $(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) $(hashtab_h) $(command_h) $(gdbcmd_h) \
-       $(gdb_string_h) $(gdb_assert_h)
+       $(cp_support_h) $(hashtab_h) $(gdb_string_h) $(gdb_assert_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)
@@ -1891,9 +1860,8 @@ exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
 expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
        $(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
        $(gdb_string_h) $(block_h)
-fbsd-nat.o: fbsd-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) \
-       $(regset_h) $(gdb_assert_h) $(gdb_string_h) $(elf_bfd_h) \
-       $(fbsd_nat_h)
+fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_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)
@@ -1992,20 +1960,18 @@ hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_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) $(i386_tdep_h) $(i387_tdep_h) $(i386bsd_nat_h) \
-       $(inf_ptrace_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) \
-       $(target_h) $(fbsd_nat_h) $(i386_tdep_h) $(i386bsd_nat_h) \
-       $(bsd_kvm_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) $(gdb_string_h) $(i386_tdep_h) \
-       $(gnu_nat_h) $(i387_tdep_h) $(gregset_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-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
        $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
@@ -2019,7 +1985,7 @@ 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-nat.o: i386nbsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
-       $(target_h) $(i386_tdep_h) $(i386bsd_nat_h) $(bsd_kvm_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) \
@@ -2069,7 +2035,7 @@ infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
        $(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \
        $(dummy_frame_h)
 inf-child.o: inf-child.c $(defs_h) $(regcache_h) $(memattr_h) $(symtab_h) \
-       $(target_h) $(inferior_h) $(gdb_string_h)
+       $(target_h) $(inferior_h)
 infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
        $(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \
        $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
@@ -2083,7 +2049,7 @@ inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
        $(inflow_h)
 inf-ptrace.o: inf-ptrace.c $(defs_h) $(observer_h) $(gdb_ptrace_h) \
        $(inflow_h) $(inferior_h) $(regcache_h) $(command_h) $(gdbcore_h) \
-       $(inf_child_h) $(gdbcmd_h) $(gdb_string_h) $(gdb_wait_h)
+       $(inf_child_h) $(gdbcmd_h)
 infptrace.o: infptrace.c $(defs_h) $(command_h) $(frame_h) $(gdbcore_h) \
        $(inferior_h) $(regcache_h) $(target_h) $(gdb_assert_h) \
        $(gdb_wait_h) $(gdb_string_h) $(gdb_dirent_h) $(gdb_ptrace_h)
@@ -2130,10 +2096,14 @@ linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \
        $(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \
        $(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \
        $(objc_lang_h) $(linespec_h)
-linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_string_h) \
-       $(gdb_wait_h) $(gdb_assert_h) $(linux_nat_h) $(gdbthread_h) \
-       $(gdbcmd_h) $(regcache_h) $(elf_bfd_h) $(gregset_h) $(gdbcore_h) \
-       $(gdbthread_h) $(gdb_stat_h)
+lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \
+       $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) \
+       $(linux_nat_h)
+linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_wait_h) \
+       $(linux_nat_h)
+linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(gdb_stat_h) \
+       $(regcache_h) $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \
+       $(cli_decode_h) $(gdb_string_h) $(linux_nat_h)
 lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
        $(gdbcore_h) $(regcache_h)
 m2-exp.o: m2-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \
@@ -2146,13 +2116,6 @@ m2-typeprint.o: m2-typeprint.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \
        $(expression_h) $(value_h) $(gdbcore_h) $(target_h) $(m2_lang_h)
 m2-valprint.o: m2-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \
        $(m2_lang_h)
-m32r-linux-nat.o: m32r-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
-       $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
-       $(gregset_h) $(m32r_tdep_h)
-m32r-linux-tdep.o: m32r-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
-       $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
-       $(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) $(trad_frame_h) \
-       $(frame_unwind_h) $(m32r_tdep_h)
 m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
        $(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \
        $(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h)
@@ -2161,7 +2124,7 @@ m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
        $(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \
        $(gdb_string_h) $(value_h) $(inferior_h) $(symfile_h) $(objfiles_h) \
        $(language_h) $(arch_utils_h) $(regcache_h) $(trad_frame_h) \
-       $(dis_asm_h) $(gdb_assert_h) $(m32r_tdep_h)
+       $(dis_asm_h) $(gdb_assert_h)
 m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
        $(frame_base_h) $(dwarf2_frame_h) $(trad_frame_h) $(symtab_h) \
        $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \
@@ -2188,7 +2151,7 @@ m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwarf2_frame_h) $(frame_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) \
-       $(target_h) $(m88k_tdep_h) $(inf_ptrace_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) \
@@ -2531,18 +2494,18 @@ sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(frame_h) \
 sparc64-linux-nat.o: sparc64-linux-nat.c $(defs_h) $(sparc64_tdep_h) \
        $(sparc_nat_h)
 sparc64-linux-tdep.o: sparc64-linux-tdep.c $(defs_h) $(gdbarch_h) $(osabi_h) \
-       $(sparc64_tdep_h)
+       $(solib_svr4_h) $(sparc64_tdep_h)
 sparc64-nat.o: sparc64-nat.c $(defs_h) $(gdbarch_h) $(sparc64_tdep_h) \
        $(sparc_nat_h)
-sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(regcache_h) $(target_h) \
+sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(regcache_h) \
        $(sparc64_tdep_h) $(sparc_nat_h) $(bsd_kvm_h)
 sparc64nbsd-tdep.o: sparc64nbsd-tdep.c $(defs_h) $(frame_h) \
        $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \
-       $(symtab_h) $(objfiles_h) $(solib_svr4_h) $(trad_frame_h) \
-       $(gdb_assert_h) $(gdb_string_h) $(sparc64_tdep_h) $(nbsd_tdep_h)
+       $(symtab_h) $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) \
+       $(gdb_string_h) $(sparc64_tdep_h) $(nbsd_tdep_h)
 sparc64obsd-tdep.o: sparc64obsd-tdep.c $(defs_h) $(frame_h) \
-       $(frame_unwind_h) $(osabi_h) $(regset_h) $(symtab_h) $(objfiles_h) \
-       $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h)
+       $(frame_unwind_h) $(osabi_h) $(regset_h) $(symtab_h) $(solib_svr4_h) \
+       $(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) $(solib_svr4_h)
@@ -2557,8 +2520,8 @@ sparc-linux-tdep.o: sparc-linux-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
        $(gdb_string_h) $(sparc_tdep_h)
 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) $(inf_ptrace_h)
-sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(regcache_h) $(target_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) \
@@ -2609,9 +2572,8 @@ symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
        $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \
        $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \
        $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) $(source_h) \
-       $(filenames_h) $(objc_lang_h) $(ada_lang_h) $(hashtab_h) \
-       $(gdb_obstack_h) $(block_h) $(dictionary_h) $(gdb_string_h) \
-       $(gdb_stat_h) $(cp_abi_h)
+       $(filenames_h) $(objc_lang_h) $(hashtab_h) $(gdb_obstack_h) \
+       $(block_h) $(dictionary_h) $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h)
 target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \
        $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
        $(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) $(gdbcore_h)
@@ -2677,8 +2639,8 @@ values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
        $(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)
-vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \
-       $(vax_tdep_h) $(inf_ptrace_h) $(bsd_kvm_h)
+vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+       $(vax_tdep_h) $(bsd_kvm_h)
 vax-nat.o: vax-nat.c $(defs_h) $(inferior_h) $(gdb_assert_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)
@@ -2703,11 +2665,9 @@ xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \
        $(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)
-xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \
-       $(frame_unwind_h) $(dwarf2_frame_h) $(symtab_h) $(gdbtypes_h) \
-       $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) $(inferior_h) \
-       $(gdb_string_h) $(gdb_assert_h) $(arch_utils_h) $(floatformat_h) \
-       $(regcache_h) $(doublest_h) $(osabi_h) $(objfiles_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)
 
 #
 # gdb/cli/ dependencies
index bb9e41c7c888f79213de7d5dfac25564bdf5a7c6..9e91817febd6f5d44a369fa2bfe68e4f28f907b3 100644 (file)
@@ -126,22 +126,6 @@ static void write_object_renaming (struct block *, struct symbol *, int);
 static void write_var_from_name (struct block *, struct name_info);
 
 static LONGEST convert_char_literal (struct type *, LONGEST);
-
-static struct type *type_int (void);
-
-static struct type *type_long (void);
-
-static struct type *type_long_long (void);
-
-static struct type *type_float (void);
-
-static struct type *type_double (void);
-
-static struct type *type_long_double (void);
-
-static struct type *type_char (void);
-
-static struct type *type_system_address (void);
 %}
 
 %union
@@ -442,17 +426,17 @@ simple_exp :      simple_exp TICK_ACCESS
        |       simple_exp TICK_ADDRESS
                        { write_exp_elt_opcode (UNOP_ADDR);
                          write_exp_elt_opcode (UNOP_CAST);
-                         write_exp_elt_type (type_system_address ());
+                         write_exp_elt_type (builtin_type_ada_system_address);
                          write_exp_elt_opcode (UNOP_CAST);
                        }
        |       simple_exp TICK_FIRST tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_FIRST); }
        |       simple_exp TICK_LAST tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_LAST); }
        |       simple_exp TICK_LENGTH tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_LENGTH); }
         |       simple_exp TICK_SIZE
                        { write_exp_elt_opcode (OP_ATR_SIZE); }
@@ -465,13 +449,13 @@ simple_exp :      simple_exp TICK_ACCESS
        |       opt_type_prefix TICK_POS '(' exp ')'
                        { write_exp_elt_opcode (OP_ATR_POS); }
        |       type_prefix TICK_FIRST tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_FIRST); }
        |       type_prefix TICK_LAST tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_LAST); }
        |       type_prefix TICK_LENGTH tick_arglist
-                       { write_int ($3, type_int ());
+                       { write_int ($3, builtin_type_int);
                          write_exp_elt_opcode (OP_ATR_LENGTH); }
        |       type_prefix TICK_VAL '(' exp ')'
                        { write_exp_elt_opcode (OP_ATR_VAL); }
@@ -521,7 +505,7 @@ exp :       FLOAT
        ;
 
 exp    :       NULL_PTR
-                       { write_int (0, type_int ()); }
+                       { write_int (0, builtin_type_int); }
        ;
 
 exp    :       STRING
@@ -682,8 +666,8 @@ write_var_from_name (struct block *orig_left_context,
   if (name.msym != NULL)
     {
       write_exp_msymbol (name.msym,
-                        lookup_function_type (type_int ()),
-                        type_int ());
+                        lookup_function_type (builtin_type_int),
+                        builtin_type_int);
     }
   else if (name.sym == NULL)
     {
@@ -795,7 +779,7 @@ write_object_renaming (struct block *orig_left_context,
              goto BadEncoding;
            suffix = next;
            write_exp_elt_opcode (OP_LONG);
-           write_exp_elt_type (type_int ());
+           write_exp_elt_type (builtin_type_ada_int);
            write_exp_elt_longcst ((LONGEST) val);
            write_exp_elt_opcode (OP_LONG);
          }
@@ -852,7 +836,7 @@ write_object_renaming (struct block *orig_left_context,
          if (end == NULL)
            end = suffix + strlen (suffix);
          field_name.length = end - suffix;
-         field_name.ptr = xmalloc (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;
@@ -895,70 +879,8 @@ convert_char_literal (struct type *type, LONGEST val)
   return val;
 }
 
-static struct type *
-type_int (void)
-{
-  return builtin_type (current_gdbarch)->builtin_int;
-}
-
-static struct type *
-type_long (void)
-{
-  return builtin_type (current_gdbarch)->builtin_long;
-}
-
-static struct type *
-type_long_long (void)
-{
-  return builtin_type (current_gdbarch)->builtin_long_long;
-}
-
-static struct type *
-type_float (void)
-{
-  return builtin_type (current_gdbarch)->builtin_float;
-}
-
-static struct type *
-type_double (void)
-{
-  return builtin_type (current_gdbarch)->builtin_double;
-}
-
-static struct type *
-type_long_double (void)
-{
-  return builtin_type (current_gdbarch)->builtin_long_double;
-}
-
-static struct type *
-type_char (void)
-{
-  return language_string_char_type (current_language, current_gdbarch);
-}
-
-static struct type *
-type_system_address (void)
-{
-  struct type *type 
-    = language_lookup_primitive_type_by_name (current_language,
-                                             current_gdbarch, 
-                                             "system__address");
-  return  type != NULL ? type : lookup_pointer_type (builtin_type_void);
-}
-
 void
 _initialize_ada_exp (void)
 {
   obstack_init (&temp_parse_space);
 }
-
-/* FIXME: hilfingr/2004-10-05: Hack to remove warning.  The function
-   string_to_operator is supposed to be used for cases where one
-   calls an operator function with prefix notation, as in 
-   "+" (a, b), but at some point, this code seems to have gone
-   missing. */
-
-struct stoken (*dummy_string_to_ada_operator) (struct stoken) 
-     = string_to_operator;
-
index 275e3a0a96e8a4d017b18acb2438b87dc867390d..51c5fb7ed1e5ef6a0a3b4a2ebe3252a6fedb4dda 100644 (file)
@@ -19,6 +19,18 @@ 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"
@@ -63,8 +75,27 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #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);
 
@@ -153,11 +184,16 @@ 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 *);
+
 static struct value *evaluate_subexp (struct type *, struct expression *,
                                       int *, enum noside);
 
 static struct value *evaluate_subexp_type (struct expression *, int *);
 
+static struct type *ada_create_fundamental_type (struct objfile *, int);
+
 static int is_dynamic_field (struct type *, int);
 
 static struct type *to_fixed_variant_branch_type (struct type *, char *,
@@ -194,6 +230,19 @@ static int is_name_suffix (const char *);
 
 static int wild_match (const char *, int, const char *);
 
+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 ada_symbol_info *, int, int *);
+
+static int find_next_line_in_linetable (struct linetable *, int, int, int);
+
+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 *);
@@ -219,6 +268,8 @@ static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
 
 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 *);
@@ -227,10 +278,9 @@ static struct value *ada_coerce_to_simple_array (struct value *);
 
 static int ada_is_direct_array_type (struct type *);
 
-static void ada_language_arch_info (struct gdbarch *,
-                                   struct language_arch_info *);
+static void error_breakpoint_runtime_sym_not_found (const char *err_desc);
 
-static void check_size (const struct type *);
+static int is_runtime_sym_defined (const char *name, int allow_tramp);
 \f
 
 
@@ -293,6 +343,69 @@ 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)
@@ -319,6 +432,20 @@ extract_string (CORE_ADDR addr, char *buf)
   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.  */
@@ -430,7 +557,7 @@ value_from_contents_and_address (struct type *type, char *valaddr,
 static struct value *
 coerce_unspec_val_to_type (struct value *val, struct type *type)
 {
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   if (VALUE_TYPE (val) == type)
     return val;
   else
@@ -439,7 +566,8 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
 
       /* Make sure that the object size is not unreasonable before
          trying to allocate some memory for it.  */
-      check_size (type);
+      if (TYPE_LENGTH (type) > varsize_limit)
+        error ("object size is larger than varsize-limit");
 
       result = allocate_value (type);
       VALUE_LVAL (result) = VALUE_LVAL (val);
@@ -478,36 +606,23 @@ cond_offset_target (CORE_ADDR address, long offset)
    with exactly one argument rather than ...), unless the limit on the
    number of warnings has passed during the evaluation of the current
    expression.  */
-
-/* FIXME: cagney/2004-10-10: This function is mimicking the behavior
-   provided by "complaint".  */
-static void lim_warning (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
-
 static void
-lim_warning (const char *format, ...)
+lim_warning (const char *format, long arg)
 {
-  va_list args;
-  va_start (args, format);
-
   warnings_issued += 1;
   if (warnings_issued <= warning_limit)
-    vwarning (format, args);
-
-  va_end (args);
+    warning (format, arg);
 }
 
-/* Issue an error if the size of an object of type T is unreasonable,
-   i.e. if it would be a bad idea to allocate a value of this type in
-   GDB.  */
-
-static void
-check_size (const struct type *type)
+static const char *
+ada_translate_error_message (const char *string)
 {
-  if (TYPE_LENGTH (type) > varsize_limit)
-    error ("object size is larger than varsize-limit");
+  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. */
@@ -638,7 +753,6 @@ 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
@@ -1100,11 +1214,11 @@ desc_base_type (struct type *type)
 {
   if (type == NULL)
     return NULL;
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   if (type != NULL
       && (TYPE_CODE (type) == TYPE_CODE_PTR
           || TYPE_CODE (type) == TYPE_CODE_REF))
-    return ada_check_typedef (TYPE_TARGET_TYPE (type));
+    return check_typedef (TYPE_TARGET_TYPE (type));
   else
     return type;
 }
@@ -1182,13 +1296,13 @@ desc_bounds_type (struct type *type)
         return NULL;
       r = lookup_struct_elt_type (type, "BOUNDS", 1);
       if (r != NULL)
-        return ada_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 ada_check_typedef (TYPE_TARGET_TYPE (ada_check_typedef (r)));
+        return check_typedef (TYPE_TARGET_TYPE (check_typedef (r)));
     }
   return NULL;
 }
@@ -1199,7 +1313,7 @@ desc_bounds_type (struct type *type)
 static struct value *
 desc_bounds (struct value *arr)
 {
-  struct type *type = ada_check_typedef (VALUE_TYPE (arr));
+  struct type *type = check_typedef (VALUE_TYPE (arr));
   if (is_thin_pntr (type))
     {
       struct type *bounds_type =
@@ -1249,7 +1363,7 @@ fat_pntr_bounds_bitsize (struct type *type)
   if (TYPE_FIELD_BITSIZE (type, 1) > 0)
     return TYPE_FIELD_BITSIZE (type, 1);
   else
-    return 8 * TYPE_LENGTH (ada_check_typedef (TYPE_FIELD_TYPE (type, 1)));
+    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
@@ -1384,7 +1498,7 @@ ada_is_direct_array_type (struct type *type)
 {
   if (type == NULL)
     return 0;
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   return (TYPE_CODE (type) == TYPE_CODE_ARRAY
           || ada_is_array_descriptor_type (type));
 }
@@ -1396,7 +1510,7 @@ ada_is_simple_array_type (struct type *type)
 {
   if (type == NULL)
     return 0;
-  type = ada_check_typedef (type);
+  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));
@@ -1411,7 +1525,7 @@ ada_is_array_descriptor_type (struct type *type)
 
   if (type == NULL)
     return 0;
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   return
     data_type != NULL
     && ((TYPE_CODE (data_type) == TYPE_CODE_PTR
@@ -1456,7 +1570,7 @@ ada_type_of_array (struct value *arr, int bounds)
 
   if (!bounds)
     return
-      ada_check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr))));
+      check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr))));
   else
     {
       struct type *elt_type;
@@ -1468,7 +1582,7 @@ ada_type_of_array (struct value *arr, int bounds)
       arity = ada_array_arity (VALUE_TYPE (arr));
 
       if (elt_type == NULL || arity == 0)
-        return ada_check_typedef (VALUE_TYPE (arr));
+        return check_typedef (VALUE_TYPE (arr));
 
       descriptor = desc_bounds (arr);
       if (value_as_long (descriptor) == 0)
@@ -1556,7 +1670,7 @@ ada_is_packed_array_type (struct type *type)
   if (type == NULL)
     return 0;
   type = desc_base_type (type);
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   return
     ada_type_name (type) != NULL
     && strstr (ada_type_name (type), "___XP") != NULL;
@@ -1578,12 +1692,12 @@ packed_array_type (struct type *type, long *elt_bits)
   struct type *new_type;
   LONGEST low_bound, high_bound;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
     return type;
 
   new_type = alloc_type (TYPE_OBJFILE (type));
-  new_elt_type = packed_array_type (ada_check_typedef (TYPE_TARGET_TYPE (type)),
+  new_elt_type = packed_array_type (check_typedef (TYPE_TARGET_TYPE (type)),
                                     elt_bits);
   create_array_type (new_type, new_elt_type, TYPE_FIELD_TYPE (type, 0));
   TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
@@ -1612,7 +1726,7 @@ decode_packed_array_type (struct type *type)
 {
   struct symbol *sym;
   struct block **blocks;
-  const char *raw_name = ada_type_name (ada_check_typedef (type));
+  const char *raw_name = ada_type_name (check_typedef (type));
   char *name = (char *) alloca (strlen (raw_name) + 1);
   char *tail = strstr (raw_name, "___XP");
   struct type *shadow_type;
@@ -1627,21 +1741,22 @@ decode_packed_array_type (struct type *type)
   sym = standard_lookup (name, get_selected_block (0), VAR_DOMAIN);
   if (sym == NULL || SYMBOL_TYPE (sym) == NULL)
     {
-      lim_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 (sym);
 
   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
     {
-      lim_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)
     {
       lim_warning
-       ("could not understand bit size information on packed array");
+        ("could not understand bit size information on packed array", 0);
       return NULL;
     }
 
@@ -1669,31 +1784,6 @@ decode_packed_array (struct value *arr)
       error ("can't unpack array");
       return NULL;
     }
-
-  if (BITS_BIG_ENDIAN && ada_is_modular_type (VALUE_TYPE (arr)))
-    {
-       /* This is a (right-justified) modular type representing a packed
-        array with no wrapper.  In order to interpret the value through
-        the (left-justified) packed array type we just built, we must
-        first left-justify it.  */
-      int bit_size, bit_pos;
-      ULONGEST mod;
-
-      mod = ada_modulus (VALUE_TYPE (arr)) - 1;
-      bit_size = 0;
-      while (mod > 0)
-       {
-         bit_size += 1;
-         mod >>= 1;
-       }
-      bit_pos = HOST_CHAR_BIT * TYPE_LENGTH (VALUE_TYPE (arr)) - bit_size;
-      arr = ada_value_primitive_packed_val (arr, NULL,
-                                           bit_pos / HOST_CHAR_BIT,
-                                           bit_pos % HOST_CHAR_BIT,
-                                           bit_size,
-                                           type);
-    }
-
   return coerce_unspec_val_to_type (arr, type);
 }
 
@@ -1712,7 +1802,7 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
 
   bits = 0;
   elt_total_bit_offset = 0;
-  elt_type = ada_check_typedef (VALUE_TYPE (arr));
+  elt_type = check_typedef (VALUE_TYPE (arr));
   for (i = 0; i < arity; i += 1)
     {
       if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY
@@ -1727,7 +1817,7 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
 
           if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
             {
-              lim_warning ("don't know bounds of array");
+              lim_warning ("don't know bounds of array", 0);
               lowerbound = upperbound = 0;
             }
 
@@ -1736,7 +1826,7 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
             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 = ada_check_typedef (TYPE_TARGET_TYPE (elt_type));
+          elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
         }
     }
   elt_off = elt_total_bit_offset / HOST_CHAR_BIT;
@@ -1799,7 +1889,7 @@ ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset,
      the indices move.  */
   int delta = BITS_BIG_ENDIAN ? -1 : 1;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   if (obj == NULL)
     {
@@ -2057,7 +2147,7 @@ ada_value_subscript (struct value *arr, int arity, struct value **ind)
 
   elt = ada_coerce_to_simple_array (arr);
 
-  elt_type = ada_check_typedef (VALUE_TYPE (elt));
+  elt_type = check_typedef (VALUE_TYPE (elt));
   if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY
       && TYPE_FIELD_BITSIZE (elt_type, 0) > 0)
     return value_subscript_packed (elt, arity, ind);
@@ -2106,16 +2196,16 @@ ada_value_ptr_subscript (struct value *arr, struct type *type, int arity,
    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,
+ada_value_slice_ptr (struct value *array_ptr, struct type *type, 
                      int low, int high)
 {
-  CORE_ADDR base = value_as_address (array_ptr)
+  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)),
+  struct type *index_type = 
+    create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type)), 
                        low, high);
-  struct type *slice_type =
+  struct type *slice_type = 
     create_array_type (NULL, TYPE_TARGET_TYPE (type), index_type);
   return value_from_pointer (lookup_reference_type (slice_type), base);
 }
@@ -2125,11 +2215,11 @@ static struct value *
 ada_value_slice (struct value *array, int low, int high)
 {
   struct type *type = VALUE_TYPE (array);
-  struct type *index_type =
+  struct type *index_type = 
     create_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
-  struct type *slice_type =
+  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));
+  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
@@ -2154,7 +2244,7 @@ ada_array_arity (struct type *type)
     while (TYPE_CODE (type) == TYPE_CODE_ARRAY)
       {
         arity += 1;
-        type = ada_check_typedef (TYPE_TARGET_TYPE (type));
+        type = check_typedef (TYPE_TARGET_TYPE (type));
       }
 
   return arity;
@@ -2187,7 +2277,7 @@ ada_array_element_type (struct type *type, int nindices)
       p_array_type = TYPE_TARGET_TYPE (p_array_type);
       while (k > 0 && p_array_type != NULL)
         {
-          p_array_type = ada_check_typedef (TYPE_TARGET_TYPE (p_array_type));
+          p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type));
           k -= 1;
         }
       return p_array_type;
@@ -2334,7 +2424,7 @@ ada_array_bound (struct value *arr, int n, int which)
 struct value *
 ada_array_length (struct value *arr, int n)
 {
-  struct type *arr_type = ada_check_typedef (VALUE_TYPE (arr));
+  struct type *arr_type = check_typedef (VALUE_TYPE (arr));
 
   if (ada_is_packed_array_type (arr_type))
     return ada_array_length (decode_packed_array (arr), n);
@@ -2349,7 +2439,7 @@ ada_array_length (struct value *arr, int n)
     }
   else
     return
-      value_from_longest (builtin_type_int,
+      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),
@@ -2362,7 +2452,7 @@ ada_array_length (struct value *arr, int n)
 static struct value *
 empty_array (struct type *arr_type, int low)
 {
-  struct type *index_type =
+  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);
@@ -2782,8 +2872,8 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
 static int
 ada_type_match (struct type *ftype, struct type *atype, int may_deref)
 {
-  ftype = ada_check_typedef (ftype);
-  atype = ada_check_typedef (atype);
+  CHECK_TYPEDEF (ftype);
+  CHECK_TYPEDEF (atype);
 
   if (TYPE_CODE (ftype) == TYPE_CODE_REF)
     ftype = TYPE_TARGET_TYPE (ftype);
@@ -2862,8 +2952,8 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
         return 0;
       else
         {
-          struct type *ftype = ada_check_typedef (TYPE_FIELD_TYPE (func_type, i));
-          struct type *atype = ada_check_typedef (VALUE_TYPE (actuals[i]));
+          struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i));
+          struct type *atype = check_typedef (VALUE_TYPE (actuals[i]));
 
           if (!ada_type_match (ftype, atype, 1))
             return 0;
@@ -2936,7 +3026,7 @@ ada_resolve_function (struct ada_symbol_info syms[],
     {
       for (k = 0; k < nsyms; k += 1)
         {
-          struct type *type = ada_check_typedef (SYMBOL_TYPE (syms[k].sym));
+          struct type *type = check_typedef (SYMBOL_TYPE (syms[k].sym));
 
           if (ada_args_match (syms[k].sym, args, nargs)
               && return_match (type, return_type))
@@ -3335,9 +3425,9 @@ static int
 possible_user_operator_p (enum exp_opcode op, struct value *args[])
 {
   struct type *type0 =
-    (args[0] == NULL) ? NULL : ada_check_typedef (VALUE_TYPE (args[0]));
+    (args[0] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[0]));
   struct type *type1 =
-    (args[1] == NULL) ? NULL : ada_check_typedef (VALUE_TYPE (args[1]));
+    (args[1] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[1]));
 
   if (type0 == NULL)
     return 0;
@@ -3468,7 +3558,7 @@ ensure_lval (struct value *val, CORE_ADDR *sp)
 {
   if (! VALUE_LVAL (val))
     {
-      int len = TYPE_LENGTH (ada_check_typedef (VALUE_TYPE (val)));
+      int len = TYPE_LENGTH (check_typedef (VALUE_TYPE (val)));
 
       /* The following is taken from the structure-return code in
         call_function_by_hand. FIXME: Therefore, some refactoring seems 
@@ -3509,14 +3599,14 @@ static struct value *
 convert_actual (struct value *actual, struct type *formal_type0,
                 CORE_ADDR *sp)
 {
-  struct type *actual_type = ada_check_typedef (VALUE_TYPE (actual));
-  struct type *formal_type = ada_check_typedef (formal_type0);
+  struct type *actual_type = check_typedef (VALUE_TYPE (actual));
+  struct type *formal_type = check_typedef (formal_type0);
   struct type *formal_target =
     TYPE_CODE (formal_type) == TYPE_CODE_PTR
-    ? ada_check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type;
+    ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type;
   struct type *actual_target =
     TYPE_CODE (actual_type) == TYPE_CODE_PTR
-    ? ada_check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type;
+    ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type;
 
   if (ada_is_array_descriptor_type (formal_target)
       && TYPE_CODE (actual_target) == TYPE_CODE_ARRAY)
@@ -3531,7 +3621,7 @@ convert_actual (struct value *actual, struct type *formal_type0,
           if (VALUE_LVAL (actual) != lval_memory)
             {
               struct value *val;
-              actual_type = ada_check_typedef (VALUE_TYPE (actual));
+              actual_type = check_typedef (VALUE_TYPE (actual));
               val = allocate_value (actual_type);
               memcpy ((char *) VALUE_CONTENTS_RAW (val),
                       (char *) VALUE_CONTENTS (actual),
@@ -3563,7 +3653,7 @@ make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
   struct value *bounds = allocate_value (bounds_type);
   int i;
 
-  for (i = ada_array_arity (ada_check_typedef (VALUE_TYPE (arr))); i > 0; i -= 1)
+  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)),
@@ -3619,9 +3709,107 @@ ada_convert_actuals (struct value *func, int nargs, struct value *args[],
       convert_actual (args[i], TYPE_FIELD_TYPE (VALUE_TYPE (func), i), sp);
 }
 \f
-/* Dummy definitions for an experimental caching module that is not
- * used in the public sources. */
+                                /* Experimental Symbol Cache Module */
+
+/* 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
+
+/* 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.  */
+
+#define HASH_SIZE 1009
+
+struct cache_entry
+{
+  const char *name;
+  domain_enum namespace;
+  struct symbol *sym;
+  struct symtab *symtab;
+  struct block *block;
+  struct cache_entry *next;
+};
+
+static struct obstack cache_space;
+
+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,
@@ -3635,6 +3823,7 @@ cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
               struct block *block, struct symtab *symtab)
 {
 }
+#endif /* GNAT_GDB */
 \f
                                 /* Symbol Lookup */
 
@@ -3744,7 +3933,7 @@ add_defn_to_vec (struct obstack *obstackp,
   struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
 
   if (SYMBOL_TYPE (sym) != NULL)
-    SYMBOL_TYPE (sym) = ada_check_typedef (SYMBOL_TYPE (sym));
+    CHECK_TYPEDEF (SYMBOL_TYPE (sym));
   for (i = num_defns_collected (obstackp) - 1; i >= 0; i -= 1)
     {
       if (lesseq_defined_than (sym, prevDefns[i].sym))
@@ -4016,6 +4205,16 @@ ada_lookup_simple_minsym (const char *name)
   return NULL;
 }
 
+/* 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)
+{
+  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
@@ -4027,6 +4226,72 @@ 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;
+
+  if (!target_has_stack)
+    return;
+
+  if (static_link == NULL)
+    {
+      /* Initialize the local variable symbol that stands for the
+         static link (when there is one).  */
+      static_link = &static_link_sym;
+      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));
+    }
+
+  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)
+    {
+      CORE_ADDR target_link = value_as_address (target_link_val);
+
+      frame = get_prev_frame (frame);
+      if (frame == NULL)
+        break;
+
+      if (get_frame_locals_address (frame) == target_link)
+        {
+          struct block *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 */
@@ -4485,10 +4750,11 @@ done:
 /* 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,
-   choosing the first symbol if there are multiple choices.  
-   *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).  */
+   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, const struct block *block0,
@@ -4503,6 +4769,8 @@ ada_lookup_symbol (const char *name, const struct block *block0,
 
   if (n_candidates == 0)
     return NULL;
+  else if (n_candidates != 1)
+    user_select_syms (candidates, n_candidates, 1);
 
   if (is_a_field_of_this != NULL)
     *is_a_field_of_this = 0;
@@ -4557,7 +4825,7 @@ ada_lookup_symbol_nonlocal (const char *name,
    (__[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]+)|___(JM|LJM|X([FDBUP].*|R[^T]?)))?$
+   (X[nb]*)?((\$|__)[0-9](_?[0-9]+)|___(LJM|X([FDBUP].*|R[^T]?)))?$
  */
 
 static int
@@ -4620,13 +4888,6 @@ is_name_suffix (const char *str)
         return 0;
       if (str[2] == '_')
         {
-          if (strcmp (str + 3, "JM") == 0)
-            return 1;
-          /* FIXME: brobecker/2004-09-30: GNAT will soon stop using
-             the LJM suffix in favor of the JM one.  But we will
-             still accept LJM as a valid suffix for a reasonable
-             amount of time, just to allow ourselves to debug programs
-             compiled using an older version of GNAT.  */
           if (strcmp (str + 3, "LJM") == 0)
             return 1;
           if (str[3] != 'X')
@@ -4913,6 +5174,7 @@ ada_add_block_symbols (struct obstack *obstackp,
                   }
               }
           }
+      end_loop2:;
       }
 
       /* NOTE: This really shouldn't be needed for _ada_ symbols.
@@ -4926,104 +5188,1491 @@ ada_add_block_symbols (struct obstack *obstackp,
     }
 }
 \f
-                                /* Field Access */
+#ifdef GNAT_GDB
 
-/* True if field number FIELD_NUM in struct or union type TYPE is supposed
-   to be invisible to users.  */
+                                /* Symbol Completion */
 
-int
-ada_is_ignored_field (struct type *type, int field_num)
+/* 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)
 {
-  if (field_num < 0 || field_num > TYPE_NFIELDS (type))
-    return 1;
-  else
+  char *result;
+  const int verbatim_match = (text[0] == '<');
+  int match = 0;
+
+  if (verbatim_match)
     {
-      const char *name = TYPE_FIELD_NAME (type, field_num);
-      return (name == NULL
-              || (name[0] == '_' && strncmp (name, "_parent", 7) != 0));
+      /* Strip the leading angle bracket.  */
+      text = text + 1;
+      text_len--;
     }
-}
 
-/* 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. */
+  /* First, test against the fully qualified name of the symbol.  */
 
-int
-ada_is_tagged_type (struct type *type, int refok)
-{
-  return (ada_lookup_struct_elt_type (type, "_tag", refok, 1, NULL) != NULL);
-}
+  if (strncmp (sym_name, text, text_len) == 0)
+    match = 1;
 
-/* True iff TYPE represents the type of X'Tag */
+  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;
 
-int
-ada_is_tag_type (struct type *type)
-{
-  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_PTR)
-    return 0;
-  else
+      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)
     {
-      const char *name = ada_type_name (TYPE_TARGET_TYPE (type));
-      return (name != NULL
-              && strcmp (name, "ada__tags__dispatch_table") == 0);
+      /* 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;
     }
-}
 
-/* The type of the tag on VAL.  */
+  /* Second: Try wild matching...  */
 
-struct type *
-ada_tag_type (struct value *val)
-{
-  return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 1, 0, NULL);
-}
+  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));
 
-/* The value of the tag on VAL.  */
+      if (strncmp (sym_name, text, text_len) == 0)
+        match = 1;
+    }
 
-struct value *
-ada_value_tag (struct value *val)
-{
-  return ada_value_struct_elt (val, "_tag", "record");
+  /* 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;
 }
 
-/* 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. */
+/* 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.
 
-static struct value *
-value_tag_from_contents_and_address (struct type *type, char *valaddr,
-                                     CORE_ADDR address)
+   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
+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)
 {
-  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;
+  const char *match = symbol_completion_match (sym_name, text, text_len,
+                                               wild_match, encoded);
+  char *completion;
 
-      return value_from_contents_and_address (tag_type, valaddr1, address1);
+  if (match == NULL)
+    return;
+
+  /* We found a match, so add the appropriate completion to the given
+     string vector.  */
+
+  if (word == orig_text)
+    {
+      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
+    {
+      /* 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);
     }
-  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;
+  string_vector_append (sv, completion);
 }
 
-struct tag_args
-{
-  struct value *tag;
-  char *name;
-};
+/* Return a list of possible symbol names completing TEXT0.  The list
+   is NULL terminated.  WORD is the entire command on which completion
+   is made.  */
 
-/* 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.  */
+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 */
+\f
+#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.  */
+
+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.  */
+  char *p;
+  for (p = line; *p != '\000' && *p != ' ' && *p != ':'; p += 1)
+    ;
+  return p;
+}
+
+/* *SPEC points to a function and line number spec (as in a break
+   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:
+     + 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
+       possible).
+     + 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 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.
+
+   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,
+   *CANONICAL is set to NULL.
+
+   A 'canonical line spec' is simply a name (in the format of the
+   breakpoint command) that uniquely identifies a breakpoint position,
+   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 '*',
+   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.  */
+
+struct symtabs_and_lines
+ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
+                          int funfirstline, char ***canonical)
+{
+  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 = 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
+    {
+      if (is_quoted)
+        *spec = skip_quoted (*spec);
+      while (**spec != '\000'
+             && !strchr (ada_completer_word_break_characters, **spec))
+        *spec += 1;
+    }
+  len = *spec - name;
+
+  line_num = -1;
+  if (file_table != NULL && (*spec)[0] == ':' && isdigit ((*spec)[1]))
+    {
+      line_num = strtol (*spec + 1, spec, 10);
+      while (**spec == ' ' || **spec == '\t')
+        *spec += 1;
+    }
+
+  if (name[0] == '*')
+    {
+      if (line_num == -1)
+        error ("Wild-card function with no line number or file name.");
+
+      return ada_sals_for_line (file_table->filename, line_num,
+                                funfirstline, canonical, 0);
+    }
+
+  if (name[0] == '\'')
+    {
+      name += 1;
+      len -= 2;
+    }
+
+  if (name[0] == '<')
+    {
+      unquoted_name = (char *) alloca (len - 1);
+      memcpy (unquoted_name, name + 1, len - 2);
+      unquoted_name[len - 2] = '\000';
+      lower_name = NULL;
+    }
+  else
+    {
+      unquoted_name = (char *) alloca (len + 1);
+      memcpy (unquoted_name, name, len);
+      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[len] = '\000';
+    }
+
+  n_matches = 0;
+  if (lower_name != NULL)
+    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);
+  if (n_matches == 0 && line_num >= 0)
+    error ("No line number information found for %s.", unquoted_name);
+  else if (n_matches == 0)
+    {
+#ifdef HPPA_COMPILER_BUG
+      /* FIXME: See comment in symtab.c::decode_line_1 */
+#undef volatile
+      volatile struct symtab_and_line val;
+#define volatile                /*nothing */
+#else
+      struct symtab_and_line val;
+#endif
+      struct minimal_symbol *msymbol;
+
+      init_sal (&val);
+
+      msymbol = NULL;
+      if (lower_name != NULL)
+        msymbol = ada_lookup_simple_minsym (ada_encode (lower_name));
+      if (msymbol == NULL)
+        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 = 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 symbol table is loaded.  Use the \"file\" command.");
+
+      error ("Function \"%s\" not defined.", unquoted_name);
+      return selected;          /* for lint */
+    }
+
+  if (line_num >= 0)
+    {
+      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, n_matches, n_matches);
+    }
+
+  selected.sals = (struct symtab_and_line *)
+    xmalloc (sizeof (struct symtab_and_line) * selected.nelts);
+  memset (selected.sals, 0, selected.nelts * sizeof (selected.sals[i]));
+  make_cleanup (xfree, selected.sals);
+
+  i = 0;
+  while (i < selected.nelts)
+    {
+      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];
+          selected.nelts -= 1;
+          continue;
+        }
+      else
+        error ("Line number not known for symbol \"%s\"", unquoted_name);
+      i += 1;
+    }
+
+  if (canonical != NULL && (line_num >= 0 || n_matches > 1))
+    {
+      *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].sym));
+    }
+
+  discard_cleanups (old_chain);
+  return selected;
+}
+
+/* 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 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 ada_symbol_info *symbols, int nsyms)
+{
+  struct symtabs_and_lines sals;
+  int best_index, best;
+  struct linetable *best_linetable;
+  struct objfile *objfile;
+  struct symtab *s;
+  struct symtab *best_symtab;
+
+  read_all_symtabs (filename);
+
+  best_index = 0;
+  best_linetable = NULL;
+  best_symtab = NULL;
+  best = 0;
+  ALL_SYMTABS (objfile, s)
+  {
+    struct linetable *l;
+    int ind, exact;
+
+    QUIT;
+
+    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 (best == 0)
+    error ("Line number not found in designated function.");
+
+done:
+
+  sals.nelts = 1;
+  sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0]));
+
+  init_sal (&sals.sals[0]);
+
+  sals.sals[0].line = best_linetable->item[best_index].line;
+  sals.sals[0].pc = best_linetable->item[best_index].pc;
+  sals.sals[0].symtab = best_symtab;
+
+  return sals;
+}
+
+/* Return the index in LINETABLE of the best match for LINE_NUM whose
+   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 ada_symbol_info *symbols, int nsyms,
+                        int *exactp)
+{
+  int i, len, best_index, best;
+
+  if (line_num <= 0 || linetable == NULL)
+    return -1;
+
+  len = linetable->nitems;
+  for (i = 0, best_index = -1, best = 0; i < len; i += 1)
+    {
+      int k;
+      struct linetable_entry *item = &(linetable->item[i]);
+
+      for (k = 0; k < nsyms; k += 1)
+        {
+          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;
+        }
+
+      if (item->line > line_num && (best == 0 || item->line < best))
+        {
+          best = item->line;
+          best_index = i;
+        }
+    }
+
+  *exactp = 0;
+  return best_index;
+}
+
+/* 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.  */
+
+static int
+nearest_line_number_in_linetable (struct linetable *linetable, int line_num)
+{
+  int i, len, best;
+
+  if (line_num <= 0 || linetable == NULL || linetable->nitems == 0)
+    return -1;
+  len = linetable->nitems;
+
+  i = 0;
+  best = INT_MAX;
+  while (i < len)
+    {
+      struct linetable_entry *item = &(linetable->item[i]);
+
+      if (item->line >= line_num && item->line < best)
+        {
+          char *func_name;
+          CORE_ADDR 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, 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;
+    }
+
+  return (best == INT_MAX) ? -1 : best;
+}
+
+
+/* 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
+   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.  */
+
+static int
+find_next_line_in_linetable (struct linetable *linetable, int line_num,
+                             int starting_line, int ind)
+{
+  int i, len;
+
+  if (line_num <= 0 || linetable == NULL || ind >= linetable->nitems)
+    return -1;
+  len = linetable->nitems;
+
+  if (ind >= 0)
+    {
+      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;
+        }
+      else
+        ind += 1;
+    }
+  else
+    ind = 0;
+
+  i = ind;
+  while (i < len)
+    {
+      struct linetable_entry *item = &(linetable->item[i]);
+
+      if (item->line >= line_num)
+        {
+          char *func_name;
+          CORE_ADDR 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, 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;
+    }
+
+  return -1;
+}
+
+/* True iff function symbol SYM starts somewhere at or before line #
+   LINE_NUM.  */
+
+static int
+is_plausible_func_for_line (struct symbol *sym, int line_num)
+{
+  struct symtab_and_line start_sal;
+
+  if (sym == NULL)
+    return 0;
+
+  start_sal = find_function_start_sal (sym, 0);
+
+  return (start_sal.line != 0 && line_num >= start_sal.line);
+}
+
+/* Read in all symbol tables corresponding to partial symbol tables
+   with file name FILENAME.  */
+
+static void
+read_all_symtabs (const char *filename)
+{
+  struct partial_symtab *ps;
+  struct objfile *objfile;
+
+  ALL_PSYMTABS (objfile, ps)
+  {
+    QUIT;
+
+    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.  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;
+  struct symtab *s;
+  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+  size_t len;
+
+  read_all_symtabs (filename);
+
+  result.sals =
+    (struct symtab_and_line *) xmalloc (4 * sizeof (result.sals[0]));
+  result.nelts = 0;
+  len = 4;
+  make_cleanup (free_current_contents, &result.sals);
+
+  ALL_SYMTABS (objfile, s)
+  {
+    int ind, target_line_num;
+
+    QUIT;
+
+    if (strcmp (s->filename, filename) != 0)
+      continue;
+
+    target_line_num =
+      nearest_line_number_in_linetable (LINETABLE (s), line_num);
+    if (target_line_num == -1)
+      continue;
+
+    ind = -1;
+    while (1)
+      {
+        ind =
+          find_next_line_in_linetable (LINETABLE (s),
+                                       target_line_num, line_num, ind);
+
+        if (ind < 0)
+          break;
+
+        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, j, n;
+      char **func_names = (char **) alloca (result.nelts * sizeof (char *));
+      int first_choice = (result.nelts > 1) ? 2 : 1;
+      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.");
+        }
+
+      /* 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)
+        {
+          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");
+            }
+
+          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 && 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]);
+            }
+        }
+    }
+
+  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.  */
+
+static char *
+extended_canonical_line_spec (struct symtab_and_line sal, const char *name)
+{
+  char *r;
+
+  if (sal.symtab == NULL || sal.symtab->filename == NULL || sal.line <= 0)
+    return NULL;
+
+  r = (char *) xmalloc (strlen (name) + strlen (sal.symtab->filename)
+                        + sizeof (sal.line) * 3 + 3);
+  sprintf (r, "%s:'%s':%d", sal.symtab->filename, name, sal.line);
+  return r;
+}
+
+/* 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 int
+ada_exception_breakpoint_type (bpstat bs)
+{
+  return ((!bs || !bs->breakpoint_at) ? 0
+          : bs->breakpoint_at->break_on_exception);
+}
+
+/* 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 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;
+
+  /* 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.  */
+
+  if (sal.symtab == NULL)
+    return 1;
+
+  /* On some systems (e.g. VxWorks), the kernel contains debugging
+     symbols; in this case, the filename referenced by these symbols
+     does not exists.  */
+
+  if (stat (sal.symtab->filename, &st))
+    return 1;
+
+  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->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
+    func_name = function_name_from_pc (get_frame_pc (frame));
+
+  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;
+    }
+
+  return 0;
+}
+
+/* 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_find_printable_frame (struct frame_info *fi)
+{
+  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
+ada_is_exception_sym (struct symbol *sym)
+{
+  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 && 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);
+}
+
+/* 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
+   *BREAK_ON_EXCEPTIONP to 1 for ordinary break on exception, 2 for
+   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;
+  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;
+
+      tok = arg + 9;
+      while (*tok == ' ' || *tok == '\t')
+        tok += 1;
+
+      end_tok = tok;
+
+      while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
+        end_tok += 1;
+
+      toklen = end_tok - tok;
+
+      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 = 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;
+
+      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
+\f
+                                /* Field Access */
+
+/* True if field number FIELD_NUM in struct or union type TYPE is supposed
+   to be invisible to users.  */
+
+int
+ada_is_ignored_field (struct type *type, int field_num)
+{
+  if (field_num < 0 || field_num > TYPE_NFIELDS (type))
+    return 1;
+  else
+    {
+      const char *name = TYPE_FIELD_NAME (type, field_num);
+      return (name == NULL
+              || (name[0] == '_' && strncmp (name, "_parent", 7) != 0));
+    }
+}
+
+/* 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, int refok)
+{
+  return (ada_lookup_struct_elt_type (type, "_tag", refok, 1, NULL) != NULL);
+}
+
+/* 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", 1, 0, NULL);
+}
+
+/* The value of the tag on VAL.  */
+
+struct value *
+ada_value_tag (struct value *val)
+{
+  return ada_value_struct_elt (val, "_tag", "record");
+}
+
+/* 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)
@@ -5069,14 +6718,14 @@ ada_parent_type (struct type *type)
 {
   int i;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT)
     return NULL;
 
   for (i = 0; i < TYPE_NFIELDS (type); i += 1)
     if (ada_is_parent_field (type, i))
-      return ada_check_typedef (TYPE_FIELD_TYPE (type, i));
+      return check_typedef (TYPE_FIELD_TYPE (type, i));
 
   return NULL;
 }
@@ -5088,7 +6737,7 @@ ada_parent_type (struct type *type)
 int
 ada_is_parent_field (struct type *type, int field_num)
 {
-  const char *name = TYPE_FIELD_NAME (ada_check_typedef (type), field_num);
+  const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num);
   return (name != NULL
           && (strncmp (name, "PARENT", 6) == 0
               || strncmp (name, "_parent", 7) == 0));
@@ -5305,7 +6954,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
 {
   struct type *type;
 
-  arg_type = ada_check_typedef (arg_type);
+  CHECK_TYPEDEF (arg_type);
   type = TYPE_FIELD_TYPE (arg_type, fieldno);
 
   /* Handle packed fields.  */
@@ -5337,7 +6986,7 @@ find_struct_field (char *name, struct type *type, int offset,
 {
   int i;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   *field_type_p = NULL;
   *byte_offset_p = *bit_offset_p = *bit_size_p = 0;
 
@@ -5369,7 +7018,7 @@ find_struct_field (char *name, struct type *type, int offset,
       else if (ada_is_variant_part (type, i))
         {
           int j;
-          struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i));
+          struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
 
           for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
             {
@@ -5398,7 +7047,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
                          struct type *type)
 {
   int i;
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   for (i = TYPE_NFIELDS (type) - 1; i >= 0; i -= 1)
     {
@@ -5423,7 +7072,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
       else if (ada_is_variant_part (type, i))
         {
           int j;
-          struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i));
+          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)
@@ -5464,7 +7113,7 @@ ada_value_struct_elt (struct value *arg, char *name, char *err)
   struct value *v;
 
   v = NULL;
-  t1 = t = ada_check_typedef (VALUE_TYPE (arg));
+  t1 = t = check_typedef (VALUE_TYPE (arg));
   if (TYPE_CODE (t) == TYPE_CODE_REF)
     {
       t1 = TYPE_TARGET_TYPE (t);
@@ -5475,7 +7124,7 @@ ada_value_struct_elt (struct value *arg, char *name, char *err)
           else
             error ("Bad value type in a %s.", err);
         }
-      t1 = ada_check_typedef (t1);
+      CHECK_TYPEDEF (t1);
       if (TYPE_CODE (t1) == TYPE_CODE_PTR)
         {
           COERCE_REF (arg);
@@ -5493,7 +7142,7 @@ ada_value_struct_elt (struct value *arg, char *name, char *err)
           else
             error ("Bad value type in a %s.", err);
         }
-      t1 = ada_check_typedef (t1);
+      CHECK_TYPEDEF (t1);
       if (TYPE_CODE (t1) == TYPE_CODE_PTR)
         {
           arg = value_ind (arg);
@@ -5532,10 +7181,7 @@ ada_value_struct_elt (struct value *arg, char *name, char *err)
         {
           if (bit_size != 0)
             {
-              if (TYPE_CODE (t) == TYPE_CODE_REF)
-                arg = ada_coerce_ref (arg);
-              else
-                arg = ada_value_ind (arg);
+              arg = ada_value_ind (arg);
               v = ada_value_primitive_packed_val (arg, NULL, byte_offset,
                                                   bit_offset, bit_size,
                                                   field_type);
@@ -5581,7 +7227,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
   if (refok && type != NULL)
     while (1)
       {
-        type = ada_check_typedef (type);
+        CHECK_TYPEDEF (type);
         if (TYPE_CODE (type) != TYPE_CODE_PTR
             && TYPE_CODE (type) != TYPE_CODE_REF)
           break;
@@ -5622,7 +7268,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
         {
           if (dispp != NULL)
             *dispp += TYPE_FIELD_BITPOS (type, i) / 8;
-          return ada_check_typedef (TYPE_FIELD_TYPE (type, i));
+          return check_typedef (TYPE_FIELD_TYPE (type, i));
         }
 
       else if (ada_is_wrapper_field (type, i))
@@ -5641,7 +7287,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
       else if (ada_is_variant_part (type, i))
         {
           int j;
-          struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i));
+          struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
 
           for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
             {
@@ -5950,7 +7596,7 @@ ada_find_parallel_type (struct type *type, const char *suffix)
 static struct type *
 dynamic_template_type (struct type *type)
 {
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT
       || ada_type_name (type) == NULL)
@@ -6074,8 +7720,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
 
   for (f = 0; f < nfields; f += 1)
     {
-      off = align_value (off, field_alignment (type, f))
-       + TYPE_FIELD_BITPOS (type, f);
+      off =
+        align_value (off,
+                     field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f);
       TYPE_FIELD_BITPOS (rtype, f) = off;
       TYPE_FIELD_BITSIZE (rtype, f) = 0;
 
@@ -6159,23 +7806,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
         }
     }
 
-  /* According to exp_dbug.ads, the size of TYPE for variable-size records
-     should contain the alignment of that record, which should be a strictly
-     positive value.  If null or negative, then something is wrong, most
-     probably in the debug info.  In that case, we don't round up the size
-     of the resulting type. If this record is not part of another structure,
-     the current RTYPE length might be good enough for our purposes.  */
-  if (TYPE_LENGTH (type) <= 0)
-    {
-      warning ("Invalid type size for `%s' detected: %d.",
-               TYPE_NAME (rtype) ? TYPE_NAME (rtype) : "<unnamed>",
-               TYPE_LENGTH (type));
-    }
-  else
-    {
-      TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype),
-                                         TYPE_LENGTH (type));
-    }
+  TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), TYPE_LENGTH (type));
 
   value_free_to_mark (mark);
   if (TYPE_LENGTH (rtype) > varsize_limit)
@@ -6218,7 +7849,7 @@ template_to_static_fixed_type (struct type *type0)
 
   for (f = 0; f < nfields; f += 1)
     {
-      struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type0, f));
+      struct type *field_type = CHECK_TYPEDEF (TYPE_FIELD_TYPE (type0, f));
       struct type *new_type;
 
       if (is_dynamic_field (type0, f))
@@ -6424,7 +8055,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
   index_type_desc = ada_find_parallel_type (type0, "___XA");
   if (index_type_desc == NULL)
     {
-      struct type *elt_type0 = ada_check_typedef (TYPE_TARGET_TYPE (type0));
+      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.  */
@@ -6448,7 +8079,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
       /* NOTE: result---the fixed version of elt_type0---should never
          depend on the contents of the array in properly constructed
          debugging data.  */
-      result = ada_to_fixed_type (ada_check_typedef (elt_type0), 0, 0, dval);
+      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 =
@@ -6476,7 +8107,7 @@ struct type *
 ada_to_fixed_type (struct type *type, char *valaddr,
                    CORE_ADDR address, struct value *dval)
 {
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   switch (TYPE_CODE (type))
     {
     default:
@@ -6519,7 +8150,7 @@ to_static_fixed_type (struct type *type0)
   if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
     return type0;
 
-  type0 = ada_check_typedef (type0);
+  CHECK_TYPEDEF (type0);
 
   switch (TYPE_CODE (type0))
     {
@@ -6547,7 +8178,7 @@ static_unwrap_type (struct type *type)
 {
   if (ada_is_aligner_type (type))
     {
-      struct type *type1 = TYPE_FIELD_TYPE (ada_check_typedef (type), 0);
+      struct type *type1 = TYPE_FIELD_TYPE (check_typedef (type), 0);
       if (ada_type_name (type1) == NULL)
         TYPE_NAME (type1) = ada_type_name (type);
 
@@ -6578,7 +8209,7 @@ static_unwrap_type (struct type *type)
    exists, otherwise TYPE.  */
 
 struct type *
-ada_check_typedef (struct type *type)
+ada_completed_type (struct type *type)
 {
   CHECK_TYPEDEF (type);
   if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
@@ -6622,6 +8253,24 @@ ada_to_fixed_value (struct value *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
@@ -6699,7 +8348,7 @@ pos_atr (struct value *arg)
 static struct value *
 value_pos_atr (struct value *arg)
 {
-  return value_from_longest (builtin_type_int, pos_atr (arg));
+  return value_from_longest (builtin_type_ada_int, pos_atr (arg));
 }
 
 /* Evaluate the TYPE'VAL attribute applied to ARG.  */
@@ -6749,7 +8398,7 @@ ada_is_character_type (struct type *type)
 int
 ada_is_string_type (struct type *type)
 {
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
   if (type != NULL
       && TYPE_CODE (type) != TYPE_CODE_PTR
       && (ada_is_simple_array_type (type)
@@ -6772,14 +8421,7 @@ ada_is_string_type (struct type *type)
 int
 ada_is_aligner_type (struct type *type)
 {
-  type = ada_check_typedef (type);
-
-  /* If we can find a parallel XVS type, then the XVS type should
-     be used instead of this type.  And hence, this is not an aligner
-     type.  */
-  if (ada_find_parallel_type (type, "___XVS") != NULL)
-    return 0;
-
+  CHECK_TYPEDEF (type);
   return (TYPE_CODE (type) == TYPE_CODE_STRUCT
           && TYPE_NFIELDS (type) == 1
           && strcmp (TYPE_FIELD_NAME (type, 0), "F") == 0);
@@ -6934,12 +8576,12 @@ evaluate_subexp_type (struct expression *exp, int *pos)
 static struct value *
 unwrap_value (struct value *val)
 {
-  struct type *type = ada_check_typedef (VALUE_TYPE (val));
+  struct type *type = check_typedef (VALUE_TYPE (val));
   if (ada_is_aligner_type (type))
     {
       struct value *v = value_struct_elt (&val, NULL, "F",
                                           NULL, "internal structure");
-      struct type *val_type = ada_check_typedef (VALUE_TYPE (v));
+      struct type *val_type = check_typedef (VALUE_TYPE (v));
       if (ada_type_name (val_type) == NULL)
         TYPE_NAME (val_type) = ada_type_name (type);
 
@@ -6948,7 +8590,7 @@ unwrap_value (struct value *val)
   else
     {
       struct type *raw_real_type =
-        ada_check_typedef (ada_get_base_type (type));
+        ada_completed_type (ada_get_base_type (type));
 
       if (type == raw_real_type)
         return val;
@@ -7000,8 +8642,8 @@ coerce_for_assign (struct type *type, struct value *val)
   if (type == type2)
     return val;
 
-  type2 = ada_check_typedef (type2);
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type2);
+  CHECK_TYPEDEF (type);
 
   if (TYPE_CODE (type2) == TYPE_CODE_PTR
       && TYPE_CODE (type) == TYPE_CODE_ARRAY)
@@ -7031,8 +8673,8 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
 
   COERCE_REF (arg1);
   COERCE_REF (arg2);
-  type1 = base_type (ada_check_typedef (VALUE_TYPE (arg1)));
-  type2 = base_type (ada_check_typedef (VALUE_TYPE (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)
@@ -7143,7 +8785,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       arg1 = evaluate_subexp (type, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
-      if (type != ada_check_typedef (VALUE_TYPE (arg1)))
+      if (type != check_typedef (VALUE_TYPE (arg1)))
         {
           if (ada_is_fixed_point_type (type))
             arg1 = cast_to_fixed (type, arg1);
@@ -7320,20 +8962,20 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                    && VALUE_LVAL (argvec[0]) == lval_memory))
         argvec[0] = value_addr (argvec[0]);
 
-      type = ada_check_typedef (VALUE_TYPE (argvec[0]));
+      type = check_typedef (VALUE_TYPE (argvec[0]));
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
         {
-          switch (TYPE_CODE (ada_check_typedef (TYPE_TARGET_TYPE (type))))
+          switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type))))
             {
             case TYPE_CODE_FUNC:
-              type = ada_check_typedef (TYPE_TARGET_TYPE (type));
+              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 = ada_check_typedef (TYPE_TARGET_TYPE (type));
+              type = check_typedef (TYPE_TARGET_TYPE (type));
               break;
             default:
               error ("cannot subscript or call something of type `%s'",
@@ -7392,8 +9034,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                                                    nargs, argvec + 1));
 
         default:
-          error ("Attempt to index or call something other than an "
-                "array or function");
+          error ("Internal error in evaluate_subexp");
         }
 
     case TERNOP_SLICE:
@@ -7401,15 +9042,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
         struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
         struct value *low_bound_val =
           evaluate_subexp (NULL_TYPE, exp, pos, noside);
-        struct value *high_bound_val =
-          evaluate_subexp (NULL_TYPE, exp, pos, noside);
-        LONGEST low_bound;
-        LONGEST high_bound;
-        COERCE_REF (low_bound_val);
-        COERCE_REF (high_bound_val);
-        low_bound = pos_atr (low_bound_val);
-        high_bound = pos_atr (high_bound_val);
-
+        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;
 
@@ -7431,26 +9066,12 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
           array = value_addr (array);
 
         if (noside == EVAL_AVOID_SIDE_EFFECTS
-            && ada_is_array_descriptor_type (ada_check_typedef
-                                             (VALUE_TYPE (array))))
+            && 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 we have more than one level of pointer indirection,
-           dereference the value until we get only one level.  */
-        while (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR
-               && (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array)))
-                     == TYPE_CODE_PTR))
-          array = value_ind (array);
-
-        /* Make sure we really do have an array type before going further,
-           to avoid a SEGV when trying to get the index type or the target
-           type later down the road if the debug info generated by
-           the compiler is incorrect or incomplete.  */
-        if (!ada_is_simple_array_type (VALUE_TYPE (array)))
-          error ("cannot take slice of non-array");
-
         if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR)
           {
             if (high_bound < low_bound || noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -7462,8 +9083,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                   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);
+                                            (int) low_bound, (int) high_bound);
               }
           }
         else if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -7486,7 +9106,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
         {
         default:
           lim_warning ("Membership test incompletely implemented; "
-                       "always returns true");
+                       "always returns true", 0);
           return value_from_longest (builtin_type_int, (LONGEST) 1);
 
         case TYPE_CODE_RANGE:
@@ -7704,7 +9324,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-        return value_zero (builtin_type_int, not_lval);
+        return value_zero (builtin_type_ada_int, not_lval);
       else
         return value_pos_atr (arg1);
 
@@ -7713,9 +9333,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-        return value_zero (builtin_type_int, not_lval);
+        return value_zero (builtin_type_ada_int, not_lval);
       else
-        return value_from_longest (builtin_type_int,
+        return value_from_longest (builtin_type_ada_int,
                                    TARGET_CHAR_BIT
                                    * TYPE_LENGTH (VALUE_TYPE (arg1)));
 
@@ -7758,11 +9378,11 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case UNOP_IND:
       if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
-        expect_type = TYPE_TARGET_TYPE (ada_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;
-      type = ada_check_typedef (VALUE_TYPE (arg1));
+      type = check_typedef (VALUE_TYPE (arg1));
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
         {
           if (ada_is_array_descriptor_type (type))
@@ -7777,13 +9397,11 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                    || TYPE_CODE (type) == TYPE_CODE_REF
                    /* In C you can dereference an array to get the 1st elt.  */
                    || TYPE_CODE (type) == TYPE_CODE_ARRAY)
-            {
-              type = to_static_fixed_type
-                (ada_aligned_type
-                 (ada_check_typedef (TYPE_TARGET_TYPE (type))));
-              check_size (type);
-              return value_zero (type, lval_memory);
-            }
+            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);
@@ -7791,7 +9409,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
             error ("Attempt to take contents of a non-pointer value.");
         }
       arg1 = ada_coerce_ref (arg1);     /* FIXME: What is this for?? */
-      type = ada_check_typedef (VALUE_TYPE (arg1));
+      type = check_typedef (VALUE_TYPE (arg1));
 
       if (ada_is_array_descriptor_type (type))
         /* GDB allows dereferencing GNAT array descriptors.  */
@@ -8150,7 +9768,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
           L = get_int_var_value (name_buf, &ok);
           if (!ok)
             {
-              lim_warning ("Unknown lower bound, using 1.");
+              lim_warning ("Unknown lower bound, using 1.", 1);
               L = 1;
             }
         }
@@ -8206,10 +9824,10 @@ ada_is_modular_type (struct type *type)
 
 /* Assuming ada_is_modular_type (TYPE), the modulus of TYPE.  */
 
-ULONGEST
+LONGEST
 ada_modulus (struct type * type)
 {
-  return (ULONGEST) TYPE_HIGH_BOUND (type) + 1;
+  return TYPE_HIGH_BOUND (type) + 1;
 }
 \f
                                 /* Operators */
@@ -8470,7 +10088,179 @@ static const struct op_print ada_op_print_tab[] = {
   {NULL, 0, 0, 0}
 };
 \f
-                               /* Fundamental Ada Types */
+                        /* Assorted Types and Interfaces */
+
+struct type *builtin_type_ada_int;
+struct type *builtin_type_ada_short;
+struct type *builtin_type_ada_long;
+struct type *builtin_type_ada_long_long;
+struct type *builtin_type_ada_char;
+struct type *builtin_type_ada_float;
+struct type *builtin_type_ada_double;
+struct type *builtin_type_ada_long_double;
+struct type *builtin_type_ada_natural;
+struct type *builtin_type_ada_positive;
+struct type *builtin_type_ada_system_address;
+
+struct type **const (ada_builtin_types[]) =
+{
+  &builtin_type_ada_int,
+    &builtin_type_ada_long,
+    &builtin_type_ada_short,
+    &builtin_type_ada_char,
+    &builtin_type_ada_float,
+    &builtin_type_ada_double,
+    &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.  */
+&builtin_type_int,
+    &builtin_type_long,
+    &builtin_type_short,
+    &builtin_type_char,
+    &builtin_type_float,
+    &builtin_type_double,
+    &builtin_type_long_long,
+    &builtin_type_void,
+    &builtin_type_signed_char,
+    &builtin_type_unsigned_char,
+    &builtin_type_unsigned_short,
+    &builtin_type_unsigned_int,
+    &builtin_type_unsigned_long,
+    &builtin_type_unsigned_long_long,
+    &builtin_type_long_double,
+    &builtin_type_complex, &builtin_type_double_complex, 0};
+
+/* 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,
+  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.  */
+#ifdef GNAT_GDB
+  ada_lookup_symbol,
+  ada_lookup_minimal_symbol,
+#endif /* GNAT_GDB */
+  array_row_major,
+  &ada_exp_descriptor,
+  parse,
+  ada_error,
+  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 */
+  ada_op_print_tab,             /* expression operators for printing */
+  0,                            /* c-style arrays */
+  1,                            /* String lower bound */
+  &builtin_type_ada_char,
+  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
+};
+
+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);
+  builtin_type_ada_long =
+    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
+               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);
+  builtin_type_ada_char =
+    init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+               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);
+  builtin_type_ada_double =
+    init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+               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);
+  builtin_type_ada_long_double =
+    init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+               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);
+  builtin_type_ada_positive =
+    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+               0, "positive", (struct objfile *) NULL);
+
+
+  builtin_type_ada_system_address =
+    lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void",
+                                    (struct objfile *) NULL));
+  TYPE_NAME (builtin_type_ada_system_address) = "system__address";
+}
+
+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
+    (256, htab_hash_string, (int (*)(const void *, const void *)) streq,
+     NULL, xcalloc, xfree);
+}
 
 /* Create a fundamental Ada type using default reasonable for the current
    target machine.
@@ -8553,9 +10343,7 @@ ada_create_fundamental_type (struct objfile *objfile, int typeid)
                         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,
@@ -8611,140 +10399,22 @@ ada_create_fundamental_type (struct objfile *objfile, int typeid)
   return (type);
 }
 
-enum ada_primitive_types {
-  ada_primitive_type_int,
-  ada_primitive_type_long,
-  ada_primitive_type_short,
-  ada_primitive_type_char,
-  ada_primitive_type_float,
-  ada_primitive_type_double,
-  ada_primitive_type_void,
-  ada_primitive_type_long_long,
-  ada_primitive_type_long_double,
-  ada_primitive_type_natural,
-  ada_primitive_type_positive,
-  ada_primitive_type_system_address,
-  nr_ada_primitive_types
-};
-
-static void
-ada_language_arch_info (struct gdbarch *current_gdbarch,
-                       struct language_arch_info *lai)
-{
-  const struct builtin_type *builtin = builtin_type (current_gdbarch);
-  lai->primitive_type_vector
-    = GDBARCH_OBSTACK_CALLOC (current_gdbarch, nr_ada_primitive_types + 1,
-                             struct type *);
-  lai->primitive_type_vector [ada_primitive_type_int] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "integer", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_long] =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-               0, "long_integer", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_short] =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-               0, "short_integer", (struct objfile *) NULL);
-  lai->string_char_type = 
-    lai->primitive_type_vector [ada_primitive_type_char] =
-    init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-               0, "character", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_float] =
-    init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
-               0, "float", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_double] =
-    init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
-               0, "long_float", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_long_long] =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-               0, "long_long_integer", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_long_double] =
-    init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-               0, "long_long_float", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_natural] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "natural", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_positive] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "positive", (struct objfile *) NULL);
-  lai->primitive_type_vector [ada_primitive_type_void] = builtin->builtin_void;
-
-  lai->primitive_type_vector [ada_primitive_type_system_address] =
-    lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void",
-                                    (struct objfile *) NULL));
-  TYPE_NAME (lai->primitive_type_vector [ada_primitive_type_system_address])
-    = "system__address";
-}
-\f
-                               /* Language vector */
-
-/* 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,
-  NULL,
-  range_check_off,
-  type_check_off,
-  case_sensitive_on,            /* Yes, Ada is case-insensitive, but
-                                   that's not quite what this means.  */
-  array_row_major,
-  &ada_exp_descriptor,
-  parse,
-  ada_error,
-  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 */
-  ada_op_print_tab,             /* expression operators for printing */
-  0,                            /* c-style arrays */
-  1,                            /* String lower bound */
-  NULL,
-  ada_get_gdb_completer_word_break_characters,
-  ada_language_arch_info,
-  LANG_MAGIC
-};
-
 void
-_initialize_ada_language (void)
+ada_dump_symtab (struct symtab *s)
 {
-  add_language (&ada_language_defn);
-
-  varsize_limit = 65536;
-
-  obstack_init (&symbol_list_obstack);
-
-  decoded_names_store = htab_create_alloc
-    (256, htab_hash_string, (int (*)(const void *, const void *)) streq,
-     NULL, xcalloc, xfree);
+  int i;
+  fprintf (stderr, "New symtab: [\n");
+  fprintf (stderr, "  Name: %s/%s;\n",
+           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);
+        }
+    }
+  fprintf (stderr, "]\n");
 }
index 18a662a0730cdc30526b0b8a9a0c83239729eac8..12eaf4bcb3fc8032ad7005a0bd0089b931590dcb 100644 (file)
@@ -160,6 +160,18 @@ struct task_entry
   int stack_per;
 };
 
+extern struct type *builtin_type_ada_int;
+extern struct type *builtin_type_ada_short;
+extern struct type *builtin_type_ada_long;
+extern struct type *builtin_type_ada_long_long;
+extern struct type *builtin_type_ada_char;
+extern struct type *builtin_type_ada_float;
+extern struct type *builtin_type_ada_double;
+extern struct type *builtin_type_ada_long_double;
+extern struct type *builtin_type_ada_natural;
+extern struct type *builtin_type_ada_positive;
+extern struct type *builtin_type_ada_system_address;
+
 /* The maximum number of tasks known to the Ada runtime.  */
 extern const int MAX_NUMBER_OF_KNOWN_TASKS;
 
@@ -367,7 +379,7 @@ extern int ada_prefer_type (struct type *, struct type *);
 
 extern struct type *ada_get_base_type (struct type *);
 
-extern struct type *ada_check_typedef (struct type *);
+extern struct type *ada_completed_type (struct type *);
 
 extern char *ada_encode (const char *);
 
@@ -375,7 +387,7 @@ extern const char *ada_enum_name (const char *);
 
 extern int ada_is_modular_type (struct type *);
 
-extern ULONGEST ada_modulus (struct type *);
+extern LONGEST ada_modulus (struct type *);
 
 extern struct value *ada_value_ind (struct value *);
 
@@ -413,6 +425,10 @@ 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);
index 6aa3b7d5bff5fff3062c6d8d8a79422f1f30b2a8..21dba2c021b53ef79db2bd6097d47c98ab364880 100644 (file)
@@ -26,6 +26,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* each successive token and places a semantic value into yylval */
 /* (ada-lval), defined by the parser.   */
 
+/* Run flex with (at least) the -i option (case-insensitive), and the -I */
+/* option (interactive---no unnecessary lookahead).  */
+
 DIG    [0-9]
 NUM10  ({DIG}({DIG}|_)*)
 HEXDIG [0-9a-f]
@@ -42,6 +45,8 @@ EXP   (e[+-]{NUM10})
 POSEXP  (e"+"?{NUM10})
 
 %{
+#define malloc xmalloc
+#define free xfree
 
 #define NUMERAL_WIDTH 256
 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
@@ -84,8 +89,6 @@ static int find_dot_all (const char *);
 
 %}
 
-%option case-insensitive interactive nodefault
-
 %s IN_STRING BEFORE_QUAL_QUOTE
 
 %%
@@ -141,19 +144,21 @@ static int find_dot_all (const char *);
                }
 
 <INITIAL>"'"({GRAPHIC}|\")"'" {
-                  yylval.typed_val.type = type_char ();
+                  yylval.typed_val.type = builtin_type_ada_char;
                   yylval.typed_val.val = yytext[1];
                   return CHARLIT;
                }
 
 <INITIAL>"'[\""{HEXDIG}{2}"\"]'"   {
                    int v;
-                   yylval.typed_val.type = type_char ();
+                   yylval.typed_val.type = builtin_type_ada_char;
                   sscanf (yytext+3, "%2x", &v);
                   yylval.typed_val.val = v;
                   return CHARLIT;
                }
 
+\"{OPER}\"/{WHITE}*"(" { return processId (yytext, yyleng); }
+
 <INITIAL>\"    {
                   tempbuf_len = 0;
                   BEGIN IN_STRING;
@@ -345,7 +350,7 @@ resize_tempbuf (unsigned int n)
   if (tempbufsize < n)
     {
       tempbufsize = (n+63) & ~63;
-      tempbuf = xrealloc (tempbuf, tempbufsize);
+      tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
     }
 }
 
@@ -473,9 +478,9 @@ processInt (const char *base0, const char *num0, const char *exp0)
     }
 
   if ((result >> (TARGET_INT_BIT-1)) == 0)
-    yylval.typed_val.type = type_int ();
+    yylval.typed_val.type = builtin_type_ada_int;
   else if ((result >> (TARGET_LONG_BIT-1)) == 0)
-    yylval.typed_val.type = type_long ();
+    yylval.typed_val.type = builtin_type_ada_long;
   else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
     {
       /* We have a number representable as an unsigned integer quantity.
@@ -495,7 +500,7 @@ processInt (const char *base0, const char *num0, const char *exp0)
       return INT;
     }
   else
-    yylval.typed_val.type = type_long_long ();
+    yylval.typed_val.type = builtin_type_ada_long_long;
 
   yylval.typed_val.val = (LONGEST) result;
   return INT;
@@ -522,11 +527,11 @@ processReal (const char *num0)
       yylval.typed_val_float.dval = temp;
     }
 
-  yylval.typed_val_float.type = type_float ();
+  yylval.typed_val_float.type = builtin_type_ada_float;
   if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
-    yylval.typed_val_float.type = type_double ();
+    yylval.typed_val_float.type = builtin_type_ada_double;
   if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
-    yylval.typed_val_float.type = type_long_double ();
+    yylval.typed_val_float.type = builtin_type_ada_long_double;
 
   return FLOAT;
 }
@@ -740,7 +745,7 @@ name_lookup (char *name0, char *err_name, int *token_type, int depth)
                                                          current_gdbarch,
                                                          name);
          if (type == NULL && strcmp ("system__address", name) == 0)
-           type = type_system_address ();
+           type = builtin_type_ada_system_address;
          if (type != NULL)
            {
              /* First check to see if we have a regular definition of this
@@ -919,10 +924,3 @@ yywrap(void)
 {
   return 1;
 }
-
-/* Dummy definition to suppress warnings about unused static definitions. */
-typedef void (*dummy_function) ();
-dummy_function ada_flex_use[] = 
-{ 
-  (dummy_function) yyunput
-};
index 8311d637f43ccc8dc96e11ebaafc6104c47c9c51..fb9c690f8202355ed67197eae91279b7d43817b9 100644 (file)
@@ -149,7 +149,7 @@ print_range (struct type *type, struct ui_file *stream)
     case TYPE_CODE_ENUM:
       break;
     default:
-      target_type = builtin_type_int;
+      target_type = builtin_type_ada_int;
       break;
     }
 
@@ -754,7 +754,7 @@ void
 ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
                int show, int level)
 {
-  struct type *type = ada_check_typedef (ada_get_base_type (type0));
+  struct type *type = ada_completed_type (ada_get_base_type (type0));
   char *type_name = decoded_type_name (type);
   int is_var_decl = (varstring != NULL && varstring[0] != '\0');
 
@@ -768,7 +768,7 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
     }
 
   if (show > 0)
-    type = ada_check_typedef (type);
+    CHECK_TYPEDEF (type);
 
   if (is_var_decl && TYPE_CODE (type) != TYPE_CODE_FUNC)
     fprintf_filtered (stream, "%.*s: ",
index 82e68252e00167cca0a37bfb75b88b254b14944a..3617d76a7794da2792602b77eaa88d763eaa33cb 100644 (file)
@@ -367,7 +367,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
   unsigned int i;
   unsigned len;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   switch (TYPE_CODE (type))
     {
@@ -599,7 +599,7 @@ ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
   LONGEST val;
   char *valaddr = valaddr0 + embedded_offset;
 
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   if (ada_is_array_descriptor_type (type) || ada_is_packed_array_type (type))
     {
@@ -960,7 +960,7 @@ static void
 print_record (struct type *type, char *valaddr, struct ui_file *stream,
              int format, int recurse, enum val_prettyprint pretty)
 {
-  type = ada_check_typedef (type);
+  CHECK_TYPEDEF (type);
 
   fprintf_filtered (stream, "(");
 
index 63687d7bee596727730fe277d5e3e535f20796e5..11a44712b0224e86b4cca89566256f26b3cf937d 100644 (file)
@@ -105,8 +105,8 @@ struct pd_thread {
 
 static struct target_ops aix_thread_ops;
 
-/* Copy of the target over which ops is pushed.  This is more
-   convenient than a pointer to deprecated_child_ops or core_ops,
+/* Copy of the target over which ops is pushed.  
+   This is more convenient than a pointer to child_ops or core_ops,
    because they lack current_target's default callbacks.  */
 
 static struct target_ops base_target;
@@ -1604,8 +1604,8 @@ aix_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
   struct cleanup *cleanup = save_inferior_ptid ();
 
   inferior_ptid = pid_to_ptid (PIDGET (inferior_ptid));
-  n = base_target.deprecated_xfer_memory (memaddr, myaddr, len, 
-                                         write, attrib, &base_target);
+  n = base_target.to_xfer_memory (memaddr, myaddr, len, 
+                                 write, attrib, &base_target);
   do_cleanups (cleanup);
 
   return n;
@@ -1736,7 +1736,7 @@ init_aix_thread_ops (void)
   aix_thread_ops.to_wait               = aix_thread_wait;
   aix_thread_ops.to_fetch_registers    = aix_thread_fetch_registers;
   aix_thread_ops.to_store_registers    = aix_thread_store_registers;
-  aix_thread_ops.deprecated_xfer_memory = aix_thread_xfer_memory;
+  aix_thread_ops.to_xfer_memory        = aix_thread_xfer_memory;
   /* No need for aix_thread_ops.to_create_inferior, because we activate thread
      debugging when the inferior reaches pd_brk_addr.  */
   aix_thread_ops.to_kill               = aix_thread_kill;
index ad00f98a536ac750f0d5110b5ece797b157f939c..299ed3af61f605b7ec6fc25a0e5fb9f19b5506a7 100644 (file)
@@ -226,8 +226,6 @@ _initialize_alphanbsd_tdep (void)
 {
   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);
 
   deprecated_add_core_fns (&alphanbsd_core_fns);
   deprecated_add_core_fns (&alphanbsd_elfcore_fns);
index 0b8caf2a005e45fbf857f101ad60f4255c13fce8..edf6df8de876929adfa1bbab673c75e959dee4a4 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for AMD64.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -50,9 +50,4 @@ extern void amd64_supply_native_gregset (struct regcache *regcache,
 extern void amd64_collect_native_gregset (const struct regcache *regcache,
                                          void *gregs, int regnum);
 
-/* Create a prototype *BSD/amd64 target.  The client can override it
-   with local methods.  */
-
-extern struct target_ops *amd64bsd_target (void);
-
 #endif /* amd64-nat.h */
index 43935536dc0d2d5f89a89830542b0ecf9d989ffe..b30885aa76364612b15f0f770e12285e14bcf87e 100644 (file)
@@ -22,7 +22,6 @@
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
-#include "target.h"
 
 /* We include <signal.h> to make sure `struct fxsave64' is defined on
    NetBSD, since NetBSD's <machine/reg.h> needs it.  */
 
 #include "amd64-tdep.h"
 #include "amd64-nat.h"
-#include "inf-ptrace.h"
 \f
 
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers (including the floating-point registers).  */
 
-static void
-amd64bsd_fetch_inferior_registers (int regnum)
+void
+fetch_inferior_registers (int regnum)
 {
   if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
     {
@@ -71,8 +69,8 @@ amd64bsd_fetch_inferior_registers (int regnum)
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
    this for all registers (including the floating-point registers).  */
 
-static void
-amd64bsd_store_inferior_registers (int regnum)
+void
+store_inferior_registers (int regnum)
 {
   if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
     {
@@ -107,17 +105,3 @@ amd64bsd_store_inferior_registers (int regnum)
        perror_with_name ("Couldn't write floating point status");
     }
 }
-
-/* Create a prototype *BSD/amd64 target.  The client can override it
-   with local methods.  */
-
-struct target_ops *
-amd64bsd_target (void)
-{
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = amd64bsd_fetch_inferior_registers;
-  t->to_store_registers = amd64bsd_store_inferior_registers;
-  return t;
-}
index b7787612ac7dccc16d68b4db54f864f5690801b7..caeaee9a75a406dec281f449294cf121a1ba5a24 100644 (file)
@@ -22,7 +22,6 @@
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
-#include "target.h"
 
 #include "gdb_assert.h"
 #include <signal.h>
@@ -32,7 +31,6 @@
 #include <sys/sysctl.h>
 #include <machine/reg.h>
 
-#include "fbsd-nat.h"
 #include "amd64-tdep.h"
 #include "amd64-nat.h"
 \f
@@ -140,22 +138,11 @@ void _initialize_amd64fbsd_nat (void);
 void
 _initialize_amd64fbsd_nat (void)
 {
-  struct target_ops *t;
   int offset;
 
   amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset;
   amd64_native_gregset64_reg_offset = amd64fbsd64_r_reg_offset;
 
-  /* Add some extra features to the common *BSD/i386 target.  */
-  t = amd64bsd_target ();
-  t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
-  t->to_find_memory_regions = fbsd_find_memory_regions;
-  t->to_make_corefile_notes = fbsd_make_corefile_notes;
-  add_target (t);
-
-  /* Support debugging kernel virtual memory images.  */
-  bsd_kvm_add_target (amd64fbsd_supply_pcb);
-
   /* To support the recognition of signal handlers, i386bsd-tdep.c
      hardcodes some constants.  Inclusion of this file means that we
      are compiling a native debugger, which means that we can use the
@@ -232,4 +219,7 @@ Please report this to <bug-gdb@gnu.org>.",
        amd64fbsd_sigtramp_end_addr = ps_strings;
       }
   }
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (amd64fbsd_supply_pcb);
 }
index 911f99e7de2fc8ba9bce941c48a0cd0b1828b918..df7ceb9e8612be03a15083348d08aa3bd16e1a1f 100644 (file)
@@ -20,7 +20,6 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "target.h"
 
 #include "gdb_assert.h"
 
@@ -66,7 +65,4 @@ _initialize_amd64nbsd_nat (void)
   amd64_native_gregset32_reg_offset = amd64nbsd32_r_reg_offset;
   amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64nbsd32_r_reg_offset);
   amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;
-
-  /* We've got nothing to add to the common *BSD/amd64 target.  */
-  add_target (amd64bsd_target ());
 }
index 6f8a6014b9500a505b654cb8cf48599c29fa4150..0f9b5efac7f25df05adab1eeb5478cb510584f30 100644 (file)
@@ -22,7 +22,6 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
-#include "target.h"
 
 #include "gdb_assert.h"
 
@@ -139,9 +138,6 @@ _initialize_amd64obsd_nat (void)
   amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64obsd32_r_reg_offset);
   amd64_native_gregset64_reg_offset = amd64obsd_r_reg_offset;
 
-  /* We've got nothing to add to the common *BSD/amd64 target.  */
-  add_target (amd64bsd_target ());
-
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (amd64obsd_supply_pcb);
 }
index eac34b8534fa9a6463a996d495ea3f435e5e44fd..7e9e669ce25114ebdb2cfb6e611f41e7938e871e 100644 (file)
@@ -2741,7 +2741,8 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint)
        struct value *v;
        int found = 0;
 
-       if (!target_stopped_data_address (&current_target, &addr))
+       addr = target_stopped_data_address ();
+       if (addr == 0)
          continue;
        for (v = b->val_chain; v; v = v->next)
          {
index 300379d954fa5898ed9d69dcbd44f3416f0478bd..64869e5464c2284c20165aeb1df7d8108165936c 100644 (file)
@@ -285,7 +285,7 @@ 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.deprecated_xfer_memory = bsd_kvm_xfer_memory;
+  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;
index ed44c994b8577659667f50e995c3c784f81546c8..e97479f2be40505dfdc3e6fd536c124c33b0e2d3 100644 (file)
 /* Define if you have the ttrace function.  */
 #undef HAVE_TTRACE
 
-/* Define if you have the wborder function.  */
-#undef HAVE_WBORDER
-
 /* Define if you have the <argz.h> header file.  */
 #undef HAVE_ARGZ_H
 
index 49834411442898993e65c95b6706788aff05ab9b..d3cbff7ff396bd1e7129896db47ec8cef8e6efd8 100644 (file)
@@ -1,7 +1,7 @@
 # Host: Little-endian Alpha running Linux
 NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o \
-       fork-child.o proc-service.o thread-db.o gcore.o \
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \
+       fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o \
        linux-nat.o
 
 # The dynamically loaded libthread_db needs access to symbols in the
index 386f681cdde6ef8b1b7479a0ae92bc7df0d3a24b..af5b546a7dcb3f2ab6c88e0f1e8d134ecd64a1d6 100644 (file)
@@ -2,8 +2,8 @@
 
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o      \
-       core-regset.o arm-linux-nat.o gcore.o   \
-       proc-service.o thread-db.o linux-nat.o
+       core-regset.o arm-linux-nat.o linux-proc.o gcore.o      \
+       proc-service.o thread-db.o lin-lwp.o linux-nat.o
 
 LOADLIBES= -ldl -rdynamic
 
index a63c9d6b0a25b0bdb5b7d78cfaab3e0dc17d5256..4337b7261a007405dac5a4e9253f1fe84faf5892 100644 (file)
 @V@/gdb/ia64-linux-nat.c @V@/gdb/ia64lx-tdep.c
 @V@/gdb/jv-exp.tab.c @V@/gdb/jv-exp_tab.c
 @V@/gdb/m2-exp.tab.c @V@/gdb/m2-exp_tab.c
-@V@/gdb/m32r-linux-nat.c @V@/gdb/m32rlnxnat.c
-@V@/gdb/m32r-linux-tdep.c @V@/gdb/m32rlnxtdep.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
index 437487218d065cfa41a07c9551c55ab163fb81f6..b8f677df2fcf310bddb7a12461e71639c7ecf754 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for the Fujitsu FR-V, for GDB, the GNU Debugger.
-   Copyright 2000, 2004 Free Software Foundation, Inc.
+   Copyright 2000 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,11 +33,10 @@ extern int frv_check_watch_resources (int type, int cnt, int ot);
 #define STOPPED_BY_WATCHPOINT(W) \
    ((W).kind == TARGET_WAITKIND_STOPPED \
    && (W).value.sig == TARGET_SIGNAL_TRAP \
-   && frv_have_stopped_data_address())
-extern int frv_have_stopped_data_address(void);
+   && (frv_stopped_data_address() != ((CORE_ADDR)0)))
+extern CORE_ADDR frv_stopped_data_address(void);
 
 /* Use these macros for watchpoint insertion/deletion.  */
-#define target_stopped_data_address(target, x) frv_stopped_data_address(x)
-extern int frv_stopped_data_address(CORE_ADDR *addr_p);
+#define target_stopped_data_address() frv_stopped_data_address()
 
 #include "solib.h"             /* Include support for shared libraries.  */
index 291e12150cf8c01775a10730ce30eff4a6ccd6f0..6f539f79eee9add6e29426e863cc6dbc42cd9001 100644 (file)
@@ -1,7 +1,7 @@
 # Host: FreeBSD/i386
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       fbsd-nat.o i386-nat.o i386bsd-nat.o i386fbsd-nat.o \
-       gcore.o bsd-kvm.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+       i386-nat.o i386bsd-nat.o i386fbsd-nat.o \
+       gcore.o fbsd-proc.o bsd-kvm.o
 NAT_FILE= nm-fbsd.h
 
 LOADLIBES= -lkvm
index f5817f132a57f7041faa298e6f4672667ebc79c2..d2dae259d689b55675a2f3322bcad8190ec93526 100644 (file)
@@ -1,6 +1,7 @@
 # Host: FreeBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       fbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
-       gcore.o bsd-kvm.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+       amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
+       gcore.o fbsd-proc.o bsd-kvm.o
+NAT_FILE= nm-fbsd64.h
 
 LOADLIBES= -lkvm
index bfe29c123e2962433f7cda93f17a249eaaba5794..3714e0c278788c4ecfae3fc34b9cfa57fe41cf01 100644 (file)
@@ -1,9 +1,9 @@
 # Host: Intel 386 running GNU/Linux.
 
 NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
        core-aout.o i386-nat.o i386-linux-nat.o \
-       proc-service.o thread-db.o gcore.o \
+       proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o \
        linux-nat.o
 
 # The dynamically loaded libthread_db needs access to symbols in the
index e9117cf041d009394576f1865c56ef8085d62924..1622f18c7c2226bdf1d299f7485283c81848861a 100644 (file)
@@ -1,7 +1,7 @@
 # Host: GNU/Linux x86-64
 NATDEPFILES= infptrace.o inftarg.o fork-child.o \
        i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \
-       proc-service.o thread-db.o gcore.o 
+       proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o 
 NAT_FILE= nm-linux64.h
 
 # The dynamically loaded libthread_db needs access to symbols in the
index aec2905024232f436ba831ef558234e2670ce77b..32f82a2af1f0f3759c58da35a5c4af0883bc88cc 100644 (file)
@@ -1,3 +1,4 @@
 # Host: NetBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
        amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
+NAT_FILE= config/nm-nbsd.h
index 1614c4d901763de8e5a92d0a33d618cef11b728e..d9b94f0d263061f24989b9a27260d165aa77075a 100644 (file)
@@ -1,7 +1,4 @@
 # Host: NetBSD/i386 a.out
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o \
+NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o \
        solib.o solib-sunos.o
-NAT_FILE= solib.h
-
-LOADLIBES= -lkvm
+NAT_FILE= nm-nbsdaout.h
index e49a49aac420617840aefad06d32c61d582cfb0e..4f9a6fdef88610d6b6d8563e58fd538160b65701 100644 (file)
@@ -1,6 +1,6 @@
 # Host: NetBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
        i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
-NAT_FILE= solib.h
+NAT_FILE= config/nm-nbsd.h
 
 LOADLIBES= -lkvm
index 4c0aa36b13cff8d1b8705694a5d08b17f1764a02..4c5683bcbd9dfbe4eb7c7bbf39b3a5d30889d94d 100644 (file)
@@ -54,6 +54,12 @@ extern unsigned long i386bsd_dr_get_status (void);
 
 /* Get generic BSD native definitions.  */
 #include "config/nm-bsd.h"
+
+/* Override child_resume in `infptrace.c' to work around a kernel bug.  */
+#define CHILD_RESUME
+
+/* Override child_pid_to_exec_file in 'inftarg.c'.  */
+#define CHILD_PID_TO_EXEC_FILE
 \f
 
 /* Support for the user struct.  */
@@ -62,10 +68,75 @@ extern unsigned long i386bsd_dr_get_status (void);
 
 #define KERNEL_U_SIZE kernel_u_size ()
 extern int kernel_u_size (void);
+
+/* This is the amount to subtract from u.u_ar0
+   to get the offset in the core file of the register values.  */
+
+#include <machine/vmparam.h>
+#define KERNEL_U_ADDR USRSTACK
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+  (addr) = register_u_addr ((blockend), (regno))
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
 \f
 
 /* Shared library support.  */
 
 #include "solib.h"
 
+/* Make structure definitions match up with those expected in
+   `solib-sunos.c'.  */
+
+#define link_object    sod
+#define lo_name                sod_name
+#define lo_library     sod_library
+#define lo_unused      sod_reserved
+#define lo_major       sod_major
+#define lo_minor       sod_minor
+#define lo_next                sod_next
+
+#define link_map       so_map
+#define lm_addr                som_addr
+#define lm_name                som_path
+#define lm_next                som_next
+#define lm_lop         som_sod
+#define lm_lob         som_sodbase
+#define lm_rwt         som_write
+#define lm_ld          som_dynamic
+#define lm_lpd         som_spd
+
+#define link_dynamic_2 section_dispatch_table
+#define ld_loaded      sdt_loaded
+#define ld_need                sdt_sods
+#define ld_rules       sdt_filler1
+#define ld_got         sdt_got
+#define ld_plt         sdt_plt
+#define ld_rel         sdt_rel
+#define ld_hash                sdt_hash
+#define ld_stab                sdt_nzlist
+#define ld_stab_hash   sdt_filler2
+#define ld_buckets     sdt_buckets
+#define ld_symbols     sdt_strings
+#define ld_symb_size   sdt_str_sz
+#define ld_text                sdt_text_sz
+#define ld_plt_sz      sdt_plt_sz
+
+#define rtc_symb       rt_symbol
+#define rtc_sp         rt_sp
+#define rtc_next       rt_next
+
+#define ld_debug       so_debug
+#define ldd_version    dd_version
+#define ldd_in_debugger        dd_in_debugger
+#define ldd_sym_loaded dd_sym_loaded
+#define ldd_bp_addr    dd_bpt_addr
+#define ldd_bp_inst    dd_bpt_shadow
+#define ldd_cp         dd_cc
+
+#define link_dynamic   _dynamic
+#define ld_version     d_version
+#define ldd            d_debug
+#define ld_un          d_un
+#define ld_2           d_sdt
+
 #endif /* nm-fbsd.h */
similarity index 69%
rename from gdb/i386bsd-nat.h
rename to gdb/config/i386/nm-fbsd64.h
index a0764ff2f1cf92b4d480b28704ce63eb90f01bfa..061e77e1374890800938326e58b9e397b1550b3b 100644 (file)
@@ -1,6 +1,6 @@
-/* Native-dependent code for modern i386 BSD's.
+/* Native-dependent definitions for FreeBSD/amd64.
 
-   Copyright 2004 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef I386BSD_NAT_H
-#define I386BSD_NAT_H
+#ifndef NM_FBSD64_H
+#define NM_FBSD64_H
 
-/* Create a prototype *BSD/i386 target.  The client can override it
-   with local methods.  */
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
 
-extern struct target_ops *i386bsd_target (void);
+/* Override child_pid_to_exec_file in 'inftarg.c'.  */
+#define CHILD_PID_TO_EXEC_FILE
 
-#endif /* i386bsd-nat.h */
+#endif /* nm-fbsd64.h */
index 265c8e04d367f957babd308edd85175eec524415..2692cae1995a74436613109ff995d9e1b4b70963 100644 (file)
@@ -47,10 +47,10 @@ extern int i386_region_ok_for_watchpoint (CORE_ADDR addr, int len);
    triggered.  */
 extern int i386_stopped_by_hwbp (void);
 
-/* If the inferior has some break/watchpoint that triggered, set
-   the address associated with that break/watchpoint and return
-   true.  Otherwise, return false.  */
-extern int i386_stopped_data_address (CORE_ADDR *);
+/* If the inferior has some break/watchpoint that triggered, return
+   the address associated with that break/watchpoint.  Otherwise,
+   return zero.  */
+extern CORE_ADDR i386_stopped_data_address (void);
 
 /* Insert a hardware-assisted breakpoint at address ADDR.  SHADOW is
    unused.  Return 0 on success, EBUSY on failure.  */
@@ -91,11 +91,9 @@ extern int  i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
 
 #define HAVE_CONTINUABLE_WATCHPOINT 1
 
-extern int i386_stopped_by_watchpoint (void);
+#define STOPPED_BY_WATCHPOINT(W)       (i386_stopped_data_address () != 0)
 
-#define STOPPED_BY_WATCHPOINT(W)       (i386_stopped_by_watchpoint () != 0)
-
-#define target_stopped_data_address(target, x)  i386_stopped_data_address(x)
+#define target_stopped_data_address()  i386_stopped_data_address ()
 
 /* Use these macros for watchpoint insertion/removal.  */
 
index 40c3e05ec0bbce0f9917483c6cf3123eecadf61b..1df875fd57b6ab658a476cd8a6c4d4d1429ebb06 100644 (file)
@@ -80,7 +80,7 @@ extern int cannot_store_register (int regno);
 #endif
 
 /* Override child_resume in `infptrace.c'.  */
-#define DEPRECATED_CHILD_RESUME
+#define CHILD_RESUME
 
 /* `linux-nat.c' and `i386-nat.c' have their own versions of
    child_post_startup_inferior.  Define this to use the copy in
similarity index 69%
rename from gdb/config/m32r/nm-linux.h
rename to gdb/config/i386/nm-nbsdaout.h
index ecfeebad88a1be672d4a8a28164d03708135297d..81866ff64ab866cfa3b76c30ea44e67345f4b80c 100644 (file)
@@ -1,5 +1,7 @@
-/* Definitions to make GDB run on an M32R based machine under GNU/Linux.
-   Copyright 2004 Free Software Foundation, Inc.
+/* Native-dependent definitions for NetBSD/i386 a.out.
+
+   Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000, 2004
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef NM_M32R_LINUX_H
-#define NM_M32R_LINUX_H
+#ifndef NM_NBSDAOUT_H
+#define NM_NBSDAOUT_H
 
-#include "config/nm-linux.h"
+#include "config/nm-nbsd.h"
 
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
-#define FETCH_INFERIOR_REGISTERS
+/* Get generic NetBSD a.out native definitions.  */
+#include "config/nm-nbsdaout.h"
 
-#endif /* NM_M32R_LINUX_H */
+#endif /* nm-nbsdaout.h */
index 571fb5984be9bea7931b6cdb578246ecc071d0b2..7fd32ca7c43b543ca9f5acf95c8384a1805c7f67 100644 (file)
 
 #define KERNEL_U_SIZE kernel_u_size ()
 extern int kernel_u_size (void);
+
+/* This is the amount to subtract from u.u_ar0
+   to get the offset in the core file of the register values.  */
+
+#include <machine/vmparam.h>
+#define KERNEL_U_ADDR USRSTACK
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+  (addr) = register_u_addr ((blockend), (regno))
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
 \f
 
 /* Shared library support.  */
 
 #include "solib.h"
 
+/* Make structure definitions match up with those expected in
+   `solib-sunos.c'.  */
+
+#define link_object    sod
+#define lo_name                sod_name
+#define lo_library     sod_library
+#define lo_unused      sod_reserved
+#define lo_major       sod_major
+#define lo_minor       sod_minor
+#define lo_next                sod_next
+
+#define link_map       so_map
+#define lm_addr                som_addr
+#define lm_name                som_path
+#define lm_next                som_next
+#define lm_lop         som_sod
+#define lm_lob         som_sodbase
+#define lm_rwt         som_write
+#define lm_ld          som_dynamic
+#define lm_lpd         som_spd
+
+#define link_dynamic_2 section_dispatch_table
+#define ld_loaded      sdt_loaded
+#define ld_need                sdt_sods
+#define ld_rules       sdt_filler1
+#define ld_got         sdt_got
+#define ld_plt         sdt_plt
+#define ld_rel         sdt_rel
+#define ld_hash                sdt_hash
+#define ld_stab                sdt_nzlist
+#define ld_stab_hash   sdt_filler2
+#define ld_buckets     sdt_buckets
+#define ld_symbols     sdt_strings
+#define ld_symb_size   sdt_str_sz
+#define ld_text                sdt_text_sz
+#define ld_plt_sz      sdt_plt_sz
+
+#define rtc_symb       rt_symbol
+#define rtc_sp         rt_sp
+#define rtc_next       rt_next
+
+#define ld_debug       so_debug
+#define ldd_version    dd_version
+#define ldd_in_debugger        dd_in_debugger
+#define ldd_sym_loaded dd_sym_loaded
+#define ldd_bp_addr    dd_bpt_addr
+#define ldd_bp_inst    dd_bpt_shadow
+#define ldd_cp         dd_cc
+
+#define link_dynamic   _dynamic
+#define ld_version     d_version
+#define ldd            d_debug
+#define ld_un          d_un
+#define ld_2           d_sdt
+
 #endif /* nm-obsd.h */
index f5b4b2dffc7fda651847777e6839792232f519d9..5e5781c7aafa942329c59feb32c69f42594c777e 100644 (file)
@@ -1,6 +1,7 @@
 # Host: OpenBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.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
 
 LOADLIBES= -lkvm
+
index 5c9899c4dfa2bc275ffecc319462a7cee2ab8802..14d341c5a079b0d68711579eb1c7856ba51a087e 100644 (file)
@@ -1,5 +1,6 @@
 # Host: OpenBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
        amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
+NAT_FILE= config/nm-nbsd.h
 
 LOADLIBES= -lkvm
index 4124c79bba0753b9a115cb2106ce322542ab2782..7b6850f6ef78d89c199c8d8f67941aea783b3f63 100644 (file)
@@ -1,7 +1,4 @@
 # Host: OpenBSD/i386 a.out
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       i386bsd-nat.o i386nbsd-nat.o i386obsd-nat.o bsd-kvm.o \
+NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o i386obsd-nat.o \
        solib.o solib-sunos.o
 NAT_FILE= nm-obsd.h
-
-LOADLIBES= -lkvm
index 5ad3145e3c4a8c8ff351c5fd749bea3bfd579abe..71fed101a3e1d649e7a836dace68f8fc2402f292 100644 (file)
@@ -2,7 +2,7 @@
 
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o gcore.o \
-       core-aout.o core-regset.o ia64-linux-nat.o \
-       proc-service.o thread-db.o linux-nat.o
+       core-aout.o core-regset.o ia64-linux-nat.o linux-proc.o \
+       proc-service.o thread-db.o lin-lwp.o linux-nat.o
 
 LOADLIBES = -ldl -rdynamic
index fb8675f69efcb242686ec15d2442cfa43530ff52..1a5539a8fdf82c80e80582c785f706964fc380b4 100644 (file)
@@ -58,12 +58,8 @@ extern int ia64_cannot_store_register (int regno);
 #define HAVE_STEPPABLE_WATCHPOINT 1
 
 #define STOPPED_BY_WATCHPOINT(W) \
-  ia64_linux_stopped_by_watchpoint ()
-extern int ia64_linux_stopped_by_watchpoint ();
-
-#define target_stopped_data_address(target, x) \
-  ia64_linux_stopped_data_address(x)
-extern int ia64_linux_stopped_data_address (CORE_ADDR *addr_p);
+  ia64_linux_stopped_by_watchpoint (inferior_ptid)
+extern CORE_ADDR ia64_linux_stopped_by_watchpoint (ptid_t ptid);
 
 #define target_insert_watchpoint(addr, len, type) \
   ia64_linux_insert_watchpoint (inferior_ptid, addr, len, type)
diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
deleted file mode 100644 (file)
index bfa8cf6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: M32R based machine running GNU/Linux
-
-NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o      \
-       m32r-linux-nat.o gcore.o proc-service.o thread-db.o     \
-       linux-nat.o
-
-LOADLIBES= -ldl -rdynamic
diff --git a/gdb/config/m32r/linux.mt b/gdb/config/m32r/linux.mt
deleted file mode 100644 (file)
index 09e5630..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Target: Renesas M32R running GNU/Linux
-TDEPFILES= m32r-tdep.o m32r-linux-tdep.o remote-m32r-sdi.o glibc-tdep.o solib.o solib-svr4.o solib-legacy.o
-DEPRECATED_TM_FILE= config/tm-linux.h
-
-SIM_OBS = remote-sim.o
-SIM = ../sim/m32r/libsim.a
index 9e3e89872821f2f88a753f3975380ae4556aa9e9..69dce24a01c52f3c049feee8f733c9ee09297685 100644 (file)
@@ -2,8 +2,8 @@
 
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o \
-       corelow.o core-aout.o m68klinux-nat.o gcore.o \
-       proc-service.o thread-db.o linux-nat.o
+       corelow.o core-aout.o m68klinux-nat.o linux-proc.o gcore.o \
+       proc-service.o thread-db.o lin-lwp.o linux-nat.o
 
 # The dynamically loaded libthread_db needs access to symbols in the
 # gdb executable.
index 02ef16a2a3cfab9210d73e03c463ff59de0e839f..e9281bcecd7a382d1cdfaa43e744497bd6f3aa08 100644 (file)
@@ -1,2 +1,3 @@
 # Host: OpenBSD/m88k
-NATDEPFILES= fork-child.o inf-child.o m88kbsd-nat.o
+NATDEPFILES= m88kbsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= config/nm-bsd.h
index 44bac251c2c0bdbeae1a723e998d402614ace92e..3fbc3e9dc74dadf64d9728ebf4b14472408ef709 100644 (file)
@@ -1,7 +1,7 @@
 # Host: Linux/MIPS
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o mips-linux-nat.o \
-       thread-db.o proc-service.o gcore.o \
+       thread-db.o lin-lwp.o proc-service.o linux-proc.o gcore.o \
        linux-nat.o
 
 LOADLIBES = -ldl -rdynamic
index fc784e3e833b583ecb6f7ad1a7a410bfa242e057..870e40d34dc76e8d062969ba24d34ed5aa2d65d6 100644 (file)
@@ -68,7 +68,7 @@ extern void lin_thread_get_thread_signals (sigset_t *mask);
 #define CHILD_POST_STARTUP_INFERIOR
 #define CHILD_POST_ATTACH
 #define CHILD_FOLLOW_FORK
-#define DEPRECATED_KILL_INFERIOR
+#define KILL_INFERIOR
 
 #define NATIVE_XFER_AUXV       procfs_xfer_auxv
 #include "auxv.h"              /* Declares it. */
index d4ff5a468e9abd6f77973bf0f84e2d8f84895fab..4a55a13c960bf7b9d71938335a308a39f64f0f2c 100644 (file)
@@ -64,7 +64,7 @@ struct target_waitstatus;
 
 /* Override child_resume in infptrace.c */
 
-#define DEPRECATED_CHILD_RESUME
+#define CHILD_RESUME
 
 /* Override child_thread_alive in intarg.c */
 
index ac2538382704d79b4ef1d9a7f0c14d196917810d..9a727eb67c6849c0000fa082dffe17d2ca98f40a 100644 (file)
@@ -4,7 +4,7 @@
 # stop GDB hanging on HP/UX.  For some reason vfork() hangs yet fork()
 # doesn't ....
 
-MH_CFLAGS = -Dvfork=fork
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
 
 NAT_FILE= nm-hppah.h
 NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infptrace.o somread.o hpread.o somsolib.o
index 1ad2a4e7f96eb4f225badc42c77298ea7267ad8e..b5466ffa1f79b013820d2d30f1948e1d28813e1c 100644 (file)
@@ -4,7 +4,7 @@
 # stop GDB hanging on HP/UX.  For some reason vfork() hangs yet fork()
 # doesn't ....
 
-MH_CFLAGS = -Dvfork=fork
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
 
 NAT_FILE= nm-hppah11.h
 NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o somread.o hpread.o somsolib.o
index 51c9f2c9fb7604ca46e4b8952aa45de8eac7ca20..c59f3fc78b511bc35209c425e051989e96c13776 100644 (file)
@@ -4,7 +4,7 @@
 # stop GDB hanging on HP/UX.  For some reason vfork() hangs yet fork()
 # doesn't ....
 
-MH_CFLAGS = -Dvfork=fork
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
 
 NAT_FILE= nm-hppah11.h
 NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o hpread.o pa64solib.o solib.o
index bc5a00120d417fa1f57c90f9cf9f4adcbf7ea73f..596857c0b9cebec6158598b948647ac96cadfb61 100644 (file)
@@ -2,7 +2,7 @@
 XDEPFILES=
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o gcore.o \
-       core-regset.o hppa-linux-nat.o \
-       proc-service.o thread-db.o linux-nat.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
index a7be1992de54062b4f95ad9c2cb4130a6268e6cc..450a7775c2edc0b729e1495c1daeeb4dce577bc3 100644 (file)
@@ -3,8 +3,8 @@
 XM_CLIBS=
 
 NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o \
-       ppc-linux-nat.o proc-service.o thread-db.o \
+NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \
+       ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \
        gcore.o linux-nat.o
 
 LOADLIBES = -ldl -rdynamic
index 5556886c3ff14e983bea63c0586b5dbb5866fce9..4e7388bf962d57cc8d82bdf30e0f262355f5bcc3 100644 (file)
@@ -1,5 +1,5 @@
 # Host: PowerPC, running NetBSD
-NATDEPFILES= fork-child.o inf-ptrace.o infptrace.o ppcnbsd-nat.o bsd-kvm.o
+NATDEPFILES= fork-child.o inf-child.o inf-ptrace.o infptrace.o ppcnbsd-nat.o bsd-kvm.o
 NAT_FILE= config/nm-nbsd.h
 
 LOADLIBES= -lkvm
index 2c42fc760d82ee882ae63a13f0e6b64246553b1d..b22408a9e4d66d3967348152546e354f3fc4c2f2 100644 (file)
@@ -3,8 +3,8 @@
 XM_CLIBS=
 
 NAT_FILE= nm-ppc64-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o \
-       ppc-linux-nat.o proc-service.o thread-db.o \
+NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \
+       ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \
        gcore.o linux-nat.o
 
 # The PowerPC has severe limitations on TOC size, and uses them even
index 2b5f1908cc183ea1d71aad977246ac4aa5b32a73..3db7bd91f998f60e2f59330c13da0125f920ecd5 100644 (file)
@@ -1,5 +1,5 @@
 # Host: S390, running Linux
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o s390-nat.o \
-       gcore.o thread-db.o proc-service.o linux-nat.o
+       linux-proc.o gcore.o thread-db.o lin-lwp.o proc-service.o linux-nat.o
 LOADLIBES = -ldl -rdynamic
index ec9a31a5c7920afdd50bdf0c072e8a5f63eb4dee..fb491a55c470281798384ed45a4df49f5cb0371b 100644 (file)
@@ -1,5 +1,5 @@
 # Host: FreeBSD/sparc64
 NATDEPFILES= sparc64fbsd-nat.o sparc64-nat.o sparc-nat.o \
-       fork-child.o inf-ptrace.o infptrace.o inftarg.o \
+       fork-child.o infptrace.o inftarg.o \
        solib.o solib-svr4.o solib-legacy.o
 NAT_FILE= nm-fbsd.h
index abd3ed87bea8d7665266ae0f256b48c0f190f5b3..ed68cc78aea287c9d2bb099f5d3b5bff4bd040d5 100644 (file)
@@ -1,10 +1,10 @@
 # Host: GNU/Linux SPARC
 NAT_FILE= nm-linux.h
 NATDEPFILES= sparc-nat.o sparc-sol2-nat.o \
-       corelow.o core-regset.o fork-child.o inf-ptrace.o \
+       corelow.o core-regset.o fork-child.o \
        infptrace.o inftarg.o \
-       proc-service.o thread-db.o \
-       gcore.o linux-nat.o
+       proc-service.o thread-db.o lin-lwp.o \
+       linux-proc.o gcore.o linux-nat.o
 
 # The dynamically loaded libthread_db needs access to symbols in the
 # gdb executable.
index 05a63b03ef816995a3404307d7154ac0d832e1e5..c1472de8de89594ee6b5bb9d10369bbb3d7b3cbc 100644 (file)
@@ -2,9 +2,9 @@
 NAT_FILE= nm-linux.h
 NATDEPFILES= sparc-nat.o sparc64-nat.o sparc-sol2-nat.o sparc64-linux-nat.o \
        corelow.o core-regset.o \
-       fork-child.o inf-ptrace.o infptrace.o inftarg.o \
-       proc-service.o thread-db.o \
-       gcore.o linux-nat.o
+       fork-child.o infptrace.o inftarg.o \
+       proc-service.o thread-db.o lin-lwp.o \
+       linux-proc.o gcore.o linux-nat.o
 
 # The dynamically loaded libthread_db needs access to symbols in the
 # gdb executable.
index 95d4166bc9f8e1c1ff7a71ff39e76f3d7e4f4d29..9ac8cf477d2bdd4991e267dab6ba3fceb29e8e5c 100644 (file)
@@ -1,6 +1,6 @@
 # Host: NetBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       sparc64nbsd-nat.o sparc-nat.o bsd-kvm.o
+NATDEPFILES= sparc64nbsd-nat.o sparc-nat.o bsd-kvm.o \
+       fork-child.o infptrace.o inftarg.o
 NAT_FILE= nm-nbsd.h
 
 LOADLIBES= -lkvm
index 9264eddbf3f1dbdc7a44c0050348d69debc522c6..6d8eb1b3050d5ad48a063b43da1cb8530c1da56f 100644 (file)
@@ -2,4 +2,4 @@
 TDEPFILES= sparc64-tdep.o sparc64nbsd-tdep.o \
        sparc-tdep.o sparcnbsd-tdep.o nbsd-tdep.o \
        corelow.o solib.o solib-svr4.o
-DEPRECATED_TM_FILE= solib.h
+DEPRECATED_TM_FILE= tm-nbsd.h
index cd0067d208853b2fee6355309df02f0120cb4021..8944e60e4830db63c12fc268946b18dce0f1459b 100644 (file)
@@ -1,6 +1,4 @@
 # Host: NetBSD/sparc a.out
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       sparc-nat.o sparcnbsd-nat.o bsd-kvm.o solib-sunos.o
-NAT_FILE= nm-nbsd.h
-
-LOADLIBES= -lkvm
+NATDEPFILES= sparc-nat.o sparcnbsd-nat.o \
+       fork-child.o infptrace.o inftarg.o solib-sunos.o
+NAT_FILE= nm-nbsdaout.h
index d258fccd5149df0245831aa7ef820aafc24cd93c..611a6a4d2adb0b05a5edb8185f8f669b3b1ff74c 100644 (file)
@@ -1,6 +1,6 @@
 # Host: NetBSD/sparc ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       sparc-nat.o sparcnbsd-nat.o bsd-kvm.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
index a24b7e9ad6427923176f8b35883559c55f092837..0dffffcfae89c3cdd4b537b55cea48fd77d8269f 100644 (file)
@@ -1,4 +1,4 @@
 # Target: OpenBSD/sparc
 TDEPFILES= sparc-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o nbsd-tdep.o \
        corelow.o solib.o solib-svr4.o
-DEPRECATED_TM_FILE= solib.h
+DEPRECATED_TM_FILE= tm-nbsd.h
index 8514db18698949a7c1b1b916e02343c643e74851..8f5ef801aaa9da62b70c21d0f2c9fce8322b6c2d 100644 (file)
@@ -2,4 +2,4 @@
 TDEPFILES= sparc64-tdep.o sparc64nbsd-tdep.o sparc64obsd-tdep.o \
        sparc-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o nbsd-tdep.o \
        corelow.o solib.o solib-svr4.o
-DEPRECATED_TM_FILE= solib.h
+DEPRECATED_TM_FILE= tm-nbsd.h
index faf42b5e3d1bc9aa5bf35ae2c06aad6755e9d885..688713530d0fbc9672a5531414ff2357a3f24806 100644 (file)
@@ -1,6 +1,5 @@
 # Host: NetBSD/vax a.out
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       vaxbsd-nat.o bsd-kvm.o \
+NATDEPFILES= vaxbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o \
        solib.o solib-sunos.o
 NAT_FILE= nm-nbsdaout.h
 
index dd9441bab255c98354133547bb107199103aeff9..06dda18f70a47d5d3462aceda372fe8ca04cf701 100644 (file)
@@ -1,5 +1,5 @@
 # Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       vaxbsd-nat.o bsd-kvm.o
+NATDEPFILES= vaxbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= config/nm-nbsd.h
 
 LOADLIBES= -lkvm
index d4d444f79396fb8863146b05fc9a8ad35063031a..416f2c62d14734ebf321eefcfde4dbf8efabd000 100644 (file)
@@ -1,5 +1,5 @@
 # Host: OpenBSD/vax
-NATDEPFILES= fork-child.o inf-ptrace.o \
-       vaxbsd-nat.o bsd-kvm.o
+NATDEPFILES= vaxbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= config/nm-bsd.h
 
 LOADLIBES= -lkvm
index be9c10594165e9bab832a9564772a1aaa0e66728..349fdfd9fac121e7982089620159a2d5e5165a3b 100755 (executable)
@@ -3094,6 +3094,21 @@ else
   enable_tui=yes
 fi
 
+if test x"$enable_tui" = xyes; then
+  if test -d $srcdir/tui; then
+    if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then
+      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
+      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+      CONFIG_ALL="${CONFIG_ALL} all-tui"
+      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
+      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
+      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
+    fi
+  fi
+fi
 
 # Enable gdbtk.
 # Check whether --enable-gdbtk or --disable-gdbtk was given.
@@ -3135,17 +3150,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3139: checking for $ac_hdr" >&5
+echo "configure:3154: 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 3144 "configure"
+#line 3159 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3164: \"$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*
@@ -3175,17 +3190,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3179: checking for $ac_hdr" >&5
+echo "configure:3194: 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 3184 "configure"
+#line 3199 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3204: \"$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*
@@ -3223,17 +3238,17 @@ if test x"$enable_libunwind" = xyes; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3227: checking for $ac_hdr" >&5
+echo "configure:3242: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3232 "configure"
+#line 3247 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3263,17 +3278,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3267: checking for $ac_hdr" >&5
+echo "configure:3282: 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 3272 "configure"
+#line 3287 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3292: \"$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*
@@ -3326,12 +3341,12 @@ fi
 for ac_func in monstartup _mcleanup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3330: checking for $ac_func" >&5
+echo "configure:3345: 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 3335 "configure"
+#line 3350 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3354,7 +3369,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3373: \"$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
@@ -3379,12 +3394,12 @@ fi
 done
 
 echo $ac_n "checking for _etext""... $ac_c" 1>&6
-echo "configure:3383: checking for _etext" >&5
+echo "configure:3398: 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 3388 "configure"
+#line 3403 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 extern char _etext;
@@ -3393,7 +3408,7 @@ int main() {
 free (&_etext);
 ; return 0; }
 EOF
-if { (eval echo configure:3397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var__etext=yes
 else
@@ -3421,19 +3436,19 @@ if test "$enable_profiling" = yes ; then
   CFLAGS="$CFLAGS $PROFILE_CFLAGS"
 
   echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6
-echo "configure:3425: checking whether $CC supports -pg" >&5
+echo "configure:3440: 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 3430 "configure"
+#line 3445 "configure"
 #include "confdefs.h"
 
 int main() {
 int x;
 ; return 0; }
 EOF
-if { (eval echo configure:3437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cc_supports_pg=yes
 else
@@ -3463,7 +3478,7 @@ 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:3467: checking for $ac_word" >&5
+echo "configure:3482: 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
@@ -3504,7 +3519,7 @@ done
 # 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:3508: checking for a BSD compatible install" >&5
+echo "configure:3523: 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
@@ -3557,7 +3572,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3561: checking whether ln -s works" >&5
+echo "configure:3576: 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
@@ -3580,7 +3595,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3584: checking for $ac_word" >&5
+echo "configure:3599: 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
@@ -3612,7 +3627,7 @@ 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:3616: checking for $ac_word" >&5
+echo "configure:3631: 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
@@ -3646,7 +3661,7 @@ test -n "$YACC" || YACC="yacc"
 # 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:3650: checking for $ac_word" >&5
+echo "configure:3665: 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
@@ -3678,7 +3693,7 @@ fi
 # 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:3682: checking for $ac_word" >&5
+echo "configure:3697: 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
@@ -3710,7 +3725,7 @@ fi
 # 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:3714: checking for $ac_word" >&5
+echo "configure:3729: 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
@@ -3744,7 +3759,7 @@ fi
 # 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:3748: checking for $ac_word" >&5
+echo "configure:3763: 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
@@ -3780,7 +3795,7 @@ fi
 
 # 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:3784: checking for main in -lm" >&5
+echo "configure:3799: 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
@@ -3788,14 +3803,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3792 "configure"
+#line 3807 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3814: \"$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
@@ -3828,12 +3843,12 @@ fi
 # 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:3832: checking for wctype" >&5
+echo "configure:3847: 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 3837 "configure"
+#line 3852 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char wctype(); below.  */
@@ -3856,7 +3871,7 @@ wctype();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3875: \"$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
@@ -3874,7 +3889,7 @@ if eval "test \"`echo '$ac_cv_func_'wctype`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:3878: checking for wctype in -lw" >&5
+echo "configure:3893: 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
@@ -3882,7 +3897,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lw  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3886 "configure"
+#line 3901 "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
@@ -3893,7 +3908,7 @@ int main() {
 wctype()
 ; return 0; }
 EOF
-if { (eval echo configure:3897: \"$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*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3926,14 +3941,14 @@ fi
 # Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
 
 echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6
-echo "configure:3930: checking for library containing gethostbyname" >&5
+echo "configure:3945: 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 3937 "configure"
+#line 3952 "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
@@ -3944,7 +3959,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3963: \"$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
@@ -3955,7 +3970,7 @@ rm -f conftest*
 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 3959 "configure"
+#line 3974 "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
@@ -3966,7 +3981,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3985: \"$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
@@ -3990,14 +4005,14 @@ fi
 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
 
 echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6
-echo "configure:3994: checking for library containing socketpair" >&5
+echo "configure:4009: 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 4001 "configure"
+#line 4016 "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
@@ -4008,7 +4023,7 @@ int main() {
 socketpair()
 ; return 0; }
 EOF
-if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4027: \"$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
@@ -4019,7 +4034,7 @@ rm -f conftest*
 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 4023 "configure"
+#line 4038 "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
@@ -4030,7 +4045,7 @@ int main() {
 socketpair()
 ; return 0; }
 EOF
-if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4049: \"$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
@@ -4051,60 +4066,67 @@ else :
   
 fi
 
-# For the TUI, we need enhanced curses functionality.
-#
-# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
-# curses library because the latter might not provide all the
-# functionality we need.  However, this leads to problems on systems
-# where the linker searches /usr/local/lib, but the compiler doesn't
-# search /usr/local/include, if ncurses is installed in /usr/local.  A
-# default installation of ncurses on alpha*-dec-osf* will lead to such
-# a situation.
+# Since GDB uses Readline, we need termcap functionality, so we need
+# to find a library that provides that.  When GDB is configured with
+# the TUI, we need full curses functionality.
 
-echo $ac_n "checking for library containing waddstr""... $ac_c" 1>&6
-echo "configure:4066: checking for library containing waddstr" >&5
-if eval "test \"`echo '$''{'ac_cv_search_waddstr'+set}'`\" = set"; then
+case $host_os in
+  cygwin*)
+    if test -d $srcdir/libtermcap; then
+      LIBS="../libtermcap/libtermcap.a $LIBS"
+      ac_cv_search_tgetent="../libtermcap/libtermcap.a"
+    fi ;;
+  go32* | *djgpp*)
+    ac_cv_search_tgetent="none required"
+    ;;
+  aix*)
+    # Readline prefers curses over termcap on AIX.
+    # ??? Why?
+    
+echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
+echo "configure:4088: 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_waddstr="no"
+ac_cv_search_tgetent="no"
 cat > conftest.$ac_ext <<EOF
-#line 4073 "configure"
+#line 4095 "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 waddstr();
+char tgetent();
 
 int main() {
-waddstr()
+tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_search_waddstr="none required"
+  ac_cv_search_tgetent="none required"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
-test "$ac_cv_search_waddstr" = "no" && for i in ncurses cursesX curses; do
+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 4095 "configure"
+#line 4117 "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 waddstr();
+char tgetent();
 
 int main() {
-waddstr()
+tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4106: \"$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*
-  ac_cv_search_waddstr="-l$i"
+  ac_cv_search_tgetent="-l$i"
 break
 else
   echo "configure: failed program was:" >&5
@@ -4115,40 +4137,28 @@ done
 LIBS="$ac_func_search_save_LIBS"
 fi
 
-echo "$ac_t""$ac_cv_search_waddstr" 1>&6
-if test "$ac_cv_search_waddstr" != "no"; then
-  test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS"
+echo "$ac_t""$ac_cv_search_tgetent" 1>&6
+if test "$ac_cv_search_tgetent" != "no"; then
+  test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS"
   
 else :
   
 fi
-
-# Since GDB uses Readline, we need termcap functionality.  In many
-# cases this will be provided by the curses library, but some systems
-# have a seperate termcap library, or no curses library at all.
-
-case $host_os in
-  cygwin*)
-    if test -d $srcdir/libtermcap; then
-      LIBS="../libtermcap/libtermcap.a $LIBS"
-      ac_cv_search_tgetent="../libtermcap/libtermcap.a"
-    fi ;;
-  go32* | *djgpp*)
-    ac_cv_search_tgetent="none required"
     ;;
 esac
 
-# These are the libraries checked by Readline.
+# Note: We used to check for libtermlib and libterminfo too, but
+# 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:4145: checking for library containing tgetent" >&5
+echo "configure:4155: 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 4152 "configure"
+#line 4162 "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
@@ -4159,7 +4169,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4173: \"$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
@@ -4167,10 +4177,10 @@ else
   cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
-test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo curses ncurses; do
+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 4174 "configure"
+#line 4184 "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
@@ -4181,7 +4191,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4195: \"$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
@@ -4206,6 +4216,152 @@ if test "$ac_cv_search_tgetent" = no; then
   { 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:4236: 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 4243 "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:4254: \"$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 cursesX curses pdcurses; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4265 "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:4276: \"$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:4305: 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 4312 "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:4323: \"$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 4334 "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:4345: \"$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.  #
 # ------------------------- #
@@ -4215,12 +4371,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 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:4219: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4375: 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 4224 "configure"
+#line 4380 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4228,7 +4384,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4253,7 +4409,7 @@ done
 # 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:4257: checking for opendir in -ldir" >&5
+echo "configure:4413: 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
@@ -4261,7 +4417,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4265 "configure"
+#line 4421 "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
@@ -4272,7 +4428,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4432: \"$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
@@ -4294,7 +4450,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4298: checking for opendir in -lx" >&5
+echo "configure:4454: 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
@@ -4302,7 +4458,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4306 "configure"
+#line 4462 "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
@@ -4313,7 +4469,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4473: \"$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
@@ -4336,12 +4492,12 @@ fi
 fi
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:4340: checking whether stat file-mode macros are broken" >&5
+echo "configure:4496: 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 4345 "configure"
+#line 4501 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -4392,12 +4548,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4396: checking for ANSI C header files" >&5
+echo "configure:4552: 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 4401 "configure"
+#line 4557 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4405,7 +4561,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4565: \"$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*
@@ -4422,7 +4578,7 @@ rm -f conftest*
 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 4426 "configure"
+#line 4582 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4440,7 +4596,7 @@ fi
 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 4444 "configure"
+#line 4600 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4461,7 +4617,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4465 "configure"
+#line 4621 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4472,7 +4628,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4499,17 +4655,17 @@ for ac_hdr in link.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4503: checking for $ac_hdr" >&5
+echo "configure:4659: 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 4508 "configure"
+#line 4664 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4669: \"$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*
@@ -4539,17 +4695,17 @@ for ac_hdr in machine/reg.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4543: checking for $ac_hdr" >&5
+echo "configure:4699: 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 4548 "configure"
+#line 4704 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4709: \"$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*
@@ -4579,17 +4735,17 @@ for ac_hdr in nlist.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4583: checking for $ac_hdr" >&5
+echo "configure:4739: 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 4588 "configure"
+#line 4744 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4749: \"$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*
@@ -4619,17 +4775,17 @@ for ac_hdr in poll.h sys/poll.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4623: checking for $ac_hdr" >&5
+echo "configure:4779: 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 4628 "configure"
+#line 4784 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4789: \"$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*
@@ -4659,17 +4815,17 @@ 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:4663: checking for $ac_hdr" >&5
+echo "configure:4819: 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 4668 "configure"
+#line 4824 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4829: \"$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*
@@ -4699,17 +4855,17 @@ for ac_hdr in stddef.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4703: checking for $ac_hdr" >&5
+echo "configure:4859: 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 4708 "configure"
+#line 4864 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4869: \"$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*
@@ -4739,17 +4895,17 @@ for ac_hdr in stdlib.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4743: checking for $ac_hdr" >&5
+echo "configure:4899: 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 4748 "configure"
+#line 4904 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4909: \"$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*
@@ -4779,17 +4935,17 @@ for ac_hdr in stdint.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4783: checking for $ac_hdr" >&5
+echo "configure:4939: 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 4788 "configure"
+#line 4944 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4949: \"$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*
@@ -4819,17 +4975,17 @@ for ac_hdr in string.h memory.h strings.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4823: checking for $ac_hdr" >&5
+echo "configure:4979: 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 4828 "configure"
+#line 4984 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4989: \"$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*
@@ -4859,17 +5015,17 @@ for ac_hdr in sys/fault.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4863: checking for $ac_hdr" >&5
+echo "configure:5019: 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 4868 "configure"
+#line 5024 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5029: \"$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*
@@ -4899,17 +5055,17 @@ for ac_hdr in sys/file.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4903: checking for $ac_hdr" >&5
+echo "configure:5059: 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 4908 "configure"
+#line 5064 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5069: \"$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*
@@ -4939,17 +5095,17 @@ for ac_hdr in sys/filio.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4943: checking for $ac_hdr" >&5
+echo "configure:5099: 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 4948 "configure"
+#line 5104 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5109: \"$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*
@@ -4979,17 +5135,17 @@ for ac_hdr in sys/ioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4983: checking for $ac_hdr" >&5
+echo "configure:5139: 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 4988 "configure"
+#line 5144 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5149: \"$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*
@@ -5019,17 +5175,17 @@ for ac_hdr in sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5023: checking for $ac_hdr" >&5
+echo "configure:5179: 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 5028 "configure"
+#line 5184 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5189: \"$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*
@@ -5059,17 +5215,17 @@ for ac_hdr in sys/proc.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5063: checking for $ac_hdr" >&5
+echo "configure:5219: 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 5068 "configure"
+#line 5224 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5229: \"$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*
@@ -5099,17 +5255,17 @@ for ac_hdr in sys/procfs.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5103: checking for $ac_hdr" >&5
+echo "configure:5259: 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 5108 "configure"
+#line 5264 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5269: \"$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*
@@ -5139,17 +5295,17 @@ for ac_hdr in sys/ptrace.h ptrace.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5143: checking for $ac_hdr" >&5
+echo "configure:5299: 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 5148 "configure"
+#line 5304 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5309: \"$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*
@@ -5179,17 +5335,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5183: checking for $ac_hdr" >&5
+echo "configure:5339: 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 5188 "configure"
+#line 5344 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5349: \"$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*
@@ -5219,17 +5375,17 @@ for ac_hdr in sys/select.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5223: checking for $ac_hdr" >&5
+echo "configure:5379: 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 5228 "configure"
+#line 5384 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5389: \"$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*
@@ -5259,17 +5415,17 @@ for ac_hdr in sys/syscall.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5263: checking for $ac_hdr" >&5
+echo "configure:5419: 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 5268 "configure"
+#line 5424 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5429: \"$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*
@@ -5299,17 +5455,17 @@ for ac_hdr in sys/types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5303: checking for $ac_hdr" >&5
+echo "configure:5459: 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 5308 "configure"
+#line 5464 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5469: \"$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*
@@ -5339,17 +5495,17 @@ for ac_hdr in sys/user.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5343: checking for $ac_hdr" >&5
+echo "configure:5499: 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 5348 "configure"
+#line 5504 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5509: \"$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*
@@ -5379,17 +5535,17 @@ for ac_hdr in sys/wait.h wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5383: checking for $ac_hdr" >&5
+echo "configure:5539: 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 5388 "configure"
+#line 5544 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5549: \"$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*
@@ -5419,17 +5575,17 @@ for ac_hdr in termios.h termio.h sgtty.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5423: checking for $ac_hdr" >&5
+echo "configure:5579: 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 5428 "configure"
+#line 5584 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5589: \"$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*
@@ -5459,17 +5615,17 @@ 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:5463: checking for $ac_hdr" >&5
+echo "configure:5619: 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 5468 "configure"
+#line 5624 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5629: \"$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*
@@ -5512,17 +5668,17 @@ for ac_hdr in curses.h cursesX.h ncurses.h ncurses/ncurses.h term.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5516: checking for $ac_hdr" >&5
+echo "configure:5672: 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 5521 "configure"
+#line 5677 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5682: \"$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*
@@ -5555,17 +5711,17 @@ for ac_hdr in ctype.h time.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5559: checking for $ac_hdr" >&5
+echo "configure:5715: 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 5564 "configure"
+#line 5720 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5725: \"$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*
@@ -5593,12 +5749,12 @@ done
 
 
 echo $ac_n "checking for member st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:5597: checking for member st_blocks in struct stat" >&5
+echo "configure:5753: 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 5602 "configure"
+#line 5758 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5606,7 +5762,7 @@ int main() {
 struct stat st; (void) st.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:5610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_stat_with_st_blocks_member=yes
 else
@@ -5634,12 +5790,12 @@ for ac_func in getopt
 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:5638: checking whether $ac_func is declared" >&5
+echo "configure:5794: 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 5643 "configure"
+#line 5799 "configure"
 #include "confdefs.h"
 #undef $ac_tr_decl
 #define $ac_tr_decl 1
@@ -5651,7 +5807,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:5655: \"$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*
   eval "gcc_cv_have_decl_$ac_func=yes"
 else
@@ -5688,12 +5844,12 @@ fi
 # ------------------ #
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5692: checking return type of signal handlers" >&5
+echo "configure:5848: 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 5697 "configure"
+#line 5853 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -5710,7 +5866,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -5734,12 +5890,12 @@ EOF
 # ------------------------------------- #
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5738: checking for working const" >&5
+echo "configure:5894: 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 5743 "configure"
+#line 5899 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -5788,7 +5944,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -5809,21 +5965,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5813: checking for inline" >&5
+echo "configure:5969: 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 5820 "configure"
+#line 5976 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:5827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -5856,19 +6012,19 @@ esac
 # 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:5860: checking for working alloca.h" >&5
+echo "configure:6016: 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 5865 "configure"
+#line 6021 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6028: \"$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
@@ -5889,12 +6045,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5893: checking for alloca" >&5
+echo "configure:6049: 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 5898 "configure"
+#line 6054 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -5922,7 +6078,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:5926: \"$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*
   ac_cv_func_alloca_works=yes
 else
@@ -5954,12 +6110,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5958: checking whether alloca needs Cray hooks" >&5
+echo "configure:6114: 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 5963 "configure"
+#line 6119 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -5984,12 +6140,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 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:5988: checking for $ac_func" >&5
+echo "configure:6144: 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 5993 "configure"
+#line 6149 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6012,7 +6168,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6172: \"$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
@@ -6039,7 +6195,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6043: checking stack direction for C alloca" >&5
+echo "configure:6199: 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
@@ -6047,7 +6203,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 6051 "configure"
+#line 6207 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -6066,7 +6222,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:6070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6226: \"$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
@@ -6091,17 +6247,17 @@ 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:6095: checking for $ac_hdr" >&5
+echo "configure:6251: 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 6100 "configure"
+#line 6256 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6261: \"$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*
@@ -6130,12 +6286,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6134: checking for $ac_func" >&5
+echo "configure:6290: 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 6139 "configure"
+#line 6295 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6158,7 +6314,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6318: \"$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
@@ -6183,7 +6339,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6187: checking for working mmap" >&5
+echo "configure:6343: 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
@@ -6191,7 +6347,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6195 "configure"
+#line 6351 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6331,7 +6487,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6491: \"$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
@@ -6354,12 +6510,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6358: checking for pid_t" >&5
+echo "configure:6514: 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 6363 "configure"
+#line 6519 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6388,17 +6544,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6392: checking for vfork.h" >&5
+echo "configure:6548: 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 6397 "configure"
+#line 6553 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6558: \"$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*
@@ -6423,18 +6579,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6427: checking for working vfork" >&5
+echo "configure:6583: 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:6433: checking for vfork" >&5
+echo "configure:6589: 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 6438 "configure"
+#line 6594 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -6457,7 +6613,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6617: \"$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
@@ -6479,7 +6635,7 @@ fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 else
   cat > conftest.$ac_ext <<EOF
-#line 6483 "configure"
+#line 6639 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -6574,7 +6730,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:6578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6734: \"$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
@@ -6599,12 +6755,12 @@ fi
 for ac_func in canonicalize_file_name realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6603: checking for $ac_func" >&5
+echo "configure:6759: 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 6608 "configure"
+#line 6764 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6627,7 +6783,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6787: \"$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
@@ -6654,12 +6810,12 @@ done
 for ac_func in poll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6658: checking for $ac_func" >&5
+echo "configure:6814: 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 6663 "configure"
+#line 6819 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6682,7 +6838,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6842: \"$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
@@ -6709,12 +6865,12 @@ done
 for ac_func in pread64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6713: checking for $ac_func" >&5
+echo "configure:6869: 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 6718 "configure"
+#line 6874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6737,7 +6893,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6897: \"$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
@@ -6764,12 +6920,12 @@ done
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6768: checking for $ac_func" >&5
+echo "configure:6924: 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 6773 "configure"
+#line 6929 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6792,7 +6948,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6952: \"$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
@@ -6819,12 +6975,12 @@ done
 for ac_func in setpgid setpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6823: checking for $ac_func" >&5
+echo "configure:6979: 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 6828 "configure"
+#line 6984 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6847,7 +7003,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7007: \"$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
@@ -6874,12 +7030,12 @@ done
 for ac_func in sigaction sigprocmask sigsetmask
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6878: checking for $ac_func" >&5
+echo "configure:7034: 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 6883 "configure"
+#line 7039 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6902,7 +7058,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7062: \"$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
@@ -6929,12 +7085,12 @@ done
 for ac_func in socketpair
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6933: checking for $ac_func" >&5
+echo "configure:7089: 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 6938 "configure"
+#line 7094 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6957,7 +7113,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7117: \"$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
@@ -6984,12 +7140,12 @@ done
 for ac_func in syscall
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6988: checking for $ac_func" >&5
+echo "configure:7144: 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 6993 "configure"
+#line 7149 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7012,7 +7168,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7172: \"$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
@@ -7039,67 +7195,12 @@ done
 for ac_func in ttrace
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7043: 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 7048 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.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 $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:7071: \"$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
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_func in wborder
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7098: checking for $ac_func" >&5
+echo "configure:7199: 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 7103 "configure"
+#line 7204 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7122,7 +7223,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7227: \"$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
@@ -7165,12 +7266,12 @@ for ac_func in ptrace
 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:7169: checking whether $ac_func is declared" >&5
+echo "configure:7270: 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 7174 "configure"
+#line 7275 "configure"
 #include "confdefs.h"
 #undef $ac_tr_decl
 #define $ac_tr_decl 1
@@ -7182,7 +7283,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "gcc_cv_have_decl_$ac_func=yes"
 else
@@ -7218,19 +7319,19 @@ fi
 
 # Check return type.
 echo $ac_n "checking return type of ptrace""... $ac_c" 1>&6
-echo "configure:7222: checking return type of ptrace" >&5
+echo "configure:7323: checking return type of ptrace" >&5
 if eval "test \"`echo '$''{'gdb_cv_func_ptrace_ret'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7227 "configure"
+#line 7328 "configure"
 #include "confdefs.h"
 $gdb_ptrace_headers
 int main() {
 extern int ptrace ();
 ; return 0; }
 EOF
-if { (eval echo configure:7234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_func_ptrace_ret='int'
 else
@@ -7249,7 +7350,7 @@ EOF
 
 # Check argument types.
 echo $ac_n "checking types of arguments for ptrace""... $ac_c" 1>&6
-echo "configure:7253: checking types of arguments for ptrace" >&5
+echo "configure:7354: checking types of arguments for ptrace" >&5
 if eval "test \"`echo '$''{'gdb_cv_func_ptrace_args'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7259,7 +7360,7 @@ for gdb_arg1 in 'int' 'long'; do
   for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long'; do
    for gdb_arg4 in 'int' 'long'; do
      cat > conftest.$ac_ext <<EOF
-#line 7263 "configure"
+#line 7364 "configure"
 #include "confdefs.h"
 $gdb_ptrace_headers
 int main() {
@@ -7269,7 +7370,7 @@ extern $gdb_cv_func_ptrace_ret
 
 ; return 0; }
 EOF
-if { (eval echo configure:7273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
     break 4;
@@ -7280,7 +7381,7 @@ fi
 rm -f conftest*
     for gdb_arg5 in 'int *' 'int' 'long'; do
      cat > conftest.$ac_ext <<EOF
-#line 7284 "configure"
+#line 7385 "configure"
 #include "confdefs.h"
 $gdb_ptrace_headers
 int main() {
@@ -7290,7 +7391,7 @@ extern $gdb_cv_func_ptrace_ret
 
 ; return 0; }
 EOF
-if { (eval echo configure:7294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
@@ -7328,7 +7429,7 @@ fi
 
 if test "$cross_compiling" = no; then
   echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7332: checking whether setpgrp takes no argument" >&5
+echo "configure:7433: 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
@@ -7336,7 +7437,7 @@ else
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7340 "configure"
+#line 7441 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -7356,7 +7457,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7461: \"$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
@@ -7381,12 +7482,12 @@ fi
 
 else
   echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7385: checking whether setpgrp takes no argument" >&5
+echo "configure:7486: 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 7390 "configure"
+#line 7491 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -7400,7 +7501,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_setpgrp_void=no
 else
@@ -7424,12 +7525,12 @@ fi
 # 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:7428: checking for sigsetjmp" >&5
+echo "configure:7529: 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 7433 "configure"
+#line 7534 "configure"
 #include "confdefs.h"
 
 #include <setjmp.h>
@@ -7438,7 +7539,7 @@ int main() {
 sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
 ; return 0; }
 EOF
-if { (eval echo configure:7442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_func_sigsetjmp=yes
 else
@@ -7464,12 +7565,12 @@ gdb_use_included_regex=yes
 # 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:7468: checking for GNU regex" >&5
+echo "configure:7569: 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 7473 "configure"
+#line 7574 "configure"
 #include "confdefs.h"
 #include <gnu-versions.h>
 int main() {
@@ -7479,7 +7580,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_gnu_regex=yes
 else
@@ -7513,12 +7614,12 @@ 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:7517: checking for td_pcb in struct thread" >&5
+echo "configure:7618: 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 7522 "configure"
+#line 7623 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -7526,7 +7627,7 @@ int main() {
 struct thread td; td.td_pcb;
 ; return 0; }
 EOF
-if { (eval echo configure:7530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_thread_td_pcb=yes
 else
@@ -7548,12 +7649,12 @@ fi
 
 # See if <sys/lwp.h> defines `struct lwp`.
 echo $ac_n "checking for struct lwp""... $ac_c" 1>&6
-echo "configure:7552: checking for struct lwp" >&5
+echo "configure:7653: checking for struct lwp" >&5
 if eval "test \"`echo '$''{'gdb_cv_struct_lwp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7557 "configure"
+#line 7658 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 #include <sys/lwp.h>
@@ -7561,7 +7662,7 @@ int main() {
 struct lwp l;
 ; return 0; }
 EOF
-if { (eval echo configure:7565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_lwp=yes
 else
@@ -7583,12 +7684,12 @@ 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:7587: checking for struct reg in machine/reg.h" >&5
+echo "configure:7688: 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 7592 "configure"
+#line 7693 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <machine/reg.h>
@@ -7596,7 +7697,7 @@ int main() {
 struct reg r;
 ; return 0; }
 EOF
-if { (eval echo configure:7600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg=yes
 else
@@ -7619,19 +7720,19 @@ fi
 # 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:7623: checking for r_fs in struct reg" >&5
+echo "configure:7724: 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 7628 "configure"
+#line 7729 "configure"
 #include "confdefs.h"
 #include <machine/reg.h>
 int main() {
 struct reg r; r.r_fs;
 ; return 0; }
 EOF
-if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg_r_fs=yes
 else
@@ -7651,19 +7752,19 @@ EOF
 
 fi
 echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:7655: checking for r_gs in struct reg" >&5
+echo "configure:7756: 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 7660 "configure"
+#line 7761 "configure"
 #include "confdefs.h"
 #include <machine/reg.h>
 int main() {
 struct reg r; r.r_gs;
 ; return 0; }
 EOF
-if { (eval echo configure:7667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg_r_gs=yes
 else
@@ -7685,19 +7786,19 @@ fi
 
 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
 echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:7689: checking for PTRACE_GETREGS" >&5
+echo "configure:7790: 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 7694 "configure"
+#line 7795 "configure"
 #include "confdefs.h"
 #include <sys/ptrace.h>
 int main() {
 PTRACE_GETREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_ptrace_getregs=yes
 else
@@ -7719,19 +7820,19 @@ fi
 
 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
 echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:7723: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:7824: 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 7728 "configure"
+#line 7829 "configure"
 #include "confdefs.h"
 #include <sys/ptrace.h>
 int main() {
 PTRACE_GETFPXREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_ptrace_getfpxregs=yes
 else
@@ -7753,12 +7854,12 @@ fi
 
 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
 echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:7757: checking for PT_GETDBREGS" >&5
+echo "configure:7858: 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 7762 "configure"
+#line 7863 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -7766,7 +7867,7 @@ int main() {
 PT_GETDBREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_pt_getdbregs=yes
 else
@@ -7788,12 +7889,12 @@ fi
 
 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
 echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:7792: checking for PT_GETXMMREGS" >&5
+echo "configure:7893: 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 7797 "configure"
+#line 7898 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -7801,7 +7902,7 @@ int main() {
 PT_GETXMMREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_pt_getxmmregs=yes
 else
@@ -7824,19 +7925,19 @@ fi
 # 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:7828: checking for uintptr_t in stdint.h" >&5
+echo "configure:7929: 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 7833 "configure"
+#line 7934 "configure"
 #include "confdefs.h"
 #include <stdint.h>
 int main() {
 uintptr_t foo = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:7840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_uintptr_t=yes
 else
@@ -7857,12 +7958,12 @@ EOF
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:7861: checking whether malloc must be declared" >&5
+echo "configure:7962: 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 7866 "configure"
+#line 7967 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7883,7 +7984,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:7887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -7904,12 +8005,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:7908: checking whether realloc must be declared" >&5
+echo "configure:8009: 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 7913 "configure"
+#line 8014 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7930,7 +8031,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:7934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -7951,12 +8052,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:7955: checking whether free must be declared" >&5
+echo "configure:8056: 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 7960 "configure"
+#line 8061 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7977,7 +8078,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:7981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -7998,12 +8099,12 @@ EOF
 fi
 
 echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:8002: checking whether strerror must be declared" >&5
+echo "configure:8103: 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 8007 "configure"
+#line 8108 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8024,7 +8125,7 @@ int main() {
 char *(*pfn) = (char *(*)) strerror
 ; return 0; }
 EOF
-if { (eval echo configure:8028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strerror=no
 else
@@ -8045,12 +8146,12 @@ EOF
 fi
 
 echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:8049: checking whether strdup must be declared" >&5
+echo "configure:8150: 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 8054 "configure"
+#line 8155 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8071,7 +8172,7 @@ int main() {
 char *(*pfn) = (char *(*)) strdup
 ; return 0; }
 EOF
-if { (eval echo configure:8075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strdup=no
 else
@@ -8092,12 +8193,12 @@ EOF
 fi
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:8096: checking whether strstr must be declared" >&5
+echo "configure:8197: 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 8101 "configure"
+#line 8202 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8118,7 +8219,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:8122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -8139,12 +8240,12 @@ EOF
 fi
 
 echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:8143: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:8244: 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 8148 "configure"
+#line 8249 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8165,7 +8266,7 @@ int main() {
 char *(*pfn) = (char *(*)) canonicalize_file_name
 ; return 0; }
 EOF
-if { (eval echo configure:8169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_canonicalize_file_name=no
 else
@@ -8191,9 +8292,9 @@ fi
 # could be expunged. --jsm 1999-03-22
 
 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:8195: checking for HPUX save_state structure" >&5
+echo "configure:8296: checking for HPUX save_state structure" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8197 "configure"
+#line 8298 "configure"
 #include "confdefs.h"
 #include <machine/save_state.h>
 EOF
@@ -8208,7 +8309,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 8212 "configure"
+#line 8313 "configure"
 #include "confdefs.h"
 #include <machine/save_state.h>
 EOF
@@ -8285,12 +8386,12 @@ 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:8289: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:8390: 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 8294 "configure"
+#line 8395 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8299,7 +8400,7 @@ int main() {
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -8321,12 +8422,12 @@ EOF
  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:8325: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:8426: 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 8330 "configure"
+#line 8431 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8335,7 +8436,7 @@ int main() {
 prrun_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prrun_t=yes
 else
@@ -8357,12 +8458,12 @@ EOF
  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:8361: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:8462: 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 8366 "configure"
+#line 8467 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8371,7 +8472,7 @@ int main() {
 gregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_gregset_t=yes
 else
@@ -8393,12 +8494,12 @@ EOF
  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:8397: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:8498: 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 8402 "configure"
+#line 8503 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8407,7 +8508,7 @@ int main() {
 fpregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_fpregset_t=yes
 else
@@ -8429,12 +8530,12 @@ EOF
  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:8433: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:8534: 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 8438 "configure"
+#line 8539 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8443,7 +8544,7 @@ int main() {
 prgregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prgregset_t=yes
 else
@@ -8465,12 +8566,12 @@ EOF
  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:8469: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:8570: 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 8474 "configure"
+#line 8575 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8479,7 +8580,7 @@ int main() {
 prfpregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prfpregset_t=yes
 else
@@ -8501,12 +8602,12 @@ EOF
  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:8505: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:8606: 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 8510 "configure"
+#line 8611 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8515,7 +8616,7 @@ int main() {
 prgregset32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prgregset32_t=yes
 else
@@ -8537,12 +8638,12 @@ EOF
  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:8541: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:8642: 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 8546 "configure"
+#line 8647 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8551,7 +8652,7 @@ int main() {
 prfpregset32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
 else
@@ -8573,12 +8674,12 @@ EOF
  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:8577: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:8678: 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 8582 "configure"
+#line 8683 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8587,7 +8688,7 @@ int main() {
 lwpid_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpid_t=yes
 else
@@ -8609,12 +8710,12 @@ EOF
  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:8613: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:8714: 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 8618 "configure"
+#line 8719 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8623,7 +8724,7 @@ int main() {
 psaddr_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psaddr_t=yes
 else
@@ -8645,12 +8746,12 @@ EOF
  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:8649: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:8750: 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 8654 "configure"
+#line 8755 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8659,7 +8760,7 @@ int main() {
 prsysent_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prsysent_t=yes
 else
@@ -8681,12 +8782,12 @@ EOF
  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:8685: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:8786: 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 8690 "configure"
+#line 8791 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8695,7 +8796,7 @@ int main() {
 pr_sigset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
 else
@@ -8717,12 +8818,12 @@ EOF
  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:8721: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:8822: 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 8726 "configure"
+#line 8827 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8731,7 +8832,7 @@ int main() {
 pr_sigaction64_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
 else
@@ -8753,12 +8854,12 @@ EOF
  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:8757: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:8858: 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 8762 "configure"
+#line 8863 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8767,7 +8868,7 @@ int main() {
 pr_siginfo64_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
 else
@@ -8794,7 +8895,7 @@ EOF
         
   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:8798: checking whether prfpregset_t type is broken" >&5
+echo "configure:8899: 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
@@ -8802,7 +8903,7 @@ else
   gdb_cv_prfpregset_t_broken=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8806 "configure"
+#line 8907 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
        int main ()
@@ -8812,7 +8913,7 @@ else
          return 0;
        }
 EOF
-if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8917: \"$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
@@ -8837,12 +8938,12 @@ EOF
 
   
   echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8841: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:8942: 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 8846 "configure"
+#line 8947 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 #include <sys/types.h>
@@ -8855,7 +8956,7 @@ int main() {
   
 ; return 0; }
 EOF
-if { (eval echo configure:8859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_procfs_piocset=yes
 else
@@ -8879,19 +8980,19 @@ fi
 if test ${host} = ${target} ; then
     
   echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8883: checking for member l_addr in struct link_map" >&5
+echo "configure:8984: 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 8888 "configure"
+#line 8989 "configure"
 #include "confdefs.h"
 #include <link.h>
 int main() {
 struct link_map lm; (void) lm.l_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map_with_l_members=yes
 else
@@ -8913,12 +9014,12 @@ EOF
 
     
   echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8917: checking for member lm_addr in struct link_map" >&5
+echo "configure:9018: 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 8922 "configure"
+#line 9023 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <link.h>
@@ -8926,7 +9027,7 @@ int main() {
 struct link_map lm; (void) lm.lm_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map_with_lm_members=yes
 else
@@ -8948,12 +9049,12 @@ EOF
 
     
   echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:8952: checking for member som_addr in struct so_map" >&5
+echo "configure:9053: 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 8957 "configure"
+#line 9058 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_NLIST_H
@@ -8964,7 +9065,7 @@ int main() {
 struct so_map lm; (void) lm.som_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_so_map_with_som_members=yes
 else
@@ -8986,12 +9087,12 @@ EOF
 
     
   echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:8990: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:9091: 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 8995 "configure"
+#line 9096 "configure"
 #include "confdefs.h"
 #define _SYSCALL32
 #include <sys/link.h>
@@ -8999,7 +9100,7 @@ int main() {
 struct link_map32 l;
 ; return 0; }
 EOF
-if { (eval echo configure:9003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map32=yes
 else
@@ -9026,12 +9127,12 @@ fi
 
 
 echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:9030: checking for long long support in compiler" >&5
+echo "configure:9131: 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 9035 "configure"
+#line 9136 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -9041,7 +9142,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_c_long_long=yes
 else
@@ -9063,7 +9164,7 @@ fi
 
 
 echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:9067: checking for long long support in printf" >&5
+echo "configure:9168: 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
@@ -9071,7 +9172,7 @@ else
   gdb_cv_printf_has_long_long=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9075 "configure"
+#line 9176 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -9085,7 +9186,7 @@ int main () {
   return (strcmp ("0x0123456789abcdef", buf));
 }
 EOF
-if { (eval echo configure:9089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9190: \"$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
@@ -9109,19 +9210,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
 
 
 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:9113: checking for long double support in compiler" >&5
+echo "configure:9214: 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 9118 "configure"
+#line 9219 "configure"
 #include "confdefs.h"
 
 int main() {
 long double foo;
 ; return 0; }
 EOF
-if { (eval echo configure:9125: \"$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*
   ac_cv_c_long_double=yes
 else
@@ -9143,7 +9244,7 @@ fi
 
 
 echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:9147: checking for long double support in printf" >&5
+echo "configure:9248: 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
@@ -9151,7 +9252,7 @@ else
   gdb_cv_printf_has_long_double=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9155 "configure"
+#line 9256 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -9161,7 +9262,7 @@ int main () {
   return (strncmp ("3.14159", buf, 7));
 }
 EOF
-if { (eval echo configure:9165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9266: \"$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
@@ -9185,7 +9286,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
 
 
 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:9189: checking for long double support in scanf" >&5
+echo "configure:9290: 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
@@ -9193,7 +9294,7 @@ else
   gdb_cv_scanf_has_long_double=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9197 "configure"
+#line 9298 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -9203,7 +9304,7 @@ int main () {
   return !(f > 3.14159 && f < 3.14160);
 }
 EOF
-if { (eval echo configure:9207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9308: \"$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
@@ -9228,7 +9329,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
 case ${host_os} in
 aix*)
   echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:9232: checking for -bbigtoc option" >&5
+echo "configure:9333: checking for -bbigtoc option" >&5
 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9242,14 +9343,14 @@ else
 
     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
     cat > conftest.$ac_ext <<EOF
-#line 9246 "configure"
+#line 9347 "configure"
 #include "confdefs.h"
 
 int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:9253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -9273,7 +9374,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
    case ${host_os} in
    hpux*)
       echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:9277: checking for HPUX/OSF thread support" >&5
+echo "configure:9378: 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
@@ -9296,7 +9397,7 @@ EOF
       # 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:9300: checking for Solaris thread debugging library" >&5
+echo "configure:9401: 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
@@ -9306,7 +9407,7 @@ EOF
          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:9310: checking for dlopen in -ldl" >&5
+echo "configure:9411: 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
@@ -9314,7 +9415,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9318 "configure"
+#line 9419 "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
@@ -9325,7 +9426,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9430: \"$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
@@ -9357,17 +9458,17 @@ fi
             # 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:9361: checking for the ld -export-dynamic flag" >&5
+echo "configure:9462: checking for the ld -export-dynamic flag" >&5
             LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
             cat > conftest.$ac_ext <<EOF
-#line 9364 "configure"
+#line 9465 "configure"
 #include "confdefs.h"
 
 int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   found=yes
 else
@@ -9386,13 +9487,13 @@ rm -f conftest*
         # 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:9390: checking if <proc_service.h> is old" >&5
+echo "configure:9491: 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 9396 "configure"
+#line 9497 "configure"
 #include "confdefs.h"
 
                #include <proc_service.h>
@@ -9403,7 +9504,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_proc_service_is_old=no
 else
@@ -9429,12 +9530,12 @@ EOF
       ;;
    aix*)
       echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6
-echo "configure:9433: checking for AiX thread debugging library" >&5
+echo "configure:9534: 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 9438 "configure"
+#line 9539 "configure"
 #include "confdefs.h"
 #include <sys/pthdebug.h>
 int main() {
@@ -9443,7 +9544,7 @@ int main() {
                                     #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_aix_thread_debug=yes
 else
@@ -9468,19 +9569,19 @@ fi
 
 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:9472: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+echo "configure:9573: 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 9477 "configure"
+#line 9578 "configure"
 #include "confdefs.h"
 #include <thread_db.h>
 int main() {
 int i = TD_NOTALLOC;
 ; return 0; }
 EOF
-if { (eval echo configure:9484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_thread_db_h_has_td_notalloc=yes
 else
@@ -9505,19 +9606,19 @@ fi
 
 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:9509: checking whether <sys/syscall.h> has __NR_tkill" >&5
+echo "configure:9610: 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 9514 "configure"
+#line 9615 "configure"
 #include "confdefs.h"
 #include <sys/syscall.h>
 int main() {
 int i = __NR_tkill;
 ; return 0; }
 EOF
-if { (eval echo configure:9521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_sys_syscall_h_has_tkill=yes
 else
@@ -9629,7 +9730,7 @@ WERROR_CFLAGS=""
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
 then
     echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:9633: checking compiler warning flags" >&5
+echo "configure:9734: 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
@@ -9639,14 +9740,14 @@ echo "configure:9633: checking compiler warning flags" >&5
            saved_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS $w"
            cat > conftest.$ac_ext <<EOF
-#line 9643 "configure"
+#line 9744 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   WARN_CFLAGS="${WARN_CFLAGS} $w"
 else
@@ -9664,12 +9765,12 @@ fi
 
 # In the Cygwin environment, we need some additional flags.
 echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:9668: checking for cygwin" >&5
+echo "configure:9769: 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 9673 "configure"
+#line 9774 "configure"
 #include "confdefs.h"
 
 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -9754,7 +9855,7 @@ if test "${with_tclconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:9758: checking for Tcl configuration" >&5
+echo "configure:9859: 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
@@ -9863,7 +9964,7 @@ if test "${with_tkconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:9867: checking for Tk configuration" >&5
+echo "configure:9968: 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
@@ -9965,7 +10066,7 @@ fi
 
 no_tcl=true
 echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:9969: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:10070: 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"
 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:10035: checking for tclInt.h" >&5
+echo "configure:10136: 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 10040 "configure"
+#line 10141 "configure"
 #include "confdefs.h"
 #include <tclInt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10146: \"$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*
@@ -10101,7 +10202,7 @@ fi
 #
 no_tk=true
 echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:10105: checking for Tk private headers" >&5
+echo "configure:10206: 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"
 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:10171: checking for tk.h" >&5
+echo "configure:10272: 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 10176 "configure"
+#line 10277 "configure"
 #include "confdefs.h"
 #include <tk.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10282: \"$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*
@@ -10223,7 +10324,7 @@ fi
 
           
 echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:10227: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:10328: 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
@@ -10246,7 +10347,7 @@ fi
 
           
 echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:10250: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:10351: 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
@@ -10294,7 +10395,7 @@ if test "${with_itclconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:10298: checking for Itcl configuration" >&5
+echo "configure:10399: 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
@@ -10397,7 +10498,7 @@ if test "${with_itkconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:10401: checking for Itk configuration" >&5
+echo "configure:10502: 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
@@ -10539,7 +10640,7 @@ fi
 # 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:10543: checking for X" >&5
+echo "configure:10644: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -10601,12 +10702,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 10605 "configure"
+#line 10706 "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:10610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10711: \"$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*
@@ -10675,14 +10776,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10679 "configure"
+#line 10780 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:10686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10787: \"$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.
@@ -10769,26 +10870,7 @@ else
 fi
 
 
-# Check whether we should enable the TUI, but only do so if we really
-# can.
-if test x"$enable_tui" = xyes; then
-  if test -d $srcdir/tui; then
-    if test "$ac_cv_search_waddstr" != no; then
-      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
-      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
-      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
-      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
-      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
-      CONFIG_ALL="${CONFIG_ALL} all-tui"
-      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
-      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
-      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
-    else
-      echo "configure: warning: no enhanced curses library found; disabling TUI" 1>&2
-    fi
-  fi
-fi
-
 # Unlike the sim directory, whether a simulator is linked is controlled by 
 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.  
 # This code just checks for a few cases where we'd like to ignore those
 
 
 frags=
-if test "${target}" = "${host}"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; }
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
+if test ! -f ${host_makefile_frag}; then
+    # When building a native debuger the .mh file containing things
+    # like NATDEPFILES is needed.  Cross debuggers don't need .mh
+    # since it no longer contains anything useful.
+    if test "${target}" = "${host}"; then
+       { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; }
+    else
+       host_makefile_frag=/dev/null
+    fi
 fi
+frags="$frags $host_makefile_frag"
 
 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
 if test ! -f ${target_makefile_frag}; then
-  { echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; }
+{ echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; }
 fi
 frags="$frags $target_makefile_frag"
 
@@ -10924,7 +11009,7 @@ fi
 # 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:10928: checking whether gdbserver is supported on this host" >&5
+echo "configure:11013: 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
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:11001: checking for Cygwin environment" >&5
+echo "configure:11086: 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 11006 "configure"
+#line 11091 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -11013,7 +11098,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:11017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -11030,19 +11115,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:11034: checking for mingw32 environment" >&5
+echo "configure:11119: 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 11039 "configure"
+#line 11124 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:11046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -11061,7 +11146,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:11065: checking for executable suffix" >&5
+echo "configure:11150: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11071,10 +11156,10 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:11075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:11160: \"$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
@@ -11113,7 +11198,7 @@ fi
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:11117: checking for iconv" >&5
+echo "configure:11202: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11121,7 +11206,7 @@ else
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 11125 "configure"
+#line 11210 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -11131,7 +11216,7 @@ iconv_t cd = iconv_open("","");
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:11135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -11143,7 +11228,7 @@ rm -f conftest*
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 11147 "configure"
+#line 11232 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -11153,7 +11238,7 @@ iconv_t cd = iconv_open("","");
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:11157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11242: \"$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
@@ -11174,13 +11259,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:11178: checking for iconv declaration" >&5
+echo "configure:11263: 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 11184 "configure"
+#line 11269 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -11199,7 +11284,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
@@ -11761,6 +11846,14 @@ nativefile=$nativefile
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 
+if test "${nativefile}" = ""; then
+        < Makefile \
+        sed -e '/^NATDEPFILES[         ]*=.*\\$/,/[^\\]$/s/^/# /' \
+            -e '/^NATDEPFILES[         ]*=/s/^/# /' \
+        | sed -e '/^\(NATDEPFILES[     ]*[+]=[         ]*\)/s//# \1/' \
+       > Makefile.tem
+mv -f Makefile.tem Makefile
+fi
 
 sed -e '/^DEPRECATED_TM_FILE[  ]*=/s,^DEPRECATED_TM_FILE[      ]*=[    ]*,&config/'"${gdb_target_cpu}"'/,
 /^XM_FILE[     ]*=/s,^XM_FILE[         ]*=[    ]*,&config/'"${gdb_host_cpu}"'/,
index fad4362ed4acd8ae271f9d54aa4bdfdc663bb155..81be74b8d491defc4a8e9e933ec35603ae3f5c2e 100644 (file)
@@ -193,6 +193,21 @@ AC_ARG_ENABLE(tui,
     *)
       AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
   esac],enable_tui=yes)
+if test x"$enable_tui" = xyes; then
+  if test -d $srcdir/tui; then
+    if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then
+      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
+      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+      CONFIG_ALL="${CONFIG_ALL} all-tui"
+      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
+      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
+      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
+    fi
+  fi
+fi
 
 # Enable gdbtk.
 AC_ARG_ENABLE(gdbtk,
@@ -317,20 +332,9 @@ AC_SEARCH_LIBS(gethostbyname, nsl)
 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
 AC_SEARCH_LIBS(socketpair, socket)
 
-# For the TUI, we need enhanced curses functionality.
-#
-# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
-# curses library because the latter might not provide all the
-# functionality we need.  However, this leads to problems on systems
-# where the linker searches /usr/local/lib, but the compiler doesn't
-# search /usr/local/include, if ncurses is installed in /usr/local.  A
-# default installation of ncurses on alpha*-dec-osf* will lead to such
-# a situation.
-AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
-
-# Since GDB uses Readline, we need termcap functionality.  In many
-# cases this will be provided by the curses library, but some systems
-# have a seperate termcap library, or no curses library at all.
+# Since GDB uses Readline, we need termcap functionality, so we need
+# to find a library that provides that.  When GDB is configured with
+# the TUI, we need full curses functionality.
 
 case $host_os in
   cygwin*)
@@ -341,15 +345,47 @@ case $host_os in
   go32* | *djgpp*)
     ac_cv_search_tgetent="none required"
     ;;
+  aix*)
+    # Readline prefers curses over termcap on AIX.
+    # ??? Why?
+    AC_SEARCH_LIBS(tgetent, [tinfo ncurses curses termcap])
+    ;;
 esac
 
-# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
+# Note: We used to check for libtermlib and libterminfo too, but
+# Readline doesn't, so I think we're safe with leaving them out.
+AC_SEARCH_LIBS(tgetent, [termcap tinfo ncurses Hcurses curses])
 
 if test "$ac_cv_search_tgetent" = no; then
   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 cursesX 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.  #
 # ------------------------- #
@@ -448,7 +484,6 @@ AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
 AC_CHECK_FUNCS(socketpair)
 AC_CHECK_FUNCS(syscall)
 AC_CHECK_FUNCS(ttrace)
-AC_CHECK_FUNCS(wborder)
 
 # Check the return and argument types of ptrace.  No canned test for
 # this, so roll our own.
@@ -1345,26 +1380,7 @@ AC_SUBST(GDBTK_SRC_DIR)
 
 AC_PATH_X
 
-# Check whether we should enable the TUI, but only do so if we really
-# can.
-if test x"$enable_tui" = xyes; then
-  if test -d $srcdir/tui; then
-    if test "$ac_cv_search_waddstr" != no; then
-      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
-      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
-      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
-      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
-      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
-      CONFIG_ALL="${CONFIG_ALL} all-tui"
-      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
-      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
-      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
-    else
-      AC_MSG_WARN([no enhanced curses library found; disabling TUI])
-    fi
-  fi
-fi
-
 # Unlike the sim directory, whether a simulator is linked is controlled by 
 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.  
 # This code just checks for a few cases where we'd like to ignore those
@@ -1422,19 +1438,22 @@ fi
 AC_SUBST(target_subdir)
 
 frags=
-if test "${target}" = "${host}"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
+if test ! -f ${host_makefile_frag}; then
+    # When building a native debuger the .mh file containing things
+    # like NATDEPFILES is needed.  Cross debuggers don't need .mh
+    # since it no longer contains anything useful.
+    if test "${target}" = "${host}"; then
+       AC_MSG_ERROR("*** Gdb does not support native target ${host}")
+    else
+       host_makefile_frag=/dev/null
+    fi
 fi
+frags="$frags $host_makefile_frag"
 
 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
 if test ! -f ${target_makefile_frag}; then
-  AC_MSG_ERROR("*** Gdb does not support target ${target}")
+AC_MSG_ERROR("*** Gdb does not support target ${target}")
 fi
 frags="$frags $target_makefile_frag"
 
@@ -1561,6 +1580,14 @@ AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
 dnl Autoconf doesn't provide a mechanism for modifying definitions 
 dnl provided by makefile fragments.
 dnl
+if test "${nativefile}" = ""; then
+        < Makefile \
+        sed -e '/^NATDEPFILES[[        ]]*=.*\\$/,/[[^\\]]$/s/^/# /' \
+            -e '/^NATDEPFILES[[        ]]*=/s/^/# /' \
+        | sed -e '/^\(NATDEPFILES[[    ]]*[[+]]=[[     ]]*\)/s//# \1/' \
+       > Makefile.tem
+mv -f Makefile.tem Makefile
+fi
 
 changequote(,)dnl
 sed -e '/^DEPRECATED_TM_FILE[  ]*=/s,^DEPRECATED_TM_FILE[      ]*=[    ]*,&config/'"${gdb_target_cpu}"'/,
index 0b1f627960ea1afc8a9d6c00a134d01d946d7756..a7c14d8966fed2491333ac93da5425d17c76a326 100644 (file)
@@ -106,8 +106,7 @@ ia64-*-linux*)              gdb_target=linux
                        ;;
 ia64*-*-*)             gdb_target=ia64 ;;
 
-m32r*-*-linux*)                gdb_target=linux ;;
-m32r*-*-*)             gdb_target=m32r ;;
+m32r-*-*)              gdb_target=m32r ;;
 
 m68hc11*-*-*|m6811*-*-*)       gdb_target=m68hc11 ;;
 
@@ -188,7 +187,9 @@ sparc-*-netbsd* | sparc-*-knetbsd*-gnu)
 sparc64-*-netbsd* | sparc64-*-knetbsd*-gnu)
                        gdb_target=nbsd64 ;;
 sparc-*-openbsd*)      gdb_target=obsd ;;
-sparc64-*-openbsd*)    gdb_target=obsd64 ;;
+sparc64-*-openbsd*)    gdb_target=obsd64
+                       gdb_osabi=GDB_OSABI_OPENBSD_ELF
+                       ;;
 sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
                        gdb_target=sol2
                        ;;
@@ -219,7 +220,9 @@ x86_64-*-linux*)    gdb_target=linux64
                        ;;
 x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
                        gdb_target=nbsd64 ;;
-x86_64-*-openbsd*)     gdb_target=obsd64 ;;
+x86_64-*-openbsd*)     gdb_target=obsd64
+                       gdb_osabi=GDB_OSABI_OPENBSD_ELF
+                       ;;
 
 esac
 
@@ -228,8 +231,6 @@ esac
 case "${target}" in
 *-*-linux*)    gdb_osabi=GDB_OSABI_LINUX ;;
 *-*-nto*)      gdb_osabi=GDB_OSABI_QNXNTO ;;
-m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
-*-*-openbsd*)  gdb_osabi=GDB_OSABI_OPENBSD_ELF ;;
 *-*-solaris*)  gdb_osabi=GDB_OSABI_SOLARIS ;;
 *-*-*-gnu*)    ;; # prevent non-GNU kernels to match the Hurd rule below
 *-*-gnu*)      gdb_osabi=GDB_OSABI_HURD ;;
index f91ec590ad004e4844fe094671d4e0ebd2002b07..a9d213284384c506bc5f71ed0c9a699b0bdc3d55 100644 (file)
@@ -538,11 +538,11 @@ core_xfer_partial (struct target_ops *ops, enum target_object object,
     {
     case TARGET_OBJECT_MEMORY:
       if (readbuf)
-       return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
-                                              0/*write*/, NULL, ops);
+       return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/,
+                                      NULL, ops);
       if (writebuf)
-       return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
-                                              1/*write*/, NULL, ops);
+       return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/,
+                                      NULL, ops);
       return -1;
 
     case TARGET_OBJECT_AUXV:
@@ -655,7 +655,7 @@ init_core_ops (void)
   core_ops.to_detach = core_detach;
   core_ops.to_fetch_registers = get_core_registers;
   core_ops.to_xfer_partial = core_xfer_partial;
-  core_ops.deprecated_xfer_memory = xfer_memory;
+  core_ops.to_xfer_memory = xfer_memory;
   core_ops.to_files_info = core_files_info;
   core_ops.to_insert_breakpoint = ignore;
   core_ops.to_remove_breakpoint = ignore;
index 64f1e5f92e99b9954f1a3517972c2e20a3f61d6f..1cb0d5293809e98e34c2c190f33a6811137411f7 100644 (file)
@@ -42,11 +42,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* To get entry_point_address.  */
 #include "objfiles.h"
 
-#include "solib.h"              /* Support for shared libraries.  */
+#include "solib.h"              /* Support for shared libraries. */
 #include "solib-svr4.h"         /* For struct link_map_offsets.  */
 #include "gdb_string.h"
 #include "dis-asm.h"
 
+
 enum cris_num_regs
 {
   /* There are no floating point registers.  Used in gdbserver low-linux.c.  */
@@ -107,19 +108,32 @@ extern const struct cris_spec_reg cris_spec_regs[];
 
 /* CRIS version, set via the user command 'set cris-version'.  Affects
    register names and sizes.*/
-static unsigned int usr_cmd_cris_version;
+static int usr_cmd_cris_version;
 
 /* Indicates whether to trust the above variable.  */
 static int usr_cmd_cris_version_valid = 0;
 
-/* Whether to make use of Dwarf-2 CFI (default on).  */
-static int usr_cmd_cris_dwarf2_cfi = 1;
+/* CRIS mode, set via the user command 'set cris-mode'.  Affects availability
+   of some registers.  */
+static const char *usr_cmd_cris_mode;
+
+/* Indicates whether to trust the above variable.  */
+static int usr_cmd_cris_mode_valid = 0;
+
+static const char CRIS_MODE_USER[] = "CRIS_MODE_USER";
+static const char CRIS_MODE_SUPERVISOR[] = "CRIS_MODE_SUPERVISOR";
+static const char *cris_mode_enums[] = 
+{
+  CRIS_MODE_USER,
+  CRIS_MODE_SUPERVISOR,
+  0
+};
 
 /* CRIS architecture specific information.  */
 struct gdbarch_tdep
 {
-  unsigned int cris_version;
-  int cris_dwarf2_cfi;
+  int cris_version;
+  const char *cris_mode;
 };
 
 /* Functions for accessing target dependent data.  */
@@ -130,121 +144,10 @@ cris_version (void)
   return (gdbarch_tdep (current_gdbarch)->cris_version);
 }
 
-/* Sigtramp identification code copied from i386-linux-tdep.c.  */
-
-#define SIGTRAMP_INSN0    0x9c5f  /* movu.w 0xXX, $r9 */
-#define SIGTRAMP_OFFSET0  0
-#define SIGTRAMP_INSN1    0xe93d  /* break 13 */
-#define SIGTRAMP_OFFSET1  4
-
-static const unsigned short sigtramp_code[] =
-{
-  SIGTRAMP_INSN0, 0x0077,  /* movu.w $0x77, $r9 */
-  SIGTRAMP_INSN1           /* break 13 */
-};
-
-#define SIGTRAMP_LEN (sizeof sigtramp_code)
-
-/* Note: same length as normal sigtramp code.  */
-
-static const unsigned short rt_sigtramp_code[] =
-{
-  SIGTRAMP_INSN0, 0x00ad,  /* movu.w $0xad, $r9 */
-  SIGTRAMP_INSN1           /* break 13 */
-};
-
-/* If PC is in a sigtramp routine, return the address of the start of
-   the routine.  Otherwise, return 0.  */
-
-static CORE_ADDR
-cris_sigtramp_start (struct frame_info *next_frame)
-{
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  unsigned short buf[SIGTRAMP_LEN];
-
-  if (!safe_frame_unwind_memory (next_frame, pc, buf, SIGTRAMP_LEN))
-    return 0;
-
-  if (buf[0] != SIGTRAMP_INSN0)
-    {
-      if (buf[0] != SIGTRAMP_INSN1)
-       return 0;
-
-      pc -= SIGTRAMP_OFFSET1;
-      if (!safe_frame_unwind_memory (next_frame, pc, buf, SIGTRAMP_LEN))
-       return 0;
-    }
-
-  if (memcmp (buf, sigtramp_code, SIGTRAMP_LEN) != 0)
-    return 0;
-
-  return pc;
-}
-
-/* If PC is in a RT sigtramp routine, return the address of the start of
-   the routine.  Otherwise, return 0.  */
-
-static CORE_ADDR
-cris_rt_sigtramp_start (struct frame_info *next_frame)
-{
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  unsigned short buf[SIGTRAMP_LEN];
-
-  if (!safe_frame_unwind_memory (next_frame, pc, buf, SIGTRAMP_LEN))
-    return 0;
-
-  if (buf[0] != SIGTRAMP_INSN0)
-    {
-      if (buf[0] != SIGTRAMP_INSN1)
-       return 0;
-
-      pc -= SIGTRAMP_OFFSET1;
-      if (!safe_frame_unwind_memory (next_frame, pc, buf, SIGTRAMP_LEN))
-       return 0;
-    }
-
-  if (memcmp (buf, rt_sigtramp_code, SIGTRAMP_LEN) != 0)
-    return 0;
-
-  return pc;
-}
-
-/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
-   routine, return the address of the associated sigcontext structure.  */
-
-static CORE_ADDR
-cris_sigcontext_addr (struct frame_info *next_frame)
+static const char *
+cris_mode (void)
 {
-  CORE_ADDR pc;
-  CORE_ADDR sp;
-  char buf[4];
-
-  frame_unwind_register (next_frame, SP_REGNUM, buf);
-  sp = extract_unsigned_integer (buf, 4);
-
-  /* Look for normal sigtramp frame first.  */
-  pc = cris_sigtramp_start (next_frame);
-  if (pc)
-    {
-      /* struct signal_frame (arch/cris/kernel/signal.c) contains
-        struct sigcontext as its first member, meaning the SP points to
-        it already.  */
-      return sp;
-    }
-
-  pc = cris_rt_sigtramp_start (next_frame);
-  if (pc)
-    {
-      /* struct rt_signal_frame (arch/cris/kernel/signal.c) contains
-        a struct ucontext, which in turn contains a struct sigcontext.
-        Magic digging:
-        4 + 4 + 128 to struct ucontext, then
-        4 + 4 + 12 to struct sigcontext.  */
-      return (sp + 156);
-    }
-
-  error ("Couldn't recognize signal trampoline.");
-  return 0;
+  return (gdbarch_tdep (current_gdbarch)->cris_mode);
 }
 
 struct cris_unwind_cache
@@ -270,111 +173,6 @@ struct cris_unwind_cache
   struct trad_frame_saved_reg *saved_regs;
 };
 
-static struct cris_unwind_cache *
-cris_sigtramp_frame_unwind_cache (struct frame_info *next_frame,
-                                 void **this_cache)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  struct cris_unwind_cache *info;
-  CORE_ADDR pc;
-  CORE_ADDR sp;
-  CORE_ADDR addr;
-  char buf[4];
-  int i;
-
-  if ((*this_cache))
-    return (*this_cache);
-
-  info = FRAME_OBSTACK_ZALLOC (struct cris_unwind_cache);
-  (*this_cache) = info;
-  info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
-  /* Zero all fields.  */
-  info->prev_sp = 0;
-  info->base = 0;
-  info->size = 0;
-  info->sp_offset = 0;
-  info->r8_offset = 0;
-  info->uses_frame = 0;
-  info->return_pc = 0;
-  info->leaf_function = 0;
-
-  frame_unwind_register (next_frame, SP_REGNUM, buf);
-  info->base = extract_unsigned_integer (buf, 4);
-
-  addr = cris_sigcontext_addr (next_frame);
-  
-  /* Layout of the sigcontext struct:
-     struct sigcontext {
-       struct pt_regs regs;
-       unsigned long oldmask;
-       unsigned long usp;
-     }; */
-  
-  /* R0 to R13 are stored in reverse order at offset (2 * 4) in 
-     struct pt_regs.  */
-  for (i = 0; i <= 13; i++)
-    info->saved_regs[i].addr = addr + ((15 - i) * 4);
-
-  info->saved_regs[MOF_REGNUM].addr = addr + (16 * 4);
-  info->saved_regs[DCCR_REGNUM].addr = addr + (17 * 4);
-  info->saved_regs[SRP_REGNUM].addr = addr + (18 * 4);
-  /* Note: IRP is off by 2 at this point.  There's no point in correcting it
-     though since that will mean that the backtrace will show a PC different
-     from what is shown when stopped.  */
-  info->saved_regs[IRP_REGNUM].addr = addr + (19 * 4);
-  info->saved_regs[PC_REGNUM] = info->saved_regs[IRP_REGNUM];
-  info->saved_regs[SP_REGNUM].addr = addr + (24 * 4);
-  
-  return info;
-}
-
-static void
-cris_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache,
-                             struct frame_id *this_id)
-{
-  struct cris_unwind_cache *cache =
-    cris_sigtramp_frame_unwind_cache (next_frame, this_cache);
-  (*this_id) = frame_id_build (cache->base, frame_pc_unwind (next_frame));
-}
-
-/* Forward declaration.  */
-
-static void cris_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 *bufferp);
-static void
-cris_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.  */
-  cris_sigtramp_frame_unwind_cache (next_frame, this_cache);
-  cris_frame_prev_register (next_frame, this_cache, regnum,
-                            optimizedp, lvalp, addrp, realnump, valuep);
-}
-
-static const struct frame_unwind cris_sigtramp_frame_unwind =
-{
-  SIGTRAMP_FRAME,
-  cris_sigtramp_frame_this_id,
-  cris_sigtramp_frame_prev_register
-};
-
-static const struct frame_unwind *
-cris_sigtramp_frame_sniffer (struct frame_info *next_frame)
-{
-  if (cris_sigtramp_start (next_frame) 
-      || cris_rt_sigtramp_start (next_frame))
-    return &cris_sigtramp_frame_unwind;
-
-  return NULL;
-}
-
 /* The instruction environment needed to find single-step breakpoints.  */
 typedef 
 struct instruction_environment
@@ -547,11 +345,11 @@ static struct gdbarch *cris_gdbarch_init (struct gdbarch_info,
 
 static void cris_dump_tdep (struct gdbarch *, struct ui_file *);
 
-static void set_cris_version (char *ignore_args, int from_tty, 
-                             struct cmd_list_element *c);
+static void cris_version_update (char *ignore_args, int from_tty, 
+                                 struct cmd_list_element *c);
 
-static void set_cris_dwarf2_cfi (char *ignore_args, int from_tty, 
-                                struct cmd_list_element *c);
+static void cris_mode_update (char *ignore_args, int from_tty, 
+                              struct cmd_list_element *c);
 
 static CORE_ADDR cris_scan_prologue (CORE_ADDR pc, 
                                     struct frame_info *next_frame,
@@ -564,8 +362,9 @@ static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch,
                                 struct frame_info *next_frame);
 
 /* When arguments must be pushed onto the stack, they go on in reverse
-   order.  The below implements a FILO (stack) to do this.  
-   Copied from d10v-tdep.c.  */
+   order.  The below implements a FILO (stack) to do this. */
+
+/* Borrowed from d10v-tdep.c.  */
 
 struct stack_item
 {
@@ -600,7 +399,7 @@ pop_stack_item (struct stack_item *si)
    the saved registers of frame described by FRAME_INFO.  This
    includes special registers such as pc and fp saved in special ways
    in the stack frame.  sp is even more special: the address we return
-   for it IS the sp for the next frame.  */
+   for it IS the sp for the next frame. */
 
 struct cris_unwind_cache *
 cris_frame_unwind_cache (struct frame_info *next_frame,
@@ -732,7 +531,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
   struct stack_item *si = NULL;
 
-  /* Push the return address.  */
+  /* Push the return address. */
   regcache_cooked_write_unsigned (regcache, SRP_REGNUM, bp_addr);
 
   /* Are we returning a value using a structure return or a normal value
@@ -968,7 +767,7 @@ cris_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame,
   limit = next_frame ? frame_pc_unwind (next_frame) : pc + 64;
 
   /* Find the prologue instructions.  */
-  while (pc > 0 && pc < limit)
+  while (pc < limit)
     {
       insn = read_memory_unsigned_integer (pc, 2);
       pc += 2;
@@ -1370,8 +1169,13 @@ cris_cannot_store_register (int regno)
     /* Writing has no effect.  */
     return 1;
 
-  /* IBR, BAR, BRP and IRP are read-only in user mode.  Let the debug
-     agent decide whether they are writable.  */
+  else if (cris_mode () == CRIS_MODE_USER)
+    {
+      if (regno == IBR_REGNUM || regno == BAR_REGNUM || regno == BRP_REGNUM 
+          || regno == IRP_REGNUM)
+        /* Read-only in user mode.  */
+        return 1;
+    }
   
   return 0;
 }
@@ -1398,7 +1202,7 @@ cris_register_offset (int regno)
     }
   else
     {
-      /* Invalid register.  */
+      /* Invalid register. */
       return -1;
     }
 }
@@ -1409,21 +1213,33 @@ cris_register_offset (int regno)
 static struct type *
 cris_register_type (struct gdbarch *gdbarch, int regno)
 {
-  if (regno == PC_REGNUM)
-    return builtin_type_void_func_ptr;
-  else if (regno == SP_REGNUM || regno == CRIS_FP_REGNUM)
-    return builtin_type_void_data_ptr;
-  else if ((regno >= 0 && regno < SP_REGNUM)
-          || (regno >= MOF_REGNUM && regno <= USP_REGNUM))
-    /* Note: R8 taken care of previous clause.  */
-    return builtin_type_uint32;
-  else if (regno >= P4_REGNUM && regno <= CCR_REGNUM)
-      return builtin_type_uint16;
-  else if (regno >= P0_REGNUM && regno <= VR_REGNUM)
-      return builtin_type_uint8;
+  if (regno == SP_REGNUM || regno == PC_REGNUM
+      || (regno > P8_REGNUM && regno < USP_REGNUM))
+    {
+      /* SP, PC, IBR, IRP, SRP, BAR, DCCR, BRP */
+      return lookup_pointer_type (builtin_type_void);
+    }
+  else if (regno == P8_REGNUM || regno == USP_REGNUM
+           || (regno >= 0 && regno < SP_REGNUM))
+    {
+      /* R0 - R13, P8, P15 */
+      return builtin_type_unsigned_long;
+    }
+  else if (regno > P3_REGNUM && regno < P8_REGNUM)
+    {
+      /* P4, CCR, DCR0, DCR1 */
+      return builtin_type_unsigned_short;
+    }
+  else if (regno > PC_REGNUM && regno < P4_REGNUM)
+    {
+      /* P0, P1, P2, P3 */
+      return builtin_type_unsigned_char;
+    }
   else
-      /* Invalid (unimplemented) register.  */
-      return builtin_type_int0;
+    {
+      /* Invalid register.  */
+      return builtin_type_void;
+    }
 }
 
 /* Stores a function return value of type type, where valbuf is the address 
@@ -1501,49 +1317,10 @@ cris_register_name (int regno)
     }
 }
 
-/* Convert DWARF register number REG to the appropriate register
-   number used by GDB.  */
-
 static int
-cris_dwarf2_reg_to_regnum (int reg)
+cris_register_bytes_ok (long bytes)
 {
-  /* We need to re-map a couple of registers (SRP is 16 in Dwarf-2 register
-     numbering, MOF is 18).
-     Adapted from gcc/config/cris/cris.h.  */
-  static int cris_dwarf_regmap[] = {
-    0,  1,  2,  3,
-    4,  5,  6,  7,
-    8,  9,  10, 11,
-    12, 13, 14, 15,
-    27, -1, -1, -1,
-    -1, -1, -1, 23,
-    -1, -1, -1, 27,
-    -1, -1, -1, -1
-  };
-  int regnum = -1;
-
-  if (reg >= 0 && reg < ARRAY_SIZE (cris_dwarf_regmap))
-    regnum = cris_dwarf_regmap[reg];
-
-  if (regnum == -1)
-    warning ("Unmapped DWARF Register #%d encountered\n", reg);
-
-  return regnum;
-}
-
-/* DWARF-2 frame support.  */
-
-static void
-cris_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
-                            struct dwarf2_frame_state_reg *reg)
-{
-  /* The return address column.  */
-  if (regnum == PC_REGNUM)
-    reg->how = DWARF2_FRAME_REG_RA;
-
-  /* The call frame address.  */
-  else if (regnum == SP_REGNUM)
-    reg->how = DWARF2_FRAME_REG_CFA;
+  return (bytes == deprecated_register_bytes ());
 }
 
 /* Extract from an array regbuf containing the raw register state a function
@@ -1819,7 +1596,6 @@ cris_software_single_step (enum target_signal ignore, int insert_breakpoints)
       if (status == -1)
         {
           /* Could not find a target.  FIXME: Should do something.  */
-          warning ("cris_software_single_step: unable to find step target");
         }
       else
         {
@@ -3536,7 +3312,7 @@ cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info)
      disassembler, even when there is no BFD.  Does something like
      "gdb; target remote; disassmeble *0x123" work?  */
   gdb_assert (exec_bfd != NULL);
-  print_insn = cris_get_disassembler (exec_bfd);
+  print_insn =  cris_get_disassembler (exec_bfd);
   gdb_assert (print_insn != NULL);
   return print_insn (addr, info);
 }
@@ -3647,38 +3423,230 @@ cris_linux_svr4_fetch_link_map_offsets (void)
   return lmp;
 }
 
+static void
+cris_fpless_backtrace (char *noargs, int from_tty)
+{
+  /* Points at the instruction after the jsr (except when in innermost frame
+     where it points at the original pc).  */
+  CORE_ADDR pc = 0;
+
+  /* Temporary variable, used for parsing from the start of the function that
+     the pc is in, up to the pc.  */
+  CORE_ADDR tmp_pc = 0;
+  CORE_ADDR sp = 0;
+
+  /* Information about current frame.  */
+  struct symtab_and_line sal;
+  char* func_name;
+
+  /* Present instruction.  */
+  unsigned short insn;
+  
+  /* Next instruction, lookahead.  */
+  unsigned short insn_next; 
+
+  /* This is to store the offset between sp at start of function and until we
+     reach push srp (if any).  */
+  int sp_add_later = 0;
+  int push_srp_found = 0;
+
+  int val = 0;
+
+  /* Frame counter.  */
+  int frame = 0;
+
+  /* For the innermost frame, we want to look at srp in case it's a leaf
+     function (since there's no push srp in that case).  */
+  int innermost_frame = 1;
+  
+  deprecated_read_register_gen (PC_REGNUM, (char *) &pc);
+  deprecated_read_register_gen (SP_REGNUM, (char *) &sp);
+  
+  /* We make an explicit return when we can't find an outer frame.  */
+  while (1)
+    {
+      /* Get file name and line number.  */
+      sal = find_pc_line (pc, 0);
+
+      /* Get function name.  */
+      find_pc_partial_function (pc, &func_name, (CORE_ADDR *) NULL,
+                                (CORE_ADDR *) NULL);
+
+      /* Print information about current frame.  */
+      printf_unfiltered ("#%i  0x%08lx in %s", frame++, pc, func_name);
+      if (sal.symtab)
+        {    
+          printf_unfiltered (" at %s:%i", sal.symtab->filename, sal.line);
+        }
+      printf_unfiltered ("\n");
+      
+      /* Get the start address of this function.  */
+      tmp_pc = get_pc_function_start (pc);
+  
+      /* Mini parser, only meant to find push sp and sub ...,sp from the start
+         of the function, up to the pc.  */
+      while (tmp_pc < pc)
+        {
+          insn = read_memory_unsigned_integer (tmp_pc, sizeof (short));
+          tmp_pc += sizeof (short);
+          if (insn == 0xE1FC)
+            {
+              /* push <reg> 32 bit instruction */
+              insn_next = read_memory_unsigned_integer (tmp_pc, 
+                                                        sizeof (short));
+              tmp_pc += sizeof (short);
+
+              /* Recognize srp.  */
+              if (insn_next == 0xBE7E)
+                {
+                  /* For subsequent (not this one though) push or sub which
+                     affects sp, adjust sp immediately.  */
+                  push_srp_found = 1;
+
+                  /* Note: this will break if we ever encounter a 
+                     push vr (1 byte) or push ccr (2 bytes).  */
+                  sp_add_later += 4;
+                }
+              else
+                {
+                  /* Some other register was pushed.  */
+                  if (push_srp_found)
+                    {    
+                      sp += 4;
+                    }
+                  else
+                    {
+                      sp_add_later += 4;
+                    }
+                }
+            }
+          else if (cris_get_operand2 (insn) == SP_REGNUM 
+                   && cris_get_mode (insn) == 0x0000
+                   && cris_get_opcode (insn) == 0x000A)
+            {
+              /* subq <val>,sp */
+              val = cris_get_quick_value (insn);
+
+              if (push_srp_found)
+                {
+                  sp += val;
+                }
+              else
+                {
+                  sp_add_later += val;
+                }
+              
+            }
+          else if (cris_get_operand2 (insn) == SP_REGNUM
+                   /* Autoincrement addressing mode.  */
+                   && cris_get_mode (insn) == 0x0003
+                   /* Opcode.  */
+                   && ((insn) & 0x03E0) >> 5 == 0x0004)
+            {
+              /* subu <val>,sp */
+              val = get_data_from_address (&insn, tmp_pc);
+
+              if (push_srp_found)
+                {
+                  sp += val;
+                }
+              else
+                {
+                  sp_add_later += val;
+                }
+            }
+          else if (cris_get_operand2 (insn) == SP_REGNUM
+                   && ((insn & 0x0F00) >> 8) == 0x0001
+                   && (cris_get_signed_offset (insn) < 0))
+            {
+              /* Immediate byte offset addressing prefix word with sp as base 
+                 register.  Used for CRIS v8 i.e. ETRAX 100 and newer if <val> 
+                 is between 64 and 128. 
+                 movem r<regsave>,[sp=sp-<val>] */
+              val = -cris_get_signed_offset (insn);
+              insn_next = read_memory_unsigned_integer (tmp_pc, 
+                                                        sizeof (short));
+              tmp_pc += sizeof (short);
+              
+              if (cris_get_mode (insn_next) == PREFIX_ASSIGN_MODE
+                  && cris_get_opcode (insn_next) == 0x000F
+                  && cris_get_size (insn_next) == 0x0003
+                  && cris_get_operand1 (insn_next) == SP_REGNUM)
+                {             
+                  if (push_srp_found)
+                    {
+                      sp += val;
+                    }
+                  else
+                    {
+                      sp_add_later += val;
+                    }
+                }
+            }
+        }
+      
+      if (push_srp_found)
+        {
+          /* Reset flag.  */
+          push_srp_found = 0;
+
+          /* sp should now point at where srp is stored on the stack.  Update
+             the pc to the srp.  */
+          pc = read_memory_unsigned_integer (sp, 4);
+        }
+      else if (innermost_frame)
+        {
+          /* We couldn't find a push srp in the prologue, so this must be
+             a leaf function, and thus we use the srp register directly.
+             This should happen at most once, for the innermost function.  */
+          deprecated_read_register_gen (SRP_REGNUM, (char *) &pc);
+        }
+      else
+        {
+          /* Couldn't find an outer frame.  */
+          return;
+        }
+
+      /* Reset flag.  (In case the innermost frame wasn't a leaf, we don't
+         want to look at the srp register later either).  */
+      innermost_frame = 0;
+
+      /* Now, add the offset for everything up to, and including push srp,
+         that was held back during the prologue parsing.  */ 
+      sp += sp_add_later;
+      sp_add_later = 0;
+    }
+}
+
 extern initialize_file_ftype _initialize_cris_tdep; /* -Wmissing-prototypes */
 
 void
 _initialize_cris_tdep (void)
 {
-  static struct cmd_list_element *cris_set_cmdlist;
-  static struct cmd_list_element *cris_show_cmdlist;
-
   struct cmd_list_element *c;
 
   gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
   
   /* CRIS-specific user-commands.  */
-  add_setshow_uinteger_cmd ("cris-version", class_support, 
-                           &usr_cmd_cris_version, 
-                           "Set the current CRIS version.",
-                           "Show the current CRIS version.",
-                           "Set if autodetection fails.",
-                           "Current CRIS version is %s.",
-                           set_cris_version, NULL,
-                           &setlist, &showlist);
+  c = add_set_cmd ("cris-version", class_support, var_integer, 
+                   (char *) &usr_cmd_cris_version, 
+                   "Set the current CRIS version.", &setlist);
+  set_cmd_sfunc (c, cris_version_update);
+  deprecated_add_show_from_set (c, &showlist);
+  
+  c = add_set_enum_cmd ("cris-mode", class_support, cris_mode_enums, 
+                        &usr_cmd_cris_mode, 
+                        "Set the current CRIS mode.", &setlist);
+  set_cmd_sfunc (c, cris_mode_update);
+  deprecated_add_show_from_set (c, &showlist);
+
+  c = add_cmd ("cris-fpless-backtrace", class_support, cris_fpless_backtrace, 
+               "Display call chain using the subroutine return pointer.\n"
+               "Note that this displays the address after the jump to the "
+               "subroutine.", &cmdlist);
   
-  add_setshow_boolean_cmd ("cris-dwarf2-cfi", class_support,
-                          &usr_cmd_cris_dwarf2_cfi,
-                          "Set the usage of Dwarf-2 CFI for CRIS.",
-                          "Show the usage of Dwarf-2 CFI for CRIS.",
-                          "Set to \"off\" if using gcc-cris < R59.",
-                          "Usage of Dwarf-2 CFI for CRIS is %d.",
-                          set_cris_dwarf2_cfi, NULL,
-                          &setlist, &showlist);
-
   deprecated_add_core_fns (&cris_elf_core_fns);
+  
 }
 
 /* Prints out all target specific values.  */
@@ -3691,37 +3659,65 @@ cris_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
     {
       fprintf_unfiltered (file, "cris_dump_tdep: tdep->cris_version = %i\n",
                           tdep->cris_version);
-      fprintf_unfiltered (file, "cris_dump_tdep: tdep->cris_dwarf2_cfi = %i\n",
-                          tdep->cris_dwarf2_cfi);
+      fprintf_unfiltered (file, "cris_dump_tdep: tdep->cris_mode = %s\n",
+                          tdep->cris_mode);
     }
 }
 
 static void
-set_cris_version (char *ignore_args, int from_tty, 
-                 struct cmd_list_element *c)
+cris_version_update (char *ignore_args, int from_tty, 
+                     struct cmd_list_element *c)
 {
   struct gdbarch_info info;
 
-  usr_cmd_cris_version_valid = 1;
+  /* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set()
+     function clones the set command passed as a parameter.  The clone
+     operation will include (BUG?) any ``set'' command callback, if
+     present.  Commands like ``info set'' call all the ``show''
+     command callbacks.  Unfortunately, for ``show'' commands cloned
+     from ``set'', this includes callbacks belonging to ``set''
+     commands.  Making this worse, this only occures if
+     deprecated_add_show_from_set() is called after add_cmd_sfunc()
+     (BUG?).  */
+
+  /* From here on, trust the user's CRIS version setting.  */
+  if (cmd_type (c) == set_cmd)
+    {
+      usr_cmd_cris_version_valid = 1;
   
-  /* Update the current architecture, if needed.  */
-  gdbarch_info_init (&info);
-  if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, 
-                   "cris_gdbarch_update: failed to update architecture.");
+      /* Update the current architecture, if needed.  */
+      gdbarch_info_init (&info);
+      if (!gdbarch_update_p (info))
+        internal_error (__FILE__, __LINE__, "cris_gdbarch_update: failed to update architecture.");
+    }  
 }
 
 static void
-set_cris_dwarf2_cfi (char *ignore_args, int from_tty, 
-                    struct cmd_list_element *c)
+cris_mode_update (char *ignore_args, int from_tty, 
+                 struct cmd_list_element *c)
 {
   struct gdbarch_info info;
-
-  /* Update the current architecture, if needed.  */
-  gdbarch_info_init (&info);
-  if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, 
-                   "cris_gdbarch_update: failed to update architecture.");
+  
+  /* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set()
+     function clones the set command passed as a parameter.  The clone
+     operation will include (BUG?) any ``set'' command callback, if
+     present.  Commands like ``info set'' call all the ``show''
+     command callbacks.  Unfortunately, for ``show'' commands cloned
+     from ``set'', this includes callbacks belonging to ``set''
+     commands.  Making this worse, this only occures if
+     deprecated_add_show_from_set() is called after add_cmd_sfunc()
+     (BUG?).  */
+
+  /* From here on, trust the user's CRIS mode setting.  */
+  if (cmd_type (c) == set_cmd)
+    {
+      usr_cmd_cris_mode_valid = 1;
+  
+      /* Update the current architecture, if needed.  */
+      gdbarch_info_init (&info);
+      if (!gdbarch_update_p (info))
+        internal_error (__FILE__, __LINE__, "cris_gdbarch_update: failed to update architecture.");
+    }
 }
 
 static struct gdbarch *
@@ -3730,6 +3726,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   struct gdbarch *gdbarch;
   struct gdbarch_tdep *tdep;
   int cris_version;
+  const char *cris_mode;
+  int register_bytes;
 
   if (usr_cmd_cris_version_valid)
     {
@@ -3742,8 +3740,26 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       cris_version = 10;
     }
 
+  if (usr_cmd_cris_mode_valid)
+    {
+      /* Trust the user's CRIS mode setting.  */ 
+      cris_mode = usr_cmd_cris_mode;
+    }
+  else if (cris_version == 10)
+    {
+      /* Assume CRIS version 10 is in user mode.  */
+      cris_mode = CRIS_MODE_USER;
+    }
+  else
+    {
+      /* Strictly speaking, older CRIS version don't have a supervisor mode,
+         but we regard its only mode as supervisor mode.  */
+      cris_mode = CRIS_MODE_SUPERVISOR;
+    }
+
   /* Make the current settings visible to the user.  */
   usr_cmd_cris_version = cris_version;
+  usr_cmd_cris_mode = cris_mode;
   
   /* Find a candidate among the list of pre-declared architectures.  Both
      CRIS version and ABI must match.  */
@@ -3751,10 +3767,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        arches != NULL;
        arches = gdbarch_list_lookup_by_info (arches->next, &info))
     {
-      if ((gdbarch_tdep (arches->gdbarch)->cris_version 
-          == usr_cmd_cris_version)
-         && (gdbarch_tdep (arches->gdbarch)->cris_dwarf2_cfi 
-             == usr_cmd_cris_dwarf2_cfi))
+      if ((gdbarch_tdep (arches->gdbarch)->cris_version == cris_version)
+          && (gdbarch_tdep (arches->gdbarch)->cris_mode == cris_mode))
         return arches->gdbarch;
     }
 
@@ -3762,8 +3776,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
   gdbarch = gdbarch_alloc (&info, tdep);
 
-  tdep->cris_version = usr_cmd_cris_version;
-  tdep->cris_dwarf2_cfi = usr_cmd_cris_dwarf2_cfi;
+  tdep->cris_version = cris_version;
+  tdep->cris_mode = cris_mode;
 
   /* INIT shall ensure that the INFO.BYTE_ORDER is non-zero.  */
   switch (info.byte_order)
@@ -3790,11 +3804,16 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_sp_regnum (gdbarch, 14);
   set_gdbarch_pc_regnum (gdbarch, 15);
   set_gdbarch_register_name (gdbarch, cris_register_name);
-
+  
+  /* Length of ordinary registers used in push_word and a few other
+     places.  register_size() is the real way to know how big a
+     register is.  */
+  set_gdbarch_deprecated_register_size (gdbarch, 4);
   set_gdbarch_double_bit (gdbarch, 64);
   /* The default definition of a long double is 2 * TARGET_DOUBLE_BIT,
      which means we have to set this explicitly.  */
   set_gdbarch_long_double_bit (gdbarch, 64);  
+  set_gdbarch_register_bytes_ok (gdbarch, cris_register_bytes_ok);
   set_gdbarch_cannot_store_register (gdbarch, cris_cannot_store_register);
   set_gdbarch_cannot_fetch_register (gdbarch, cris_cannot_fetch_register);
 
@@ -3808,23 +3827,33 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     case 1:
     case 2:
     case 3:
+      /* Support for these may be added later.  */
+      internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unsupported CRIS version");
+      break;
+      
     case 8:
     case 9:
-      /* Old versions; not supported.  */
-      internal_error (__FILE__, __LINE__, 
-                     "cris_gdbarch_init: unsupported CRIS version");
+      /* CRIS v8 and v9, a.k.a. ETRAX 100.  General registers R0 - R15 
+         (32 bits), special registers P0 - P1 (8 bits), P4 - P5 (16 bits), 
+         and P8 - P14 (32 bits).  */
+      register_bytes = (16 * 4) + (2 * 1) + (2 * 2) + (7 * 4);
       break;
 
     case 10:
     case 11: 
       /* CRIS v10 and v11, a.k.a. ETRAX 100LX.  In addition to ETRAX 100, 
          P7 (32 bits), and P15 (32 bits) have been implemented.  */
+      register_bytes = (16 * 4) + (2 * 1) + (2 * 2) + (9 * 4);
       break;
 
     default:
       internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS version");
     }
 
+  /* Returns the register offset for the first byte of register regno's space 
+     in the saved register state.  */
+  set_gdbarch_deprecated_register_byte (gdbarch, cris_register_offset);
+  
   set_gdbarch_register_type (gdbarch, cris_register_type);
   
   /* Dummy frame functions.  */
@@ -3844,16 +3873,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);
   set_gdbarch_unwind_dummy_id (gdbarch, cris_unwind_dummy_id);
 
-  if (tdep->cris_dwarf2_cfi == 1)
-    {
-      /* Hook in the Dwarf-2 frame sniffer.  */
-      set_gdbarch_dwarf2_reg_to_regnum (gdbarch, cris_dwarf2_reg_to_regnum);
-      dwarf2_frame_set_init_reg (gdbarch, cris_dwarf2_frame_init_reg);
-      frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
-    }
-
-  frame_unwind_append_sniffer (gdbarch, cris_sigtramp_frame_sniffer);
-
+  /* FIXME: Hook in the DWARF CFI frame unwinder.
+     frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+  */
   frame_unwind_append_sniffer (gdbarch, cris_frame_sniffer);
   frame_base_set_default (gdbarch, &cris_frame_base);
 
index fd96665d44b7c099059b411bb4e96e0e10eccd1a..63477de59680652e3d1569b602d378c872f4d65b 100644 (file)
@@ -197,7 +197,6 @@ enum language
     language_asm,              /* Assembly language */
     language_scm,              /* Scheme / Guile */
     language_pascal,           /* Pascal */
-    language_ada,              /* Ada */
     language_minimal,          /* All other languages, minimal support only */
     nr_languages
   };
@@ -804,16 +803,11 @@ typedef struct ptid ptid_t;
 #include "tm.h"
 #endif
 
-/* Assume that fopen accepts the letter "b" in the mode string.
-   Support for is demanded by ISO C90, and should be supported on all
-   platforms that claim to have a standards conforming C library.  On
-   true POSIX systems it will be ignored and have no effect.  There
-   may still be systems without a standards conforming C library where
-   an ISO C90 compiler (GCC) is available.  Known examples are SunOS
-   4.x and 4.3BSD.  This assumption means these systems are no longer
-   supported.  */
+/* If the xm.h file did not define the mode string used to open the
+   files, assume that binary files are opened the same way as text
+   files */
 #ifndef FOPEN_RB
-# include "fopen-bin.h"
+#include "fopen-same.h"
 #endif
 
 /* Defaults for system-wide constants (if not defined by xm.h, we fake it).
@@ -858,6 +852,10 @@ extern int longest_to_int (LONGEST);
 
 extern char *savestring (const char *, size_t);
 
+extern char *msavestring (void *, const char *, size_t);
+
+extern char *mstrsave (void *, const char *);
+
 /* xmalloc(), xrealloc() and xcalloc() have already been declared in
    "libiberty.h". */
 extern void xfree (void *);
index c46594bddb93f2c559b27d8be69fd9d8a7e26a9c..2d3035ed3d5357e549093451663897ff95e2a0bf 100644 (file)
@@ -1,55 +1,3 @@
-2004-10-12  Andrew Cagney  <cagney@gnu.org>
-
-       * gdbint.texinfo (Versions and Branches): New chapter.
-       (Releasing GDB): Delete "Versions and Branches" section.
-       (Top): Add "Versions and Branches".
-
-2004-10-08  Eli Zaretskii  <eliz@gnu.org>
-
-       * gdb.texinfo (Editing, History): Add cross-references to the
-       included Readline and History user documentation.  Remove
-       references to the symbol have-readline-appendices which is unused
-       and undefined.
-       (History): Fix indexing.
-
-2004-10-08  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * gdbint.texinfo (target_stopped_data_address): Update to
-       new prototype.
-       (i386_stopped_data_address): Update prototype and description.
-       (i386_stopped_by_watchpoint): New function and description.
-
-2004-10-03  Paul N. Hilfinger  <hilfinger@gnat.com>
-
-       * gdb.texinfo (Filenames): Add Ada suffixes.
-       (Ada) New section.
-
-2004-09-27  Andrew Cagney  <cagney@gnu.org>
-           Robert Picco  <Robert.Picco@hp.com>
-
-       * gdb.texinfo (Packets): Document the "p" packet.
-
-2004-09-21  Jason Molenda  (jmolenda@apple.com)
-
-       * gdb.texinfo (Paths and Names of the Source Files): Document the
-       meaning of values in the 'desc' field of a SO stab.
-
-2004-09-20  Daniel Jacobowitz  <dan@debian.org>
-
-       * gdb.texinfo (Maintenance Commands): Document "maint set dwarf2
-       max-cache-age" and "maint show dwarf2 max-cache-age".
-
-2004-09-16  Eli Zaretskii  <eliz@gnu.org>
-
-       * gdb.texinfo (Set Breaks): Add index entry for setting
-       breakpoints on overloaded C++ functions that are not members of
-       any classes.  Add an example and an index entry for setting
-       breakpoints on all program functions.
-       (Character Sets, Macros, Overlay Commands)
-       (Non-debug DLL symbols, GDB/MI Output Syntax)
-       (Annotations Overview, Maintenance Commands, File-I/O Overview):
-       Use "(@value{GDBP})" instead of a literal "(gdb)".
-
 2004-09-12  Andrew Cagney  <cagney@gnu.org>
 
        * gdbint.texinfo (Native Debugging): Delete description of
        (Coding): Add -Wunused-label to list of -Werror warnings.
 
 2004-01-08  Jason Molenda  <jmolenda@apple.com>
-            Eli Zaretskii  <eliz@gnu.org>
+            Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Update copyright.
        (Objective-C): "methodName" typeo fixed.  Add @code/@var markup
 
 2002-09-20  Kevin Buettner  <kevinb@redhat.com>
 
-       From Eli Zaretskii  <eliz@gnu.org>:
+       From Eli Zaretskii  <eliz@is.elta.co.il>:
        * gdb.texinfo (Character Sets): Use @smallexample instead of
        @example.  Use GNU/Linux instead of Linux.
 
        * gdbint.texinfo (Target Architecture Definition): Delete
        definition of HAVE_REGISTER_WINDOWS.
 
-2002-04-19  Eli Zaretskii  <eliz@gnu.org>
+2002-04-19  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdbint.texinfo (Releasing GDB, Coding): Fix typos.  Reported by
        "Theodore A. Roth" <troth@verinet.com>.
 
 2002-04-15  Don Howard  <dhoward@redhat.com>
 
-       From Eli Zaretskii <eliz@gnu.org>
+       From Eli Zaretskii <eliz@is.elta.co.il>
        * gdb.texinfo (show max-user-call-depth): Correct formatting.
        Provide a better explaination of this feature.
 
        '_ovly_debug_event', which allows GDB to keep better track
        of overlays.
 
-2002-02-03  Eli Zaretskii  <eliz@gnu.org>
+2002-02-03  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Memory Region Attributes): Fix the wording.
        Suggested by Dmitry Sivachenko.
        * gdbint.texinfo (Target Architecture Definition): Delete
        description of TARGET_BYTE_ORDER_DEFAULT.
 
-2002-01-27  Eli Zaretskii  <eliz@gnu.org>
+2002-01-27  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Fix typos and markup.  From Dmitry Sivachenko
        <mitya@cavia.pp.ru>.
@@ -1634,7 +1582,7 @@ Tue Jan 22 11:57:38 2002  Andrew Cagney  <cagney@redhat.com>
        * gdbint.texinfo (Target Architecture Definition): Remove
        definition of IEEE_FLOAT.
 
-2002-01-20  Eli Zaretskii  <eliz@gnu.org>
+2002-01-20  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Beautify copyright years; fix a typo.
        (DJGPP Native): Fix overfull hboxes in examples.  From Brian Youmans
@@ -1660,7 +1608,7 @@ Tue Jan 22 11:57:38 2002  Andrew Cagney  <cagney@redhat.com>
 
        * fdl.texi: Remove next/prev from @node.
 
-2002-01-17  Eli Zaretskii  <eliz@gnu.org>
+2002-01-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: @include fdl.texi.  Fixes for overfull hboxes and
        for monstrous @multitable (from Brian Youmans).
@@ -1692,7 +1640,7 @@ Tue Jan 22 11:57:38 2002  Andrew Cagney  <cagney@redhat.com>
 
        * gdb.texinfo (--pid): Document new command line option (attach).
 
-2002-01-07  Eli Zaretskii  <eliz@gnu.org>
+2002-01-07  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Tracepoints): Clarify that tracepoints need support
        in the stub.
@@ -1716,7 +1664,7 @@ Tue Jan 22 11:57:38 2002  Andrew Cagney  <cagney@redhat.com>
        * gdb.texinfo (Free Software): New section ``Free Software Needs
        Free Documentation''.
 
-2001-12-30  Eli Zaretskii  <eliz@gnu.org>
+2001-12-30  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * stabs.texinfo:
        * gdb.texinfo:
@@ -1763,7 +1711,7 @@ Tue Jan 22 11:57:38 2002  Andrew Cagney  <cagney@redhat.com>
        * gdb.texinfo (Options): Eliminate attempt to explain .gdbinit/gdb.ini
        use since it is described in the referenced section.
 
-       From Eli Zaretskii <eliz@gnu.org>
+       From Eli Zaretskii <eliz@is.elta.co.il>
        * gdb.texinfo (Command Files): Reword to make gdb.ini requirement
        clearer when using DJGPP.
 
@@ -1877,7 +1825,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
 
        * gdbint.texinfo (libgdb): Rewrite.
 
-2001-07-26  Eli Zaretskii  <eliz@gnu.org>
+2001-07-26  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * Makefile.in (gdbgui.dvi, gdb-gui, gdbgui.info): Targets deleted.
 
@@ -1891,7 +1839,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
        * gdbint.texinfo (Host Definition): Remove description of
        NEED_POSIX_SETPGID.
 
-2001-07-23  Eli Zaretskii  <eliz@gnu.org>
+2001-07-23  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.tex (DJGPP Native): New node, with descriptions of
        DJGPP-specific commands.
@@ -1930,7 +1878,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
        EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_STRUCT_VALUE_ADDRESS_P.
        The latter has been changed to a true predicate.
 
-2001-06-17  Eli Zaretskii  <eliz@gnu.org>
+2001-06-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * annotate.texi: Add @noindent where needed.  From Dmitry
        Sivachenko <dima@Chg.RU>.
@@ -1949,7 +1897,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
 
        * gdb.texinfo (Protocol): Add doc for new packet "qSymbol:".
 
-2001-06-13  Eli Zaretskii  <eliz@gnu.org>
+2001-06-13  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Signals): Clarify the default setting of signal
        handling.
@@ -1963,20 +1911,20 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
 
        * Makefile.in (GDBvn.texi): Set GDBVN from ../version.in.
 
-2001-05-10  Eli Zaretskii  <eliz@gnu.org>
+2001-05-10  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdbint.texinfo (Clean Design and Portable Implementation):
        Renamed from "Clean Design".
        (Clean Design and Portable Implementation): Document portable
        methods of handling file names, and the associated macros.
 
-2001-04-02  Eli Zaretskii  <eliz@gnu.org>
+2001-04-02  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Tracepoint Actions): Mention the "info scope"
        command and provide a cross-reference to its description.
        (Symbols): Note that "info scope" is useful for trace experiments.
 
-2001-04-01  Eli Zaretskii  <eliz@gnu.org>
+2001-04-01  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Symbols): Document "info scope".
        (Tracepoints): New chapter.
@@ -1988,7 +1936,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
 
        * stabs.texinfo: Change Permissions to GFDL.  Update Copyright.
 
-2001-03-26  Eli Zaretskii  <eliz@gnu.org>
+2001-03-26  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Change Permissions to GFDL.  Update Copyright.
 
@@ -2003,7 +1951,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
        a cross-reference to its description.
        (Symbols): Document "info symbol".
 
-2001-03-21  Eli Zaretskii  <eliz@gnu.org>
+2001-03-21  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdbint.texinfo (Algorithms): New section "Watchpoints" and new
        subsection "x86 Watchpoints".
@@ -2022,11 +1970,11 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
        * Makefile.in, all-cfg.texi, annotate.texi, gdb.texinfo,
        gdbint.texinfo, refcard.tex: Update/correct copyright notices.
 
-2001-02-21  Eli Zaretskii  <eliz@gnu.org>
+2001-02-21  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Signals): Document "ignore", "noignore", and "all".
 
-2001-02-11  Eli Zaretskii  <eliz@gnu.org>
+2001-02-11  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Environment): Document that `path' does not change
        the value of PATH in GDB's own environment (it did in the past,
@@ -2045,7 +1993,7 @@ Wed Aug 15 10:47:28 2001  Christopher Faylor <cgf@cygnus.com>
 
        * gdbint.texinfo (POP_FRAME): Document use by return_command.
 
-2000-12-25  Eli Zaretskii  <eliz@gnu.org>
+2000-12-25  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * refcard.tex: Version and copyright fixed.  From Phil Edwards
        <pedwards@disaster.jaj.com>.
@@ -2060,7 +2008,7 @@ Mon Nov 20 21:29:35 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * gdbint.texinfo (Coding): Update current value of
        --enable-build-warnings.  Mention --enable-gdb-build-warnings.
 
-2000-11-19  Eli Zaretskii  <eliz@gnu.org>
+2000-11-19  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Continuing and Stepping):  Fixed markup and typos,
        as suggested by Dmitry Sivachenko <dima@Chg.RU>.
@@ -2069,12 +2017,12 @@ Mon Nov 20 21:29:35 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdb.texinfo: Document new 'set step-mode' command.
 
-2000-10-16  Eli Zaretskii  <eliz@gnu.org>
+2000-10-16  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Contributors, MIPS Embedded): Minor spelling
        changes from Dmitry Sivachenko <dima@Chg.RU>.
 
-2000-09-26  Eli Zaretskii  <eliz@gnu.org>
+2000-09-26  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Hooks): Document the new post-hook functionality.
        From Steven Johnson <sbjohnson@ozemail.com.au>.
@@ -2083,7 +2031,7 @@ Mon Nov 20 21:29:35 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdbint.texinfo (Overall Structure): Spelling fix.
 
-2000-08-10  Eli Zaretskii  <eliz@gnu.org>
+2000-08-10  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdbint.texinfo (Target Architecture Definition): Document that
        REGISTER_CONVERT_TO_VIRTUAL should only be called on a register
@@ -2099,12 +2047,12 @@ Mon Nov 20 21:29:35 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * stabs.texinfo: Fix spelling errors.
        (String Field): FILE-NUMBER starts from 0, not 1.
 
-2000-07-05  Eli Zaretskii <eliz@gnu.org>
+2000-07-05  Eli Zaretskii <eliz@is.elta.co.il>
 
        * refcard.tex: Remove \centerline from the blurb.  Patch from
         Brian Youmans.
 
-2000-06-25  Eli Zaretskii <eliz@gnu.org>
+2000-06-25  Eli Zaretskii <eliz@is.elta.co.il>
 
        * Makefile.in (install-info): Support installation from outside of
         the source directory.  Reported by Mark Harig
@@ -2123,7 +2071,7 @@ Fri May 26 15:55:33 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        (gdb.texinfo, gdbint.texinfo, stabs.texinfo): When TeX insert the
        @contents at the start.
 
-2000-05-24  Eli Zaretskii  <eliz@gnu.org>
+2000-05-24  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Remove duplicate @syncodeindex.  From Brian
         Youmans.
@@ -2142,7 +2090,7 @@ Tue May 23 22:57:41 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * configure: Regenerate.
 
-2000-05-17  Eli Zaretskii  <eliz@gnu.org>
+2000-05-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * Makefile.in (install-info): Run install-info on installed Info
        files.
@@ -2152,7 +2100,7 @@ Fri May 12 20:18:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * gdb.texinfo: Add Stan Shebs, et.al. as authors.  Mention
        Andrew Cagney.
 
-2000-05-09  Eli Zaretskii  <eliz@gnu.org>
+2000-05-09  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo: Proofreading changes from Brian Youmans.
 
@@ -2161,7 +2109,7 @@ Fri May 12 20:18:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * gdb.texinfo (Command Files): Mention -x, use @enumerate for
        startup sequence, minor edits.
 
-2000-05-01  Eli Zaretskii  <eliz@gnu.org>
+2000-05-01  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * annotate.texi: Remove "@syncodeindex fn cp", it causes grief in
        TeX.
@@ -2175,7 +2123,7 @@ Sat Apr 29 17:01:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdbint.texinfo (Hints): Do not use @value{GDBN in @nodes.
 
-2000-04-23  Eli Zaretskii  <eliz@gnu.org>
+2000-04-23  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * Makefile.in (GDBMI_DIR): New variable.
        (SET_TEXINPUTS): Add $(GDBMI_DIR).
@@ -2194,19 +2142,19 @@ Sat Apr 29 17:01:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * gdb.texinfo (Files): Update description of add-symbol-file
        command.
 
-2000-04-17  Eli Zaretskii  <eliz@gnu.org>
+2000-04-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Porting GDB): Don't use @value in the node name, it
        prevents the build (and is generally a Bad Idea).
 
-2000-04-17  Eli Zaretskii  <eliz@gnu.org>
+2000-04-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Protocol): Prevent makeinfo from complaining about
        a comma inside @var.
        (Command Files): Index markup changes from Dmitry Sivachenko
        <dima@Chg.RU>.
 
-2000-04-16  Eli Zaretskii  <eliz@gnu.org>
+2000-04-16  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * Makefile.in (LN_S): Define.
        (gdb-cfg.texi, gdb.dvi, links2roff, inc-hist.texinfo): Don't
@@ -2318,7 +2266,7 @@ Fri Mar 24 17:56:48 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        <dima@Chg.RU>, also clarification of allowed content for
        string constants.
 
-2000-03-16  Eli Zaretskii <eliz@gnu.org>
+2000-03-16  Eli Zaretskii <eliz@is.elta.co.il>
 
        * gdb.texinfo (main menu): Add Annotations.
        (File Options): Add @cindex entries for each command-line option.
@@ -2407,7 +2355,7 @@ Thu Oct 14 21:17:17 1999  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdb.texinfo: Fix uses of @multitable.
 
-       From Eli Zaretskii  <eliz@gnu.org>:
+       From Eli Zaretskii  <eliz@is.elta.co.il>:
        * gdb.texinfo: Include details specific to DOS host, clarify
        some confusing language, fix @ref/@xref/@pxref usages, add
        comments about using with optimization, add more indexing,
@@ -2464,7 +2412,7 @@ Wed Aug 25 10:47:03 1999  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdbint.texinfo (Breakpoint Handling): Add missing words.
 
-1999-08-10  Eli Zaretskii  <eliz@gnu.org>
+1999-08-10  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * gdb.texinfo (Set Watchpoints): Explain some subtleties about
        watch, awatch, and rwatch.  Explain why the latter two cannot be
index 6af8d37896b433ce2daede481cf78500ab6680e7..0f4f2770bd588dd9926d8056a2bf2dffaaca644d 100644 (file)
@@ -2590,19 +2590,10 @@ an @code{fo} followed by zero or more @code{o}s.  There is an implicit
 @code{.*} leading and trailing the regular expression you supply, so to
 match only functions that begin with @code{foo}, use @code{^foo}.
 
-@cindex non-member C@t{++} functions, set breakpoint in
 When debugging C@t{++} programs, @code{rbreak} is useful for setting
 breakpoints on overloaded functions that are not members of any special
 classes.
 
-@cindex set breakpoints on all functions
-The @code{rbreak} command can be used to set breakpoints in
-@strong{all} the functions in a program, like this:
-
-@smallexample
-(@value{GDBP}) rbreak .
-@end smallexample
-
 @kindex info breakpoints
 @cindex @code{$_} and @code{info breakpoints}
 @item info breakpoints @r{[}@var{n}@r{]}
@@ -6309,7 +6300,7 @@ $ gdb -nw charset-test
 GNU gdb 2001-12-19-cvs
 Copyright 2001 Free Software Foundation, Inc.
 @dots{}
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 We can use the @code{show charset} command to see what character sets
@@ -6317,18 +6308,18 @@ We can use the @code{show charset} command to see what character sets
 strings:
 
 @smallexample
-(@value{GDBP}) show charset
+(gdb) show charset
 The current host and target character set is `ISO-8859-1'.
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 For the sake of printing this manual, let's use @sc{ascii} as our
 initial character set:
 @smallexample
-(@value{GDBP}) set charset ASCII
-(@value{GDBP}) show charset
+(gdb) set charset ASCII
+(gdb) show charset
 The current host and target character set is `ASCII'.
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 Let's assume that @sc{ascii} is indeed the correct character set for our
@@ -6338,20 +6329,20 @@ them properly.  Since our current target character set is also
 @sc{ascii}, the contents of @code{ascii_hello} print legibly:
 
 @smallexample
-(@value{GDBP}) print ascii_hello
+(gdb) print ascii_hello
 $1 = 0x401698 "Hello, world!\n"
-(@value{GDBP}) print ascii_hello[0]
+(gdb) print ascii_hello[0]
 $2 = 72 'H'
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 @value{GDBN} uses the target character set for character and string
 literals you use in expressions:
 
 @smallexample
-(@value{GDBP}) print '+'
+(gdb) print '+'
 $3 = 43 '+'
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 The @sc{ascii} character set uses the number 43 to encode the @samp{+}
@@ -6362,20 +6353,20 @@ target program uses.  If we print @code{ibm1047_hello} while our target
 character set is still @sc{ascii}, we get jibberish:
 
 @smallexample
-(@value{GDBP}) print ibm1047_hello
+(gdb) print ibm1047_hello
 $4 = 0x4016a8 "\310\205\223\223\226k@@\246\226\231\223\204Z%"
-(@value{GDBP}) print ibm1047_hello[0]
+(gdb) print ibm1047_hello[0]
 $5 = 200 '\310'
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB},
 @value{GDBN} tells us the character sets it supports:
 
 @smallexample
-(@value{GDBP}) set target-charset
+(gdb) set target-charset
 ASCII       EBCDIC-US   IBM1047     ISO-8859-1
-(@value{GDBP}) set target-charset
+(gdb) set target-charset
 @end smallexample
 
 We can select @sc{ibm1047} as our target character set, and examine the
@@ -6385,28 +6376,28 @@ target character set, @sc{ibm1047}, to the host character set,
 @sc{ascii}, and they display correctly:
 
 @smallexample
-(@value{GDBP}) set target-charset IBM1047
-(@value{GDBP}) show charset
+(gdb) set target-charset IBM1047
+(gdb) show charset
 The current host character set is `ASCII'.
 The current target character set is `IBM1047'.
-(@value{GDBP}) print ascii_hello
+(gdb) print ascii_hello
 $6 = 0x401698 "\110\145%%?\054\040\167?\162%\144\041\012"
-(@value{GDBP}) print ascii_hello[0]
+(gdb) print ascii_hello[0]
 $7 = 72 '\110'
-(@value{GDBP}) print ibm1047_hello
+(gdb) print ibm1047_hello
 $8 = 0x4016a8 "Hello, world!\n"
-(@value{GDBP}) print ibm1047_hello[0]
+(gdb) print ibm1047_hello[0]
 $9 = 200 'H'
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 As above, @value{GDBN} uses the target character set for character and
 string literals you use in expressions:
 
 @smallexample
-(@value{GDBP}) print '+'
+(gdb) print '+'
 $10 = 78 '+'
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 The @sc{ibm1047} character set uses the number 78 to encode the @samp{+}
@@ -6547,7 +6538,7 @@ $ gdb -nw sample
 GNU gdb 2002-05-06-cvs
 Copyright 2002 Free Software Foundation, Inc.
 GDB is free software, @dots{}
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 We can expand macros and examine their definitions, even when the
@@ -6555,7 +6546,7 @@ program is not running.  @value{GDBN} uses the current listing position
 to decide which macro definitions are in scope:
 
 @smallexample
-(@value{GDBP}) list main
+(gdb) list main
 3
 4       #define M 42
 5       #define ADD(x) (M + x)
@@ -6566,18 +6557,18 @@ to decide which macro definitions are in scope:
 10        printf ("Hello, world!\n");
 11      #undef N
 12        printf ("We're so creative.\n");
-(@value{GDBP}) info macro ADD
+(gdb) info macro ADD
 Defined at /home/jimb/gdb/macros/play/sample.c:5
 #define ADD(x) (M + x)
-(@value{GDBP}) info macro Q
+(gdb) info macro Q
 Defined at /home/jimb/gdb/macros/play/sample.h:1
   included at /home/jimb/gdb/macros/play/sample.c:2
 #define Q <
-(@value{GDBP}) macro expand ADD(1)
+(gdb) macro expand ADD(1)
 expands to: (42 + 1)
-(@value{GDBP}) macro expand-once ADD(1)
+(gdb) macro expand-once ADD(1)
 expands to: once (M + 1)
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 In the example above, note that @command{macro expand-once} expands only
@@ -6589,27 +6580,27 @@ Once the program is running, GDB uses the macro definitions in force at
 the source line of the current stack frame:
 
 @smallexample
-(@value{GDBP}) break main
+(gdb) break main
 Breakpoint 1 at 0x8048370: file sample.c, line 10.
-(@value{GDBP}) run
+(gdb) run
 Starting program: /home/jimb/gdb/macros/play/sample
 
 Breakpoint 1, main () at sample.c:10
 10        printf ("Hello, world!\n");
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 At line 10, the definition of the macro @code{N} at line 9 is in force:
 
 @smallexample
-(@value{GDBP}) info macro N
+(gdb) info macro N
 Defined at /home/jimb/gdb/macros/play/sample.c:9
 #define N 28
-(@value{GDBP}) macro expand N Q M
+(gdb) macro expand N Q M
 expands to: 28 < 42
-(@value{GDBP}) print N Q M
+(gdb) print N Q M
 $1 = 1
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 As we step over directives that remove @code{N}'s definition, and then
@@ -6617,23 +6608,23 @@ give it a new definition, @value{GDBN} finds the definition (or lack
 thereof) in force at each point:
 
 @smallexample
-(@value{GDBP}) next
+(gdb) next
 Hello, world!
 12        printf ("We're so creative.\n");
-(@value{GDBP}) info macro N
+(gdb) info macro N
 The symbol `N' has no definition as a C/C++ preprocessor macro
 at /home/jimb/gdb/macros/play/sample.c:12
-(@value{GDBP}) next
+(gdb) next
 We're so creative.
 14        printf ("Goodbye, world!\n");
-(@value{GDBP}) info macro N
+(gdb) info macro N
 Defined at /home/jimb/gdb/macros/play/sample.c:13
 #define N 1729
-(@value{GDBP}) macro expand N Q M
+(gdb) macro expand N Q M
 expands to: 1729 < 42
-(@value{GDBP}) print N Q M
+(gdb) print N Q M
 $2 = 0
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 
@@ -7489,7 +7480,7 @@ Normally, when @value{GDBN} prints a code address, it includes the name
 of the function the address falls in:
 
 @smallexample
-(@value{GDBP}) print main
+(gdb) print main
 $3 = @{int ()@} 0x11a0 <main>
 @end smallexample
 @noindent
@@ -7499,9 +7490,9 @@ asterisks around them.  For example, if @code{foo} is a function in an
 unmapped overlay, @value{GDBN} prints it this way:
 
 @smallexample
-(@value{GDBP}) overlay list
+(gdb) overlay list
 No sections are mapped.
-(@value{GDBP}) print foo
+(gdb) print foo
 $5 = @{int (int)@} 0x100000 <*foo*>
 @end smallexample
 @noindent
@@ -7509,10 +7500,10 @@ When @code{foo}'s overlay is mapped, @value{GDBN} prints the function's
 name normally:
 
 @smallexample
-(@value{GDBP}) overlay list
+(gdb) overlay list
 Section .ov.foo.text, loaded at 0x100000 - 0x100034,
         mapped at 0x1016 - 0x104a
-(@value{GDBP}) print foo
+(gdb) print foo
 $6 = @{int (int)@} 0x1016 <foo>
 @end smallexample
 
@@ -7717,11 +7708,6 @@ If a source file name ends in one of the following extensions, then
 @value{GDBN} infers that its language is the one indicated.
 
 @table @file
-@item .ada
-@itemx .ads
-@itemx .adb
-@itemx .a
-Ada source file.
 
 @item .c
 C source file
@@ -8010,7 +7996,7 @@ being set automatically by @value{GDBN}.
 @node Support
 @section Supported languages
 
-@value{GDBN} supports C, C@t{++}, Objective-C, Fortran, Java, assembly, Modula-2, and Ada.
+@value{GDBN} supports C, C@t{++}, Objective-C, Fortran, Java, assembly, and Modula-2.
 @c This is false ...
 Some @value{GDBN} features may be used in expressions regardless of the
 language you use: the @value{GDBN} @code{@@} and @code{::} operators,
@@ -8030,7 +8016,6 @@ language reference or tutorial.
 * C::                           C and C@t{++}
 * Objective-C::                 Objective-C
 * Modula-2::                    Modula-2
-* Ada::                         Ada
 @end menu
 
 @node C
@@ -8646,7 +8631,7 @@ the description of an object.  However, this command may only work
 with certain Objective-C libraries that have a particular hook
 function, @code{_NSPrintForDebugger}, defined.
 
-@node Modula-2, Ada, Objective-C, Support
+@node Modula-2,  , Objective-C, Support
 @subsection Modula-2
 
 @cindex Modula-2, @value{GDBN} support
@@ -9089,341 +9074,6 @@ address can be specified by an integral constant, the construct
 In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is
 interpreted as the beginning of a comment.  Use @code{<>} instead.
 
-@node Ada
-@subsection Ada
-@cindex Ada
-
-The extensions made to @value{GDBN} for Ada only support
-output from the @sc{gnu} Ada (GNAT) compiler.
-Other Ada compilers are not currently supported, and
-attempting to debug executables produced by them is most likely
-to be difficult.
-
-
-@cindex expressions in Ada
-@menu
-* Ada Mode Intro::              General remarks on the Ada syntax 
-                                   and semantics supported by Ada mode 
-                                   in @value{GDBN}.
-* Omissions from Ada::          Restrictions on the Ada expression syntax.
-* Additions to Ada::            Extensions of the Ada expression syntax.
-* Stopping Before Main Program:: Debugging the program during elaboration.
-* Ada Glitches::                Known peculiarities of Ada mode.
-@end menu
-
-@node Ada Mode Intro
-@subsubsection Introduction
-@cindex Ada mode, general
-
-The Ada mode of @value{GDBN} supports a fairly large subset of Ada expression 
-syntax, with some extensions.
-The philosophy behind the design of this subset is 
-
-@itemize @bullet
-@item
-That @value{GDBN} should provide basic literals and access to operations for 
-arithmetic, dereferencing, field selection, indexing, and subprogram calls, 
-leaving more sophisticated computations to subprograms written into the
-program (which therefore may be called from @value{GDBN}).
-
-@item 
-That type safety and strict adherence to Ada language restrictions
-are not particularly important to the @value{GDBN} user.
-
-@item 
-That brevity is important to the @value{GDBN} user.
-@end itemize
-
-Thus, for brevity, the debugger acts as if there were 
-implicit @code{with} and @code{use} clauses in effect for all user-written 
-packages, making it unnecessary to fully qualify most names with 
-their packages, regardless of context.  Where this causes ambiguity, 
-@value{GDBN} asks the user's intent.
-
-The debugger will start in Ada mode if it detects an Ada main program. 
-As for other languages, it will enter Ada mode when stopped in a program that
-was translated from an Ada source file.
-
-While in Ada mode, you may use `@t{--}' for comments.  This is useful 
-mostly for documenting command files.  The standard @value{GDBN} comment 
-(@samp{#}) still works at the beginning of a line in Ada mode, but not in the 
-middle (to allow based literals).
-
-The debugger supports limited overloading.  Given a subprogram call in which
-the function symbol has multiple definitions, it will use the number of 
-actual parameters and some information about their types to attempt to narrow
-the set of definitions.  It also makes very limited use of context, preferring
-procedures to functions in the context of the @code{call} command, and
-functions to procedures elsewhere. 
-
-@node Omissions from Ada
-@subsubsection Omissions from Ada
-@cindex Ada, omissions from
-
-Here are the notable omissions from the subset:
-
-@itemize @bullet
-@item
-Only a subset of the attributes are supported:
-
-@itemize @minus
-@item
-@t{'First}, @t{'Last}, and @t{'Length}
- on array objects (not on types and subtypes).
-
-@item
-@t{'Min} and @t{'Max}.  
-
-@item 
-@t{'Pos} and @t{'Val}. 
-
-@item
-@t{'Tag}.
-
-@item
-@t{'Range} on array objects (not subtypes), but only as the right
-operand of the membership (@code{in}) operator.
-
-@item 
-@t{'Access}, @t{'Unchecked_Access}, and 
-@t{'Unrestricted_Access} (a GNAT extension).
-
-@item
-@t{'Address}.
-@end itemize
-
-@item
-The names in
-@code{Characters.Latin_1} are not available and
-concatenation is not implemented.  Thus, escape characters in strings are 
-not currently available.
-
-@item
-Equality tests (@samp{=} and @samp{/=}) on arrays test for bitwise
-equality of representations.  They will generally work correctly
-for strings and arrays whose elements have integer or enumeration types.
-They may not work correctly for arrays whose element
-types have user-defined equality, for arrays of real values 
-(in particular, IEEE-conformant floating point, because of negative
-zeroes and NaNs), and for arrays whose elements contain unused bits with
-indeterminate values.  
-
-@item
-The other component-by-component array operations (@code{and}, @code{or}, 
-@code{xor}, @code{not}, and relational tests other than equality)
-are not implemented. 
-
-@item 
-There are no record or array aggregates.
-
-@item
-Calls to dispatching subprograms are not implemented.
-
-@item
-The overloading algorithm is much more limited (i.e., less selective)
-than that of real Ada.  It makes only limited use of the context in which a subexpression
-appears to resolve its meaning, and it is much looser in its rules for allowing
-type matches.  As a result, some function calls will be ambiguous, and the user
-will be asked to choose the proper resolution.
-
-@item
-The @code{new} operator is not implemented.
-
-@item
-Entry calls are not implemented.
-
-@item 
-Aside from printing, arithmetic operations on the native VAX floating-point 
-formats are not supported.
-
-@item
-It is not possible to slice a packed array.
-@end itemize
-
-@node Additions to Ada
-@subsubsection Additions to Ada
-@cindex Ada, deviations from 
-
-As it does for other languages, @value{GDBN} makes certain generic
-extensions to Ada (@pxref{Expressions}):
-
-@itemize @bullet
-@item
-If the expression @var{E} is a variable residing in memory 
-(typically a local variable or array element) and @var{N} is 
-a positive integer, then @code{@var{E}@@@var{N}} displays the values of
-@var{E} and the @var{N}-1 adjacent variables following it in memory as an array.  
-In Ada, this operator is generally not necessary, since its prime use
-is in displaying parts of an array, and slicing will usually do this in Ada.
-However, there are occasional uses when debugging programs
-in which certain debugging information has been optimized away.
-
-@item
-@code{@var{B}::@var{var}} means ``the variable named @var{var} that appears
-in function or file @var{B}.''  When @var{B} is a file name, you must typically
-surround it in single quotes.
-
-@item 
-The expression @code{@{@var{type}@} @var{addr}} means ``the variable of type
-@var{type} that appears at address @var{addr}.''
-
-@item
-A name starting with @samp{$} is a convenience variable 
-(@pxref{Convenience Vars}) or a machine register (@pxref{Registers}).
-@end itemize
-
-In addition, @value{GDBN} provides a few other shortcuts and outright additions specific 
-to Ada:
-
-@itemize @bullet
-@item 
-The assignment statement is allowed as an expression, returning
-its right-hand operand as its value.  Thus, you may enter
-
-@smallexample
-set x := y + 3
-print A(tmp := y + 1)
-@end smallexample
-
-@item 
-The semicolon is allowed as an ``operator,''  returning as its value 
-the value of its right-hand operand.
-This allows, for example,
-complex conditional breaks:
-
-@smallexample
-break f
-condition 1 (report(i); k += 1; A(k) > 100)
-@end smallexample
-
-@item 
-Rather than use catenation and symbolic character names to introduce special 
-characters into strings, one may instead use a special bracket notation, 
-which is also used to print strings.  A sequence of characters of the form 
-@samp{["@var{XX}"]} within a string or character literal denotes the 
-(single) character whose numeric encoding is @var{XX} in hexadecimal.  The
-sequence of characters @samp{["""]} also denotes a single quotation mark 
-in strings.   For example,
-@smallexample
-   "One line.["0a"]Next line.["0a"]"
-@end smallexample
-@noindent
-contains an ASCII newline character (@code{Ada.Characters.Latin_1.LF}) after each
-period.
-
-@item
-The subtype used as a prefix for the attributes @t{'Pos}, @t{'Min}, and
-@t{'Max} is optional (and is ignored in any case).  For example, it is valid
-to write
-
-@smallexample
-print 'max(x, y)
-@end smallexample
-
-@item
-When printing arrays, @value{GDBN} uses positional notation when the 
-array has a lower bound of 1, and uses a modified named notation otherwise.
-For example, a one-dimensional array of three integers with a lower bound of 3 might print as
-
-@smallexample
-(3 => 10, 17, 1)
-@end smallexample
-
-@noindent
-That is, in contrast to valid Ada, only the first component has a @code{=>} 
-clause.
-
-@item
-You may abbreviate attributes in expressions with any unique,
-multi-character subsequence of 
-their names (an exact match gets preference).
-For example, you may use @t{a'len}, @t{a'gth}, or @t{a'lh}
-in place of  @t{a'length}.
-
-@item
-@cindex quoting Ada internal identifiers
-Since Ada is case-insensitive, the debugger normally maps identifiers you type 
-to lower case.  The GNAT compiler uses upper-case characters for 
-some of its internal identifiers, which are normally of no interest to users.
-For the rare occasions when you actually have to look at them,
-enclose them in angle brackets to avoid the lower-case mapping. 
-For example,
-@smallexample
-@value{GDBP} print <JMPBUF_SAVE>[0]
-@end smallexample
-
-@item
-Printing an object of class-wide type or dereferencing an 
-access-to-class-wide value will display all the components of the object's
-specific type (as indicated by its run-time tag).  Likewise, component
-selection on such a value will operate on the specific type of the
-object.
-
-@end itemize
-
-@node Stopping Before Main Program
-@subsubsection Stopping at the Very Beginning
-
-@cindex breakpointing Ada elaboration code
-It is sometimes necessary to debug the program during elaboration, and
-before reaching the main procedure.
-As defined in the Ada Reference
-Manual, the elaboration code is invoked from a procedure called
-@code{adainit}.  To run your program up to the beginning of
-elaboration, simply use the following two commands:
-@code{tbreak adainit} and @code{run}.
-
-@node Ada Glitches
-@subsubsection Known Peculiarities of Ada Mode
-@cindex Ada, problems
-
-Besides the omissions listed previously (@pxref{Omissions from Ada}),
-we know of several problems with and limitations of Ada mode in
-@value{GDBN},
-some of which will be fixed with planned future releases of the debugger 
-and the GNU Ada compiler.
-
-@itemize @bullet
-@item
-Currently, the debugger 
-has insufficient information to determine whether certain pointers represent
-pointers to objects or the objects themselves.
-Thus, the user may have to tack an extra @code{.all} after an expression
-to get it printed properly.
-
-@item 
-Static constants that the compiler chooses not to materialize as objects in 
-storage are invisible to the debugger.
-
-@item
-Named parameter associations in function argument lists are ignored (the
-argument lists are treated as positional).
-
-@item
-Many useful library packages are currently invisible to the debugger.
-
-@item
-Fixed-point arithmetic, conversions, input, and output is carried out using 
-floating-point arithmetic, and may give results that only approximate those on 
-the host machine.
-
-@item
-The type of the @t{'Address} attribute may not be @code{System.Address}.
-
-@item
-The GNAT compiler never generates the prefix @code{Standard} for any of 
-the standard symbols defined by the Ada language.  @value{GDBN} knows about 
-this: it will strip the prefix from names when you use it, and will never
-look for a name you have so qualified among local symbols, nor match against
-symbols in other packages or subprograms.  If you have 
-defined entities anywhere in your program other than parameters and 
-local variables whose simple names match names in @code{Standard}, 
-GNAT's lack of qualification here can cause confusion.  When this happens,
-you can usually resolve the confusion 
-by qualifying the problematic names with package
-@code{Standard} explicitly.  
-@end itemize
-
 @node Unsupported languages
 @section Unsupported languages
 
@@ -12106,7 +11756,7 @@ some confusion. If in doubt, try the @code{info functions} and
 @pxref{Symbols}). Here's an example:
 
 @smallexample
-(@value{GDBP}) info function CreateFileA
+(gdb) info function CreateFileA
 All functions matching regular expression "CreateFileA":
 
 Non-debugging symbols:
@@ -12115,7 +11765,7 @@ Non-debugging symbols:
 @end smallexample
 
 @smallexample
-(@value{GDBP}) info function !
+(gdb) info function !
 All functions matching regular expression "!":
 
 Non-debugging symbols:
@@ -12142,28 +11792,28 @@ type information in the command. Here's an example of the type of
 problem:
 
 @smallexample
-(@value{GDBP}) print 'cygwin1!__argv'
+(gdb) print 'cygwin1!__argv'
 $1 = 268572168
 @end smallexample
 
 @smallexample
-(@value{GDBP}) x 'cygwin1!__argv'
+(gdb) x 'cygwin1!__argv'
 0x10021610:      "\230y\""
 @end smallexample
 
 And two possible solutions:
 
 @smallexample
-(@value{GDBP}) print ((char **)'cygwin1!__argv')[0]
+(gdb) print ((char **)'cygwin1!__argv')[0]
 $2 = 0x22fd98 "/cygdrive/c/mydirectory/myprogram"
 @end smallexample
 
 @smallexample
-(@value{GDBP}) x/2x &'cygwin1!__argv'
+(gdb) x/2x &'cygwin1!__argv'
 0x610c0aa8 <cygwin1!__argv>:    0x10021608      0x00000000
-(@value{GDBP}) x/x 0x10021608
+(gdb) x/x 0x10021608
 0x10021608:     0x0022fd98
-(@value{GDBP}) x/s 0x0022fd98
+(gdb) x/s 0x0022fd98
 0x22fd98:        "/cygdrive/c/mydirectory/myprogram"
 @end smallexample
 
@@ -12174,7 +11824,7 @@ function's frame set-up code. You can work around this by using ``*&''
 to set the breakpoint at a raw memory address:
 
 @smallexample
-(@value{GDBP}) break *&'python22!PyOS_Readline'
+(gdb) break *&'python22!PyOS_Readline'
 Breakpoint 1 at 0x1e04eff0
 @end smallexample
 
@@ -13383,7 +13033,7 @@ Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
 @cindex readline
 @cindex command line editing
 
-@value{GDBN} reads its input commands via the @dfn{Readline} interface.  This
+@value{GDBN} reads its input commands via the @dfn{readline} interface.  This
 @sc{gnu} library provides consistent behavior for programs which provide a
 command line interface to the user.  Advantages are @sc{gnu} Emacs-style
 or @dfn{vi}-style inline editing of commands, @code{csh}-like history
@@ -13408,26 +13058,14 @@ Disable command line editing.
 Show whether command line editing is enabled.
 @end table
 
-@xref{Command Line Editing}, for more details about the Readline
-interface.  Users unfamiliar with @sc{gnu} Emacs or @code{vi} are
-encouraged to read that chapter.
-
 @node History
 @section Command history
-@cindex command history
 
 @value{GDBN} can keep track of the commands you type during your
 debugging sessions, so that you can be certain of precisely what
 happened.  Use these commands to manage the @value{GDBN} command
 history facility.
 
-@value{GDBN} uses the @sc{gnu} History library, a part of the Readline
-package, to provide the history facility.  @xref{Using History
-Interactively}, for the detailed description of the History library.
-
-Here is the description of @value{GDBN} commands related to command
-history.
-
 @table @code
 @cindex history substitution
 @cindex history file
@@ -13460,10 +13098,12 @@ This defaults to the value of the environment variable
 @code{HISTSIZE}, or to 256 if this variable is not set.
 @end table
 
+@cindex history expansion
 History expansion assigns special meaning to the character @kbd{!}.
-@xref{Event Designators}, for more details.
+@ifset have-readline-appendices
+@xref{Event Designators}.
+@end ifset
 
-@cindex history expansion, turn on/off
 Since @kbd{!} is also the logical not operator in C, history expansion
 is off by default. If you decide to enable history expansion with the
 @code{set history expansion on} command, you may sometimes need to
@@ -13477,12 +13117,19 @@ The commands to control history expansion are:
 @table @code
 @item set history expansion on
 @itemx set history expansion
-@kindex set history expansion
+@cindex history expansion
 Enable history expansion.  History expansion is off by default.
 
 @item set history expansion off
 Disable history expansion.
 
+The readline code comes with more complete documentation of
+editing and history expansion features.  Users unfamiliar with @sc{gnu} Emacs
+or @code{vi} may wish to read it.
+@ifset have-readline-appendices
+@xref{Command Line Editing}.
+@end ifset
+
 @c @group
 @kindex show history
 @item show history
@@ -15021,7 +14668,7 @@ corresponding output for that command will also be prefixed by that same
 
 @table @code
 @item @var{output} @expansion{}
-@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(@value{GDBP})" @var{nl}}
+@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
 
 @item @var{result-record} @expansion{}
 @code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
@@ -18884,7 +18531,7 @@ for details.
 This GDB was configured as "i386-pc-linux-gnu"
 
 ^Z^Zpre-prompt
-(@value{GDBP})
+(gdb)
 ^Z^Zprompt
 @kbd{quit}
 
@@ -19806,13 +19453,13 @@ either quit @value{GDBN} or create a core file of the current
 @value{GDBN} session.
 
 @smallexample
-(@value{GDBP}) @kbd{maint internal-error testing, 1, 2}
+(gdb) @kbd{maint internal-error testing, 1, 2}
 @dots{}/maint.c:121: internal-error: testing, 1, 2
 A problem internal to GDB has been detected.  Further
 debugging may prove unreliable.
 Quit this debugging session? (y or n) @kbd{n}
 Create a core file? (y or n) @kbd{n}
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 Takes an optional parameter that is used as the text of the error or
@@ -19824,18 +19471,18 @@ warning message.
 Prints the contents of @value{GDBN}'s internal dummy-frame stack.
 
 @smallexample
-(@value{GDBP}) @kbd{b add}
+(gdb) @kbd{b add}
 @dots{}
-(@value{GDBP}) @kbd{print add(2,3)}
+(gdb) @kbd{print add(2,3)}
 Breakpoint 2, add (a=2, b=3) at @dots{}
 58       return (a + b);
 The program being debugged stopped while in a function called from GDB.
 @dots{}
-(@value{GDBP}) @kbd{maint print dummy-frames}
+(gdb) @kbd{maint print dummy-frames}
 0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6
  top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@}
  call_lo=0x01014000 call_hi=0x01014001
-(@value{GDBP})
+(gdb)
 @end smallexample
 
 Takes an optional file parameter.
@@ -19866,7 +19513,7 @@ Print @value{GDBN}'s internal register group data structures.
 Takes an optional file parameter.
 
 @smallexample
-(@value{GDBP}) @kbd{maint print reggroups}
+(gdb) @kbd{maint print reggroups}
  Group      Type
  general    user
  float      user
@@ -19895,19 +19542,6 @@ data in a @file{gmon.out} file, be sure to move it to a safe location.
 Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be
 compiled with the @samp{-pg} compiler option.
 
-@kindex maint set dwarf2 max-cache-age
-@kindex maint show dwarf2 max-cache-age
-@item maint set dwarf2 max-cache-age
-@itemx maint show dwarf2 max-cache-age
-Control the DWARF 2 compilation unit cache.
-
-In object files with inter-compilation-unit references, such as those
-produced by the GCC option @samp{-feliminate-dwarf2-dups}, the DWARF 2
-reader needs to frequently refer to previously read compilation units.
-This setting controls how long a compilation unit will remain in the cache
-if it is not referenced.  Setting it to zero disables caching, which will
-slow down @value{GDBN} startup but reduce memory consumption.
-
 @end table
 
 
@@ -20307,20 +19941,17 @@ Reserved for future use.
 
 @item @code{O} --- reserved
 
-@item @code{p}@var{hex number of register} --- read register packet
+Reserved for future use.
+
+@item @code{p}@var{n@dots{}} --- read reg @strong{(reserved)}
 @cindex @code{p} packet
 
-@xref{read registers packet}, for a description of how the returned
-register value is encoded.
+@xref{write register packet}.
 
 Reply:
 @table @samp
-@item @var{XX@dots{}}
-the register's value
-@item E@var{NN}
-for an error
-@item
-Indicating an unrecognized @var{query}.
+@item @var{r@dots{}.}
+The hex encoded value of the register in target byte order.
 @end table
 
 @item @code{P}@var{n@dots{}}@code{=}@var{r@dots{}} --- write register
@@ -21070,7 +20701,7 @@ previous activity (continue, step).  No additional continue or step
 request from @value{GDBN} is required.
 
 @smallexample
-(@value{GDBP}) continue
+(gdb) continue
   <- target requests 'system call X'
   target is stopped, @value{GDBN} executes system call
   -> GDB returns result
index 3c27769b53e3beabc197ab5b98dca3f43c819ef6..bff7d159e64470c28d2e5af4903dace82590ac63 100644 (file)
@@ -84,7 +84,6 @@ as the mechanisms that adapt @value{GDBN} to specific hosts and targets.
 * Support Libraries::
 * Coding::
 * Porting GDB::
-* Versions and Branches::
 * Releasing GDB::
 * Testsuite::
 * Hints::
@@ -477,10 +476,9 @@ no other code touches these values, the implementations of the above
 two macros can use them for their internal purposes.
 
 @findex target_stopped_data_address
-@item target_stopped_data_address (@var{addr_p})
-If the inferior has some watchpoint that triggered, place the address
-associated with the watchpoint at the location pointed to by
-@var{addr_p} and return non-zero.  Otherwise, return zero.
+@item target_stopped_data_address ()
+If the inferior has some watchpoint that triggered, return the address
+associated with that watchpoint.  Otherwise, return zero.
 
 @findex HAVE_STEPPABLE_WATCHPOINT
 @item HAVE_STEPPABLE_WATCHPOINT
@@ -600,25 +598,15 @@ less than 4, the number of debug registers available to x86
 processors.
 
 @findex i386_stopped_data_address
-@item i386_stopped_data_address (@var{addr_p})
-The target function
-@code{target_stopped_data_address} is set to call this function.
-This
+@item i386_stopped_data_address (void)
+The macros @code{STOPPED_BY_WATCHPOINT} and
+@code{target_stopped_data_address} are set to call this function.  The
+argument passed to @code{STOPPED_BY_WATCHPOINT} is ignored.  This
 function examines the breakpoint condition bits in the DR6 Debug
 Status register, as returned by the @code{I386_DR_LOW_GET_STATUS}
 macro, and returns the address associated with the first bit that is
 set in DR6.
 
-@findex i386_stopped_by_watchpoint
-@item i386_stopped_by_watchpoint (void)
-The macro @code{STOPPED_BY_WATCHPOINT}
-is set to call this function.  The
-argument passed to @code{STOPPED_BY_WATCHPOINT} is ignored.  This
-function examines the breakpoint condition bits in the DR6 Debug
-Status register, as returned by the @code{I386_DR_LOW_GET_STATUS}
-macro, and returns true if any bit is set.  Otherwise, false is
-returned.
-
 @findex i386_insert_watchpoint
 @findex i386_remove_watchpoint
 @item i386_insert_watchpoint (@var{addr}, @var{len}, @var{type})
@@ -666,7 +654,7 @@ register.
 @item i386_stopped_by_hwbp (void)
 This function returns non-zero if the inferior has some watchpoint or
 hardware breakpoint that triggered.  It works like
-@code{i386_stopped_data_address}, except that it doesn't record the
+@code{i386_stopped_data_address}, except that it doesn't return the
 address whose watchpoint triggered.
 
 @findex i386_cleanup_dregs
@@ -5380,198 +5368,109 @@ target-dependent @file{.h} and @file{.c} files used for your
 configuration.
 @end itemize
 
-@node Versions and Branches
-@chapter Versions and Branches
+@node Releasing GDB
 
-@section Versions
+@chapter Releasing @value{GDBN}
+@cindex making a new release of gdb
 
-@value{GDBN}'s version is determined by the file
-@file{gdb/version.in} and takes one of the following forms:
+@section Versions and Branches
 
-@table @asis
-@item @var{major}.@var{minor}
-@itemx @var{major}.@var{minor}.@var{patchlevel}
-an official release (e.g., 6.0 or 6.0.1)
-@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD}
-a snapshot (e.g., 6.0.50_20020630)
-@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}-@var{MM}-@var{DD}-cvs
-a @sc{cvs} check out (e.g., 6.0.90_2004-02-30-cvs)
-@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD} (@var{vendor})
-a vendor specific release of @value{GDBN}, that while based on@*
-@var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD},
-may contain additional changes
-@end table
+@subsection Version Identifiers
 
-@value{GDBN}'s mainline uses the @var{major} and @var{minor} version
-numbers from the most recent release branch, with a @var{patchlevel}
-of 50.  As each new release branch is created, the mainline
-@var{major} and @var{minor} version numbers are accordingly updated.
+@value{GDBN}'s version is determined by the file @file{gdb/version.in}.
 
-@value{GDBN}'s release branch uses a similar, but slightly more
-complicated scheme.  When the branch is first cut, the mainline's
-@var{patchlevel} is changed to .90.  As draft releases are drawn from
-the branch, the @var{patchlevel} is incremented.  Once the first
-release (@var{major}.@var{minor}) has been made, the version prefix is
-updated to @var{major}.@var{minor}.0.90.  Follow on releases have an
-incremented @var{patchlevel}.
+@value{GDBN}'s mainline uses ISO dates to differentiate between
+versions.  The CVS repository uses @var{YYYY}-@var{MM}-@var{DD}-cvs
+while the corresponding snapshot uses @var{YYYYMMDD}.
 
-If the previous @value{GDBN} version is 6.1 and the current version is
-6.2, then, substituting 6 for @var{major} and 1 or 2 for @var{minor},
-here's an illustration of a typical sequence:
+@value{GDBN}'s release branch uses a slightly more complicated scheme.
+When the branch is first cut, the mainline version identifier is
+prefixed with the @var{major}.@var{minor} from of the previous release
+series but with .90 appended.  As draft releases are drawn from the
+branch, the minor minor number (.90) is incremented.  Once the first
+release (@var{M}.@var{N}) has been made, the version prefix is updated
+to @var{M}.@var{N}.0.90 (dot zero, dot ninety).  Follow on releases have
+an incremented minor minor version number (.0).
 
-@smallexample
-     <HEAD>
-        |
-6.1.50_2002-03-02-cvs
-        |
-        +---------------------------.
-        |                    <gdb_6_2-branch>
-        |                           |
-6.2.50_2002-03-03-cvs        6.1.90 (draft #1)
-        |                           |
-6.2.50_2002-03-04-cvs        6.1.90_2002-03-04-cvs
-        |                           |
-6.2.50_2002-03-05-cvs        6.1.91 (draft #2)
-        |                           |
-6.2.50_2002-03-06-cvs        6.1.91_2002-03-06-cvs
-        |                           |
-6.2.50_2002-03-07-cvs        6.2 (release)
-        |                          |
-6.2.50_2002-03-08-cvs        6.2.0.90_2002-03-08-cvs
-        |                          |
-6.2.50_2002-03-09-cvs        6.2.1 (update)
-        |                           |
-6.2.50_2002-03-10-cvs         <branch closed>
-        |
-6.2.50_2002-03-11-cvs
-        |
-        +---------------------------.
-        |                     <gdb_6_3-branch>
-        |                           |
-6.3.50_2002-03-12-cvs        6.2.90 (draft #1)
-        |                           |
-@end smallexample
+Using 5.1 (previous) and 5.2 (current), the example below illustrates a
+typical sequence of version identifiers:
 
-@section Release Branches
-@cindex Release Branches
-
-@value{GDBN} draws a release series (6.2, 6.2.1, @dots{}) from a
-single release branch, and identifies that branch using the @sc{cvs}
-branch tags:
-
-@smallexample
-gdb_@var{major}_@var{minor}-@var{YYYY}@var{MM}@var{DD}-branchpoint
-gdb_@var{major}_@var{minor}-branch
-gdb_@var{major}_@var{minor}-@var{YYYY}@var{MM}@var{DD}-release
-@end smallexample
+@table @asis
+@item 5.1.1
+final release from previous branch
+@item 2002-03-03-cvs
+main-line the day the branch is cut
+@item 5.1.90-2002-03-03-cvs
+corresponding branch version
+@item 5.1.91
+first draft release candidate
+@item 5.1.91-2002-03-17-cvs
+updated branch version
+@item 5.1.92
+second draft release candidate
+@item 5.1.92-2002-03-31-cvs
+updated branch version
+@item 5.1.93
+final release candidate (see below)
+@item 5.2
+official release
+@item 5.2.0.90-2002-04-07-cvs
+updated CVS branch version
+@item 5.2.1
+second official release
+@end table
 
-@emph{Pragmatics: To help identify the date at which a branch or
-release is made, both the branchpoint and release tags include the
-date that they are cut (@var{YYYY}@var{MM}@var{DD}) in the tag.  The
-branch tag, denoting the head of the branch, does not need this.}
+Notes:
 
-@section Vendor Branches
-@cindex vendor branches
+@itemize @bullet
+@item
+Minor minor minor draft release candidates such as 5.2.0.91 have been
+omitted from the example.  Such release candidates are, typically, never
+made.
+@item
+For 5.1.93 the bziped tar ball @file{gdb-5.1.93.tar.bz2} is just the
+official @file{gdb-5.2.tar} renamed and compressed.
+@end itemize
 
 To avoid version conflicts, vendors are expected to modify the file
 @file{gdb/version.in} to include a vendor unique alphabetic identifier
 (an official @value{GDBN} release never uses alphabetic characters in
-its version identifer).  E.g., @samp{6.2widgit2}, or @samp{6.2 (Widgit
-Inc Patch 2)}.
+its version identifer).
 
-@section Experimental Branches
-@cindex experimental branches
+Since @value{GDBN} does not make minor minor minor releases (e.g.,
+5.1.0.1) the conflict between that and a minor minor draft release
+identifier (e.g., 5.1.0.90) is avoided.
 
-@subsection Guidelines
 
-@value{GDBN} permits the creation of branches, cut from the @sc{cvs}
-repository, for experimental development.  Branches make it possible
-for developers to share preliminary work, and maintainers to examine
-significant new developments.
+@subsection Branches
 
-The following are a set of guidelines for creating such branches:
+@value{GDBN} draws a release series (5.2, 5.2.1, @dots{}) from a single
+release branch (gdb_5_2-branch).  Since minor minor minor releases
+(5.1.0.1) are not made, the need to branch the release branch is avoided
+(it also turns out that the effort required for such a a branch and
+release is significantly greater than the effort needed to create a new
+release from the head of the release branch).
 
-@table @emph
-
-@item a branch has an owner
-The owner can set further policy for a branch, but may not change the
-ground rules.  In particular, they can set a policy for commits (be it
-adding more reviewers or deciding who can commit).
-
-@item all commits are posted
-All changes committed to a branch shall also be posted to
-@email{gdb-patches@@sources.redhat.com, the @value{GDBN} patches
-mailing list}.  While commentary on such changes are encouraged, people
-should remember that the changes only apply to a branch.
-
-@item all commits are covered by an assignment
-This ensures that all changes belong to the Free Software Foundation,
-and avoids the possibility that the branch may become contaminated.
-
-@item a branch is focused
-A focused branch has a single objective or goal, and does not contain
-unnecessary or irrelevant changes.  Cleanups, where identified, being
-be pushed into the mainline as soon as possible.
-
-@item a branch tracks mainline
-This keeps the level of divergence under control.  It also keeps the
-pressure on developers to push cleanups and other stuff into the
-mainline.
-
-@item a branch shall contain the entire @value{GDBN} module
-The @value{GDBN} module @code{gdb} should be specified when creating a
-branch (branches of individual files should be avoided).  @xref{Tags}.
-
-@item a branch shall be branded using @file{version.in}
-The file @file{gdb/version.in} shall be modified so that it identifies
-the branch @var{owner} and branch @var{name}, e.g.,
-@samp{6.2.50_20030303_owner_name} or @samp{6.2 (Owner Name)}.
-
-@end table
-
-@subsection Tags
-@anchor{Tags}
-
-To simplify the identification of @value{GDBN} branches, the following
-branch tagging convention is strongly recommended:
+Releases 5.0 and 5.1 used branch and release tags of the form:
 
-@table @code
-
-@item @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint
-@itemx @var{owner}_@var{name}-@var{YYYYMMDD}-branch
-The branch point and corresponding branch tag.  @var{YYYYMMDD} is the
-date that the branch was created.  A branch is created using the
-sequence: @anchor{experimental branch tags}
 @smallexample
-cvs rtag @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint gdb
-cvs rtag -b -r @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint \
-   @var{owner}_@var{name}-@var{YYYYMMDD}-branch gdb
+gdb_N_M-YYYY-MM-DD-branchpoint
+gdb_N_M-YYYY-MM-DD-branch
+gdb_M_N-YYYY-MM-DD-release
 @end smallexample
 
-@item @var{owner}_@var{name}-@var{yyyymmdd}-mergepoint
-The tagged point, on the mainline, that was used when merging the branch
-on @var{yyyymmdd}.  To merge in all changes since the branch was cut,
-use a command sequence like:
+Release 5.2 is trialing the branch and release tags:
+
 @smallexample
-cvs rtag @var{owner}_@var{name}-@var{yyyymmdd}-mergepoint gdb
-cvs update \
-   -j@var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint
-   -j@var{owner}_@var{name}-@var{yyyymmdd}-mergepoint
+gdb_N_M-YYYY-MM-DD-branchpoint
+gdb_N_M-branch
+gdb_M_N-YYYY-MM-DD-release
 @end smallexample
-@noindent
-Similar sequences can be used to just merge in changes since the last
-merge.
 
-@end table
+@emph{Pragmatics: The branchpoint and release tags need to identify when
+a branch and release are made.  The branch tag, denoting the head of the
+branch, does not have this criteria.}
 
-@noindent
-For further information on @sc{cvs}, see
-@uref{http://www.gnu.org/software/cvs/, Concurrent Versions System}.
-@node Releasing GDB
-
-@chapter Releasing @value{GDBN}
-@cindex making a new release of gdb
 
 @section Branch Commit Policy
 
index 4b019d3fe558367a8c3610864b72c90b2951df80..a00bc80a7283195ff175f3361659fa55495817fd 100644 (file)
@@ -422,33 +422,9 @@ file.  This information is contained in a symbol of stab type
 value of the symbol is the start address of the portion of the
 text section corresponding to that file.
 
-Some compilers use the desc field to indicate the language of the
-source file.  Sun's compilers started this usage, and the first
-constants are derived from their documentation.  Languages added
-by gcc/gdb start at 0x32 to avoid conflict with languages Sun may
-add in the future.  A desc field with a value 0 indicates that no
-language has been specified via this mechanism.
-
-@table @asis
-@item @code{N_SO_AS} (0x1)
-Assembly language
-@item @code{N_SO_C}  (0x2)
-K&R traditional C
-@item @code{N_SO_ANSI_C} (0x3)
-ANSI C
-@item @code{N_SO_CC}  (0x4)
-C++
-@item @code{N_SO_FORTRAN} (0x5)
-Fortran
-@item @code{N_SO_PASCAL} (0x6)
-Pascal
-@item @code{N_SO_FORTRAN90} (0x7)
-Fortran90
-@item @code{N_SO_OBJC} (0x32)
-Objective-C
-@item @code{N_SO_OBJCPLUS} (0x33)
-Objective-C++
-@end table
+With the Sun Solaris2 compiler, the desc field contains a
+source-language code.
+@c Do the debuggers use it?  What are the codes? -djm
 
 Some compilers (for example, GCC2 and SunOS4 @file{/bin/cc}) also
 include the directory in which the source was compiled, in a second
index 420bea094bdac08565a29a5836544b3d6cb23d14..49a003f57866f620c593437deaa68562659d4be6 100644 (file)
@@ -45,8 +45,6 @@
 #include "dwarf2loc.h"
 #include "cp-support.h"
 #include "hashtab.h"
-#include "command.h"
-#include "gdbcmd.h"
 
 #include <fcntl.h>
 #include "gdb_string.h"
@@ -168,17 +166,6 @@ struct dwarf2_per_objfile
   char *macinfo_buffer;
   char *ranges_buffer;
   char *loc_buffer;
-
-  /* A list of all the compilation units.  This is used to locate
-     the target compilation unit of a particular reference.  */
-  struct dwarf2_per_cu_data **all_comp_units;
-
-  /* The number of compilation units in ALL_COMP_UNITS.  */
-  int n_comp_units;
-
-  /* A chain of compilation units that are currently read in, so that
-     they can be freed later.  */
-  struct dwarf2_per_cu_data *read_in_chain;
 };
 
 static struct dwarf2_per_objfile *dwarf2_per_objfile;
@@ -257,11 +244,6 @@ struct comp_unit_head
     int base_known;
   };
 
-/* Fixed size for the DIE hash table.  */
-#ifndef REF_HASH_SIZE
-#define REF_HASH_SIZE 1021
-#endif
-
 /* Internal state when decoding a particular compilation unit.  */
 struct dwarf2_cu
 {
@@ -317,36 +299,6 @@ struct dwarf2_cu
      unit, including partial DIEs.  */
   struct obstack comp_unit_obstack;
 
-  /* When multiple dwarf2_cu structures are living in memory, this field
-     chains them all together, so that they can be released efficiently.
-     We will probably also want a generation counter so that most-recently-used
-     compilation units are cached...  */
-  struct dwarf2_per_cu_data *read_in_chain;
-
-  /* Backchain to our per_cu entry if the tree has been built.  */
-  struct dwarf2_per_cu_data *per_cu;
-
-  /* How many compilation units ago was this CU last referenced?  */
-  int last_used;
-
-  /* A hash table of die offsets for following references.  */
-  struct die_info *die_ref_table[REF_HASH_SIZE];
-
-  /* Full DIEs if read in.  */
-  struct die_info *dies;
-
-  /* A set of pointers to dwarf2_per_cu_data objects for compilation
-     units referenced by this one.  Only set during full symbol processing;
-     partial symbol tables do not have dependencies.  */
-  htab_t dependencies;
-
-  /* Mark used when releasing cached dies.  */
-  unsigned int mark : 1;
-
-  /* This flag will be set if this compilation unit might include
-     inter-compilation-unit references.  */
-  unsigned int has_form_ref_addr : 1;
-
   /* 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
@@ -354,37 +306,6 @@ struct dwarf2_cu
   unsigned int has_namespace_info : 1;
 };
 
-/* Persistent data held for a compilation unit, even when not
-   processing it.  We put a pointer to this structure in the
-   read_symtab_private field of the psymtab.  If we encounter
-   inter-compilation-unit references, we also maintain a sorted
-   list of all compilation units.  */
-
-struct dwarf2_per_cu_data
-{
-  /* The start offset and length of this compilation unit.  2**31-1
-     bytes should suffice to store the length of any compilation unit
-     - if it doesn't, GDB will fall over anyway.  */
-  unsigned long offset;
-  unsigned long length : 31;
-
-  /* Flag indicating this compilation unit will be read in before
-     any of the current compilation units are processed.  */
-  unsigned long queued : 1;
-
-  /* Set iff currently read in.  */
-  struct dwarf2_cu *cu;
-
-  /* If full symbols for this CU have been read in, then this field
-     holds a map of DIE offsets to types.  It isn't always possible
-     to reconstruct this information later, so we have to preserve
-     it.  */
-  htab_t type_hash;
-
-  /* The partial symbol table associated with this compilation unit.  */
-  struct partial_symtab *psymtab;
-};
-
 /* The line number information for a compilation unit (found in the
    .debug_line section) begins with a "statement program header",
    which contains the following information.  */
@@ -574,6 +495,13 @@ struct dwarf_block
 #define ATTR_ALLOC_CHUNK 4
 #endif
 
+/* A hash table of die offsets for following references.  */
+#ifndef REF_HASH_SIZE
+#define REF_HASH_SIZE 1021
+#endif
+
+static struct die_info *die_ref_table[REF_HASH_SIZE];
+
 /* Allocate fields for structs, unions and enums in this size.  */
 #ifndef DW_FIELD_ALLOC_CHUNK
 #define DW_FIELD_ALLOC_CHUNK 4
@@ -591,6 +519,19 @@ static int isreg;          /* Object lives in register.
                                   decode_locdesc's return value is
                                   the register number.  */
 
+/* We put a pointer to this structure in the read_symtab_private field
+   of the psymtab.  */
+
+struct dwarf2_pinfo
+  {
+    /* Offset in .debug_info for this compilation unit. */
+
+    unsigned long dwarf_info_offset;
+  };
+
+#define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private)
+#define DWARF_INFO_OFFSET(p) (PST_PRIVATE(p)->dwarf_info_offset)
+
 /* 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
    and friends.  */
@@ -644,24 +585,6 @@ struct field_info
     int nfnfields;
   };
 
-/* One item on the queue of compilation units to read in full symbols
-   for.  */
-struct dwarf2_queue_item
-{
-  struct dwarf2_per_cu_data *per_cu;
-  struct dwarf2_queue_item *next;
-};
-
-/* The current queue.  */
-static struct dwarf2_queue_item *dwarf2_queue, *dwarf2_queue_tail;
-
-/* Loaded secondary compilation units are kept in memory until they
-   have not been referenced for the processing of this many
-   compilation units.  Set this to zero to disable caching.  Cache
-   sizes of up to at least twenty will improve startup time for
-   typical inter-CU-reference binaries, at an obvious memory cost.  */
-static int dwarf2_max_cache_age = 5;
-
 /* Various complaints about symbol reading that don't abort the process */
 
 static void
@@ -769,7 +692,8 @@ static char *read_partial_die (struct partial_die_info *,
                               bfd *, char *, struct dwarf2_cu *);
 
 static struct partial_die_info *find_partial_die (unsigned long,
-                                                 struct dwarf2_cu *);
+                                                 struct dwarf2_cu *,
+                                                 struct dwarf2_cu **);
 
 static void fixup_partial_die (struct partial_die_info *,
                               struct dwarf2_cu *);
@@ -857,14 +781,17 @@ static struct type *die_type (struct die_info *, struct dwarf2_cu *);
 static struct type *die_containing_type (struct die_info *,
                                         struct dwarf2_cu *);
 
+#if 0
+static struct type *type_at_offset (unsigned int, struct objfile *);
+#endif
+
 static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *);
 
 static void read_type_die (struct die_info *, struct dwarf2_cu *);
 
 static char *determine_prefix (struct die_info *die, struct dwarf2_cu *);
 
-static char *typename_concat (struct obstack *, const char *prefix, const char *suffix,
-                             struct dwarf2_cu *);
+static char *typename_concat (const char *prefix, const char *suffix);
 
 static void read_typedef (struct die_info *, struct dwarf2_cu *);
 
@@ -953,6 +880,8 @@ static struct die_info *read_die_and_siblings (char *info_ptr, bfd *abfd,
 
 static void free_die_list (struct die_info *);
 
+static struct cleanup *make_cleanup_free_die_list (struct die_info *);
+
 static void process_die (struct die_info *, struct dwarf2_cu *);
 
 static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *);
@@ -986,17 +915,16 @@ static void dump_die (struct die_info *);
 
 static void dump_die_list (struct die_info *);
 
-static void store_in_ref_table (unsigned int, struct die_info *,
-                               struct dwarf2_cu *);
+static void store_in_ref_table (unsigned int, struct die_info *);
+
+static void dwarf2_empty_hash_tables (void);
 
 static unsigned int dwarf2_get_ref_die_offset (struct attribute *,
                                               struct dwarf2_cu *);
 
 static int dwarf2_get_attr_constant_value (struct attribute *, int);
 
-static struct die_info *follow_die_ref (struct die_info *,
-                                       struct attribute *,
-                                       struct dwarf2_cu *);
+static struct die_info *follow_die_ref (unsigned int);
 
 static struct type *dwarf2_fundamental_type (struct objfile *, int,
                                             struct dwarf2_cu *);
@@ -1036,39 +964,6 @@ static hashval_t partial_die_hash (const void *item);
 
 static int partial_die_eq (const void *item_lhs, const void *item_rhs);
 
-static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit
-  (unsigned long offset, struct objfile *objfile);
-
-static struct dwarf2_per_cu_data *dwarf2_find_comp_unit
-  (unsigned long offset, struct objfile *objfile);
-
-static void free_one_comp_unit (void *);
-
-static void free_cached_comp_units (void *);
-
-static void age_cached_comp_units (void);
-
-static void free_one_cached_comp_unit (void *);
-
-static void set_die_type (struct die_info *, struct type *,
-                         struct dwarf2_cu *);
-
-static void reset_die_and_siblings_types (struct die_info *,
-                                         struct dwarf2_cu *);
-
-static void create_all_comp_units (struct objfile *);
-
-static struct dwarf2_cu *load_full_comp_unit (struct dwarf2_per_cu_data *);
-
-static void process_full_comp_unit (struct dwarf2_per_cu_data *);
-
-static void dwarf2_add_dependence (struct dwarf2_cu *,
-                                  struct dwarf2_per_cu_data *);
-
-static void dwarf2_mark (struct dwarf2_cu *);
-
-static void dwarf2_clear_marks (struct dwarf2_per_cu_data *);
-
 /* Try to locate the sections we need for DWARF 2 debugging
    information and return true if we have enough to do something.  */
 
@@ -1349,7 +1244,9 @@ dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst,
 
   /* No private part is necessary for include psymtabs.  This property
      can be used to differentiate between such include psymtabs and
-     the regular ones.  */
+     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;
 }
 
@@ -1393,17 +1290,10 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
   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 = dwarf2_per_objfile->info_buffer;
 
-  /* Any cached compilation units will be linked by the per-objfile
-     read_in_chain.  Make sure to free them when we're done.  */
-  back_to = make_cleanup (free_cached_comp_units, NULL);
-
-  create_all_comp_units (objfile);
-
   /* 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 load_partial_die) can really know whether
@@ -1444,12 +1334,12 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
 
       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);
       make_cleanup (dwarf2_free_abbrev_table, &cu);
 
-      this_cu = dwarf2_find_comp_unit (cu.header.offset, objfile);
-
       /* Read the compilation unit die */
       abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu);
       info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
@@ -1465,35 +1355,17 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
                                  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 *) this_cu;
+         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_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 */
       pst->read_symtab = dwarf2_psymtab_to_symtab;
 
-      /* If this compilation unit was already read in, free the
-        cached copy in order to read it in again.  This is
-        necessary because we skipped some symbols when we first
-        read in the compilation unit (see load_partial_dies).
-        This problem could be avoided, but the benefit is
-        unclear.  */
-      if (this_cu->cu != NULL)
-       free_one_cached_comp_unit (this_cu->cu);
-
-      cu.per_cu = this_cu;
-
-      /* Note that this is a pointer to our stack frame, being
-        added to a global data structure.  It will be cleaned up
-        in free_stack_comp_unit when we finish with this
-        compilation unit.  */
-      this_cu->cu = &cu;
-
-      this_cu->psymtab = pst;
-
       /* Check if comp unit has_children.
          If so, read the rest of the partial symbols from this comp unit.
          If not, there's no more debug_info for this comp unit. */
@@ -1547,122 +1419,6 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
 
       do_cleanups (back_to_inner);
     }
-  do_cleanups (back_to);
-}
-
-/* Load the DIEs for a secondary CU into memory.  */
-
-static void
-load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile)
-{
-  bfd *abfd = objfile->obfd;
-  char *info_ptr, *beg_of_comp_unit;
-  struct partial_die_info comp_unit_die;
-  struct dwarf2_cu *cu;
-  struct abbrev_info *abbrev;
-  unsigned int bytes_read;
-  struct cleanup *back_to;
-
-  info_ptr = dwarf2_per_objfile->info_buffer + this_cu->offset;
-  beg_of_comp_unit = info_ptr;
-
-  cu = xmalloc (sizeof (struct dwarf2_cu));
-  memset (cu, 0, sizeof (struct dwarf2_cu));
-
-  obstack_init (&cu->comp_unit_obstack);
-
-  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 - dwarf2_per_objfile->info_buffer;
-  cu->header.first_die_ptr = info_ptr;
-  cu->header.cu_head_ptr = beg_of_comp_unit;
-
-  /* Read the abbrevs for this compilation unit into a table.  */
-  dwarf2_read_abbrevs (abfd, cu);
-  back_to = make_cleanup (dwarf2_free_abbrev_table, cu);
-
-  /* Read the compilation unit die.  */
-  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);
-
-  /* Link this compilation unit into the compilation unit tree.  */
-  this_cu->cu = cu;
-  cu->per_cu = this_cu;
-
-  /* Check if comp unit has_children.
-     If so, read the rest of the partial symbols from this comp unit.
-     If not, there's no more debug_info for this comp unit. */
-  if (comp_unit_die.has_children)
-    load_partial_dies (abfd, info_ptr, 0, cu);
-
-  do_cleanups (back_to);
-}
-
-/* Create a list of all compilation units in OBJFILE.  We do this only
-   if an inter-comp-unit reference is found; presumably if there is one,
-   there will be many, and one will occur early in the .debug_info section.
-   So there's no point in building this list incrementally.  */
-
-static void
-create_all_comp_units (struct objfile *objfile)
-{
-  int n_allocated;
-  int n_comp_units;
-  struct dwarf2_per_cu_data **all_comp_units;
-  char *info_ptr = dwarf2_per_objfile->info_buffer;
-
-  n_comp_units = 0;
-  n_allocated = 10;
-  all_comp_units = xmalloc (n_allocated
-                           * sizeof (struct dwarf2_per_cu_data *));
-  
-  while (info_ptr < dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size)
-    {
-      struct comp_unit_head cu_header;
-      char *beg_of_comp_unit;
-      struct dwarf2_per_cu_data *this_cu;
-      unsigned long offset;
-      int bytes_read;
-
-      offset = info_ptr - dwarf2_per_objfile->info_buffer;
-
-      /* Read just enough information to find out where the next
-        compilation unit is.  */
-      cu_header.length = read_initial_length (objfile->obfd, info_ptr,
-                                             &cu_header, &bytes_read);
-
-      /* Save the compilation unit for later lookup.  */
-      this_cu = obstack_alloc (&objfile->objfile_obstack,
-                              sizeof (struct dwarf2_per_cu_data));
-      memset (this_cu, 0, sizeof (*this_cu));
-      this_cu->offset = offset;
-      this_cu->length = cu_header.length + cu_header.initial_length_size;
-
-      if (n_comp_units == n_allocated)
-       {
-         n_allocated *= 2;
-         all_comp_units = xrealloc (all_comp_units,
-                                    n_allocated
-                                    * sizeof (struct dwarf2_per_cu_data *));
-       }
-      all_comp_units[n_comp_units++] = this_cu;
-
-      info_ptr = info_ptr + this_cu->length;
-    }
-
-  dwarf2_per_objfile->all_comp_units
-    = obstack_alloc (&objfile->objfile_obstack,
-                    n_comp_units * sizeof (struct dwarf2_per_cu_data *));
-  memcpy (dwarf2_per_objfile->all_comp_units, all_comp_units,
-         n_comp_units * sizeof (struct dwarf2_per_cu_data *));
-  xfree (all_comp_units);
-  dwarf2_per_objfile->n_comp_units = n_comp_units;
 }
 
 /* Process all loaded DIEs for compilation unit CU, starting at FIRST_DIE.
@@ -1755,8 +1511,7 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc,
 /* Functions used to compute the fully scoped name of a partial DIE.
 
    Normally, this is simple.  For C++, the parent DIE's fully scoped
-   name is concatenated with "::" and the partial DIE's name.  For
-   Java, the same thing occurs except that "." is used instead of "::".
+   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.
@@ -1782,13 +1537,15 @@ partial_die_parent_scope (struct partial_die_info *pdi,
 {
   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, cu);
+    real_pdi = find_partial_die (real_pdi->spec_offset, spec_cu, &spec_cu);
 
   parent = real_pdi->die_parent;
   if (parent == NULL)
@@ -1799,7 +1556,7 @@ partial_die_parent_scope (struct partial_die_info *pdi,
 
   fixup_partial_die (parent, cu);
 
-  grandparent_scope = partial_die_parent_scope (parent, cu);
+  grandparent_scope = partial_die_parent_scope (parent, spec_cu);
 
   if (parent->tag == DW_TAG_namespace
       || parent->tag == DW_TAG_structure_type
@@ -1809,8 +1566,8 @@ partial_die_parent_scope (struct partial_die_info *pdi,
       if (grandparent_scope == NULL)
        parent->scope = parent->name;
       else
-       parent->scope = typename_concat (&cu->comp_unit_obstack, grandparent_scope,
-                                        parent->name, cu);
+       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.  */
@@ -1842,7 +1599,7 @@ partial_die_full_name (struct partial_die_info *pdi,
   if (parent_scope == NULL)
     return NULL;
   else
-    return typename_concat (NULL, parent_scope, pdi->name, cu);
+    return concat (parent_scope, "::", pdi->name, NULL);
 }
 
 static void
@@ -1960,16 +1717,14 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
        return;
       add_psymbol_to_list (actual_name, strlen (actual_name),
                           STRUCT_DOMAIN, LOC_TYPEDEF,
-                          (cu->language == language_cplus
-                           || cu->language == language_java)
+                          cu->language == language_cplus
                           ? &objfile->global_psymbols
                           : &objfile->static_psymbols,
                           0, (CORE_ADDR) 0, cu->language, objfile);
 
-      if (cu->language == language_cplus
-          || cu->language == language_java)
+      if (cu->language == language_cplus)
        {
-         /* For C++ and Java, these implicitly act as typedefs as well. */
+         /* For C++, these implicitly act as typedefs as well. */
          add_psymbol_to_list (actual_name, strlen (actual_name),
                               VAR_DOMAIN, LOC_TYPEDEF,
                               &objfile->global_psymbols,
@@ -1979,8 +1734,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
     case DW_TAG_enumerator:
       add_psymbol_to_list (actual_name, strlen (actual_name),
                           VAR_DOMAIN, LOC_CONST,
-                          (cu->language == language_cplus
-                           || cu->language == language_java)
+                          cu->language == language_cplus
                           ? &objfile->global_psymbols
                           : &objfile->static_psymbols,
                           0, (CORE_ADDR) 0, cu->language, objfile);
@@ -2060,8 +1814,7 @@ static void
 guess_structure_name (struct partial_die_info *struct_pdi,
                      struct dwarf2_cu *cu)
 {
-  if ((cu->language == language_cplus
-       || cu->language == language_java)
+  if (cu->language == language_cplus
       && cu->has_namespace_info == 0
       && struct_pdi->has_children)
     {
@@ -2073,14 +1826,16 @@ guess_structure_name (struct partial_die_info *struct_pdi,
 
       struct partial_die_info *child_pdi = struct_pdi->die_child;
       struct partial_die_info *real_pdi;
+      struct dwarf2_cu *spec_cu;
 
       /* 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.  */
 
       real_pdi = struct_pdi;
+      spec_cu = cu;
       while (real_pdi->has_specification)
-       real_pdi = find_partial_die (real_pdi->spec_offset, cu);
+       real_pdi = find_partial_die (real_pdi->spec_offset, spec_cu, &spec_cu);
 
       if (real_pdi->die_parent != NULL)
        return;
@@ -2321,10 +2076,6 @@ dwarf2_psymtab_to_symtab (struct partial_symtab *pst)
              gdb_flush (gdb_stdout);
            }
 
-         /* Restore our global data.  */
-         dwarf2_per_objfile = objfile_data (pst->objfile,
-                                            dwarf2_objfile_data_key);
-
          psymtab_to_symtab_1 (pst);
 
          /* Finish up the debug error message.  */
@@ -2334,104 +2085,21 @@ dwarf2_psymtab_to_symtab (struct partial_symtab *pst)
     }
 }
 
-/* Add PER_CU to the queue.  */
-
-static void
-queue_comp_unit (struct dwarf2_per_cu_data *per_cu)
-{
-  struct dwarf2_queue_item *item;
-
-  per_cu->queued = 1;
-  item = xmalloc (sizeof (*item));
-  item->per_cu = per_cu;
-  item->next = NULL;
-
-  if (dwarf2_queue == NULL)
-    dwarf2_queue = item;
-  else
-    dwarf2_queue_tail->next = item;
-
-  dwarf2_queue_tail = item;
-}
-
-/* Process the queue.  */
-
-static void
-process_queue (struct objfile *objfile)
-{
-  struct dwarf2_queue_item *item, *next_item;
-
-  /* Initially, there is just one item on the queue.  Load its DIEs,
-     and the DIEs of any other compilation units it requires,
-     transitively.  */
-
-  for (item = dwarf2_queue; item != NULL; item = item->next)
-    {
-      /* Read in this compilation unit.  This may add new items to
-        the end of the queue.  */
-      load_full_comp_unit (item->per_cu);
-
-      item->per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
-      dwarf2_per_objfile->read_in_chain = item->per_cu;
-
-      /* If this compilation unit has already had full symbols created,
-        reset the TYPE fields in each DIE.  */
-      if (item->per_cu->psymtab->readin)
-       reset_die_and_siblings_types (item->per_cu->cu->dies,
-                                     item->per_cu->cu);
-    }
-
-  /* Now everything left on the queue needs to be read in.  Process
-     them, one at a time, removing from the queue as we finish.  */
-  for (item = dwarf2_queue; item != NULL; dwarf2_queue = item = next_item)
-    {
-      if (!item->per_cu->psymtab->readin)
-       process_full_comp_unit (item->per_cu);
-
-      item->per_cu->queued = 0;
-      next_item = item->next;
-      xfree (item);
-    }
-
-  dwarf2_queue_tail = NULL;
-}
-
-/* Free all allocated queue entries.  This function only releases anything if
-   an error was thrown; if the queue was processed then it would have been
-   freed as we went along.  */
-
-static void
-dwarf2_release_queue (void *dummy)
-{
-  struct dwarf2_queue_item *item, *last;
-
-  item = dwarf2_queue;
-  while (item)
-    {
-      /* Anything still marked queued is likely to be in an
-        inconsistent state, so discard it.  */
-      if (item->per_cu->queued)
-       {
-         if (item->per_cu->cu != NULL)
-           free_one_cached_comp_unit (item->per_cu->cu);
-         item->per_cu->queued = 0;
-       }
-
-      last = item;
-      item = item->next;
-      xfree (last);
-    }
-
-  dwarf2_queue = dwarf2_queue_tail = NULL;
-}
-
-/* Read in full symbols for PST, and anything it depends on.  */
-
 static void
 psymtab_to_symtab_1 (struct partial_symtab *pst)
 {
-  struct dwarf2_per_cu_data *per_cu;
+  struct objfile *objfile = pst->objfile;
+  bfd *abfd = objfile->obfd;
+  struct dwarf2_cu cu;
+  struct die_info *dies;
+  unsigned long offset;
+  CORE_ADDR lowpc, highpc;
+  struct die_info *child_die;
+  char *info_ptr;
+  struct symtab *symtab;
   struct cleanup *back_to;
+  struct attribute *attr;
+  CORE_ADDR baseaddr;
   int i;
 
   for (i = 0; i < pst->number_of_dependencies; i++)
@@ -2451,9 +2119,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
         psymtab_to_symtab_1 (pst->dependencies[i]);
       }
 
-  per_cu = (struct dwarf2_per_cu_data *) pst->read_symtab_private;
-
-  if (per_cu == NULL)
+  if (pst->read_symtab_private == NULL)
     {
       /* It's an include file, no symbols to read for it.
          Everything is in the parent symtab.  */
@@ -2461,107 +2127,39 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
       return;
     }
 
-  back_to = make_cleanup (dwarf2_release_queue, NULL);
-
-  queue_comp_unit (per_cu);
-
-  process_queue (pst->objfile);
-
-  /* Age the cache, releasing compilation units that have not
-     been used recently.  */
-  age_cached_comp_units ();
-
-  do_cleanups (back_to);
-}
-
-/* Load the DIEs associated with PST and PER_CU into memory.  */
-
-static struct dwarf2_cu *
-load_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
-{
-  struct partial_symtab *pst = per_cu->psymtab;
-  bfd *abfd = pst->objfile->obfd;
-  struct dwarf2_cu *cu;
-  unsigned long offset;
-  char *info_ptr;
-  struct cleanup *back_to, *free_cu_cleanup;
-  struct attribute *attr;
-  CORE_ADDR baseaddr;
+  dwarf2_per_objfile = objfile_data (pst->objfile, dwarf2_objfile_data_key);
 
   /* Set local variables from the partial symbol table info.  */
-  offset = per_cu->offset;
+  offset = DWARF_INFO_OFFSET (pst);
 
   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 = "";
 
-  cu = xmalloc (sizeof (struct dwarf2_cu));
-  memset (cu, 0, sizeof (struct dwarf2_cu));
+  obstack_init (&cu.comp_unit_obstack);
+  back_to = make_cleanup (free_stack_comp_unit, &cu);
 
-  /* If an error occurs while loading, release our storage.  */
-  free_cu_cleanup = make_cleanup (free_one_comp_unit, cu);
+  buildsym_init ();
+  make_cleanup (really_free_pendings, NULL);
 
-  cu->objfile = pst->objfile;
+  cu.objfile = objfile;
 
   /* read in the comp_unit header  */
-  info_ptr = read_comp_unit_head (&cu->header, info_ptr, abfd);
+  info_ptr = read_comp_unit_head (&cu.header, info_ptr, abfd);
 
   /* Read the abbrevs for this compilation unit  */
-  dwarf2_read_abbrevs (abfd, cu);
-  back_to = make_cleanup (dwarf2_free_abbrev_table, cu);
-
-  cu->header.offset = offset;
-
-  cu->per_cu = per_cu;
-  per_cu->cu = cu;
-
-  /* We use this obstack for block values in dwarf_alloc_block.  */
-  obstack_init (&cu->comp_unit_obstack);
-
-  cu->dies = read_comp_unit (info_ptr, abfd, cu);
-
-  /* We try not to read any attributes in this function, because not
-     all objfiles needed for references have been loaded yet, and symbol
-     table processing isn't initialized.  But we have to set the CU language,
-     or we won't be able to build types correctly.  */
-  attr = dwarf2_attr (cu->dies, DW_AT_language, cu);
-  if (attr)
-    set_cu_language (DW_UNSND (attr), cu);
-  else
-    set_cu_language (language_minimal, cu);
-
-  do_cleanups (back_to);
-
-  /* We've successfully allocated this compilation unit.  Let our caller
-     clean it up when finished with it.  */
-  discard_cleanups (free_cu_cleanup);
-
-  return cu;
-}
-
-/* Generate full symbol information for PST and CU, whose DIEs have
-   already been loaded into memory.  */
-
-static void
-process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
-{
-  struct partial_symtab *pst = per_cu->psymtab;
-  struct dwarf2_cu *cu = per_cu->cu;
-  struct objfile *objfile = pst->objfile;
-  bfd *abfd = objfile->obfd;
-  CORE_ADDR lowpc, highpc;
-  struct symtab *symtab;
-  struct cleanup *back_to;
-  struct attribute *attr;
-  CORE_ADDR baseaddr;
+  dwarf2_read_abbrevs (abfd, &cu);
+  make_cleanup (dwarf2_free_abbrev_table, &cu);
 
-  baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+  cu.header.offset = offset;
 
-  /* We're in the global namespace.  */
-  processing_current_prefix = "";
+  cu.list_in_scope = &file_symbols;
 
-  buildsym_init ();
-  back_to = make_cleanup (really_free_pendings, NULL);
+  dies = read_comp_unit (info_ptr, abfd, &cu);
 
-  cu->list_in_scope = &file_symbols;
+  make_cleanup_free_die_list (dies);
 
   /* Find the base address of the compilation unit for range lists and
      location lists.  It will normally be specified by DW_AT_low_pc.
@@ -2569,32 +2167,32 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
      DW_AT_entry_pc.  It's been removed, but GCC still uses this for
      compilation units with discontinuous ranges.  */
 
-  cu->header.base_known = 0;
-  cu->header.base_address = 0;
+  cu.header.base_known = 0;
+  cu.header.base_address = 0;
 
-  attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu);
+  attr = dwarf2_attr (dies, DW_AT_entry_pc, &cu);
   if (attr)
     {
-      cu->header.base_address = DW_ADDR (attr);
-      cu->header.base_known = 1;
+      cu.header.base_address = DW_ADDR (attr);
+      cu.header.base_known = 1;
     }
   else
     {
-      attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu);
+      attr = dwarf2_attr (dies, DW_AT_low_pc, &cu);
       if (attr)
        {
-         cu->header.base_address = DW_ADDR (attr);
-         cu->header.base_known = 1;
+         cu.header.base_address = DW_ADDR (attr);
+         cu.header.base_known = 1;
        }
     }
 
   /* Do line number decoding in read_file_scope () */
-  process_die (cu->dies, cu);
+  process_die (dies, &cu);
 
   /* Some compilers don't define a DW_AT_high_pc attribute for the
      compilation unit.  If the DW_AT_high_pc is missing, synthesize
      it, by scanning the DIE's below the compilation unit.  */
-  get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu);
+  get_scope_pc_bounds (dies, &lowpc, &highpc, &cu);
 
   symtab = end_symtab (highpc + baseaddr, objfile, SECT_OFF_TEXT (objfile));
 
@@ -2602,9 +2200,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
      If the compilation is from a C file generated by language preprocessors,
      do not set the language if it was already deduced by start_subfile.  */
   if (symtab != NULL
-      && !(cu->language == language_c && symtab->language != language_c))
+      && !(cu.language == language_c && symtab->language != language_c))
     {
-      symtab->language = cu->language;
+      symtab->language = cu.language;
     }
   pst->symtab = symtab;
   pst->readin = 1;
@@ -2876,8 +2474,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
   if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu))
     return;
 
-  if (cu->language == language_cplus
-      || cu->language == language_java)
+  if (cu->language == language_cplus)
     {
       struct die_info *spec_die = die_specification (die, cu);
 
@@ -3675,13 +3272,10 @@ static int
 is_vtable_name (const char *name, struct dwarf2_cu *cu)
 {
   static const char vptr[] = "_vptr";
-  static const char vtable[] = "vtable";
 
-  /* Look for the C++ and Java forms of the vtable.  */
-  if ((cu->language == language_java
-       && strncmp (name, vtable, sizeof (vtable) - 1) == 0)
-       || (strncmp (name, vptr, sizeof (vptr) - 1) == 0
-       && is_cplus_marker (name[sizeof (vptr) - 1])))
+  /* C++ and some implementations of Java use this name.  */
+  if (strncmp (name, vptr, sizeof (vptr) - 1) == 0
+      && is_cplus_marker (name[sizeof (vptr) - 1]))
     return 1;
 
   return 0;
@@ -3722,8 +3316,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
   attr = dwarf2_attr (die, DW_AT_name, cu);
   if (attr && DW_STRING (attr))
     {
-      if (cu->language == language_cplus
-         || cu->language == language_java)
+      if (cu->language == language_cplus)
        {
          char *new_prefix = determine_class_name (die, cu);
          TYPE_TAG_NAME (type) = obsavestring (new_prefix,
@@ -3771,7 +3364,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
   /* 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. */
-  set_die_type (die, type, cu);
+  die->type = type;
 
   if (die->child != NULL && ! die_is_declaration (die, cu))
     {
@@ -3925,9 +3518,11 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
 
       if (processing_has_namespace_info)
        {
-         TYPE_TAG_NAME (type) = typename_concat (&objfile->objfile_obstack,
-                                                 processing_current_prefix,
-                                                 name, cu);
+         TYPE_TAG_NAME (type) = obconcat (&objfile->objfile_obstack,
+                                          processing_current_prefix,
+                                          processing_current_prefix[0] == '\0'
+                                          ? "" : "::",
+                                          name);
        }
       else
        {
@@ -3947,11 +3542,11 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
       TYPE_LENGTH (type) = 0;
     }
 
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 /* Determine the name of the type represented by DIE, which should be
-   a named C++ or Java compound type.  Return the name in question; the caller
+   a named C++ compound type.  Return the name in question; the caller
    is responsible for xfree()'ing it.  */
 
 static char *
@@ -3998,9 +3593,8 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu)
   if (new_prefix == NULL)
     {
       const char *name = dwarf2_name (die, cu);
-      new_prefix = typename_concat (NULL, processing_current_prefix,
-                                   name ? name : "<<anonymous>>", 
-                                   cu);
+      new_prefix = typename_concat (processing_current_prefix,
+                                   name ? name : "<<anonymous>>");
     }
 
   if (back_to != NULL)
@@ -4113,8 +3707,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
     {
       index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu);
       range_type = create_range_type (NULL, index_type, 0, -1);
-      set_die_type (die, create_array_type (NULL, element_type, range_type),
-                   cu);
+      die->type = create_array_type (NULL, element_type, range_type);
       return;
     }
 
@@ -4174,7 +3767,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
   do_cleanups (back_to);
 
   /* Install the type in the die. */
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 static enum dwarf_array_dim_ordering
@@ -4268,7 +3861,6 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
   const char *name;
   int is_anonymous;
   struct die_info *current_die;
-  struct cleanup *back_to = make_cleanup (null_cleanup, 0);
 
   name = namespace_name (die, &is_anonymous, cu);
 
@@ -4280,8 +3872,14 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
     }
   else
     {
-      char *temp_name = typename_concat (NULL, previous_prefix, name, cu);
-      make_cleanup (xfree, temp_name);
+      /* We need temp_name around because processing_current_prefix
+        is a const char *.  */
+      char *temp_name = alloca (strlen (previous_prefix)
+                               + 2 + strlen(name) + 1);
+      strcpy (temp_name, previous_prefix);
+      strcat (temp_name, "::");
+      strcat (temp_name, name);
+
       processing_current_prefix = temp_name;
     }
 
@@ -4301,7 +3899,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
       TYPE_TAG_NAME (type) = TYPE_NAME (type);
 
       new_symbol (die, type, cu);
-      set_die_type (die, type, cu);
+      die->type = type;
 
       if (is_anonymous)
        cp_add_using_directive (processing_current_prefix,
@@ -4321,7 +3919,6 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   processing_current_prefix = previous_prefix;
-  do_cleanups (back_to);
 }
 
 /* Return the name of the namespace represented by DIE.  Set
@@ -4408,7 +4005,7 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   TYPE_LENGTH (type) = byte_size;
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 /* Extract all information from a DW_TAG_ptr_to_member_type DIE and add to
@@ -4432,7 +4029,7 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu)
   domain = die_containing_type (die, cu);
   smash_to_member_type (type, domain, to_type);
 
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 /* Extract all information from a DW_TAG_reference_type DIE and add to
@@ -4460,7 +4057,7 @@ read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu)
     {
       TYPE_LENGTH (type) = cu_header->addr_size;
     }
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 static void
@@ -4474,8 +4071,7 @@ read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   base_type = die_type (die, cu);
-  set_die_type (die, make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0),
-               cu);
+  die->type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0);
 }
 
 static void
@@ -4489,8 +4085,7 @@ read_tag_volatile_type (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   base_type = die_type (die, cu);
-  set_die_type (die, make_cv_type (TYPE_CONST (base_type), 1, base_type, 0),
-               cu);
+  die->type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0);
 }
 
 /* Extract all information from a DW_TAG_string_type DIE and add to
@@ -4542,7 +4137,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
       char_type = dwarf2_fundamental_type (objfile, FT_CHAR, cu);
       type = create_string_type (char_type, range_type);
     }
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 /* Handle DIES due to C code like:
@@ -4569,13 +4164,12 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
       return;
     }
   type = die_type (die, cu);
-  ftype = make_function_type (type, (struct type **) 0);
+  ftype = lookup_function_type (type);
 
-  /* All functions in C++ and Java have prototypes.  */
+  /* All functions in C++ have prototypes.  */
   attr = dwarf2_attr (die, DW_AT_prototyped, cu);
   if ((attr && (DW_UNSND (attr) != 0))
-      || cu->language == language_cplus
-      || cu->language == language_java)
+      || cu->language == language_cplus)
     TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED;
 
   if (die->child != NULL)
@@ -4624,7 +4218,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
        }
     }
 
-  set_die_type (die, ftype, cu);
+  die->type = ftype;
 }
 
 static void
@@ -4641,9 +4235,7 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu)
        {
          name = DW_STRING (attr);
        }
-      set_die_type (die, init_type (TYPE_CODE_TYPEDEF, 0,
-                                   TYPE_FLAG_TARGET_STUB, name, objfile),
-                   cu);
+      die->type = init_type (TYPE_CODE_TYPEDEF, 0, TYPE_FLAG_TARGET_STUB, name, objfile);
       TYPE_TARGET_TYPE (die->type) = die_type (die, cu);
     }
 }
@@ -4731,7 +4323,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
     {
       type = dwarf_base_type (encoding, size, cu);
     }
-  set_die_type (die, type, cu);
+  die->type = type;
 }
 
 /* Read the given DW_AT_subrange DIE.  */
@@ -4766,9 +4358,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
       low = 1;
     }
 
-  /* FIXME: For variable sized arrays either of these could be
-     a variable rather than a constant value.  We'll allow it,
-     but we don't know how to handle it.  */
   attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
   if (attr)
     low = dwarf2_get_attr_constant_value (attr, 0);
@@ -4805,7 +4394,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   if (attr)
     TYPE_LENGTH (range_type) = DW_UNSND (attr);
 
-  set_die_type (die, range_type, cu);
+  die->type = range_type;
 }
   
 
@@ -4814,6 +4403,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
 static struct die_info *
 read_comp_unit (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu)
 {
+  /* Reset die reference table; we are
+     building new ones now.  */
+  dwarf2_empty_hash_tables ();
+
   return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL);
 }
 
@@ -4834,7 +4427,7 @@ read_die_and_children (char *info_ptr, bfd *abfd,
   int has_children;
 
   cur_ptr = read_full_die (&die, abfd, info_ptr, cu, &has_children);
-  store_in_ref_table (die->offset, die, cu);
+  store_in_ref_table (die->offset, die);
 
   if (has_children)
     {
@@ -4913,6 +4506,19 @@ free_die_list (struct die_info *dies)
     }
 }
 
+static void
+do_free_die_list_cleanup (void *dies)
+{
+  free_die_list (dies);
+}
+
+static struct cleanup *
+make_cleanup_free_die_list (struct die_info *dies)
+{
+  return make_cleanup (do_free_die_list_cleanup, dies);
+}
+
+
 /* Read the contents of the section at OFFSET and of size SIZE from the
    object file specified by OBJFILE into the objfile_obstack and return it.  */
 
@@ -5001,17 +4607,6 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu)
                = xrealloc (cur_attrs, (allocated_attrs
                                        * sizeof (struct attr_abbrev)));
            }
-
-         /* Record whether this compilation unit might have
-            inter-compilation-unit references.  If we don't know what form
-            this attribute will have, then it might potentially be a
-            DW_FORM_ref_addr, so we conservatively expect inter-CU
-            references.  */
-
-         if (abbrev_form == DW_FORM_ref_addr
-             || abbrev_form == DW_FORM_indirect)
-           cu->has_form_ref_addr = 1;
-
          cur_attrs[cur_abbrev->num_attrs].name = abbrev_name;
          cur_attrs[cur_abbrev->num_attrs++].form = abbrev_form;
          abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
@@ -5225,8 +4820,7 @@ load_partial_dies (bfd *abfd, char *info_ptr, int building_psymtab,
          else if (building_psymtab)
            add_psymbol_to_list (part_die->name, strlen (part_die->name),
                                 VAR_DOMAIN, LOC_CONST,
-                                (cu->language == language_cplus
-                                 || cu->language == language_java)
+                                cu->language == language_cplus
                                 ? &cu->objfile->global_psymbols
                                 : &cu->objfile->static_psymbols,
                                 0, (CORE_ADDR) 0, cu->language, cu->objfile);
@@ -5452,25 +5046,20 @@ find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu)
 /* 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)
+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)
-    return find_partial_die_in_comp_unit (offset, cu);
-
-  per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile);
-
-  if (per_cu->cu == NULL)
     {
-      load_comp_unit (per_cu, cu->objfile);
-      per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
-      dwarf2_per_objfile->read_in_chain = per_cu;
+      *target_cu = cu;
+      return find_partial_die_in_comp_unit (offset, cu);
     }
 
-  per_cu->cu->last_used = 0;
-  return find_partial_die_in_comp_unit (offset, per_cu->cu);
+  internal_error (__FILE__, __LINE__,
+                 "unsupported inter-compilation-unit reference");
 }
 
 /* Adjust PART_DIE before generating a symbol for it.  This function
@@ -5486,10 +5075,11 @@ fixup_partial_die (struct partial_die_info *part_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_die = find_partial_die (part_die->spec_offset, cu, &spec_cu);
 
-      fixup_partial_die (spec_die, cu);
+      fixup_partial_die (spec_die, spec_cu);
 
       if (spec_die->name)
        {
@@ -5563,38 +5153,6 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr,
     {
       info_ptr = read_attribute (&die->attrs[i], &abbrev->attrs[i],
                                 abfd, info_ptr, cu);
-
-      /* If this attribute is an absolute reference to a different
-        compilation unit, make sure that compilation unit is loaded
-        also.  */
-      if (die->attrs[i].form == DW_FORM_ref_addr
-         && (DW_ADDR (&die->attrs[i]) < cu->header.offset
-             || (DW_ADDR (&die->attrs[i])
-                 >= cu->header.offset + cu->header.length)))
-       {
-         struct dwarf2_per_cu_data *per_cu;
-         per_cu = dwarf2_find_containing_comp_unit (DW_ADDR (&die->attrs[i]),
-                                                    cu->objfile);
-
-         /* Mark the dependence relation so that we don't flush PER_CU
-            too early.  */
-         dwarf2_add_dependence (cu, per_cu);
-
-         /* If it's already on the queue, we have nothing to do.  */
-         if (per_cu->queued)
-           continue;
-
-         /* If the compilation unit is already loaded, just mark it as
-            used.  */
-         if (per_cu->cu != NULL)
-           {
-             per_cu->cu->last_used = 0;
-             continue;
-           }
-
-         /* Add it to the queue.  */
-         queue_comp_unit (per_cu);
-       }
     }
 
   *diep = die;
@@ -5691,24 +5249,23 @@ read_attribute_value (struct attribute *attr, unsigned form,
       info_ptr += bytes_read;
       break;
     case DW_FORM_ref1:
-      DW_ADDR (attr) = cu->header.offset + read_1_byte (abfd, info_ptr);
+      DW_UNSND (attr) = read_1_byte (abfd, info_ptr);
       info_ptr += 1;
       break;
     case DW_FORM_ref2:
-      DW_ADDR (attr) = cu->header.offset + read_2_bytes (abfd, info_ptr);
+      DW_UNSND (attr) = read_2_bytes (abfd, info_ptr);
       info_ptr += 2;
       break;
     case DW_FORM_ref4:
-      DW_ADDR (attr) = cu->header.offset + read_4_bytes (abfd, info_ptr);
+      DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
       info_ptr += 4;
       break;
     case DW_FORM_ref8:
-      DW_ADDR (attr) = cu->header.offset + read_8_bytes (abfd, info_ptr);
+      DW_UNSND (attr) = read_8_bytes (abfd, info_ptr);
       info_ptr += 8;
       break;
     case DW_FORM_ref_udata:
-      DW_ADDR (attr) = (cu->header.offset
-                       + read_unsigned_leb128 (abfd, info_ptr, &bytes_read));
+      DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
       info_ptr += bytes_read;
       break;
     case DW_FORM_indirect:
@@ -6094,8 +5651,6 @@ set_cu_language (unsigned int lang, struct dwarf2_cu *cu)
       break;
     case DW_LANG_Ada83:
     case DW_LANG_Ada95:
-      cu->language = language_ada;
-      break;
     case DW_LANG_Cobol74:
     case DW_LANG_Cobol85:
     case DW_LANG_Pascal83:
@@ -6118,14 +5673,21 @@ dwarf2_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *cu)
   for (i = 0; i < die->num_attrs; ++i)
     {
       if (die->attrs[i].name == name)
-       return &die->attrs[i];
+       {
+         return &die->attrs[i];
+       }
       if (die->attrs[i].name == DW_AT_specification
          || die->attrs[i].name == DW_AT_abstract_origin)
        spec = &die->attrs[i];
     }
-
   if (spec)
-    return dwarf2_attr (follow_die_ref (die, spec, cu), name, cu);
+    {
+      struct die_info *ref_die =
+      follow_die_ref (dwarf2_get_ref_die_offset (spec, cu));
+
+      if (ref_die)
+       return dwarf2_attr (ref_die, name, cu);
+    }
 
   return NULL;
 }
@@ -6167,7 +5729,7 @@ die_specification (struct die_info *die, struct dwarf2_cu *cu)
   if (spec_attr == NULL)
     return NULL;
   else
-    return follow_die_ref (die, spec_attr, cu);
+    return follow_die_ref (dwarf2_get_ref_die_offset (spec_attr, cu));
 }
 
 /* Free the line_header structure *LH, and any arrays and strings it
@@ -6869,8 +6431,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
             read_structure_type, and the correct name is saved in
             the type.  */
 
-         if (cu->language == language_cplus
-             || cu->language == language_java)
+         if (cu->language == language_cplus)
            {
              struct type *type = SYMBOL_TYPE (sym);
              
@@ -6887,7 +6448,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
            }
 
          {
-           /* NOTE: carlton/2003-11-10: C++ and Java class symbols shouldn't
+           /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
               really ever be static objects: otherwise, if you try
               to, say, break of a class's method and you're in a file
               which doesn't mention that class, it won't work unless
@@ -6898,18 +6459,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
            struct pending **list_to_add;
 
            list_to_add = (cu->list_in_scope == &file_symbols
-                          && (cu->language == language_cplus
-                              || cu->language == language_java)
+                          && cu->language == language_cplus
                           ? &global_symbols : cu->list_in_scope);
          
            add_symbol_to_list (sym, list_to_add);
 
            /* The semantics of C++ state that "struct foo { ... }" also
-              defines a typedef for "foo".  A Java class declaration also
-              defines a typedef for the class.  Synthesize a typedef symbol
-              so that "ptype foo" works as expected.  */
-           if (cu->language == language_cplus
-               || cu->language == language_java)
+              defines a typedef for "foo". Synthesize a typedef symbol so
+              that "ptype foo" works as expected.  */
+           if (cu->language == language_cplus)
              {
                struct symbol *typedef_sym = (struct symbol *)
                  obstack_alloc (&objfile->objfile_obstack,
@@ -6929,9 +6487,10 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
          if (processing_has_namespace_info
              && processing_current_prefix[0] != '\0')
            {
-             SYMBOL_LINKAGE_NAME (sym) = typename_concat (&objfile->objfile_obstack,
-                                                          processing_current_prefix,
-                                                          name, cu);
+             SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack,
+                                                   processing_current_prefix,
+                                                   "::",
+                                                   name);
            }
          SYMBOL_CLASS (sym) = LOC_TYPEDEF;
          SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
@@ -6947,9 +6506,10 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
          if (processing_has_namespace_info
              && processing_current_prefix[0] != '\0')
            {
-             SYMBOL_LINKAGE_NAME (sym) = typename_concat (&objfile->objfile_obstack,
-                                                          processing_current_prefix,
-                                                          name, cu);
+             SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack,
+                                                   processing_current_prefix,
+                                                   "::",
+                                                   name);
            }
          attr = dwarf2_attr (die, DW_AT_const_value, cu);
          if (attr)
@@ -6963,8 +6523,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
            struct pending **list_to_add;
 
            list_to_add = (cu->list_in_scope == &file_symbols
-                          && (cu->language == language_cplus
-                              || cu->language == language_java)
+                          && cu->language == language_cplus
                           ? &global_symbols : cu->list_in_scope);
          
            add_symbol_to_list (sym, list_to_add);
@@ -7098,6 +6657,7 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
   struct type *type;
   struct attribute *type_attr;
   struct die_info *type_die;
+  unsigned int ref;
 
   type_attr = dwarf2_attr (die, DW_AT_type, cu);
   if (!type_attr)
@@ -7106,8 +6666,16 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
       return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu);
     }
   else
-    type_die = follow_die_ref (die, type_attr, cu);
-
+    {
+      ref = dwarf2_get_ref_die_offset (type_attr, cu);
+      type_die = follow_die_ref (ref);
+      if (!type_die)
+       {
+         error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", 
+                         ref, cu->objfile->name);
+         return NULL;
+       }
+    }
   type = tag_type_to_type (type_die, cu);
   if (!type)
     {
@@ -7127,11 +6695,19 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
   struct type *type = NULL;
   struct attribute *type_attr;
   struct die_info *type_die = NULL;
+  unsigned int ref;
 
   type_attr = dwarf2_attr (die, DW_AT_containing_type, cu);
   if (type_attr)
     {
-      type_die = follow_die_ref (die, type_attr, cu);
+      ref = dwarf2_get_ref_die_offset (type_attr, cu);
+      type_die = follow_die_ref (ref);
+      if (!type_die)
+       {
+         error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", ref, 
+                         cu->objfile->name);
+         return NULL;
+       }
       type = tag_type_to_type (type_die, cu);
     }
   if (!type)
@@ -7144,6 +6720,24 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
   return type;
 }
 
+#if 0
+static struct type *
+type_at_offset (unsigned int offset, struct dwarf2_cu *cu)
+{
+  struct die_info *die;
+  struct type *type;
+
+  die = follow_die_ref (offset);
+  if (!die)
+    {
+      error ("Dwarf Error: Cannot find type referent at offset %d.", offset);
+      return NULL;
+    }
+  type = tag_type_to_type (die, cu);
+  return type;
+}
+#endif
+
 static struct type *
 tag_type_to_type (struct die_info *die, struct dwarf2_cu *cu)
 {
@@ -7238,8 +6832,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct die_info *parent;
 
-  if (cu->language != language_cplus
-      && cu->language != language_java)
+  if (cu->language != language_cplus)
     return NULL;
 
   parent = die->parent;
@@ -7263,10 +6856,9 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
            {
              int dummy;
              char *parent_prefix = determine_prefix (parent, cu);
-             char *retval = typename_concat (NULL, parent_prefix,
+             char *retval = typename_concat (parent_prefix,
                                              namespace_name (parent, &dummy,
-                                                             cu),
-                                             cu);
+                                                             cu));
              xfree (parent_prefix);
              return retval;
            }
@@ -7299,47 +6891,25 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
     }
 }
 
-/* Return a newly-allocated string formed by concatenating PREFIX and
-   SUFFIX with appropriate separator.  If PREFIX or SUFFIX is NULL or empty, then
-   simply copy the SUFFIX or PREFIX, respectively.  If OBS is non-null,
-   perform an obconcat, otherwise allocate storage for the result.  The CU argument
-   is used to determine the language and hence, the appropriate separator.  */
-
-#define MAX_SEP_LEN 2  /* sizeof ("::")  */
+/* Return a newly-allocated string formed by concatenating PREFIX,
+   "::", and SUFFIX, except that if PREFIX is NULL or the empty
+   string, just return a copy of SUFFIX.  */
 
 static char *
-typename_concat (struct obstack *obs, const char *prefix, const char *suffix, 
-                struct dwarf2_cu *cu)
+typename_concat (const char *prefix, const char *suffix)
 {
-  char *sep;
-
-  if (suffix == NULL || suffix[0] == '\0' || prefix == NULL || prefix[0] == '\0')
-    sep = "";
-  else if (cu->language == language_java)
-    sep = ".";
+  if (prefix == NULL || prefix[0] == '\0')
+    return xstrdup (suffix);
   else
-    sep = "::";
-
-  if (obs == NULL)
     {
-      char *retval = xmalloc (strlen (prefix) + MAX_SEP_LEN + strlen (suffix) + 1);
-      retval[0] = '\0';
-      
-      if (prefix)
-       {
-         strcpy (retval, prefix);
-         strcat (retval, sep);
-       }
-      if (suffix)
-       strcat (retval, suffix);
-      
+      char *retval = xmalloc (strlen (prefix) + 2 + strlen (suffix) + 1);
+
+      strcpy (retval, prefix);
+      strcat (retval, "::");
+      strcat (retval, suffix);
+
       return retval;
     }
-  else
-    {
-      /* We have an obstack.  */
-      return obconcat (obs, prefix, sep, suffix);
-    }
 }
 
 static struct type *
@@ -7497,12 +7067,21 @@ static struct die_info *
 dwarf2_extension (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct attribute *attr;
+  struct die_info *extension_die;
+  unsigned int ref;
 
   attr = dwarf2_attr (die, DW_AT_extension, cu);
   if (attr == NULL)
     return NULL;
 
-  return follow_die_ref (die, attr, cu);
+  ref = dwarf2_get_ref_die_offset (attr, cu);
+  extension_die = follow_die_ref (ref);
+  if (!extension_die)
+    {
+      error ("Dwarf Error: Cannot find referent at offset %d.", ref);
+    }
+
+  return extension_die;
 }
 
 /* Convert a DIE tag into its string name.  */
@@ -8339,16 +7918,13 @@ dump_die (struct die_info *die)
        case DW_FORM_block1:
          fprintf_unfiltered (gdb_stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
          break;
-       case DW_FORM_ref1:
-       case DW_FORM_ref2:
-       case DW_FORM_ref4:
-         fprintf_unfiltered (gdb_stderr, "constant ref: %ld (adjusted)",
-                             (long) (DW_ADDR (&die->attrs[i])));
-         break;
        case DW_FORM_data1:
        case DW_FORM_data2:
        case DW_FORM_data4:
        case DW_FORM_data8:
+       case DW_FORM_ref1:
+       case DW_FORM_ref2:
+       case DW_FORM_ref4:
        case DW_FORM_udata:
        case DW_FORM_sdata:
          fprintf_unfiltered (gdb_stderr, "constant: %ld", DW_UNSND (&die->attrs[i]));
@@ -8392,16 +7968,22 @@ dump_die_list (struct die_info *die)
 }
 
 static void
-store_in_ref_table (unsigned int offset, struct die_info *die,
-                   struct dwarf2_cu *cu)
+store_in_ref_table (unsigned int offset, struct die_info *die)
 {
   int h;
   struct die_info *old;
 
   h = (offset % REF_HASH_SIZE);
-  old = cu->die_ref_table[h];
+  old = die_ref_table[h];
   die->next_ref = old;
-  cu->die_ref_table[h] = die;
+  die_ref_table[h] = die;
+}
+
+
+static void
+dwarf2_empty_hash_tables (void)
+{
+  memset (die_ref_table, 0, sizeof (die_ref_table));
 }
 
 static unsigned int
@@ -8412,12 +7994,14 @@ dwarf2_get_ref_die_offset (struct attribute *attr, struct dwarf2_cu *cu)
   switch (attr->form)
     {
     case DW_FORM_ref_addr:
+      result = DW_ADDR (attr);
+      break;
     case DW_FORM_ref1:
     case DW_FORM_ref2:
     case DW_FORM_ref4:
     case DW_FORM_ref8:
     case DW_FORM_ref_udata:
-      result = DW_ADDR (attr);
+      result = cu->header.offset + DW_UNSND (attr);
       break;
     default:
       complaint (&symfile_complaints,
@@ -8450,41 +8034,21 @@ dwarf2_get_attr_constant_value (struct attribute *attr, int default_value)
 }
 
 static struct die_info *
-follow_die_ref (struct die_info *src_die, struct attribute *attr,
-               struct dwarf2_cu *cu)
+follow_die_ref (unsigned int offset)
 {
   struct die_info *die;
-  unsigned int offset;
   int h;
-  struct die_info temp_die;
-  struct dwarf2_cu *target_cu;
-
-  offset = dwarf2_get_ref_die_offset (attr, cu);
-
-  if (DW_ADDR (attr) < cu->header.offset
-      || DW_ADDR (attr) >= cu->header.offset + cu->header.length)
-    {
-      struct dwarf2_per_cu_data *per_cu;
-      per_cu = dwarf2_find_containing_comp_unit (DW_ADDR (attr),
-                                                cu->objfile);
-      target_cu = per_cu->cu;
-    }
-  else
-    target_cu = cu;
 
   h = (offset % REF_HASH_SIZE);
-  die = target_cu->die_ref_table[h];
+  die = die_ref_table[h];
   while (die)
     {
       if (die->offset == offset)
-       return die;
+       {
+         return die;
+       }
       die = die->next_ref;
     }
-
-  error ("Dwarf Error: Cannot find DIE at 0x%lx referenced from DIE "
-        "at 0x%lx [in module %s]",
-        (long) src_die->offset, (long) offset, cu->objfile->name);
-
   return NULL;
 }
 
@@ -9213,85 +8777,9 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
     }
 }
 
-/* Locate the compilation unit from CU's objfile which contains the
-   DIE at OFFSET.  Raises an error on failure.  */
-
-static struct dwarf2_per_cu_data *
-dwarf2_find_containing_comp_unit (unsigned long offset,
-                                 struct objfile *objfile)
-{
-  struct dwarf2_per_cu_data *this_cu;
-  int low, high;
-
-  low = 0;
-  high = dwarf2_per_objfile->n_comp_units - 1;
-  while (high > low)
-    {
-      int mid = low + (high - low) / 2;
-      if (dwarf2_per_objfile->all_comp_units[mid]->offset >= offset)
-       high = mid;
-      else
-       low = mid + 1;
-    }
-  gdb_assert (low == high);
-  if (dwarf2_per_objfile->all_comp_units[low]->offset > offset)
-    {
-      if (low == 0)
-       error ("Dwarf Error: could not find partial DIE containing "
-              "offset 0x%lx [in module %s]",
-              (long) offset, bfd_get_filename (objfile->obfd));
-
-      gdb_assert (dwarf2_per_objfile->all_comp_units[low-1]->offset <= offset);
-      return dwarf2_per_objfile->all_comp_units[low-1];
-    }
-  else
-    {
-      this_cu = dwarf2_per_objfile->all_comp_units[low];
-      if (low == dwarf2_per_objfile->n_comp_units - 1
-         && offset >= this_cu->offset + this_cu->length)
-       error ("invalid dwarf2 offset %ld", offset);
-      gdb_assert (offset < this_cu->offset + this_cu->length);
-      return this_cu;
-    }
-}
-
-/* Locate the compilation unit from OBJFILE which is located at exactly
-   OFFSET.  Raises an error on failure.  */
-
-static struct dwarf2_per_cu_data *
-dwarf2_find_comp_unit (unsigned long offset, struct objfile *objfile)
-{
-  struct dwarf2_per_cu_data *this_cu;
-  this_cu = dwarf2_find_containing_comp_unit (offset, objfile);
-  if (this_cu->offset != offset)
-    error ("no compilation unit with offset %ld\n", offset);
-  return this_cu;
-}
-
-/* Release one cached compilation unit, CU.  We unlink it from the tree
-   of compilation units, but we don't remove it from the read_in_chain;
-   the caller is responsible for that.  */
-
-static void
-free_one_comp_unit (void *data)
-{
-  struct dwarf2_cu *cu = data;
-
-  if (cu->per_cu != NULL)
-    cu->per_cu->cu = NULL;
-  cu->per_cu = NULL;
-
-  obstack_free (&cu->comp_unit_obstack, NULL);
-  if (cu->dies)
-    free_die_list (cu->dies);
-
-  xfree (cu);
-}
-
 /* 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 be
-   sure to unlink it from the cache.  Also release any associated storage
-   and perform cache maintenance.
+   when we're finished with it.  We can't free the pointer itself, but
+   release any associated storage.
 
    Only used during partial symbol parsing.  */
 
@@ -9302,263 +8790,6 @@ free_stack_comp_unit (void *data)
 
   obstack_free (&cu->comp_unit_obstack, NULL);
   cu->partial_dies = NULL;
-
-  if (cu->per_cu != NULL)
-    {
-      /* This compilation unit is on the stack in our caller, so we
-        should not xfree it.  Just unlink it.  */
-      cu->per_cu->cu = NULL;
-      cu->per_cu = NULL;
-
-      /* If we had a per-cu pointer, then we may have other compilation
-        units loaded, so age them now.  */
-      age_cached_comp_units ();
-    }
-}
-
-/* Free all cached compilation units.  */
-
-static void
-free_cached_comp_units (void *data)
-{
-  struct dwarf2_per_cu_data *per_cu, **last_chain;
-
-  per_cu = dwarf2_per_objfile->read_in_chain;
-  last_chain = &dwarf2_per_objfile->read_in_chain;
-  while (per_cu != NULL)
-    {
-      struct dwarf2_per_cu_data *next_cu;
-
-      next_cu = per_cu->cu->read_in_chain;
-
-      free_one_comp_unit (per_cu->cu);
-      *last_chain = next_cu;
-
-      per_cu = next_cu;
-    }
-}
-
-/* Increase the age counter on each cached compilation unit, and free
-   any that are too old.  */
-
-static void
-age_cached_comp_units (void)
-{
-  struct dwarf2_per_cu_data *per_cu, **last_chain;
-
-  dwarf2_clear_marks (dwarf2_per_objfile->read_in_chain);
-  per_cu = dwarf2_per_objfile->read_in_chain;
-  while (per_cu != NULL)
-    {
-      per_cu->cu->last_used ++;
-      if (per_cu->cu->last_used <= dwarf2_max_cache_age)
-       dwarf2_mark (per_cu->cu);
-      per_cu = per_cu->cu->read_in_chain;
-    }
-
-  per_cu = dwarf2_per_objfile->read_in_chain;
-  last_chain = &dwarf2_per_objfile->read_in_chain;
-  while (per_cu != NULL)
-    {
-      struct dwarf2_per_cu_data *next_cu;
-
-      next_cu = per_cu->cu->read_in_chain;
-
-      if (!per_cu->cu->mark)
-       {
-         free_one_comp_unit (per_cu->cu);
-         *last_chain = next_cu;
-       }
-      else
-       last_chain = &per_cu->cu->read_in_chain;
-
-      per_cu = next_cu;
-    }
-}
-
-/* Remove a single compilation unit from the cache.  */
-
-static void
-free_one_cached_comp_unit (void *target_cu)
-{
-  struct dwarf2_per_cu_data *per_cu, **last_chain;
-
-  per_cu = dwarf2_per_objfile->read_in_chain;
-  last_chain = &dwarf2_per_objfile->read_in_chain;
-  while (per_cu != NULL)
-    {
-      struct dwarf2_per_cu_data *next_cu;
-
-      next_cu = per_cu->cu->read_in_chain;
-
-      if (per_cu->cu == target_cu)
-       {
-         free_one_comp_unit (per_cu->cu);
-         *last_chain = next_cu;
-         break;
-       }
-      else
-       last_chain = &per_cu->cu->read_in_chain;
-
-      per_cu = next_cu;
-    }
-}
-
-/* A pair of DIE offset and GDB type pointer.  We store these
-   in a hash table separate from the DIEs, and preserve them
-   when the DIEs are flushed out of cache.  */
-
-struct dwarf2_offset_and_type
-{
-  unsigned int offset;
-  struct type *type;
-};
-
-/* Hash function for a dwarf2_offset_and_type.  */
-
-static hashval_t
-offset_and_type_hash (const void *item)
-{
-  const struct dwarf2_offset_and_type *ofs = item;
-  return ofs->offset;
-}
-
-/* Equality function for a dwarf2_offset_and_type.  */
-
-static int
-offset_and_type_eq (const void *item_lhs, const void *item_rhs)
-{
-  const struct dwarf2_offset_and_type *ofs_lhs = item_lhs;
-  const struct dwarf2_offset_and_type *ofs_rhs = item_rhs;
-  return ofs_lhs->offset == ofs_rhs->offset;
-}
-
-/* Set the type associated with DIE to TYPE.  Save it in CU's hash
-   table if necessary.  */
-
-static void
-set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
-{
-  struct dwarf2_offset_and_type **slot, ofs;
-
-  die->type = type;
-
-  if (cu->per_cu == NULL)
-    return;
-
-  if (cu->per_cu->type_hash == NULL)
-    cu->per_cu->type_hash
-      = htab_create_alloc_ex (cu->header.length / 24,
-                             offset_and_type_hash,
-                             offset_and_type_eq,
-                             NULL,
-                             &cu->objfile->objfile_obstack,
-                             hashtab_obstack_allocate,
-                             dummy_obstack_deallocate);
-
-  ofs.offset = die->offset;
-  ofs.type = type;
-  slot = (struct dwarf2_offset_and_type **)
-    htab_find_slot_with_hash (cu->per_cu->type_hash, &ofs, ofs.offset, INSERT);
-  *slot = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (**slot));
-  **slot = ofs;
-}
-
-/* Find the type for DIE in TYPE_HASH, or return NULL if DIE does not
-   have a saved type.  */
-
-static struct type *
-get_die_type (struct die_info *die, htab_t type_hash)
-{
-  struct dwarf2_offset_and_type *slot, ofs;
-
-  ofs.offset = die->offset;
-  slot = htab_find_with_hash (type_hash, &ofs, ofs.offset);
-  if (slot)
-    return slot->type;
-  else
-    return NULL;
-}
-
-/* Restore the types of the DIE tree starting at START_DIE from the hash
-   table saved in CU.  */
-
-static void
-reset_die_and_siblings_types (struct die_info *start_die, struct dwarf2_cu *cu)
-{
-  struct die_info *die;
-
-  if (cu->per_cu->type_hash == NULL)
-    return;
-
-  for (die = start_die; die != NULL; die = die->sibling)
-    {
-      die->type = get_die_type (die, cu->per_cu->type_hash);
-      if (die->child != NULL)
-       reset_die_and_siblings_types (die->child, cu);
-    }
-}
-
-/* Set the mark field in CU and in every other compilation unit in the
-   cache that we must keep because we are keeping CU.  */
-
-/* Add a dependence relationship from CU to REF_PER_CU.  */
-
-static void
-dwarf2_add_dependence (struct dwarf2_cu *cu,
-                      struct dwarf2_per_cu_data *ref_per_cu)
-{
-  void **slot;
-
-  if (cu->dependencies == NULL)
-    cu->dependencies
-      = htab_create_alloc_ex (5, htab_hash_pointer, htab_eq_pointer,
-                             NULL, &cu->comp_unit_obstack,
-                             hashtab_obstack_allocate,
-                             dummy_obstack_deallocate);
-
-  slot = htab_find_slot (cu->dependencies, ref_per_cu, INSERT);
-  if (*slot == NULL)
-    *slot = ref_per_cu;
-}
-
-/* Set the mark field in CU and in every other compilation unit in the
-   cache that we must keep because we are keeping CU.  */
-
-static int
-dwarf2_mark_helper (void **slot, void *data)
-{
-  struct dwarf2_per_cu_data *per_cu;
-
-  per_cu = (struct dwarf2_per_cu_data *) *slot;
-  if (per_cu->cu->mark)
-    return 1;
-  per_cu->cu->mark = 1;
-
-  if (per_cu->cu->dependencies != NULL)
-    htab_traverse (per_cu->cu->dependencies, dwarf2_mark_helper, NULL);
-
-  return 1;
-}
-
-static void
-dwarf2_mark (struct dwarf2_cu *cu)
-{
-  if (cu->mark)
-    return;
-  cu->mark = 1;
-  if (cu->dependencies != NULL)
-    htab_traverse (cu->dependencies, dwarf2_mark_helper, NULL);
-}
-
-static void
-dwarf2_clear_marks (struct dwarf2_per_cu_data *per_cu)
-{
-  while (per_cu)
-    {
-      per_cu->cu->mark = 0;
-      per_cu = per_cu->cu->read_in_chain;
-    }
 }
 
 /* Allocation function for the libiberty hash table which uses an
@@ -9604,53 +8835,10 @@ partial_die_eq (const void *item_lhs, const void *item_rhs)
   return part_die_lhs->offset == part_die_rhs->offset;
 }
 
-static struct cmd_list_element *set_dwarf2_cmdlist;
-static struct cmd_list_element *show_dwarf2_cmdlist;
-
-static void
-set_dwarf2_cmd (char *args, int from_tty)
-{
-  help_list (set_dwarf2_cmdlist, "maintenance set dwarf2 ", -1, gdb_stdout);
-}
-
-static void
-show_dwarf2_cmd (char *args, int from_tty)
-{ 
-  cmd_show_list (show_dwarf2_cmdlist, from_tty, "");
-}
-
 void _initialize_dwarf2_read (void);
 
 void
 _initialize_dwarf2_read (void)
 {
   dwarf2_objfile_data_key = register_objfile_data ();
-
-  add_prefix_cmd ("dwarf2", class_maintenance, set_dwarf2_cmd,
-                 "Set DWARF 2 specific variables.\n"
-                 "Configure DWARF 2 variables such as the cache size",
-                  &set_dwarf2_cmdlist, "maintenance set dwarf2 ",
-                  0/*allow-unknown*/, &maintenance_set_cmdlist);
-
-  add_prefix_cmd ("dwarf2", class_maintenance, show_dwarf2_cmd,
-                 "Show DWARF 2 specific variables\n"
-                 "Show DWARF 2 variables such as the cache size",
-                  &show_dwarf2_cmdlist, "maintenance show dwarf2 ",
-                  0/*allow-unknown*/, &maintenance_show_cmdlist);
-
-  add_setshow_zinteger_cmd ("max-cache-age", class_obscure,
-                           &dwarf2_max_cache_age,
-                           "Set the upper bound on the age of cached "
-                           "dwarf2 compilation units.",
-                           "Show the upper bound on the age of cached "
-                           "dwarf2 compilation units.",
-                           "A higher limit means that cached "
-                           "compilation units will be stored\n"
-                           "in memory longer, and more total memory will "
-                           "be used.  Zero disables\n"
-                           "caching, which can slow down startup.",
-                           "The upper bound on the age of cached "
-                           "dwarf2 compilation units is %d.",
-                           NULL, NULL, &set_dwarf2_cmdlist,
-                           &show_dwarf2_cmdlist);
 }
index 39d52fe5f58cbda3ff210142f25c7fb2c8328f97..01f1f51c265997bbb352726b708e00eefa0b7dc6 100644 (file)
@@ -855,11 +855,15 @@ gdb_readline2 (gdb_client_data client_data)
        }
 
       if (c == '\n')
+#ifndef CRLF_SOURCE_FILES
+       break;
+#else
        {
          if (input_index > 0 && result[input_index - 1] == '\r')
            input_index--;
          break;
        }
+#endif
 
       result[input_index++] = c;
       while (input_index >= result_size)
index f3246cacb8908593ef2e5960d61363227d6dcb70..7eaa15ab2ff7749e3d86074abe2a23c772f9f294 100644 (file)
@@ -699,7 +699,7 @@ Specify the filename of the executable file.";
   exec_ops.to_open = exec_open;
   exec_ops.to_close = exec_close;
   exec_ops.to_attach = find_default_attach;
-  exec_ops.deprecated_xfer_memory = xfer_memory;
+  exec_ops.to_xfer_memory = xfer_memory;
   exec_ops.to_files_info = exec_files_info;
   exec_ops.to_insert_breakpoint = ignore;
   exec_ops.to_remove_breakpoint = ignore;
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
deleted file mode 100644 (file)
index b59cf66..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Native-dependent code for FreeBSD.
-
-   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 FBSD_NAT_H
-#define FBSD_NAT_H
-
-/* Return a the name of file that can be opened to get the symbols for
-   the child process identified by PID.  */
-
-extern char *fbsd_pid_to_exec_file (int pid);
-
-/* Iterate over all the memory regions in the current inferior,
-   calling FUNC for each memory region.  OBFD is passed as the last
-   argument to FUNC.  */
-
-extern int fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
-                                                 int, int, int, void *),
-                                    void *obfd);
-
-/* Create appropriate note sections for a corefile, returning them in
-   allocated memory.  */
-
-extern char *fbsd_make_corefile_notes (bfd *obfd, int *note_size);
-
-#endif /* fbsd-nat.h */
similarity index 86%
rename from gdb/fbsd-nat.c
rename to gdb/fbsd-proc.c
index b7045d493e2dd1856caa0c04d282b943b2081f0c..f021d275b9aa16d1de6f8b9a9aa9feb7c32d88d3 100644 (file)
@@ -1,6 +1,6 @@
-/* Native-dependent code for FreeBSD.
+/* FreeBSD-specific methods for using the /proc file system.
 
-   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include <sys/types.h>
 
 #include "elf-bfd.h"
-#include "fbsd-nat.h"
-
-/* Return a the name of file that can be opened to get the symbols for
-   the child process identified by PID.  */
 
 char *
-fbsd_pid_to_exec_file (int pid)
+child_pid_to_exec_file (int pid)
 {
   char *path;
   char *buf;
@@ -54,8 +50,8 @@ fbsd_pid_to_exec_file (int pid)
 }
 
 static int
-fbsd_read_mapping (FILE *mapfile, unsigned long *start, unsigned long *end,
-                  char *protection)
+read_mapping (FILE *mapfile, unsigned long *start, unsigned long *end,
+             char *protection)
 {
   /* FreeBSD 5.1-RELEASE uses a 256-byte buffer.  */
   char buf[256];
@@ -74,11 +70,7 @@ fbsd_read_mapping (FILE *mapfile, unsigned long *start, unsigned long *end,
   return (ret != 0 && ret != EOF);
 }
 
-/* Iterate over all the memory regions in the current inferior,
-   calling FUNC for each memory region.  OBFD is passed as the last
-   argument to FUNC.  */
-
-int
+static int
 fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
                                       int, int, int, void *),
                          void *obfd)
@@ -100,7 +92,7 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
                      "Reading memory regions from %s\n", mapfilename);
 
   /* Now iterate until end-of-file.  */
-  while (fbsd_read_mapping (mapfile, &start, &end, &protection[0]))
+  while (read_mapping (mapfile, &start, &end, &protection[0]))
     {
       size = end - start;
 
@@ -126,10 +118,7 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
   return 0;
 }
 
-/* Create appropriate note sections for a corefile, returning them in
-   allocated memory.  */
-
-char *
+static char *
 fbsd_make_corefile_notes (bfd *obfd, int *note_size)
 {
   struct gdbarch *gdbarch = current_gdbarch;
@@ -179,3 +168,14 @@ fbsd_make_corefile_notes (bfd *obfd, int *note_size)
   make_cleanup (xfree, note_data);
   return note_data;
 }
+\f
+
+void
+_initialize_fbsd_proc (void)
+{
+  extern void inftarg_set_find_memory_regions ();
+  extern void inftarg_set_make_corefile_notes ();
+
+  inftarg_set_find_memory_regions (fbsd_find_memory_regions);
+  inftarg_set_make_corefile_notes (fbsd_make_corefile_notes);
+}
index 90580baaa766b378e48964bac24035455ebcd89d..e1d32b064525337fc889952e70752f66b323ff89 100644 (file)
@@ -1,8 +1,6 @@
 /* Fork a Unix child process, and set up to debug it, for GDB.
-
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
-   2000, 2001, 2004 Free Software Foundation, Inc.
-
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+   2001 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
    This file is part of GDB.
 
 #include <signal.h>
 
-/* This just gets used as a default if we can't find SHELL */
+/* This just gets used as a default if we can't find SHELL */
 #ifndef SHELL_FILE
 #define SHELL_FILE "/bin/sh"
 #endif
 
 extern char **environ;
 
-/* Break up SCRATCH into an argument vector suitable for passing to
-   execvp and store it in ARGV.  E.g., on "run a b c d" this routine
-   would get as input the string "a b c d", and as output it would
-   fill in ARGV with the four arguments "a", "b", "c", "d".  */
-
+/* This function breaks up an argument string into an argument
+ * vector suitable for passing to execvp().
+ * E.g., on "run a b c d" this routine would get as input
+ * the string "a b c d", and as output it would fill in argv with
+ * the four arguments "a", "b", "c", "d".
+ */
 static void
 breakup_args (char *scratch, char **argv)
 {
@@ -55,45 +54,49 @@ breakup_args (char *scratch, char **argv)
 
   for (;;)
     {
+
       /* Scan past leading separators */
       while (*cp == ' ' || *cp == '\t' || *cp == '\n')
-       cp++;
+       {
+         cp++;
+       }
 
-      /* Break if at end of string */
+      /* Break if at end of string */
       if (*cp == '\0')
        break;
 
-      /* Take an arg */
+      /* Take an arg */
       *argv++ = cp;
 
-      /* Scan for next arg separator */
+      /* Scan for next arg separator */
       cp = strchr (cp, ' ');
       if (cp == NULL)
        cp = strchr (cp, '\t');
       if (cp == NULL)
        cp = strchr (cp, '\n');
 
-      /* No separators => end of string => break */
+      /* No separators => end of string => break */
       if (cp == NULL)
        break;
 
-      /* Replace the separator with a terminator */
+      /* Replace the separator with a terminator */
       *cp++ = '\0';
     }
 
-  /* Null-terminate the vector.  */
+  /* execv requires a null-terminated arg vector */
   *argv = NULL;
+
 }
 
-/* When executing a command under the given shell, return non-zero if
-   the '!' character should be escaped when embedded in a quoted
+/* When executing a command under the given shell, return non-zero
+   if the '!' character should be escaped when embedded in a quoted
    command-line argument.  */
 
 static int
 escape_bang_in_quoted_argument (const char *shell_file)
 {
   const int shell_file_len = strlen (shell_file);
-
+  
   /* Bang should be escaped only in C Shells.  For now, simply check
      that the shell name ends with 'csh', which covers at least csh
      and tcsh.  This should be good enough for now.  */
@@ -109,14 +112,14 @@ escape_bang_in_quoted_argument (const char *shell_file)
   return 0;
 }
 
-/* Start an inferior Unix child process and sets inferior_ptid to its
-   pid.  EXEC_FILE is the file to run.  ALLARGS is a string containing
-   the arguments to the program.  ENV is the environment vector to
-   pass.  SHELL_FILE is the shell file, or NULL if we should pick
-   one.  */
+/* Start an inferior Unix child process and sets inferior_ptid to its pid.
+   EXEC_FILE is the file to run.
+   ALLARGS is a string containing the arguments to the program.
+   ENV is the environment vector to pass.  SHELL_FILE is the shell file,
+   or NULL if we should pick one.  Errors reported with error().  */
 
-/* This function is NOT reentrant.  Some of the variables have been
-   made static to ensure that they survive the vfork call.  */
+/* This function is NOT-REENTRANT.  Some of the variables have been
+   made static to ensure that they survive the vfork() call.  */
 
 void
 fork_inferior (char *exec_file_arg, char *allargs, char **env,
@@ -138,19 +141,20 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
   int shell = 0;
   static char **argv;
 
-  /* If no exec file handed to us, get it from the exec-file command
-     -- with a good, common error message if none is specified.  */
+  /* If no exec file handed to us, get it from the exec-file command -- with
+     a good, common error message if none is specified.  */
   exec_file = exec_file_arg;
   if (exec_file == 0)
     exec_file = get_exec_file (1);
 
-  /* STARTUP_WITH_SHELL is defined in inferior.h.  If 0,e we'll just
-    do a fork/exec, no shell, so don't bother figuring out what
-    shell.  */
+  /* STARTUP_WITH_SHELL is defined in inferior.h.
+   * If 0, we'll just do a fork/exec, no shell, so don't
+   * bother figuring out what shell.
+   */
   shell_file = shell_file_arg;
   if (STARTUP_WITH_SHELL)
     {
-      /* Figure out what shell to start up the user program under.  */
+      /* Figure out what shell to start up the user program under. */
       if (shell_file == NULL)
        shell_file = getenv ("SHELL");
       if (shell_file == NULL)
@@ -158,9 +162,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
       shell = 1;
     }
 
-  /* Multiplying the length of exec_file by 4 is to account for the
-     fact that it may expand when quoted; it is a worst-case number
-     based on every character being '.  */
+  /* Multiplying the length of exec_file by 4 is to account for the fact
+     that it may expand when quoted; it is a worst-case number based on
+     every character being '.  */
   len = 5 + 4 * strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop */ 12;
   /* If desired, concat something onto the front of ALLARGS.
      SHELL_COMMAND is the result.  */
@@ -174,18 +178,17 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
   if (!shell)
     {
-      /* We're going to call execvp.  Create argument vector.
-        Calculate an upper bound on the length of the vector by
-        assuming that every other character is a separate
-        argument.  */
-      int argc = (strlen (allargs) + 1) / 2 + 2;
-      argv = (char **) xmalloc (argc * sizeof (*argv));
+      /* We're going to call execvp. Create argv */
+      /* Largest case: every other character is a separate arg */
+      argv = (char **) xmalloc (((strlen (allargs) + 1) / (unsigned) 2 + 2) * sizeof (*argv));
       argv[0] = exec_file;
       breakup_args (allargs, &argv[1]);
+
     }
   else
     {
-      /* We're going to call a shell.  */
+
+      /* We're going to call a shell */
 
       /* Now add exec_file, quoting as necessary.  */
 
@@ -195,9 +198,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
       strcat (shell_command, "exec ");
 
-      /* Quoting in this style is said to work with all shells.  But
-         csh on IRIX 4.0.1 can't deal with it.  So we only quote it if
-         we need to.  */
+      /* Quoting in this style is said to work with all shells.  But csh
+         on IRIX 4.0.1 can't deal with it.  So we only quote it if we need
+         to.  */
       p = exec_file;
       while (1)
        {
@@ -248,29 +251,32 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
       strcat (shell_command, " ");
       strcat (shell_command, allargs);
+
     }
 
-  /* On some systems an exec will fail if the executable is open.  */
+  /* exec is said to fail if the executable is open.  */
   close_exec_file ();
 
   /* Retain a copy of our environment variables, since the child will
-     replace the value of environ and if we're vforked, we have to
+     replace the value of  environ  and if we're vforked, we have to
      restore it.  */
   save_our_env = environ;
 
   /* Tell the terminal handling subsystem what tty we plan to run on;
      it will just record the information for later.  */
+
   new_tty_prefork (inferior_io_terminal);
 
   /* It is generally good practice to flush any possible pending stdio
-     output prior to doing a fork, to avoid the possibility of both
-     the parent and child flushing the same data after the fork. */
+     output prior to doing a fork, to avoid the possibility of both the
+     parent and child flushing the same data after the fork. */
+
   gdb_flush (gdb_stdout);
   gdb_flush (gdb_stderr);
 
-  /* If there's any initialization of the target layers that must
-     happen to prepare to handle the child we're about fork, do it
-     now...  */
+  /* If there's any initialization of the target layers that must happen
+     to prepare to handle the child we're about fork, do it now...
+   */
   if (pre_trace_fun != NULL)
     (*pre_trace_fun) ();
 
@@ -295,9 +301,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
       if (debug_setpgrp == -1)
        perror ("setpgrp failed in child");
 
-      /* Ask the tty subsystem to switch to the one we specified
-         earlier (or to share the current terminal, if none was
-         specified).  */
+      /* Ask the tty subsystem to switch to the one we specified earlier
+         (or to share the current terminal, if none was specified).  */
+
       new_tty ();
 
       /* Changing the signal handlers for the inferior after
@@ -308,15 +314,14 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
       /* "Trace me, Dr. Memory!" */
       (*traceme_fun) ();
-
       /* The call above set this process (the "child") as debuggable
-        by the original gdb process (the "parent").  Since processes
-        (unlike people) can have only one parent, if you are debugging
-        gdb itself (and your debugger is thus _already_ the
-        controller/parent for this child), code from here on out is
-        undebuggable.  Indeed, you probably got an error message
-        saying "not parent".  Sorry; you'll have to use print
-        statements!  */
+       * by the original gdb process (the "parent").  Since processes
+       * (unlike people) can have only one parent, if you are
+       * debugging gdb itself (and your debugger is thus _already_ the
+       * controller/parent for this child),  code from here on out
+       * is undebuggable.  Indeed, you probably got an error message
+       * saying "not parent".  Sorry--you'll have to use print statements!
+       */
 
       /* There is no execlpe call, so we have to set the environment
          for our child in the global variable.  If we've vforked, this
@@ -325,17 +330,19 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
          path to find $SHELL.  Rich Pixley says so, and I agree.  */
       environ = env;
 
-      /* If we decided above to start up with a shell, we exec the
-        shell, "-c" says to interpret the next arg as a shell command
-        to execute, and this command is "exec <target-program>
-        <args>".  "-f" means "fast startup" to the c-shell, which
-        means don't do .cshrc file. Doing .cshrc may cause fork/exec
-        events which will confuse debugger start-up code.  */
+      /* If we decided above to start up with a shell,
+       * we exec the shell,
+       * "-c" says to interpret the next arg as a shell command
+       * to execute, and this command is "exec <target-program> <args>".
+       * "-f" means "fast startup" to the c-shell, which means
+       * don't do .cshrc file. Doing .cshrc may cause fork/exec
+       * events which will confuse debugger start-up code.
+       */
       if (shell)
        {
          execlp (shell_file, shell_file, "-c", shell_command, (char *) 0);
 
-         /* If we get here, it's an error */
+         /* If we get here, it's an error */
          fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,
                              safe_strerror (errno));
          gdb_flush (gdb_stderr);
@@ -343,14 +350,13 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
        }
       else
        {
-         /* Otherwise, we directly exec the target program with
-            execvp.  */
+         /* Otherwise, we directly exec the target program with execvp. */
          int i;
          char *errstring;
 
          execvp (exec_file, argv);
 
-         /* If we get here, it's an error */
+         /* If we get here, it's an error */
          errstring = safe_strerror (errno);
          fprintf_unfiltered (gdb_stderr, "Cannot exec %s ", exec_file);
 
@@ -363,10 +369,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
              i++;
            }
          fprintf_unfiltered (gdb_stderr, ".\n");
-#if 0
-         /* This extra info seems to be useless.  */
-         fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring);
-#endif
+         /* This extra info seems to be useless
+            fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring);
+          */
          gdb_flush (gdb_stderr);
          _exit (0177);
        }
@@ -377,21 +382,20 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
   init_thread_list ();
 
-  /* Needed for wait_for_inferior stuff below.  */
-  inferior_ptid = pid_to_ptid (pid);
+  inferior_ptid = pid_to_ptid (pid);   /* Needed for wait_for_inferior stuff below */
 
   /* Now that we have a child process, make it our target, and
-     initialize anything target-vector-specific that needs
-     initializing.  */
+     initialize anything target-vector-specific that needs initializing.  */
+
   (*init_trace_fun) (pid);
 
   /* We are now in the child process of interest, having exec'd the
      correct program, and are poised at the first instruction of the
      new program.  */
 
-  /* Allow target dependent code to play with the new process.  This
-     might be used to have target-specific code initialize a variable
-     in the new process prior to executing the first instruction.  */
+  /* Allow target dependent code to play with the new process.  This might be
+     used to have target-specific code initialize a variable in the new process
+     prior to executing the first instruction.  */
   TARGET_CREATE_INFERIOR_HOOK (pid);
 
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
@@ -405,16 +409,18 @@ void
 startup_inferior (int ntraps)
 {
   int pending_execs = ntraps;
-  int terminal_initted = 0;
+  int terminal_initted;
 
-  /* The process was started by the fork that created it, but it will
-     have stopped one instruction after execing the shell.  Here we
-     must get it up to actual execution of the real program.  */
+  /* The process was started by the fork that created it,
+     but it will have stopped one instruction after execing the shell.
+     Here we must get it up to actual execution of the real program.  */
 
   clear_proceed_status ();
 
   init_wait_for_inferior ();
 
+  terminal_initted = 0;
+
   if (STARTUP_WITH_SHELL)
     inferior_ignoring_startup_exec_events = ntraps;
   else
@@ -424,14 +430,13 @@ startup_inferior (int ntraps)
 
   while (1)
     {
-      /* Make wait_for_inferior be quiet. */
+      /* Make wait_for_inferior be quiet */
       stop_soon = STOP_QUIETLY;
       wait_for_inferior ();
       if (stop_signal != TARGET_SIGNAL_TRAP)
        {
-         /* Let shell child handle its own signals in its own way.
-            FIXME: what if child has exited?  Must exit loop
-            somehow.  */
+         /* Let shell child handle its own signals in its own way */
+         /* FIXME, what if child has exit()ed?  Must exit loop somehow */
          resume (0, stop_signal);
        }
       else
@@ -439,10 +444,9 @@ startup_inferior (int ntraps)
          /* We handle SIGTRAP, however; it means child did an exec.  */
          if (!terminal_initted)
            {
-             /* Now that the child has exec'd we know it has already
-                set its process group.  On POSIX systems, tcsetpgrp
-                will fail with EPERM if we try it before the child's
-                setpgid.  */
+             /* Now that the child has exec'd we know it has already set its
+                process group.  On POSIX systems, tcsetpgrp will fail with
+                EPERM if we try it before the child's setpgid.  */
 
              /* Set up the "saved terminal modes" of the inferior
                 based on what modes we are starting it with.  */
@@ -454,10 +458,11 @@ startup_inferior (int ntraps)
              terminal_initted = 1;
            }
 
-         if (--pending_execs == 0)
+         pending_execs = pending_execs - 1;
+         if (0 == pending_execs)
            break;
 
-         resume (0, TARGET_SIGNAL_0);  /* Just make it go on */
+         resume (0, TARGET_SIGNAL_0);  /* Just make it go on */
        }
     }
   stop_soon = NO_STOP_QUIETLY;
index 30e1928a95379fb31d11ff5889b9481ca1ee899d..7bc09f0208d996e4d09025477d19eb2320fab00f 100644 (file)
@@ -1293,8 +1293,8 @@ frv_check_watch_resources (int type, int cnt, int ot)
 }
 
 
-int
-frv_stopped_data_address (CORE_ADDR *addr_p)
+CORE_ADDR
+frv_stopped_data_address (void)
 {
   CORE_ADDR brr, dbar0, dbar1, dbar2, dbar3;
 
@@ -1305,24 +1305,15 @@ frv_stopped_data_address (CORE_ADDR *addr_p)
   dbar3 = read_register (dbar3_regnum);
 
   if (brr & (1<<11))
-    *addr_p = dbar0;
+    return dbar0;
   else if (brr & (1<<10))
-    *addr_p = dbar1;
+    return dbar1;
   else if (brr & (1<<9))
-    *addr_p = dbar2;
+    return dbar2;
   else if (brr & (1<<8))
-    *addr_p = dbar3;
+    return dbar3;
   else
     return 0;
-
-  return 1;
-}
-
-int
-frv_have_stopped_data_address (void)
-{
-  CORE_ADDR addr = 0;
-  return frv_stopped_data_address (&addr);
 }
 
 static CORE_ADDR
index 41b95d2642b48178984d83ed0fe1cf0b4a6fe13b..b21016107ade100ada4dd51e50200e28828d3d91 100755 (executable)
@@ -77,7 +77,6 @@ types="\
 -T prgregset_t -T fpregset_t -T gregset_t -T sigset_t \
 -T td_thrhandle_t -T td_event_msg_t -T td_thr_events_t \
 -T td_notify_t -T td_thr_iter_f -T td_thrinfo_t \
--T caddr_t \
 `cat *.h | sed -n \
     -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
     -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
index 0a28534990fb3cf738fad3b16631f97cf46ae8b8..81dd0a062db6299ffccdea62029306c813ffc3b4 100644 (file)
@@ -292,7 +292,7 @@ typedef struct td_thrinfo
   intptr_t ti_sp;                      /* Unused.  */
   short int ti_flags;                  /* Unused.  */
   int ti_pri;                          /* Thread priority.  */
-  lwpid_t ti_lid;                      /* Kernel pid for this thread.  */
+  lwpid_t ti_lid;                      /* Unused.  */
   sigset_t ti_sigmask;                 /* Signal mask.  */
   unsigned char ti_traceme;            /* Nonzero if event reporting
                                           enabled.  */
index 9dabd2c6587157dfee7ca1080e5d35fdcb4f6d55..8c4490ec9404a24640424fcb0a2a9ed30763b93d 100644 (file)
@@ -98,14 +98,6 @@ extern struct cmd_list_element *maintenanceinfolist;
 
 extern struct cmd_list_element *maintenanceprintlist;
 
-/* Chain containing all defined "maintenance set" subcommands. */
-
-extern struct cmd_list_element *maintenance_set_cmdlist;
-
-/* Chain containing all defined "maintenance show" subcommands. */
-
-extern struct cmd_list_element *maintenance_show_cmdlist;
-
 extern struct cmd_list_element *setprintlist;
 
 extern struct cmd_list_element *showprintlist;
index 96df7e507ee769e1c0b42a5eb4454bbf6cb2cbc4..0095e5f87e001ec716b5f342ad70f02913137c5f 100644 (file)
@@ -1,32 +1,3 @@
-2004-10-16  Daniel Jacobowitz  <dan@debian.org>
-
-       * linux-i386-low.c (ps_get_thread_area): New.
-       * linux-x86-64-low.c (ps_get_thread_area): New.
-       * linux-low.c: Include <sys/syscall.h>.
-       (linux_kill_one_process): Don't kill the first thread here.
-       (linux_kill): Kill the first thread here.
-       (kill_lwp): New function.
-       (send_sigstop, linux_send_signal): Use it.
-       * proc-service.c: Clean up #ifdefs.
-       (fpregset_info): Delete.
-       (ps_lgetregs): Update and enable implementation.
-       (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
-       implementations.
-       * remote-utils.c (struct sym_cache, symbol_cache): New.
-       (input_interrupt): Print a clearer message.
-       (async_io_enabled): New variable.
-       (enable_async_io, disable_async_io): Use it.  Update comments.
-       (look_up_one_symbol): Use the symbol cache.
-       * thread-db.c (thread_db_look_up_symbols): New function.
-       (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
-
-2004-10-16  Daniel Jacobowitz  <dan@debian.org>
-
-       * configure.in: Test for -rdynamic.
-       * configure: Regenerated.
-       * Makefile (INTERNAL_LDFLAGS): New.
-       (gdbserver, gdbreplay): Use it.
-
 2004-09-02  Andrew Cagney  <cagney@gnu.org>
 
        * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
index 712376157ffb0cfdfbcb710a6819972a7437e6ac..a5c1f95531be82db897c14e65f8faee5af47280f 100644 (file)
@@ -103,7 +103,6 @@ INTERNAL_CFLAGS =  $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
 # LDFLAGS is specifically reserved for setting from the command line
 # when running make.
 LDFLAGS = @LDFLAGS@
-INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
 
 # Perhaps should come from parent Makefile
 VERSION = gdbserver-4.12.3
@@ -172,12 +171,12 @@ clean-info:
 
 gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS}
        rm -f gdbserver
-       ${CC-LD} $(GLOBAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver $(OBS) \
+       ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbserver $(OBS) \
          $(GDBSERVER_LIBS) $(XM_CLIBS)
 
 gdbreplay: gdbreplay.o
        rm -f gdbreplay
-       ${CC-LD} $(GLOBAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay gdbreplay.o \
+       ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \
          $(XM_CLIBS)
 
 # Put the proper machine-specific files first, so M-. on a machine
index 0bcefd6bc44ad0118129c89ad76c60a3f9310938..62d3785f4ab78f7d7d9ff7b85eb9deff3cfa52e9 100755 (executable)
@@ -1582,28 +1582,6 @@ rm -f conftest*
   else
     srv_libs="$srv_cv_thread_db"
   fi
-  old_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS -rdynamic"
-  cat > conftest.$ac_ext <<EOF
-#line 1589 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  RDYNAMIC=-rdynamic
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  RDYNAMIC=
-fi
-rm -f conftest*
-  
-  LDFLAGS="$old_LDFLAGS"
 fi
 
 if test "$srv_linux_thread_db" = "yes"; then
@@ -1771,7 +1749,6 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@CPP@%$CPP%g
-s%@RDYNAMIC@%$RDYNAMIC%g
 s%@GDBSERVER_DEPFILES@%$GDBSERVER_DEPFILES%g
 s%@GDBSERVER_LIBS@%$GDBSERVER_LIBS%g
 s%@USE_THREAD_DB@%$USE_THREAD_DB%g
index 027699a6063536dad158d976d904b0a023e3bfc1..a5a34dfbda0208c7a54c260bc6c40e43ad24724a 100644 (file)
@@ -1,5 +1,5 @@
 dnl Autoconf configure script for GDB server.
-dnl Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+dnl Copyright 2000, 2002 Free Software Foundation, Inc.
 dnl
 dnl This file is part of GDB.
 dnl
@@ -114,11 +114,6 @@ if test "$srv_linux_thread_db" = "yes"; then
   else
     srv_libs="$srv_cv_thread_db"
   fi
-  old_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS -rdynamic"
-  AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
-  AC_SUBST(RDYNAMIC)
-  LDFLAGS="$old_LDFLAGS"
 fi
 
 if test "$srv_linux_thread_db" = "yes"; then
index d8cc4ecaed9d7b36e06dfe5f3d0b7156d4bc4de6..b79b601ae8f5b203dc6e6a2e612a64f5a8dc0a0f 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 #include "linux-low.h"
 #include "i387-fp.h"
 
-/* Correct for all GNU/Linux targets (for quite some time).  */
-#define GDB_GREGSET_T elf_gregset_t
-#define GDB_FPREGSET_T elf_fpregset_t
-
-#ifndef HAVE_ELF_FPREGSET_T
-/* Make sure we have said types.  Not all platforms bring in <linux/elf.h>
-   via <sys/procfs.h>.  */
-#ifdef HAVE_LINUX_ELF_H   
-#include <linux/elf.h>    
-#endif
-#endif
-   
-#include "../gdb_proc_service.h"
-
-#include <sys/ptrace.h>
-
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
 
-#ifndef PTRACE_GET_THREAD_AREA
-#define PTRACE_GET_THREAD_AREA 25
-#endif
-
 /* This module only supports access to the general purpose registers.  */
 
 #define i386_num_regs 16
@@ -63,22 +43,6 @@ static int i386_regmap[] =
   DS * 4, ES * 4, FS * 4, GS * 4
 };
 
-/* Called by libthread_db.  */
-
-ps_err_e
-ps_get_thread_area (const struct ps_prochandle *ph, 
-                   lwpid_t lwpid, int idx, void **base)
-{
-  unsigned int desc[4];
-
-  if (ptrace (PTRACE_GET_THREAD_AREA, lwpid,
-             (void *) idx, (unsigned long) &desc) < 0)
-    return PS_ERR;
-
-  *(int *)base = desc[1];
-  return PS_OK;
-}
-
 static int
 i386_cannot_store_register (int regno)
 {
index 9c41fbb2281f06ce3d5434181d140d8764bfdd07..5733180e997337af4febecca31a3af7f0ab82a72 100644 (file)
@@ -35,7 +35,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <sys/syscall.h>
 
 /* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead,
    however.  This requires changing the ID in place when we go from !using_threads
@@ -224,13 +223,6 @@ linux_kill_one_process (struct inferior_list_entry *entry)
   struct process_info *process = get_thread_process (thread);
   int wstat;
 
-  /* We avoid killing the first thread here, because of a Linux kernel (at
-     least 2.6.0-test7 through 2.6.8-rc4) bug; if we kill the parent before
-     the children get a chance to be reaped, it will remain a zombie
-     forever.  */
-  if (entry == all_threads.head)
-    return;
-
   do
     {
       ptrace (PTRACE_KILL, pid_of (process), 0, 0);
@@ -243,21 +235,7 @@ linux_kill_one_process (struct inferior_list_entry *entry)
 static void
 linux_kill (void)
 {
-  struct thread_info *thread = (struct thread_info *) all_threads.head;
-  struct process_info *process = get_thread_process (thread);
-  int wstat;
-
   for_each_inferior (&all_threads, linux_kill_one_process);
-
-  /* See the comment in linux_kill_one_process.  We did not kill the first
-     thread in the list, so do so now.  */
-  do
-    {
-      ptrace (PTRACE_KILL, pid_of (process), 0, 0);
-
-      /* Make sure it died.  The loop is most likely unnecessary.  */
-      wstat = linux_wait_for_event (thread);
-    } while (WIFSTOPPED (wstat));
 }
 
 static void
@@ -731,30 +709,6 @@ retry:
   return ((unsigned char) WSTOPSIG (w));
 }
 
-/* Send a signal to an LWP.  For LinuxThreads, kill is enough; however, if
-   thread groups are in use, we need to use tkill.  */
-
-static int
-kill_lwp (int lwpid, int signo)
-{
-  static int tkill_failed;
-
-  errno = 0;
-
-#ifdef SYS_tkill
-  if (!tkill_failed)
-    {
-      int ret = syscall (SYS_tkill, lwpid, signo);
-      if (errno != ENOSYS)
-        return ret;
-      errno = 0;
-      tkill_failed = 1;
-    }
-#endif
-
-  return kill (lwpid, signo);
-}
-
 static void
 send_sigstop (struct inferior_list_entry *entry)
 {
@@ -774,7 +728,7 @@ send_sigstop (struct inferior_list_entry *entry)
   if (debug_threads)
     fprintf (stderr, "Sending sigstop to process %d\n", process->head.id);
 
-  kill_lwp (process->head.id, SIGSTOP);
+  kill (process->head.id, SIGSTOP);
   process->sigstop_sent = 1;
 }
 
@@ -1434,10 +1388,10 @@ linux_send_signal (int signum)
       struct process_info *process;
 
       process = get_thread_process (current_inferior);
-      kill_lwp (process->lwpid, signum);
+      kill (process->lwpid, signum);
     }
   else
-    kill_lwp (signal_pid, signum);
+    kill (signal_pid, signum);
 }
 
 /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
index 45f00b0c880a3556199f2e9fa7f4f26954898038..4ee1ae48190af621c32058ab90bb3047258dc3e0 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU/Linux/x86-64 specific low level interface, for the remote server
    for GDB.
-   Copyright 2002, 2004
+   Copyright 2002
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 #include "linux-low.h"
 #include "i387-fp.h"
 
-/* Correct for all GNU/Linux targets (for quite some time).  */
-#define GDB_GREGSET_T elf_gregset_t
-#define GDB_FPREGSET_T elf_fpregset_t
-
-#ifndef HAVE_ELF_FPREGSET_T
-/* Make sure we have said types.  Not all platforms bring in <linux/elf.h>
-   via <sys/procfs.h>.  */
-#ifdef HAVE_LINUX_ELF_H   
-#include <linux/elf.h>    
-#endif
-#endif
-   
-#include "../gdb_proc_service.h"
-
 #include <sys/reg.h>
 #include <sys/procfs.h>
 #include <sys/ptrace.h>
 
-/* This definition comes from prctl.h, but some kernels may not have it.  */
-#ifndef PTRACE_ARCH_PRCTL
-#define PTRACE_ARCH_PRCTL      30
-#endif
-
 static int x86_64_regmap[] = {
   RAX * 8, RBX * 8, RCX * 8, RDX * 8,
   RSI * 8, RDI * 8, RBP * 8, RSP * 8,
@@ -58,28 +39,6 @@ static int x86_64_regmap[] = {
 
 #define X86_64_NUM_GREGS (sizeof(x86_64_regmap)/sizeof(int))
 
-/* Called by libthread_db.  */
-
-ps_err_e
-ps_get_thread_area (const struct ps_prochandle *ph,
-                    lwpid_t lwpid, int idx, void **base)
-{
-  switch (idx)
-    {
-    case FS:
-      if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
-       return PS_OK;
-      break;
-    case GS:
-      if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
-       return PS_OK;
-      break;
-    default:
-      return PS_BADADDR;
-    }
-  return PS_ERR;
-}
-
 static void
 x86_64_fill_gregset (void *buf)
 {
index 5b83dec7465bfc3a7bbc388b65b69054b70e6f30..becf565529b59da596ff87c26cd7b4ba3fc818af 100644 (file)
@@ -1,5 +1,5 @@
 /* libthread_db helper functions for the remote server for GDB.
-   Copyright 2002, 2004
+   Copyright 2002
    Free Software Foundation, Inc.
 
    Contributed by MontaVista Software.
@@ -48,11 +48,11 @@ typedef void *gdb_ps_read_buf_t;
 typedef const void *gdb_ps_write_buf_t;
 typedef size_t gdb_ps_size_t;
 
-#ifdef HAVE_LINUX_REGSETS
-#define HAVE_REGSETS
-#endif
-
-#ifdef HAVE_REGSETS
+/* FIXME redo this right */
+#if 0
+#ifndef HAVE_LINUX_REGSETS
+#error HAVE_LINUX_REGSETS required!
+#else
 static struct regset_info *
 gregset_info(void)
 {
@@ -67,6 +67,22 @@ gregset_info(void)
 
   return &target_regsets[i];
 }
+
+static struct regset_info *
+fpregset_info(void)
+{
+  int i = 0;
+
+  while (target_regsets[i].size != -1)
+    {
+      if (target_regsets[i].type == FP_REGS)
+       break;
+      i++;
+    }
+
+  return &target_regsets[i];
+}
+#endif
 #endif
 
 /* Search for the symbol named NAME within the object named OBJ within
@@ -112,8 +128,9 @@ ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
 ps_err_e
 ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
-#ifdef HAVE_REGSETS
+#if 0
   struct thread_info *reg_inferior, *save_inferior;
+  void *regcache;
 
   reg_inferior = (struct thread_info *) find_inferior_id (&all_threads,
                                                          lwpid);
@@ -123,14 +140,16 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
   save_inferior = current_inferior;
   current_inferior = reg_inferior;
 
-  the_target->fetch_registers (0);
-  gregset_info()->fill_function (gregset);
+  regcache = new_register_cache ();
+  the_target->fetch_registers (0, regcache);
+  gregset_info()->fill_function (gregset, regcache);
+  free_register_cache (regcache);
 
   current_inferior = save_inferior;
   return PS_OK;
-#else
-  return PS_ERR;
 #endif
+  /* FIXME */
+  return PS_ERR;
 }
 
 /* Set the general registers of LWP LWPID within the target process PH
@@ -139,7 +158,27 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 ps_err_e
 ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
 {
-  /* Unneeded.  */
+#if 0
+  struct thread_info *reg_inferior, *save_inferior;
+  void *regcache;
+
+  reg_inferior = (struct thread_info *) find_inferior_id (&all_threads, lwpid);
+  if (reg_inferior == NULL)
+    return PS_ERR;
+
+  save_inferior = current_inferior;
+  current_inferior = reg_inferior;
+
+  regcache = new_register_cache ();
+  gregset_info()->store_function (gregset, regcache);
+  the_target->store_registers (0, regcache);
+  free_register_cache (regcache);
+
+  current_inferior = save_inferior;
+
+  return PS_OK;
+#endif
+  /* FIXME */
   return PS_ERR;
 }
 
@@ -150,7 +189,27 @@ ps_err_e
 ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
               gdb_prfpregset_t *fpregset)
 {
-  /* Unneeded.  */
+#if 0
+  struct thread_info *reg_inferior, *save_inferior;
+  void *regcache;
+
+  reg_inferior = (struct thread_info *) find_inferior_id (&all_threads, lwpid);
+  if (reg_inferior == NULL)
+    return PS_ERR;
+
+  save_inferior = current_inferior;
+  current_inferior = reg_inferior;
+
+  regcache = new_register_cache ();
+  the_target->fetch_registers (0, regcache);
+  fpregset_info()->fill_function (fpregset, regcache);
+  free_register_cache (regcache);
+
+  current_inferior = save_inferior;
+
+  return PS_OK;
+#endif
+  /* FIXME */
   return PS_ERR;
 }
 
@@ -161,7 +220,27 @@ ps_err_e
 ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
               const gdb_prfpregset_t *fpregset)
 {
-  /* Unneeded.  */
+#if 0
+  struct thread_info *reg_inferior, *save_inferior;
+  void *regcache;
+
+  reg_inferior = (struct thread_info *) find_inferior_id (&all_threads, lwpid);
+  if (reg_inferior == NULL)
+    return PS_ERR;
+
+  save_inferior = current_inferior;
+  current_inferior = reg_inferior;
+
+  regcache = new_register_cache ();
+  fpregset_info()->store_function (fpregset, regcache);
+  the_target->store_registers (0, regcache);
+  free_register_cache (regcache);
+
+  current_inferior = save_inferior;
+
+  return PS_OK;
+#endif
+  /* FIXME */
   return PS_ERR;
 }
 
index 0d2bdef06a0464512d539fba51fbb73289068c28..26b267a3aaf108a6f4dde02ba057494b581ba10e 100644 (file)
 #include <unistd.h>
 #include <arpa/inet.h>
 
-/* A cache entry for a successfully looked-up symbol.  */
-struct sym_cache
-{
-  const char *name;
-  CORE_ADDR addr;
-  struct sym_cache *next;
-};
-
-/* The symbol cache.  */
-static struct sym_cache *symbol_cache;
-
 int remote_debug = 0;
 struct ui_file *gdb_stdlog;
 
@@ -364,14 +353,13 @@ input_interrupt (int unused)
   if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0)
     {
       int cc;
-      char c = 0;
+      char c;
       
       cc = read (remote_desc, &c, 1);
 
       if (cc != 1 || c != '\003')
        {
-         fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n",
-                  cc, c, c);
+         fprintf (stderr, "input_interrupt, cc = %d c = %d\n", cc, c);
          return;
        }
       
@@ -397,33 +385,16 @@ unblock_async_io (void)
   sigprocmask (SIG_UNBLOCK, &sigio_set, NULL);
 }
 
-/* Asynchronous I/O support.  SIGIO must be enabled when waiting, in order to
-   accept Control-C from the client, and must be disabled when talking to
-   the client.  */
-
-/* Current state of asynchronous I/O.  */
-static int async_io_enabled;
-
-/* Enable asynchronous I/O.  */
 void
 enable_async_io (void)
 {
-  if (async_io_enabled)
-    return;
-
   signal (SIGIO, input_interrupt);
-  async_io_enabled = 1;
 }
 
-/* Disable asynchronous I/O.  */
 void
 disable_async_io (void)
 {
-  if (!async_io_enabled)
-    return;
-
   signal (SIGIO, SIG_IGN);
-  async_io_enabled = 0;
 }
 
 /* Returns next char from remote GDB.  -1 if error.  */
@@ -721,23 +692,11 @@ decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
   convert_ascii_to_int (&from[i++], to, *len_ptr);
 }
 
-/* Ask GDB for the address of NAME, and return it in ADDRP if found.
-   Returns 1 if the symbol is found, 0 if it is not, -1 on error.  */
-
 int
 look_up_one_symbol (const char *name, CORE_ADDR *addrp)
 {
   char own_buf[266], *p, *q;
   int len;
-  struct sym_cache *sym;
-
-  /* Check the cache first.  */
-  for (sym = symbol_cache; sym; sym = sym->next)
-    if (strcmp (name, sym->name) == 0)
-      {
-       *addrp = sym->addr;
-       return 1;
-      }
 
   /* Send the request.  */
   strcpy (own_buf, "qSymbol:");
@@ -772,13 +731,6 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp)
     return 0;
 
   decode_address (addrp, p, q - p);
-
-  /* Save the symbol in our cache.  */
-  sym = malloc (sizeof (*sym));
-  sym->name = strdup (name);
-  sym->addr = *addrp;
-  sym->next = symbol_cache;
-  symbol_cache = sym;
-
   return 1;
 }
+
index c6e0c2de3a797c66d6cb63897876766d4a5bc6d7..f3d57a54d622eb323061d34a023fcb81dca058a0 100644 (file)
@@ -312,36 +312,11 @@ thread_db_find_new_threads (void)
     error ("Cannot find new threads: %s", thread_db_err_str (err));
 }
 
-/* Cache all future symbols that thread_db might request.  We can not
-   request symbols at arbitrary states in the remote protocol, only
-   when the client tells us that new symbols are available.  So when
-   we load the thread library, make sure to check the entire list.  */
-
-static void
-thread_db_look_up_symbols (void)
-{
-  const char **sym_list = td_symbol_list ();
-  CORE_ADDR unused;
-
-  for (sym_list = td_symbol_list (); *sym_list; sym_list++)
-    look_up_one_symbol (*sym_list, &unused);
-}
-
 int
 thread_db_init ()
 {
   int err;
 
-  /* FIXME drow/2004-10-16: This is the "overall process ID", which
-     GNU/Linux calls tgid, "thread group ID".  When we support
-     attaching to threads, the original thread may not be the correct
-     thread.  We would have to get the process ID from /proc for NPTL.
-     For LinuxThreads we could do something similar: follow the chain
-     of parent processes until we find the highest one we're attached
-     to, and use its tgid.
-
-     This isn't the only place in gdbserver that assumes that the first
-     process in the list is the thread group leader.  */
   proc_handle.pid = ((struct inferior_list_entry *)current_inferior)->id;
 
   err = td_ta_new (&proc_handle, &thread_agent);
@@ -357,7 +332,6 @@ thread_db_init ()
       if (thread_db_enable_reporting () == 0)
        return 0;
       thread_db_find_new_threads ();
-      thread_db_look_up_symbols ();
       return 1;
 
     default:
index eb28de2faae0969fa69795917dcf0ec236ab46e2..4f95e136707f4af7d31fd83117814341b66376fa 100644 (file)
@@ -293,17 +293,6 @@ enum type_code
 #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
                                   & TYPE_FLAG_ADDRESS_CLASS_ALL)
 
-/* The debugging formats (especially STABS) do not contain enough information
-   to represent all Ada types---especially those whose size depends on
-   dynamic quantities.  Therefore, the GNAT Ada compiler includes
-   extra information in the form of additional type definitions
-   connected by naming conventions.  This flag indicates that the 
-   type is an ordinary (unencoded) GDB type that has been created from 
-   the necessary run-time information, and does not need further 
-   interpretation. Optionally marks ordinary, fixed-size GDB type. */
-
-#define TYPE_FLAG_FIXED_INSTANCE (1 << 15)
-
 /*  Array bound type.  */
 enum array_bound_type
 {
index c10e6e614568c0d21659dab9b35252122793b1ce..f43d1ba0d1396ef3d74bf092403c00be40b62ca5 100644 (file)
@@ -2597,7 +2597,7 @@ init_gnu_ops (void)
   gnu_ops.to_fetch_registers = gnu_fetch_registers;    /* to_fetch_registers */
   gnu_ops.to_store_registers = gnu_store_registers;    /* to_store_registers */
   gnu_ops.to_prepare_to_store = gnu_prepare_to_store; /* to_prepare_to_store */
-  gnu_ops.deprecated_xfer_memory = gnu_xfer_memory;
+  gnu_ops.to_xfer_memory = gnu_xfer_memory; /* to_xfer_memory */
   gnu_ops.to_find_memory_regions = gnu_find_memory_regions;
   gnu_ops.to_insert_breakpoint = memory_insert_breakpoint;
   gnu_ops.to_remove_breakpoint = memory_remove_breakpoint;
index c34db892fc9db4072ea6b4672d4ad6419f4f74f7..ec3b5aa650b616fab52fdcdd922401e9657c3cff 100644 (file)
@@ -861,7 +861,7 @@ init_go32_ops (void)
   go32_ops.to_fetch_registers = go32_fetch_registers;
   go32_ops.to_store_registers = go32_store_registers;
   go32_ops.to_prepare_to_store = go32_prepare_to_store;
-  go32_ops.deprecated_xfer_memory = go32_xfer_memory;
+  go32_ops.to_xfer_memory = go32_xfer_memory;
   go32_ops.to_files_info = go32_files_info;
   go32_ops.to_insert_breakpoint = memory_insert_breakpoint;
   go32_ops.to_remove_breakpoint = memory_remove_breakpoint;
index db15a1b30839776fb291a5054c7547c1d23ca31f..1209584e93e0bb3ccf0c3b8489704e23018c9ec2 100644 (file)
@@ -1660,11 +1660,6 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache)
            looking_for_rp = 0;
            cache->saved_regs[HPPA_RP_REGNUM].addr = -20;
          }
-       else if (inst == 0x6bc23fd1) /* stw rp,-0x18(sr0,sp) */
-         {
-           looking_for_rp = 0;
-           cache->saved_regs[HPPA_RP_REGNUM].addr = -24;
-         }
        else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
          {
            looking_for_rp = 0;
index 3979ecef3b8411ba2e2c0b05a0b7bc7d5ec93574..60e28890c8cc760759a868670b37d835d28d2b75 100644 (file)
@@ -1,7 +1,7 @@
-/* Native support code for HPUX PA-RISC, for GDB the GNU debugger.
-
-   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+/* Native support code for HPUX PA-RISC.
+   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -289,10 +289,10 @@ fetch_register (int regno)
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.
 
-   Returns the length copied, which is either the LEN argument or
-   zero.  This xfer function does not do partial moves, since
-   deprecated_child_ops doesn't allow memory operations to cross below
-   us in the target stack anyway.  TARGET is ignored.  */
+   Returns the length copied, which is either the LEN argument or zero.
+   This xfer function does not do partial moves, since child_ops
+   doesn't allow memory operations to cross below us in the target stack
+   anyway.  TARGET is ignored.  */
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
index e9f6cfb6b6e7c971ead6d06b278b0b63005eca50..5664314225c7541c2476b9d5afafcb537d83f33f 100644 (file)
@@ -1,8 +1,5 @@
-/* Low level interface for debugging HPUX/DCE threads for GDB, the GNU
-   debugger.
-
-   Copyright 1996, 1998, 1999, 2000, 2001, 2004 Free Software
-   Foundation, Inc.
+/* Low level interface for debugging HPUX/DCE threads for GDB, the GNU debugger.
+   Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -48,6 +45,7 @@
 #include "gdbcore.h"
 
 extern int child_suppress_run;
+extern struct target_ops child_ops;    /* target vector for inftarg.c */
 
 extern void _initialize_hpux_thread (void);
 
@@ -136,7 +134,7 @@ find_tcb (ptid_t ptid)
 static void
 hpux_thread_open (char *arg, int from_tty)
 {
-  deprecated_child_ops.to_open (arg, from_tty);
+  child_ops.to_open (arg, from_tty);
 }
 
 /* Attach to process PID, then initialize for debugging it
@@ -145,7 +143,7 @@ hpux_thread_open (char *arg, int from_tty)
 static void
 hpux_thread_attach (char *args, int from_tty)
 {
-  deprecated_child_ops.to_attach (args, from_tty);
+  child_ops.to_attach (args, from_tty);
 
   /* XXX - might want to iterate over all the threads and register them. */
 }
@@ -161,7 +159,7 @@ hpux_thread_attach (char *args, int from_tty)
 static void
 hpux_thread_detach (char *args, int from_tty)
 {
-  deprecated_child_ops.to_detach (args, from_tty);
+  child_ops.to_detach (args, from_tty);
 }
 
 /* Resume execution of process PID.  If STEP is nozero, then
@@ -188,7 +186,7 @@ hpux_thread_resume (ptid_t ptid, int step, enum target_signal signo)
     }
 #endif
 
-  deprecated_child_ops.to_resume (ptid, step, signo);
+  child_ops.to_resume (ptid, step, signo);
 
   cached_thread = 0;
 
@@ -211,7 +209,7 @@ hpux_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
   if (!ptid_equal (ptid, minus_one_ptid))
     ptid = main_ptid;
 
-  rtnval = deprecated_child_ops.to_wait (ptid, ourstatus);
+  rtnval = child_ops.to_wait (ptid, ourstatus);
 
   rtnval = find_active_thread ();
 
@@ -262,7 +260,7 @@ hpux_thread_fetch_registers (int regno)
 
   if (tcb_ptr->state == cma__c_state_running)
     {
-      deprecated_child_ops.to_fetch_registers (regno);
+      child_ops.to_fetch_registers (regno);
 
       do_cleanups (old_chain);
 
@@ -283,7 +281,7 @@ hpux_thread_fetch_registers (int regno)
   for (regno = first_regno; regno <= last_regno; regno++)
     {
       if (regmap[regno] == -1)
-       deprecated_child_ops.to_fetch_registers (regno);
+       child_ops.to_fetch_registers (regno);
       else
        {
          unsigned char buf[MAX_REGISTER_SIZE];
@@ -324,7 +322,7 @@ hpux_thread_store_registers (int regno)
 
   if (tcb_ptr->state == cma__c_state_running)
     {
-      deprecated_child_ops.to_store_registers (regno);
+      child_ops.to_store_registers (regno);
 
       do_cleanups (old_chain);
 
@@ -345,7 +343,7 @@ hpux_thread_store_registers (int regno)
   for (regno = first_regno; regno <= last_regno; regno++)
     {
       if (regmap[regno] == -1)
-       deprecated_child_ops.to_store_registers (regno);
+       child_ops.to_store_registers (regno);
       else
        {
          unsigned char buf[MAX_REGISTER_SIZE];
@@ -354,7 +352,7 @@ hpux_thread_store_registers (int regno)
          sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
 
          if (regno == FLAGS_REGNUM)
-           deprecated_child_ops.to_store_registers (regno);    /* Let lower layer handle this... */
+           child_ops.to_store_registers (regno);       /* Let lower layer handle this... */
          else if (regno == SP_REGNUM)
            {
              write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
@@ -387,7 +385,7 @@ hpux_thread_store_registers (int regno)
 static void
 hpux_thread_prepare_to_store (void)
 {
-  deprecated_child_ops.to_prepare_to_store ();
+  child_ops.to_prepare_to_store ();
 }
 
 static int
@@ -403,7 +401,7 @@ hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
   inferior_ptid = main_ptid;
 
   retval = 
-    deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target);
+    child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target);
 
   do_cleanups (old_chain);
 
@@ -415,19 +413,19 @@ hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
 static void
 hpux_thread_files_info (struct target_ops *ignore)
 {
-  deprecated_child_ops.to_files_info (ignore);
+  child_ops.to_files_info (ignore);
 }
 
 static void
 hpux_thread_kill_inferior (void)
 {
-  deprecated_child_ops.to_kill ();
+  child_ops.to_kill ();
 }
 
 static void
 hpux_thread_notice_signals (ptid_t ptid)
 {
-  deprecated_child_ops.to_notice_signals (ptid);
+  child_ops.to_notice_signals (ptid);
 }
 
 /* Fork an inferior process, and start debugging it with /proc.  */
@@ -436,7 +434,7 @@ static void
 hpux_thread_create_inferior (char *exec_file, char *allargs, char **env,
                             int from_tty)
 {
-  deprecated_child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
+  child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
 
   if (hpux_thread_active)
     {
@@ -500,7 +498,7 @@ quit:
 static void
 hpux_thread_mourn_inferior (void)
 {
-  deprecated_child_ops.to_mourn_inferior ();
+  child_ops.to_mourn_inferior ();
 }
 
 /* Mark our target-struct as eligible for stray "run" and "attach" commands.  */
@@ -520,7 +518,7 @@ hpux_thread_alive (ptid_t ptid)
 static void
 hpux_thread_stop (void)
 {
-  deprecated_child_ops.to_stop ();
+  child_ops.to_stop ();
 }
 \f
 /* Convert a pid to printable form. */
@@ -550,7 +548,7 @@ init_hpux_thread_ops (void)
   hpux_thread_ops.to_fetch_registers = hpux_thread_fetch_registers;
   hpux_thread_ops.to_store_registers = hpux_thread_store_registers;
   hpux_thread_ops.to_prepare_to_store = hpux_thread_prepare_to_store;
-  hpux_thread_ops.deprecated_xfer_memory = hpux_thread_xfer_memory;
+  hpux_thread_ops.to_xfer_memory = hpux_thread_xfer_memory;
   hpux_thread_ops.to_files_info = hpux_thread_files_info;
   hpux_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
   hpux_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
index 6b5f49b2a386212aca99ba8a352655510eb07cfb..95b46096b51770c9077d4b75536b6b14da17f9b0 100644 (file)
@@ -564,16 +564,14 @@ i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
   return nregs <= DR_NADDR ? 1 : 0;
 }
 
-/* If the inferior has some watchpoint that triggered, set the
-   address associated with that watchpoint and return non-zero.  
-   Otherwise, return zero.  */
+/* If the inferior has some watchpoint that triggered, return the
+   address associated with that watchpoint.  Otherwise, return zero.  */
 
-int
-i386_stopped_data_address (CORE_ADDR *addr_p)
+CORE_ADDR
+i386_stopped_data_address (void)
 {
   CORE_ADDR addr = 0;
   int i;
-  int rc = 0;
 
   dr_status_mirror = I386_DR_LOW_GET_STATUS ();
 
@@ -588,7 +586,6 @@ i386_stopped_data_address (CORE_ADDR *addr_p)
          && I386_DR_GET_RW_LEN (i) != 0)
        {
          addr = dr_mirror[i];
-         rc = 1;
          if (maint_show_dr)
            i386_show_dr ("watchpoint_hit", addr, -1, hw_write);
        }
@@ -596,16 +593,7 @@ i386_stopped_data_address (CORE_ADDR *addr_p)
   if (maint_show_dr && addr == 0)
     i386_show_dr ("stopped_data_addr", 0, 0, hw_write);
 
-  if (rc)
-    *addr_p = addr;
-  return rc;
-}
-
-int
-i386_stopped_by_watchpoint (void)
-{
-  CORE_ADDR addr = 0;
-  return i386_stopped_data_address (&addr);
+  return addr;
 }
 
 /* Return non-zero if the inferior has some break/watchpoint that
index d5cd111c90193949a9633f110637e774ef880b18..cc727c81d98653f418cb7111e096f09d7ff83f29 100644 (file)
@@ -151,16 +151,16 @@ i386_fpc_regnum_p (int regnum)
   return (I387_FCTRL_REGNUM <= regnum && regnum < I387_XMM0_REGNUM);
 }
 
-/* Return the name of register REGNUM.  */
+/* Return the name of register REG.  */
 
 const char *
-i386_register_name (int regnum)
+i386_register_name (int reg)
 {
-  if (i386_mmx_regnum_p (current_gdbarch, regnum))
-    return i386_mmx_names[regnum - I387_MM0_REGNUM];
+  if (i386_mmx_regnum_p (current_gdbarch, reg))
+    return i386_mmx_names[reg - I387_MM0_REGNUM];
 
-  if (regnum >= 0 && regnum < i386_num_register_names)
-    return i386_register_names[regnum];
+  if (reg >= 0 && reg < i386_num_register_names)
+    return i386_register_names[reg];
 
   return NULL;
 }
index 349112a4ad0cfd18721fe2678603f3104855c308..f54d2f0fb72e578239046592160841bfa94b4765 100644 (file)
@@ -33,8 +33,6 @@
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
-#include "i386bsd-nat.h"
-#include "inf-ptrace.h"
 \f
 
 /* In older BSD versions we cannot get at some of the segment
@@ -130,8 +128,8 @@ i386bsd_collect_gregset (const struct regcache *regcache,
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers (including the floating point registers).  */
 
-static void
-i386bsd_fetch_inferior_registers (int regnum)
+void
+fetch_inferior_registers (int regnum)
 {
   if (regnum == -1 || GETREGS_SUPPLIES (regnum))
     {
@@ -180,8 +178,8 @@ i386bsd_fetch_inferior_registers (int regnum)
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
    this for all registers (including the floating point registers).  */
 
-static void
-i386bsd_store_inferior_registers (int regnum)
+void
+store_inferior_registers (int regnum)
 {
   if (regnum == -1 || GETREGS_SUPPLIES (regnum))
     {
@@ -237,20 +235,6 @@ i386bsd_store_inferior_registers (int regnum)
 #endif
     }
 }
-
-/* Create a prototype *BSD/i386 target.  The client can override it
-   with local methods.  */
-
-struct target_ops *
-i386bsd_target (void)
-{
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = i386bsd_fetch_inferior_registers;
-  t->to_store_registers = i386bsd_store_inferior_registers;
-  return t;
-}
 \f
 
 /* Support for debug registers.  */
index bf4bd94d8c182256a79b55fea96ce92f6c18790e..ed07711ab3114e42c0f453248d40fd12e6f9cf83 100644 (file)
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
-#include "target.h"
 
 #include <sys/types.h>
 #include <sys/ptrace.h>
 #include <sys/sysctl.h>
 
-#include "fbsd-nat.h"
 #include "i386-tdep.h"
-#include "i386bsd-nat.h"
 
-/* Resume execution of the inferior process.  If STEP is nonzero,
-   single-step it.  If SIGNAL is nonzero, give it that signal.  */
+/* Resume execution of the inferior process.
+   If STEP is nonzero, single-step it.
+   If SIGNAL is nonzero, give it that signal.  */
 
-static void
-i386fbsd_resume (ptid_t ptid, int step, enum target_signal signal)
+void
+child_resume (ptid_t ptid, int step, enum target_signal signal)
 {
   pid_t pid = ptid_get_pid (ptid);
   int request = PT_STEP;
@@ -121,19 +119,6 @@ void _initialize_i386fbsd_nat (void);
 void
 _initialize_i386fbsd_nat (void)
 {
-  struct target_ops *t;
-
-  /* Add some extra features to the common *BSD/i386 target.  */
-  t = i386bsd_target ();
-  t->to_resume = i386fbsd_resume;
-  t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
-  t->to_find_memory_regions = fbsd_find_memory_regions;
-  t->to_make_corefile_notes = fbsd_make_corefile_notes;
-  add_target (t);
-
-  /* Support debugging kernel virtual memory images.  */
-  bsd_kvm_add_target (i386fbsd_supply_pcb);
-
   /* FreeBSD provides a kern.ps_strings sysctl that we can use to
      locate the sigtramp.  That way we can still recognize a sigtramp
      if its location is changed in a new kernel.  Of course this is
@@ -156,4 +141,7 @@ _initialize_i386fbsd_nat (void)
       }
   }
 #endif
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (i386fbsd_supply_pcb);
 }
index 023fbb7d6e8650ccefa2b3ea57c012c3fe092b5b..f694eba91e573ec758603a5fab53d066cfe5551d 100644 (file)
@@ -28,7 +28,6 @@
 #include "gdb_assert.h"
 #include <errno.h>
 #include <stdio.h>
-#include "gdb_string.h"
 
 #include <mach.h>
 #include <mach_error.h>
@@ -61,9 +60,8 @@ static int reg_offset[] =
 #define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
 
 \f
-/* Get the whole floating-point state of THREAD and record the values
-   of the corresponding (pseudo) registers.  */
-
+/* Get the whole floating-point state of THREAD and record the
+   values of the corresponding (pseudo) registers.  */
 static void
 fetch_fpregs (struct proc *thread)
 {
@@ -81,15 +79,18 @@ fetch_fpregs (struct proc *thread)
     }
 
   if (!state.initialized)
+    /* The floating-point state isn't initialized.  */
     {
-      /* The floating-point state isn't initialized.  */
-      i387_supply_fsave (current_regcache, -1, NULL);
-    }
-  else
-    {
-      /* Supply the floating-point registers.  */
-      i387_supply_fsave (current_regcache, -1, state.hw_state);
+      int i;
+
+      for (i = FP0_REGNUM; i <= FOP_REGNUM; i++)
+       regcache_raw_supply (current_regcache, i, NULL);
+
+      return;
     }
+
+  /* Supply the floating-point registers.  */
+  i387_supply_fsave (current_regcache, -1, state.hw_state);
 }
 
 #ifdef HAVE_SYS_PROCFS_H
index 22af0117e4e53370ce5b7691811c57f4aa34e20e..92da7e18dcdeabe3e89a2439d6585f89c5f42383 100644 (file)
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
-#include "target.h"
 
 #include "i386-tdep.h"
-#include "i386bsd-nat.h"
 
 /* Support for debugging kernel virtual memory images.  */
 
@@ -79,9 +77,6 @@ void _initialize_i386nbsd_nat (void);
 void
 _initialize_i386nbsd_nat (void)
 {
-  /* We've got nothing to add to the common *BSD/i386 target.  */
-  add_target (i386bsd_target ());
-
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (i386nbsd_supply_pcb);
 }
index 285567c9bbec7ff8bca15ba7d4fc8a5e71f5ac6c..09daf246c15cde53ae2895367c8b2e63cb6d3805 100644 (file)
@@ -418,7 +418,8 @@ fill_gregset (gregset_t *gregsetp, int regno)
 
 #define COPY_REG(_idx_,_regi_) \
   if ((regno == -1) || regno == _regi_) \
-    regcache_raw_collect (current_regcache, _regi_, regp + _idx_)
+    memcpy (regp + _idx_, &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
+           register_size (current_gdbarch, _regi_))
 
   for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
     {
@@ -475,12 +476,17 @@ void
 fill_fpregset (fpregset_t *fpregsetp, int regno)
 {
   int regi;
+  char *to;
+  char *from;
 
   for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
     {
       if ((regno == -1) || (regno == regi))
-       regcache_raw_collect (current_regcache, regi,
-                             &((*fpregsetp)[regi - IA64_FR0_REGNUM]));
+       {
+         from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
+         to = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
+         memcpy (to, from, register_size (current_gdbarch, regi));
+       }
     }
 }
 
@@ -630,13 +636,12 @@ ia64_linux_remove_watchpoint (ptid_t ptid, CORE_ADDR addr, int len)
   return -1;
 }
 
-int
-ia64_linux_stopped_data_address (CORE_ADDR *addr_p)
+CORE_ADDR
+ia64_linux_stopped_by_watchpoint (ptid_t ptid)
 {
   CORE_ADDR psr;
   int tid;
   struct siginfo siginfo;
-  ptid_t ptid = inferior_ptid;
 
   tid = TIDGET(ptid);
   if (tid == 0)
@@ -654,15 +659,7 @@ ia64_linux_stopped_data_address (CORE_ADDR *addr_p)
                            for the next instruction */
   write_register_pid (IA64_PSR_REGNUM, psr, ptid);
 
-  *addr_p = (CORE_ADDR)siginfo.si_addr;
-  return 1;
-}
-
-int
-ia64_linux_stopped_by_watchpoint (void)
-{
-  CORE_ADDR addr;
-  return ia64_linux_stopped_data_address (&addr);
+  return (CORE_ADDR) siginfo.si_addr;
 }
 
 LONGEST 
index ebc6c6243d221bb2e6bc4c8fa1d9f04ddac5dd1b..f729611173adbfe27602c54245c489f59136bc72 100644 (file)
@@ -27,7 +27,6 @@
 #include "symtab.h"
 #include "target.h"
 #include "inferior.h"
-#include "gdb_string.h"
 
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers.  */
@@ -52,6 +51,14 @@ inf_child_store_inferior_registers (int regnum)
 {
 }
 
+void
+inf_child_post_wait (ptid_t ptid, int wait_status)
+{
+  /* This version of Unix doesn't require a meaningful "post wait"
+     operation.
+   */
+}
+
 static void
 inf_child_post_attach (int pid)
 {
@@ -181,6 +188,14 @@ inf_child_pid_to_exec_file (int pid)
   return NULL;
 }
 
+static char *
+inf_child_core_file_to_sym_file (char *core)
+{
+  /* The target stratum for a running executable need not support this
+     operation.  */
+  return NULL;
+}
+
 struct target_ops *
 inf_child_target (void)
 {
@@ -190,8 +205,7 @@ inf_child_target (void)
   t->to_doc = "Unix child process (started by the \"run\" command).";
   t->to_open = inf_child_open;
   t->to_post_attach = inf_child_post_attach;
-  t->to_fetch_registers = inf_child_fetch_inferior_registers;
-  t->to_store_registers = inf_child_store_inferior_registers;
+  t->to_post_wait = inf_child_post_wait;
   t->to_prepare_to_store = inf_child_prepare_to_store;
   t->to_insert_breakpoint = memory_insert_breakpoint;
   t->to_remove_breakpoint = memory_remove_breakpoint;
index 283a22dc4c826505ea07d3576812388098f58548..f79f7863ba67a8c417e462042126477aead4408d 100644 (file)
@@ -30,9 +30,8 @@
 #include "gdbcore.h"
 #include "inf-child.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
 
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <signal.h>
 
 /* HACK: Save the ptrace ops returned by ptrace_target.  */
@@ -55,8 +54,8 @@ inf_ptrace_kill_inferior (void)
 
      The kill call causes problems under hpux10, so it's been removed;
      if this causes problems we'll deal with them as they arise.  */
-  ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
-  wait (&status);
+  call_ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
+  ptrace_wait (null_ptid, &status);
   target_mourn_inferior ();
 }
 
@@ -95,6 +94,145 @@ inf_ptrace_resume (ptid_t ptid, int step, enum target_signal signal)
     perror_with_name ("ptrace");
 }
 
+/* Set an upper limit on alloca.  */
+#define GDB_MAX_ALLOCA 0x1000
+
+/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
+   in the NEW_SUN_PTRACE case.  It ought to be straightforward.  But
+   it appears that writing did not write the data that I specified.  I
+   cannot understand where it got the data that it actually did
+   write.  */
+
+/* Copy LEN bytes to or from inferior's memory starting at MEMADDR to
+   debugger memory starting at MYADDR.  Copy to inferior if WRITE is
+   nonzero.  TARGET is ignored.
+
+   Returns the length copied, which is either the LEN argument or
+   zero.  This xfer function does not do partial moves, since
+   ptrace_ops_hack doesn't allow memory operations to cross below us in the
+   target stack anyway.  */
+
+int
+inf_ptrace_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                       struct mem_attrib *attrib, struct target_ops *target)
+{
+  int i;
+  /* Round starting address down to longword boundary.  */
+  CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
+  /* Round ending address up; get number of longwords that makes.  */
+  int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
+              / sizeof (PTRACE_TYPE_RET));
+  int alloc = count * sizeof (PTRACE_TYPE_RET);
+  PTRACE_TYPE_RET *buffer;
+  struct cleanup *old_chain = NULL;
+
+#ifdef PT_IO
+  /* OpenBSD 3.1, NetBSD 1.6 and FreeBSD 5.0 have a new PT_IO request
+     that promises to be much more efficient in reading and writing
+     data in the traced process's address space.  */
+
+  {
+    struct ptrace_io_desc piod;
+
+    /* NOTE: We assume that there are no distinct address spaces for
+       instruction and data.  */
+    piod.piod_op = write ? PIOD_WRITE_D : PIOD_READ_D;
+    piod.piod_offs = (void *) memaddr;
+    piod.piod_addr = myaddr;
+    piod.piod_len = len;
+
+    if (ptrace (PT_IO, PIDGET (inferior_ptid), (caddr_t) & piod, 0) == -1)
+      {
+       /* If the PT_IO request is somehow not supported, fallback on
+          using PT_WRITE_D/PT_READ_D.  Otherwise we will return zero
+          to indicate failure.  */
+       if (errno != EINVAL)
+         return 0;
+      }
+    else
+      {
+       /* Return the actual number of bytes read or written.  */
+       return piod.piod_len;
+      }
+  }
+#endif
+
+  /* Allocate buffer of that many longwords.  */
+  if (len < GDB_MAX_ALLOCA)
+    {
+      buffer = (PTRACE_TYPE_RET *) alloca (alloc);
+    }
+  else
+    {
+      buffer = (PTRACE_TYPE_RET *) xmalloc (alloc);
+      old_chain = make_cleanup (xfree, buffer);
+    }
+
+  if (write)
+    {
+      /* Fill start and end extra bytes of buffer with existing memory
+         data.  */
+      if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET))
+       {
+         /* Need part of initial word -- fetch it.  */
+         buffer[0] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
+                             (PTRACE_TYPE_ARG3) addr, 0);
+       }
+
+      if (count > 1)           /* FIXME, avoid if even boundary.  */
+       {
+         buffer[count - 1] =
+           ptrace (PT_READ_I, PIDGET (inferior_ptid),
+                   ((PTRACE_TYPE_ARG3)
+                    (addr + (count - 1) * sizeof (PTRACE_TYPE_RET))), 0);
+       }
+
+      /* Copy data to be written over corresponding part of buffer.  */
+      memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
+             myaddr, len);
+
+      /* Write the entire buffer.  */
+      for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
+       {
+         errno = 0;
+         ptrace (PT_WRITE_D, PIDGET (inferior_ptid),
+                 (PTRACE_TYPE_ARG3) addr, buffer[i]);
+         if (errno)
+           {
+             /* Using the appropriate one (I or D) is necessary for
+                Gould NP1, at least.  */
+             errno = 0;
+             ptrace (PT_WRITE_I, PIDGET (inferior_ptid),
+                     (PTRACE_TYPE_ARG3) addr, buffer[i]);
+           }
+         if (errno)
+           return 0;
+       }
+    }
+  else
+    {
+      /* Read all the longwords.  */
+      for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
+       {
+         errno = 0;
+         buffer[i] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
+                             (PTRACE_TYPE_ARG3) addr, 0);
+         if (errno)
+           return 0;
+         QUIT;
+       }
+
+      /* Copy appropriate bytes out of the buffer.  */
+      memcpy (myaddr,
+             (char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
+             len);
+    }
+
+  if (old_chain != NULL)
+    do_cleanups (old_chain);
+  return len;
+}
+
 /* Wait for child to do something.  Return pid of child, or -1 in case
    of error; store status through argument pointer OURSTATUS.  */
 
@@ -116,7 +254,7 @@ inf_ptrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
                                   attached process. */
       set_sigio_trap ();
 
-      pid = wait (&status);
+      pid = ptrace_wait (inferior_ptid, &status);
 
       save_errno = errno;
 
@@ -159,6 +297,14 @@ inf_ptrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
   return pid_to_ptid (pid);
 }
 
+void
+inf_ptrace_post_wait (ptid_t ptid, int wait_status)
+{
+  /* This version of Unix doesn't require a meaningful "post wait"
+     operation.
+   */
+}
+
 /* Check to see if the given thread is alive.
 
    FIXME: Is kill() ever the right way to do this?  I doubt it, but
@@ -188,7 +334,7 @@ inf_ptrace_attach (char *args, int from_tty)
   dummy = args;
   pid = strtol (args, &dummy, 0);
   /* Some targets don't set errno on errors, grrr! */
-  if (pid == 0 && args == dummy)
+  if ((pid == 0) && (args == dummy))
     error ("Illegal process-id: %s\n", args);
 
   if (pid == getpid ())                /* Trying to masturbate? */
@@ -208,15 +354,7 @@ inf_ptrace_attach (char *args, int from_tty)
       gdb_flush (gdb_stdout);
     }
 
-#ifdef PT_ATTACH
-  errno = 0;
-  ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3) 0, 0);
-  if (errno != 0)
-    perror_with_name ("ptrace");
-  attach_flag = 1;
-#else
-  error ("This system does not support attaching to a process");
-#endif
+  attach (pid);
 
   inferior_ptid = pid_to_ptid (pid);
   push_target (ptrace_ops_hack);
@@ -239,7 +377,7 @@ inf_ptrace_post_attach (int pid)
 static void
 inf_ptrace_detach (char *args, int from_tty)
 {
-  int sig = 0;
+  int siggnal = 0;
   int pid = PIDGET (inferior_ptid);
 
   if (from_tty)
@@ -252,17 +390,9 @@ inf_ptrace_detach (char *args, int from_tty)
       gdb_flush (gdb_stdout);
     }
   if (args)
-    sig = atoi (args);
+    siggnal = atoi (args);
 
-#ifdef PT_DETACH
-  errno = 0;
-  ptrace (PT_DETACH, pid, (PTRACE_TYPE_ARG3) 1, sig);
-  if (errno != 0)
-    perror_with_name ("ptrace");
-  attach_flag = 0;
-#else
-  error ("This system does not support detaching from a process");
-#endif
+  detach (siggnal);
 
   inferior_ptid = null_ptid;
   unpush_target (ptrace_ops_hack);
@@ -302,7 +432,7 @@ static void
 inf_ptrace_me (void)
 {
   /* "Trace me, Dr. Memory!" */
-  ptrace (0, 0, (PTRACE_TYPE_ARG3) 0, 0);
+  call_ptrace (0, 0, (PTRACE_TYPE_ARG3) 0, 0);
 }
 
 /* Stub function which causes the GDB that runs it, to start ptrace-ing
@@ -480,99 +610,13 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
   switch (object)
     {
     case TARGET_OBJECT_MEMORY:
-#ifdef PT_IO
-      /* OpenBSD 3.1, NetBSD 1.6 and FreeBSD 5.0 have a new PT_IO
-        request that promises to be much more efficient in reading
-        and writing data in the traced process's address space.  */
-      {
-       struct ptrace_io_desc piod;
-       
-       /* NOTE: We assume that there are no distinct address spaces
-          for instruction and data.  */
-       piod.piod_op = writebuf ? PIOD_WRITE_D : PIOD_READ_D;
-       piod.piod_addr = writebuf ? (void *) writebuf : readbuf;
-       piod.piod_offs = (void *) (long) offset;
-       piod.piod_len = len;
-
-       errno = 0;
-       if (ptrace (PT_IO, PIDGET (inferior_ptid), (caddr_t) &piod, 0) == 0)
-         /* Return the actual number of bytes read or written.  */
-         return piod.piod_len;
-       /* If the PT_IO request is somehow not supported, fallback on
-          using PT_WRITE_D/PT_READ_D.  Otherwise we will return zero
-          to indicate failure.  */
-       if (errno != EINVAL)
-         return 0;
-      }
-#endif
-      {
-       union
-       {
-         PTRACE_TYPE_RET word;
-         unsigned char byte[sizeof (PTRACE_TYPE_RET)];
-       } buffer;
-       ULONGEST rounded_offset;
-       LONGEST partial_len;
-       
-       /* Round the start offset down to the next long word
-          boundary.  */
-       rounded_offset = offset & -(ULONGEST) sizeof (PTRACE_TYPE_RET);
-       
-       /* Since ptrace will transfer a single word starting at that
-          rounded_offset the partial_len needs to be adjusted down to
-          that (remember this function only does a single transfer).
-          Should the required length be even less, adjust it down
-          again.  */
-       partial_len = (rounded_offset + sizeof (PTRACE_TYPE_RET)) - offset;
-       if (partial_len > len)
-         partial_len = len;
-       
-       if (writebuf)
-         {
-           /* If OFFSET:PARTIAL_LEN is smaller than
-              ROUNDED_OFFSET:WORDSIZE then a read/modify write will
-              be needed.  Read in the entire word.  */
-           if (rounded_offset < offset
-               || (offset + partial_len
-                   < rounded_offset + sizeof (PTRACE_TYPE_RET)))
-             /* Need part of initial word -- fetch it.  */
-             buffer.word = ptrace (PT_READ_I, PIDGET (inferior_ptid),
-                                   (PTRACE_TYPE_ARG3) (long) rounded_offset,
-                                   0);
-           
-           /* Copy data to be written over corresponding part of
-              buffer.  */
-           memcpy (buffer.byte + (offset - rounded_offset), writebuf, partial_len);
-           
-           errno = 0;
-           ptrace (PT_WRITE_D, PIDGET (inferior_ptid),
-                   (PTRACE_TYPE_ARG3) (long) rounded_offset,
-                   buffer.word);
-           if (errno)
-             {
-               /* Using the appropriate one (I or D) is necessary for
-                  Gould NP1, at least.  */
-               errno = 0;
-               ptrace (PT_WRITE_I, PIDGET (inferior_ptid),
-                       (PTRACE_TYPE_ARG3) (long) rounded_offset,
-                       buffer.word);
-               if (errno)
-                 return 0;
-             }
-         }
-       if (readbuf)
-         {
-           errno = 0;
-           buffer.word = ptrace (PT_READ_I, PIDGET (inferior_ptid),
-                                 (PTRACE_TYPE_ARG3) (long) rounded_offset, 0);
-           if (errno)
-             return 0;
-           /* Copy appropriate bytes out of the buffer.  */
-           memcpy (readbuf, buffer.byte + (offset - rounded_offset),
-                   partial_len);
-         }
-       return partial_len;
-      }
+      if (readbuf)
+       return inf_ptrace_xfer_memory (offset, readbuf, len, 0 /*write */ ,
+                                      NULL, ops);
+      if (writebuf)
+       return inf_ptrace_xfer_memory (offset, readbuf, len, 1 /*write */ ,
+                                      NULL, ops);
+      return -1;
 
     case TARGET_OBJECT_UNWIND_TABLE:
       return -1;
@@ -604,7 +648,9 @@ inf_ptrace_target (void)
   t->to_detach = inf_ptrace_detach;
   t->to_resume = inf_ptrace_resume;
   t->to_wait = inf_ptrace_wait;
+  t->to_post_wait = inf_ptrace_post_wait;
   t->to_prepare_to_store = inf_ptrace_prepare_to_store;
+  t->to_xfer_memory = inf_ptrace_xfer_memory;
   t->to_xfer_partial = inf_ptrace_xfer_partial;
   t->to_files_info = inf_ptrace_files_info;
   t->to_kill = inf_ptrace_kill_inferior;
index ec4f11a013694f6351e9e327fa48bb2985eef499..53bcffd3ae7a6ba68efac515422ff680271c6761 100644 (file)
@@ -307,7 +307,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
   CORE_ADDR funaddr;
   int using_gcc;               /* Set to version of gcc in use, or zero if not gcc */
   CORE_ADDR real_pc;
-  struct type *ftype = check_typedef (VALUE_TYPE (function));
+  struct type *ftype = check_typedef (SYMBOL_TYPE (function));
   CORE_ADDR bp_addr;
   struct regcache *caller_regcache;
   struct cleanup *caller_regcache_cleanup;
index ec4ad1628ac1e4a37624b14dc261c8bffce024f3..fb7736c2fc5f9afda342ba8efb869d3adc30e72d 100644 (file)
@@ -138,24 +138,17 @@ call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data)
 /* Wait for a process to finish, possibly running a target-specific
    hook before returning.  */
 
-/* NOTE: cagney: 2004-09-29: Dependant on the native configuration,
-   "hppah-nat.c" may either call this or infttrace.c's implementation
-   of ptrace_wait.  See "hppahpux.mh".  */
-
 int
 ptrace_wait (ptid_t ptid, int *status)
 {
   int wstate;
 
   wstate = wait (status);
+  target_post_wait (pid_to_ptid (wstate), *status);
   return wstate;
 }
 
-#ifndef DEPRECATED_KILL_INFERIOR
-/* NOTE: cagney/2004-09-12: Instead of definining this macro, code
-   should call inf_ptrace_target to get a basic ptrace target and then
-   locally update any necessary methods.  See ppcnbsd-nat.c.  */
-
+#ifndef KILL_INFERIOR
 void
 kill_inferior (void)
 {
@@ -174,15 +167,12 @@ kill_inferior (void)
      The kill call causes problems under hpux10, so it's been removed;
      if this causes problems we'll deal with them as they arise.  */
   ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
-  wait (&status);
+  ptrace_wait (null_ptid, &status);
   target_mourn_inferior ();
 }
-#endif /* DEPRECATED_KILL_INFERIOR */
+#endif /* KILL_INFERIOR */
 
-#ifndef DEPRECATED_CHILD_RESUME
-/* NOTE: cagney/2004-09-12: Instead of definining this macro, code
-   should call inf_ptrace_target to get a basic ptrace target and then
-   locally update any necessary methods.  See ppcnbsd-nat.c.  */
+#ifndef CHILD_RESUME
 
 /* Resume execution of the inferior process.
    If STEP is nonzero, single-step it.
@@ -221,7 +211,7 @@ child_resume (ptid_t ptid, int step, enum target_signal signal)
   if (errno != 0)
     perror_with_name ("ptrace");
 }
-#endif /* DEPRECATED_CHILD_RESUME */
+#endif /* CHILD_RESUME */
 \f
 
 /* Start debugging the process whose number is PID.  */
@@ -403,8 +393,8 @@ store_inferior_registers (int regnum)
 
    Returns the length copied, which is either the LEN argument or
    zero.  This xfer function does not do partial moves, since
-   deprecated_child_ops doesn't allow memory operations to cross below
-   us in the target stack anyway.  */
+   child_ops doesn't allow memory operations to cross below us in the
+   target stack anyway.  */
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
index 7cf9953044a4ca454283c791f91c9a532e578324..cc302c2948ba79a5ca5c91073ec2f2cfbd281a79 100644 (file)
@@ -935,9 +935,9 @@ void init_execution_control_state (struct execution_control_state *ecs);
 void handle_inferior_event (struct execution_control_state *ecs);
 
 static void step_into_function (struct execution_control_state *ecs);
-static void insert_step_resume_breakpoint_at_frame (struct frame_info *step_frame);
-static void insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal,
-                                                 struct frame_id sr_id);
+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);
@@ -1081,6 +1081,18 @@ init_execution_control_state (struct execution_control_state *ecs)
   ecs->wp = &(ecs->ws);
 }
 
+/* Call this function before setting step_resume_breakpoint, as a
+   sanity check.  There should never be more than one step-resume
+   breakpoint per thread, so we should never be setting a new
+   step_resume_breakpoint when one is already active.  */
+static void
+check_for_old_step_resume_breakpoint (void)
+{
+  if (step_resume_breakpoint)
+    warning
+      ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
+}
+
 /* Return the cached copy of the last pid/waitstatus returned by
    target_wait()/deprecated_target_wait_hook().  The data is actually
    cached by handle_inferior_event(), which gets called immediately
@@ -1935,7 +1947,7 @@ process_event_stop_test:
             code paths as single-step - set a breakpoint at the
             signal return address and then, once hit, step off that
             breakpoint.  */
-         insert_step_resume_breakpoint_at_frame (get_current_frame ());
+         insert_step_resume_breakpoint (get_current_frame (), ecs);
          ecs->step_after_step_resume_breakpoint = 1;
        }
       else if (step_range_end != 0
@@ -1953,7 +1965,7 @@ process_event_stop_test:
             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_at_frame (get_current_frame ());
+         insert_step_resume_breakpoint (get_current_frame (), ecs);
        }
       keep_going (ecs);
       return;
@@ -2261,7 +2273,11 @@ process_event_stop_test:
          init_sal (&sr_sal);
          sr_sal.pc = pc_after_resolver;
 
-         insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+         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 ();
        }
 
       keep_going (ecs);
@@ -2319,7 +2335,8 @@ process_event_stop_test:
          /* 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_at_frame (get_prev_frame (get_current_frame ()));
+         insert_step_resume_breakpoint (get_prev_frame
+                                        (get_current_frame ()), ecs);
          keep_going (ecs);
          return;
        }
@@ -2329,7 +2346,8 @@ process_event_stop_test:
          /* 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_at_frame (get_prev_frame (get_current_frame ()));
+         insert_step_resume_breakpoint (get_prev_frame
+                                        (get_current_frame ()), ecs);
          keep_going (ecs);
          return;
        }
@@ -2351,7 +2369,12 @@ process_event_stop_test:
          init_sal (&sr_sal);
          sr_sal.pc = ecs->stop_func_start;
 
-         insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+         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 ();
+
          keep_going (ecs);
          return;
        }
@@ -2386,7 +2409,8 @@ process_event_stop_test:
 
       /* Set a breakpoint at callee's return address (the address at
          which the caller will resume).  */
-      insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ()));
+      insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
+                                    ecs);
       keep_going (ecs);
       return;
     }
@@ -2407,11 +2431,14 @@ process_event_stop_test:
          init_sal (&sr_sal);   /* initialize to zeroes */
          sr_sal.pc = real_stop_pc;
          sr_sal.section = find_pc_overlay (sr_sal.pc);
-
-         /* Do not specify what the fp should be when we stop since
-            on some machines the prologue is where the new fp value
-            is established.  */
-         insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+         /* Do not specify what the fp should be when we stop
+            since on some machines the prologue
+            is where the new fp value is established.  */
+         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 ();
 
          /* Restart without fiddling with the step ranges or
             other state.  */
@@ -2446,7 +2473,8 @@ process_event_stop_test:
        {
          /* Set a breakpoint at callee's return address (the address
             at which the caller will resume).  */
-         insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ()));
+         insert_step_resume_breakpoint (get_prev_frame
+                                        (get_current_frame ()), ecs);
          keep_going (ecs);
          return;
        }
@@ -2617,11 +2645,14 @@ step_into_function (struct execution_control_state *ecs)
       init_sal (&sr_sal);      /* initialize to zeroes */
       sr_sal.pc = ecs->stop_func_start;
       sr_sal.section = find_pc_overlay (ecs->stop_func_start);
-
       /* Do not specify what the fp should be when we stop since on
          some machines the prologue is where the new fp value is
          established.  */
-      insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+      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 ();
 
       /* And make sure stepping stops right away then.  */
       step_range_end = step_range_start;
@@ -2629,23 +2660,6 @@ step_into_function (struct execution_control_state *ecs)
   keep_going (ecs);
 }
 
-/* Insert a "step resume breakpoint" at SR_SAL with frame ID SR_ID.
-   This is used to both functions and to skip over code.  */
-
-static void
-insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal,
-                                     struct frame_id sr_id)
-{
-  /* There should never be more than one step-resume breakpoint per
-     thread, so we should never be setting a new
-     step_resume_breakpoint when one is already active.  */
-  gdb_assert (step_resume_breakpoint == NULL);
-  step_resume_breakpoint = set_momentary_breakpoint (sr_sal, sr_id,
-                                                    bp_step_resume);
-  if (breakpoints_inserted)
-    insert_breakpoints ();
-}
-                                     
 /* Insert a "step resume breakpoint" at RETURN_FRAME.pc.  This is used
    to skip a function (next, skip-no-debug) or signal.  It's assumed
    that the function/signal handler being skipped eventually returns
@@ -2661,7 +2675,8 @@ insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal,
    the interrupted function at RETURN_FRAME.pc.  */
 
 static void
-insert_step_resume_breakpoint_at_frame (struct frame_info *return_frame)
+insert_step_resume_breakpoint (struct frame_info *return_frame,
+                              struct execution_control_state *ecs)
 {
   struct symtab_and_line sr_sal;
 
@@ -2670,7 +2685,14 @@ insert_step_resume_breakpoint_at_frame (struct frame_info *return_frame)
   sr_sal.pc = ADDR_BITS_REMOVE (get_frame_pc (return_frame));
   sr_sal.section = find_pc_overlay (sr_sal.pc);
 
-  insert_step_resume_breakpoint_at_sal (sr_sal, get_frame_id (return_frame));
+  check_for_old_step_resume_breakpoint ();
+
+  step_resume_breakpoint
+    = set_momentary_breakpoint (sr_sal, get_frame_id (return_frame),
+                               bp_step_resume);
+
+  if (breakpoints_inserted)
+    insert_breakpoints ();
 }
 
 static void
index e9ace23a17fa386eac7fe9a1247c0290554caf03..68efdac30775b3acd6f47f2522e25eb777da9a2f 100644 (file)
@@ -53,6 +53,10 @@ static void child_prepare_to_store (void);
 static ptid_t child_wait (ptid_t, struct target_waitstatus *);
 #endif /* CHILD_WAIT */
 
+#if !defined(CHILD_POST_WAIT)
+void child_post_wait (ptid_t, int);
+#endif
+
 static void child_open (char *, int);
 
 static void child_files_info (struct target_ops *);
@@ -85,6 +89,8 @@ static void init_child_ops (void);
 
 extern char **environ;
 
+struct target_ops child_ops;
+
 int child_suppress_run = 0;    /* Non-zero if inftarg should pretend not to
                                   be a runnable target.  Used by targets
                                   that can sit atop inftarg, such as HPUX
@@ -113,7 +119,7 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
                                   attached process. */
       set_sigio_trap ();
 
-      pid = wait (&status);
+      pid = ptrace_wait (inferior_ptid, &status);
 
       save_errno = errno;
 
@@ -155,6 +161,17 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
 }
 #endif /* CHILD_WAIT */
 
+#if !defined(CHILD_POST_WAIT)
+void
+child_post_wait (ptid_t ptid, int wait_status)
+{
+  /* This version of Unix doesn't require a meaningful "post wait"
+     operation.
+   */
+}
+#endif
+
+
 #ifndef CHILD_THREAD_ALIVE
 
 /* Check to see if the given thread is alive.
@@ -210,7 +227,7 @@ child_attach (char *args, int from_tty)
   attach (pid);
   
   inferior_ptid = pid_to_ptid (pid);
-  push_target (&deprecated_child_ops);
+  push_target (&child_ops);
 }
 
 #if !defined(CHILD_POST_ATTACH)
@@ -251,7 +268,7 @@ child_detach (char *args, int from_tty)
   detach (siggnal);
   
   inferior_ptid = null_ptid;
-  unpush_target (&deprecated_child_ops);
+  unpush_target (&child_ops);
 }
 
 /* Get ready to modify the registers array.  On machines which store
@@ -299,7 +316,7 @@ ptrace_me (void)
 static void
 ptrace_him (int pid)
 {
-  push_target (&deprecated_child_ops);
+  push_target (&child_ops);
 
   /* On some targets, there must be some explicit synchronization
      between the parent and child processes after the debugger
@@ -462,7 +479,7 @@ child_has_exited (int pid, int wait_status, int *exit_status)
 static void
 child_mourn_inferior (void)
 {
-  unpush_target (&deprecated_child_ops);
+  unpush_target (&child_ops);
   generic_mourn_inferior ();
 }
 
@@ -540,7 +557,7 @@ child_xfer_partial (struct target_ops *ops, enum target_object object,
        return child_xfer_memory (offset, readbuf, len, 0/*write*/,
                                  NULL, ops);
       if (writebuf)
-       return child_xfer_memory (offset, (void *) writebuf, len, 1/*write*/,
+       return child_xfer_memory (offset, readbuf, len, 1/*write*/,
                                  NULL, ops);
       return -1;
 
@@ -581,57 +598,76 @@ child_pid_to_str (ptid_t ptid)
 static void
 init_child_ops (void)
 {
-  deprecated_child_ops.to_shortname = "child";
-  deprecated_child_ops.to_longname = "Unix child process";
-  deprecated_child_ops.to_doc = "Unix child process (started by the \"run\" command).";
-  deprecated_child_ops.to_open = child_open;
-  deprecated_child_ops.to_attach = child_attach;
-  deprecated_child_ops.to_post_attach = child_post_attach;
-  deprecated_child_ops.to_detach = child_detach;
-  deprecated_child_ops.to_resume = child_resume;
-  deprecated_child_ops.to_wait = child_wait;
-  deprecated_child_ops.to_fetch_registers = fetch_inferior_registers;
-  deprecated_child_ops.to_store_registers = store_inferior_registers;
-  deprecated_child_ops.to_prepare_to_store = child_prepare_to_store;
-  deprecated_child_ops.deprecated_xfer_memory = child_xfer_memory;
-  deprecated_child_ops.to_xfer_partial = child_xfer_partial;
-  deprecated_child_ops.to_files_info = child_files_info;
-  deprecated_child_ops.to_insert_breakpoint = memory_insert_breakpoint;
-  deprecated_child_ops.to_remove_breakpoint = memory_remove_breakpoint;
-  deprecated_child_ops.to_terminal_init = terminal_init_inferior;
-  deprecated_child_ops.to_terminal_inferior = terminal_inferior;
-  deprecated_child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
-  deprecated_child_ops.to_terminal_save_ours = terminal_save_ours;
-  deprecated_child_ops.to_terminal_ours = terminal_ours;
-  deprecated_child_ops.to_terminal_info = child_terminal_info;
-  deprecated_child_ops.to_kill = kill_inferior;
-  deprecated_child_ops.to_create_inferior = child_create_inferior;
-  deprecated_child_ops.to_post_startup_inferior = child_post_startup_inferior;
-  deprecated_child_ops.to_acknowledge_created_inferior = child_acknowledge_created_inferior;
-  deprecated_child_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint;
-  deprecated_child_ops.to_remove_fork_catchpoint = child_remove_fork_catchpoint;
-  deprecated_child_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
-  deprecated_child_ops.to_remove_vfork_catchpoint = child_remove_vfork_catchpoint;
-  deprecated_child_ops.to_follow_fork = child_follow_fork;
-  deprecated_child_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint;
-  deprecated_child_ops.to_remove_exec_catchpoint = child_remove_exec_catchpoint;
-  deprecated_child_ops.to_reported_exec_events_per_exec_call = child_reported_exec_events_per_exec_call;
-  deprecated_child_ops.to_has_exited = child_has_exited;
-  deprecated_child_ops.to_mourn_inferior = child_mourn_inferior;
-  deprecated_child_ops.to_can_run = child_can_run;
-  deprecated_child_ops.to_thread_alive = child_thread_alive;
-  deprecated_child_ops.to_pid_to_str = child_pid_to_str;
-  deprecated_child_ops.to_stop = child_stop;
-  deprecated_child_ops.to_enable_exception_callback = child_enable_exception_callback;
-  deprecated_child_ops.to_get_current_exception_event = child_get_current_exception_event;
-  deprecated_child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
-  deprecated_child_ops.to_stratum = process_stratum;
-  deprecated_child_ops.to_has_all_memory = 1;
-  deprecated_child_ops.to_has_memory = 1;
-  deprecated_child_ops.to_has_stack = 1;
-  deprecated_child_ops.to_has_registers = 1;
-  deprecated_child_ops.to_has_execution = 1;
-  deprecated_child_ops.to_magic = OPS_MAGIC;
+  child_ops.to_shortname = "child";
+  child_ops.to_longname = "Unix child process";
+  child_ops.to_doc = "Unix child process (started by the \"run\" command).";
+  child_ops.to_open = child_open;
+  child_ops.to_attach = child_attach;
+  child_ops.to_post_attach = child_post_attach;
+  child_ops.to_detach = child_detach;
+  child_ops.to_resume = child_resume;
+  child_ops.to_wait = child_wait;
+  child_ops.to_post_wait = child_post_wait;
+  child_ops.to_fetch_registers = fetch_inferior_registers;
+  child_ops.to_store_registers = store_inferior_registers;
+  child_ops.to_prepare_to_store = child_prepare_to_store;
+  child_ops.to_xfer_memory = child_xfer_memory;
+  child_ops.to_xfer_partial = child_xfer_partial;
+  child_ops.to_files_info = child_files_info;
+  child_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  child_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  child_ops.to_terminal_init = terminal_init_inferior;
+  child_ops.to_terminal_inferior = terminal_inferior;
+  child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  child_ops.to_terminal_save_ours = terminal_save_ours;
+  child_ops.to_terminal_ours = terminal_ours;
+  child_ops.to_terminal_info = child_terminal_info;
+  child_ops.to_kill = kill_inferior;
+  child_ops.to_create_inferior = child_create_inferior;
+  child_ops.to_post_startup_inferior = child_post_startup_inferior;
+  child_ops.to_acknowledge_created_inferior = child_acknowledge_created_inferior;
+  child_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint;
+  child_ops.to_remove_fork_catchpoint = child_remove_fork_catchpoint;
+  child_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
+  child_ops.to_remove_vfork_catchpoint = child_remove_vfork_catchpoint;
+  child_ops.to_follow_fork = child_follow_fork;
+  child_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint;
+  child_ops.to_remove_exec_catchpoint = child_remove_exec_catchpoint;
+  child_ops.to_reported_exec_events_per_exec_call = child_reported_exec_events_per_exec_call;
+  child_ops.to_has_exited = child_has_exited;
+  child_ops.to_mourn_inferior = child_mourn_inferior;
+  child_ops.to_can_run = child_can_run;
+  child_ops.to_thread_alive = child_thread_alive;
+  child_ops.to_pid_to_str = child_pid_to_str;
+  child_ops.to_stop = child_stop;
+  child_ops.to_enable_exception_callback = child_enable_exception_callback;
+  child_ops.to_get_current_exception_event = child_get_current_exception_event;
+  child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
+  child_ops.to_stratum = process_stratum;
+  child_ops.to_has_all_memory = 1;
+  child_ops.to_has_memory = 1;
+  child_ops.to_has_stack = 1;
+  child_ops.to_has_registers = 1;
+  child_ops.to_has_execution = 1;
+  child_ops.to_magic = OPS_MAGIC;
+}
+
+/* Take over the 'find_mapped_memory' vector from inftarg.c. */
+extern void
+inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
+                                                      unsigned long,
+                                                      int, int, int,
+                                                      void *),
+                                             void *))
+{
+  child_ops.to_find_memory_regions = func;
+}
+
+/* Take over the 'make_corefile_notes' vector from inftarg.c. */
+extern void
+inftarg_set_make_corefile_notes (char * (*func) (bfd *, int *))
+{
+  child_ops.to_make_corefile_notes = func;
 }
 
 void
@@ -656,5 +692,5 @@ _initialize_inftarg (void)
 #endif
 
   init_child_ops ();
-  add_target (&deprecated_child_ops);
+  add_target (&child_ops);
 }
index 4171651f6440252877b78fdeec7c9238641c9760..fcb4d028bd9d172a911716cbc86d4cab52c9d274 100644 (file)
@@ -2888,6 +2888,9 @@ ptrace_wait (ptid_t ptid, int *status)
       *status = _SIGTRAP;
     }
 
+  target_post_wait (pid_to_ptid (tsp.tts_pid), *status);
+
+
 #ifdef THREAD_DEBUG
   if (debug_on)
     printf ("Done waiting, pid is %d, tid %d\n", real_pid, real_tid);
@@ -3839,7 +3842,7 @@ kill_inferior (void)
 }
 
 
-#ifndef DEPRECATED_CHILD_RESUME
+#ifndef CHILD_RESUME
 
 /* Sanity check a thread about to be continued.
  */
@@ -4250,7 +4253,7 @@ threads_continue_one_with_signal (lwpid_t gdb_tid, int signal)
 }
 #endif
 
-#ifndef DEPRECATED_CHILD_RESUME
+#ifndef CHILD_RESUME
 
 /* Resume execution of the inferior process.
 
@@ -4551,7 +4554,7 @@ child_resume (ptid_t ptid, int step, enum target_signal signal)
 #endif
 
 }
-#endif /* DEPRECATED_CHILD_RESUME */
+#endif /* CHILD_RESUME */
 \f
 /*
  * Like it says.
@@ -4815,10 +4818,10 @@ _initialize_kernel_u_addr (void)
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.  TARGET is ignored.
 
-   Returns the length copied, which is either the LEN argument or
-   zero.  This xfer function does not do partial moves, since
-   deprecated_child_ops doesn't allow memory operations to cross below
-   us in the target stack anyway.  */
+   Returns the length copied, which is either the LEN argument or zero.
+   This xfer function does not do partial moves, since child_ops
+   doesn't allow memory operations to cross below us in the target stack
+   anyway.  */
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
index a3d1210445465bcbf7411dd0690ab06c7a62a573..41da7d0f3fdcf2470a52a66e5f2fb56f8090ee91 100644 (file)
@@ -446,22 +446,13 @@ FieldAccess:
 /*|    SUPER '.' SimpleName { FIXME } */
 ;
 
-FuncStart:
-       Name '('
-                { push_expression_name ($1); }
-;
-
 MethodInvocation:
-       FuncStart
-                { start_arglist(); }
-       ArgumentList_opt ')'
-                { write_exp_elt_opcode (OP_FUNCALL);
-                 write_exp_elt_longcst ((LONGEST) end_arglist ());
-                 write_exp_elt_opcode (OP_FUNCALL); }
+       Name '(' ArgumentList_opt ')'
+               { error (_("Method invocation not implemented")); }
 |      Primary '.' SimpleName '(' ArgumentList_opt ')'
-               { error (_("Form of method invocation not implemented")); }
+               { error (_("Method invocation not implemented")); }
 |      SUPER '.' SimpleName '(' ArgumentList_opt ')'
-               { error (_("Form of method invocation not implemented")); }
+               { error (_("Method invocation not implemented")); }
 ;
 
 ArrayAccess:
index cdf35ea6bb617904b07334002bf3b56242787084..d7050622a3aa10fd66df33443b419fe1f08533b3 100644 (file)
@@ -1286,7 +1286,7 @@ language_gdbarch_post_init (struct gdbarch *gdbarch)
   int i;
 
   l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch);
-  for (i = 0; i < languages_size; i++)
+  for (i = 0; i <= languages_size; i++)
     {
       if (languages[i] != NULL
          && languages[i]->la_language_arch_info != NULL)
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
new file mode 100644 (file)
index 0000000..5971630
--- /dev/null
@@ -0,0 +1,1971 @@
+/* Multi-threaded debugging support for GNU/Linux (LWP layer).
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+
+#include "gdb_assert.h"
+#include "gdb_string.h"
+#include <errno.h>
+#include <signal.h>
+#ifdef HAVE_TKILL_SYSCALL
+#include <unistd.h>
+#include <sys/syscall.h>
+#endif
+#include <sys/ptrace.h>
+#include "gdb_wait.h"
+
+#include "gdbthread.h"
+#include "inferior.h"
+#include "target.h"
+#include "regcache.h"
+#include "gdbcmd.h"
+
+static int debug_lin_lwp;
+extern char *strsignal (int sig);
+
+#include "linux-nat.h"
+
+/* On GNU/Linux there are no real LWP's.  The closest thing to LWP's
+   are processes sharing the same VM space.  A multi-threaded process
+   is basically a group of such processes.  However, such a grouping
+   is almost entirely a user-space issue; the kernel doesn't enforce
+   such a grouping at all (this might change in the future).  In
+   general, we'll rely on the threads library (i.e. the GNU/Linux
+   Threads library) to provide such a grouping.
+
+   It is perfectly well possible to write a multi-threaded application
+   without the assistance of a threads library, by using the clone
+   system call directly.  This module should be able to give some
+   rudimentary support for debugging such applications if developers
+   specify the CLONE_PTRACE flag in the clone system call, and are
+   using the Linux kernel 2.4 or above.
+
+   Note that there are some peculiarities in GNU/Linux that affect
+   this code:
+
+   - In general one should specify the __WCLONE flag to waitpid in
+     order to make it report events for any of the cloned processes
+     (and leave it out for the initial process).  However, if a cloned
+     process has exited the exit status is only reported if the
+     __WCLONE flag is absent.  Linux kernel 2.4 has a __WALL flag, but
+     we cannot use it since GDB must work on older systems too.
+
+   - When a traced, cloned process exits and is waited for by the
+     debugger, the kernel reassigns it to the original parent and
+     keeps it around as a "zombie".  Somehow, the GNU/Linux Threads
+     library doesn't notice this, which leads to the "zombie problem":
+     When debugged a multi-threaded process that spawns a lot of
+     threads will run out of processes, even if the threads exit,
+     because the "zombies" stay around.  */
+
+/* List of known LWPs.  */
+static struct lwp_info *lwp_list;
+
+/* Number of LWPs in the list.  */
+static int num_lwps;
+
+/* Non-zero if we're running in "threaded" mode.  */
+static int threaded;
+\f
+
+#define GET_LWP(ptid)          ptid_get_lwp (ptid)
+#define GET_PID(ptid)          ptid_get_pid (ptid)
+#define is_lwp(ptid)           (GET_LWP (ptid) != 0)
+#define BUILD_LWP(lwp, pid)    ptid_build (pid, lwp, 0)
+
+/* If the last reported event was a SIGTRAP, this variable is set to
+   the process id of the LWP/thread that got it.  */
+ptid_t trap_ptid;
+\f
+
+/* This module's target-specific operations.  */
+static struct target_ops lin_lwp_ops;
+
+/* The standard child operations.  */
+extern struct target_ops child_ops;
+
+/* Since we cannot wait (in lin_lwp_wait) for the initial process and
+   any cloned processes with a single call to waitpid, we have to use
+   the WNOHANG flag and call waitpid in a loop.  To optimize
+   things a bit we use `sigsuspend' to wake us up when a process has
+   something to report (it will send us a SIGCHLD if it has).  To make
+   this work we have to juggle with the signal mask.  We save the
+   original signal mask such that we can restore it before creating a
+   new process in order to avoid blocking certain signals in the
+   inferior.  We then block SIGCHLD during the waitpid/sigsuspend
+   loop.  */
+
+/* Original signal mask.  */
+static sigset_t normal_mask;
+
+/* Signal mask for use with sigsuspend in lin_lwp_wait, initialized in
+   _initialize_lin_lwp.  */
+static sigset_t suspend_mask;
+
+/* Signals to block to make that sigsuspend work.  */
+static sigset_t blocked_mask;
+\f
+
+/* Prototypes for local functions.  */
+static int stop_wait_callback (struct lwp_info *lp, void *data);
+static int lin_lwp_thread_alive (ptid_t ptid);
+\f
+/* Convert wait status STATUS to a string.  Used for printing debug
+   messages only.  */
+
+static char *
+status_to_str (int status)
+{
+  static char buf[64];
+
+  if (WIFSTOPPED (status))
+    snprintf (buf, sizeof (buf), "%s (stopped)",
+             strsignal (WSTOPSIG (status)));
+  else if (WIFSIGNALED (status))
+    snprintf (buf, sizeof (buf), "%s (terminated)",
+             strsignal (WSTOPSIG (status)));
+  else
+    snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status));
+
+  return buf;
+}
+\f
+/* Initialize the list of LWPs.  Note that this module, contrary to
+   what GDB's generic threads layer does for its thread list,
+   re-initializes the LWP lists whenever we mourn or detach (which
+   doesn't involve mourning) the inferior.  */
+
+static void
+init_lwp_list (void)
+{
+  struct lwp_info *lp, *lpnext;
+
+  for (lp = lwp_list; lp; lp = lpnext)
+    {
+      lpnext = lp->next;
+      xfree (lp);
+    }
+
+  lwp_list = NULL;
+  num_lwps = 0;
+  threaded = 0;
+}
+
+/* Add the LWP specified by PID to the list.  If this causes the
+   number of LWPs to become larger than one, go into "threaded" mode.
+   Return a pointer to the structure describing the new LWP.  */
+
+static struct lwp_info *
+add_lwp (ptid_t ptid)
+{
+  struct lwp_info *lp;
+
+  gdb_assert (is_lwp (ptid));
+
+  lp = (struct lwp_info *) xmalloc (sizeof (struct lwp_info));
+
+  memset (lp, 0, sizeof (struct lwp_info));
+
+  lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
+
+  lp->ptid = ptid;
+
+  lp->next = lwp_list;
+  lwp_list = lp;
+  if (++num_lwps > 1)
+    threaded = 1;
+
+  return lp;
+}
+
+/* Remove the LWP specified by PID from the list.  */
+
+static void
+delete_lwp (ptid_t ptid)
+{
+  struct lwp_info *lp, *lpprev;
+
+  lpprev = NULL;
+
+  for (lp = lwp_list; lp; lpprev = lp, lp = lp->next)
+    if (ptid_equal (lp->ptid, ptid))
+      break;
+
+  if (!lp)
+    return;
+
+  /* We don't go back to "non-threaded" mode if the number of threads
+     becomes less than two.  */
+  num_lwps--;
+
+  if (lpprev)
+    lpprev->next = lp->next;
+  else
+    lwp_list = lp->next;
+
+  xfree (lp);
+}
+
+/* Return a pointer to the structure describing the LWP corresponding
+   to PID.  If no corresponding LWP could be found, return NULL.  */
+
+static struct lwp_info *
+find_lwp_pid (ptid_t ptid)
+{
+  struct lwp_info *lp;
+  int lwp;
+
+  if (is_lwp (ptid))
+    lwp = GET_LWP (ptid);
+  else
+    lwp = GET_PID (ptid);
+
+  for (lp = lwp_list; lp; lp = lp->next)
+    if (lwp == GET_LWP (lp->ptid))
+      return lp;
+
+  return NULL;
+}
+
+/* Call CALLBACK with its second argument set to DATA for every LWP in
+   the list.  If CALLBACK returns 1 for a particular LWP, return a
+   pointer to the structure describing that LWP immediately.
+   Otherwise return NULL.  */
+
+struct lwp_info *
+iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data)
+{
+  struct lwp_info *lp, *lpnext;
+
+  for (lp = lwp_list; lp; lp = lpnext)
+    {
+      lpnext = lp->next;
+      if ((*callback) (lp, data))
+       return lp;
+    }
+
+  return NULL;
+}
+\f
+
+#if 0
+static void
+lin_lwp_open (char *args, int from_tty)
+{
+  push_target (&lin_lwp_ops);
+}
+#endif
+
+/* Attach to the LWP specified by PID.  If VERBOSE is non-zero, print
+   a message telling the user that a new LWP has been added to the
+   process.  */
+
+void
+lin_lwp_attach_lwp (ptid_t ptid, int verbose)
+{
+  struct lwp_info *lp, *found_lp;
+
+  gdb_assert (is_lwp (ptid));
+
+  /* Make sure SIGCHLD is blocked.  We don't want SIGCHLD events
+     to interrupt either the ptrace() or waitpid() calls below.  */
+  if (!sigismember (&blocked_mask, SIGCHLD))
+    {
+      sigaddset (&blocked_mask, SIGCHLD);
+      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+    }
+
+  if (verbose)
+    printf_filtered ("[New %s]\n", target_pid_to_str (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, 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;
+
+      if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
+       error ("Can't attach %s: %s", target_pid_to_str (ptid),
+              safe_strerror (errno));
+
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n",
+                           target_pid_to_str (ptid));
+
+      pid = waitpid (GET_LWP (ptid), &status, 0);
+      if (pid == -1 && errno == ECHILD)
+       {
+         /* Try again with __WCLONE to check cloned processes.  */
+         pid = waitpid (GET_LWP (ptid), &status, __WCLONE);
+         lp->cloned = 1;
+       }
+
+      gdb_assert (pid == GET_LWP (ptid)
+                 && WIFSTOPPED (status) && WSTOPSIG (status));
+
+      child_post_attach (pid);
+
+      lp->stopped = 1;
+
+      if (debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "LLAL: waitpid %s received %s\n",
+                             target_pid_to_str (ptid),
+                             status_to_str (status));
+       }
+    }
+  else
+    {
+      /* We assume that the LWP representing the original process
+         is already stopped.  Mark it as stopped in the data structure
+         that the lin-lwp layer uses to keep track of threads.  Note
+         that this won't have already been done since the main thread
+         will have, we assume, been stopped by an attach from a
+         different layer.  */
+      lp->stopped = 1;
+    }
+}
+
+static void
+lin_lwp_attach (char *args, int from_tty)
+{
+  struct lwp_info *lp;
+  pid_t pid;
+  int status;
+
+  /* FIXME: We should probably accept a list of process id's, and
+     attach all of them.  */
+  child_ops.to_attach (args, from_tty);
+
+  /* Add the initial process as the first LWP to the list.  */
+  lp = add_lwp (BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)));
+
+  /* Make sure the initial process is stopped.  The user-level threads
+     layer might want to poke around in the inferior, and that won't
+     work if things haven't stabilized yet.  */
+  pid = waitpid (GET_PID (inferior_ptid), &status, 0);
+  if (pid == -1 && errno == ECHILD)
+    {
+      warning ("%s is a cloned process", target_pid_to_str (inferior_ptid));
+
+      /* Try again with __WCLONE to check cloned processes.  */
+      pid = waitpid (GET_PID (inferior_ptid), &status, __WCLONE);
+      lp->cloned = 1;
+    }
+
+  gdb_assert (pid == GET_PID (inferior_ptid)
+             && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP);
+
+  lp->stopped = 1;
+
+  /* Fake the SIGSTOP that core GDB expects.  */
+  lp->status = W_STOPCODE (SIGSTOP);
+  lp->resumed = 1;
+  if (debug_lin_lwp)
+    {
+      fprintf_unfiltered (gdb_stdlog,
+                         "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid);
+    }
+}
+
+static int
+detach_callback (struct lwp_info *lp, void *data)
+{
+  gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
+
+  if (debug_lin_lwp && lp->status)
+    fprintf_unfiltered (gdb_stdlog, "DC:  Pending %s for %s on detach.\n",
+                       strsignal (WSTOPSIG (lp->status)),
+                       target_pid_to_str (lp->ptid));
+
+  while (lp->signalled && lp->stopped)
+    {
+      errno = 0;
+      if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
+                 WSTOPSIG (lp->status)) < 0)
+       error ("Can't continue %s: %s", target_pid_to_str (lp->ptid),
+              safe_strerror (errno));
+
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "DC:  PTRACE_CONTINUE (%s, 0, %s) (OK)\n",
+                           target_pid_to_str (lp->ptid),
+                           status_to_str (lp->status));
+
+      lp->stopped = 0;
+      lp->signalled = 0;
+      lp->status = 0;
+      /* FIXME drow/2003-08-26: There was a call to stop_wait_callback
+        here.  But since lp->signalled was cleared above,
+        stop_wait_callback didn't do anything; the process was left
+        running.  Shouldn't we be waiting for it to stop?
+        I've removed the call, since stop_wait_callback now does do
+        something when called with lp->signalled == 0.  */
+
+      gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
+    }
+
+  /* We don't actually detach from the LWP that has an id equal to the
+     overall process id just yet.  */
+  if (GET_LWP (lp->ptid) != GET_PID (lp->ptid))
+    {
+      errno = 0;
+      if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0,
+                 WSTOPSIG (lp->status)) < 0)
+       error ("Can't detach %s: %s", target_pid_to_str (lp->ptid),
+              safe_strerror (errno));
+
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "PTRACE_DETACH (%s, %s, 0) (OK)\n",
+                           target_pid_to_str (lp->ptid),
+                           strsignal (WSTOPSIG (lp->status)));
+
+      delete_lwp (lp->ptid);
+    }
+
+  return 0;
+}
+
+static void
+lin_lwp_detach (char *args, int from_tty)
+{
+  iterate_over_lwps (detach_callback, NULL);
+
+  /* Only the initial process should be left right now.  */
+  gdb_assert (num_lwps == 1);
+
+  trap_ptid = null_ptid;
+
+  /* Destroy LWP info; it's no longer valid.  */
+  init_lwp_list ();
+
+  /* Restore the original signal mask.  */
+  sigprocmask (SIG_SETMASK, &normal_mask, NULL);
+  sigemptyset (&blocked_mask);
+
+  inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
+  child_ops.to_detach (args, from_tty);
+}
+\f
+
+/* Resume LP.  */
+
+static int
+resume_callback (struct lwp_info *lp, void *data)
+{
+  if (lp->stopped && lp->status == 0)
+    {
+      struct thread_info *tp;
+
+      child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0);
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "RC:  PTRACE_CONT %s, 0, 0 (resume sibling)\n",
+                           target_pid_to_str (lp->ptid));
+      lp->stopped = 0;
+      lp->step = 0;
+    }
+
+  return 0;
+}
+
+static int
+resume_clear_callback (struct lwp_info *lp, void *data)
+{
+  lp->resumed = 0;
+  return 0;
+}
+
+static int
+resume_set_callback (struct lwp_info *lp, void *data)
+{
+  lp->resumed = 1;
+  return 0;
+}
+
+static void
+lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo)
+{
+  struct lwp_info *lp;
+  int resume_all;
+
+  /* A specific PTID means `step only this process id'.  */
+  resume_all = (PIDGET (ptid) == -1);
+
+  if (resume_all)
+    iterate_over_lwps (resume_set_callback, NULL);
+  else
+    iterate_over_lwps (resume_clear_callback, NULL);
+
+  /* If PID is -1, it's the current inferior that should be
+     handled specially.  */
+  if (PIDGET (ptid) == -1)
+    ptid = inferior_ptid;
+
+  lp = find_lwp_pid (ptid);
+  if (lp)
+    {
+      ptid = pid_to_ptid (GET_LWP (lp->ptid));
+
+      /* Remember if we're stepping.  */
+      lp->step = step;
+
+      /* Mark this LWP as resumed.  */
+      lp->resumed = 1;
+
+      /* If we have a pending wait status for this thread, there is no
+         point in resuming the process.  */
+      if (lp->status)
+       {
+         /* FIXME: What should we do if we are supposed to continue
+            this thread with a signal?  */
+         gdb_assert (signo == TARGET_SIGNAL_0);
+         return;
+       }
+
+      /* Mark LWP as not stopped to prevent it from being continued by
+         resume_callback.  */
+      lp->stopped = 0;
+    }
+
+  if (resume_all)
+    iterate_over_lwps (resume_callback, NULL);
+
+  child_resume (ptid, step, signo);
+  if (debug_lin_lwp)
+    fprintf_unfiltered (gdb_stdlog,
+                       "LLR: %s %s, %s (resume event thread)\n",
+                       step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+                       target_pid_to_str (ptid),
+                       signo ? strsignal (signo) : "0");
+}
+\f
+
+/* Issue kill to specified lwp.  */
+
+static int tkill_failed;
+
+static int
+kill_lwp (int lwpid, int signo)
+{
+  errno = 0;
+
+/* Use tkill, if possible, in case we are using nptl threads.  If tkill
+   fails, then we are not using nptl threads and we should be using kill.  */
+
+#ifdef HAVE_TKILL_SYSCALL
+  if (!tkill_failed)
+    {
+      int ret = syscall (__NR_tkill, lwpid, signo);
+      if (errno != ENOSYS)
+       return ret;
+      errno = 0;
+      tkill_failed = 1;
+    }
+#endif
+
+  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.  */
+
+static int
+wait_lwp (struct lwp_info *lp)
+{
+  pid_t pid;
+  int status;
+  int thread_dead = 0;
+
+  gdb_assert (!lp->stopped);
+  gdb_assert (lp->status == 0);
+
+  pid = waitpid (GET_LWP (lp->ptid), &status, 0);
+  if (pid == -1 && errno == ECHILD)
+    {
+      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, 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",
+                               target_pid_to_str (lp->ptid));
+       }
+    }
+
+  if (!thread_dead)
+    {
+      gdb_assert (pid == GET_LWP (lp->ptid));
+
+      if (debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "WL: waitpid %s received %s\n",
+                             target_pid_to_str (lp->ptid),
+                             status_to_str (status));
+       }
+    }
+
+  /* Check if the thread has exited.  */
+  if (WIFEXITED (status) || WIFSIGNALED (status))
+    {
+      thread_dead = 1;
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n",
+                           target_pid_to_str (lp->ptid));
+    }
+
+  if (thread_dead)
+    {
+      if (in_thread_list (lp->ptid))
+       {
+         /* Core GDB cannot deal with us deleting the current thread.  */
+         if (!ptid_equal (lp->ptid, inferior_ptid))
+           delete_thread (lp->ptid);
+         printf_unfiltered ("[%s exited]\n",
+                            target_pid_to_str (lp->ptid));
+       }
+
+      delete_lwp (lp->ptid);
+      return 0;
+    }
+
+  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;
+}
+
+/* Send a SIGSTOP to LP.  */
+
+static int
+stop_callback (struct lwp_info *lp, void *data)
+{
+  if (!lp->stopped && !lp->signalled)
+    {
+      int ret;
+
+      if (debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "SC:  kill %s **<SIGSTOP>**\n",
+                             target_pid_to_str (lp->ptid));
+       }
+      errno = 0;
+      ret = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
+      if (debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "SC:  lwp kill %d %s\n",
+                             ret,
+                             errno ? safe_strerror (errno) : "ERRNO-OK");
+       }
+
+      lp->signalled = 1;
+      gdb_assert (lp->status == 0);
+    }
+
+  return 0;
+}
+
+/* Wait until LP is stopped.  If DATA is non-null it is interpreted as
+   a pointer to a set of signals to be flushed immediately.  */
+
+static int
+stop_wait_callback (struct lwp_info *lp, void *data)
+{
+  sigset_t *flush_mask = data;
+
+  if (!lp->stopped)
+    {
+      int status;
+
+      status = wait_lwp (lp);
+      if (status == 0)
+       return 0;
+
+      /* Ignore any signals in FLUSH_MASK.  */
+      if (flush_mask && sigismember (flush_mask, WSTOPSIG (status)))
+       {
+         if (!lp->signalled)
+           {
+             lp->stopped = 1;
+             return 0;
+           }
+
+         errno = 0;
+         ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+         if (debug_lin_lwp)
+           fprintf_unfiltered (gdb_stdlog,
+                               "PTRACE_CONT %s, 0, 0 (%s)\n",
+                               target_pid_to_str (lp->ptid),
+                               errno ? safe_strerror (errno) : "OK");
+
+         return stop_wait_callback (lp, flush_mask);
+       }
+
+      if (WSTOPSIG (status) != SIGSTOP)
+       {
+         if (WSTOPSIG (status) == SIGTRAP)
+           {
+             /* If a LWP other than the LWP that we're reporting an
+                event for has hit a GDB breakpoint (as opposed to
+                some random trap signal), then just arrange for it to
+                hit it again later.  We don't keep the SIGTRAP status
+                and don't forward the SIGTRAP signal to the LWP.  We
+                will handle the current event, eventually we will
+                resume all LWPs, and this one will get its breakpoint
+                trap again.
+
+                If we do not do this, then we run the risk that the
+                user will delete or disable the breakpoint, but the
+                thread will have already tripped on it.  */
+
+             /* Now resume this LWP and get the SIGSTOP event. */
+             errno = 0;
+             ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+             if (debug_lin_lwp)
+               {
+                 fprintf_unfiltered (gdb_stdlog,
+                                     "PTRACE_CONT %s, 0, 0 (%s)\n",
+                                     target_pid_to_str (lp->ptid),
+                                     errno ? safe_strerror (errno) : "OK");
+
+                 fprintf_unfiltered (gdb_stdlog,
+                                     "SWC: Candidate SIGTRAP event in %s\n",
+                                     target_pid_to_str (lp->ptid));
+               }
+             /* Hold the SIGTRAP for handling by lin_lwp_wait. */
+             stop_wait_callback (lp, data);
+             /* If there's another event, throw it back into the queue. */
+             if (lp->status)
+               {
+                 if (debug_lin_lwp)
+                   {
+                     fprintf_unfiltered (gdb_stdlog,
+                                         "SWC: kill %s, %s\n",
+                                         target_pid_to_str (lp->ptid),
+                                         status_to_str ((int) status));
+                   }
+                 kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
+               }
+             /* Save the sigtrap event. */
+             lp->status = status;
+             return 0;
+           }
+         else
+           {
+             /* The thread was stopped with a signal other than
+                SIGSTOP, and didn't accidentally trip a breakpoint. */
+
+             if (debug_lin_lwp)
+               {
+                 fprintf_unfiltered (gdb_stdlog,
+                                     "SWC: Pending event %s in %s\n",
+                                     status_to_str ((int) status),
+                                     target_pid_to_str (lp->ptid));
+               }
+             /* Now resume this LWP and get the SIGSTOP event. */
+             errno = 0;
+             ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+             if (debug_lin_lwp)
+               fprintf_unfiltered (gdb_stdlog,
+                                   "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
+                                   target_pid_to_str (lp->ptid),
+                                   errno ? safe_strerror (errno) : "OK");
+
+             /* Hold this event/waitstatus while we check to see if
+                there are any more (we still want to get that SIGSTOP). */
+             stop_wait_callback (lp, data);
+             /* If the lp->status field is still empty, use it to hold
+                this event.  If not, then this event must be returned
+                to the event queue of the LWP.  */
+             if (lp->status == 0)
+               lp->status = status;
+             else
+               {
+                 if (debug_lin_lwp)
+                   {
+                     fprintf_unfiltered (gdb_stdlog,
+                                         "SWC: kill %s, %s\n",
+                                         target_pid_to_str (lp->ptid),
+                                         status_to_str ((int) status));
+                   }
+                 kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
+               }
+             return 0;
+           }
+       }
+      else
+       {
+         /* We caught the SIGSTOP that we intended to catch, so
+            there's no SIGSTOP pending.  */
+         lp->stopped = 1;
+         lp->signalled = 0;
+       }
+    }
+
+  return 0;
+}
+
+/* Check whether PID has any pending signals in FLUSH_MASK.  If so set
+   the appropriate bits in PENDING, and return 1 - otherwise return 0.  */
+
+static int
+lin_lwp_has_pending (int pid, sigset_t *pending, sigset_t *flush_mask)
+{
+  sigset_t blocked, ignored;
+  int i;
+
+  linux_proc_pending_signals (pid, pending, &blocked, &ignored);
+
+  if (!flush_mask)
+    return 0;
+
+  for (i = 1; i < NSIG; i++)
+    if (sigismember (pending, i))
+      if (!sigismember (flush_mask, i)
+         || sigismember (&blocked, i)
+         || sigismember (&ignored, i))
+       sigdelset (pending, i);
+
+  if (sigisemptyset (pending))
+    return 0;
+
+  return 1;
+}
+
+/* DATA is interpreted as a mask of signals to flush.  If LP has
+   signals pending, and they are all in the flush mask, then arrange
+   to flush them.  LP should be stopped, as should all other threads
+   it might share a signal queue with.  */
+
+static int
+flush_callback (struct lwp_info *lp, void *data)
+{
+  sigset_t *flush_mask = data;
+  sigset_t pending, intersection, blocked, ignored;
+  int pid, status;
+
+  /* Normally, when an LWP exits, it is removed from the LWP list.  The
+     last LWP isn't removed till later, however.  So if there is only
+     one LWP on the list, make sure it's alive.  */
+  if (lwp_list == lp && lp->next == NULL)
+    if (!lin_lwp_thread_alive (lp->ptid))
+      return 0;
+
+  /* Just because the LWP is stopped doesn't mean that new signals
+     can't arrive from outside, so this function must be careful of
+     race conditions.  However, because all threads are stopped, we
+     can assume that the pending mask will not shrink unless we resume
+     the LWP, and that it will then get another signal.  We can't
+     control which one, however.  */
+
+  if (lp->status)
+    {
+      if (debug_lin_lwp)
+       printf_unfiltered ("FC: LP has pending status %06x\n", lp->status);
+      if (WIFSTOPPED (lp->status) && sigismember (flush_mask, WSTOPSIG (lp->status)))
+       lp->status = 0;
+    }
+
+  while (lin_lwp_has_pending (GET_LWP (lp->ptid), &pending, flush_mask))
+    {
+      int ret;
+      
+      errno = 0;
+      ret = ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stderr,
+                           "FC: Sent PTRACE_CONT, ret %d %d\n", ret, errno);
+
+      lp->stopped = 0;
+      stop_wait_callback (lp, flush_mask);
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stderr,
+                           "FC: Wait finished; saved status is %d\n",
+                           lp->status);
+    }
+
+  return 0;
+}
+
+/* Return non-zero if LP has a wait status pending.  */
+
+static int
+status_callback (struct lwp_info *lp, void *data)
+{
+  /* Only report a pending wait status if we pretend that this has
+     indeed been resumed.  */
+  return (lp->status != 0 && lp->resumed);
+}
+
+/* Return non-zero if LP isn't stopped.  */
+
+static int
+running_callback (struct lwp_info *lp, void *data)
+{
+  return (lp->stopped == 0 || (lp->status != 0 && lp->resumed));
+}
+
+/* Count the LWP's that have had events.  */
+
+static int
+count_events_callback (struct lwp_info *lp, void *data)
+{
+  int *count = data;
+
+  gdb_assert (count != NULL);
+
+  /* Count only LWPs that have a SIGTRAP event pending.  */
+  if (lp->status != 0
+      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
+    (*count)++;
+
+  return 0;
+}
+
+/* Select the LWP (if any) that is currently being single-stepped.  */
+
+static int
+select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
+{
+  if (lp->step && lp->status != 0)
+    return 1;
+  else
+    return 0;
+}
+
+/* Select the Nth LWP that has had a SIGTRAP event.  */
+
+static int
+select_event_lwp_callback (struct lwp_info *lp, void *data)
+{
+  int *selector = data;
+
+  gdb_assert (selector != NULL);
+
+  /* Select only LWPs that have a SIGTRAP event pending. */
+  if (lp->status != 0
+      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
+    if ((*selector)-- == 0)
+      return 1;
+
+  return 0;
+}
+
+static int
+cancel_breakpoints_callback (struct lwp_info *lp, void *data)
+{
+  struct lwp_info *event_lp = data;
+
+  /* Leave the LWP that has been elected to receive a SIGTRAP alone.  */
+  if (lp == event_lp)
+    return 0;
+
+  /* If a LWP other than the LWP that we're reporting an event for has
+     hit a GDB breakpoint (as opposed to some random trap signal),
+     then just arrange for it to hit it again later.  We don't keep
+     the SIGTRAP status and don't forward the SIGTRAP signal to the
+     LWP.  We will handle the current event, eventually we will resume
+     all LWPs, and this one will get its breakpoint trap again.
+
+     If we do not do this, then we run the risk that the user will
+     delete or disable the breakpoint, but the LWP will have already
+     tripped on it.  */
+
+  if (lp->status != 0
+      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP
+      && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) -
+                                    DECR_PC_AFTER_BREAK))
+    {
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "CBC: Push back breakpoint for %s\n",
+                           target_pid_to_str (lp->ptid));
+
+      /* Back up the PC if necessary.  */
+      if (DECR_PC_AFTER_BREAK)
+       write_pc_pid (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK, lp->ptid);
+
+      /* Throw away the SIGTRAP.  */
+      lp->status = 0;
+    }
+
+  return 0;
+}
+
+/* Select one LWP out of those that have events pending.  */
+
+static void
+select_event_lwp (struct lwp_info **orig_lp, int *status)
+{
+  int num_events = 0;
+  int random_selector;
+  struct lwp_info *event_lp;
+
+  /* Record the wait status for the origional LWP.  */
+  (*orig_lp)->status = *status;
+
+  /* Give preference to any LWP that is being single-stepped.  */
+  event_lp = iterate_over_lwps (select_singlestep_lwp_callback, NULL);
+  if (event_lp != NULL)
+    {
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "SEL: Select single-step %s\n",
+                           target_pid_to_str (event_lp->ptid));
+    }
+  else
+    {
+      /* No single-stepping LWP.  Select one at random, out of those
+         which have had SIGTRAP events.  */
+
+      /* First see how many SIGTRAP events we have.  */
+      iterate_over_lwps (count_events_callback, &num_events);
+
+      /* Now randomly pick a LWP out of those that have had a SIGTRAP.  */
+      random_selector = (int)
+       ((num_events * (double) rand ()) / (RAND_MAX + 1.0));
+
+      if (debug_lin_lwp && num_events > 1)
+       fprintf_unfiltered (gdb_stdlog,
+                           "SEL: Found %d SIGTRAP events, selecting #%d\n",
+                           num_events, random_selector);
+
+      event_lp = iterate_over_lwps (select_event_lwp_callback,
+                                   &random_selector);
+    }
+
+  if (event_lp != NULL)
+    {
+      /* Switch the event LWP.  */
+      *orig_lp = event_lp;
+      *status = event_lp->status;
+    }
+
+  /* Flush the wait status for the event LWP.  */
+  (*orig_lp)->status = 0;
+}
+
+/* Return non-zero if LP has been resumed.  */
+
+static int
+resumed_callback (struct lwp_info *lp, void *data)
+{
+  return lp->resumed;
+}
+
+#ifdef CHILD_WAIT
+
+/* We need to override child_wait to support attaching to cloned
+   processes, since a normal wait (as done by the default version)
+   ignores those processes.  */
+
+/* Wait for child PTID to do something.  Return id of the child,
+   minus_one_ptid in case of error; store status into *OURSTATUS.  */
+
+ptid_t
+child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+{
+  int save_errno;
+  int status;
+  pid_t pid;
+
+  ourstatus->kind = TARGET_WAITKIND_IGNORE;
+
+  do
+    {
+      set_sigint_trap ();      /* Causes SIGINT to be passed on to the
+                                  attached process.  */
+      set_sigio_trap ();
+
+      pid = waitpid (GET_PID (ptid), &status, 0);
+      if (pid == -1 && errno == ECHILD)
+       /* Try again with __WCLONE to check cloned processes.  */
+       pid = waitpid (GET_PID (ptid), &status, __WCLONE);
+
+      if (debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "CW:  waitpid %ld received %s\n",
+                             (long) pid, status_to_str (status));
+       }
+
+      save_errno = errno;
+
+      /* Make sure we don't report an event for the exit of the
+         original program, if we've detached from it.  */
+      if (pid != -1 && !WIFSTOPPED (status) && pid != GET_PID (inferior_ptid))
+       {
+         pid = -1;
+         save_errno = EINTR;
+       }
+
+      /* Check for stop events reported by a process we didn't already
+        know about - in this case, anything other than inferior_ptid.
+
+        If we're expecting to receive stopped processes after fork,
+        vfork, and clone events, then we'll just add the new one to
+        our list and go back to waiting for the event to be reported
+        - the stopped process might be returned from waitpid before
+        or after the event is.  If we want to handle debugging of
+        CLONE_PTRACE processes we need to do more here, i.e. switch
+        to multi-threaded mode.  */
+      if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP
+         && pid != GET_PID (inferior_ptid))
+       {
+         linux_record_stopped_pid (pid);
+         pid = -1;
+         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;
+             ptrace (PTRACE_CONT, pid, 0, 0);
+             pid = -1;
+             save_errno = EINTR;
+           }
+       }
+
+      clear_sigio_trap ();
+      clear_sigint_trap ();
+    }
+  while (pid == -1 && save_errno == EINTR);
+
+  if (pid == -1)
+    {
+      warning ("Child process unexpectedly missing: %s",
+              safe_strerror (errno));
+
+      /* Claim it exited with unknown signal.  */
+      ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+      ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+      return minus_one_ptid;
+    }
+
+  if (ourstatus->kind == TARGET_WAITKIND_IGNORE)
+    store_waitstatus (ourstatus, status);
+
+  return pid_to_ptid (pid);
+}
+
+#endif
+
+/* Stop an active thread, verify it still exists, then resume it.  */
+
+static int
+stop_and_resume_callback (struct lwp_info *lp, void *data)
+{
+  struct lwp_info *ptr;
+
+  if (!lp->stopped && !lp->signalled)
+    {
+      stop_callback (lp, NULL);
+      stop_wait_callback (lp, NULL);
+      /* Resume if the lwp still exists.  */
+      for (ptr = lwp_list; ptr; ptr = ptr->next)
+       if (lp == ptr)
+         {
+           resume_callback (lp, NULL);
+           resume_set_callback (lp, NULL);
+         }
+    }
+  return 0;
+}
+
+static ptid_t
+lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+{
+  struct lwp_info *lp = NULL;
+  int options = 0;
+  int status = 0;
+  pid_t pid = PIDGET (ptid);
+  sigset_t flush_mask;
+
+  sigemptyset (&flush_mask);
+
+  /* Make sure SIGCHLD is blocked.  */
+  if (!sigismember (&blocked_mask, SIGCHLD))
+    {
+      sigaddset (&blocked_mask, SIGCHLD);
+      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+    }
+
+retry:
+
+  /* Make sure there is at least one LWP that has been resumed, at
+     least if there are any LWPs at all.  */
+  gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
+
+  /* First check if there is a LWP with a wait status pending.  */
+  if (pid == -1)
+    {
+      /* Any LWP that's been resumed will do.  */
+      lp = iterate_over_lwps (status_callback, NULL);
+      if (lp)
+       {
+         status = lp->status;
+         lp->status = 0;
+
+         if (debug_lin_lwp && status)
+           fprintf_unfiltered (gdb_stdlog,
+                               "LLW: Using pending wait status %s for %s.\n",
+                               status_to_str (status),
+                               target_pid_to_str (lp->ptid));
+       }
+
+      /* But if we don't fine one, we'll have to wait, and check both
+         cloned and uncloned processes.  We start with the cloned
+         processes.  */
+      options = __WCLONE | WNOHANG;
+    }
+  else if (is_lwp (ptid))
+    {
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LLW: Waiting for specific LWP %s.\n",
+                           target_pid_to_str (ptid));
+
+      /* We have a specific LWP to check.  */
+      lp = find_lwp_pid (ptid);
+      gdb_assert (lp);
+      status = lp->status;
+      lp->status = 0;
+
+      if (debug_lin_lwp && status)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LLW: Using pending wait status %s for %s.\n",
+                           status_to_str (status),
+                           target_pid_to_str (lp->ptid));
+
+      /* If we have to wait, take into account whether PID is a cloned
+         process or not.  And we have to convert it to something that
+         the layer beneath us can understand.  */
+      options = lp->cloned ? __WCLONE : 0;
+      pid = GET_LWP (ptid);
+    }
+
+  if (status && lp->signalled)
+    {
+      /* A pending SIGSTOP may interfere with the normal stream of
+         events.  In a typical case where interference is a problem,
+         we have a SIGSTOP signal pending for LWP A while
+         single-stepping it, encounter an event in LWP B, and take the
+         pending SIGSTOP while trying to stop LWP A.  After processing
+         the event in LWP B, LWP A is continued, and we'll never see
+         the SIGTRAP associated with the last time we were
+         single-stepping LWP A.  */
+
+      /* Resume the thread.  It should halt immediately returning the
+         pending SIGSTOP.  */
+      registers_changed ();
+      child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
+                   TARGET_SIGNAL_0);
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LLW: %s %s, 0, 0 (expect SIGSTOP)\n",
+                           lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+                           target_pid_to_str (lp->ptid));
+      lp->stopped = 0;
+      gdb_assert (lp->resumed);
+
+      /* This should catch the pending SIGSTOP.  */
+      stop_wait_callback (lp, NULL);
+    }
+
+  set_sigint_trap ();          /* Causes SIGINT to be passed on to the
+                                  attached process. */
+  set_sigio_trap ();
+
+  while (status == 0)
+    {
+      pid_t lwpid;
+
+      lwpid = waitpid (pid, &status, options);
+      if (lwpid > 0)
+       {
+         gdb_assert (pid == -1 || lwpid == pid);
+
+         if (debug_lin_lwp)
+           {
+             fprintf_unfiltered (gdb_stdlog,
+                                 "LLW: waitpid %ld received %s\n",
+                                 (long) lwpid, status_to_str (status));
+           }
+
+         lp = find_lwp_pid (pid_to_ptid (lwpid));
+
+         /* Check for stop events reported by a process we didn't
+            already know about - anything not already in our LWP
+            list.
+
+            If we're expecting to receive stopped processes after
+            fork, vfork, and clone events, then we'll just add the
+            new one to our list and go back to waiting for the event
+            to be reported - the stopped process might be returned
+            from waitpid before or after the event is.  */
+         if (WIFSTOPPED (status) && !lp)
+           {
+             linux_record_stopped_pid (lwpid);
+             status = 0;
+             continue;
+           }
+
+         /* Make sure we don't report an event for the exit of an LWP not in
+            our list, i.e.  not part of the current process.  This can happen
+            if we detach from a program we original forked and then it
+            exits.  */
+         if (!WIFSTOPPED (status) && !lp)
+           {
+             status = 0;
+             continue;
+           }
+
+         /* NOTE drow/2003-06-17: This code seems to be meant for debugging
+            CLONE_PTRACE processes which do not use the thread library -
+            otherwise we wouldn't find the new LWP this way.  That doesn't
+            currently work, and the following code is currently unreachable
+            due to the two blocks above.  If it's fixed some day, this code
+            should be broken out into a function so that we can also pick up
+            LWPs from the new interface.  */
+         if (!lp)
+           {
+             lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid)));
+             if (options & __WCLONE)
+               lp->cloned = 1;
+
+             if (threaded)
+               {
+                 gdb_assert (WIFSTOPPED (status)
+                             && WSTOPSIG (status) == SIGSTOP);
+                 lp->signalled = 1;
+
+                 if (!in_thread_list (inferior_ptid))
+                   {
+                     inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid),
+                                                GET_PID (inferior_ptid));
+                     add_thread (inferior_ptid);
+                   }
+
+                 add_thread (lp->ptid);
+                 printf_unfiltered ("[New %s]\n",
+                                    target_pid_to_str (lp->ptid));
+               }
+           }
+
+         /* 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)
+           {
+             if (in_thread_list (lp->ptid))
+               {
+                 /* Core GDB cannot deal with us deleting the current
+                    thread.  */
+                 if (!ptid_equal (lp->ptid, inferior_ptid))
+                   delete_thread (lp->ptid);
+                 printf_unfiltered ("[%s exited]\n",
+                                    target_pid_to_str (lp->ptid));
+               }
+
+             /* If this is the main thread, we must stop all threads and
+                verify if they are still alive.  This is because in the nptl
+                thread model, there is no signal issued for exiting LWPs
+                other than the main thread.  We only get the main thread
+                exit signal once all child threads have already exited.
+                If we stop all the threads and use the stop_wait_callback
+                to check if they have exited we can determine whether this
+                signal should be ignored or whether it means the end of the
+                debugged application, regardless of which threading model
+                is being used.  */
+             if (GET_PID (lp->ptid) == GET_LWP (lp->ptid))
+               {
+                 lp->stopped = 1;
+                 iterate_over_lwps (stop_and_resume_callback, NULL);
+               }
+
+             if (debug_lin_lwp)
+               fprintf_unfiltered (gdb_stdlog,
+                                   "LLW: %s exited.\n",
+                                   target_pid_to_str (lp->ptid));
+
+             delete_lwp (lp->ptid);
+
+             /* If there is at least one more LWP, then the exit signal
+                was not the end of the debugged application and should be
+                ignored.  */
+             if (num_lwps > 0)
+               {
+                 /* Make sure there is at least one thread running.  */
+                 gdb_assert (iterate_over_lwps (running_callback, NULL));
+
+                 /* Discard the event.  */
+                 status = 0;
+                 continue;
+               }
+           }
+
+         /* Check if the current LWP has previously exited.  In the nptl
+            thread model, LWPs other than the main thread do not issue
+            signals when they exit so we must check whenever the thread
+            has stopped.  A similar check is made in stop_wait_callback().  */
+         if (num_lwps > 1 && !lin_lwp_thread_alive (lp->ptid))
+           {
+             if (in_thread_list (lp->ptid))
+               {
+                 /* Core GDB cannot deal with us deleting the current
+                    thread.  */
+                 if (!ptid_equal (lp->ptid, inferior_ptid))
+                   delete_thread (lp->ptid);
+                 printf_unfiltered ("[%s exited]\n",
+                                    target_pid_to_str (lp->ptid));
+               }
+             if (debug_lin_lwp)
+               fprintf_unfiltered (gdb_stdlog,
+                                   "LLW: %s exited.\n",
+                                   target_pid_to_str (lp->ptid));
+
+             delete_lwp (lp->ptid);
+
+             /* Make sure there is at least one thread running.  */
+             gdb_assert (iterate_over_lwps (running_callback, NULL));
+
+             /* Discard the event.  */
+             status = 0;
+             continue;
+           }
+
+         /* Make sure we don't report a SIGSTOP that we sent
+            ourselves in an attempt to stop an LWP.  */
+         if (lp->signalled
+             && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP)
+           {
+             if (debug_lin_lwp)
+               fprintf_unfiltered (gdb_stdlog,
+                                   "LLW: Delayed SIGSTOP caught for %s.\n",
+                                   target_pid_to_str (lp->ptid));
+
+             /* This is a delayed SIGSTOP.  */
+             lp->signalled = 0;
+
+             registers_changed ();
+             child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
+                           TARGET_SIGNAL_0);
+             if (debug_lin_lwp)
+               fprintf_unfiltered (gdb_stdlog,
+                                   "LLW: %s %s, 0, 0 (discard SIGSTOP)\n",
+                                   lp->step ?
+                                   "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+                                   target_pid_to_str (lp->ptid));
+
+             lp->stopped = 0;
+             gdb_assert (lp->resumed);
+
+             /* Discard the event.  */
+             status = 0;
+             continue;
+           }
+
+         break;
+       }
+
+      if (pid == -1)
+       {
+         /* Alternate between checking cloned and uncloned processes.  */
+         options ^= __WCLONE;
+
+         /* And suspend every time we have checked both.  */
+         if (options & __WCLONE)
+           sigsuspend (&suspend_mask);
+       }
+
+      /* We shouldn't end up here unless we want to try again.  */
+      gdb_assert (status == 0);
+    }
+
+  clear_sigio_trap ();
+  clear_sigint_trap ();
+
+  gdb_assert (lp);
+
+  /* Don't report signals that GDB isn't interested in, such as
+     signals that are neither printed nor stopped upon.  Stopping all
+     threads can be a bit time-consuming so if we want decent
+     performance with heavily multi-threaded programs, especially when
+     they're using a high frequency timer, we'd better avoid it if we
+     can.  */
+
+  if (WIFSTOPPED (status))
+    {
+      int signo = target_signal_from_host (WSTOPSIG (status));
+
+      if (signal_stop_state (signo) == 0
+         && signal_print_state (signo) == 0
+         && signal_pass_state (signo) == 1)
+       {
+         /* FIMXE: kettenis/2001-06-06: Should we resume all threads
+            here?  It is not clear we should.  GDB may not expect
+            other threads to run.  On the other hand, not resuming
+            newly attached threads may cause an unwanted delay in
+            getting them running.  */
+         registers_changed ();
+         child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo);
+         if (debug_lin_lwp)
+           fprintf_unfiltered (gdb_stdlog,
+                               "LLW: %s %s, %s (preempt 'handle')\n",
+                               lp->step ?
+                               "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+                               target_pid_to_str (lp->ptid),
+                               signo ? strsignal (signo) : "0");
+         lp->stopped = 0;
+         status = 0;
+         goto retry;
+       }
+
+      if (signo == TARGET_SIGNAL_INT && signal_pass_state (signo) == 0)
+       {
+         /* If ^C/BREAK is typed at the tty/console, SIGINT gets
+            forwarded to the entire process group, that is, all LWP's
+            will receive it.  Since we only want to report it once,
+            we try to flush it from all LWPs except this one.  */
+         sigaddset (&flush_mask, SIGINT);
+       }
+    }
+
+  /* This LWP is stopped now.  */
+  lp->stopped = 1;
+
+  if (debug_lin_lwp)
+    fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n",
+                       status_to_str (status), target_pid_to_str (lp->ptid));
+
+  /* Now stop all other LWP's ...  */
+  iterate_over_lwps (stop_callback, NULL);
+
+  /* ... and wait until all of them have reported back that they're no
+     longer running.  */
+  iterate_over_lwps (stop_wait_callback, &flush_mask);
+  iterate_over_lwps (flush_callback, &flush_mask);
+
+  /* If we're not waiting for a specific LWP, choose an event LWP from
+     among those that have had events.  Giving equal priority to all
+     LWPs that have had events helps prevent starvation.  */
+  if (pid == -1)
+    select_event_lwp (&lp, &status);
+
+  /* Now that we've selected our final event LWP, cancel any
+     breakpoints in other LWPs that have hit a GDB breakpoint.  See
+     the comment in cancel_breakpoints_callback to find out why.  */
+  iterate_over_lwps (cancel_breakpoints_callback, lp);
+
+  /* If we're not running in "threaded" mode, we'll report the bare
+     process id.  */
+
+  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP)
+    {
+      trap_ptid = (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
+      if (debug_lin_lwp)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LLW: trap_ptid is %s.\n",
+                           target_pid_to_str (trap_ptid));
+    }
+  else
+    trap_ptid = null_ptid;
+
+  if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE)
+    {
+      *ourstatus = lp->waitstatus;
+      lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
+    }
+  else
+    store_waitstatus (ourstatus, status);
+
+  return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
+}
+
+static int
+kill_callback (struct lwp_info *lp, void *data)
+{
+  errno = 0;
+  ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0);
+  if (debug_lin_lwp)
+    fprintf_unfiltered (gdb_stdlog,
+                       "KC:  PTRACE_KILL %s, 0, 0 (%s)\n",
+                       target_pid_to_str (lp->ptid),
+                       errno ? safe_strerror (errno) : "OK");
+
+  return 0;
+}
+
+static int
+kill_wait_callback (struct lwp_info *lp, void *data)
+{
+  pid_t pid;
+
+  /* We must make sure that there are no pending events (delayed
+     SIGSTOPs, pending SIGTRAPs, etc.) to make sure the current
+     program doesn't interfere with any following debugging session.  */
+
+  /* For cloned processes we must check both with __WCLONE and
+     without, since the exit status of a cloned process isn't reported
+     with __WCLONE.  */
+  if (lp->cloned)
+    {
+      do
+       {
+         pid = waitpid (GET_LWP (lp->ptid), NULL, __WCLONE);
+         if (pid != (pid_t) -1 && debug_lin_lwp)
+           {
+             fprintf_unfiltered (gdb_stdlog,
+                                 "KWC: wait %s received unknown.\n",
+                                 target_pid_to_str (lp->ptid));
+           }
+       }
+      while (pid == GET_LWP (lp->ptid));
+
+      gdb_assert (pid == -1 && errno == ECHILD);
+    }
+
+  do
+    {
+      pid = waitpid (GET_LWP (lp->ptid), NULL, 0);
+      if (pid != (pid_t) -1 && debug_lin_lwp)
+       {
+         fprintf_unfiltered (gdb_stdlog,
+                             "KWC: wait %s received unk.\n",
+                             target_pid_to_str (lp->ptid));
+       }
+    }
+  while (pid == GET_LWP (lp->ptid));
+
+  gdb_assert (pid == -1 && errno == ECHILD);
+  return 0;
+}
+
+static void
+lin_lwp_kill (void)
+{
+  /* Kill all LWP's ...  */
+  iterate_over_lwps (kill_callback, NULL);
+
+  /* ... and wait until we've flushed all events.  */
+  iterate_over_lwps (kill_wait_callback, NULL);
+
+  target_mourn_inferior ();
+}
+
+static void
+lin_lwp_create_inferior (char *exec_file, char *allargs, char **env,
+                        int from_tty)
+{
+  child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
+}
+
+static void
+lin_lwp_mourn_inferior (void)
+{
+  trap_ptid = null_ptid;
+
+  /* Destroy LWP info; it's no longer valid.  */
+  init_lwp_list ();
+
+  /* Restore the original signal mask.  */
+  sigprocmask (SIG_SETMASK, &normal_mask, NULL);
+  sigemptyset (&blocked_mask);
+
+  child_ops.to_mourn_inferior ();
+}
+
+static int
+lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                    struct mem_attrib *attrib, struct target_ops *target)
+{
+  struct cleanup *old_chain = save_inferior_ptid ();
+  int xfer;
+
+  if (is_lwp (inferior_ptid))
+    inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
+
+  xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+  if (xfer == 0)
+    xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+
+  do_cleanups (old_chain);
+  return xfer;
+}
+
+static int
+lin_lwp_thread_alive (ptid_t ptid)
+{
+  gdb_assert (is_lwp (ptid));
+
+  errno = 0;
+  ptrace (PTRACE_PEEKUSER, GET_LWP (ptid), 0, 0);
+  if (debug_lin_lwp)
+    fprintf_unfiltered (gdb_stdlog,
+                       "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n",
+                       target_pid_to_str (ptid),
+                       errno ? safe_strerror (errno) : "OK");
+  if (errno)
+    return 0;
+
+  return 1;
+}
+
+static char *
+lin_lwp_pid_to_str (ptid_t ptid)
+{
+  static char buf[64];
+
+  if (is_lwp (ptid))
+    {
+      snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid));
+      return buf;
+    }
+
+  return normal_pid_to_str (ptid);
+}
+
+static void
+init_lin_lwp_ops (void)
+{
+#if 0
+  lin_lwp_ops.to_open = lin_lwp_open;
+#endif
+  lin_lwp_ops.to_shortname = "lwp-layer";
+  lin_lwp_ops.to_longname = "lwp-layer";
+  lin_lwp_ops.to_doc = "Low level threads support (LWP layer)";
+  lin_lwp_ops.to_attach = lin_lwp_attach;
+  lin_lwp_ops.to_detach = lin_lwp_detach;
+  lin_lwp_ops.to_resume = lin_lwp_resume;
+  lin_lwp_ops.to_wait = lin_lwp_wait;
+  /* fetch_inferior_registers and store_inferior_registers will
+     honor the LWP id, so we can use them directly.  */
+  lin_lwp_ops.to_fetch_registers = fetch_inferior_registers;
+  lin_lwp_ops.to_store_registers = store_inferior_registers;
+  lin_lwp_ops.to_xfer_memory = lin_lwp_xfer_memory;
+  lin_lwp_ops.to_kill = lin_lwp_kill;
+  lin_lwp_ops.to_create_inferior = lin_lwp_create_inferior;
+  lin_lwp_ops.to_mourn_inferior = lin_lwp_mourn_inferior;
+  lin_lwp_ops.to_thread_alive = lin_lwp_thread_alive;
+  lin_lwp_ops.to_pid_to_str = lin_lwp_pid_to_str;
+  lin_lwp_ops.to_post_startup_inferior = child_post_startup_inferior;
+  lin_lwp_ops.to_post_attach = child_post_attach;
+  lin_lwp_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint;
+  lin_lwp_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
+  lin_lwp_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint;
+
+  lin_lwp_ops.to_stratum = thread_stratum;
+  lin_lwp_ops.to_has_thread_control = tc_schedlock;
+  lin_lwp_ops.to_magic = OPS_MAGIC;
+}
+
+static void
+sigchld_handler (int signo)
+{
+  /* Do nothing.  The only reason for this handler is that it allows
+     us to use sigsuspend in lin_lwp_wait above to wait for the
+     arrival of a SIGCHLD.  */
+}
+
+void
+_initialize_lin_lwp (void)
+{
+  struct sigaction action;
+
+  extern void thread_db_init (struct target_ops *);
+
+  init_lin_lwp_ops ();
+  add_target (&lin_lwp_ops);
+  thread_db_init (&lin_lwp_ops);
+
+  /* Save the original signal mask.  */
+  sigprocmask (SIG_SETMASK, NULL, &normal_mask);
+
+  action.sa_handler = sigchld_handler;
+  sigemptyset (&action.sa_mask);
+  action.sa_flags = 0;
+  sigaction (SIGCHLD, &action, NULL);
+
+  /* Make sure we don't block SIGCHLD during a sigsuspend.  */
+  sigprocmask (SIG_SETMASK, NULL, &suspend_mask);
+  sigdelset (&suspend_mask, SIGCHLD);
+
+  sigemptyset (&blocked_mask);
+
+  deprecated_add_show_from_set
+    (add_set_cmd ("lin-lwp", no_class, var_zinteger,
+                 (char *) &debug_lin_lwp,
+                 "Set debugging of GNU/Linux lwp module.\n\
+Enables printf debugging output.\n", &setdebuglist), &showdebuglist);
+}
+\f
+
+/* FIXME: kettenis/2000-08-26: The stuff on this page is specific to
+   the GNU/Linux Threads library and therefore doesn't really belong
+   here.  */
+
+/* Read variable NAME in the target and return its value if found.
+   Otherwise return zero.  It is assumed that the type of the variable
+   is `int'.  */
+
+static int
+get_signo (const char *name)
+{
+  struct minimal_symbol *ms;
+  int signo;
+
+  ms = lookup_minimal_symbol (name, NULL, NULL);
+  if (ms == NULL)
+    return 0;
+
+  if (target_read_memory (SYMBOL_VALUE_ADDRESS (ms), (char *) &signo,
+                         sizeof (signo)) != 0)
+    return 0;
+
+  return signo;
+}
+
+/* Return the set of signals used by the threads library in *SET.  */
+
+void
+lin_thread_get_thread_signals (sigset_t *set)
+{
+  struct sigaction action;
+  int restart, cancel;
+
+  sigemptyset (set);
+
+  restart = get_signo ("__pthread_sig_restart");
+  if (restart == 0)
+    return;
+
+  cancel = get_signo ("__pthread_sig_cancel");
+  if (cancel == 0)
+    return;
+
+  sigaddset (set, restart);
+  sigaddset (set, cancel);
+
+  /* The GNU/Linux Threads library makes terminating threads send a
+     special "cancel" signal instead of SIGCHLD.  Make sure we catch
+     those (to prevent them from terminating GDB itself, which is
+     likely to be their default action) and treat them the same way as
+     SIGCHLD.  */
+
+  action.sa_handler = sigchld_handler;
+  sigemptyset (&action.sa_mask);
+  action.sa_flags = 0;
+  sigaction (cancel, &action, NULL);
+
+  /* We block the "cancel" signal throughout this code ...  */
+  sigaddset (&blocked_mask, cancel);
+  sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+
+  /* ... except during a sigsuspend.  */
+  sigdelset (&suspend_mask, cancel);
+}
index 9c40f772e64305eec16c5417ffba9953790d85ae..15b67042290e1f5470fc57c64321ec1fc4750e73 100644 (file)
@@ -1,6 +1,5 @@
 /* GNU/Linux native-dependent code common to multiple platforms.
-
-   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "defs.h"
 #include "inferior.h"
 #include "target.h"
-#include "gdb_string.h"
+
 #include "gdb_wait.h"
-#include "gdb_assert.h"
-#ifdef HAVE_TKILL_SYSCALL
-#include <unistd.h>
-#include <sys/syscall.h>
-#endif
 #include <sys/ptrace.h>
+
 #include "linux-nat.h"
-#include "gdbthread.h"
-#include "gdbcmd.h"
-#include "regcache.h"
-#include <sys/param.h>         /* for MAXPATHLEN */
-#include <sys/procfs.h>                /* for elf_gregset etc. */
-#include "elf-bfd.h"           /* for elfcore_write_* */
-#include "gregset.h"           /* for gregset */
-#include "gdbcore.h"           /* for get_exec_file */
-#include <ctype.h>             /* for isdigit */
-#include "gdbthread.h"         /* for struct thread_info etc. */
-#include "gdb_stat.h"          /* for struct stat */
-#include <fcntl.h>             /* for O_RDONLY */
-
-#ifndef O_LARGEFILE
-#define O_LARGEFILE 0
-#endif
 
 /* If the system headers did not provide the constants, hard-code the normal
    values.  */
@@ -81,7 +60,7 @@
 #define __WALL          0x40000000 /* Wait for any child.  */
 #endif
 
-static int debug_linux_nat;
+extern struct target_ops child_ops;
 
 static int linux_parent_pid;
 
@@ -398,7 +377,7 @@ child_follow_fork (int follow_child)
        target_detach (NULL, 0);
 
       inferior_ptid = pid_to_ptid (child_pid);
-      push_target (&deprecated_child_ops);
+      push_target (&child_ops);
 
       /* Reset breakpoints in the child as appropriate.  */
       follow_inferior_reset_breakpoints ();
@@ -522,12 +501,12 @@ kill_inferior (void)
       || last.kind == TARGET_WAITKIND_VFORKED)
     {
       ptrace (PT_KILL, last.value.related_pid, 0, 0);
-      wait (&status);
+      ptrace_wait (null_ptid, &status);
     }
 
   /* Kill the current process.  */
   ptrace (PT_KILL, pid, 0, 0);
-  ret = wait (&status);
+  ret = ptrace_wait (null_ptid, &status);
 
   /* We might get a SIGCHLD instead of an exit status.  This is
      aggravated by the first kill above - a child has just died.  */
@@ -535,2582 +514,8 @@ kill_inferior (void)
   while (ret == pid && WIFSTOPPED (status))
     {
       ptrace (PT_KILL, pid, 0, 0);
-      ret = wait (&status);
+      ret = ptrace_wait (null_ptid, &status);
     }
 
   target_mourn_inferior ();
 }
-
-/* On GNU/Linux there are no real LWP's.  The closest thing to LWP's
-   are processes sharing the same VM space.  A multi-threaded process
-   is basically a group of such processes.  However, such a grouping
-   is almost entirely a user-space issue; the kernel doesn't enforce
-   such a grouping at all (this might change in the future).  In
-   general, we'll rely on the threads library (i.e. the GNU/Linux
-   Threads library) to provide such a grouping.
-
-   It is perfectly well possible to write a multi-threaded application
-   without the assistance of a threads library, by using the clone
-   system call directly.  This module should be able to give some
-   rudimentary support for debugging such applications if developers
-   specify the CLONE_PTRACE flag in the clone system call, and are
-   using the Linux kernel 2.4 or above.
-
-   Note that there are some peculiarities in GNU/Linux that affect
-   this code:
-
-   - In general one should specify the __WCLONE flag to waitpid in
-     order to make it report events for any of the cloned processes
-     (and leave it out for the initial process).  However, if a cloned
-     process has exited the exit status is only reported if the
-     __WCLONE flag is absent.  Linux kernel 2.4 has a __WALL flag, but
-     we cannot use it since GDB must work on older systems too.
-
-   - When a traced, cloned process exits and is waited for by the
-     debugger, the kernel reassigns it to the original parent and
-     keeps it around as a "zombie".  Somehow, the GNU/Linux Threads
-     library doesn't notice this, which leads to the "zombie problem":
-     When debugged a multi-threaded process that spawns a lot of
-     threads will run out of processes, even if the threads exit,
-     because the "zombies" stay around.  */
-
-/* List of known LWPs.  */
-static struct lwp_info *lwp_list;
-
-/* Number of LWPs in the list.  */
-static int num_lwps;
-
-/* Non-zero if we're running in "threaded" mode.  */
-static int threaded;
-\f
-
-#define GET_LWP(ptid)          ptid_get_lwp (ptid)
-#define GET_PID(ptid)          ptid_get_pid (ptid)
-#define is_lwp(ptid)           (GET_LWP (ptid) != 0)
-#define BUILD_LWP(lwp, pid)    ptid_build (pid, lwp, 0)
-
-/* If the last reported event was a SIGTRAP, this variable is set to
-   the process id of the LWP/thread that got it.  */
-ptid_t trap_ptid;
-\f
-
-/* This module's target-specific operations.  */
-static struct target_ops linux_nat_ops;
-
-/* Since we cannot wait (in linux_nat_wait) for the initial process and
-   any cloned processes with a single call to waitpid, we have to use
-   the WNOHANG flag and call waitpid in a loop.  To optimize
-   things a bit we use `sigsuspend' to wake us up when a process has
-   something to report (it will send us a SIGCHLD if it has).  To make
-   this work we have to juggle with the signal mask.  We save the
-   original signal mask such that we can restore it before creating a
-   new process in order to avoid blocking certain signals in the
-   inferior.  We then block SIGCHLD during the waitpid/sigsuspend
-   loop.  */
-
-/* Original signal mask.  */
-static sigset_t normal_mask;
-
-/* Signal mask for use with sigsuspend in linux_nat_wait, initialized in
-   _initialize_linux_nat.  */
-static sigset_t suspend_mask;
-
-/* Signals to block to make that sigsuspend work.  */
-static sigset_t blocked_mask;
-\f
-
-/* Prototypes for local functions.  */
-static int stop_wait_callback (struct lwp_info *lp, void *data);
-static int linux_nat_thread_alive (ptid_t ptid);
-\f
-/* Convert wait status STATUS to a string.  Used for printing debug
-   messages only.  */
-
-static char *
-status_to_str (int status)
-{
-  static char buf[64];
-
-  if (WIFSTOPPED (status))
-    snprintf (buf, sizeof (buf), "%s (stopped)",
-             strsignal (WSTOPSIG (status)));
-  else if (WIFSIGNALED (status))
-    snprintf (buf, sizeof (buf), "%s (terminated)",
-             strsignal (WSTOPSIG (status)));
-  else
-    snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status));
-
-  return buf;
-}
-
-/* Initialize the list of LWPs.  Note that this module, contrary to
-   what GDB's generic threads layer does for its thread list,
-   re-initializes the LWP lists whenever we mourn or detach (which
-   doesn't involve mourning) the inferior.  */
-
-static void
-init_lwp_list (void)
-{
-  struct lwp_info *lp, *lpnext;
-
-  for (lp = lwp_list; lp; lp = lpnext)
-    {
-      lpnext = lp->next;
-      xfree (lp);
-    }
-
-  lwp_list = NULL;
-  num_lwps = 0;
-  threaded = 0;
-}
-
-/* Add the LWP specified by PID to the list.  If this causes the
-   number of LWPs to become larger than one, go into "threaded" mode.
-   Return a pointer to the structure describing the new LWP.  */
-
-static struct lwp_info *
-add_lwp (ptid_t ptid)
-{
-  struct lwp_info *lp;
-
-  gdb_assert (is_lwp (ptid));
-
-  lp = (struct lwp_info *) xmalloc (sizeof (struct lwp_info));
-
-  memset (lp, 0, sizeof (struct lwp_info));
-
-  lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
-
-  lp->ptid = ptid;
-
-  lp->next = lwp_list;
-  lwp_list = lp;
-  if (++num_lwps > 1)
-    threaded = 1;
-
-  return lp;
-}
-
-/* Remove the LWP specified by PID from the list.  */
-
-static void
-delete_lwp (ptid_t ptid)
-{
-  struct lwp_info *lp, *lpprev;
-
-  lpprev = NULL;
-
-  for (lp = lwp_list; lp; lpprev = lp, lp = lp->next)
-    if (ptid_equal (lp->ptid, ptid))
-      break;
-
-  if (!lp)
-    return;
-
-  /* We don't go back to "non-threaded" mode if the number of threads
-     becomes less than two.  */
-  num_lwps--;
-
-  if (lpprev)
-    lpprev->next = lp->next;
-  else
-    lwp_list = lp->next;
-
-  xfree (lp);
-}
-
-/* Return a pointer to the structure describing the LWP corresponding
-   to PID.  If no corresponding LWP could be found, return NULL.  */
-
-static struct lwp_info *
-find_lwp_pid (ptid_t ptid)
-{
-  struct lwp_info *lp;
-  int lwp;
-
-  if (is_lwp (ptid))
-    lwp = GET_LWP (ptid);
-  else
-    lwp = GET_PID (ptid);
-
-  for (lp = lwp_list; lp; lp = lp->next)
-    if (lwp == GET_LWP (lp->ptid))
-      return lp;
-
-  return NULL;
-}
-
-/* Call CALLBACK with its second argument set to DATA for every LWP in
-   the list.  If CALLBACK returns 1 for a particular LWP, return a
-   pointer to the structure describing that LWP immediately.
-   Otherwise return NULL.  */
-
-struct lwp_info *
-iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data)
-{
-  struct lwp_info *lp, *lpnext;
-
-  for (lp = lwp_list; lp; lp = lpnext)
-    {
-      lpnext = lp->next;
-      if ((*callback) (lp, data))
-       return lp;
-    }
-
-  return NULL;
-}
-
-/* Attach to the LWP specified by PID.  If VERBOSE is non-zero, print
-   a message telling the user that a new LWP has been added to the
-   process.  */
-
-void
-lin_lwp_attach_lwp (ptid_t ptid, int verbose)
-{
-  struct lwp_info *lp, *found_lp;
-
-  gdb_assert (is_lwp (ptid));
-
-  /* Make sure SIGCHLD is blocked.  We don't want SIGCHLD events
-     to interrupt either the ptrace() or waitpid() calls below.  */
-  if (!sigismember (&blocked_mask, SIGCHLD))
-    {
-      sigaddset (&blocked_mask, SIGCHLD);
-      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
-    }
-
-  if (verbose)
-    printf_filtered ("[New %s]\n", target_pid_to_str (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, 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;
-
-      if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
-       error ("Can't attach %s: %s", target_pid_to_str (ptid),
-              safe_strerror (errno));
-
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n",
-                           target_pid_to_str (ptid));
-
-      pid = waitpid (GET_LWP (ptid), &status, 0);
-      if (pid == -1 && errno == ECHILD)
-       {
-         /* Try again with __WCLONE to check cloned processes.  */
-         pid = waitpid (GET_LWP (ptid), &status, __WCLONE);
-         lp->cloned = 1;
-       }
-
-      gdb_assert (pid == GET_LWP (ptid)
-                 && WIFSTOPPED (status) && WSTOPSIG (status));
-
-      child_post_attach (pid);
-
-      lp->stopped = 1;
-
-      if (debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "LLAL: waitpid %s received %s\n",
-                             target_pid_to_str (ptid),
-                             status_to_str (status));
-       }
-    }
-  else
-    {
-      /* We assume that the LWP representing the original process is
-         already stopped.  Mark it as stopped in the data structure
-         that the linux ptrace layer uses to keep track of threads.
-         Note that this won't have already been done since the main
-         thread will have, we assume, been stopped by an attach from a
-         different layer.  */
-      lp->stopped = 1;
-    }
-}
-
-static void
-linux_nat_attach (char *args, int from_tty)
-{
-  struct lwp_info *lp;
-  pid_t pid;
-  int status;
-
-  /* FIXME: We should probably accept a list of process id's, and
-     attach all of them.  */
-  deprecated_child_ops.to_attach (args, from_tty);
-
-  /* Add the initial process as the first LWP to the list.  */
-  lp = add_lwp (BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)));
-
-  /* Make sure the initial process is stopped.  The user-level threads
-     layer might want to poke around in the inferior, and that won't
-     work if things haven't stabilized yet.  */
-  pid = waitpid (GET_PID (inferior_ptid), &status, 0);
-  if (pid == -1 && errno == ECHILD)
-    {
-      warning ("%s is a cloned process", target_pid_to_str (inferior_ptid));
-
-      /* Try again with __WCLONE to check cloned processes.  */
-      pid = waitpid (GET_PID (inferior_ptid), &status, __WCLONE);
-      lp->cloned = 1;
-    }
-
-  gdb_assert (pid == GET_PID (inferior_ptid)
-             && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP);
-
-  lp->stopped = 1;
-
-  /* Fake the SIGSTOP that core GDB expects.  */
-  lp->status = W_STOPCODE (SIGSTOP);
-  lp->resumed = 1;
-  if (debug_linux_nat)
-    {
-      fprintf_unfiltered (gdb_stdlog,
-                         "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid);
-    }
-}
-
-static int
-detach_callback (struct lwp_info *lp, void *data)
-{
-  gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
-
-  if (debug_linux_nat && lp->status)
-    fprintf_unfiltered (gdb_stdlog, "DC:  Pending %s for %s on detach.\n",
-                       strsignal (WSTOPSIG (lp->status)),
-                       target_pid_to_str (lp->ptid));
-
-  while (lp->signalled && lp->stopped)
-    {
-      errno = 0;
-      if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
-                 WSTOPSIG (lp->status)) < 0)
-       error ("Can't continue %s: %s", target_pid_to_str (lp->ptid),
-              safe_strerror (errno));
-
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "DC:  PTRACE_CONTINUE (%s, 0, %s) (OK)\n",
-                           target_pid_to_str (lp->ptid),
-                           status_to_str (lp->status));
-
-      lp->stopped = 0;
-      lp->signalled = 0;
-      lp->status = 0;
-      /* FIXME drow/2003-08-26: There was a call to stop_wait_callback
-        here.  But since lp->signalled was cleared above,
-        stop_wait_callback didn't do anything; the process was left
-        running.  Shouldn't we be waiting for it to stop?
-        I've removed the call, since stop_wait_callback now does do
-        something when called with lp->signalled == 0.  */
-
-      gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
-    }
-
-  /* We don't actually detach from the LWP that has an id equal to the
-     overall process id just yet.  */
-  if (GET_LWP (lp->ptid) != GET_PID (lp->ptid))
-    {
-      errno = 0;
-      if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0,
-                 WSTOPSIG (lp->status)) < 0)
-       error ("Can't detach %s: %s", target_pid_to_str (lp->ptid),
-              safe_strerror (errno));
-
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "PTRACE_DETACH (%s, %s, 0) (OK)\n",
-                           target_pid_to_str (lp->ptid),
-                           strsignal (WSTOPSIG (lp->status)));
-
-      delete_lwp (lp->ptid);
-    }
-
-  return 0;
-}
-
-static void
-linux_nat_detach (char *args, int from_tty)
-{
-  iterate_over_lwps (detach_callback, NULL);
-
-  /* Only the initial process should be left right now.  */
-  gdb_assert (num_lwps == 1);
-
-  trap_ptid = null_ptid;
-
-  /* Destroy LWP info; it's no longer valid.  */
-  init_lwp_list ();
-
-  /* Restore the original signal mask.  */
-  sigprocmask (SIG_SETMASK, &normal_mask, NULL);
-  sigemptyset (&blocked_mask);
-
-  inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
-  deprecated_child_ops.to_detach (args, from_tty);
-}
-
-/* Resume LP.  */
-
-static int
-resume_callback (struct lwp_info *lp, void *data)
-{
-  if (lp->stopped && lp->status == 0)
-    {
-      struct thread_info *tp;
-
-      child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0);
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "RC:  PTRACE_CONT %s, 0, 0 (resume sibling)\n",
-                           target_pid_to_str (lp->ptid));
-      lp->stopped = 0;
-      lp->step = 0;
-    }
-
-  return 0;
-}
-
-static int
-resume_clear_callback (struct lwp_info *lp, void *data)
-{
-  lp->resumed = 0;
-  return 0;
-}
-
-static int
-resume_set_callback (struct lwp_info *lp, void *data)
-{
-  lp->resumed = 1;
-  return 0;
-}
-
-static void
-linux_nat_resume (ptid_t ptid, int step, enum target_signal signo)
-{
-  struct lwp_info *lp;
-  int resume_all;
-
-  /* A specific PTID means `step only this process id'.  */
-  resume_all = (PIDGET (ptid) == -1);
-
-  if (resume_all)
-    iterate_over_lwps (resume_set_callback, NULL);
-  else
-    iterate_over_lwps (resume_clear_callback, NULL);
-
-  /* If PID is -1, it's the current inferior that should be
-     handled specially.  */
-  if (PIDGET (ptid) == -1)
-    ptid = inferior_ptid;
-
-  lp = find_lwp_pid (ptid);
-  if (lp)
-    {
-      ptid = pid_to_ptid (GET_LWP (lp->ptid));
-
-      /* Remember if we're stepping.  */
-      lp->step = step;
-
-      /* Mark this LWP as resumed.  */
-      lp->resumed = 1;
-
-      /* If we have a pending wait status for this thread, there is no
-         point in resuming the process.  */
-      if (lp->status)
-       {
-         /* FIXME: What should we do if we are supposed to continue
-            this thread with a signal?  */
-         gdb_assert (signo == TARGET_SIGNAL_0);
-         return;
-       }
-
-      /* Mark LWP as not stopped to prevent it from being continued by
-         resume_callback.  */
-      lp->stopped = 0;
-    }
-
-  if (resume_all)
-    iterate_over_lwps (resume_callback, NULL);
-
-  child_resume (ptid, step, signo);
-  if (debug_linux_nat)
-    fprintf_unfiltered (gdb_stdlog,
-                       "LLR: %s %s, %s (resume event thread)\n",
-                       step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
-                       target_pid_to_str (ptid),
-                       signo ? strsignal (signo) : "0");
-}
-
-/* Issue kill to specified lwp.  */
-
-static int tkill_failed;
-
-static int
-kill_lwp (int lwpid, int signo)
-{
-  errno = 0;
-
-/* Use tkill, if possible, in case we are using nptl threads.  If tkill
-   fails, then we are not using nptl threads and we should be using kill.  */
-
-#ifdef HAVE_TKILL_SYSCALL
-  if (!tkill_failed)
-    {
-      int ret = syscall (__NR_tkill, lwpid, signo);
-      if (errno != ENOSYS)
-       return ret;
-      errno = 0;
-      tkill_failed = 1;
-    }
-#endif
-
-  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
-linux_nat_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_linux_nat)
-       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.  */
-
-static int
-wait_lwp (struct lwp_info *lp)
-{
-  pid_t pid;
-  int status;
-  int thread_dead = 0;
-
-  gdb_assert (!lp->stopped);
-  gdb_assert (lp->status == 0);
-
-  pid = waitpid (GET_LWP (lp->ptid), &status, 0);
-  if (pid == -1 && errno == ECHILD)
-    {
-      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, 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_linux_nat)
-           fprintf_unfiltered (gdb_stdlog, "WL: %s vanished.\n",
-                               target_pid_to_str (lp->ptid));
-       }
-    }
-
-  if (!thread_dead)
-    {
-      gdb_assert (pid == GET_LWP (lp->ptid));
-
-      if (debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "WL: waitpid %s received %s\n",
-                             target_pid_to_str (lp->ptid),
-                             status_to_str (status));
-       }
-    }
-
-  /* Check if the thread has exited.  */
-  if (WIFEXITED (status) || WIFSIGNALED (status))
-    {
-      thread_dead = 1;
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n",
-                           target_pid_to_str (lp->ptid));
-    }
-
-  if (thread_dead)
-    {
-      if (in_thread_list (lp->ptid))
-       {
-         /* Core GDB cannot deal with us deleting the current thread.  */
-         if (!ptid_equal (lp->ptid, inferior_ptid))
-           delete_thread (lp->ptid);
-         printf_unfiltered ("[%s exited]\n",
-                            target_pid_to_str (lp->ptid));
-       }
-
-      delete_lwp (lp->ptid);
-      return 0;
-    }
-
-  gdb_assert (WIFSTOPPED (status));
-
-  /* Handle GNU/Linux's extended waitstatus for trace events.  */
-  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
-    {
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "WL: Handling extended status 0x%06x\n",
-                           status);
-      if (linux_nat_handle_extended (lp, status))
-       return wait_lwp (lp);
-    }
-
-  return status;
-}
-
-/* Send a SIGSTOP to LP.  */
-
-static int
-stop_callback (struct lwp_info *lp, void *data)
-{
-  if (!lp->stopped && !lp->signalled)
-    {
-      int ret;
-
-      if (debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "SC:  kill %s **<SIGSTOP>**\n",
-                             target_pid_to_str (lp->ptid));
-       }
-      errno = 0;
-      ret = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
-      if (debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "SC:  lwp kill %d %s\n",
-                             ret,
-                             errno ? safe_strerror (errno) : "ERRNO-OK");
-       }
-
-      lp->signalled = 1;
-      gdb_assert (lp->status == 0);
-    }
-
-  return 0;
-}
-
-/* Wait until LP is stopped.  If DATA is non-null it is interpreted as
-   a pointer to a set of signals to be flushed immediately.  */
-
-static int
-stop_wait_callback (struct lwp_info *lp, void *data)
-{
-  sigset_t *flush_mask = data;
-
-  if (!lp->stopped)
-    {
-      int status;
-
-      status = wait_lwp (lp);
-      if (status == 0)
-       return 0;
-
-      /* Ignore any signals in FLUSH_MASK.  */
-      if (flush_mask && sigismember (flush_mask, WSTOPSIG (status)))
-       {
-         if (!lp->signalled)
-           {
-             lp->stopped = 1;
-             return 0;
-           }
-
-         errno = 0;
-         ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
-         if (debug_linux_nat)
-           fprintf_unfiltered (gdb_stdlog,
-                               "PTRACE_CONT %s, 0, 0 (%s)\n",
-                               target_pid_to_str (lp->ptid),
-                               errno ? safe_strerror (errno) : "OK");
-
-         return stop_wait_callback (lp, flush_mask);
-       }
-
-      if (WSTOPSIG (status) != SIGSTOP)
-       {
-         if (WSTOPSIG (status) == SIGTRAP)
-           {
-             /* If a LWP other than the LWP that we're reporting an
-                event for has hit a GDB breakpoint (as opposed to
-                some random trap signal), then just arrange for it to
-                hit it again later.  We don't keep the SIGTRAP status
-                and don't forward the SIGTRAP signal to the LWP.  We
-                will handle the current event, eventually we will
-                resume all LWPs, and this one will get its breakpoint
-                trap again.
-
-                If we do not do this, then we run the risk that the
-                user will delete or disable the breakpoint, but the
-                thread will have already tripped on it.  */
-
-             /* Now resume this LWP and get the SIGSTOP event. */
-             errno = 0;
-             ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
-             if (debug_linux_nat)
-               {
-                 fprintf_unfiltered (gdb_stdlog,
-                                     "PTRACE_CONT %s, 0, 0 (%s)\n",
-                                     target_pid_to_str (lp->ptid),
-                                     errno ? safe_strerror (errno) : "OK");
-
-                 fprintf_unfiltered (gdb_stdlog,
-                                     "SWC: Candidate SIGTRAP event in %s\n",
-                                     target_pid_to_str (lp->ptid));
-               }
-             /* Hold the SIGTRAP for handling by linux_nat_wait. */
-             stop_wait_callback (lp, data);
-             /* If there's another event, throw it back into the queue. */
-             if (lp->status)
-               {
-                 if (debug_linux_nat)
-                   {
-                     fprintf_unfiltered (gdb_stdlog,
-                                         "SWC: kill %s, %s\n",
-                                         target_pid_to_str (lp->ptid),
-                                         status_to_str ((int) status));
-                   }
-                 kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
-               }
-             /* Save the sigtrap event. */
-             lp->status = status;
-             return 0;
-           }
-         else
-           {
-             /* The thread was stopped with a signal other than
-                SIGSTOP, and didn't accidentally trip a breakpoint. */
-
-             if (debug_linux_nat)
-               {
-                 fprintf_unfiltered (gdb_stdlog,
-                                     "SWC: Pending event %s in %s\n",
-                                     status_to_str ((int) status),
-                                     target_pid_to_str (lp->ptid));
-               }
-             /* Now resume this LWP and get the SIGSTOP event. */
-             errno = 0;
-             ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
-                                   target_pid_to_str (lp->ptid),
-                                   errno ? safe_strerror (errno) : "OK");
-
-             /* Hold this event/waitstatus while we check to see if
-                there are any more (we still want to get that SIGSTOP). */
-             stop_wait_callback (lp, data);
-             /* If the lp->status field is still empty, use it to hold
-                this event.  If not, then this event must be returned
-                to the event queue of the LWP.  */
-             if (lp->status == 0)
-               lp->status = status;
-             else
-               {
-                 if (debug_linux_nat)
-                   {
-                     fprintf_unfiltered (gdb_stdlog,
-                                         "SWC: kill %s, %s\n",
-                                         target_pid_to_str (lp->ptid),
-                                         status_to_str ((int) status));
-                   }
-                 kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
-               }
-             return 0;
-           }
-       }
-      else
-       {
-         /* We caught the SIGSTOP that we intended to catch, so
-            there's no SIGSTOP pending.  */
-         lp->stopped = 1;
-         lp->signalled = 0;
-       }
-    }
-
-  return 0;
-}
-
-/* Check whether PID has any pending signals in FLUSH_MASK.  If so set
-   the appropriate bits in PENDING, and return 1 - otherwise return 0.  */
-
-static int
-linux_nat_has_pending (int pid, sigset_t *pending, sigset_t *flush_mask)
-{
-  sigset_t blocked, ignored;
-  int i;
-
-  linux_proc_pending_signals (pid, pending, &blocked, &ignored);
-
-  if (!flush_mask)
-    return 0;
-
-  for (i = 1; i < NSIG; i++)
-    if (sigismember (pending, i))
-      if (!sigismember (flush_mask, i)
-         || sigismember (&blocked, i)
-         || sigismember (&ignored, i))
-       sigdelset (pending, i);
-
-  if (sigisemptyset (pending))
-    return 0;
-
-  return 1;
-}
-
-/* DATA is interpreted as a mask of signals to flush.  If LP has
-   signals pending, and they are all in the flush mask, then arrange
-   to flush them.  LP should be stopped, as should all other threads
-   it might share a signal queue with.  */
-
-static int
-flush_callback (struct lwp_info *lp, void *data)
-{
-  sigset_t *flush_mask = data;
-  sigset_t pending, intersection, blocked, ignored;
-  int pid, status;
-
-  /* Normally, when an LWP exits, it is removed from the LWP list.  The
-     last LWP isn't removed till later, however.  So if there is only
-     one LWP on the list, make sure it's alive.  */
-  if (lwp_list == lp && lp->next == NULL)
-    if (!linux_nat_thread_alive (lp->ptid))
-      return 0;
-
-  /* Just because the LWP is stopped doesn't mean that new signals
-     can't arrive from outside, so this function must be careful of
-     race conditions.  However, because all threads are stopped, we
-     can assume that the pending mask will not shrink unless we resume
-     the LWP, and that it will then get another signal.  We can't
-     control which one, however.  */
-
-  if (lp->status)
-    {
-      if (debug_linux_nat)
-       printf_unfiltered ("FC: LP has pending status %06x\n", lp->status);
-      if (WIFSTOPPED (lp->status) && sigismember (flush_mask, WSTOPSIG (lp->status)))
-       lp->status = 0;
-    }
-
-  while (linux_nat_has_pending (GET_LWP (lp->ptid), &pending, flush_mask))
-    {
-      int ret;
-      
-      errno = 0;
-      ret = ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stderr,
-                           "FC: Sent PTRACE_CONT, ret %d %d\n", ret, errno);
-
-      lp->stopped = 0;
-      stop_wait_callback (lp, flush_mask);
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stderr,
-                           "FC: Wait finished; saved status is %d\n",
-                           lp->status);
-    }
-
-  return 0;
-}
-
-/* Return non-zero if LP has a wait status pending.  */
-
-static int
-status_callback (struct lwp_info *lp, void *data)
-{
-  /* Only report a pending wait status if we pretend that this has
-     indeed been resumed.  */
-  return (lp->status != 0 && lp->resumed);
-}
-
-/* Return non-zero if LP isn't stopped.  */
-
-static int
-running_callback (struct lwp_info *lp, void *data)
-{
-  return (lp->stopped == 0 || (lp->status != 0 && lp->resumed));
-}
-
-/* Count the LWP's that have had events.  */
-
-static int
-count_events_callback (struct lwp_info *lp, void *data)
-{
-  int *count = data;
-
-  gdb_assert (count != NULL);
-
-  /* Count only LWPs that have a SIGTRAP event pending.  */
-  if (lp->status != 0
-      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
-    (*count)++;
-
-  return 0;
-}
-
-/* Select the LWP (if any) that is currently being single-stepped.  */
-
-static int
-select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
-{
-  if (lp->step && lp->status != 0)
-    return 1;
-  else
-    return 0;
-}
-
-/* Select the Nth LWP that has had a SIGTRAP event.  */
-
-static int
-select_event_lwp_callback (struct lwp_info *lp, void *data)
-{
-  int *selector = data;
-
-  gdb_assert (selector != NULL);
-
-  /* Select only LWPs that have a SIGTRAP event pending. */
-  if (lp->status != 0
-      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
-    if ((*selector)-- == 0)
-      return 1;
-
-  return 0;
-}
-
-static int
-cancel_breakpoints_callback (struct lwp_info *lp, void *data)
-{
-  struct lwp_info *event_lp = data;
-
-  /* Leave the LWP that has been elected to receive a SIGTRAP alone.  */
-  if (lp == event_lp)
-    return 0;
-
-  /* If a LWP other than the LWP that we're reporting an event for has
-     hit a GDB breakpoint (as opposed to some random trap signal),
-     then just arrange for it to hit it again later.  We don't keep
-     the SIGTRAP status and don't forward the SIGTRAP signal to the
-     LWP.  We will handle the current event, eventually we will resume
-     all LWPs, and this one will get its breakpoint trap again.
-
-     If we do not do this, then we run the risk that the user will
-     delete or disable the breakpoint, but the LWP will have already
-     tripped on it.  */
-
-  if (lp->status != 0
-      && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP
-      && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) -
-                                    DECR_PC_AFTER_BREAK))
-    {
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "CBC: Push back breakpoint for %s\n",
-                           target_pid_to_str (lp->ptid));
-
-      /* Back up the PC if necessary.  */
-      if (DECR_PC_AFTER_BREAK)
-       write_pc_pid (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK, lp->ptid);
-
-      /* Throw away the SIGTRAP.  */
-      lp->status = 0;
-    }
-
-  return 0;
-}
-
-/* Select one LWP out of those that have events pending.  */
-
-static void
-select_event_lwp (struct lwp_info **orig_lp, int *status)
-{
-  int num_events = 0;
-  int random_selector;
-  struct lwp_info *event_lp;
-
-  /* Record the wait status for the origional LWP.  */
-  (*orig_lp)->status = *status;
-
-  /* Give preference to any LWP that is being single-stepped.  */
-  event_lp = iterate_over_lwps (select_singlestep_lwp_callback, NULL);
-  if (event_lp != NULL)
-    {
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "SEL: Select single-step %s\n",
-                           target_pid_to_str (event_lp->ptid));
-    }
-  else
-    {
-      /* No single-stepping LWP.  Select one at random, out of those
-         which have had SIGTRAP events.  */
-
-      /* First see how many SIGTRAP events we have.  */
-      iterate_over_lwps (count_events_callback, &num_events);
-
-      /* Now randomly pick a LWP out of those that have had a SIGTRAP.  */
-      random_selector = (int)
-       ((num_events * (double) rand ()) / (RAND_MAX + 1.0));
-
-      if (debug_linux_nat && num_events > 1)
-       fprintf_unfiltered (gdb_stdlog,
-                           "SEL: Found %d SIGTRAP events, selecting #%d\n",
-                           num_events, random_selector);
-
-      event_lp = iterate_over_lwps (select_event_lwp_callback,
-                                   &random_selector);
-    }
-
-  if (event_lp != NULL)
-    {
-      /* Switch the event LWP.  */
-      *orig_lp = event_lp;
-      *status = event_lp->status;
-    }
-
-  /* Flush the wait status for the event LWP.  */
-  (*orig_lp)->status = 0;
-}
-
-/* Return non-zero if LP has been resumed.  */
-
-static int
-resumed_callback (struct lwp_info *lp, void *data)
-{
-  return lp->resumed;
-}
-
-#ifdef CHILD_WAIT
-
-/* We need to override child_wait to support attaching to cloned
-   processes, since a normal wait (as done by the default version)
-   ignores those processes.  */
-
-/* Wait for child PTID to do something.  Return id of the child,
-   minus_one_ptid in case of error; store status into *OURSTATUS.  */
-
-ptid_t
-child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
-{
-  int save_errno;
-  int status;
-  pid_t pid;
-
-  ourstatus->kind = TARGET_WAITKIND_IGNORE;
-
-  do
-    {
-      set_sigint_trap ();      /* Causes SIGINT to be passed on to the
-                                  attached process.  */
-      set_sigio_trap ();
-
-      pid = waitpid (GET_PID (ptid), &status, 0);
-      if (pid == -1 && errno == ECHILD)
-       /* Try again with __WCLONE to check cloned processes.  */
-       pid = waitpid (GET_PID (ptid), &status, __WCLONE);
-
-      if (debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "CW:  waitpid %ld received %s\n",
-                             (long) pid, status_to_str (status));
-       }
-
-      save_errno = errno;
-
-      /* Make sure we don't report an event for the exit of the
-         original program, if we've detached from it.  */
-      if (pid != -1 && !WIFSTOPPED (status) && pid != GET_PID (inferior_ptid))
-       {
-         pid = -1;
-         save_errno = EINTR;
-       }
-
-      /* Check for stop events reported by a process we didn't already
-        know about - in this case, anything other than inferior_ptid.
-
-        If we're expecting to receive stopped processes after fork,
-        vfork, and clone events, then we'll just add the new one to
-        our list and go back to waiting for the event to be reported
-        - the stopped process might be returned from waitpid before
-        or after the event is.  If we want to handle debugging of
-        CLONE_PTRACE processes we need to do more here, i.e. switch
-        to multi-threaded mode.  */
-      if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP
-         && pid != GET_PID (inferior_ptid))
-       {
-         linux_record_stopped_pid (pid);
-         pid = -1;
-         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;
-             ptrace (PTRACE_CONT, pid, 0, 0);
-             pid = -1;
-             save_errno = EINTR;
-           }
-       }
-
-      clear_sigio_trap ();
-      clear_sigint_trap ();
-    }
-  while (pid == -1 && save_errno == EINTR);
-
-  if (pid == -1)
-    {
-      warning ("Child process unexpectedly missing: %s",
-              safe_strerror (errno));
-
-      /* Claim it exited with unknown signal.  */
-      ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
-      ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
-      return minus_one_ptid;
-    }
-
-  if (ourstatus->kind == TARGET_WAITKIND_IGNORE)
-    store_waitstatus (ourstatus, status);
-
-  return pid_to_ptid (pid);
-}
-
-#endif
-
-/* Stop an active thread, verify it still exists, then resume it.  */
-
-static int
-stop_and_resume_callback (struct lwp_info *lp, void *data)
-{
-  struct lwp_info *ptr;
-
-  if (!lp->stopped && !lp->signalled)
-    {
-      stop_callback (lp, NULL);
-      stop_wait_callback (lp, NULL);
-      /* Resume if the lwp still exists.  */
-      for (ptr = lwp_list; ptr; ptr = ptr->next)
-       if (lp == ptr)
-         {
-           resume_callback (lp, NULL);
-           resume_set_callback (lp, NULL);
-         }
-    }
-  return 0;
-}
-
-static ptid_t
-linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
-{
-  struct lwp_info *lp = NULL;
-  int options = 0;
-  int status = 0;
-  pid_t pid = PIDGET (ptid);
-  sigset_t flush_mask;
-
-  sigemptyset (&flush_mask);
-
-  /* Make sure SIGCHLD is blocked.  */
-  if (!sigismember (&blocked_mask, SIGCHLD))
-    {
-      sigaddset (&blocked_mask, SIGCHLD);
-      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
-    }
-
-retry:
-
-  /* Make sure there is at least one LWP that has been resumed, at
-     least if there are any LWPs at all.  */
-  gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
-
-  /* First check if there is a LWP with a wait status pending.  */
-  if (pid == -1)
-    {
-      /* Any LWP that's been resumed will do.  */
-      lp = iterate_over_lwps (status_callback, NULL);
-      if (lp)
-       {
-         status = lp->status;
-         lp->status = 0;
-
-         if (debug_linux_nat && status)
-           fprintf_unfiltered (gdb_stdlog,
-                               "LLW: Using pending wait status %s for %s.\n",
-                               status_to_str (status),
-                               target_pid_to_str (lp->ptid));
-       }
-
-      /* But if we don't fine one, we'll have to wait, and check both
-         cloned and uncloned processes.  We start with the cloned
-         processes.  */
-      options = __WCLONE | WNOHANG;
-    }
-  else if (is_lwp (ptid))
-    {
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "LLW: Waiting for specific LWP %s.\n",
-                           target_pid_to_str (ptid));
-
-      /* We have a specific LWP to check.  */
-      lp = find_lwp_pid (ptid);
-      gdb_assert (lp);
-      status = lp->status;
-      lp->status = 0;
-
-      if (debug_linux_nat && status)
-       fprintf_unfiltered (gdb_stdlog,
-                           "LLW: Using pending wait status %s for %s.\n",
-                           status_to_str (status),
-                           target_pid_to_str (lp->ptid));
-
-      /* If we have to wait, take into account whether PID is a cloned
-         process or not.  And we have to convert it to something that
-         the layer beneath us can understand.  */
-      options = lp->cloned ? __WCLONE : 0;
-      pid = GET_LWP (ptid);
-    }
-
-  if (status && lp->signalled)
-    {
-      /* A pending SIGSTOP may interfere with the normal stream of
-         events.  In a typical case where interference is a problem,
-         we have a SIGSTOP signal pending for LWP A while
-         single-stepping it, encounter an event in LWP B, and take the
-         pending SIGSTOP while trying to stop LWP A.  After processing
-         the event in LWP B, LWP A is continued, and we'll never see
-         the SIGTRAP associated with the last time we were
-         single-stepping LWP A.  */
-
-      /* Resume the thread.  It should halt immediately returning the
-         pending SIGSTOP.  */
-      registers_changed ();
-      child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
-                   TARGET_SIGNAL_0);
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "LLW: %s %s, 0, 0 (expect SIGSTOP)\n",
-                           lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
-                           target_pid_to_str (lp->ptid));
-      lp->stopped = 0;
-      gdb_assert (lp->resumed);
-
-      /* This should catch the pending SIGSTOP.  */
-      stop_wait_callback (lp, NULL);
-    }
-
-  set_sigint_trap ();          /* Causes SIGINT to be passed on to the
-                                  attached process. */
-  set_sigio_trap ();
-
-  while (status == 0)
-    {
-      pid_t lwpid;
-
-      lwpid = waitpid (pid, &status, options);
-      if (lwpid > 0)
-       {
-         gdb_assert (pid == -1 || lwpid == pid);
-
-         if (debug_linux_nat)
-           {
-             fprintf_unfiltered (gdb_stdlog,
-                                 "LLW: waitpid %ld received %s\n",
-                                 (long) lwpid, status_to_str (status));
-           }
-
-         lp = find_lwp_pid (pid_to_ptid (lwpid));
-
-         /* Check for stop events reported by a process we didn't
-            already know about - anything not already in our LWP
-            list.
-
-            If we're expecting to receive stopped processes after
-            fork, vfork, and clone events, then we'll just add the
-            new one to our list and go back to waiting for the event
-            to be reported - the stopped process might be returned
-            from waitpid before or after the event is.  */
-         if (WIFSTOPPED (status) && !lp)
-           {
-             linux_record_stopped_pid (lwpid);
-             status = 0;
-             continue;
-           }
-
-         /* Make sure we don't report an event for the exit of an LWP not in
-            our list, i.e.  not part of the current process.  This can happen
-            if we detach from a program we original forked and then it
-            exits.  */
-         if (!WIFSTOPPED (status) && !lp)
-           {
-             status = 0;
-             continue;
-           }
-
-         /* NOTE drow/2003-06-17: This code seems to be meant for debugging
-            CLONE_PTRACE processes which do not use the thread library -
-            otherwise we wouldn't find the new LWP this way.  That doesn't
-            currently work, and the following code is currently unreachable
-            due to the two blocks above.  If it's fixed some day, this code
-            should be broken out into a function so that we can also pick up
-            LWPs from the new interface.  */
-         if (!lp)
-           {
-             lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid)));
-             if (options & __WCLONE)
-               lp->cloned = 1;
-
-             if (threaded)
-               {
-                 gdb_assert (WIFSTOPPED (status)
-                             && WSTOPSIG (status) == SIGSTOP);
-                 lp->signalled = 1;
-
-                 if (!in_thread_list (inferior_ptid))
-                   {
-                     inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid),
-                                                GET_PID (inferior_ptid));
-                     add_thread (inferior_ptid);
-                   }
-
-                 add_thread (lp->ptid);
-                 printf_unfiltered ("[New %s]\n",
-                                    target_pid_to_str (lp->ptid));
-               }
-           }
-
-         /* Handle GNU/Linux's extended waitstatus for trace events.  */
-         if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
-           {
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "LLW: Handling extended status 0x%06x\n",
-                                   status);
-             if (linux_nat_handle_extended (lp, status))
-               {
-                 status = 0;
-                 continue;
-               }
-           }
-
-         /* Check if the thread has exited.  */
-         if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
-           {
-             if (in_thread_list (lp->ptid))
-               {
-                 /* Core GDB cannot deal with us deleting the current
-                    thread.  */
-                 if (!ptid_equal (lp->ptid, inferior_ptid))
-                   delete_thread (lp->ptid);
-                 printf_unfiltered ("[%s exited]\n",
-                                    target_pid_to_str (lp->ptid));
-               }
-
-             /* If this is the main thread, we must stop all threads and
-                verify if they are still alive.  This is because in the nptl
-                thread model, there is no signal issued for exiting LWPs
-                other than the main thread.  We only get the main thread
-                exit signal once all child threads have already exited.
-                If we stop all the threads and use the stop_wait_callback
-                to check if they have exited we can determine whether this
-                signal should be ignored or whether it means the end of the
-                debugged application, regardless of which threading model
-                is being used.  */
-             if (GET_PID (lp->ptid) == GET_LWP (lp->ptid))
-               {
-                 lp->stopped = 1;
-                 iterate_over_lwps (stop_and_resume_callback, NULL);
-               }
-
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "LLW: %s exited.\n",
-                                   target_pid_to_str (lp->ptid));
-
-             delete_lwp (lp->ptid);
-
-             /* If there is at least one more LWP, then the exit signal
-                was not the end of the debugged application and should be
-                ignored.  */
-             if (num_lwps > 0)
-               {
-                 /* Make sure there is at least one thread running.  */
-                 gdb_assert (iterate_over_lwps (running_callback, NULL));
-
-                 /* Discard the event.  */
-                 status = 0;
-                 continue;
-               }
-           }
-
-         /* Check if the current LWP has previously exited.  In the nptl
-            thread model, LWPs other than the main thread do not issue
-            signals when they exit so we must check whenever the thread
-            has stopped.  A similar check is made in stop_wait_callback().  */
-         if (num_lwps > 1 && !linux_nat_thread_alive (lp->ptid))
-           {
-             if (in_thread_list (lp->ptid))
-               {
-                 /* Core GDB cannot deal with us deleting the current
-                    thread.  */
-                 if (!ptid_equal (lp->ptid, inferior_ptid))
-                   delete_thread (lp->ptid);
-                 printf_unfiltered ("[%s exited]\n",
-                                    target_pid_to_str (lp->ptid));
-               }
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "LLW: %s exited.\n",
-                                   target_pid_to_str (lp->ptid));
-
-             delete_lwp (lp->ptid);
-
-             /* Make sure there is at least one thread running.  */
-             gdb_assert (iterate_over_lwps (running_callback, NULL));
-
-             /* Discard the event.  */
-             status = 0;
-             continue;
-           }
-
-         /* Make sure we don't report a SIGSTOP that we sent
-            ourselves in an attempt to stop an LWP.  */
-         if (lp->signalled
-             && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP)
-           {
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "LLW: Delayed SIGSTOP caught for %s.\n",
-                                   target_pid_to_str (lp->ptid));
-
-             /* This is a delayed SIGSTOP.  */
-             lp->signalled = 0;
-
-             registers_changed ();
-             child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
-                           TARGET_SIGNAL_0);
-             if (debug_linux_nat)
-               fprintf_unfiltered (gdb_stdlog,
-                                   "LLW: %s %s, 0, 0 (discard SIGSTOP)\n",
-                                   lp->step ?
-                                   "PTRACE_SINGLESTEP" : "PTRACE_CONT",
-                                   target_pid_to_str (lp->ptid));
-
-             lp->stopped = 0;
-             gdb_assert (lp->resumed);
-
-             /* Discard the event.  */
-             status = 0;
-             continue;
-           }
-
-         break;
-       }
-
-      if (pid == -1)
-       {
-         /* Alternate between checking cloned and uncloned processes.  */
-         options ^= __WCLONE;
-
-         /* And suspend every time we have checked both.  */
-         if (options & __WCLONE)
-           sigsuspend (&suspend_mask);
-       }
-
-      /* We shouldn't end up here unless we want to try again.  */
-      gdb_assert (status == 0);
-    }
-
-  clear_sigio_trap ();
-  clear_sigint_trap ();
-
-  gdb_assert (lp);
-
-  /* Don't report signals that GDB isn't interested in, such as
-     signals that are neither printed nor stopped upon.  Stopping all
-     threads can be a bit time-consuming so if we want decent
-     performance with heavily multi-threaded programs, especially when
-     they're using a high frequency timer, we'd better avoid it if we
-     can.  */
-
-  if (WIFSTOPPED (status))
-    {
-      int signo = target_signal_from_host (WSTOPSIG (status));
-
-      if (signal_stop_state (signo) == 0
-         && signal_print_state (signo) == 0
-         && signal_pass_state (signo) == 1)
-       {
-         /* FIMXE: kettenis/2001-06-06: Should we resume all threads
-            here?  It is not clear we should.  GDB may not expect
-            other threads to run.  On the other hand, not resuming
-            newly attached threads may cause an unwanted delay in
-            getting them running.  */
-         registers_changed ();
-         child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo);
-         if (debug_linux_nat)
-           fprintf_unfiltered (gdb_stdlog,
-                               "LLW: %s %s, %s (preempt 'handle')\n",
-                               lp->step ?
-                               "PTRACE_SINGLESTEP" : "PTRACE_CONT",
-                               target_pid_to_str (lp->ptid),
-                               signo ? strsignal (signo) : "0");
-         lp->stopped = 0;
-         status = 0;
-         goto retry;
-       }
-
-      if (signo == TARGET_SIGNAL_INT && signal_pass_state (signo) == 0)
-       {
-         /* If ^C/BREAK is typed at the tty/console, SIGINT gets
-            forwarded to the entire process group, that is, all LWP's
-            will receive it.  Since we only want to report it once,
-            we try to flush it from all LWPs except this one.  */
-         sigaddset (&flush_mask, SIGINT);
-       }
-    }
-
-  /* This LWP is stopped now.  */
-  lp->stopped = 1;
-
-  if (debug_linux_nat)
-    fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n",
-                       status_to_str (status), target_pid_to_str (lp->ptid));
-
-  /* Now stop all other LWP's ...  */
-  iterate_over_lwps (stop_callback, NULL);
-
-  /* ... and wait until all of them have reported back that they're no
-     longer running.  */
-  iterate_over_lwps (stop_wait_callback, &flush_mask);
-  iterate_over_lwps (flush_callback, &flush_mask);
-
-  /* If we're not waiting for a specific LWP, choose an event LWP from
-     among those that have had events.  Giving equal priority to all
-     LWPs that have had events helps prevent starvation.  */
-  if (pid == -1)
-    select_event_lwp (&lp, &status);
-
-  /* Now that we've selected our final event LWP, cancel any
-     breakpoints in other LWPs that have hit a GDB breakpoint.  See
-     the comment in cancel_breakpoints_callback to find out why.  */
-  iterate_over_lwps (cancel_breakpoints_callback, lp);
-
-  /* If we're not running in "threaded" mode, we'll report the bare
-     process id.  */
-
-  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP)
-    {
-      trap_ptid = (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
-      if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-                           "LLW: trap_ptid is %s.\n",
-                           target_pid_to_str (trap_ptid));
-    }
-  else
-    trap_ptid = null_ptid;
-
-  if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE)
-    {
-      *ourstatus = lp->waitstatus;
-      lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
-    }
-  else
-    store_waitstatus (ourstatus, status);
-
-  return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
-}
-
-static int
-kill_callback (struct lwp_info *lp, void *data)
-{
-  errno = 0;
-  ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0);
-  if (debug_linux_nat)
-    fprintf_unfiltered (gdb_stdlog,
-                       "KC:  PTRACE_KILL %s, 0, 0 (%s)\n",
-                       target_pid_to_str (lp->ptid),
-                       errno ? safe_strerror (errno) : "OK");
-
-  return 0;
-}
-
-static int
-kill_wait_callback (struct lwp_info *lp, void *data)
-{
-  pid_t pid;
-
-  /* We must make sure that there are no pending events (delayed
-     SIGSTOPs, pending SIGTRAPs, etc.) to make sure the current
-     program doesn't interfere with any following debugging session.  */
-
-  /* For cloned processes we must check both with __WCLONE and
-     without, since the exit status of a cloned process isn't reported
-     with __WCLONE.  */
-  if (lp->cloned)
-    {
-      do
-       {
-         pid = waitpid (GET_LWP (lp->ptid), NULL, __WCLONE);
-         if (pid != (pid_t) -1 && debug_linux_nat)
-           {
-             fprintf_unfiltered (gdb_stdlog,
-                                 "KWC: wait %s received unknown.\n",
-                                 target_pid_to_str (lp->ptid));
-           }
-       }
-      while (pid == GET_LWP (lp->ptid));
-
-      gdb_assert (pid == -1 && errno == ECHILD);
-    }
-
-  do
-    {
-      pid = waitpid (GET_LWP (lp->ptid), NULL, 0);
-      if (pid != (pid_t) -1 && debug_linux_nat)
-       {
-         fprintf_unfiltered (gdb_stdlog,
-                             "KWC: wait %s received unk.\n",
-                             target_pid_to_str (lp->ptid));
-       }
-    }
-  while (pid == GET_LWP (lp->ptid));
-
-  gdb_assert (pid == -1 && errno == ECHILD);
-  return 0;
-}
-
-static void
-linux_nat_kill (void)
-{
-  /* Kill all LWP's ...  */
-  iterate_over_lwps (kill_callback, NULL);
-
-  /* ... and wait until we've flushed all events.  */
-  iterate_over_lwps (kill_wait_callback, NULL);
-
-  target_mourn_inferior ();
-}
-
-static void
-linux_nat_create_inferior (char *exec_file, char *allargs, char **env,
-                        int from_tty)
-{
-  deprecated_child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
-}
-
-static void
-linux_nat_mourn_inferior (void)
-{
-  trap_ptid = null_ptid;
-
-  /* Destroy LWP info; it's no longer valid.  */
-  init_lwp_list ();
-
-  /* Restore the original signal mask.  */
-  sigprocmask (SIG_SETMASK, &normal_mask, NULL);
-  sigemptyset (&blocked_mask);
-
-  deprecated_child_ops.to_mourn_inferior ();
-}
-
-static int
-linux_nat_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-                    struct mem_attrib *attrib, struct target_ops *target)
-{
-  struct cleanup *old_chain = save_inferior_ptid ();
-  int xfer;
-
-  if (is_lwp (inferior_ptid))
-    inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
-
-  xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target);
-  if (xfer == 0)
-    xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
-
-  do_cleanups (old_chain);
-  return xfer;
-}
-
-static int
-linux_nat_thread_alive (ptid_t ptid)
-{
-  gdb_assert (is_lwp (ptid));
-
-  errno = 0;
-  ptrace (PTRACE_PEEKUSER, GET_LWP (ptid), 0, 0);
-  if (debug_linux_nat)
-    fprintf_unfiltered (gdb_stdlog,
-                       "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n",
-                       target_pid_to_str (ptid),
-                       errno ? safe_strerror (errno) : "OK");
-  if (errno)
-    return 0;
-
-  return 1;
-}
-
-static char *
-linux_nat_pid_to_str (ptid_t ptid)
-{
-  static char buf[64];
-
-  if (is_lwp (ptid))
-    {
-      snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid));
-      return buf;
-    }
-
-  return normal_pid_to_str (ptid);
-}
-
-static void
-init_linux_nat_ops (void)
-{
-#if 0
-  linux_nat_ops.to_open = linux_nat_open;
-#endif
-  linux_nat_ops.to_shortname = "lwp-layer";
-  linux_nat_ops.to_longname = "lwp-layer";
-  linux_nat_ops.to_doc = "Low level threads support (LWP layer)";
-  linux_nat_ops.to_attach = linux_nat_attach;
-  linux_nat_ops.to_detach = linux_nat_detach;
-  linux_nat_ops.to_resume = linux_nat_resume;
-  linux_nat_ops.to_wait = linux_nat_wait;
-  /* fetch_inferior_registers and store_inferior_registers will
-     honor the LWP id, so we can use them directly.  */
-  linux_nat_ops.to_fetch_registers = fetch_inferior_registers;
-  linux_nat_ops.to_store_registers = store_inferior_registers;
-  linux_nat_ops.deprecated_xfer_memory = linux_nat_xfer_memory;
-  linux_nat_ops.to_kill = linux_nat_kill;
-  linux_nat_ops.to_create_inferior = linux_nat_create_inferior;
-  linux_nat_ops.to_mourn_inferior = linux_nat_mourn_inferior;
-  linux_nat_ops.to_thread_alive = linux_nat_thread_alive;
-  linux_nat_ops.to_pid_to_str = linux_nat_pid_to_str;
-  linux_nat_ops.to_post_startup_inferior = child_post_startup_inferior;
-  linux_nat_ops.to_post_attach = child_post_attach;
-  linux_nat_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint;
-  linux_nat_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
-  linux_nat_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint;
-
-  linux_nat_ops.to_stratum = thread_stratum;
-  linux_nat_ops.to_has_thread_control = tc_schedlock;
-  linux_nat_ops.to_magic = OPS_MAGIC;
-}
-
-static void
-sigchld_handler (int signo)
-{
-  /* Do nothing.  The only reason for this handler is that it allows
-     us to use sigsuspend in linux_nat_wait above to wait for the
-     arrival of a SIGCHLD.  */
-}
-
-/* Accepts an integer PID; Returns a string representing a file that
-   can be opened to get the symbols for the child process.  */
-
-char *
-child_pid_to_exec_file (int pid)
-{
-  char *name1, *name2;
-
-  name1 = xmalloc (MAXPATHLEN);
-  name2 = xmalloc (MAXPATHLEN);
-  make_cleanup (xfree, name1);
-  make_cleanup (xfree, name2);
-  memset (name2, 0, MAXPATHLEN);
-
-  sprintf (name1, "/proc/%d/exe", pid);
-  if (readlink (name1, name2, MAXPATHLEN) > 0)
-    return name2;
-  else
-    return name1;
-}
-
-/* Service function for corefiles and info proc.  */
-
-static int
-read_mapping (FILE *mapfile,
-             long long *addr,
-             long long *endaddr,
-             char *permissions,
-             long long *offset,
-             char *device, long long *inode, char *filename)
-{
-  int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx",
-                   addr, endaddr, permissions, offset, device, inode);
-
-  if (ret > 0 && ret != EOF && *inode != 0)
-    {
-      /* Eat everything up to EOL for the filename.  This will prevent
-         weird filenames (such as one with embedded whitespace) from
-         confusing this code.  It also makes this code more robust in
-         respect to annotations the kernel may add after the filename.
-
-         Note the filename is used for informational purposes
-         only.  */
-      ret += fscanf (mapfile, "%[^\n]\n", filename);
-    }
-  else
-    {
-      filename[0] = '\0';      /* no filename */
-      fscanf (mapfile, "\n");
-    }
-  return (ret != 0 && ret != EOF);
-}
-
-/* Fills the "to_find_memory_regions" target vector.  Lists the memory
-   regions in the inferior for a corefile.  */
-
-static int
-linux_nat_find_memory_regions (int (*func) (CORE_ADDR,
-                                           unsigned long,
-                                           int, int, int, void *), void *obfd)
-{
-  long long pid = PIDGET (inferior_ptid);
-  char mapsfilename[MAXPATHLEN];
-  FILE *mapsfile;
-  long long addr, endaddr, size, offset, inode;
-  char permissions[8], device[8], filename[MAXPATHLEN];
-  int read, write, exec;
-  int ret;
-
-  /* Compose the filename for the /proc memory map, and open it.  */
-  sprintf (mapsfilename, "/proc/%lld/maps", pid);
-  if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
-    error ("Could not open %s\n", mapsfilename);
-
-  if (info_verbose)
-    fprintf_filtered (gdb_stdout,
-                     "Reading memory regions from %s\n", mapsfilename);
-
-  /* Now iterate until end-of-file.  */
-  while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0],
-                      &offset, &device[0], &inode, &filename[0]))
-    {
-      size = endaddr - addr;
-
-      /* Get the segment's permissions.  */
-      read = (strchr (permissions, 'r') != 0);
-      write = (strchr (permissions, 'w') != 0);
-      exec = (strchr (permissions, 'x') != 0);
-
-      if (info_verbose)
-       {
-         fprintf_filtered (gdb_stdout,
-                           "Save segment, %lld bytes at 0x%s (%c%c%c)",
-                           size, paddr_nz (addr),
-                           read ? 'r' : ' ',
-                           write ? 'w' : ' ', exec ? 'x' : ' ');
-         if (filename && filename[0])
-           fprintf_filtered (gdb_stdout, " for %s", filename);
-         fprintf_filtered (gdb_stdout, "\n");
-       }
-
-      /* Invoke the callback function to create the corefile
-        segment.  */
-      func (addr, size, read, write, exec, obfd);
-    }
-  fclose (mapsfile);
-  return 0;
-}
-
-/* Records the thread's register state for the corefile note
-   section.  */
-
-static char *
-linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
-                              char *note_data, int *note_size)
-{
-  gdb_gregset_t gregs;
-  gdb_fpregset_t fpregs;
-#ifdef FILL_FPXREGSET
-  gdb_fpxregset_t fpxregs;
-#endif
-  unsigned long lwp = ptid_get_lwp (ptid);
-
-  fill_gregset (&gregs, -1);
-  note_data = (char *) elfcore_write_prstatus (obfd,
-                                              note_data,
-                                              note_size,
-                                              lwp,
-                                              stop_signal, &gregs);
-
-  fill_fpregset (&fpregs, -1);
-  note_data = (char *) elfcore_write_prfpreg (obfd,
-                                             note_data,
-                                             note_size,
-                                             &fpregs, sizeof (fpregs));
-#ifdef FILL_FPXREGSET
-  fill_fpxregset (&fpxregs, -1);
-  note_data = (char *) elfcore_write_prxfpreg (obfd,
-                                              note_data,
-                                              note_size,
-                                              &fpxregs, sizeof (fpxregs));
-#endif
-  return note_data;
-}
-
-struct linux_nat_corefile_thread_data
-{
-  bfd *obfd;
-  char *note_data;
-  int *note_size;
-  int num_notes;
-};
-
-/* Called by gdbthread.c once per thread.  Records the thread's
-   register state for the corefile note section.  */
-
-static int
-linux_nat_corefile_thread_callback (struct lwp_info *ti, void *data)
-{
-  struct linux_nat_corefile_thread_data *args = data;
-  ptid_t saved_ptid = inferior_ptid;
-
-  inferior_ptid = ti->ptid;
-  registers_changed ();
-  target_fetch_registers (-1); /* FIXME should not be necessary;
-                                  fill_gregset should do it automatically. */
-  args->note_data = linux_nat_do_thread_registers (args->obfd,
-                                                  ti->ptid,
-                                                  args->note_data,
-                                                  args->note_size);
-  args->num_notes++;
-  inferior_ptid = saved_ptid;
-  registers_changed ();
-  target_fetch_registers (-1); /* FIXME should not be necessary;
-                                  fill_gregset should do it automatically. */
-  return 0;
-}
-
-/* Records the register state for the corefile note section.  */
-
-static char *
-linux_nat_do_registers (bfd *obfd, ptid_t ptid,
-                       char *note_data, int *note_size)
-{
-  registers_changed ();
-  target_fetch_registers (-1); /* FIXME should not be necessary;
-                                  fill_gregset should do it automatically. */
-  return linux_nat_do_thread_registers (obfd,
-                                       ptid_build (ptid_get_pid (inferior_ptid),
-                                                   ptid_get_pid (inferior_ptid),
-                                                   0),
-                                       note_data, note_size);
-  return note_data;
-}
-
-/* Fills the "to_make_corefile_note" target vector.  Builds the note
-   section for a corefile, and returns it in a malloc buffer.  */
-
-static char *
-linux_nat_make_corefile_notes (bfd *obfd, int *note_size)
-{
-  struct linux_nat_corefile_thread_data thread_args;
-  struct cleanup *old_chain;
-  char fname[16] = { '\0' };
-  char psargs[80] = { '\0' };
-  char *note_data = NULL;
-  ptid_t current_ptid = inferior_ptid;
-  char *auxv;
-  int auxv_len;
-
-  if (get_exec_file (0))
-    {
-      strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname));
-      strncpy (psargs, get_exec_file (0), sizeof (psargs));
-      if (get_inferior_args ())
-       {
-         strncat (psargs, " ", sizeof (psargs) - strlen (psargs));
-         strncat (psargs, get_inferior_args (),
-                  sizeof (psargs) - strlen (psargs));
-       }
-      note_data = (char *) elfcore_write_prpsinfo (obfd,
-                                                  note_data,
-                                                  note_size, fname, psargs);
-    }
-
-  /* Dump information for threads.  */
-  thread_args.obfd = obfd;
-  thread_args.note_data = note_data;
-  thread_args.note_size = note_size;
-  thread_args.num_notes = 0;
-  iterate_over_lwps (linux_nat_corefile_thread_callback, &thread_args);
-  if (thread_args.num_notes == 0)
-    {
-      /* iterate_over_threads didn't come up with any threads; just
-         use inferior_ptid.  */
-      note_data = linux_nat_do_registers (obfd, inferior_ptid,
-                                         note_data, note_size);
-    }
-  else
-    {
-      note_data = thread_args.note_data;
-    }
-
-  auxv_len = target_auxv_read (&current_target, &auxv);
-  if (auxv_len > 0)
-    {
-      note_data = elfcore_write_note (obfd, note_data, note_size,
-                                     "CORE", NT_AUXV, auxv, auxv_len);
-      xfree (auxv);
-    }
-
-  make_cleanup (xfree, note_data);
-  return note_data;
-}
-
-/* Implement the "info proc" command.  */
-
-static void
-linux_nat_info_proc_cmd (char *args, int from_tty)
-{
-  long long pid = PIDGET (inferior_ptid);
-  FILE *procfile;
-  char **argv = NULL;
-  char buffer[MAXPATHLEN];
-  char fname1[MAXPATHLEN], fname2[MAXPATHLEN];
-  int cmdline_f = 1;
-  int cwd_f = 1;
-  int exe_f = 1;
-  int mappings_f = 0;
-  int environ_f = 0;
-  int status_f = 0;
-  int stat_f = 0;
-  int all = 0;
-  struct stat dummy;
-
-  if (args)
-    {
-      /* Break up 'args' into an argv array.  */
-      if ((argv = buildargv (args)) == NULL)
-       nomem (0);
-      else
-       make_cleanup_freeargv (argv);
-    }
-  while (argv != NULL && *argv != NULL)
-    {
-      if (isdigit (argv[0][0]))
-       {
-         pid = strtoul (argv[0], NULL, 10);
-       }
-      else if (strncmp (argv[0], "mappings", strlen (argv[0])) == 0)
-       {
-         mappings_f = 1;
-       }
-      else if (strcmp (argv[0], "status") == 0)
-       {
-         status_f = 1;
-       }
-      else if (strcmp (argv[0], "stat") == 0)
-       {
-         stat_f = 1;
-       }
-      else if (strcmp (argv[0], "cmd") == 0)
-       {
-         cmdline_f = 1;
-       }
-      else if (strncmp (argv[0], "exe", strlen (argv[0])) == 0)
-       {
-         exe_f = 1;
-       }
-      else if (strcmp (argv[0], "cwd") == 0)
-       {
-         cwd_f = 1;
-       }
-      else if (strncmp (argv[0], "all", strlen (argv[0])) == 0)
-       {
-         all = 1;
-       }
-      else
-       {
-         /* [...] (future options here) */
-       }
-      argv++;
-    }
-  if (pid == 0)
-    error ("No current process: you must name one.");
-
-  sprintf (fname1, "/proc/%lld", pid);
-  if (stat (fname1, &dummy) != 0)
-    error ("No /proc directory: '%s'", fname1);
-
-  printf_filtered ("process %lld\n", pid);
-  if (cmdline_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/cmdline", pid);
-      if ((procfile = fopen (fname1, "r")) > 0)
-       {
-         fgets (buffer, sizeof (buffer), procfile);
-         printf_filtered ("cmdline = '%s'\n", buffer);
-         fclose (procfile);
-       }
-      else
-       warning ("unable to open /proc file '%s'", fname1);
-    }
-  if (cwd_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/cwd", pid);
-      memset (fname2, 0, sizeof (fname2));
-      if (readlink (fname1, fname2, sizeof (fname2)) > 0)
-       printf_filtered ("cwd = '%s'\n", fname2);
-      else
-       warning ("unable to read link '%s'", fname1);
-    }
-  if (exe_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/exe", pid);
-      memset (fname2, 0, sizeof (fname2));
-      if (readlink (fname1, fname2, sizeof (fname2)) > 0)
-       printf_filtered ("exe = '%s'\n", fname2);
-      else
-       warning ("unable to read link '%s'", fname1);
-    }
-  if (mappings_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/maps", pid);
-      if ((procfile = fopen (fname1, "r")) > 0)
-       {
-         long long addr, endaddr, size, offset, inode;
-         char permissions[8], device[8], filename[MAXPATHLEN];
-
-         printf_filtered ("Mapped address spaces:\n\n");
-         if (TARGET_ADDR_BIT == 32)
-           {
-             printf_filtered ("\t%10s %10s %10s %10s %7s\n",
-                          "Start Addr",
-                          "  End Addr",
-                          "      Size", "    Offset", "objfile");
-            }
-         else
-            {
-             printf_filtered ("  %18s %18s %10s %10s %7s\n",
-                          "Start Addr",
-                          "  End Addr",
-                          "      Size", "    Offset", "objfile");
-           }
-
-         while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
-                              &offset, &device[0], &inode, &filename[0]))
-           {
-             size = endaddr - addr;
-
-             /* FIXME: carlton/2003-08-27: Maybe the printf_filtered
-                calls here (and possibly above) should be abstracted
-                out into their own functions?  Andrew suggests using
-                a generic local_address_string instead to print out
-                the addresses; that makes sense to me, too.  */
-
-             if (TARGET_ADDR_BIT == 32)
-               {
-                 printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
-                              (unsigned long) addr,    /* FIXME: pr_addr */
-                              (unsigned long) endaddr,
-                              (int) size,
-                              (unsigned int) offset,
-                              filename[0] ? filename : "");
-               }
-             else
-               {
-                 printf_filtered ("  %#18lx %#18lx %#10x %#10x %7s\n",
-                              (unsigned long) addr,    /* FIXME: pr_addr */
-                              (unsigned long) endaddr,
-                              (int) size,
-                              (unsigned int) offset,
-                              filename[0] ? filename : "");
-               }
-           }
-
-         fclose (procfile);
-       }
-      else
-       warning ("unable to open /proc file '%s'", fname1);
-    }
-  if (status_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/status", pid);
-      if ((procfile = fopen (fname1, "r")) > 0)
-       {
-         while (fgets (buffer, sizeof (buffer), procfile) != NULL)
-           puts_filtered (buffer);
-         fclose (procfile);
-       }
-      else
-       warning ("unable to open /proc file '%s'", fname1);
-    }
-  if (stat_f || all)
-    {
-      sprintf (fname1, "/proc/%lld/stat", pid);
-      if ((procfile = fopen (fname1, "r")) > 0)
-       {
-         int itmp;
-         char ctmp;
-
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Process: %d\n", itmp);
-         if (fscanf (procfile, "%s ", &buffer[0]) > 0)
-           printf_filtered ("Exec file: %s\n", buffer);
-         if (fscanf (procfile, "%c ", &ctmp) > 0)
-           printf_filtered ("State: %c\n", ctmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Parent process: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Process group: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Session id: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("TTY: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("TTY owner process group: %d\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Flags: 0x%x\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Minor faults (no memory page): %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Minor faults, children: %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Major faults (memory page faults): %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Major faults, children: %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("utime: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("stime: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("utime, children: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("stime, children: %d\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("jiffies remaining in current time slice: %d\n",
-                            itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("'nice' value: %d\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("jiffies until next timeout: %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("jiffies until next SIGALRM: %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("start time (jiffies since system boot): %d\n",
-                            itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Virtual memory size: %u\n",
-                            (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Resident set size: %u\n", (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("rlim: %u\n", (unsigned int) itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Start of text: 0x%x\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("End of text: 0x%x\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)
-           printf_filtered ("Start of stack: 0x%x\n", itmp);
-#if 0                          /* Don't know how architecture-dependent the rest is...
-                                  Anyway the signal bitmap info is available from "status".  */
-         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
-           printf_filtered ("Kernel stack pointer: 0x%x\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
-           printf_filtered ("Kernel instr pointer: 0x%x\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Pending signals bitmap: 0x%x\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Blocked signals bitmap: 0x%x\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Ignored signals bitmap: 0x%x\n", itmp);
-         if (fscanf (procfile, "%d ", &itmp) > 0)
-           printf_filtered ("Catched signals bitmap: 0x%x\n", itmp);
-         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
-           printf_filtered ("wchan (system call): 0x%x\n", itmp);
-#endif
-         fclose (procfile);
-       }
-      else
-       warning ("unable to open /proc file '%s'", fname1);
-    }
-}
-
-int
-linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write,
-                       struct mem_attrib *attrib, struct target_ops *target)
-{
-  int fd, ret;
-  char filename[64];
-
-  if (write)
-    return 0;
-
-  /* Don't bother for one word.  */
-  if (len < 3 * sizeof (long))
-    return 0;
-
-  /* We could keep this file open and cache it - possibly one per
-     thread.  That requires some juggling, but is even faster.  */
-  sprintf (filename, "/proc/%d/mem", PIDGET (inferior_ptid));
-  fd = open (filename, O_RDONLY | O_LARGEFILE);
-  if (fd == -1)
-    return 0;
-
-  /* If pread64 is available, use it.  It's faster if the kernel
-     supports it (only one syscall), and it's 64-bit safe even on
-     32-bit platforms (for instance, SPARC debugging a SPARC64
-     application).  */
-#ifdef HAVE_PREAD64
-  if (pread64 (fd, myaddr, len, addr) != len)
-#else
-  if (lseek (fd, addr, SEEK_SET) == -1 || read (fd, myaddr, len) != len)
-#endif
-    ret = 0;
-  else
-    ret = len;
-
-  close (fd);
-  return ret;
-}
-
-/* Parse LINE as a signal set and add its set bits to SIGS.  */
-
-static void
-add_line_to_sigset (const char *line, sigset_t *sigs)
-{
-  int len = strlen (line) - 1;
-  const char *p;
-  int signum;
-
-  if (line[len] != '\n')
-    error ("Could not parse signal set: %s", line);
-
-  p = line;
-  signum = len * 4;
-  while (len-- > 0)
-    {
-      int digit;
-
-      if (*p >= '0' && *p <= '9')
-       digit = *p - '0';
-      else if (*p >= 'a' && *p <= 'f')
-       digit = *p - 'a' + 10;
-      else
-       error ("Could not parse signal set: %s", line);
-
-      signum -= 4;
-
-      if (digit & 1)
-       sigaddset (sigs, signum + 1);
-      if (digit & 2)
-       sigaddset (sigs, signum + 2);
-      if (digit & 4)
-       sigaddset (sigs, signum + 3);
-      if (digit & 8)
-       sigaddset (sigs, signum + 4);
-
-      p++;
-    }
-}
-
-/* Find process PID's pending signals from /proc/pid/status and set
-   SIGS to match.  */
-
-void
-linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored)
-{
-  FILE *procfile;
-  char buffer[MAXPATHLEN], fname[MAXPATHLEN];
-  int signum;
-
-  sigemptyset (pending);
-  sigemptyset (blocked);
-  sigemptyset (ignored);
-  sprintf (fname, "/proc/%d/status", pid);
-  procfile = fopen (fname, "r");
-  if (procfile == NULL)
-    error ("Could not open %s", fname);
-
-  while (fgets (buffer, MAXPATHLEN, procfile) != NULL)
-    {
-      /* Normal queued signals are on the SigPnd line in the status
-        file.  However, 2.6 kernels also have a "shared" pending
-        queue for delivering signals to a thread group, so check for
-        a ShdPnd line also.
-
-        Unfortunately some Red Hat kernels include the shared pending
-        queue but not the ShdPnd status field.  */
-
-      if (strncmp (buffer, "SigPnd:\t", 8) == 0)
-       add_line_to_sigset (buffer + 8, pending);
-      else if (strncmp (buffer, "ShdPnd:\t", 8) == 0)
-       add_line_to_sigset (buffer + 8, pending);
-      else if (strncmp (buffer, "SigBlk:\t", 8) == 0)
-       add_line_to_sigset (buffer + 8, blocked);
-      else if (strncmp (buffer, "SigIgn:\t", 8) == 0)
-       add_line_to_sigset (buffer + 8, ignored);
-    }
-
-  fclose (procfile);
-}
-
-void
-_initialize_linux_nat (void)
-{
-  struct sigaction action;
-  extern void thread_db_init (struct target_ops *);
-
-  deprecated_child_ops.to_find_memory_regions = linux_nat_find_memory_regions;
-  deprecated_child_ops.to_make_corefile_notes = linux_nat_make_corefile_notes;
-
-  add_info ("proc", linux_nat_info_proc_cmd,
-           "Show /proc process information about any running process.\n\
-Specify any process id, or use the program being debugged by default.\n\
-Specify any of the following keywords for detailed info:\n\
-  mappings -- list of mapped memory regions.\n\
-  stat     -- list a bunch of random process info.\n\
-  status   -- list a different bunch of random process info.\n\
-  all      -- list all available /proc info.");
-
-  init_linux_nat_ops ();
-  add_target (&linux_nat_ops);
-  thread_db_init (&linux_nat_ops);
-
-  /* Save the original signal mask.  */
-  sigprocmask (SIG_SETMASK, NULL, &normal_mask);
-
-  action.sa_handler = sigchld_handler;
-  sigemptyset (&action.sa_mask);
-  action.sa_flags = 0;
-  sigaction (SIGCHLD, &action, NULL);
-
-  /* Make sure we don't block SIGCHLD during a sigsuspend.  */
-  sigprocmask (SIG_SETMASK, NULL, &suspend_mask);
-  sigdelset (&suspend_mask, SIGCHLD);
-
-  sigemptyset (&blocked_mask);
-
-  deprecated_add_show_from_set
-    (add_set_cmd ("lin-lwp", no_class, var_zinteger,
-                 (char *) &debug_linux_nat,
-                 "Set debugging of GNU/Linux lwp module.\n\
-Enables printf debugging output.\n", &setdebuglist), &showdebuglist);
-}
-\f
-
-/* FIXME: kettenis/2000-08-26: The stuff on this page is specific to
-   the GNU/Linux Threads library and therefore doesn't really belong
-   here.  */
-
-/* Read variable NAME in the target and return its value if found.
-   Otherwise return zero.  It is assumed that the type of the variable
-   is `int'.  */
-
-static int
-get_signo (const char *name)
-{
-  struct minimal_symbol *ms;
-  int signo;
-
-  ms = lookup_minimal_symbol (name, NULL, NULL);
-  if (ms == NULL)
-    return 0;
-
-  if (target_read_memory (SYMBOL_VALUE_ADDRESS (ms), (char *) &signo,
-                         sizeof (signo)) != 0)
-    return 0;
-
-  return signo;
-}
-
-/* Return the set of signals used by the threads library in *SET.  */
-
-void
-lin_thread_get_thread_signals (sigset_t *set)
-{
-  struct sigaction action;
-  int restart, cancel;
-
-  sigemptyset (set);
-
-  restart = get_signo ("__pthread_sig_restart");
-  if (restart == 0)
-    return;
-
-  cancel = get_signo ("__pthread_sig_cancel");
-  if (cancel == 0)
-    return;
-
-  sigaddset (set, restart);
-  sigaddset (set, cancel);
-
-  /* The GNU/Linux Threads library makes terminating threads send a
-     special "cancel" signal instead of SIGCHLD.  Make sure we catch
-     those (to prevent them from terminating GDB itself, which is
-     likely to be their default action) and treat them the same way as
-     SIGCHLD.  */
-
-  action.sa_handler = sigchld_handler;
-  sigemptyset (&action.sa_mask);
-  action.sa_flags = 0;
-  sigaction (cancel, &action, NULL);
-
-  /* We block the "cancel" signal throughout this code ...  */
-  sigaddset (&blocked_mask, cancel);
-  sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
-
-  /* ... except during a sigsuspend.  */
-  sigdelset (&suspend_mask, cancel);
-}
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
new file mode 100644 (file)
index 0000000..0a77459
--- /dev/null
@@ -0,0 +1,737 @@
+/* GNU/Linux specific methods for using the /proc file system.
+
+   Copyright 2001, 2002 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include <sys/param.h>         /* for MAXPATHLEN */
+#include <sys/procfs.h>                /* for elf_gregset etc. */
+#include "gdb_stat.h"          /* for struct stat */
+#include <ctype.h>             /* for isdigit */
+#include <unistd.h>            /* for open, pread64 */
+#include <fcntl.h>             /* for O_RDONLY */
+#include "regcache.h"          /* for registers_changed */
+#include "gregset.h"           /* for gregset */
+#include "gdbcore.h"           /* for get_exec_file */
+#include "gdbthread.h"         /* for struct thread_info etc. */
+#include "elf-bfd.h"           /* for elfcore_write_* */
+#include "cli/cli-decode.h"    /* for add_info */
+#include "gdb_string.h"
+
+#include <signal.h>
+
+#include "linux-nat.h"
+
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+/* Function: child_pid_to_exec_file
+ *
+ * Accepts an integer pid
+ * Returns a string representing a file that can be opened
+ * to get the symbols for the child process.
+ */
+
+char *
+child_pid_to_exec_file (int pid)
+{
+  char *name1, *name2;
+
+  name1 = xmalloc (MAXPATHLEN);
+  name2 = xmalloc (MAXPATHLEN);
+  make_cleanup (xfree, name1);
+  make_cleanup (xfree, name2);
+  memset (name2, 0, MAXPATHLEN);
+
+  sprintf (name1, "/proc/%d/exe", pid);
+  if (readlink (name1, name2, MAXPATHLEN) > 0)
+    return name2;
+  else
+    return name1;
+}
+
+/* Function: read_mappings
+ *
+ * Service function for corefiles and info proc.
+ */
+
+static int
+read_mapping (FILE *mapfile,
+             long long *addr,
+             long long *endaddr,
+             char *permissions,
+             long long *offset,
+             char *device, long long *inode, char *filename)
+{
+  int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx",
+                   addr, endaddr, permissions, offset, device, inode);
+
+  if (ret > 0 && ret != EOF && *inode != 0)
+    {
+      /* Eat everything up to EOL for the filename.  This will prevent
+         weird filenames (such as one with embedded whitespace) from
+         confusing this code.  It also makes this code more robust
+         in respect to annotations the kernel may add after the
+         filename.
+
+         Note the filename is used for informational purposes only.  */
+      ret += fscanf (mapfile, "%[^\n]\n", filename);
+    }
+  else
+    {
+      filename[0] = '\0';      /* no filename */
+      fscanf (mapfile, "\n");
+    }
+  return (ret != 0 && ret != EOF);
+}
+
+/* Function: linux_find_memory_regions
+ *
+ * Fills the "to_find_memory_regions" target vector.
+ * Lists the memory regions in the inferior for a corefile.
+ */
+
+static int
+linux_find_memory_regions (int (*func) (CORE_ADDR,
+                                       unsigned long,
+                                       int, int, int, void *), void *obfd)
+{
+  long long pid = PIDGET (inferior_ptid);
+  char mapsfilename[MAXPATHLEN];
+  FILE *mapsfile;
+  long long addr, endaddr, size, offset, inode;
+  char permissions[8], device[8], filename[MAXPATHLEN];
+  int read, write, exec;
+  int ret;
+
+  /* Compose the filename for the /proc memory map, and open it. */
+  sprintf (mapsfilename, "/proc/%lld/maps", pid);
+  if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
+    error ("Could not open %s\n", mapsfilename);
+
+  if (info_verbose)
+    fprintf_filtered (gdb_stdout,
+                     "Reading memory regions from %s\n", mapsfilename);
+
+  /* Now iterate until end-of-file. */
+  while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0],
+                      &offset, &device[0], &inode, &filename[0]))
+    {
+      size = endaddr - addr;
+
+      /* Get the segment's permissions.  */
+      read = (strchr (permissions, 'r') != 0);
+      write = (strchr (permissions, 'w') != 0);
+      exec = (strchr (permissions, 'x') != 0);
+
+      if (info_verbose)
+       {
+         fprintf_filtered (gdb_stdout,
+                           "Save segment, %lld bytes at 0x%s (%c%c%c)",
+                           size, paddr_nz (addr),
+                           read ? 'r' : ' ',
+                           write ? 'w' : ' ', exec ? 'x' : ' ');
+         if (filename && filename[0])
+           fprintf_filtered (gdb_stdout, " for %s", filename);
+         fprintf_filtered (gdb_stdout, "\n");
+       }
+
+      /* Invoke the callback function to create the corefile segment. */
+      func (addr, size, read, write, exec, obfd);
+    }
+  fclose (mapsfile);
+  return 0;
+}
+
+/* Function: linux_do_thread_registers
+ *
+ * Records the thread's register state for the corefile note section.
+ */
+
+static char *
+linux_do_thread_registers (bfd *obfd, ptid_t ptid,
+                          char *note_data, int *note_size)
+{
+  gdb_gregset_t gregs;
+  gdb_fpregset_t fpregs;
+#ifdef FILL_FPXREGSET
+  gdb_fpxregset_t fpxregs;
+#endif
+  unsigned long lwp = ptid_get_lwp (ptid);
+
+  fill_gregset (&gregs, -1);
+  note_data = (char *) elfcore_write_prstatus (obfd,
+                                              note_data,
+                                              note_size,
+                                              lwp,
+                                              stop_signal, &gregs);
+
+  fill_fpregset (&fpregs, -1);
+  note_data = (char *) elfcore_write_prfpreg (obfd,
+                                             note_data,
+                                             note_size,
+                                             &fpregs, sizeof (fpregs));
+#ifdef FILL_FPXREGSET
+  fill_fpxregset (&fpxregs, -1);
+  note_data = (char *) elfcore_write_prxfpreg (obfd,
+                                              note_data,
+                                              note_size,
+                                              &fpxregs, sizeof (fpxregs));
+#endif
+  return note_data;
+}
+
+struct linux_corefile_thread_data
+{
+  bfd *obfd;
+  char *note_data;
+  int *note_size;
+  int num_notes;
+};
+
+/* Function: linux_corefile_thread_callback
+ *
+ * Called by gdbthread.c once per thread.
+ * Records the thread's register state for the corefile note section.
+ */
+
+static int
+linux_corefile_thread_callback (struct lwp_info *ti, void *data)
+{
+  struct linux_corefile_thread_data *args = data;
+  ptid_t saved_ptid = inferior_ptid;
+
+  inferior_ptid = ti->ptid;
+  registers_changed ();
+  target_fetch_registers (-1); /* FIXME should not be necessary;
+                                  fill_gregset should do it automatically. */
+  args->note_data = linux_do_thread_registers (args->obfd,
+                                              ti->ptid,
+                                              args->note_data,
+                                              args->note_size);
+  args->num_notes++;
+  inferior_ptid = saved_ptid;
+  registers_changed ();
+  target_fetch_registers (-1); /* FIXME should not be necessary;
+                                  fill_gregset should do it automatically. */
+  return 0;
+}
+
+/* Function: linux_do_registers
+ *
+ * Records the register state for the corefile note section.
+ */
+
+static char *
+linux_do_registers (bfd *obfd, ptid_t ptid,
+                   char *note_data, int *note_size)
+{
+  registers_changed ();
+  target_fetch_registers (-1); /* FIXME should not be necessary;
+                                  fill_gregset should do it automatically. */
+  return linux_do_thread_registers (obfd,
+                                   ptid_build (ptid_get_pid (inferior_ptid),
+                                               ptid_get_pid (inferior_ptid),
+                                               0),
+                                   note_data, note_size);
+  return note_data;
+}
+
+/* Function: linux_make_note_section
+ *
+ * Fills the "to_make_corefile_note" target vector.
+ * Builds the note section for a corefile, and returns it
+ * in a malloc buffer.
+ */
+
+static char *
+linux_make_note_section (bfd *obfd, int *note_size)
+{
+  struct linux_corefile_thread_data thread_args;
+  struct cleanup *old_chain;
+  char fname[16] = { '\0' };
+  char psargs[80] = { '\0' };
+  char *note_data = NULL;
+  ptid_t current_ptid = inferior_ptid;
+  char *auxv;
+  int auxv_len;
+
+  if (get_exec_file (0))
+    {
+      strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname));
+      strncpy (psargs, get_exec_file (0), sizeof (psargs));
+      if (get_inferior_args ())
+       {
+         strncat (psargs, " ", sizeof (psargs) - strlen (psargs));
+         strncat (psargs, get_inferior_args (),
+                  sizeof (psargs) - strlen (psargs));
+       }
+      note_data = (char *) elfcore_write_prpsinfo (obfd,
+                                                  note_data,
+                                                  note_size, fname, psargs);
+    }
+
+  /* Dump information for threads.  */
+  thread_args.obfd = obfd;
+  thread_args.note_data = note_data;
+  thread_args.note_size = note_size;
+  thread_args.num_notes = 0;
+  iterate_over_lwps (linux_corefile_thread_callback, &thread_args);
+  if (thread_args.num_notes == 0)
+    {
+      /* iterate_over_threads didn't come up with any threads;
+         just use inferior_ptid.  */
+      note_data = linux_do_registers (obfd, inferior_ptid,
+                                     note_data, note_size);
+    }
+  else
+    {
+      note_data = thread_args.note_data;
+    }
+
+  auxv_len = target_auxv_read (&current_target, &auxv);
+  if (auxv_len > 0)
+    {
+      note_data = elfcore_write_note (obfd, note_data, note_size,
+                                     "CORE", NT_AUXV, auxv, auxv_len);
+      xfree (auxv);
+    }
+
+  make_cleanup (xfree, note_data);
+  return note_data;
+}
+
+/*
+ * Function: linux_info_proc_cmd
+ *
+ * Implement the "info proc" command.
+ */
+
+static void
+linux_info_proc_cmd (char *args, int from_tty)
+{
+  long long pid = PIDGET (inferior_ptid);
+  FILE *procfile;
+  char **argv = NULL;
+  char buffer[MAXPATHLEN];
+  char fname1[MAXPATHLEN], fname2[MAXPATHLEN];
+  int cmdline_f = 1;
+  int cwd_f = 1;
+  int exe_f = 1;
+  int mappings_f = 0;
+  int environ_f = 0;
+  int status_f = 0;
+  int stat_f = 0;
+  int all = 0;
+  struct stat dummy;
+
+  if (args)
+    {
+      /* Break up 'args' into an argv array. */
+      if ((argv = buildargv (args)) == NULL)
+       nomem (0);
+      else
+       make_cleanup_freeargv (argv);
+    }
+  while (argv != NULL && *argv != NULL)
+    {
+      if (isdigit (argv[0][0]))
+       {
+         pid = strtoul (argv[0], NULL, 10);
+       }
+      else if (strncmp (argv[0], "mappings", strlen (argv[0])) == 0)
+       {
+         mappings_f = 1;
+       }
+      else if (strcmp (argv[0], "status") == 0)
+       {
+         status_f = 1;
+       }
+      else if (strcmp (argv[0], "stat") == 0)
+       {
+         stat_f = 1;
+       }
+      else if (strcmp (argv[0], "cmd") == 0)
+       {
+         cmdline_f = 1;
+       }
+      else if (strncmp (argv[0], "exe", strlen (argv[0])) == 0)
+       {
+         exe_f = 1;
+       }
+      else if (strcmp (argv[0], "cwd") == 0)
+       {
+         cwd_f = 1;
+       }
+      else if (strncmp (argv[0], "all", strlen (argv[0])) == 0)
+       {
+         all = 1;
+       }
+      else
+       {
+         /* [...] (future options here) */
+       }
+      argv++;
+    }
+  if (pid == 0)
+    error ("No current process: you must name one.");
+
+  sprintf (fname1, "/proc/%lld", pid);
+  if (stat (fname1, &dummy) != 0)
+    error ("No /proc directory: '%s'", fname1);
+
+  printf_filtered ("process %lld\n", pid);
+  if (cmdline_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/cmdline", pid);
+      if ((procfile = fopen (fname1, "r")) > 0)
+       {
+         fgets (buffer, sizeof (buffer), procfile);
+         printf_filtered ("cmdline = '%s'\n", buffer);
+         fclose (procfile);
+       }
+      else
+       warning ("unable to open /proc file '%s'", fname1);
+    }
+  if (cwd_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/cwd", pid);
+      memset (fname2, 0, sizeof (fname2));
+      if (readlink (fname1, fname2, sizeof (fname2)) > 0)
+       printf_filtered ("cwd = '%s'\n", fname2);
+      else
+       warning ("unable to read link '%s'", fname1);
+    }
+  if (exe_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/exe", pid);
+      memset (fname2, 0, sizeof (fname2));
+      if (readlink (fname1, fname2, sizeof (fname2)) > 0)
+       printf_filtered ("exe = '%s'\n", fname2);
+      else
+       warning ("unable to read link '%s'", fname1);
+    }
+  if (mappings_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/maps", pid);
+      if ((procfile = fopen (fname1, "r")) > 0)
+       {
+         long long addr, endaddr, size, offset, inode;
+         char permissions[8], device[8], filename[MAXPATHLEN];
+
+         printf_filtered ("Mapped address spaces:\n\n");
+         if (TARGET_ADDR_BIT == 32)
+           {
+             printf_filtered ("\t%10s %10s %10s %10s %7s\n",
+                          "Start Addr",
+                          "  End Addr",
+                          "      Size", "    Offset", "objfile");
+            }
+         else
+            {
+             printf_filtered ("  %18s %18s %10s %10s %7s\n",
+                          "Start Addr",
+                          "  End Addr",
+                          "      Size", "    Offset", "objfile");
+           }
+
+         while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
+                              &offset, &device[0], &inode, &filename[0]))
+           {
+             size = endaddr - addr;
+
+             /* FIXME: carlton/2003-08-27: Maybe the printf_filtered
+                calls here (and possibly above) should be abstracted
+                out into their own functions?  Andrew suggests using
+                a generic local_address_string instead to print out
+                the addresses; that makes sense to me, too.  */
+
+             if (TARGET_ADDR_BIT == 32)
+               {
+                 printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+                              (unsigned long) addr,    /* FIXME: pr_addr */
+                              (unsigned long) endaddr,
+                              (int) size,
+                              (unsigned int) offset,
+                              filename[0] ? filename : "");
+               }
+             else
+               {
+                 printf_filtered ("  %#18lx %#18lx %#10x %#10x %7s\n",
+                              (unsigned long) addr,    /* FIXME: pr_addr */
+                              (unsigned long) endaddr,
+                              (int) size,
+                              (unsigned int) offset,
+                              filename[0] ? filename : "");
+               }
+           }
+
+         fclose (procfile);
+       }
+      else
+       warning ("unable to open /proc file '%s'", fname1);
+    }
+  if (status_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/status", pid);
+      if ((procfile = fopen (fname1, "r")) > 0)
+       {
+         while (fgets (buffer, sizeof (buffer), procfile) != NULL)
+           puts_filtered (buffer);
+         fclose (procfile);
+       }
+      else
+       warning ("unable to open /proc file '%s'", fname1);
+    }
+  if (stat_f || all)
+    {
+      sprintf (fname1, "/proc/%lld/stat", pid);
+      if ((procfile = fopen (fname1, "r")) > 0)
+       {
+         int itmp;
+         char ctmp;
+
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Process: %d\n", itmp);
+         if (fscanf (procfile, "%s ", &buffer[0]) > 0)
+           printf_filtered ("Exec file: %s\n", buffer);
+         if (fscanf (procfile, "%c ", &ctmp) > 0)
+           printf_filtered ("State: %c\n", ctmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Parent process: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Process group: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Session id: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("TTY: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("TTY owner process group: %d\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Flags: 0x%x\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Minor faults (no memory page): %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Minor faults, children: %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Major faults (memory page faults): %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Major faults, children: %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("utime: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("stime: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("utime, children: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("stime, children: %d\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("jiffies remaining in current time slice: %d\n",
+                            itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("'nice' value: %d\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("jiffies until next timeout: %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("jiffies until next SIGALRM: %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("start time (jiffies since system boot): %d\n",
+                            itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Virtual memory size: %u\n",
+                            (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Resident set size: %u\n", (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("rlim: %u\n", (unsigned int) itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Start of text: 0x%x\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("End of text: 0x%x\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)
+           printf_filtered ("Start of stack: 0x%x\n", itmp);
+#if 0                          /* Don't know how architecture-dependent the rest is...
+                                  Anyway the signal bitmap info is available from "status".  */
+         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
+           printf_filtered ("Kernel stack pointer: 0x%x\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
+           printf_filtered ("Kernel instr pointer: 0x%x\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Pending signals bitmap: 0x%x\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Blocked signals bitmap: 0x%x\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Ignored signals bitmap: 0x%x\n", itmp);
+         if (fscanf (procfile, "%d ", &itmp) > 0)
+           printf_filtered ("Catched signals bitmap: 0x%x\n", itmp);
+         if (fscanf (procfile, "%u ", &itmp) > 0)      /* FIXME arch? */
+           printf_filtered ("wchan (system call): 0x%x\n", itmp);
+#endif
+         fclose (procfile);
+       }
+      else
+       warning ("unable to open /proc file '%s'", fname1);
+    }
+}
+
+void
+_initialize_linux_proc (void)
+{
+  extern void inftarg_set_find_memory_regions ();
+  extern void inftarg_set_make_corefile_notes ();
+
+  inftarg_set_find_memory_regions (linux_find_memory_regions);
+  inftarg_set_make_corefile_notes (linux_make_note_section);
+
+  add_info ("proc", linux_info_proc_cmd,
+           "Show /proc process information about any running process.\n\
+Specify any process id, or use the program being debugged by default.\n\
+Specify any of the following keywords for detailed info:\n\
+  mappings -- list of mapped memory regions.\n\
+  stat     -- list a bunch of random process info.\n\
+  status   -- list a different bunch of random process info.\n\
+  all      -- list all available /proc info.");
+}
+
+int
+linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write,
+                       struct mem_attrib *attrib, struct target_ops *target)
+{
+  int fd, ret;
+  char filename[64];
+
+  if (write)
+    return 0;
+
+  /* Don't bother for one word.  */
+  if (len < 3 * sizeof (long))
+    return 0;
+
+  /* We could keep this file open and cache it - possibly one
+     per thread.  That requires some juggling, but is even faster.  */
+  sprintf (filename, "/proc/%d/mem", PIDGET (inferior_ptid));
+  fd = open (filename, O_RDONLY | O_LARGEFILE);
+  if (fd == -1)
+    return 0;
+
+  /* If pread64 is available, use it.  It's faster if the kernel
+     supports it (only one syscall), and it's 64-bit safe even
+     on 32-bit platforms (for instance, SPARC debugging a SPARC64
+     application).  */
+#ifdef HAVE_PREAD64
+  if (pread64 (fd, myaddr, len, addr) != len)
+#else
+  if (lseek (fd, addr, SEEK_SET) == -1 || read (fd, myaddr, len) != len)
+#endif
+    ret = 0;
+  else
+    ret = len;
+
+  close (fd);
+  return ret;
+}
+
+/* Parse LINE as a signal set and add its set bits to SIGS.  */
+
+static void
+linux_proc_add_line_to_sigset (const char *line, sigset_t *sigs)
+{
+  int len = strlen (line) - 1;
+  const char *p;
+  int signum;
+
+  if (line[len] != '\n')
+    error ("Could not parse signal set: %s", line);
+
+  p = line;
+  signum = len * 4;
+  while (len-- > 0)
+    {
+      int digit;
+
+      if (*p >= '0' && *p <= '9')
+       digit = *p - '0';
+      else if (*p >= 'a' && *p <= 'f')
+       digit = *p - 'a' + 10;
+      else
+       error ("Could not parse signal set: %s", line);
+
+      signum -= 4;
+
+      if (digit & 1)
+       sigaddset (sigs, signum + 1);
+      if (digit & 2)
+       sigaddset (sigs, signum + 2);
+      if (digit & 4)
+       sigaddset (sigs, signum + 3);
+      if (digit & 8)
+       sigaddset (sigs, signum + 4);
+
+      p++;
+    }
+}
+
+/* Find process PID's pending signals from /proc/pid/status and set SIGS
+   to match.  */
+
+void
+linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored)
+{
+  FILE *procfile;
+  char buffer[MAXPATHLEN], fname[MAXPATHLEN];
+  int signum;
+
+  sigemptyset (pending);
+  sigemptyset (blocked);
+  sigemptyset (ignored);
+  sprintf (fname, "/proc/%d/status", pid);
+  procfile = fopen (fname, "r");
+  if (procfile == NULL)
+    error ("Could not open %s", fname);
+
+  while (fgets (buffer, MAXPATHLEN, procfile) != NULL)
+    {
+      /* Normal queued signals are on the SigPnd line in the status
+        file.  However, 2.6 kernels also have a "shared" pending queue
+        for delivering signals to a thread group, so check for a ShdPnd
+        line also.
+
+        Unfortunately some Red Hat kernels include the shared pending queue
+        but not the ShdPnd status field.  */
+
+      if (strncmp (buffer, "SigPnd:\t", 8) == 0)
+       linux_proc_add_line_to_sigset (buffer + 8, pending);
+      else if (strncmp (buffer, "ShdPnd:\t", 8) == 0)
+       linux_proc_add_line_to_sigset (buffer + 8, pending);
+      else if (strncmp (buffer, "SigBlk:\t", 8) == 0)
+       linux_proc_add_line_to_sigset (buffer + 8, blocked);
+      else if (strncmp (buffer, "SigIgn:\t", 8) == 0)
+       linux_proc_add_line_to_sigset (buffer + 8, ignored);
+    }
+
+  fclose (procfile);
+}
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
deleted file mode 100644 (file)
index 7b35087..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/* Native-dependent code for GNU/Linux m32r.
-
-   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 "gdbcore.h"
-#include "regcache.h"
-#include "linux-nat.h"
-
-#include "gdb_assert.h"
-#include "gdb_string.h"
-#include <sys/ptrace.h>
-#include <sys/user.h>
-#include <sys/procfs.h>
-
-/* Prototypes for supply_gregset etc.  */
-#include "gregset.h"
-
-#include "m32r-tdep.h"
-\f
-
-
-
-/* Since EVB register is not available for native debug, we reduce
-   the number of registers.  */
-#define M32R_LINUX_NUM_REGS (M32R_NUM_REGS - 1)
-
-/* Mapping between the general-purpose registers in `struct user'
-   format and GDB's register array layout.  */
-static int regmap[] = {
-  4, 5, 6, 7, 0, 1, 2, 8,
-  9, 10, 11, 12, 13, 24, 25, 23,
-  19, 19, 26, 23, 22, 20, 16, 15
-};
-
-#define PSW_REGMAP 19
-#define BBPSW_REGMAP 21
-#define SPU_REGMAP 23
-#define SPI_REGMAP 26
-
-/* Doee apply to the corresponding SET requests as well.  */
-#define GETREGS_SUPPLIES(regno) (0 <= (regno) && (regno) <= M32R_LINUX_NUM_REGS)
-\f
-
-
-/* Transfering the general-purpose registers between GDB, inferiors
-   and core files.  */
-
-/* Fill GDB's register array with the general-purpose register values
-   in *GREGSETP.  */
-
-void
-supply_gregset (elf_gregset_t * gregsetp)
-{
-  elf_greg_t *regp = (elf_greg_t *) gregsetp;
-  int i;
-  unsigned long psw, bbpsw;
-
-  psw = *(regp + PSW_REGMAP);
-  bbpsw = *(regp + BBPSW_REGMAP);
-
-  for (i = 0; i < M32R_LINUX_NUM_REGS; i++)
-    {
-      switch (i)
-       {
-       case PSW_REGNUM:
-         *(regp + regmap[i]) =
-           ((0x00c1 & bbpsw) << 8) | ((0xc100 & psw) >> 8);
-         break;
-       case CBR_REGNUM:
-         *(regp + regmap[i]) = ((psw >> 8) & 1);
-         break;
-       }
-
-      if (i != M32R_SP_REGNUM)
-       regcache_raw_supply (current_regcache, i, regp + regmap[i]);
-      else if (psw & 0x8000)
-       regcache_raw_supply (current_regcache, i, regp + SPU_REGMAP);
-      else
-       regcache_raw_supply (current_regcache, i, regp + SPI_REGMAP);
-    }
-}
-
-/* Fetch all general-purpose registers from process/thread TID and
-   store their values in GDB's register array.  */
-
-static void
-fetch_regs (int tid)
-{
-  elf_gregset_t regs;
-
-  if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
-    perror_with_name ("Couldn't get registers");
-
-  supply_gregset (&regs);
-}
-
-/* Fill register REGNO (if it is a general-purpose register) in
-   *GREGSETPS with the value in GDB's register array.  If REGNO is -1,
-   do this for all registers.  */
-
-void
-fill_gregset (elf_gregset_t * gregsetp, int regno)
-{
-  elf_greg_t *regp = (elf_greg_t *) gregsetp;
-  int i;
-  unsigned long psw, bbpsw, tmp;
-
-  psw = *(regp + PSW_REGMAP);
-  bbpsw = *(regp + BBPSW_REGMAP);
-
-  for (i = 0; i < M32R_LINUX_NUM_REGS; i++)
-    {
-      if (regno != -1 && regno != i)
-       continue;
-
-      if (i == CBR_REGNUM || i == PSW_REGNUM)
-       continue;
-
-      if (i == SPU_REGNUM || i == SPI_REGNUM)
-       continue;
-
-      if (i != M32R_SP_REGNUM)
-       regcache_raw_collect (current_regcache, i, regp + regmap[i]);
-      else if (psw & 0x8000)
-       regcache_raw_collect (current_regcache, i, regp + SPU_REGMAP);
-      else
-       regcache_raw_collect (current_regcache, i, regp + SPI_REGMAP);
-    }
-}
-
-/* Store all valid general-purpose registers in GDB's register array
-   into the process/thread specified by TID.  */
-
-static void
-store_regs (int tid, int regno)
-{
-  elf_gregset_t regs;
-
-  if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
-    perror_with_name ("Couldn't get registers");
-
-  fill_gregset (&regs, regno);
-
-  if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
-    perror_with_name ("Couldn't write registers");
-}
-\f
-
-
-/* Transfering floating-point registers between GDB, inferiors and cores.  
-   Since M32R has no floating-point registers, these functions do nothing.  */
-
-void
-supply_fpregset (gdb_fpregset_t *fpregs)
-{
-}
-
-void
-fill_fpregset (gdb_fpregset_t *fpregs, int regno)
-{
-}
-\f
-
-
-/* Transferring arbitrary registers between GDB and inferior.  */
-
-/* Fetch register REGNO from the child process.  If REGNO is -1, do
-   this for all registers (including the floating point and SSE
-   registers).  */
-
-void
-fetch_inferior_registers (int regno)
-{
-  int tid;
-
-  /* GNU/Linux LWP ID's are process ID's.  */
-  tid = TIDGET (inferior_ptid);
-  if (tid == 0)
-    tid = PIDGET (inferior_ptid);      /* Not a threaded program.  */
-
-  /* Use the PTRACE_GETREGS request whenever possible, since it
-     transfers more registers in one system call, and we'll cache the
-     results.  */
-  if (regno == -1 || GETREGS_SUPPLIES (regno))
-    {
-      fetch_regs (tid);
-      return;
-    }
-
-  internal_error (__FILE__, __LINE__,
-                 "Got request for bad register number %d.", regno);
-}
-
-/* Store register REGNO back into the child process.  If REGNO is -1,
-   do this for all registers (including the floating point and SSE
-   registers).  */
-void
-store_inferior_registers (int regno)
-{
-  int tid;
-
-  /* GNU/Linux LWP ID's are process ID's.  */
-  if ((tid = TIDGET (inferior_ptid)) == 0)
-    tid = PIDGET (inferior_ptid);      /* Not a threaded program.  */
-
-  /* Use the PTRACE_SETREGS request whenever possible, since it
-     transfers more registers in one system call.  */
-  if (regno == -1 || GETREGS_SUPPLIES (regno))
-    {
-      store_regs (tid, regno);
-      return;
-    }
-
-  internal_error (__FILE__, __LINE__,
-                 "Got request to store bad register number %d.", regno);
-}
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
deleted file mode 100644 (file)
index d2ca1a9..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/* Target-dependent code for GNU/Linux m32r.
-
-   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 "frame.h"
-#include "value.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "osabi.h"
-#include "reggroups.h"
-
-#include "gdb_string.h"
-
-#include "glibc-tdep.h"
-#include "solib-svr4.h"
-
-#include "trad-frame.h"
-#include "frame-unwind.h"
-
-#include "m32r-tdep.h"
-\f
-
-/* Recognizing signal handler frames.  */
-
-/* GNU/Linux has two flavors of signals.  Normal signal handlers, and
-   "realtime" (RT) signals.  The RT signals can provide additional
-   information to the signal handler if the SA_SIGINFO flag is set
-   when establishing a signal handler using `sigaction'.  It is not
-   unlikely that future versions of GNU/Linux will support SA_SIGINFO
-   for normal signals too.  */
-
-/* When the m32r Linux kernel calls a signal handler and the
-   SA_RESTORER flag isn't set, the return address points to a bit of
-   code on the stack.  This function returns whether the PC appears to
-   be within this bit of code.
-
-   The instruction sequence for normal signals is
-       ldi    r7, #__NR_sigreturn
-       trap   #2
-   or 0x67 0x77 0x10 0xf2.
-
-   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 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.  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
-   what the GNU C Library has been doing for quite some time now.
-   However, as of version 2.1.2, the GNU C Library uses signal
-   trampolines (named __restore and __restore_rt) that are identical
-   to the ones used by the kernel.  Therefore, these trampolines are
-   supported too.  */
-
-static const unsigned char linux_sigtramp_code[] = {
-  0x67, 0x77, 0x10, 0xf2,
-};
-
-/* If PC is in a sigtramp routine, return the address of the start of
-   the routine.  Otherwise, return 0.  */
-
-static CORE_ADDR
-m32r_linux_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
-{
-  unsigned char buf[4];
-
-  /* We only recognize a signal trampoline if PC is at the start of
-     one of the instructions.  We optimize for finding the PC at the
-     start of the instruction sequence, as will be the case when the
-     trampoline is not the first frame on the stack.  We assume that
-     in the case where the PC is not at the start of the instruction
-     sequence, there will be a few trailing readable bytes on the
-     stack.  */
-
-  if (pc % 2 != 0)
-    {
-      if (!safe_frame_unwind_memory (next_frame, pc, buf, 2))
-       return 0;
-
-      if (memcmp (buf, linux_sigtramp_code, 2) == 0)
-       pc -= 2;
-      else
-       return 0;
-    }
-
-  if (!safe_frame_unwind_memory (next_frame, pc, buf, 4))
-    return 0;
-
-  if (memcmp (buf, linux_sigtramp_code, 4) != 0)
-    return 0;
-
-  return pc;
-}
-
-/* This function does the same for RT signals.  Here the instruction
-   sequence is
-       ldi    r7, #__NR_rt_sigreturn
-       trap   #2
-   or 0x97 0xf0 0x00 0xad 0x10 0xf2 0xf0 0x00.
-
-   The effect is to call the system call rt_sigreturn.  */
-
-static const unsigned char linux_rt_sigtramp_code[] = {
-  0x97, 0xf0, 0x00, 0xad, 0x10, 0xf2, 0xf0, 0x00,
-};
-
-/* If PC is in a RT sigtramp routine, return the address of the start
-   of the routine.  Otherwise, return 0.  */
-
-static CORE_ADDR
-m32r_linux_rt_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
-{
-  unsigned char buf[4];
-
-  /* We only recognize a signal trampoline if PC is at the start of
-     one of the instructions.  We optimize for finding the PC at the
-     start of the instruction sequence, as will be the case when the
-     trampoline is not the first frame on the stack.  We assume that
-     in the case where the PC is not at the start of the instruction
-     sequence, there will be a few trailing readable bytes on the
-     stack.  */
-
-  if (pc % 2 != 0)
-    return 0;
-
-  if (!safe_frame_unwind_memory (next_frame, pc, buf, 4))
-    return 0;
-
-  if (memcmp (buf, linux_rt_sigtramp_code, 4) == 0)
-    {
-      if (!safe_frame_unwind_memory (next_frame, pc + 4, buf, 4))
-       return 0;
-
-      if (memcmp (buf, linux_rt_sigtramp_code + 4, 4) == 0)
-       return pc;
-    }
-  else if (memcmp (buf, linux_rt_sigtramp_code + 4, 4) == 0)
-    {
-      if (!safe_frame_unwind_memory (next_frame, pc - 4, buf, 4))
-       return 0;
-
-      if (memcmp (buf, linux_rt_sigtramp_code, 4) == 0)
-       return pc - 4;
-    }
-
-  return 0;
-}
-
-static int
-m32r_linux_pc_in_sigtramp (CORE_ADDR pc, char *name,
-                          struct frame_info *next_frame)
-{
-  /* 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
-     be part of the preceding function.  This should always be sigaction,
-     __sigaction, or __libc_sigaction (all aliases to the same function).  */
-  if (name == NULL || strstr (name, "sigaction") != NULL)
-    return (m32r_linux_sigtramp_start (pc, next_frame) != 0
-           || m32r_linux_rt_sigtramp_start (pc, next_frame) != 0);
-
-  return (strcmp ("__restore", name) == 0
-         || strcmp ("__restore_rt", name) == 0);
-}
-
-/* From <asm/sigcontext.h>.  */
-static int m32r_linux_sc_reg_offset[] = {
-  4 * 4,                       /* r0 */
-  5 * 4,                       /* r1 */
-  6 * 4,                       /* r2 */
-  7 * 4,                       /* r3 */
-  0 * 4,                       /* r4 */
-  1 * 4,                       /* r5 */
-  2 * 4,                       /* r6 */
-  8 * 4,                       /* r7 */
-  9 * 4,                       /* r8 */
-  10 * 4,                      /* r9 */
-  11 * 4,                      /* r10 */
-  12 * 4,                      /* r11 */
-  13 * 4,                      /* r12 */
-  21 * 4,                      /* fp */
-  22 * 4,                      /* lr */
-  -1 * 4,                      /* sp */
-  16 * 4,                      /* psw */
-  -1 * 4,                      /* cbr */
-  23 * 4,                      /* spi */
-  20 * 4,                      /* spu */
-  19 * 4,                      /* bpc */
-  17 * 4,                      /* pc */
-  15 * 4,                      /* accl */
-  14 * 4                       /* acch */
-};
-
-struct m32r_frame_cache
-{
-  CORE_ADDR base, pc;
-  struct trad_frame_saved_reg *saved_regs;
-};
-
-static struct m32r_frame_cache *
-m32r_linux_sigtramp_frame_cache (struct frame_info *next_frame,
-                                void **this_cache)
-{
-  struct m32r_frame_cache *cache;
-  CORE_ADDR sigcontext_addr, addr;
-  int regnum;
-
-  if ((*this_cache) != NULL)
-    return (*this_cache);
-  cache = FRAME_OBSTACK_ZALLOC (struct m32r_frame_cache);
-  (*this_cache) = cache;
-  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
-  cache->base = frame_unwind_register_unsigned (next_frame, M32R_SP_REGNUM);
-  sigcontext_addr = cache->base + 4;
-
-  cache->pc = frame_pc_unwind (next_frame);
-  addr = m32r_linux_sigtramp_start (cache->pc, next_frame);
-  if (addr == 0)
-    {
-      /* If this is a RT signal trampoline, adjust SIGCONTEXT_ADDR
-         accordingly.  */
-      addr = m32r_linux_rt_sigtramp_start (cache->pc, next_frame);
-      if (addr)
-       sigcontext_addr += 128;
-      else
-       addr = frame_func_unwind (next_frame);
-    }
-  cache->pc = addr;
-
-  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
-  for (regnum = 0; regnum < sizeof (m32r_linux_sc_reg_offset) / 4; regnum++)
-    {
-      if (m32r_linux_sc_reg_offset[regnum] >= 0)
-       cache->saved_regs[regnum].addr =
-         sigcontext_addr + m32r_linux_sc_reg_offset[regnum];
-    }
-
-  return cache;
-}
-
-static void
-m32r_linux_sigtramp_frame_this_id (struct frame_info *next_frame,
-                                  void **this_cache,
-                                  struct frame_id *this_id)
-{
-  struct m32r_frame_cache *cache =
-    m32r_linux_sigtramp_frame_cache (next_frame, this_cache);
-
-  (*this_id) = frame_id_build (cache->base, cache->pc);
-}
-
-static void
-m32r_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)
-{
-  struct m32r_frame_cache *cache =
-    m32r_linux_sigtramp_frame_cache (next_frame, this_cache);
-
-  trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum,
-                               optimizedp, lvalp, addrp, realnump, valuep);
-}
-
-static const struct frame_unwind m32r_linux_sigtramp_frame_unwind = {
-  SIGTRAMP_FRAME,
-  m32r_linux_sigtramp_frame_this_id,
-  m32r_linux_sigtramp_frame_prev_register
-};
-
-static const struct frame_unwind *
-m32r_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 (m32r_linux_pc_in_sigtramp (pc, name, next_frame))
-    return &m32r_linux_sigtramp_frame_unwind;
-
-  return NULL;
-}
-
-static void
-m32r_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
-  /* Since EVB register is not available for native debug, we reduce
-     the number of registers.  */
-  set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS - 1);
-
-  frame_unwind_append_sniffer (gdbarch, m32r_linux_sigtramp_frame_sniffer);
-
-  /* GNU/Linux uses SVR4-style shared libraries.  */
-  set_solib_svr4_fetch_link_map_offsets
-    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
-}
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern void _initialize_m32r_linux_tdep (void);
-
-void
-_initialize_m32r_linux_tdep (void)
-{
-  gdbarch_register_osabi (bfd_arch_m32r, 0, GDB_OSABI_LINUX,
-                         m32r_linux_init_abi);
-}
index 0afd2614bcec30d999519f1d86f2882d0e59048b..fd5e9dc836a49dac4b3a5051c78ddcc210d41d1a 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Renesas M32R, for GDB.
 
-   Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
 
 #include "gdb_assert.h"
 
-#include "m32r-tdep.h"
+struct gdbarch_tdep
+{
+  /* gdbarch target dependent data here. Currently unused for M32R. */
+};
+
+/* m32r register names. */
+
+enum
+{
+  R0_REGNUM = 0,
+  R3_REGNUM = 3,
+  M32R_FP_REGNUM = 13,
+  LR_REGNUM = 14,
+  M32R_SP_REGNUM = 15,
+  PSW_REGNUM = 16,
+  M32R_PC_REGNUM = 21,
+  /* m32r calling convention. */
+  ARG1_REGNUM = R0_REGNUM,
+  ARGN_REGNUM = R3_REGNUM,
+  RET1_REGNUM = R0_REGNUM,
+};
 
 /* Local functions */
 
@@ -55,6 +75,19 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
   return sp & ~3;
 }
 
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+   EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc and TYPE
+   is the type (which is known to be struct, union or array).
+
+   The m32r returns anything less than 8 bytes in size in
+   registers. */
+
+static int
+m32r_use_struct_convention (int gcc_p, struct type *type)
+{
+  return (TYPE_LENGTH (type) > 8);
+}
+
 
 /* BREAKPOINT */
 #define M32R_BE_BREAKPOINT32 {0x10, 0xf1, 0x70, 0x00}
@@ -205,12 +238,18 @@ char *m32r_register_names[] = {
   "evb"
 };
 
+static int
+m32r_num_regs (void)
+{
+  return (sizeof (m32r_register_names) / sizeof (m32r_register_names[0]));
+}
+
 static const char *
 m32r_register_name (int reg_nr)
 {
   if (reg_nr < 0)
     return NULL;
-  if (reg_nr >= M32R_NUM_REGS)
+  if (reg_nr >= m32r_num_regs ())
     return NULL;
   return m32r_register_names[reg_nr];
 }
@@ -253,56 +292,69 @@ m32r_store_return_value (struct type *type, struct regcache *regcache,
     }
 }
 
+/* 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
+m32r_extract_struct_value_address (struct regcache *regcache)
+{
+  ULONGEST addr;
+  regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr);
+  return addr;
+}
+
+
 /* This is required by skip_prologue. The results of decoding a prologue
    should be cached because this thrashing is getting nuts.  */
 
-static int
+static void
 decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
-                CORE_ADDR *pl_endptr, unsigned long *framelength)
+                CORE_ADDR *pl_endptr)
 {
   unsigned long framesize;
   int insn;
   int op1;
+  int maybe_one_more = 0;
   CORE_ADDR after_prologue = 0;
-  CORE_ADDR after_push = 0;
   CORE_ADDR after_stack_adjust = 0;
   CORE_ADDR current_pc;
-  LONGEST return_value;
 
   framesize = 0;
   after_prologue = 0;
 
   for (current_pc = start_pc; current_pc < scan_limit; current_pc += 2)
     {
-      /* Check if current pc's location is readable. */
-      if (!safe_read_memory_integer (current_pc, 2, &return_value))
-       return -1;
-
       insn = read_memory_unsigned_integer (current_pc, 2);
 
-      if (insn == 0x0000)
-       break;
-
       /* If this is a 32 bit instruction, we dont want to examine its
          immediate data as though it were an instruction */
       if (current_pc & 0x02)
        {
+         /* Clear the parallel execution bit from 16 bit instruction */
+         if (maybe_one_more)
+           {
+             /* The last instruction was a branch, usually terminates
+                the series, but if this is a parallel instruction,
+                it may be a stack framing instruction */
+             if (!(insn & 0x8000))
+               {
+                 /* nope, we are really done */
+                 break;
+               }
+           }
          /* decode this instruction further */
          insn &= 0x7fff;
        }
       else
        {
+         if (maybe_one_more)
+           break;              /* This isnt the one more */
          if (insn & 0x8000)
            {
              if (current_pc == scan_limit)
                scan_limit += 2;        /* extend the search */
-
              current_pc += 2;  /* skip the immediate data */
-
-             /* Check if current pc's location is readable. */
-             if (!safe_read_memory_integer (current_pc, 2, &return_value))
-               return -1;
-
              if (insn == 0x8faf)       /* add3 sp, sp, xxxx */
                /* add 16 bit sign-extended offset */
                {
@@ -312,8 +364,6 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
              else
                {
                  if (((insn >> 8) == 0xe4)     /* ld24 r4, xxxxxx; sub sp, r4 */
-                     && safe_read_memory_integer (current_pc + 2, 2,
-                                                  &return_value)
                      && read_memory_unsigned_integer (current_pc + 2,
                                                       2) == 0x0f24)
                    /* subtract 24 bit sign-extended negative-offset */
@@ -326,7 +376,7 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
                      framesize += insn;
                    }
                }
-             after_push = current_pc + 2;
+             after_prologue = current_pc;
              continue;
            }
        }
@@ -365,23 +415,17 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
          after_prologue = current_pc + 2;
          break;                /* end of stack adjustments */
        }
-
       /* Nop looks like a branch, continue explicitly */
       if (insn == 0x7000)
        {
          after_prologue = current_pc + 2;
          continue;             /* nop occurs between pushes */
        }
-      /* End of prolog if any of these are trap instructions */
-      if ((insn & 0xfff0) == 0x10f0)
-       {
-         after_prologue = current_pc;
-         break;
-       }
       /* End of prolog if any of these are branch instructions */
       if ((op1 == 0x7000) || (op1 == 0xb000) || (op1 == 0xf000))
        {
          after_prologue = current_pc;
+         maybe_one_more = 1;
          continue;
        }
       /* Some of the branch instructions are mixed with other types */
@@ -391,14 +435,12 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
          if ((subop == 0x0ec0) || (subop == 0x0fc0))
            {
              after_prologue = current_pc;
+             maybe_one_more = 1;
              continue;         /* jmp , jl */
            }
        }
     }
 
-  if (framelength)
-    *framelength = framesize;
-
   if (current_pc >= scan_limit)
     {
       if (pl_endptr)
@@ -410,13 +452,6 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
            {
              *pl_endptr = after_stack_adjust;
            }
-         else if (after_push != 0)
-           /* We did not find a "mv fp,sp", but we DID find
-              a push.  Is it safe to use that as the
-              end of the prologue?  I just don't know. */
-           {
-             *pl_endptr = after_push;
-           }
          else
            /* We reached the end of the loop without finding the end
               of the prologue.  No way to win -- we should report failure.  
@@ -424,29 +459,25 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit,
               GDB will set a breakpoint at the start of the function (etc.) */
            *pl_endptr = start_pc;
        }
-      return 0;
+      return;
     }
-
   if (after_prologue == 0)
     after_prologue = current_pc;
 
   if (pl_endptr)
     *pl_endptr = after_prologue;
-
-  return 0;
 }                              /*  decode_prologue */
 
 /* Function: skip_prologue
    Find end of function prologue */
 
-#define DEFAULT_SEARCH_LIMIT 128
+#define DEFAULT_SEARCH_LIMIT 44
 
 CORE_ADDR
 m32r_skip_prologue (CORE_ADDR pc)
 {
   CORE_ADDR func_addr, func_end;
   struct symtab_and_line sal;
-  LONGEST return_value;
 
   /* See what the symbol table says */
 
@@ -468,18 +499,11 @@ m32r_skip_prologue (CORE_ADDR pc)
     }
   else
     func_end = pc + DEFAULT_SEARCH_LIMIT;
-
-  /* If pc's location is not readable, just quit. */
-  if (!safe_read_memory_integer (pc, 4, &return_value))
-    return pc;
-
-  /* Find the end of prologue.  */
-  if (decode_prologue (pc, func_end, &sal.end, NULL) < 0)
-    return pc;
-
+  decode_prologue (pc, func_end, &sal.end);
   return sal.end;
 }
 
+
 struct m32r_unwind_cache
 {
   /* The previous frame's inner most stack address.  Used as this
@@ -508,14 +532,13 @@ static struct m32r_unwind_cache *
 m32r_frame_unwind_cache (struct frame_info *next_frame,
                         void **this_prologue_cache)
 {
-  CORE_ADDR pc, scan_limit;
+  CORE_ADDR pc;
   ULONGEST prev_sp;
   ULONGEST this_base;
-  unsigned long op, op2;
+  unsigned long op;
   int i;
   struct m32r_unwind_cache *info;
 
-
   if ((*this_prologue_cache))
     return (*this_prologue_cache);
 
@@ -525,11 +548,10 @@ m32r_frame_unwind_cache (struct frame_info *next_frame,
 
   info->size = 0;
   info->sp_offset = 0;
-  info->uses_frame = 0;
 
-  scan_limit = frame_pc_unwind (next_frame);
+  info->uses_frame = 0;
   for (pc = frame_func_unwind (next_frame);
-       pc > 0 && pc < scan_limit; pc += 2)
+       pc > 0 && pc < frame_pc_unwind (next_frame); pc += 2)
     {
       if ((pc & 2) == 0)
        {
@@ -543,19 +565,18 @@ m32r_frame_unwind_cache (struct frame_info *next_frame,
                  short n = op & 0xffff;
                  info->sp_offset += n;
                }
-             else if (((op >> 8) == 0xe4)
-                      && get_frame_memory_unsigned (next_frame, pc + 2,
+             else if (((op >> 8) == 0xe4)      /* ld24 r4, xxxxxx; sub sp, r4 */
+                      && get_frame_memory_unsigned (next_frame, pc + 4,
                                                     2) == 0x0f24)
                {
-                 /* ld24 r4, xxxxxx; sub sp, r4 */
                  unsigned long n = op & 0xffffff;
                  info->sp_offset += n;
-                 pc += 2;      /* skip sub instruction */
+                 pc += 2;
                }
+             else
+               break;
 
-             if (pc == scan_limit)
-               scan_limit += 2;        /* extend the search */
-             pc += 2;          /* skip the immediate data */
+             pc += 2;
              continue;
            }
        }
@@ -580,13 +601,12 @@ m32r_frame_unwind_cache (struct frame_info *next_frame,
          /* mv fp, sp */
          info->uses_frame = 1;
          info->r13_offset = info->sp_offset;
-         break;                /* end of stack adjustments */
-       }
-      else if ((op & 0xfff0) == 0x10f0)
-       {
-         /* end of prologue if this is a trap instruction */
-         break;                /* end of stack adjustments */
        }
+      else if (op == 0x7000)
+       /* nop */
+       continue;
+      else
+       break;
     }
 
   info->size = -info->sp_offset;
@@ -787,24 +807,6 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache,
     }
 }
 
-enum return_value_convention
-m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
-                  struct regcache *regcache, void *readbuf,
-                  const void *writebuf)
-{
-  if (TYPE_LENGTH (valtype) > 8)
-    return RETURN_VALUE_STRUCT_CONVENTION;
-  else
-    {
-      if (readbuf != NULL)
-       m32r_extract_return_value (valtype, regcache, readbuf);
-      if (writebuf != NULL)
-       m32r_store_return_value (valtype, regcache, writebuf);
-      return RETURN_VALUE_REGISTER_CONVENTION;
-    }
-}
-
-
 
 static CORE_ADDR
 m32r_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
@@ -919,13 +921,16 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_write_pc (gdbarch, m32r_write_pc);
   set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp);
 
-  set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS);
+  set_gdbarch_num_regs (gdbarch, m32r_num_regs ());
   set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM);
   set_gdbarch_register_name (gdbarch, m32r_register_name);
   set_gdbarch_register_type (gdbarch, m32r_register_type);
 
+  set_gdbarch_extract_return_value (gdbarch, m32r_extract_return_value);
   set_gdbarch_push_dummy_call (gdbarch, m32r_push_dummy_call);
-  set_gdbarch_return_value (gdbarch, m32r_return_value);
+  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_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/m32r-tdep.h b/gdb/m32r-tdep.h
deleted file mode 100644 (file)
index 60da0d6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Target-dependent code for Renesas M32R, 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.  */
-
-#ifndef M32R_TDEP_H
-#define M32R_TDEP_H
-
-struct gdbarch_tdep
-{
-  /* gdbarch target dependent data here. Currently unused for M32R. */
-};
-
-/* m32r register names. */
-
-enum m32r_regnum
-{
-  R0_REGNUM = 0,
-  R3_REGNUM = 3,
-  M32R_FP_REGNUM = 13,
-  LR_REGNUM = 14,
-  M32R_SP_REGNUM = 15,
-  PSW_REGNUM = 16,
-  CBR_REGNUM = 17,
-  SPU_REGNUM = 18,
-  SPI_REGNUM = 19,
-  M32R_PC_REGNUM = 21,
-  /* m32r calling convention. */
-  ARG1_REGNUM = R0_REGNUM,
-  ARGN_REGNUM = R3_REGNUM,
-  RET1_REGNUM = R0_REGNUM,
-};
-
-#define M32R_NUM_REGS 25
-
-#endif /* m32r-tdep.h */
index 472eb76d5b8a90d5ba67f87b630525588979bbbd..7553c19b1ee0792d072fea0240d3bea604af76dd 100644 (file)
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
-#include "target.h"
 
 #include <sys/types.h>
 #include <sys/ptrace.h>
 #include <machine/reg.h>
 
 #include "m88k-tdep.h"
-#include "inf-ptrace.h"
 
 /* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
 
@@ -64,8 +62,8 @@ m88kbsd_collect_gregset (const struct regcache *regcache,
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers.  */
 
-static void
-m88kbsd_fetch_inferior_registers (int regnum)
+void
+fetch_inferior_registers (int regnum)
 {
   struct reg regs;
 
@@ -79,8 +77,8 @@ m88kbsd_fetch_inferior_registers (int regnum)
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
    this for all registers.  */
 
-static void
-m88kbsd_store_inferior_registers (int regnum)
+void
+store_inferior_registers (int regnum)
 {
   struct reg regs;
 
@@ -94,18 +92,3 @@ m88kbsd_store_inferior_registers (int regnum)
              (PTRACE_TYPE_ARG3) &regs, 0) == -1)
     perror_with_name ("Couldn't write registers");
 }
-\f
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_m88kbsd_nat (void);
-
-void
-_initialize_m88kbsd_nat (void)
-{
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = m88kbsd_fetch_inferior_registers;
-  t->to_store_registers = m88kbsd_store_inferior_registers;
-  add_target (t);
-}
index 6b4b067851eac960251660b08b9d92c6bcafcbf6..0ee3533a7103c71acc5989ada13e0fea176a8dc2 100644 (file)
@@ -609,8 +609,8 @@ maintenance_do_deprecate (char *text, int deprecate)
 
 /* Maintenance set/show framework.  */
 
-struct cmd_list_element *maintenance_set_cmdlist;
-struct cmd_list_element *maintenance_show_cmdlist;
+static struct cmd_list_element *maintenance_set_cmdlist;
+static struct cmd_list_element *maintenance_show_cmdlist;
 
 static void
 maintenance_set_cmd (char *args, int from_tty)
index 635d0cc4a17a9ff2ecf435bb1b608cc6595f528e..3aeda7d08159439f8206fc67ba415a4d8732e104 100644 (file)
@@ -145,15 +145,7 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
    Note:  One instance where there may be duplicate minimal symbols with
    the same name is when the symbol tables for a shared library and the
    symbol tables for an executable contain global symbols with the same
-   names (the dynamic linker deals with the duplication).
-
-   It's also possible to have minimal symbols with different mangled
-   names, but identical demangled names.  For example, the GNU C++ v3
-   ABI requires the generation of two (or perhaps three) copies of
-   constructor functions --- "in-charge", "not-in-charge", and
-   "allocate" copies; destructors may be duplicated as well.
-   Obviously, there must be distinct mangled names for each of these,
-   but the demangled names are all the same: S::S or S::~S.  */
+   names (the dynamic linker deals with the duplication).  */
 
 struct minimal_symbol *
 lookup_minimal_symbol (const char *name, const char *sfile,
index 4f249b8e439c6d0503da7aa5739d8e485d747616..2b40fddf8f93641a1c4df26c4106dd50c5701589 100644 (file)
@@ -945,6 +945,63 @@ after_prologue (CORE_ADDR pc)
   return 0;
 }
 
+/* Decode a MIPS32 instruction that saves a register in the stack, and
+   set the appropriate bit in the general register mask or float register mask
+   to indicate which register is saved.  This is a helper function
+   for mips_find_saved_regs.  */
+
+static void
+mips32_decode_reg_save (t_inst inst, unsigned long *gen_mask,
+                       unsigned long *float_mask)
+{
+  int reg;
+
+  if ((inst & 0xffe00000) == 0xafa00000        /* sw reg,n($sp) */
+      || (inst & 0xffe00000) == 0xafc00000     /* sw reg,n($r30) */
+      || (inst & 0xffe00000) == 0xffa00000)    /* sd reg,n($sp) */
+    {
+      /* It might be possible to use the instruction to
+         find the offset, rather than the code below which
+         is based on things being in a certain order in the
+         frame, but figuring out what the instruction's offset
+         is relative to might be a little tricky.  */
+      reg = (inst & 0x001f0000) >> 16;
+      *gen_mask |= (1 << reg);
+    }
+  else if ((inst & 0xffe00000) == 0xe7a00000   /* swc1 freg,n($sp) */
+          || (inst & 0xffe00000) == 0xe7c00000 /* swc1 freg,n($r30) */
+          || (inst & 0xffe00000) == 0xf7a00000)        /* sdc1 freg,n($sp) */
+
+    {
+      reg = ((inst & 0x001f0000) >> 16);
+      *float_mask |= (1 << reg);
+    }
+}
+
+/* Decode a MIPS16 instruction that saves a register in the stack, and
+   set the appropriate bit in the general register or float register mask
+   to indicate which register is saved.  This is a helper function
+   for mips_find_saved_regs.  */
+
+static void
+mips16_decode_reg_save (t_inst inst, unsigned long *gen_mask)
+{
+  if ((inst & 0xf800) == 0xd000)       /* sw reg,n($sp) */
+    {
+      int reg = mips16_to_32_reg[(inst & 0x700) >> 8];
+      *gen_mask |= (1 << reg);
+    }
+  else if ((inst & 0xff00) == 0xf900)  /* sd reg,n($sp) */
+    {
+      int reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
+      *gen_mask |= (1 << reg);
+    }
+  else if ((inst & 0xff00) == 0x6200   /* sw $ra,n($sp) */
+          || (inst & 0xff00) == 0xfa00)        /* sd $ra,n($sp) */
+    *gen_mask |= (1 << RA_REGNUM);
+}
+
+
 /* Fetch and return instruction from the specified location.  If the PC
    is odd, assume it's a MIPS16 instruction; otherwise MIPS32.  */
 
@@ -983,6 +1040,20 @@ mips16_fetch_instruction (CORE_ADDR addr)
   return extract_unsigned_integer (buf, instlen);
 }
 
+static ULONGEST
+mips32_fetch_instruction (CORE_ADDR addr)
+{
+  char buf[MIPS_INSTLEN];
+  int instlen;
+  int status;
+  instlen = MIPS_INSTLEN;
+  status = deprecated_read_memory_nobpt (addr, buf, instlen);
+  if (status)
+    memory_error (status, addr);
+  return extract_unsigned_integer (buf, instlen);
+}
+
+
 /* These the fields of 32 bit mips instructions */
 #define mips32_op(x) (x >> 26)
 #define itype_op(x) (x >> 26)
@@ -1143,7 +1214,7 @@ mips32_next_pc (CORE_ADDR pc)
            pc += 8;
          break;
        case 6:         /* BLEZ, BLEZL */
-         if (read_signed_register (itype_rs (inst)) <= 0)
+         if (read_signed_register (itype_rs (inst) <= 0))
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
@@ -1151,7 +1222,7 @@ mips32_next_pc (CORE_ADDR pc)
        case 7:
        default:
        greater_branch: /* BGTZ, BGTZL */
-         if (read_signed_register (itype_rs (inst)) > 0)
+         if (read_signed_register (itype_rs (inst) > 0))
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
@@ -1710,262 +1781,6 @@ mips_mdebug_frame_base_sniffer (struct frame_info *next_frame)
     return NULL;
 }
 
-/* Set a register's saved stack address in temp_saved_regs.  If an
-   address has already been set for this register, do nothing; this
-   way we will only recognize the first save of a given register in a
-   function prologue.
-
-   For simplicity, save the address in both [0 .. NUM_REGS) and
-   [NUM_REGS .. 2*NUM_REGS).  Strictly speaking, only the second range
-   is used as it is only second range (the ABI instead of ISA
-   registers) that comes into play when finding saved registers in a
-   frame.  */
-
-static void
-set_reg_offset (struct mips_frame_cache *this_cache, int regnum,
-               CORE_ADDR offset)
-{
-  if (this_cache != NULL
-      && this_cache->saved_regs[regnum].addr == -1)
-    {
-      this_cache->saved_regs[regnum + 0 * NUM_REGS].addr = offset;
-      this_cache->saved_regs[regnum + 1 * NUM_REGS].addr = offset;
-    }
-}
-
-
-/* Fetch the immediate value from a MIPS16 instruction.
-   If the previous instruction was an EXTEND, use it to extend
-   the upper bits of the immediate value.  This is a helper function
-   for mips16_scan_prologue.  */
-
-static int
-mips16_get_imm (unsigned short prev_inst,      /* previous instruction */
-               unsigned short inst,    /* current instruction */
-               int nbits,      /* number of bits in imm field */
-               int scale,      /* scale factor to be applied to imm */
-               int is_signed)  /* is the imm field signed? */
-{
-  int offset;
-
-  if ((prev_inst & 0xf800) == 0xf000)  /* prev instruction was EXTEND? */
-    {
-      offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
-      if (offset & 0x8000)     /* check for negative extend */
-       offset = 0 - (0x10000 - (offset & 0xffff));
-      return offset | (inst & 0x1f);
-    }
-  else
-    {
-      int max_imm = 1 << nbits;
-      int mask = max_imm - 1;
-      int sign_bit = max_imm >> 1;
-
-      offset = inst & mask;
-      if (is_signed && (offset & sign_bit))
-       offset = 0 - (max_imm - offset);
-      return offset * scale;
-    }
-}
-
-
-/* Analyze the function prologue from START_PC to LIMIT_PC. Builds
-   the associated FRAME_CACHE if not null.
-   Return the address of the first instruction past the prologue.  */
-
-static CORE_ADDR
-mips16_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
-                      struct frame_info *next_frame,
-                      struct mips_frame_cache *this_cache)
-{
-  CORE_ADDR cur_pc;
-  CORE_ADDR frame_addr = 0;    /* Value of $r17, used as frame pointer */
-  CORE_ADDR sp;
-  long frame_offset = 0;        /* Size of stack frame.  */
-  long frame_adjust = 0;        /* Offset of FP from SP.  */
-  int frame_reg = MIPS_SP_REGNUM;
-  unsigned short prev_inst = 0;        /* saved copy of previous instruction */
-  unsigned inst = 0;           /* current instruction */
-  unsigned entry_inst = 0;     /* the entry instruction */
-  int reg, offset;
-
-  int extend_bytes = 0;
-  int prev_extend_bytes;
-  CORE_ADDR end_prologue_addr = 0;
-
-  /* Can be called when there's no process, and hence when there's no
-     NEXT_FRAME.  */
-  if (next_frame != NULL)
-    sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM);
-  else
-    sp = 0;
-
-  if (limit_pc > start_pc + 200)
-    limit_pc = start_pc + 200;
-
-  for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS16_INSTLEN)
-    {
-      /* Save the previous instruction.  If it's an EXTEND, we'll extract
-         the immediate offset extension from it in mips16_get_imm.  */
-      prev_inst = inst;
-
-      /* Fetch and decode the instruction.   */
-      inst = (unsigned short) mips_fetch_instruction (cur_pc);
-
-      /* Normally we ignore extend instructions.  However, if it is
-         not followed by a valid prologue instruction, then this
-         instruction is not part of the prologue either.  We must
-         remember in this case to adjust the end_prologue_addr back
-         over the extend.  */
-      if ((inst & 0xf800) == 0xf000)    /* extend */
-        {
-          extend_bytes = MIPS16_INSTLEN;
-          continue;
-        }
-
-      prev_extend_bytes = extend_bytes;
-      extend_bytes = 0;
-
-      if ((inst & 0xff00) == 0x6300    /* addiu sp */
-         || (inst & 0xff00) == 0xfb00) /* daddiu sp */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 8, 8, 1);
-         if (offset < 0)       /* negative stack adjustment? */
-           frame_offset -= offset;
-         else
-           /* Exit loop if a positive stack adjustment is found, which
-              usually means that the stack cleanup code in the function
-              epilogue is reached.  */
-           break;
-       }
-      else if ((inst & 0xf800) == 0xd000)      /* sw reg,n($sp) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
-         reg = mips16_to_32_reg[(inst & 0x700) >> 8];
-         set_reg_offset (this_cache, reg, sp + offset);
-       }
-      else if ((inst & 0xff00) == 0xf900)      /* sd reg,n($sp) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
-         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         set_reg_offset (this_cache, reg, sp + offset);
-       }
-      else if ((inst & 0xff00) == 0x6200)      /* sw $ra,n($sp) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
-         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
-       }
-      else if ((inst & 0xff00) == 0xfa00)      /* sd $ra,n($sp) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 8, 8, 0);
-         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
-       }
-      else if (inst == 0x673d) /* move $s1, $sp */
-       {
-         frame_addr = sp;
-         frame_reg = 17;
-       }
-      else if ((inst & 0xff00) == 0x0100)      /* addiu $s1,sp,n */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
-         frame_addr = sp + offset;
-         frame_reg = 17;
-         frame_adjust = offset;
-       }
-      else if ((inst & 0xFF00) == 0xd900)      /* sw reg,offset($s1) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 5, 4, 0);
-         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         set_reg_offset (this_cache, reg, frame_addr + offset);
-       }
-      else if ((inst & 0xFF00) == 0x7900)      /* sd reg,offset($s1) */
-       {
-         offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
-         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         set_reg_offset (this_cache, reg, frame_addr + offset);
-       }
-      else if ((inst & 0xf81f) == 0xe809
-               && (inst & 0x700) != 0x700)     /* entry */
-       entry_inst = inst;      /* save for later processing */
-      else if ((inst & 0xf800) == 0x1800)      /* jal(x) */
-       cur_pc += MIPS16_INSTLEN;       /* 32-bit instruction */
-      else if ((inst & 0xff1c) == 0x6704)      /* move reg,$a0-$a3 */
-        {
-          /* This instruction is part of the prologue, but we don't
-             need to do anything special to handle it.  */
-        }
-      else
-        {
-          /* This instruction is not an instruction typically found
-             in a prologue, so we must have reached the end of the
-             prologue.  */
-          if (end_prologue_addr == 0)
-            end_prologue_addr = cur_pc - prev_extend_bytes;
-        }
-    }
-
-  /* The entry instruction is typically the first instruction in a function,
-     and it stores registers at offsets relative to the value of the old SP
-     (before the prologue).  But the value of the sp parameter to this
-     function is the new SP (after the prologue has been executed).  So we
-     can't calculate those offsets until we've seen the entire prologue,
-     and can calculate what the old SP must have been. */
-  if (entry_inst != 0)
-    {
-      int areg_count = (entry_inst >> 8) & 7;
-      int sreg_count = (entry_inst >> 6) & 3;
-
-      /* The entry instruction always subtracts 32 from the SP.  */
-      frame_offset += 32;
-
-      /* Now we can calculate what the SP must have been at the
-         start of the function prologue.  */
-      sp += frame_offset;
-
-      /* Check if a0-a3 were saved in the caller's argument save area.  */
-      for (reg = 4, offset = 0; reg < areg_count + 4; reg++)
-       {
-         set_reg_offset (this_cache, reg, sp + offset);
-         offset += mips_abi_regsize (current_gdbarch);
-       }
-
-      /* Check if the ra register was pushed on the stack.  */
-      offset = -4;
-      if (entry_inst & 0x20)
-       {
-         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
-         offset -= mips_abi_regsize (current_gdbarch);
-       }
-
-      /* Check if the s0 and s1 registers were pushed on the stack.  */
-      for (reg = 16; reg < sreg_count + 16; reg++)
-       {
-         set_reg_offset (this_cache, reg, sp + offset);
-         offset -= mips_abi_regsize (current_gdbarch);
-       }
-    }
-
-  if (this_cache != NULL)
-    {
-      this_cache->base =
-        (frame_unwind_register_signed (next_frame, NUM_REGS + frame_reg)
-         + frame_offset - frame_adjust);
-      /* FIXME: brobecker/2004-10-10: Just as in the mips32 case, we should
-         be able to get rid of the assignment below, evetually. But it's
-         still needed for now.  */
-      this_cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc]
-        = this_cache->saved_regs[NUM_REGS + RA_REGNUM];
-    }
-
-  /* If we didn't reach the end of the prologue when scanning the function
-     instructions, then set end_prologue_addr to the address of the
-     instruction immediately after the last one we scanned.  */
-  if (end_prologue_addr == 0)
-    end_prologue_addr = cur_pc;
-
-  return end_prologue_addr;
-}
-
 /* Heuristic unwinder for 16-bit MIPS instruction set (aka MIPS16).
    Procedures that use the 32-bit instruction set are handled by the
    mips_insn32 unwinder.  */
@@ -1973,7 +1788,14 @@ mips16_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
 static struct mips_frame_cache *
 mips_insn16_frame_cache (struct frame_info *next_frame, void **this_cache)
 {
+  mips_extra_func_info_t proc_desc;
   struct mips_frame_cache *cache;
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  /* r0 bit means kernel trap */
+  int kernel_trap;
+  /* What registers have been saved?  Bitmasks.  */
+  unsigned long gen_mask, float_mask;
 
   if ((*this_cache) != NULL)
     return (*this_cache);
@@ -1981,7 +1803,7 @@ mips_insn16_frame_cache (struct frame_info *next_frame, void **this_cache)
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
 
-  /* Analyze the function prologue.  */
+  /* Synthesize a proc descriptor.  */
   {
     const CORE_ADDR pc = frame_pc_unwind (next_frame);
     CORE_ADDR start_addr;
@@ -1989,27 +1811,179 @@ mips_insn16_frame_cache (struct frame_info *next_frame, void **this_cache)
     find_pc_partial_function (pc, NULL, &start_addr, NULL);
     if (start_addr == 0)
       start_addr = heuristic_proc_start (pc);
-    /* We can't analyze the prologue if we couldn't find the begining
-       of the function.  */
-    if (start_addr == 0)
-      return cache;
 
-    mips16_scan_prologue (start_addr, pc, next_frame, *this_cache);
+#ifdef NOT_YET
+    proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, *this_cache);
+#else
+    proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, NULL);
+#endif
   }
   
-  /* SP_REGNUM, contains the value and not the address.  */
-  trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base);
-
-  return (*this_cache);
-}
+  /* Extract the frame's base.  */
+  cache->base = (frame_unwind_register_signed (next_frame, NUM_REGS + PROC_FRAME_REG (proc_desc))
+                + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc));
 
-static void
-mips_insn16_frame_this_id (struct frame_info *next_frame, void **this_cache,
-                          struct frame_id *this_id)
-{
-  struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame,
-                                                          this_cache);
-  (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+  kernel_trap = PROC_REG_MASK (proc_desc) & 1;
+  gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc);
+  float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc);
+  
+  /* In any frame other than the innermost or a frame interrupted by a
+     signal, we assume that all registers have been saved.  This
+     assumes that all register saves in a function happen before the
+     first function call.  */
+  if (in_prologue (frame_pc_unwind (next_frame), PROC_LOW_ADDR (proc_desc))
+      /* Not sure exactly what kernel_trap means, but if it means the
+        kernel saves the registers without a prologue doing it, we
+        better not examine the prologue to see whether registers
+        have been saved yet.  */
+      && !kernel_trap)
+    {
+      /* We need to figure out whether the registers that the
+         proc_desc claims are saved have been saved yet.  */
+
+      CORE_ADDR addr;
+
+      /* Bitmasks; set if we have found a save for the register.  */
+      unsigned long gen_save_found = 0;
+      unsigned long float_save_found = 0;
+      int mips16;
+
+      /* If the address is odd, assume this is MIPS16 code.  */
+      addr = PROC_LOW_ADDR (proc_desc);
+      mips16 = pc_is_mips16 (addr);
+
+      /* Scan through this function's instructions preceding the
+         current PC, and look for those that save registers.  */
+      while (addr < frame_pc_unwind (next_frame))
+       {
+         if (mips16)
+           {
+             mips16_decode_reg_save (mips16_fetch_instruction (addr),
+                                     &gen_save_found);
+             addr += MIPS16_INSTLEN;
+           }
+         else
+           {
+             mips32_decode_reg_save (mips32_fetch_instruction (addr),
+                                     &gen_save_found, &float_save_found);
+             addr += MIPS_INSTLEN;
+           }
+       }
+      gen_mask = gen_save_found;
+      float_mask = float_save_found;
+    }
+
+  /* Fill in the offsets for the registers which gen_mask says were
+     saved.  */
+  {
+    CORE_ADDR reg_position = (cache->base
+                             + PROC_REG_OFFSET (proc_desc));
+    int ireg;
+    for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
+      if (gen_mask & 0x80000000)
+       {
+         cache->saved_regs[NUM_REGS + ireg].addr = reg_position;
+         reg_position -= mips_abi_regsize (gdbarch);
+       }
+  }
+
+  /* The MIPS16 entry instruction saves $s0 and $s1 in the reverse
+     order of that normally used by gcc.  Therefore, we have to fetch
+     the first instruction of the function, and if it's an entry
+     instruction that saves $s0 or $s1, correct their saved addresses.  */
+  if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc)))
+    {
+      ULONGEST inst = mips16_fetch_instruction (PROC_LOW_ADDR (proc_desc));
+      if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)
+       /* entry */
+       {
+         int reg;
+         int sreg_count = (inst >> 6) & 3;
+
+         /* Check if the ra register was pushed on the stack.  */
+         CORE_ADDR reg_position = (cache->base
+                                   + PROC_REG_OFFSET (proc_desc));
+         if (inst & 0x20)
+           reg_position -= mips_abi_regsize (gdbarch);
+
+         /* Check if the s0 and s1 registers were pushed on the
+            stack.  */
+         /* NOTE: cagney/2004-02-08: Huh?  This is doing no such
+             check.  */
+         for (reg = 16; reg < sreg_count + 16; reg++)
+           {
+             cache->saved_regs[NUM_REGS + reg].addr = reg_position;
+             reg_position -= mips_abi_regsize (gdbarch);
+           }
+       }
+    }
+
+  /* Fill in the offsets for the registers which float_mask says were
+     saved.  */
+  {
+    CORE_ADDR reg_position = (cache->base
+                             + PROC_FREG_OFFSET (proc_desc));
+    int ireg;
+    /* Fill in the offsets for the float registers which float_mask
+       says were saved.  */
+    for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1)
+      if (float_mask & 0x80000000)
+       {
+         if (mips_abi_regsize (gdbarch) == 4
+             && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+           {
+             /* On a big endian 32 bit ABI, floating point registers
+                are paired to form doubles such that the most
+                significant part is in $f[N+1] and the least
+                significant in $f[N] vis: $f[N+1] ||| $f[N].  The
+                registers are also spilled as a pair and stored as a
+                double.
+
+                When little-endian the least significant part is
+                stored first leading to the memory order $f[N] and
+                then $f[N+1].
+
+                Unfortunately, when big-endian the most significant
+                part of the double is stored first, and the least
+                significant is stored second.  This leads to the
+                registers being ordered in memory as firt $f[N+1] and
+                then $f[N].
+
+                For the big-endian case make certain that the
+                addresses point at the correct (swapped) locations
+                $f[N] and $f[N+1] pair (keep in mind that
+                reg_position is decremented each time through the
+                loop).  */
+             if ((ireg & 1))
+               cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg]
+                 .addr = reg_position - mips_abi_regsize (gdbarch);
+             else
+               cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg]
+                 .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_abi_regsize (gdbarch);
+       }
+
+    cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc]
+      = cache->saved_regs[NUM_REGS + RA_REGNUM];
+  }
+
+  /* SP_REGNUM, contains the value and not the address.  */
+  trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base);
+
+  return (*this_cache);
+}
+
+static void
+mips_insn16_frame_this_id (struct frame_info *next_frame, void **this_cache,
+                          struct frame_id *this_id)
+{
+  struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame,
+                                                          this_cache);
+  (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
 }
 
 static void
@@ -2067,256 +2041,162 @@ mips_insn16_frame_base_sniffer (struct frame_info *next_frame)
     return NULL;
 }
 
-/* Mark all the registers as unset in the saved_regs array
-   of THIS_CACHE.  Do nothing if THIS_CACHE is null.  */
+/* Heuristic unwinder for procedures using 32-bit instructions (covers
+   both 32-bit and 64-bit MIPS ISAs).  Procedures using 16-bit
+   instructions (a.k.a. MIPS16) are handled by the mips_insn16
+   unwinder.  */
 
-void
-reset_saved_regs (struct mips_frame_cache *this_cache)
+static struct mips_frame_cache *
+mips_insn32_frame_cache (struct frame_info *next_frame, void **this_cache)
 {
-  if (this_cache == NULL || this_cache->saved_regs == NULL)
-    return;
-
-  {
-    const int num_regs = NUM_REGS;
-    int i;
-
-    for (i = 0; i < num_regs; i++)
-      {
-        this_cache->saved_regs[i].addr = -1;
-      }
-  }
-}
-
-/* Analyze the function prologue from START_PC to LIMIT_PC. Builds
-   the associated FRAME_CACHE if not null.  
-   Return the address of the first instruction past the prologue.  */
+  mips_extra_func_info_t proc_desc;
+  struct mips_frame_cache *cache;
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  /* r0 bit means kernel trap */
+  int kernel_trap;
+  /* What registers have been saved?  Bitmasks.  */
+  unsigned long gen_mask, float_mask;
 
-static CORE_ADDR
-mips32_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
-                      struct frame_info *next_frame,
-                      struct mips_frame_cache *this_cache)
-{
-  CORE_ADDR cur_pc;
-  CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */
-  CORE_ADDR sp;
-  long frame_offset;
-  int  frame_reg = MIPS_SP_REGNUM;
+  if ((*this_cache) != NULL)
+    return (*this_cache);
+  cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache);
+  (*this_cache) = cache;
+  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
 
-  CORE_ADDR end_prologue_addr = 0;
-  int seen_sp_adjust = 0;
-  int load_immediate_bytes = 0;
+  /* Synthesize a proc descriptor.  */
+  {
+    const CORE_ADDR pc = frame_pc_unwind (next_frame);
+    CORE_ADDR start_addr;
 
-  /* Can be called when there's no process, and hence when there's no
-     NEXT_FRAME.  */
-  if (next_frame != NULL)
-    sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM);
-  else
-    sp = 0;
+    find_pc_partial_function (pc, NULL, &start_addr, NULL);
+    if (start_addr == 0)
+      start_addr = heuristic_proc_start (pc);
 
-  if (limit_pc > start_pc + 200)
-    limit_pc = start_pc + 200;
+#ifdef NOT_YET
+    proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, *this_cache);
+#else
+    proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, NULL);
+#endif
+  }
+  
+  if (proc_desc == NULL)
+    /* I'm not sure how/whether this can happen.  Normally when we
+       can't find a proc_desc, we "synthesize" one using
+       heuristic_proc_desc and set the saved_regs right away.  */
+    return cache;
 
-restart:
+  /* Extract the frame's base.  */
+  cache->base = (frame_unwind_register_signed (next_frame, NUM_REGS + PROC_FRAME_REG (proc_desc))
+                + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc));
 
-  frame_offset = 0;
-  for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS_INSTLEN)
+  kernel_trap = PROC_REG_MASK (proc_desc) & 1;
+  gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc);
+  float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc);
+  
+  /* In any frame other than the innermost or a frame interrupted by a
+     signal, we assume that all registers have been saved.  This
+     assumes that all register saves in a function happen before the
+     first function call.  */
+  if (in_prologue (frame_pc_unwind (next_frame), PROC_LOW_ADDR (proc_desc))
+      /* Not sure exactly what kernel_trap means, but if it means the
+        kernel saves the registers without a prologue doing it, we
+        better not examine the prologue to see whether registers
+        have been saved yet.  */
+      && !kernel_trap)
     {
-      unsigned long inst, high_word, low_word;
-      int reg;
+      /* We need to figure out whether the registers that the
+         proc_desc claims are saved have been saved yet.  */
 
-      /* Fetch the instruction.   */
-      inst = (unsigned long) mips_fetch_instruction (cur_pc);
+      CORE_ADDR addr;
 
-      /* Save some code by pre-extracting some useful fields.  */
-      high_word = (inst >> 16) & 0xffff;
-      low_word = inst & 0xffff;
-      reg = high_word & 0x1f;
-
-      if (high_word == 0x27bd  /* addiu $sp,$sp,-i */
-         || high_word == 0x23bd        /* addi $sp,$sp,-i */
-         || high_word == 0x67bd)       /* daddiu $sp,$sp,-i */
-       {
-         if (low_word & 0x8000)        /* negative stack adjustment? */
-            frame_offset += 0x10000 - low_word;
-         else
-           /* Exit loop if a positive stack adjustment is found, which
-              usually means that the stack cleanup code in the function
-              epilogue is reached.  */
-           break;
-          seen_sp_adjust = 1;
-       }
-      else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */
-       {
-         set_reg_offset (this_cache, reg, sp + low_word);
-       }
-      else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */
-       {
-         /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra.  */
-         set_reg_offset (this_cache, 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 != frame_offset)
-           frame_addr = sp + low_word;
-         else if (frame_reg == MIPS_SP_REGNUM)
-           {
-             unsigned alloca_adjust;
+      /* Bitmasks; set if we have found a save for the register.  */
+      unsigned long gen_save_found = 0;
+      unsigned long float_save_found = 0;
 
-             frame_reg = 30;
-             frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30);
-             alloca_adjust = (unsigned) (frame_addr - (sp + low_word));
-             if (alloca_adjust > 0)
-               {
-                  /* FP > SP + frame_size. This may be because of
-                     an alloca or somethings similar.  Fix sp to
-                     "pre-alloca" value, and try again.  */
-                 sp += alloca_adjust;
-                  /* Need to reset the status of all registers.  Otherwise,
-                     we will hit a guard that prevents the new address
-                     for each register to be recomputed during the second
-                     pass.  */
-                  reset_saved_regs (this_cache);
-                 goto restart;
-               }
-           }
-       }
-      /* move $30,$sp.  With different versions of gas this will be either
-         `addu $30,$sp,$zero' or `or $30,$sp,$zero' or `daddu 30,sp,$0'.
-         Accept any one of these.  */
-      else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
-       {
-         /* New gcc frame, virtual frame pointer is at r30 + frame_size.  */
-         if (frame_reg == MIPS_SP_REGNUM)
-           {
-             unsigned alloca_adjust;
+      addr = PROC_LOW_ADDR (proc_desc);
 
-             frame_reg = 30;
-             frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30);
-             alloca_adjust = (unsigned) (frame_addr - sp);
-             if (alloca_adjust > 0)
-               {
-                  /* FP > SP + frame_size. This may be because of
-                     an alloca or somethings similar.  Fix sp to
-                     "pre-alloca" value, and try again.  */
-                 sp = frame_addr;
-                  /* Need to reset the status of all registers.  Otherwise,
-                     we will hit a guard that prevents the new address
-                     for each register to be recomputed during the second
-                     pass.  */
-                  reset_saved_regs (this_cache);
-                 goto restart;
-               }
-           }
-       }
-      else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */
+      /* Scan through this function's instructions preceding the
+         current PC, and look for those that save registers.  */
+      while (addr < frame_pc_unwind (next_frame))
        {
-         set_reg_offset (this_cache, reg, frame_addr + low_word);
+          mips32_decode_reg_save (mips32_fetch_instruction (addr),
+                                  &gen_save_found, &float_save_found);
+          addr += MIPS_INSTLEN;
        }
-      else if ((high_word & 0xFFE0) == 0xE7A0 /* swc1 freg,n($sp) */
-               || (high_word & 0xF3E0) == 0xA3C0 /* sx reg,n($s8) */
-               || (inst & 0xFF9F07FF) == 0x00800021 /* move reg,$a0-$a3 */
-               || high_word == 0x3c1c /* lui $gp,n */
-               || high_word == 0x279c /* addiu $gp,$gp,n */
-               || inst == 0x0399e021 /* addu $gp,$gp,$t9 */
-               || inst == 0x033ce021 /* addu $gp,$t9,$gp */
-              )
-       {
-         /* These instructions are part of the prologue, but we don't
-            need to do anything special to handle them.  */
-       }
-      /* The instructions below load $at or $t0 with an immediate
-         value in preparation for a stack adjustment via
-         subu $sp,$sp,[$at,$t0]. These instructions could also
-         initialize a local variable, so we accept them only before
-         a stack adjustment instruction was seen.  */
-      else if (!seen_sp_adjust
-               && (high_word == 0x3c01 /* lui $at,n */
-                   || high_word == 0x3c08 /* lui $t0,n */
-                   || high_word == 0x3421 /* ori $at,$at,n */
-                   || high_word == 0x3508 /* ori $t0,$t0,n */
-                   || high_word == 0x3401 /* ori $at,$zero,n */
-                   || high_word == 0x3408 /* ori $t0,$zero,n */
-                  ))
-       {
-          load_immediate_bytes += MIPS_INSTLEN;     /* FIXME!! */
-       }
-      else
-       {
-         /* This instruction is not an instruction typically found
-            in a prologue, so we must have reached the end of the
-            prologue.  */
-         /* FIXME: brobecker/2004-10-10: Can't we just break out of this
-            loop now?  Why would we need to continue scanning the function
-            instructions?  */
-         if (end_prologue_addr == 0)
-           end_prologue_addr = cur_pc;
-       }
+      gen_mask = gen_save_found;
+      float_mask = float_save_found;
     }
 
-  if (this_cache != NULL)
-    {
-      this_cache->base = 
-        (frame_unwind_register_signed (next_frame, NUM_REGS + frame_reg)
-         + frame_offset);
-      /* FIXME: brobecker/2004-09-15: We should be able to get rid of
-         this assignment below, eventually.  But it's still needed
-         for now.  */
-      this_cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc]
-        = this_cache->saved_regs[NUM_REGS + RA_REGNUM];
-    }
-
-  /* If we didn't reach the end of the prologue when scanning the function
-     instructions, then set end_prologue_addr to the address of the
-     instruction immediately after the last one we scanned.  */
-  /* brobecker/2004-10-10: I don't think this would ever happen, but
-     we may as well be careful and do our best if we have a null
-     end_prologue_addr.  */
-  if (end_prologue_addr == 0)
-    end_prologue_addr = cur_pc;
-     
-  /* In a frameless function, we might have incorrectly
-     skipped some load immediate instructions. Undo the skipping
-     if the load immediate was not followed by a stack adjustment.  */
-  if (load_immediate_bytes && !seen_sp_adjust)
-    end_prologue_addr -= load_immediate_bytes;
-
-  return end_prologue_addr;
-}
+  /* Fill in the offsets for the registers which gen_mask says were
+     saved.  */
+  {
+    CORE_ADDR reg_position = (cache->base
+                             + PROC_REG_OFFSET (proc_desc));
+    int ireg;
+    for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
+      if (gen_mask & 0x80000000)
+       {
+         cache->saved_regs[NUM_REGS + ireg].addr = reg_position;
+         reg_position -= mips_abi_regsize (gdbarch);
+       }
+  }
 
-/* Heuristic unwinder for procedures using 32-bit instructions (covers
-   both 32-bit and 64-bit MIPS ISAs).  Procedures using 16-bit
-   instructions (a.k.a. MIPS16) are handled by the mips_insn16
-   unwinder.  */
+  /* Fill in the offsets for the registers which float_mask says were
+     saved.  */
+  {
+    CORE_ADDR reg_position = (cache->base + PROC_FREG_OFFSET (proc_desc));
+    int ireg;
 
-static struct mips_frame_cache *
-mips_insn32_frame_cache (struct frame_info *next_frame, void **this_cache)
-{
-  struct mips_frame_cache *cache;
+    /* Fill in the offsets for the float registers which float_mask
+       says were saved.  */
+    for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1)
+      if (float_mask & 0x80000000)
+       {
+          const int regno =
+            NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg;
 
-  if ((*this_cache) != NULL)
-    return (*this_cache);
+         if (mips_abi_regsize (gdbarch) == 4
+             && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+           {
+             /* On a big endian 32 bit ABI, floating point registers
+                are paired to form doubles such that the most
+                significant part is in $f[N+1] and the least
+                significant in $f[N] vis: $f[N+1] ||| $f[N].  The
+                registers are also spilled as a pair and stored as a
+                double.
 
-  cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache);
-  (*this_cache) = cache;
-  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+                When little-endian the least significant part is
+                stored first leading to the memory order $f[N] and
+                then $f[N+1].
 
-  /* Analyze the function prologue.  */
-  {
-    const CORE_ADDR pc = frame_pc_unwind (next_frame);
-    CORE_ADDR start_addr;
+                Unfortunately, when big-endian the most significant
+                part of the double is stored first, and the least
+                significant is stored second.  This leads to the
+                registers being ordered in memory as firt $f[N+1] and
+                then $f[N].
 
-    find_pc_partial_function (pc, NULL, &start_addr, NULL);
-    if (start_addr == 0)
-      start_addr = heuristic_proc_start (pc);
-    /* We can't analyze the prologue if we couldn't find the begining
-       of the function.  */
-    if (start_addr == 0)
-      return cache;
+                For the big-endian case make certain that the
+                addresses point at the correct (swapped) locations
+                $f[N] and $f[N+1] pair (keep in mind that
+                reg_position is decremented each time through the
+                loop).  */
+             if ((ireg & 1))
+               cache->saved_regs[regno].addr =
+                  reg_position - mips_abi_regsize (gdbarch);
+             else
+               cache->saved_regs[regno].addr =
+                 reg_position + mips_abi_regsize (gdbarch);
+           }
+         else
+           cache->saved_regs[regno].addr = reg_position;
+         reg_position -= mips_abi_regsize (gdbarch);
+       }
 
-    mips32_scan_prologue (start_addr, pc, next_frame, *this_cache);
+    cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc]
+      = cache->saved_regs[NUM_REGS + RA_REGNUM];
   }
-  
+
   /* SP_REGNUM, contains the value and not the address.  */
   trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base);
 
@@ -2493,6 +2373,12 @@ read_next_frame_reg (struct frame_info *fi, int regno)
       regcache_cooked_read_signed (current_regcache, regno, &val);
       return val;
     }
+  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.  */
+    return frame_unwind_register_signed (fi, regno % NUM_REGS);
   else
     return frame_unwind_register_signed (fi, regno);
 
@@ -2554,6 +2440,30 @@ mips_software_single_step (enum target_signal sig, int insert_breakpoints_p)
 
 static struct mips_extra_func_info temp_proc_desc;
 
+/* Set a register's saved stack address in temp_saved_regs.  If an
+   address has already been set for this register, do nothing; this
+   way we will only recognize the first save of a given register in a
+   function prologue.
+
+   For simplicity, save the address in both [0 .. NUM_REGS) and
+   [NUM_REGS .. 2*NUM_REGS).  Strictly speaking, only the second range
+   is used as it is only second range (the ABI instead of ISA
+   registers) that comes into play when finding saved registers in a
+   frame.  */
+
+static void
+set_reg_offset (struct mips_frame_cache *this_cache, int regnum,
+               CORE_ADDR offset)
+{
+  if (this_cache != NULL
+      && this_cache->saved_regs[regnum].addr == 0)
+    {
+      this_cache->saved_regs[regnum + 0 * NUM_REGS].addr = offset;
+      this_cache->saved_regs[regnum + 1 * NUM_REGS].addr = offset;
+    }
+}
+
+
 /* Test whether the PC points to the return instruction at the
    end of a function. */
 
@@ -2594,77 +2504,355 @@ heuristic_proc_start (CORE_ADDR pc)
   if (heuristic_fence_post == UINT_MAX || fence < VM_MIN_ADDRESS)
     fence = VM_MIN_ADDRESS;
 
-  instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN;
+  instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN;
+
+  /* search back for previous return */
+  for (start_pc -= instlen;; start_pc -= instlen)
+    if (start_pc < fence)
+      {
+       /* It's not clear to me why we reach this point when
+          stop_soon, but with this test, at least we
+          don't print out warnings for every child forked (eg, on
+          decstation).  22apr93 rich@cygnus.com.  */
+       if (stop_soon == NO_STOP_QUIETLY)
+         {
+           static int blurb_printed = 0;
+
+           warning ("GDB can't find the start of the function at 0x%s.",
+                    paddr_nz (pc));
+
+           if (!blurb_printed)
+             {
+               /* This actually happens frequently in embedded
+                  development, when you first connect to a board
+                  and your stack pointer and pc are nowhere in
+                  particular.  This message needs to give people
+                  in that situation enough information to
+                  determine that it's no big deal.  */
+               printf_filtered ("\n\
+    GDB is unable to find the start of the function at 0x%s\n\
+and thus can't determine the size of that function's stack frame.\n\
+This means that GDB may be unable to access that stack frame, or\n\
+the frames below it.\n\
+    This problem is most likely caused by an invalid program counter or\n\
+stack pointer.\n\
+    However, if you think GDB should simply search farther back\n\
+from 0x%s for code which looks like the beginning of a\n\
+function, you can increase the range of the search using the `set\n\
+heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc));
+               blurb_printed = 1;
+             }
+         }
+
+       return 0;
+      }
+    else if (pc_is_mips16 (start_pc))
+      {
+       unsigned short inst;
+
+       /* On MIPS16, any one of the following is likely to be the
+          start of a function:
+          entry
+          addiu sp,-n
+          daddiu sp,-n
+          extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'  */
+       inst = mips_fetch_instruction (start_pc);
+       if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)      /* entry */
+           || (inst & 0xff80) == 0x6380        /* addiu sp,-n */
+           || (inst & 0xff80) == 0xfb80        /* daddiu sp,-n */
+           || ((inst & 0xf810) == 0xf010 && seen_adjsp))       /* extend -n */
+         break;
+       else if ((inst & 0xff00) == 0x6300      /* addiu sp */
+                || (inst & 0xff00) == 0xfb00)  /* daddiu sp */
+         seen_adjsp = 1;
+       else
+         seen_adjsp = 0;
+      }
+    else if (mips_about_to_return (start_pc))
+      {
+       start_pc += 2 * MIPS_INSTLEN;   /* skip return, and its delay slot */
+       break;
+      }
+
+  return start_pc;
+}
+
+/* Fetch the immediate value from a MIPS16 instruction.
+   If the previous instruction was an EXTEND, use it to extend
+   the upper bits of the immediate value.  This is a helper function
+   for mips16_heuristic_proc_desc.  */
+
+static int
+mips16_get_imm (unsigned short prev_inst,      /* previous instruction */
+               unsigned short inst,    /* current instruction */
+               int nbits,      /* number of bits in imm field */
+               int scale,      /* scale factor to be applied to imm */
+               int is_signed)  /* is the imm field signed? */
+{
+  int offset;
+
+  if ((prev_inst & 0xf800) == 0xf000)  /* prev instruction was EXTEND? */
+    {
+      offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
+      if (offset & 0x8000)     /* check for negative extend */
+       offset = 0 - (0x10000 - (offset & 0xffff));
+      return offset | (inst & 0x1f);
+    }
+  else
+    {
+      int max_imm = 1 << nbits;
+      int mask = max_imm - 1;
+      int sign_bit = max_imm >> 1;
+
+      offset = inst & mask;
+      if (is_signed && (offset & sign_bit))
+       offset = 0 - (max_imm - offset);
+      return offset * scale;
+    }
+}
+
+
+/* Fill in values in temp_proc_desc based on the MIPS16 instruction
+   stream from start_pc to limit_pc.  */
+
+static void
+mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
+                           CORE_ADDR sp,
+                           struct frame_info *next_frame,
+                           struct mips_frame_cache *this_cache)
+{
+  CORE_ADDR cur_pc;
+  CORE_ADDR frame_addr = 0;    /* Value of $r17, used as frame pointer */
+  unsigned short prev_inst = 0;        /* saved copy of previous instruction */
+  unsigned inst = 0;           /* current instruction */
+  unsigned entry_inst = 0;     /* the entry instruction */
+  int reg, offset;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  PROC_FRAME_OFFSET (&temp_proc_desc) = 0;     /* size of stack frame */
+  PROC_FRAME_ADJUST (&temp_proc_desc) = 0;     /* offset of FP from SP */
+
+  for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS16_INSTLEN)
+    {
+      /* Save the previous instruction.  If it's an EXTEND, we'll extract
+         the immediate offset extension from it in mips16_get_imm.  */
+      prev_inst = inst;
+
+      /* Fetch and decode the instruction.   */
+      inst = (unsigned short) mips_fetch_instruction (cur_pc);
+      if ((inst & 0xff00) == 0x6300    /* addiu sp */
+         || (inst & 0xff00) == 0xfb00) /* daddiu sp */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 8, 8, 1);
+         if (offset < 0)       /* negative stack adjustment? */
+           PROC_FRAME_OFFSET (&temp_proc_desc) -= offset;
+         else
+           /* Exit loop if a positive stack adjustment is found, which
+              usually means that the stack cleanup code in the function
+              epilogue is reached.  */
+           break;
+       }
+      else if ((inst & 0xf800) == 0xd000)      /* sw reg,n($sp) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
+         reg = mips16_to_32_reg[(inst & 0x700) >> 8];
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << reg);
+         set_reg_offset (this_cache, reg, sp + offset);
+       }
+      else if ((inst & 0xff00) == 0xf900)      /* sd reg,n($sp) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
+         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << reg);
+         set_reg_offset (this_cache, reg, sp + offset);
+       }
+      else if ((inst & 0xff00) == 0x6200)      /* sw $ra,n($sp) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM);
+         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
+       }
+      else if ((inst & 0xff00) == 0xfa00)      /* sd $ra,n($sp) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 8, 8, 0);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM);
+         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
+       }
+      else if (inst == 0x673d) /* move $s1, $sp */
+       {
+         frame_addr = sp;
+         PROC_FRAME_REG (&temp_proc_desc) = 17;
+       }
+      else if ((inst & 0xff00) == 0x0100)      /* addiu $s1,sp,n */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
+         frame_addr = sp + offset;
+         PROC_FRAME_REG (&temp_proc_desc) = 17;
+         PROC_FRAME_ADJUST (&temp_proc_desc) = offset;
+       }
+      else if ((inst & 0xFF00) == 0xd900)      /* sw reg,offset($s1) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 5, 4, 0);
+         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, frame_addr + offset);
+       }
+      else if ((inst & 0xFF00) == 0x7900)      /* sd reg,offset($s1) */
+       {
+         offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
+         reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, frame_addr + offset);
+       }
+      else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)   /* entry */
+       entry_inst = inst;      /* save for later processing */
+      else if ((inst & 0xf800) == 0x1800)      /* jal(x) */
+       cur_pc += MIPS16_INSTLEN;       /* 32-bit instruction */
+    }
+
+  /* The entry instruction is typically the first instruction in a function,
+     and it stores registers at offsets relative to the value of the old SP
+     (before the prologue).  But the value of the sp parameter to this
+     function is the new SP (after the prologue has been executed).  So we
+     can't calculate those offsets until we've seen the entire prologue,
+     and can calculate what the old SP must have been. */
+  if (entry_inst != 0)
+    {
+      int areg_count = (entry_inst >> 8) & 7;
+      int sreg_count = (entry_inst >> 6) & 3;
+
+      /* The entry instruction always subtracts 32 from the SP.  */
+      PROC_FRAME_OFFSET (&temp_proc_desc) += 32;
+
+      /* Now we can calculate what the SP must have been at the
+         start of the function prologue.  */
+      sp += PROC_FRAME_OFFSET (&temp_proc_desc);
 
-  /* search back for previous return */
-  for (start_pc -= instlen;; start_pc -= instlen)
-    if (start_pc < fence)
-      {
-       /* It's not clear to me why we reach this point when
-          stop_soon, but with this test, at least we
-          don't print out warnings for every child forked (eg, on
-          decstation).  22apr93 rich@cygnus.com.  */
-       if (stop_soon == NO_STOP_QUIETLY)
-         {
-           static int blurb_printed = 0;
+      /* Check if a0-a3 were saved in the caller's argument save area.  */
+      for (reg = 4, offset = 0; reg < areg_count + 4; reg++)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, sp + offset);
+         offset += mips_abi_regsize (current_gdbarch);
+       }
 
-           warning ("GDB can't find the start of the function at 0x%s.",
-                    paddr_nz (pc));
+      /* Check if the ra register was pushed on the stack.  */
+      offset = -4;
+      if (entry_inst & 0x20)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM;
+         set_reg_offset (this_cache, RA_REGNUM, sp + offset);
+         offset -= mips_abi_regsize (current_gdbarch);
+       }
 
-           if (!blurb_printed)
-             {
-               /* This actually happens frequently in embedded
-                  development, when you first connect to a board
-                  and your stack pointer and pc are nowhere in
-                  particular.  This message needs to give people
-                  in that situation enough information to
-                  determine that it's no big deal.  */
-               printf_filtered ("\n\
-    GDB is unable to find the start of the function at 0x%s\n\
-and thus can't determine the size of that function's stack frame.\n\
-This means that GDB may be unable to access that stack frame, or\n\
-the frames below it.\n\
-    This problem is most likely caused by an invalid program counter or\n\
-stack pointer.\n\
-    However, if you think GDB should simply search farther back\n\
-from 0x%s for code which looks like the beginning of a\n\
-function, you can increase the range of the search using the `set\n\
-heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc));
-               blurb_printed = 1;
-             }
-         }
+      /* Check if the s0 and s1 registers were pushed on the stack.  */
+      for (reg = 16; reg < sreg_count + 16; reg++)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, sp + offset);
+         offset -= mips_abi_regsize (current_gdbarch);
+       }
+    }
+}
 
-       return 0;
-      }
-    else if (pc_is_mips16 (start_pc))
-      {
-       unsigned short inst;
+static void
+mips32_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
+                           CORE_ADDR sp, struct frame_info *next_frame,
+                           struct mips_frame_cache *this_cache)
+{
+  CORE_ADDR cur_pc;
+  CORE_ADDR frame_addr = 0;    /* Value of $r30. Used by gcc for frame-pointer */
+restart:
+  PROC_FRAME_OFFSET (&temp_proc_desc) = 0;
+  PROC_FRAME_ADJUST (&temp_proc_desc) = 0;     /* offset of FP from SP */
+  for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS_INSTLEN)
+    {
+      unsigned long inst, high_word, low_word;
+      int reg;
 
-       /* On MIPS16, any one of the following is likely to be the
-          start of a function:
-          entry
-          addiu sp,-n
-          daddiu sp,-n
-          extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'  */
-       inst = mips_fetch_instruction (start_pc);
-       if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)      /* entry */
-           || (inst & 0xff80) == 0x6380        /* addiu sp,-n */
-           || (inst & 0xff80) == 0xfb80        /* daddiu sp,-n */
-           || ((inst & 0xf810) == 0xf010 && seen_adjsp))       /* extend -n */
-         break;
-       else if ((inst & 0xff00) == 0x6300      /* addiu sp */
-                || (inst & 0xff00) == 0xfb00)  /* daddiu sp */
-         seen_adjsp = 1;
-       else
-         seen_adjsp = 0;
-      }
-    else if (mips_about_to_return (start_pc))
-      {
-       start_pc += 2 * MIPS_INSTLEN;   /* skip return, and its delay slot */
-       break;
-      }
+      /* Fetch the instruction.   */
+      inst = (unsigned long) mips_fetch_instruction (cur_pc);
 
-  return start_pc;
+      /* Save some code by pre-extracting some useful fields.  */
+      high_word = (inst >> 16) & 0xffff;
+      low_word = inst & 0xffff;
+      reg = high_word & 0x1f;
+
+      if (high_word == 0x27bd  /* addiu $sp,$sp,-i */
+         || high_word == 0x23bd        /* addi $sp,$sp,-i */
+         || high_word == 0x67bd)       /* daddiu $sp,$sp,-i */
+       {
+         if (low_word & 0x8000)        /* negative stack adjustment? */
+           PROC_FRAME_OFFSET (&temp_proc_desc) += 0x10000 - low_word;
+         else
+           /* Exit loop if a positive stack adjustment is found, which
+              usually means that the stack cleanup code in the function
+              epilogue is reached.  */
+           break;
+       }
+      else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, sp + low_word);
+       }
+      else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */
+       {
+         /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and
+            $ra.  */
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, 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) == MIPS_SP_REGNUM)
+           {
+             unsigned alloca_adjust;
+             PROC_FRAME_REG (&temp_proc_desc) = 30;
+             frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30);
+             alloca_adjust = (unsigned) (frame_addr - (sp + low_word));
+             if (alloca_adjust > 0)
+               {
+                 /* FP > SP + frame_size. This may be because
+                  * of an alloca or somethings similar.
+                  * Fix sp to "pre-alloca" value, and try again.
+                  */
+                 sp += alloca_adjust;
+                 goto restart;
+               }
+           }
+       }
+      /* move $30,$sp.  With different versions of gas this will be either
+         `addu $30,$sp,$zero' or `or $30,$sp,$zero' or `daddu 30,sp,$0'.
+         Accept any one of these.  */
+      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) == MIPS_SP_REGNUM)
+           {
+             unsigned alloca_adjust;
+             PROC_FRAME_REG (&temp_proc_desc) = 30;
+             frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30);
+             alloca_adjust = (unsigned) (frame_addr - sp);
+             if (alloca_adjust > 0)
+               {
+                 /* FP > SP + frame_size. This may be because
+                  * of an alloca or somethings similar.
+                  * Fix sp to "pre-alloca" value, and try again.
+                  */
+                 sp += alloca_adjust;
+                 goto restart;
+               }
+           }
+       }
+      else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (this_cache, reg, frame_addr + low_word);
+       }
+    }
 }
 
 static mips_extra_func_info_t
@@ -2672,19 +2860,30 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
                     struct frame_info *next_frame,
                     struct mips_frame_cache *this_cache)
 {
+  CORE_ADDR sp;
+
+  /* Can be called when there's no process, and hence when there's no
+     NEXT_FRAME.  */
+  if (next_frame != NULL)
+    sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM);
+  else
+    sp = 0;
+
   if (start_pc == 0)
     return NULL;
-
   memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
   PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
   PROC_FRAME_REG (&temp_proc_desc) = MIPS_SP_REGNUM;
   PROC_PC_REG (&temp_proc_desc) = RA_REGNUM;
 
+  if (start_pc + 200 < limit_pc)
+    limit_pc = start_pc + 200;
   if (pc_is_mips16 (start_pc))
-    mips16_scan_prologue (start_pc, limit_pc, next_frame, this_cache);
+    mips16_heuristic_proc_desc (start_pc, limit_pc, sp,
+                               next_frame, this_cache);
   else
-    mips32_scan_prologue (start_pc, limit_pc, next_frame, this_cache);
-
+    mips32_heuristic_proc_desc (start_pc, limit_pc, sp,
+                               next_frame, this_cache);
   return &temp_proc_desc;
 }
 
@@ -4975,6 +5174,199 @@ mips_step_skips_delay (CORE_ADDR pc)
                     extract_unsigned_integer (buf, MIPS_INSTLEN));
 }
 
+/* Skip the PC past function prologue instructions (32-bit version).
+   This is a helper function for mips_skip_prologue.  */
+
+static CORE_ADDR
+mips32_skip_prologue (CORE_ADDR pc)
+{
+  t_inst inst;
+  CORE_ADDR end_pc;
+  int seen_sp_adjust = 0;
+  int load_immediate_bytes = 0;
+
+  /* Find an upper bound on the prologue.  */
+  end_pc = skip_prologue_using_sal (pc);
+  if (end_pc == 0)
+    end_pc = pc + 100;         /* Magic.  */
+
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (; pc < end_pc; pc += MIPS_INSTLEN)
+    {
+      unsigned long high_word;
+
+      inst = mips_fetch_instruction (pc);
+      high_word = (inst >> 16) & 0xffff;
+
+      if (high_word == 0x27bd  /* addiu $sp,$sp,offset */
+         || high_word == 0x67bd)       /* daddiu $sp,$sp,offset */
+       seen_sp_adjust = 1;
+      else if (inst == 0x03a1e823 ||   /* subu $sp,$sp,$at */
+              inst == 0x03a8e823)      /* subu $sp,$sp,$t0 */
+       seen_sp_adjust = 1;
+      else if (((inst & 0xFFE00000) == 0xAFA00000      /* sw reg,n($sp) */
+               || (inst & 0xFFE00000) == 0xFFA00000)   /* sd reg,n($sp) */
+              && (inst & 0x001F0000))  /* reg != $zero */
+       continue;
+
+      else if ((inst & 0xFFE00000) == 0xE7A00000)      /* swc1 freg,n($sp) */
+       continue;
+      else if ((inst & 0xF3E00000) == 0xA3C00000 && (inst & 0x001F0000))
+       /* sx reg,n($s8) */
+       continue;               /* reg != $zero */
+
+      /* move $s8,$sp.  With different versions of gas this will be either
+         `addu $s8,$sp,$zero' or `or $s8,$sp,$zero' or `daddu s8,sp,$0'.
+         Accept any one of these.  */
+      else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
+       continue;
+
+      else if ((inst & 0xFF9F07FF) == 0x00800021)      /* move reg,$a0-$a3 */
+       continue;
+      else if (high_word == 0x3c1c)    /* lui $gp,n */
+       continue;
+      else if (high_word == 0x279c)    /* addiu $gp,$gp,n */
+       continue;
+      else if (inst == 0x0399e021      /* addu $gp,$gp,$t9 */
+              || inst == 0x033ce021)   /* addu $gp,$t9,$gp */
+       continue;
+      /* The following instructions load $at or $t0 with an immediate
+         value in preparation for a stack adjustment via
+         subu $sp,$sp,[$at,$t0]. These instructions could also initialize
+         a local variable, so we accept them only before a stack adjustment
+         instruction was seen.  */
+      else if (!seen_sp_adjust)
+       {
+         if (high_word == 0x3c01 ||    /* lui $at,n */
+             high_word == 0x3c08)      /* lui $t0,n */
+           {
+             load_immediate_bytes += MIPS_INSTLEN;     /* FIXME!! */
+             continue;
+           }
+         else if (high_word == 0x3421 ||       /* ori $at,$at,n */
+                  high_word == 0x3508 ||       /* ori $t0,$t0,n */
+                  high_word == 0x3401 ||       /* ori $at,$zero,n */
+                  high_word == 0x3408) /* ori $t0,$zero,n */
+           {
+             load_immediate_bytes += MIPS_INSTLEN;     /* FIXME!! */
+             continue;
+           }
+         else
+           break;
+       }
+      else
+       break;
+    }
+
+  /* In a frameless function, we might have incorrectly
+     skipped some load immediate instructions. Undo the skipping
+     if the load immediate was not followed by a stack adjustment.  */
+  if (load_immediate_bytes && !seen_sp_adjust)
+    pc -= load_immediate_bytes;
+  return pc;
+}
+
+/* Skip the PC past function prologue instructions (16-bit version).
+   This is a helper function for mips_skip_prologue.  */
+
+static CORE_ADDR
+mips16_skip_prologue (CORE_ADDR pc)
+{
+  CORE_ADDR end_pc;
+  int extend_bytes = 0;
+  int prev_extend_bytes;
+
+  /* Table of instructions likely to be found in a function prologue.  */
+  static struct
+  {
+    unsigned short inst;
+    unsigned short mask;
+  }
+  table[] =
+  {
+    {
+    0x6300, 0xff00}
+    ,                          /* addiu $sp,offset */
+    {
+    0xfb00, 0xff00}
+    ,                          /* daddiu $sp,offset */
+    {
+    0xd000, 0xf800}
+    ,                          /* sw reg,n($sp) */
+    {
+    0xf900, 0xff00}
+    ,                          /* sd reg,n($sp) */
+    {
+    0x6200, 0xff00}
+    ,                          /* sw $ra,n($sp) */
+    {
+    0xfa00, 0xff00}
+    ,                          /* sd $ra,n($sp) */
+    {
+    0x673d, 0xffff}
+    ,                          /* move $s1,sp */
+    {
+    0xd980, 0xff80}
+    ,                          /* sw $a0-$a3,n($s1) */
+    {
+    0x6704, 0xff1c}
+    ,                          /* move reg,$a0-$a3 */
+    {
+    0xe809, 0xf81f}
+    ,                          /* entry pseudo-op */
+    {
+    0x0100, 0xff00}
+    ,                          /* addiu $s1,$sp,n */
+    {
+    0, 0}                      /* end of table marker */
+  };
+
+  /* Find an upper bound on the prologue.  */
+  end_pc = skip_prologue_using_sal (pc);
+  if (end_pc == 0)
+    end_pc = pc + 100;         /* Magic.  */
+
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (; pc < end_pc; pc += MIPS16_INSTLEN)
+    {
+      unsigned short inst;
+      int i;
+
+      inst = mips_fetch_instruction (pc);
+
+      /* Normally we ignore an extend instruction.  However, if it is
+         not followed by a valid prologue instruction, we must adjust
+         the pc back over the extend so that it won't be considered
+         part of the prologue.  */
+      if ((inst & 0xf800) == 0xf000)   /* extend */
+       {
+         extend_bytes = MIPS16_INSTLEN;
+         continue;
+       }
+      prev_extend_bytes = extend_bytes;
+      extend_bytes = 0;
+
+      /* Check for other valid prologue instructions besides extend.  */
+      for (i = 0; table[i].mask != 0; i++)
+       if ((inst & table[i].mask) == table[i].inst)    /* found, get out */
+         break;
+      if (table[i].mask != 0)  /* it was in table? */
+       continue;               /* ignore it */
+      else
+       /* non-prologue */
+       {
+         /* Return the current pc, adjusted backwards by 2 if
+            the previous instruction was an extend.  */
+         return pc - prev_extend_bytes;
+       }
+    }
+  return pc;
+}
+
 /* To skip prologues, I use this predicate.  Returns either PC itself
    if the code at PC does not look like a function prologue; otherwise
    returns an address that (if we're lucky) follows the prologue.  If
@@ -4992,7 +5384,6 @@ mips_skip_prologue (CORE_ADDR pc)
      is greater.  */
 
   CORE_ADDR post_prologue_pc = after_prologue (pc);
-  CORE_ADDR limit_pc;
 
   if (post_prologue_pc != 0)
     return max (pc, post_prologue_pc);
@@ -5000,17 +5391,10 @@ mips_skip_prologue (CORE_ADDR pc)
   /* Can't determine prologue from the symbol table, need to examine
      instructions.  */
 
-  /* Find an upper limit on the function prologue using the debug
-     information.  If the debug information could not be used to provide
-     that bound, then use an arbitrary large number as the upper bound.  */
-  limit_pc = skip_prologue_using_sal (pc);
-  if (limit_pc == 0)
-    limit_pc = pc + 100;          /* Magic.  */
-
   if (pc_is_mips16 (pc))
-    return mips16_scan_prologue (pc, limit_pc, NULL, NULL);
+    return mips16_skip_prologue (pc);
   else
-    return mips32_scan_prologue (pc, limit_pc, NULL, NULL);
+    return mips32_skip_prologue (pc);
 }
 
 /* Root of all "set mips "/"show mips " commands. This will eventually be
index 5e50713ed839104b758ac1dd0aef13f1b53ea1de..0fb44a1100e6e07564375e72b5c3849082c34c01 100644 (file)
@@ -2256,7 +2256,7 @@ init_base_monitor_ops (void)
   monitor_ops.to_fetch_registers = monitor_fetch_registers;
   monitor_ops.to_store_registers = monitor_store_registers;
   monitor_ops.to_prepare_to_store = monitor_prepare_to_store;
-  monitor_ops.deprecated_xfer_memory = monitor_xfer_memory;
+  monitor_ops.to_xfer_memory = monitor_xfer_memory;
   monitor_ops.to_files_info = monitor_files_info;
   monitor_ops.to_insert_breakpoint = monitor_insert_breakpoint;
   monitor_ops.to_remove_breakpoint = monitor_remove_breakpoint;
index 227d4e39f5e8824c76275388ac7943921fd4c03c..910156601a6997f9142789db6d227d9d8be091e8 100644 (file)
@@ -1272,7 +1272,7 @@ init_procfs_ops (void)
   procfs_ops.to_fetch_registers = procfs_fetch_registers;
   procfs_ops.to_store_registers = procfs_store_registers;
   procfs_ops.to_prepare_to_store = procfs_prepare_to_store;
-  procfs_ops.deprecated_xfer_memory = procfs_xfer_memory;
+  procfs_ops.to_xfer_memory = procfs_xfer_memory;
   procfs_ops.to_files_info = procfs_files_info;
   procfs_ops.to_insert_breakpoint = procfs_insert_breakpoint;
   procfs_ops.to_remove_breakpoint = procfs_remove_breakpoint;
index 3c4e0b402b0ec3fa94b03a3ef6d290a7f0e3f1f8..69f61d48688ab48d15b10e636f3375094a9fbec4 100644 (file)
@@ -184,7 +184,7 @@ allocate_objfile (bfd *abfd, int flags)
     }
   if (abfd != NULL)
     {
-      objfile->name = xstrdup (bfd_get_filename (abfd));
+      objfile->name = mstrsave (objfile->md, bfd_get_filename (abfd));
       objfile->mtime = bfd_get_mtime (abfd);
 
       /* Build section table.  */
@@ -197,7 +197,7 @@ allocate_objfile (bfd *abfd, int flags)
     }
   else
     {
-      objfile->name = xstrdup ("<<anonymous objfile>>");
+      objfile->name = mstrsave (objfile->md, "<<anonymous objfile>>");
     }
 
   /* Initialize the section indexes for this objfile, so that we can
index 16d2532a72e29ed0e7005e01289a330eabb6220e..e7eefca955123feba87e598b5175320dc7a90682 100644 (file)
@@ -325,7 +325,7 @@ a wiggler, specify wiggler and then the port it is connected to\n\
   bdm_ppc_ops.to_fetch_registers = bdm_ppc_fetch_registers;
   bdm_ppc_ops.to_store_registers = bdm_ppc_store_registers;
   bdm_ppc_ops.to_prepare_to_store = ocd_prepare_to_store;
-  bdm_ppc_ops.deprecated_xfer_memory = ocd_xfer_memory;
+  bdm_ppc_ops.to_xfer_memory = ocd_xfer_memory;
   bdm_ppc_ops.to_files_info = ocd_files_info;
   bdm_ppc_ops.to_insert_breakpoint = ocd_insert_breakpoint;
   bdm_ppc_ops.to_remove_breakpoint = ocd_remove_breakpoint;
index 7e31a7ffcb6f341c5ea2c93daa5bf778c27de3df..0a1f1528b3abfb4df13314f033ae8c265fb22d85 100644 (file)
@@ -172,7 +172,7 @@ init_procfs_ops (void)
   procfs_ops.to_fetch_registers     = procfs_fetch_registers;
   procfs_ops.to_store_registers     = procfs_store_registers;
   procfs_ops.to_xfer_partial        = procfs_xfer_partial;
-  procfs_ops.deprecated_xfer_memory = procfs_xfer_memory;
+  procfs_ops.to_xfer_memory         = procfs_xfer_memory;
   procfs_ops.to_insert_breakpoint   =  memory_insert_breakpoint;
   procfs_ops.to_remove_breakpoint   =  memory_remove_breakpoint;
   procfs_ops.to_notice_signals      = procfs_notice_signals;
@@ -4326,11 +4326,11 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
     {
     case TARGET_OBJECT_MEMORY:
       if (readbuf)
-       return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
-                                              0/*write*/, NULL, ops);
+       return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/,
+                                      NULL, ops);
       if (writebuf)
-       return (*ops->deprecated_xfer_memory) (offset, writebuf, len,
-                                              1/*write*/, NULL, ops);
+       return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/,
+                                      NULL, ops);
       return -1;
 
 #ifdef NEW_PROC_API
index f34da7965ebb0988d7fa4c4b6fb71cbea576618a..12721c330e35ac72234eb4df38b75e825674e721 100644 (file)
@@ -616,8 +616,8 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
        target_fetch_registers (regnum);
 #if 0
       /* FIXME: cagney/2004-08-07: At present a number of targets
-        forget (or didn't know that they needed) to set this leading to
-        panics.  Also is the problem that targets need to indicate
+        forget (or didn't know that they needed) set this leading to
+        panics.  Also is the problem that target's need to indicate
         that a register is in one of the possible states: valid,
         undefined, unknown.  The last of which isn't yet
         possible.  */
index 405a6b53411a2ac2da620a55d92bb63a576ddef2..965ea9718cf97fc7ef8402167d8a75e0cdb31958 100644 (file)
@@ -2150,7 +2150,7 @@ target e7000 foobar";
   e7000_ops.to_fetch_registers = e7000_fetch_register;
   e7000_ops.to_store_registers = e7000_store_register;
   e7000_ops.to_prepare_to_store = e7000_prepare_to_store;
-  e7000_ops.deprecated_xfer_memory = e7000_xfer_inferior_memory;
+  e7000_ops.to_xfer_memory = e7000_xfer_inferior_memory;
   e7000_ops.to_files_info = e7000_files_info;
   e7000_ops.to_insert_breakpoint = e7000_insert_breakpoint;
   e7000_ops.to_remove_breakpoint = e7000_remove_breakpoint;
index cca045e3cbc70b54d4c4e5f59de0ed6e34fb50c1..a2fc04682fef466c3b25343425467d44c1bc144f 100644 (file)
@@ -1450,23 +1450,16 @@ m32r_remove_watchpoint (CORE_ADDR addr, int len, int type)
   return 0;
 }
 
-int
-m32r_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
+CORE_ADDR
+m32r_stopped_data_address (void)
 {
-  int rc = 0;
-  if (hit_watchpoint_addr != 0x00000000)
-    {
-      *addr_p = hit_watchpoint_addr;
-      rc = 1;
-    }
-  return rc;
+  return hit_watchpoint_addr;
 }
 
 int
 m32r_stopped_by_watchpoint (void)
 {
-  CORE_ADDR addr;
-  return m32r_stopped_data_address (&current_target, &addr);
+  return (hit_watchpoint_addr != 0x00000000);
 }
 
 
@@ -1575,7 +1568,7 @@ init_m32r_ops (void)
   m32r_ops.to_fetch_registers = m32r_fetch_register;
   m32r_ops.to_store_registers = m32r_store_register;
   m32r_ops.to_prepare_to_store = m32r_prepare_to_store;
-  m32r_ops.deprecated_xfer_memory = m32r_xfer_memory;
+  m32r_ops.to_xfer_memory = m32r_xfer_memory;
   m32r_ops.to_files_info = m32r_files_info;
   m32r_ops.to_insert_breakpoint = m32r_insert_breakpoint;
   m32r_ops.to_remove_breakpoint = m32r_remove_breakpoint;
index 175a4f96f033755a200b474fdbd1a954c2e357e5..b7dc35e0ffcdb1e106fb06a02c1c036a1b67a0f9 100644 (file)
@@ -3306,7 +3306,7 @@ _initialize_remote_mips (void)
   mips_ops.to_fetch_registers = mips_fetch_registers;
   mips_ops.to_store_registers = mips_store_registers;
   mips_ops.to_prepare_to_store = mips_prepare_to_store;
-  mips_ops.deprecated_xfer_memory = mips_xfer_memory;
+  mips_ops.to_xfer_memory = mips_xfer_memory;
   mips_ops.to_files_info = mips_files_info;
   mips_ops.to_insert_breakpoint = mips_insert_breakpoint;
   mips_ops.to_remove_breakpoint = mips_remove_breakpoint;
index 2571b785582dc0a6d0e5e1ec06210f0e4cabed55..1c14a03b43f705790f06f56c559cbfb7af2e7d54 100644 (file)
@@ -895,7 +895,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   arm_rdi_ops.to_fetch_registers = arm_rdi_fetch_registers;
   arm_rdi_ops.to_store_registers = arm_rdi_store_registers;
   arm_rdi_ops.to_prepare_to_store = arm_rdi_prepare_to_store;
-  arm_rdi_ops.deprecated_xfer_memory = arm_rdi_xfer_memory;
+  arm_rdi_ops.to_xfer_memory = arm_rdi_xfer_memory;
   arm_rdi_ops.to_files_info = arm_rdi_files_info;
   arm_rdi_ops.to_insert_breakpoint = arm_rdi_insert_breakpoint;
   arm_rdi_ops.to_remove_breakpoint = arm_rdi_remove_breakpoint;
index d480d5331eea106c566fdf0f6bbe67229ff0ba5a..20683110232a7236ebca7ccc0fa9b8fb585d293a 100644 (file)
@@ -1405,7 +1405,7 @@ init_remote_rdp_ops (void)
   remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register;
   remote_rdp_ops.to_store_registers = remote_rdp_store_register;
   remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store;
-  remote_rdp_ops.deprecated_xfer_memory = remote_rdp_xfer_inferior_memory;
+  remote_rdp_ops.to_xfer_memory = remote_rdp_xfer_inferior_memory;
   remote_rdp_ops.to_files_info = remote_rdp_files_info;
   remote_rdp_ops.to_insert_breakpoint = remote_rdp_insert_breakpoint;
   remote_rdp_ops.to_remove_breakpoint = remote_rdp_remove_breakpoint;
index 0bf1c01c82af7c0e6c05f690aba6f27c51988694..5b4b3898adb9e30b0c0d7c876854aaa0a6060749 100644 (file)
@@ -1061,7 +1061,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   sds_ops.to_fetch_registers = sds_fetch_registers;
   sds_ops.to_store_registers = sds_store_registers;
   sds_ops.to_prepare_to_store = sds_prepare_to_store;
-  sds_ops.deprecated_xfer_memory = sds_xfer_memory;
+  sds_ops.to_xfer_memory = sds_xfer_memory;
   sds_ops.to_files_info = sds_files_info;
   sds_ops.to_insert_breakpoint = sds_insert_breakpoint;
   sds_ops.to_remove_breakpoint = sds_remove_breakpoint;
index 9e377ae083ea1746421c78b8e4d5c7da8808f1a8..7a5c7b0aba96eb99f3d80da814a9bed68fde0388 100644 (file)
@@ -863,7 +863,7 @@ init_gdbsim_ops (void)
   gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
   gdbsim_ops.to_store_registers = gdbsim_store_register;
   gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
-  gdbsim_ops.deprecated_xfer_memory = gdbsim_xfer_inferior_memory;
+  gdbsim_ops.to_xfer_memory = gdbsim_xfer_inferior_memory;
   gdbsim_ops.to_files_info = gdbsim_files_info;
   gdbsim_ops.to_insert_breakpoint = gdbsim_insert_breakpoint;
   gdbsim_ops.to_remove_breakpoint = gdbsim_remove_breakpoint;
index a71998c2f5ffdc99c2867e9dc6379b0ea038eb75..eba847fde743a4e35e0278670ac2bf50a34c99e0 100644 (file)
@@ -775,7 +775,7 @@ the speed to connect at in bits per second.";
   st2000_ops.to_fetch_registers = st2000_fetch_register;
   st2000_ops.to_store_registers = st2000_store_register;
   st2000_ops.to_prepare_to_store = st2000_prepare_to_store;
-  st2000_ops.deprecated_xfer_memory = st2000_xfer_inferior_memory;
+  st2000_ops.to_xfer_memory = st2000_xfer_inferior_memory;
   st2000_ops.to_files_info = st2000_files_info;
   st2000_ops.to_insert_breakpoint = st2000_insert_breakpoint;
   st2000_ops.to_remove_breakpoint = st2000_remove_breakpoint;  /* Breakpoints */
index 76baff564e875bae3396b7e81d915f090332e59c..de5cc03fb4189cc3a09898f07d17137aa3e65bd5 100644 (file)
@@ -1343,7 +1343,7 @@ Specify the name of the machine to connect to.";
   vx_ops.to_open = vx_open;
   vx_ops.to_close = vx_close;
   vx_ops.to_attach = vx_attach;
-  vx_ops.deprecated_xfer_memory = vx_xfer_memory;
+  vx_ops.to_xfer_memory = vx_xfer_memory;
   vx_ops.to_files_info = vx_files_info;
   vx_ops.to_load = vx_load_command;
   vx_ops.to_lookup_symbol = vx_lookup_symbol;
@@ -1368,7 +1368,7 @@ init_vx_run_ops (void)
   vx_run_ops.to_fetch_registers = vx_read_register;
   vx_run_ops.to_store_registers = vx_write_register;
   vx_run_ops.to_prepare_to_store = vx_prepare_to_store;
-  vx_run_ops.deprecated_xfer_memory = vx_xfer_memory;
+  vx_run_ops.to_xfer_memory = vx_xfer_memory;
   vx_run_ops.to_files_info = vx_run_files_info;
   vx_run_ops.to_insert_breakpoint = vx_insert_breakpoint;
   vx_run_ops.to_remove_breakpoint = vx_remove_breakpoint;
index c389c4a7f3b699fcfa11da5f7758e90c3bb51d97..497f97242ccc9e9d96c17ec583ad23a9c0b5c05c 100644 (file)
@@ -961,23 +961,6 @@ show_remote_protocol_qPart_auxv_packet_cmd (char *args, int from_tty,
   show_packet_config_cmd (&remote_protocol_qPart_auxv);
 }
 
-static struct packet_config remote_protocol_p;
-
-static void
-set_remote_protocol_p_packet_cmd (char *args, int from_tty,
-                                 struct cmd_list_element *c)
-{
-  update_packet_config (&remote_protocol_p);
-}
-
-static void
-show_remote_protocol_p_packet_cmd (char *args, int from_tty,
-                                  struct cmd_list_element *c)
-{
-  show_packet_config_cmd (&remote_protocol_p);
-}
-
-
 
 /* Tokens for use by the asynchronous signal handlers for SIGINT */
 static void *sigint_remote_twice_token;
@@ -2058,7 +2041,6 @@ init_all_packet_configs (void)
 {
   int i;
   update_packet_config (&remote_protocol_P);
-  update_packet_config (&remote_protocol_p);
   update_packet_config (&remote_protocol_qSymbol);
   update_packet_config (&remote_protocol_vcont);
   for (i = 0; i < NR_Z_PACKET_TYPES; i++)
@@ -3168,36 +3150,6 @@ static int register_bytes_found;
 /* Read the remote registers into the block REGS.  */
 /* Currently we just read all the registers, so we don't use regnum.  */
 
-static int
-fetch_register_using_p (int regnum)
-{
-  struct remote_state *rs = get_remote_state ();
-  char *buf = alloca (rs->remote_packet_size), *p;
-  char regp[MAX_REGISTER_SIZE];
-  int i;
-
-  buf[0] = 'p';
-  bin2hex((char *) &regnum, &buf[1], sizeof(regnum));
-  buf[9] = 0;
-  remote_send (buf, rs->remote_packet_size);
-  if (buf[0] != 0 && buf[0] != 'E') {
-     p = buf;
-     i = 0;
-     while (p[0] != 0) {
-       if (p[1] == 0) {
-               error("fetch_register_using_p: early buf termination");
-               return 0;
-       }
-       regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
-        p += 2;
-    }
-    regcache_raw_supply (current_regcache, regnum, regp);
-    return 1;
- }
-
- return 0;
-}
-
 static void
 remote_fetch_registers (int regnum)
 {
@@ -3218,31 +3170,6 @@ remote_fetch_registers (int regnum)
                        "Attempt to fetch a non G-packet register when this "
                        "remote.c does not support the p-packet.");
     }
-      switch (remote_protocol_p.support)
-       {
-       case PACKET_DISABLE:
-         break;
-       case PACKET_ENABLE:
-         if (fetch_register_using_p (regnum))
-           return;
-         else
-           error ("Protocol error: p packet not recognized by stub");
-       case PACKET_SUPPORT_UNKNOWN:
-         if (fetch_register_using_p (regnum))
-           {
-             /* The stub recognized the 'p' packet.  Remember this.  */
-             remote_protocol_p.support = PACKET_ENABLE;
-             return;
-           }
-         else
-           {
-             /* The stub does not support the 'P' packet.  Use 'G'
-                instead, and don't try using 'P' in the future (it
-                will just waste our time).  */
-             remote_protocol_p.support = PACKET_DISABLE;
-             break;
-           }
-       }
 
   sprintf (buf, "g");
   remote_send (buf, (rs->remote_packet_size));
@@ -4624,18 +4551,13 @@ remote_stopped_by_watchpoint (void)
 
 extern int stepped_after_stopped_by_watchpoint;
 
-static int
-remote_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
+static CORE_ADDR
+remote_stopped_data_address (void)
 {
-  int rc = 0;
   if (remote_stopped_by_watchpoint ()
       || stepped_after_stopped_by_watchpoint)
-    {
-      *addr_p = remote_watch_data_address;
-      rc = 1;
-    }
-
-  return rc;
+    return remote_watch_data_address;
+  return (CORE_ADDR)0;
 }
 
 
@@ -4869,31 +4791,6 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
   char *p2 = &buf2[0];
   char query_type;
 
-  /* Handle memory using remote_xfer_memory.  */
-  if (object == TARGET_OBJECT_MEMORY)
-    {
-      int xfered;
-      errno = 0;
-
-      if (writebuf != NULL)
-       {
-         void *buffer = xmalloc (len);
-         struct cleanup *cleanup = make_cleanup (xfree, buffer);
-         memcpy (buffer, writebuf, len);
-         xfered = remote_xfer_memory (offset, buffer, len, 1, NULL, ops);
-         do_cleanups (cleanup);
-       }
-      else
-       xfered = remote_xfer_memory (offset, readbuf, len, 0, NULL, ops);
-
-      if (xfered > 0)
-       return xfered;
-      else if (xfered == 0 && errno == 0)
-       return 0;
-      else
-       return -1;
-    }
-
   /* Only handle reads.  */
   if (writebuf != NULL || readbuf == NULL)
     return -1;
@@ -5247,7 +5144,7 @@ Specify the serial device it is connected to\n\
   remote_ops.to_fetch_registers = remote_fetch_registers;
   remote_ops.to_store_registers = remote_store_registers;
   remote_ops.to_prepare_to_store = remote_prepare_to_store;
-  remote_ops.deprecated_xfer_memory = remote_xfer_memory;
+  remote_ops.to_xfer_memory = remote_xfer_memory;
   remote_ops.to_files_info = remote_files_info;
   remote_ops.to_insert_breakpoint = remote_insert_breakpoint;
   remote_ops.to_remove_breakpoint = remote_remove_breakpoint;
@@ -5367,7 +5264,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   remote_async_ops.to_fetch_registers = remote_fetch_registers;
   remote_async_ops.to_store_registers = remote_store_registers;
   remote_async_ops.to_prepare_to_store = remote_prepare_to_store;
-  remote_async_ops.deprecated_xfer_memory = remote_xfer_memory;
+  remote_async_ops.to_xfer_memory = remote_xfer_memory;
   remote_async_ops.to_files_info = remote_files_info;
   remote_async_ops.to_insert_breakpoint = remote_insert_breakpoint;
   remote_async_ops.to_remove_breakpoint = remote_remove_breakpoint;
@@ -5435,7 +5332,6 @@ show_remote_cmd (char *args, int from_tty)
      remote_show_cmdlist for a list of sub commands to show.  */
   show_remote_protocol_Z_packet_cmd (args, from_tty, NULL);
   show_remote_protocol_P_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);
   show_remote_protocol_binary_download_cmd (args, from_tty, NULL);
@@ -5632,13 +5528,6 @@ in a memory packet.\n",
                         &remote_set_cmdlist, &remote_show_cmdlist,
                         1);
 
-  add_packet_config_cmd (&remote_protocol_p,
-                        "p", "fetch-register",
-                        set_remote_protocol_p_packet_cmd,
-                        show_remote_protocol_p_packet_cmd,
-                        &remote_set_cmdlist, &remote_show_cmdlist,
-                        1);
-
   add_packet_config_cmd (&remote_protocol_Z[Z_PACKET_SOFTWARE_BP],
                         "Z0", "software-breakpoint",
                         set_remote_protocol_Z_software_bp_packet_cmd,
index df360763f42edc01f5ac0ae4f7bb0f3630a04a23..59067c64d29adbefd3099a0700bce07b136c7b1a 100644 (file)
@@ -442,10 +442,10 @@ read_word (CORE_ADDR from, int *to, int arch64)
    to debugger memory starting at MYADDR.  Copy to inferior if
    WRITE is nonzero.
 
-   Returns the length copied, which is either the LEN argument or
-   zero.  This xfer function does not do partial moves, since
-   deprecated_child_ops doesn't allow memory operations to cross below
-   us in the target stack anyway.  */
+   Returns the length copied, which is either the LEN argument or zero.
+   This xfer function does not do partial moves, since child_ops
+   doesn't allow memory operations to cross below us in the target stack
+   anyway.  */
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
index 37988a37f64c260e2653672a1a81efaeafd0f655..36741c5e5e27aba928f66552483a86398b8d569f 100644 (file)
@@ -1478,11 +1478,14 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
             There are 13 fpr's reserved for passing parameters. At this point
             there is no way we would run out of them.  */
 
-         gdb_assert (len <= 8);
-
-         regcache_cooked_write (regcache,
-                                tdep->ppc_fp0_regnum + 1 + f_argno,
-                                VALUE_CONTENTS (arg));
+         if (len > 8)
+           printf_unfiltered ("Fatal Error: a floating point parameter "
+                               "#%d with a size > 8 is found!\n", argno);
+
+         memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE
+                                        (tdep->ppc_fp0_regnum + 1 + f_argno)],
+                 VALUE_CONTENTS (arg),
+                 len);
          ++f_argno;
        }
 
@@ -1492,15 +1495,12 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
          /* Argument takes more than one register.  */
          while (argbytes < len)
            {
-             char word[MAX_REGISTER_SIZE];
-             memset (word, 0, reg_size);
-             memcpy (word,
+             memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0,
+                     reg_size);
+             memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)],
                      ((char *) VALUE_CONTENTS (arg)) + argbytes,
                      (len - argbytes) > reg_size
                        ? reg_size : len - argbytes);
-             regcache_cooked_write (regcache,
-                                   tdep->ppc_gp0_regnum + 3 + ii,
-                                   word);
              ++ii, argbytes += reg_size;
 
              if (ii >= 8)
@@ -1513,11 +1513,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
        {
          /* Argument can fit in one register.  No problem.  */
          int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
-         char word[MAX_REGISTER_SIZE];
-
-         memset (word, 0, reg_size);
-         memcpy (word, VALUE_CONTENTS (arg), len);
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
+         memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size);
+         memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj, 
+                 VALUE_CONTENTS (arg), len);
        }
       ++argno;
     }
@@ -1594,11 +1592,15 @@ ran_out_of_registers_for_arguments:
          if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
            {
 
-             gdb_assert (len <= 8);
+             if (len > 8)
+               printf_unfiltered ("Fatal Error: a floating point parameter"
+                                   " #%d with a size > 8 is found!\n", argno);
 
-             regcache_cooked_write (regcache,
-                                    tdep->ppc_fp0_regnum + 1 + f_argno,
-                                    VALUE_CONTENTS (arg));
+             memcpy (&(deprecated_registers
+                        [DEPRECATED_REGISTER_BYTE
+                         (tdep->ppc_fp0_regnum + 1 + f_argno)]),
+                     VALUE_CONTENTS (arg),
+                     len);
              ++f_argno;
            }
 
index 48e994d4e2e774ea2d318893f00a2730af7bb1a4..03ef25cd09bfea90a82cd8627bcc1e608f7678f3 100644 (file)
@@ -56,7 +56,7 @@
 
 static void (*sh_show_regs) (void);
 
-#define SH_NUM_REGS 67
+#define SH_NUM_REGS 59
 
 struct sh_frame_cache
 {
@@ -86,7 +86,6 @@ sh_sh_register_name (int reg_nr)
     "", "",
     "", "", "", "", "", "", "", "",
     "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -108,7 +107,6 @@ sh_sh3_register_name (int reg_nr)
     "ssr", "spc",
     "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
     "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1"
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -130,7 +128,6 @@ sh_sh3e_register_name (int reg_nr)
     "ssr", "spc",
     "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
     "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -152,87 +149,6 @@ sh_sh2e_register_name (int reg_nr)
     "", "",
     "", "", "", "", "", "", "", "",
     "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
-  };
-  if (reg_nr < 0)
-    return NULL;
-  if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
-    return NULL;
-  return register_names[reg_nr];
-}
-
-static const char *
-sh_sh2a_register_name (int reg_nr)
-{
-  static char *register_names[] = {
-    /* general registers 0-15 */
-    "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-    "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
-    /* 16 - 22 */
-    "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
-    /* 23, 24 */
-    "fpul", "fpscr",
-    /* floating point registers 25 - 40 */
-    "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
-    "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
-    /* 41, 42 */
-    "", "",
-    /* 43 - 62.  Banked registers.  The bank number used is determined by
-       the bank register (63). */
-    "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
-    "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b",
-    "machb", "ivnb", "prb", "gbrb", "maclb",
-    /* 63: register bank number, not a real register but used to
-       communicate the register bank currently get/set.  This register
-       is hidden to the user, who manipulates it using the pseudo
-       register called "bank" (67).  See below.  */
-    "",
-    /* 64 - 66 */
-    "ibcr", "ibnr", "tbr",
-    /* 67: register bank number, the user visible pseudo register.  */
-    "bank",
-    /* double precision (pseudo) 68 - 75 */
-    "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14",
-  };
-  if (reg_nr < 0)
-    return NULL;
-  if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
-    return NULL;
-  return register_names[reg_nr];
-}
-
-static const char *
-sh_sh2a_nofpu_register_name (int reg_nr)
-{
-  static char *register_names[] = {
-    /* general registers 0-15 */
-    "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-    "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
-    /* 16 - 22 */
-    "pc", "pr", "gbr", "vbr", "mach", "macl", "sr",
-    /* 23, 24 */
-    "", "",
-    /* floating point registers 25 - 40 */
-    "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
-    /* 41, 42 */
-    "", "",
-    /* 43 - 62.  Banked registers.  The bank number used is determined by
-       the bank register (63). */
-    "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
-    "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b",
-    "machb", "ivnb", "prb", "gbrb", "maclb",
-    /* 63: register bank number, not a real register but used to
-       communicate the register bank currently get/set.  This register
-       is hidden to the user, who manipulates it using the pseudo
-       register called "bank" (67).  See below.  */
-    "",
-    /* 64 - 66 */
-    "ibcr", "ibnr", "tbr",
-    /* 67: register bank number, the user visible pseudo register.  */
-    "bank",
-    /* double precision (pseudo) 68 - 75 */
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -254,7 +170,6 @@ sh_sh_dsp_register_name (int reg_nr)
     "", "",
     "rs", "re", "", "", "", "", "", "",
     "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -277,7 +192,6 @@ sh_sh3_dsp_register_name (int reg_nr)
     "rs", "re", "", "", "", "", "", "",
     "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
     "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -306,9 +220,6 @@ sh_sh4_register_name (int reg_nr)
     "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
     /* bank 1 51 - 58 */
     "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
-    "", "", "", "", "", "", "", "",
-    /* pseudo bank register. */
-    "",
     /* double precision (pseudo) 59 - 66 */
     "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14",
     /* vectors (pseudo) 67 - 70 */
@@ -343,9 +254,6 @@ sh_sh4_nofpu_register_name (int reg_nr)
     "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0",
     /* bank 1 51 - 58 */
     "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
-    "", "", "", "", "", "", "", "",
-    /* pseudo bank register. */
-    "",
     /* double precision (pseudo) 59 - 66 -- not for nofpu target */
     "", "", "", "", "", "", "", "",
     /* vectors (pseudo) 67 - 70 -- not for nofpu target */
@@ -372,7 +280,6 @@ sh_sh4al_dsp_register_name (int reg_nr)
     "rs", "re", "", "", "", "", "", "",
     "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
     "", "", "", "", "", "", "", "",
-    "", "", "", "", "", "", "", "",
   };
   if (reg_nr < 0)
     return NULL;
@@ -411,10 +318,6 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
    r15-4-->r15, PR-->(r15) */
 #define IS_STS(x)              ((x) == 0x4f22)
 
-/* STS.L MACL,@-r15  0100111100010010
-   r15-4-->r15, MACL-->(r15) */
-#define IS_MACL_STS(x)         ((x) == 0x4f12)
-
 /* MOV.L Rm,@-r15  00101111mmmm0110
    r15-4-->r15, Rm-->(R15) */
 #define IS_PUSH(x)             (((x) & 0xff0f) == 0x2f06)
@@ -462,8 +365,6 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 #define IS_MOVW_PCREL_TO_REG(x)        (((x) & 0xf000) == 0x9000)
 /* MOV.L @(disp*4,PC),Rn      1101nnnndddddddd */
 #define IS_MOVL_PCREL_TO_REG(x)        (((x) & 0xf000) == 0xd000)
-/* MOVI20 #imm20,Rn           0000nnnniiii0000 */
-#define IS_MOVI20(x)           (((x) & 0xf00f) == 0x0000)
 /* SUB Rn,R15                 00111111nnnn1000 */
 #define IS_SUB_REG_FROM_SP(x)  (((x) & 0xff0f) == 0x3f08)
 
@@ -473,7 +374,6 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 #define IS_RESTORE_FP(x)       ((x) == 0x6ef6)
 #define IS_RTS(x)              ((x) == 0x000b)
 #define IS_LDS(x)              ((x) == 0x4f26)
-#define IS_MACL_LDS(x)         ((x) == 0x4f16)
 #define IS_MOV_FP_SP(x)        ((x) == 0x6fe3)
 #define IS_ADD_REG_TO_FP(x)    (((x) & 0xff0f) == 0x3e0c)
 #define IS_ADD_IMM_FP(x)       (((x) & 0xff00) == 0x7e00)
@@ -515,11 +415,6 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
          cache->saved_regs[PR_REGNUM] = cache->sp_offset;
          cache->sp_offset += 4;
        }
-      else if (IS_MACL_STS (inst))
-       {
-         cache->saved_regs[MACL_REGNUM] = cache->sp_offset;
-         cache->sp_offset += 4;
-       }
       else if (IS_MOV_R3 (inst))
        {
          r3_val = ((inst & 0xff) ^ 0x80) - 0x80;
@@ -565,25 +460,6 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
                }
            }
        }
-      else if (IS_MOVI20 (inst))
-        {
-         if (sav_reg < 0)
-           {
-             reg = GET_TARGET_REG (inst);
-             if (reg < 14)
-               {
-                 sav_reg = reg;
-                 sav_offset = GET_SOURCE_REG (inst) << 16;
-                 /* MOVI20 is a 32 bit instruction! */
-                 pc += 2;
-                 sav_offset |= read_memory_unsigned_integer (pc, 2);
-                 /* Now sav_offset contains an unsigned 20 bit value.
-                    It must still get sign extended.  */
-                 if (sav_offset & 0x00080000)
-                   sav_offset |= 0xfff00000;
-               }
-           }
-       }
       else if (IS_SUB_REG_FROM_SP (inst))
        {
          reg = GET_SOURCE_REG (inst);
@@ -1281,34 +1157,6 @@ sh3e_sh4_store_return_value (struct type *type, struct regcache *regcache,
     sh_default_store_return_value (type, regcache, valbuf);
 }
 
-static enum return_value_convention
-sh_return_value_nofpu (struct gdbarch *gdbarch, struct type *type,
-                      struct regcache *regcache,
-                      void *readbuf, const void *writebuf)
-{
-  if (sh_use_struct_convention (0, type))
-    return RETURN_VALUE_STRUCT_CONVENTION;
-  if (writebuf)
-    sh_default_store_return_value (type, regcache, writebuf);
-  else if (readbuf)
-    sh_default_extract_return_value (type, regcache, readbuf);
-  return RETURN_VALUE_REGISTER_CONVENTION;
-}
-
-static enum return_value_convention
-sh_return_value_fpu (struct gdbarch *gdbarch, struct type *type,
-                    struct regcache *regcache,
-                    void *readbuf, const void *writebuf)
-{
-  if (sh_use_struct_convention (0, type))
-    return RETURN_VALUE_STRUCT_CONVENTION;
-  if (writebuf)
-    sh3e_sh4_store_return_value (type, regcache, writebuf);
-  else if (readbuf)
-    sh3e_sh4_extract_return_value (type, regcache, readbuf);
-  return RETURN_VALUE_REGISTER_CONVENTION;
-}
-
 /* Print the registers in a form similar to the E7000 */
 
 static void
@@ -1402,141 +1250,6 @@ sh2e_show_regs (void)
   printf_filtered (("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"), (long) read_register (FP0_REGNUM + 8), (long) read_register (FP0_REGNUM + 9), (long) read_register (FP0_REGNUM + 10), (long) read_register (FP0_REGNUM + 11), (long) read_register (FP0_REGNUM + 12), (long) read_register (FP0_REGNUM + 13), (long) read_register (FP0_REGNUM + 14), (long) read_register (FP0_REGNUM + 15));
 }
 
-static void
-sh2a_show_regs (void)
-{
-  int pr = read_register (FPSCR_REGNUM) & 0x80000;
-  printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
-                  paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
-                  (long) read_register (PR_REGNUM),
-                  (long) read_register (MACH_REGNUM),
-                  (long) read_register (MACL_REGNUM));
-
-  printf_filtered ("GBR=%08lx VBR=%08lx TBR=%08lx",
-                  (long) read_register (GBR_REGNUM),
-                  (long) read_register (VBR_REGNUM),
-                  (long) read_register (TBR_REGNUM));
-  printf_filtered (" FPUL=%08lx FPSCR=%08lx\n",
-                  (long) read_register (FPUL_REGNUM),
-                  (long) read_register (FPSCR_REGNUM));
-
-  printf_filtered ("R0-R7  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (0), (long) read_register (1),
-                  (long) read_register (2), (long) read_register (3),
-                  (long) read_register (4), (long) read_register (5),
-                  (long) read_register (6), (long) read_register (7));
-  printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (8), (long) read_register (9),
-                  (long) read_register (10), (long) read_register (11),
-                  (long) read_register (12), (long) read_register (13),
-                  (long) read_register (14), (long) read_register (15));
-
-  printf_filtered ((pr
-                   ? "DR0-DR6  %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
-                   :
-                   "FP0-FP7  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
-                  (long) read_register (FP0_REGNUM + 0),
-                  (long) read_register (FP0_REGNUM + 1),
-                  (long) read_register (FP0_REGNUM + 2),
-                  (long) read_register (FP0_REGNUM + 3),
-                  (long) read_register (FP0_REGNUM + 4),
-                  (long) read_register (FP0_REGNUM + 5),
-                  (long) read_register (FP0_REGNUM + 6),
-                  (long) read_register (FP0_REGNUM + 7));
-  printf_filtered ((pr ?
-                   "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" :
-                   "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
-                  (long) read_register (FP0_REGNUM + 8),
-                  (long) read_register (FP0_REGNUM + 9),
-                  (long) read_register (FP0_REGNUM + 10),
-                  (long) read_register (FP0_REGNUM + 11),
-                  (long) read_register (FP0_REGNUM + 12),
-                  (long) read_register (FP0_REGNUM + 13),
-                  (long) read_register (FP0_REGNUM + 14),
-                  (long) read_register (FP0_REGNUM + 15));
-  printf_filtered ("BANK=%-3d\n", (int) read_register (BANK_REGNUM));
-  printf_filtered ("R0b - R7b  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 0),
-                  (long) read_register (R0_BANK0_REGNUM + 1),
-                  (long) read_register (R0_BANK0_REGNUM + 2),
-                  (long) read_register (R0_BANK0_REGNUM + 3),
-                  (long) read_register (R0_BANK0_REGNUM + 4),
-                  (long) read_register (R0_BANK0_REGNUM + 5),
-                  (long) read_register (R0_BANK0_REGNUM + 6),
-                  (long) read_register (R0_BANK0_REGNUM + 7));
-  printf_filtered ("R8b - R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 8),
-                  (long) read_register (R0_BANK0_REGNUM + 9),
-                  (long) read_register (R0_BANK0_REGNUM + 10),
-                  (long) read_register (R0_BANK0_REGNUM + 11),
-                  (long) read_register (R0_BANK0_REGNUM + 12),
-                  (long) read_register (R0_BANK0_REGNUM + 13),
-                  (long) read_register (R0_BANK0_REGNUM + 14));
-  printf_filtered ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 15),
-                  (long) read_register (R0_BANK0_REGNUM + 16),
-                  (long) read_register (R0_BANK0_REGNUM + 17),
-                  (long) read_register (R0_BANK0_REGNUM + 18),
-                  (long) read_register (R0_BANK0_REGNUM + 19));
-}
-
-static void
-sh2a_nofpu_show_regs (void)
-{
-  int pr = read_register (FPSCR_REGNUM) & 0x80000;
-  printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
-                  paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
-                  (long) read_register (PR_REGNUM),
-                  (long) read_register (MACH_REGNUM),
-                  (long) read_register (MACL_REGNUM));
-
-  printf_filtered ("GBR=%08lx VBR=%08lx TBR=%08lx",
-                  (long) read_register (GBR_REGNUM),
-                  (long) read_register (VBR_REGNUM),
-                  (long) read_register (TBR_REGNUM));
-  printf_filtered (" FPUL=%08lx FPSCR=%08lx\n",
-                  (long) read_register (FPUL_REGNUM),
-                  (long) read_register (FPSCR_REGNUM));
-
-  printf_filtered ("R0-R7  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (0), (long) read_register (1),
-                  (long) read_register (2), (long) read_register (3),
-                  (long) read_register (4), (long) read_register (5),
-                  (long) read_register (6), (long) read_register (7));
-  printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (8), (long) read_register (9),
-                  (long) read_register (10), (long) read_register (11),
-                  (long) read_register (12), (long) read_register (13),
-                  (long) read_register (14), (long) read_register (15));
-
-  printf_filtered ("BANK=%-3d\n", (int) read_register (BANK_REGNUM));
-  printf_filtered ("R0b - R7b  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 0),
-                  (long) read_register (R0_BANK0_REGNUM + 1),
-                  (long) read_register (R0_BANK0_REGNUM + 2),
-                  (long) read_register (R0_BANK0_REGNUM + 3),
-                  (long) read_register (R0_BANK0_REGNUM + 4),
-                  (long) read_register (R0_BANK0_REGNUM + 5),
-                  (long) read_register (R0_BANK0_REGNUM + 6),
-                  (long) read_register (R0_BANK0_REGNUM + 7));
-  printf_filtered ("R8b - R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 8),
-                  (long) read_register (R0_BANK0_REGNUM + 9),
-                  (long) read_register (R0_BANK0_REGNUM + 10),
-                  (long) read_register (R0_BANK0_REGNUM + 11),
-                  (long) read_register (R0_BANK0_REGNUM + 12),
-                  (long) read_register (R0_BANK0_REGNUM + 13),
-                  (long) read_register (R0_BANK0_REGNUM + 14));
-  printf_filtered ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n",
-                  (long) read_register (R0_BANK0_REGNUM + 15),
-                  (long) read_register (R0_BANK0_REGNUM + 16),
-                  (long) read_register (R0_BANK0_REGNUM + 17),
-                  (long) read_register (R0_BANK0_REGNUM + 18),
-                  (long) read_register (R0_BANK0_REGNUM + 19));
-}
-
 static void
 sh3e_show_regs (void)
 {
@@ -1758,18 +1471,6 @@ sh_show_regs_command (char *args, int from_tty)
     (*sh_show_regs) ();
 }
 
-static struct type *
-sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr)
-{
-  if ((reg_nr >= FP0_REGNUM
-       && (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
-    return builtin_type_float;
-  else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
-    return builtin_type_double;
-  else
-    return builtin_type_int;
-}
-
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 static struct type *
@@ -1894,9 +1595,6 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
   int base_regnum, portion;
   char temp_buffer[MAX_REGISTER_SIZE];
 
-  if (reg_nr == PSEUDO_BANK_REGNUM)
-    regcache_raw_read (regcache, BANK_REGNUM, buffer);
-  else
   if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
     {
       base_regnum = dr_reg_base_num (reg_nr);
@@ -1933,19 +1631,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
   int base_regnum, portion;
   char temp_buffer[MAX_REGISTER_SIZE];
 
-  if (reg_nr == PSEUDO_BANK_REGNUM)
-    {
-      /* When the bank register is written to, the whole register bank
-         is switched and all values in the bank registers must be read
-        from the target/sim again. We're just invalidating the regcache
-        so that a re-read happens next time it's necessary.  */
-      int bregnum;
-
-      regcache_raw_write (regcache, BANK_REGNUM, buffer);
-      for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum)
-        set_register_cached (bregnum, 0);
-    }
-  else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
+  if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
     {
       base_regnum = dr_reg_base_num (reg_nr);
 
@@ -1999,12 +1685,6 @@ do_dr_register_info (struct gdbarch *gdbarch, struct ui_file *file,
                    (int) read_register (first_fp_reg_num),
                    (int) read_register (first_fp_reg_num + 1));
 }
-static void
-do_bank_register_info (struct gdbarch *gdbarch, struct ui_file *file)
-{
-  fprintf_filtered (file, "bank           %d\n",
-                   (int) read_register (BANK_REGNUM));
-}
 
 static void
 sh_print_pseudo_register (struct gdbarch *gdbarch, struct ui_file *file,
@@ -2013,8 +1693,6 @@ sh_print_pseudo_register (struct gdbarch *gdbarch, struct ui_file *file,
   if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS)
     internal_error (__FILE__, __LINE__,
                    "Invalid pseudo register number %d\n", regnum);
-  else if (regnum == PSEUDO_BANK_REGNUM)
-    do_bank_register_info (gdbarch, file);
   else if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM)
     do_dr_register_info (gdbarch, file, regnum);
   else if (regnum >= FV0_REGNUM && regnum <= FV_LAST_REGNUM)
@@ -2137,11 +1815,6 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
            sh_do_register (gdbarch, file, regnum);     /* All other regs */
        }
 
-      if (regnum == PSEUDO_BANK_REGNUM
-         && REGISTER_NAME (regnum)
-         && *REGISTER_NAME (regnum))
-       sh_print_pseudo_register (gdbarch, file, regnum++);
-
       if (fpregs)
        while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
          {
@@ -2210,35 +1883,6 @@ sh_dsp_register_sim_regno (int nr)
   return nr;
 }
 
-static int
-sh_sh2a_register_sim_regno (int nr)
-{
-  switch (nr)
-    {
-      case TBR_REGNUM:
-        return SIM_SH_TBR_REGNUM;
-      case IBNR_REGNUM:
-        return SIM_SH_IBNR_REGNUM;
-      case IBCR_REGNUM:
-        return SIM_SH_IBCR_REGNUM;
-      case BANK_REGNUM:
-        return SIM_SH_BANK_REGNUM;
-      case MACLB_REGNUM:
-        return SIM_SH_BANK_MACL_REGNUM;
-      case GBRB_REGNUM:
-        return SIM_SH_BANK_GBR_REGNUM;
-      case PRB_REGNUM:
-        return SIM_SH_BANK_PR_REGNUM;
-      case IVNB_REGNUM:
-        return SIM_SH_BANK_IVN_REGNUM;
-      case MACHB_REGNUM:
-        return SIM_SH_BANK_MACH_REGNUM;
-      default:
-        break;
-    }
-  return legacy_register_sim_regno (nr);
-}
-
 static struct sh_frame_cache *
 sh_alloc_frame_cache (void)
 {
@@ -2463,16 +2107,8 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       else if (!IS_RESTORE_FP (read_memory_unsigned_integer (addr + 2, 2)))
        return 0;
 
-      inst = read_memory_unsigned_integer (addr - 2, 2);
-
-      /* Step over possible lds.l @r15+,macl. */
-      if (IS_MACL_LDS (inst))
-       {
-         addr -= 2;
-         inst = read_memory_unsigned_integer (addr - 2, 2);
-       }
-
       /* Step over possible lds.l @r15+,pr. */
+      inst = read_memory_unsigned_integer (addr - 2, 2);
       if (IS_LDS (inst))
        {
          addr -= 2;
@@ -2495,14 +2131,6 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
          inst = read_memory_unsigned_integer (addr - 2, 2);
        }
 
-      /* On SH2a check if the previous instruction was perhaps a MOVI20.
-         That's allowed for the epilogue.  */
-      if ((gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh2a
-           || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh2a_nofpu)
-          && addr > func_addr + 6
-         && IS_MOVI20 (read_memory_unsigned_integer (addr - 4, 2)))
-       addr -= 4;
-
       if (pc >= addr)
        return 1;
     }
@@ -2522,12 +2150,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     case bfd_mach_sh2e:
       sh_show_regs = sh2e_show_regs;
       break;
-    case bfd_mach_sh2a:
-      sh_show_regs = sh2a_show_regs;
-      break;
-    case bfd_mach_sh2a_nofpu:
-      sh_show_regs = sh2a_nofpu_show_regs;
-      break;
     case bfd_mach_sh_dsp:
       sh_show_regs = sh_dsp_show_regs;
       break;
@@ -2592,15 +2214,16 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
 
   set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
+  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);
 
   set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
 
-  set_gdbarch_return_value (gdbarch, sh_return_value_nofpu);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
-                                           sh_extract_struct_value_address);
+  set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
+  set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
+  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
 
   set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -2634,32 +2257,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_register_name (gdbarch, sh_sh2e_register_name);
       set_gdbarch_register_type (gdbarch, sh_sh3e_register_type);
       set_gdbarch_fp0_regnum (gdbarch, 25);
-      set_gdbarch_return_value (gdbarch, sh_return_value_fpu);
+      set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
+      set_gdbarch_extract_return_value (gdbarch,
+                                       sh3e_sh4_extract_return_value);
       set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
       break;
 
-    case bfd_mach_sh2a:
-      set_gdbarch_register_name (gdbarch, sh_sh2a_register_name);
-      set_gdbarch_register_type (gdbarch, sh_sh2a_register_type);
-      set_gdbarch_register_sim_regno (gdbarch, sh_sh2a_register_sim_regno);
-
-      set_gdbarch_fp0_regnum (gdbarch, 25);
-      set_gdbarch_num_pseudo_regs (gdbarch, 9);
-      set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read);
-      set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
-      set_gdbarch_return_value (gdbarch, sh_return_value_fpu);
-      set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
-      break;
-
-    case bfd_mach_sh2a_nofpu:
-      set_gdbarch_register_name (gdbarch, sh_sh2a_nofpu_register_name);
-      set_gdbarch_register_sim_regno (gdbarch, sh_sh2a_register_sim_regno);
-
-      set_gdbarch_num_pseudo_regs (gdbarch, 1);
-      set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read);
-      set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
-      break;
-
     case bfd_mach_sh_dsp:
       set_gdbarch_register_name (gdbarch, sh_sh_dsp_register_name);
       set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno);
@@ -2676,7 +2279,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_register_name (gdbarch, sh_sh3e_register_name);
       set_gdbarch_register_type (gdbarch, sh_sh3e_register_type);
       set_gdbarch_fp0_regnum (gdbarch, 25);
-      set_gdbarch_return_value (gdbarch, sh_return_value_fpu);
+      set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
+      set_gdbarch_extract_return_value (gdbarch,
+                                       sh3e_sh4_extract_return_value);
       set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
       break;
 
@@ -2690,10 +2295,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_register_name (gdbarch, sh_sh4_register_name);
       set_gdbarch_register_type (gdbarch, sh_sh4_register_type);
       set_gdbarch_fp0_regnum (gdbarch, 25);
-      set_gdbarch_num_pseudo_regs (gdbarch, 13);
+      set_gdbarch_num_pseudo_regs (gdbarch, 12);
       set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read);
       set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
-      set_gdbarch_return_value (gdbarch, sh_return_value_fpu);
+      set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
+      set_gdbarch_extract_return_value (gdbarch,
+                                       sh3e_sh4_extract_return_value);
       set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
       break;
 
index 9321b5954c765ee7331df38c57bb38b215a0948f..a2ef7602090aa8fea27445c9b85b86c3f8cf8b56 100644 (file)
@@ -64,23 +64,11 @@ enum
     RE_REGNUM = 44,
     DSP_R0_BANK_REGNUM = 51,
     DSP_R7_BANK_REGNUM = 58,
-    /* sh2a register */
-    R0_BANK0_REGNUM = 43,
-    MACHB_REGNUM = 58,
-    IVNB_REGNUM = 59,
-    PRB_REGNUM = 60,
-    GBRB_REGNUM = 61,
-    MACLB_REGNUM = 62,
-    BANK_REGNUM = 63,
-    IBCR_REGNUM = 64,
-    IBNR_REGNUM = 65,
-    TBR_REGNUM = 66,
-    PSEUDO_BANK_REGNUM = 67,
     /* Floating point pseudo registers */
-    DR0_REGNUM = 68,
-    DR_LAST_REGNUM = 75,
-    FV0_REGNUM = 76,
-    FV_LAST_REGNUM = 79
+    DR0_REGNUM = 59,
+    DR_LAST_REGNUM = 66,
+    FV0_REGNUM = 67,
+    FV_LAST_REGNUM = 70
   };
 
 extern gdbarch_init_ftype sh64_gdbarch_init;
index 820317b167de24c753cbc98fe61482d79fa74e07..393f976f9ee22caed20e0237e650318e518b97b4 100644 (file)
@@ -680,11 +680,11 @@ sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
     }
 
   if (target_has_execution)
-    retval = procfs_ops.deprecated_xfer_memory (memaddr, myaddr, len,
-                                               dowrite, attrib, target);
+    retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
+                                       dowrite, attrib, target);
   else
-    retval = orig_core_ops.deprecated_xfer_memory (memaddr, myaddr, len,
-                                                  dowrite, attrib, target);
+    retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len,
+                                          dowrite, attrib, target);
 
   do_cleanups (old_chain);
 
@@ -1014,11 +1014,11 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
 
       /* FIXME: passing 0 as attrib argument.  */
       if (target_has_execution)
-       cc = procfs_ops.deprecated_xfer_memory (addr, buf, size,
-                                               dowrite, 0, &procfs_ops);
+       cc = procfs_ops.to_xfer_memory (addr, buf, size,
+                                       dowrite, 0, &procfs_ops);
       else
-       cc = orig_core_ops.deprecated_xfer_memory (addr, buf, size,
-                                                  dowrite, 0, &core_ops);
+       cc = orig_core_ops.to_xfer_memory (addr, buf, size,
+                                          dowrite, 0, &core_ops);
 
       if (cc < 0)
        {
@@ -1541,7 +1541,7 @@ init_sol_thread_ops (void)
   sol_thread_ops.to_fetch_registers = sol_thread_fetch_registers;
   sol_thread_ops.to_store_registers = sol_thread_store_registers;
   sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store;
-  sol_thread_ops.deprecated_xfer_memory = sol_thread_xfer_memory;
+  sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory;
   sol_thread_ops.to_xfer_partial = sol_thread_xfer_partial;
   sol_thread_ops.to_files_info = sol_thread_files_info;
   sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
@@ -1584,7 +1584,7 @@ init_sol_core_ops (void)
   sol_core_ops.to_attach = sol_thread_attach;
   sol_core_ops.to_detach = sol_core_detach;
   sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
-  sol_core_ops.deprecated_xfer_memory = sol_thread_xfer_memory;
+  sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
   sol_core_ops.to_xfer_partial = sol_thread_xfer_partial;
   sol_core_ops.to_files_info = sol_core_files_info;
   sol_core_ops.to_insert_breakpoint = ignore;
index 52376366406e83e380eff538395a89cd5267626a..872c8acd1e48f4d6600bac6711b8dc75a1347af0 100644 (file)
@@ -1,7 +1,7 @@
 /* Handle SunOS shared libraries for GDB, the GNU Debugger.
-
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
-   2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+   2001, 2004
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -28,7 +28,7 @@
 #include <sys/param.h>
 #include <fcntl.h>
 
-/* SunOS shared libs need the nlist structure.  */
+ /* SunOS shared libs need the nlist structure.  */
 #include <a.out.h>
 #include <link.h>
 
 #include "bcache.h"
 #include "regcache.h"
 
-/* The shared library implementation found on BSD a.out systems is
-   very similar to the SunOS implementation.  However, the data
-   structures defined in <link.h> are named very differently.  Make up
-   for those differences here.  */
-
-#ifdef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
-
-/* FIXME: Temporary until the equivalent defines have been removed
-   from all nm-*bsd*.h files.  */
-#ifndef link_dynamic
-
-/* Map `struct link_map' and its members.  */
-#define link_map       so_map
-#define lm_addr                som_addr
-#define lm_name                som_path
-#define lm_next                som_next
-
-/* Map `struct link_dynamic_2' and its members.  */
-#define link_dynamic_2 section_dispatch_table
-#define ld_loaded      sdt_loaded
-
-/* Map `struct rtc_symb' and its members.  */
-#define rtc_symb       rt_symbol
-#define rtc_sp         rt_sp
-#define rtc_next       rt_next
-
-/* Map `struct ld_debug' and its members.  */
-#define ld_debug       so_debug
-#define ldd_in_debugger        dd_in_debugger
-#define ldd_bp_addr    dd_bpt_addr
-#define ldd_bp_inst    dd_bpt_shadow
-#define ldd_cp         dd_cc
-
-/* Map `struct link_dynamic' and its members.  */
-#define link_dynamic   _dynamic
-#define ld_version     d_version
-#define ldd            d_debug
-#define ld_un          d_un
-#define ld_2           d_sdt
-
-#endif
-
-#endif
-
 /* Link map info to include in an allocated so_list entry */
 
 struct lm_info
@@ -190,7 +146,7 @@ allocate_rt_common_objfile (void)
   objfile->psymbol_cache = bcache_xmalloc ();
   objfile->macro_cache = bcache_xmalloc ();
   obstack_init (&objfile->objfile_obstack);
-  objfile->name = xstrdup ("rt_common");
+  objfile->name = mstrsave (objfile->md, "rt_common");
 
   /* Add this file onto the tail of the linked list of other such files. */
 
index f0dc5542b8e387525298cf1beaba0b1605f08e3b..b1e9c387473f3b047379dc71b89515cc644fb091 100644 (file)
 #include "ui-out.h"
 #include "readline/readline.h"
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
 #ifdef CRLF_SOURCE_FILES
 
 /* Define CRLF_SOURCE_FILES in an xm-*.h file if source files on the
    host use \r\n rather than just \n.  Defining CRLF_SOURCE_FILES is
    much faster than defining LSEEK_NOT_LINEAR.  */
 
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
 
@@ -674,7 +674,9 @@ openp (const char *path, int opts, const char *string,
   if (!path)
     path = ".";
 
+#if defined(_WIN32) || defined(__CYGWIN__)
   mode |= O_BINARY;
+#endif
 
   if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string))
     {
@@ -887,7 +889,7 @@ find_and_open_source (struct objfile *objfile,
     {
       char *tmp_fullname;
       tmp_fullname = *fullname;
-      *fullname = xstrdup (tmp_fullname);
+      *fullname = mstrsave (objfile->md, *fullname);
       xfree (tmp_fullname);
     }
   return result;
index 4c33e6da588fc9412457194544ca45007f563781..95f923739ab5907612afd3d1aa6d0afbcc8b6953 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GNU/Linux SPARC.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    Otherwise, return 0.  */
 
 CORE_ADDR
-sparc_linux_sigtramp_start (struct frame_info *next_frame,
-                           ULONGEST insn0, ULONGEST insn1)
+sparc_linux_sigtramp_start (CORE_ADDR pc, ULONGEST insn0, ULONGEST insn1)
 {
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
   ULONGEST word0, word1;
-  unsigned char buf[8];                /* Two instructions.  */
+  char buf[8];                 /* Two instructions.  */
 
   /* We only recognize a signal trampoline if PC is at the start of
      one of the instructions.  We optimize for finding the PC at the
@@ -98,7 +96,7 @@ sparc_linux_sigtramp_start (struct frame_info *next_frame,
      sequence, there will be a few trailing readable bytes on the
      stack.  */
 
-  if (!safe_frame_unwind_memory (next_frame, pc, buf, sizeof buf))
+  if (deprecated_read_memory_nobpt (pc, buf, sizeof buf) != 0)
     return 0;
 
   word0 = extract_unsigned_integer (buf, 4);
@@ -108,7 +106,7 @@ sparc_linux_sigtramp_start (struct frame_info *next_frame,
        return 0;
 
       pc -= 4;
-      if (!safe_frame_unwind_memory (next_frame, pc, buf, sizeof buf))
+      if (deprecated_read_memory_nobpt (pc, buf, sizeof buf) != 0)
        return 0;
 
       word0 = extract_unsigned_integer (buf, 4);
@@ -122,35 +120,30 @@ sparc_linux_sigtramp_start (struct frame_info *next_frame,
 }
 
 static CORE_ADDR
-sparc32_linux_sigtramp_start (struct frame_info *next_frame)
+sparc32_linux_sigtramp_start (CORE_ADDR pc)
 {
-  return sparc_linux_sigtramp_start (next_frame, LINUX32_SIGTRAMP_INSN0,
+  return sparc_linux_sigtramp_start (pc, LINUX32_SIGTRAMP_INSN0,
                                     LINUX32_SIGTRAMP_INSN1);
 }
 
 static CORE_ADDR
-sparc32_linux_rt_sigtramp_start (struct frame_info *next_frame)
+sparc32_linux_rt_sigtramp_start (CORE_ADDR pc)
 {
-  return sparc_linux_sigtramp_start (next_frame, LINUX32_RT_SIGTRAMP_INSN0,
+  return sparc_linux_sigtramp_start (pc, LINUX32_RT_SIGTRAMP_INSN0,
                                     LINUX32_RT_SIGTRAMP_INSN1);
 }
 
 static int
-sparc32_linux_sigtramp_p (struct frame_info *next_frame)
+sparc32_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
 {
-  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
      be part of the preceding function.  This should always be sigaction,
      __sigaction, or __libc_sigaction (all aliases to the same function).  */
   if (name == NULL || strstr (name, "sigaction") != NULL)
-    return (sparc32_linux_sigtramp_start (next_frame) != 0
-           || sparc32_linux_rt_sigtramp_start (next_frame) != 0);
+    return (sparc32_linux_sigtramp_start (pc) != 0
+           || sparc32_linux_rt_sigtramp_start (pc) != 0);
 
   return (strcmp ("__restore", name) == 0
          || strcmp ("__restore_rt", name) == 0);
@@ -177,12 +170,13 @@ sparc32_linux_sigtramp_frame_cache (struct frame_info *next_frame,
   regnum = SPARC_O1_REGNUM;
   sigcontext_addr = frame_unwind_register_unsigned (next_frame, regnum);
 
-  addr = sparc32_linux_sigtramp_start (next_frame);
+  cache->pc = frame_pc_unwind (next_frame);
+  addr = sparc32_linux_sigtramp_start (cache->pc);
   if (addr == 0)
     {
       /* If this is a RT signal trampoline, adjust SIGCONTEXT_ADDR
          accordingly.  */
-      addr = sparc32_linux_rt_sigtramp_start (next_frame);
+      addr = sparc32_linux_rt_sigtramp_start (cache->pc);
       if (addr)
        sigcontext_addr += 128;
       else
@@ -245,13 +239,47 @@ static const struct frame_unwind sparc32_linux_sigtramp_frame_unwind =
 static const struct frame_unwind *
 sparc32_linux_sigtramp_frame_sniffer (struct frame_info *next_frame)
 {
-  if (sparc32_linux_sigtramp_p (next_frame))
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (sparc32_linux_pc_in_sigtramp (pc, name))
     return &sparc32_linux_sigtramp_frame_unwind;
 
   return NULL;
 }
 \f
 
+static struct link_map_offsets *
+sparc32_linux_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = NULL;
+
+  if (lmp == NULL)
+    {
+      lmp = &lmo;
+
+      /* Everything we need is in the first 8 bytes.  */
+      lmo.r_debug_size = 8;
+      lmo.r_map_offset = 4;
+      lmo.r_map_size   = 4;
+
+      /* Everything we need is in the first 20 bytes.  */
+      lmo.link_map_size = 20;
+      lmo.l_addr_offset = 0;
+      lmo.l_addr_size   = 4;
+      lmo.l_name_offset = 4;
+      lmo.l_name_size   = 4;
+      lmo.l_next_offset = 12;
+      lmo.l_next_size   = 4;
+      lmo.l_prev_offset = 16;
+      lmo.l_prev_size   = 4;
+    }
+
+  return lmp;
+}
+
 static void
 sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -266,6 +294,9 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
 
   frame_unwind_append_sniffer (gdbarch, sparc32_linux_sigtramp_frame_sniffer);
+
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, sparc32_linux_svr4_fetch_link_map_offsets);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
index a3836ce892ef5283af517d7c347fec3ddf6112ec..858e2787dff42020ac4c7b12ebf569e0cb0d7489 100644 (file)
@@ -35,7 +35,6 @@
 
 #include "sparc-tdep.h"
 #include "sparc-nat.h"
-#include "inf-ptrace.h"
 
 /* With some trickery we can use the code in this file for most (if
    not all) ptrace(2) based SPARC systems, which includes SunOS 4,
@@ -305,20 +304,6 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
   memcpy (readbuf, buf + offset, len);
   return len;
 }
-\f
-/* Create a prototype generic SPARC target.  The client can override
-   it with local methods.  */
-
-struct target_ops *
-sparc_target (void)
-{
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = fetch_inferior_registers;
-  t->to_store_registers = store_inferior_registers;
-  return t;
-}
 
 \f
 /* Provide a prototype to silence -Wmissing-prototypes.  */
index 25ecc637b28cd57b34dc5ddf329cb7bf1e9f5b43..8f99b1eea1192c0b5ff0355d6228478b7db26ede 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for SPARC.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,9 +37,4 @@ extern int (*sparc_fpregset_supplies_p) (int);
 extern int sparc32_gregset_supplies_p (int regnum);
 extern int sparc32_fpregset_supplies_p (int regnum);
 
-/* Create a prototype generic SPARC target.  The client can override
-   it with local methods.  */
-
-extern struct target_ops *sparc_target (void);
-
 #endif /* sparc-nat.h */
index 7f86e0ae070813ce2a613da23aa34ad8e25227db..cd785571d585b00be691a13acbd5a1aaafc8c9eb 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GNU/Linux UltraSPARC.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "defs.h"
 #include "gdbarch.h"
 #include "osabi.h"
+#include "solib-svr4.h"
 
 #include "sparc64-tdep.h"
 
+static struct link_map_offsets *
+sparc64_linux_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = NULL;
+
+  if (lmp == NULL)
+    {
+      lmp = &lmo;
+
+      /* Everything we need is in the first 16 bytes.  */
+      lmo.r_debug_size = 16;
+      lmo.r_map_offset = 8;
+      lmo.r_map_size   = 8;
+
+      /* Everything we need is in the first 40 bytes.  */
+      lmo.link_map_size = 40;
+      lmo.l_addr_offset = 0;
+      lmo.l_addr_size   = 8;
+      lmo.l_name_offset = 8;
+      lmo.l_name_size   = 8;
+      lmo.l_next_offset = 24;
+      lmo.l_next_size   = 8;
+      lmo.l_prev_offset = 32;
+      lmo.l_prev_size   = 8;
+    }
+
+  return lmp;
+}
+
 static void
 sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -35,6 +66,9 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   /* ... but doesn't have kernel-assisted single-stepping support.  */
   set_gdbarch_software_single_step (gdbarch, sparc_software_single_step);
+
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, sparc64_linux_svr4_fetch_link_map_offsets);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
index fe9e006b8dc1db871851420ddf025d207f6ba416..7d554cf60897df46053a714978e1e0be298d4eea 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "defs.h"
 #include "regcache.h"
-#include "target.h"
 
 #include "sparc64-tdep.h"
 #include "sparc-nat.h"
@@ -170,9 +169,6 @@ _initialize_sparc64nbsd_nat (void)
   sparc_gregset_supplies_p = sparc64nbsd_gregset_supplies_p;
   sparc_fpregset_supplies_p = sparc64nbsd_fpregset_supplies_p;
 
-  /* We've got nothing to add to the generic SPARC target.  */
-  add_target (sparc_target ());
-
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (sparc64nbsd_supply_pcb);
 }
index aa665da8c5d6557925164a75a08376acf0eb44b5..35ad2326ff366ce1e92c84a083e1c6baebc0702a 100644 (file)
@@ -28,7 +28,6 @@
 #include "regcache.h"
 #include "regset.h"
 #include "symtab.h"
-#include "objfiles.h"
 #include "solib-svr4.h"
 #include "trad-frame.h"
 
@@ -237,11 +236,8 @@ sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   sparc64_init_abi (info, gdbarch);
 
-  /* NetBSD/sparc64 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);
+    (gdbarch, nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 }
 
 \f
index fdd5e8184ce345328acd221c6aaa554905d34278..5f8cb3bc480834fabd8fa1c99795d6e5a61169d9 100644 (file)
 #include "osabi.h"
 #include "regset.h"
 #include "symtab.h"
-#include "objfiles.h"
 #include "solib-svr4.h"
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
 
 #include "sparc64-tdep.h"
+#include "nbsd-tdep.h"
 
 /* OpenBSD uses the traditional NetBSD core file format, even for
    ports that use ELF.  The core files don't use multiple register
@@ -201,11 +201,8 @@ sparc64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   sparc64_init_abi (info, gdbarch);
 
-  /* OpenBSD/sparc64 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);
+    (gdbarch, nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 }
 
 \f
index 4b0eb12136c830e3f85e78762be7a8e25bb99c4d..fa663f2478c35886e37282146bb62ca762482a38 100644 (file)
@@ -20,8 +20,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "gdbcore.h"
 #include "regcache.h"
-#include "target.h"
 
 #include "sparc-tdep.h"
 #include "sparc-nat.h"
@@ -66,9 +66,6 @@ _initialize_sparcnbsd_nat (void)
 {
   sparc_gregset = &sparc32nbsd_gregset;
 
-  /* We've got nothing to add to the generic SPARC target.  */
-  add_target (sparc_target ());
-
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (sparc32nbsd_supply_pcb);
 }
index ee9336d30e744dc8b80c610f65748d787e1e1b8b..14e8ccd534cfcd22d649fd6b06072ec781a71ebc 100644 (file)
@@ -2185,10 +2185,6 @@ init_filename_language_table (void)
       add_filename_language (".pas", language_pascal);
       add_filename_language (".p", language_pascal);
       add_filename_language (".pp", language_pascal);
-      add_filename_language (".adb", language_ada);
-      add_filename_language (".ads", language_ada);
-      add_filename_language (".a", language_ada);
-      add_filename_language (".ada", language_ada);
     }
 }
 
index 8ed6d9e9da3998bc649f0529c0042bbdd4bc1575..46325db11b73efc9046f5f140b1c80042f4b5d21 100644 (file)
@@ -41,7 +41,6 @@
 #include "source.h"
 #include "filenames.h"         /* for FILENAME_CMP */
 #include "objc-lang.h"
-#include "ada-lang.h"
 
 #include "hashtab.h"
 
@@ -70,7 +69,7 @@ static void variables_info (char *, int);
 
 static void sources_info (char *, int);
 
-static void output_source_filename (const char *, int *);
+static void output_source_filename (char *, int *);
 
 static int find_line_common (struct linetable *, int, int *);
 
@@ -273,7 +272,8 @@ lookup_partial_symtab (const char *name)
        this symtab and use its absolute path.  */
     if (full_path != NULL)
       {
-       psymtab_to_fullname (pst);
+       if (pst->fullname == NULL)
+         source_full_path_of (pst->filename, &pst->fullname);
        if (pst->fullname != NULL
            && FILENAME_CMP (full_path, pst->fullname) == 0)
          {
@@ -284,7 +284,8 @@ lookup_partial_symtab (const char *name)
     if (real_path != NULL)
       {
         char *rp = NULL;
-       psymtab_to_fullname (pst);
+       if (pst->fullname == NULL)
+         source_full_path_of (pst->filename, &pst->fullname);
         if (pst->fullname != NULL)
           {
             rp = gdb_realpath (pst->fullname);
@@ -635,24 +636,17 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
 char *
 symbol_natural_name (const struct general_symbol_info *gsymbol)
 {
-  switch (gsymbol->language) 
+  if ((gsymbol->language == language_cplus
+       || gsymbol->language == language_java
+       || gsymbol->language == language_objc)
+      && (gsymbol->language_specific.cplus_specific.demangled_name != NULL))
     {
-    case language_cplus:
-    case language_java:
-    case language_objc:
-      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
-       return gsymbol->language_specific.cplus_specific.demangled_name;
-      break;
-    case language_ada:
-      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
-       return gsymbol->language_specific.cplus_specific.demangled_name;
-      else
-       return ada_decode_symbol (gsymbol);
-      break;
-    default:
-      break;
+      return gsymbol->language_specific.cplus_specific.demangled_name;
+    }
+  else
+    {
+      return gsymbol->name;
     }
-  return gsymbol->name;
 }
 
 /* Return the demangled name for a symbol based on the language for
@@ -660,24 +654,13 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
 char *
 symbol_demangled_name (struct general_symbol_info *gsymbol)
 {
-  switch (gsymbol->language) 
-    {
-    case language_cplus:
-    case language_java:
-    case language_objc:
-      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
-       return gsymbol->language_specific.cplus_specific.demangled_name;
-      break;
-    case language_ada:
-      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
-       return gsymbol->language_specific.cplus_specific.demangled_name;
-      else
-       return ada_decode_symbol (gsymbol);
-      break;
-    default:
-      break;
-    }
-  return NULL;
+  if (gsymbol->language == language_cplus
+      || gsymbol->language == language_java
+      || gsymbol->language == language_objc)
+    return gsymbol->language_specific.cplus_specific.demangled_name;
+
+  else 
+    return NULL;
 }
 
 /* Return the search name of a symbol---generally the demangled or
@@ -685,10 +668,7 @@ symbol_demangled_name (struct general_symbol_info *gsymbol)
    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) {
-  if (gsymbol->language == language_ada)
-    return gsymbol->name;
-  else
-    return symbol_natural_name (gsymbol);
+  return symbol_natural_name (gsymbol);
 }
 
 /* Initialize the structure fields to zero values.  */
@@ -1020,7 +1000,7 @@ lookup_symbol (const char *name, const struct block *block,
 
   modified_name = name;
 
-  /* If we are using C++ or Java, demangle the name before doing a lookup, so
+  /* If we are using C++ language, demangle the name before doing a lookup, so
      we can always binary search. */
   if (current_language->la_language == language_cplus)
     {
@@ -1032,17 +1012,6 @@ lookup_symbol (const char *name, const struct block *block,
          needtofreename = 1;
        }
     }
-  else if (current_language->la_language == language_java)
-    {
-      demangled_name = cplus_demangle (name, 
-                                      DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
-      if (demangled_name)
-       {
-         mangled_name = name;
-         modified_name = demangled_name;
-         needtofreename = 1;
-       }
-    }
 
   if (case_sensitivity == case_sensitive_off)
     {
@@ -2653,7 +2622,7 @@ filename_seen (const char *file, int add, int *first)
    NAME is the name to print and *FIRST is nonzero if this is the first
    name printed.  Set *FIRST to zero.  */
 static void
-output_source_filename (const char *name, int *first)
+output_source_filename (char *name, int *first)
 {
   /* Since a single source file can result in several partial symbol
      tables, we need to avoid printing it more than once.  Note: if
@@ -2702,8 +2671,7 @@ sources_info (char *ignore, int from_tty)
   first = 1;
   ALL_SYMTABS (objfile, s)
   {
-    const char *fullname = symtab_to_fullname (s);
-    output_source_filename (fullname ? fullname : s->filename, &first);
+    output_source_filename (s->filename, &first);
   }
   printf_filtered ("\n\n");
 
@@ -2714,8 +2682,7 @@ sources_info (char *ignore, int from_tty)
   {
     if (!ps->readin)
       {
-       const char *fullname = psymtab_to_fullname (ps);
-       output_source_filename (fullname ? fullname : ps->filename, &first);
+       output_source_filename (ps->filename, &first);
       }
   }
   printf_filtered ("\n");
index 81389a778fbb54cbd5e5046a0e2fd7d164814dd4..0e76e71ebc5b6ffcd90eaa1774f46b2795c2e126 100644 (file)
@@ -86,8 +86,6 @@ static int target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
 
 static void init_dummy_target (void);
 
-static struct target_ops debug_target;
-
 static void debug_to_open (char *, int);
 
 static void debug_to_close (int);
@@ -108,9 +106,8 @@ static void debug_to_store_registers (int);
 
 static void debug_to_prepare_to_store (void);
 
-static int deprecated_debug_xfer_memory (CORE_ADDR, char *, int, int,
-                                        struct mem_attrib *,
-                                        struct target_ops *);
+static int debug_to_xfer_memory (CORE_ADDR, char *, int, int,
+                                struct mem_attrib *, struct target_ops *);
 
 static void debug_to_files_info (struct target_ops *);
 
@@ -130,7 +127,7 @@ static int debug_to_remove_watchpoint (CORE_ADDR, int, int);
 
 static int debug_to_stopped_by_watchpoint (void);
 
-static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
+static CORE_ADDR debug_to_stopped_data_address (void);
 
 static int debug_to_region_size_ok_for_hw_watchpoint (int);
 
@@ -162,12 +159,6 @@ static int debug_to_thread_alive (ptid_t);
 
 static void debug_to_stop (void);
 
-/* NOTE: cagney/2004-09-29: Many targets reference this variable in
-   wierd and mysterious ways.  Putting the variable here lets those
-   wierd and mysterious ways keep building while they are being
-   converted to the inferior inheritance structure.  */
-struct target_ops deprecated_child_ops;
-
 /* Pointer to array of target architecture structures; the size of the
    array; the current index into the array; the allocated size of the 
    array.  */
@@ -388,10 +379,11 @@ update_current_target (void)
       INHERIT (to_disconnect, t);
       INHERIT (to_resume, t);
       INHERIT (to_wait, t);
+      INHERIT (to_post_wait, t);
       INHERIT (to_fetch_registers, t);
       INHERIT (to_store_registers, t);
       INHERIT (to_prepare_to_store, t);
-      INHERIT (deprecated_xfer_memory, t);
+      INHERIT (to_xfer_memory, t);
       INHERIT (to_files_info, t);
       INHERIT (to_insert_breakpoint, t);
       INHERIT (to_remove_breakpoint, t);
@@ -489,6 +481,9 @@ update_current_target (void)
   de_fault (to_wait, 
            (ptid_t (*) (ptid_t, struct target_waitstatus *)) 
            noprocess);
+  de_fault (to_post_wait, 
+           (void (*) (ptid_t, int)) 
+           target_ignore);
   de_fault (to_fetch_registers, 
            (void (*) (int)) 
            target_ignore);
@@ -498,7 +493,7 @@ update_current_target (void)
   de_fault (to_prepare_to_store, 
            (void (*) (void)) 
            noprocess);
-  de_fault (deprecated_xfer_memory, 
+  de_fault (to_xfer_memory, 
            (int (*) (CORE_ADDR, char *, int, int, struct mem_attrib *, struct target_ops *)) 
            nomemory);
   de_fault (to_files_info, 
@@ -527,7 +522,7 @@ update_current_target (void)
            (int (*) (void))
            return_zero);
   de_fault (to_stopped_data_address,
-           (int (*) (struct target_ops *, CORE_ADDR *))
+           (CORE_ADDR (*) (void))
            return_zero);
   de_fault (to_region_size_ok_for_hw_watchpoint,
            default_region_size_ok_for_hw_watchpoint);
@@ -784,7 +779,7 @@ target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop)
       tlen = MIN (len, 4 - (memaddr & 3));
       offset = memaddr & 3;
 
-      errcode = target_read_memory (memaddr & ~3, buf, 4);
+      errcode = target_xfer_memory (memaddr & ~3, buf, 4, 0);
       if (errcode != 0)
        {
          /* The transfer request might have crossed the boundary to an
@@ -792,7 +787,7 @@ target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop)
             a single byte.  */
          tlen = 1;
          offset = 0;
-         errcode = target_read_memory (memaddr, buf, 1);
+         errcode = target_xfer_memory (memaddr, buf, 1, 0);
          if (errcode != 0)
            goto done;
        }
@@ -843,147 +838,6 @@ target_section_by_addr (struct target_ops *target, CORE_ADDR addr)
   return NULL;
 }
 
-/* Return non-zero when the target vector has supplied an xfer_partial
-   method and it, rather than xfer_memory, should be used.  */
-static int
-target_xfer_partial_p (void)
-{
-  return (target_stack != NULL
-         && target_stack->to_xfer_partial != default_xfer_partial);
-}
-
-static LONGEST
-target_xfer_partial (struct target_ops *ops,
-                    enum target_object object, const char *annex,
-                    void *readbuf, const void *writebuf,
-                    ULONGEST offset, LONGEST len)
-{
-  LONGEST retval;
-
-  gdb_assert (ops->to_xfer_partial != NULL);
-  retval = ops->to_xfer_partial (ops, object, annex, readbuf, writebuf,
-                                offset, len);
-  if (targetdebug)
-    {
-      const unsigned char *myaddr = NULL;
-
-      fprintf_unfiltered (gdb_stdlog,
-                         "%s:target_xfer_partial (%d, %s, 0x%lx,  0x%lx,  0x%s, %s) = %s",
-                         ops->to_shortname,
-                         (int) object,
-                         (annex ? annex : "(null)"),
-                         (long) readbuf, (long) writebuf,
-                         paddr_nz (offset), paddr_d (len), paddr_d (retval));
-
-      if (readbuf)
-       myaddr = readbuf;
-      if (writebuf)
-       myaddr = writebuf;
-      if (retval > 0 && myaddr != NULL)
-       {
-         int i;
-         
-         fputs_unfiltered (", bytes =", gdb_stdlog);
-         for (i = 0; i < retval; i++)
-           {
-             if ((((long) &(myaddr[i])) & 0xf) == 0)
-               {
-                 if (targetdebug < 2 && i > 0)
-                   {
-                     fprintf_unfiltered (gdb_stdlog, " ...");
-                     break;
-                   }
-                 fprintf_unfiltered (gdb_stdlog, "\n");
-               }
-             
-             fprintf_unfiltered (gdb_stdlog, " %02x", myaddr[i] & 0xff);
-           }
-       }
-      
-      fputc_unfiltered ('\n', gdb_stdlog);
-    }
-  return retval;
-}
-
-/* Attempt a transfer all LEN bytes starting at OFFSET between the
-   inferior's KIND:ANNEX space and GDB's READBUF/WRITEBUF buffer.  If
-   the transfer succeeds, return zero, otherwize the host ERRNO is
-   returned.
-
-   The inferior is formed from several layers.  In the case of
-   corefiles, inf-corefile is layered above inf-exec and a request for
-   text (corefiles do not include text pages) will be first sent to
-   the core-stratum, fail, and then sent to the object-file where it
-   will succeed.
-
-   NOTE: cagney/2004-09-30:
-
-   The old code tried to use four separate mechanisms for mapping an
-   object:offset:len tuple onto an inferior and its address space: the
-   target stack; the inferior's TO_SECTIONS; solib's SO_LIST;
-   overlays.
-
-   This is stupid.
-
-   The code below is instead using a single mechanism (currently
-   strata).  If that mechanism proves insufficient then re-factor it
-   implementing another singluar mechanism (for instance, a generic
-   object:annex onto inferior:object:annex say).  */
-
-static LONGEST
-xfer_using_stratum (enum target_object object, const char *annex,
-                   ULONGEST offset, LONGEST len, void *readbuf,
-                   const void *writebuf)
-{
-  LONGEST xfered;
-  struct target_ops *target;
-
-  /* Always successful.  */
-  if (len == 0)
-    return 0;
-  /* Never successful.  */
-  if (target_stack == NULL)
-    return EIO;
-
-  target = target_stack;
-  while (1)
-    {
-      xfered = target_xfer_partial (target, object, annex,
-                                   readbuf, writebuf, offset, len);
-      if (xfered > 0)
-       {
-         /* The partial xfer succeeded, update the counts, check that
-            the xfer hasn't finished and if it hasn't set things up
-            for the next round.  */
-         len -= xfered;
-         if (len <= 0)
-           return 0;
-         offset += xfered;
-         if (readbuf != NULL)
-           readbuf = (bfd_byte *) readbuf + xfered;
-         if (writebuf != NULL)
-           writebuf = (bfd_byte *) writebuf + xfered;
-         target = target_stack;
-       }
-      else if (xfered < 0)
-       {
-         /* Something totally screwed up, abandon the attempt to
-            xfer.  */
-         if (errno)
-           return errno;
-         else
-           return EIO;
-       }
-      else
-       {
-         /* This "stratum" didn't work, try the next one down.  */
-         target = target->beneath;
-         if (target == NULL)
-           return EIO;
-       }
-    }
-}
-
 /* Read LEN bytes of target memory at address MEMADDR, placing the results in
    GDB's memory at MYADDR.  Returns either 0 for success or an errno value
    if any error occurs.
@@ -997,38 +851,15 @@ xfer_using_stratum (enum target_object object, const char *annex,
 int
 target_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
 {
-  if (target_xfer_partial_p ())
-    return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL,
-                              memaddr, len, myaddr, NULL);
-  else
-    return target_xfer_memory (memaddr, myaddr, len, 0);
+  return target_xfer_memory (memaddr, myaddr, len, 0);
 }
 
 int
 target_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
 {
-  if (target_xfer_partial_p ())
-    return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL,
-                              memaddr, len, NULL, myaddr);
-  else
-    return target_xfer_memory (memaddr, myaddr, len, 1);
+  return target_xfer_memory (memaddr, myaddr, len, 1);
 }
 
-#ifndef target_stopped_data_address_p
-int
-target_stopped_data_address_p (struct target_ops *target)
-{
-  if (target->to_stopped_data_address
-      == (int (*) (struct target_ops *, CORE_ADDR *)) return_zero)
-    return 0;
-  if (target->to_stopped_data_address == debug_to_stopped_data_address
-      && (debug_target.to_stopped_data_address
-         == (int (*) (struct target_ops *, CORE_ADDR *)) return_zero))
-    return 0;
-  return 1;
-}
-#endif
-
 static int trust_readonly = 0;
 
 /* Move memory to or from the targets.  The top target gets priority;
@@ -1048,8 +879,8 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
   if (len == 0)
     return 0;
 
-  /* deprecated_xfer_memory is not guaranteed to set errno, even when
-     it returns 0.  */
+  /* to_xfer_memory is not guaranteed to set errno, even when it returns
+     0.  */
   errno = 0;
 
   if (!write && trust_readonly)
@@ -1066,7 +897,7 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
     }
 
   /* The quick case is that the top target can handle the transfer.  */
-  res = current_target.deprecated_xfer_memory
+  res = current_target.to_xfer_memory
     (memaddr, myaddr, len, write, attrib, &current_target);
 
   /* If res <= 0 then we call it again in the loop.  Ah well. */
@@ -1077,7 +908,7 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
          if (!t->to_has_memory)
            continue;
 
-         res = t->deprecated_xfer_memory (memaddr, myaddr, len, write, attrib, t);
+         res = t->to_xfer_memory (memaddr, myaddr, len, write, attrib, t);
          if (res > 0)
            break;              /* Handled all or part of xfer */
          if (t->to_has_all_memory)
@@ -1232,21 +1063,13 @@ target_xfer_memory_partial (CORE_ADDR memaddr, char *myaddr, int len,
 int
 target_read_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
 {
-  if (target_xfer_partial_p ())
-    return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
-                               buf, NULL, memaddr, len);
-  else
-    return target_xfer_memory_partial (memaddr, buf, len, 0, err);
+  return target_xfer_memory_partial (memaddr, buf, len, 0, err);
 }
 
 int
 target_write_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
 {
-  if (target_xfer_partial_p ())
-    return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
-                               NULL, buf, memaddr, len);
-  else
-    return target_xfer_memory_partial (memaddr, buf, len, 1, err);
+  return target_xfer_memory_partial (memaddr, buf, len, 1, err);
 }
 
 /* More generic transfers.  */
@@ -1257,9 +1080,9 @@ default_xfer_partial (struct target_ops *ops, enum target_object object,
                      const void *writebuf, ULONGEST offset, LONGEST len)
 {
   if (object == TARGET_OBJECT_MEMORY
-      && ops->deprecated_xfer_memory != NULL)
-    /* If available, fall back to the target's
-       "deprecated_xfer_memory" method.  */
+      && ops->to_xfer_memory != NULL)
+    /* If available, fall back to the target's "to_xfer_memory"
+       method.  */
     {
       int xfered = -1;
       errno = 0;
@@ -1268,25 +1091,25 @@ default_xfer_partial (struct target_ops *ops, enum target_object object,
          void *buffer = xmalloc (len);
          struct cleanup *cleanup = make_cleanup (xfree, buffer);
          memcpy (buffer, writebuf, len);
-         xfered = ops->deprecated_xfer_memory (offset, buffer, len,
-                                               1/*write*/, NULL, ops);
+         xfered = ops->to_xfer_memory (offset, buffer, len, 1/*write*/, NULL,
+                                       ops);
          do_cleanups (cleanup);
        }
       if (readbuf != NULL)
-       xfered = ops->deprecated_xfer_memory (offset, readbuf, len, 0/*read*/,
-                                             NULL, ops);
+       xfered = ops->to_xfer_memory (offset, readbuf, len, 0/*read*/, NULL,
+                                     ops);
       if (xfered > 0)
        return xfered;
       else if (xfered == 0 && errno == 0)
-       /* "deprecated_xfer_memory" uses 0, cross checked against
-           ERRNO as one indication of an error.  */
+       /* "to_xfer_memory" uses 0, cross checked against ERRNO as one
+           indication of an error.  */
        return 0;
       else
        return -1;
     }
   else if (ops->beneath != NULL)
-    return target_xfer_partial (ops->beneath, object, annex,
-                               readbuf, writebuf, offset, len);
+    return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
+                                         readbuf, writebuf, offset, len);
   else
     return -1;
 }
@@ -1303,7 +1126,8 @@ target_read_partial (struct target_ops *ops,
                     const char *annex, void *buf,
                     ULONGEST offset, LONGEST len)
 {
-  return target_xfer_partial (ops, object, annex, buf, NULL, offset, len);
+  gdb_assert (ops->to_xfer_partial != NULL);
+  return ops->to_xfer_partial (ops, object, annex, buf, NULL, offset, len);
 }
 
 LONGEST
@@ -1312,7 +1136,8 @@ target_write_partial (struct target_ops *ops,
                      const char *annex, const void *buf,
                      ULONGEST offset, LONGEST len)
 {
-  return target_xfer_partial (ops, object, annex, NULL, buf, offset, len);
+  gdb_assert (ops->to_xfer_partial != NULL);
+  return ops->to_xfer_partial (ops, object, annex, NULL, buf, offset, len);
 }
 
 /* Wrappers to perform the full transfer.  */
@@ -1796,6 +1621,9 @@ init_dummy_target (void)
   dummy_target.to_magic = OPS_MAGIC;
 }
 \f
+
+static struct target_ops debug_target;
+
 static void
 debug_to_open (char *args, int from_tty)
 {
@@ -1912,6 +1740,15 @@ debug_to_wait (ptid_t ptid, struct target_waitstatus *status)
   return retval;
 }
 
+static void
+debug_to_post_wait (ptid_t ptid, int status)
+{
+  debug_target.to_post_wait (ptid, status);
+
+  fprintf_unfiltered (gdb_stdlog, "target_post_wait (%d, %d)\n",
+                     PIDGET (ptid), status);
+}
+
 static void
 debug_print_register (const char * func, int regno)
 {
@@ -1965,14 +1802,14 @@ debug_to_prepare_to_store (void)
 }
 
 static int
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
-                             int write, struct mem_attrib *attrib,
-                             struct target_ops *target)
+debug_to_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                     struct mem_attrib *attrib,
+                     struct target_ops *target)
 {
   int retval;
 
-  retval = debug_target.deprecated_xfer_memory (memaddr, myaddr, len, write,
-                                               attrib, target);
+  retval = debug_target.to_xfer_memory (memaddr, myaddr, len, write,
+                                       attrib, target);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d",
@@ -2084,17 +1921,16 @@ debug_to_stopped_by_watchpoint (void)
   return retval;
 }
 
-static int
-debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr)
+static CORE_ADDR
+debug_to_stopped_data_address (void)
 {
-  int retval;
+  CORE_ADDR retval;
 
-  retval = debug_target.to_stopped_data_address (target, addr);
+  retval = debug_target.to_stopped_data_address ();
 
   fprintf_unfiltered (gdb_stdlog,
-                     "target_stopped_data_address ([0x%lx]) = %ld\n",
-                     (unsigned long)*addr,
-                     (unsigned long)retval);
+                     "target_stopped_data_address () = 0x%lx\n",
+                     (unsigned long) retval);
   return retval;
 }
 
@@ -2431,6 +2267,25 @@ debug_to_stop (void)
   fprintf_unfiltered (gdb_stdlog, "target_stop ()\n");
 }
 
+static LONGEST
+debug_to_xfer_partial (struct target_ops *ops, enum target_object object,
+                      const char *annex, void *readbuf, const void *writebuf,
+                      ULONGEST offset, LONGEST len)
+{
+  LONGEST retval;
+
+  retval = debug_target.to_xfer_partial (&debug_target, object, annex,
+                                        readbuf, writebuf, offset, len);
+
+  fprintf_unfiltered (gdb_stdlog,
+                     "target_xfer_partial (%d, %s, 0x%lx,  0x%lx,  0x%s, %s) = %s\n",
+                     (int) object, (annex ? annex : "(null)"),
+                     (long) readbuf, (long) writebuf, paddr_nz (offset),
+                     paddr_d (len), paddr_d (retval));
+
+  return retval;
+}
+
 static void
 debug_to_rcmd (char *command,
               struct ui_file *outbuf)
@@ -2485,10 +2340,11 @@ setup_target_debug (void)
   current_target.to_disconnect = debug_to_disconnect;
   current_target.to_resume = debug_to_resume;
   current_target.to_wait = debug_to_wait;
+  current_target.to_post_wait = debug_to_post_wait;
   current_target.to_fetch_registers = debug_to_fetch_registers;
   current_target.to_store_registers = debug_to_store_registers;
   current_target.to_prepare_to_store = debug_to_prepare_to_store;
-  current_target.deprecated_xfer_memory = deprecated_debug_xfer_memory;
+  current_target.to_xfer_memory = debug_to_xfer_memory;
   current_target.to_files_info = debug_to_files_info;
   current_target.to_insert_breakpoint = debug_to_insert_breakpoint;
   current_target.to_remove_breakpoint = debug_to_remove_breakpoint;
@@ -2527,6 +2383,7 @@ setup_target_debug (void)
   current_target.to_thread_alive = debug_to_thread_alive;
   current_target.to_find_new_threads = debug_to_find_new_threads;
   current_target.to_stop = debug_to_stop;
+  current_target.to_xfer_partial = debug_to_xfer_partial;
   current_target.to_rcmd = debug_to_rcmd;
   current_target.to_enable_exception_callback = debug_to_enable_exception_callback;
   current_target.to_get_current_exception_event = debug_to_get_current_exception_event;
index 84c284b268c44177b2683938e6e7a77877abc915..92beccaf343d8165de8f044172d7a61809817265 100644 (file)
@@ -304,6 +304,7 @@ struct target_ops
     void (*to_disconnect) (char *, int);
     void (*to_resume) (ptid_t, int, enum target_signal);
     ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
+    void (*to_post_wait) (ptid_t, int);
     void (*to_fetch_registers) (int);
     void (*to_store_registers) (int);
     void (*to_prepare_to_store) (void);
@@ -324,15 +325,12 @@ struct target_ops
 
        negative (call its absolute value N) means that we cannot
        transfer right at MEMADDR, but we could transfer at least
-       something at MEMADDR + N.
+       something at MEMADDR + N.  */
 
-       NOTE: cagney/2004-10-01: This has been entirely superseeded by
-       to_xfer_partial and inferior inheritance.  */
-
-    int (*deprecated_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
-                                  int len, int write,
-                                  struct mem_attrib *attrib,
-                                  struct target_ops *target);
+    int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
+                          int len, int write,
+                          struct mem_attrib *attrib,
+                          struct target_ops *target);
 
     void (*to_files_info) (struct target_ops *);
     int (*to_insert_breakpoint) (CORE_ADDR, char *);
@@ -344,7 +342,7 @@ struct target_ops
     int (*to_insert_watchpoint) (CORE_ADDR, int, int);
     int (*to_stopped_by_watchpoint) (void);
     int to_have_continuable_watchpoint;
-    int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *);
+    CORE_ADDR (*to_stopped_data_address) (void);
     int (*to_region_size_ok_for_hw_watchpoint) (int);
     void (*to_terminal_init) (void);
     void (*to_terminal_inferior) (void);
@@ -509,6 +507,19 @@ extern void target_disconnect (char *, int);
 #define        target_wait(ptid, status)               \
      (*current_target.to_wait) (ptid, status)
 
+/* The target_wait operation waits for a process event to occur, and
+   thereby stop the process.
+
+   On some targets, certain events may happen in sequences.  gdb's
+   correct response to any single event of such a sequence may require
+   knowledge of what earlier events in the sequence have been seen.
+
+   This operation provides a target-specific hook that allows the
+   necessary bookkeeping to be performed to track such sequences.  */
+
+#define target_post_wait(ptid, status) \
+     (*current_target.to_post_wait) (ptid, status)
+
 /* Fetch at least register REGNO, or all regs if regno == -1.  No result.  */
 
 #define        target_fetch_registers(regno)   \
@@ -567,6 +578,8 @@ extern char *child_core_file_to_sym_file (char *);
 extern void child_post_attach (int);
 #endif
 
+extern void child_post_wait (ptid_t, int);
+
 extern void child_post_startup_inferior (ptid_t);
 
 extern void child_acknowledge_created_inferior (int);
@@ -1070,14 +1083,9 @@ extern void (*deprecated_target_new_objfile_hook) (struct objfile *);
      (*current_target.to_remove_hw_breakpoint) (addr, save)
 #endif
 
-extern int target_stopped_data_address_p (struct target_ops *);
-
 #ifndef target_stopped_data_address
-#define target_stopped_data_address(target, x) \
-    (*target.to_stopped_data_address) (target, x)
-#else
-/* Horrible hack to get around existing macros :-(.  */
-#define target_stopped_data_address_p(CURRENT_TARGET) (1)
+#define target_stopped_data_address() \
+    (*current_target.to_stopped_data_address) ()
 #endif
 
 /* This will only be defined by a target that supports catching vfork events,
@@ -1229,6 +1237,4 @@ extern void push_remote_target (char *name, int from_tty);
 /* Blank target vector entries are initialized to target_ignore. */
 void target_ignore (void);
 
-extern struct target_ops deprecated_child_ops;
-
 #endif /* !defined (TARGET_H) */
index 7ba5c695220cc56f0f16bcd29d1b009aa52dd8a2..aa6abb45d220c98f468f1cdbd03b0abc94cb1aec 100644 (file)
@@ -1,99 +1,3 @@
-2004-10-14  Andrew Cagney  <cagney@gnu.org>
-
-       * gdb.mi/gdb701.c (main): Return 0.
-
-2004-10-13  Daniel Jacobowitz  <dan@debian.org>
-
-       * gdb.dwarf2/dw2-intercu.S, gdb.dwarf2/dw2-intercu.exp: New files.
-
-2004-10-12  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * gdb.threads/schedlock.c: Add comment markers to use to find
-       line numbers.
-       * gdb.threads/schedlock.exp: Adjust regex to handle the new
-       comments.
-       * gdb.threads/watchthreads.exp: Use gdb_get_line_number to find
-       breakpoint lines.
-
-2004-10-12  Daniel Jacobowitz  <dan@debian.org>
-
-       * gdb.dwarf2/dw2-basic.exp: Run on Hurd also.
-
-2004-10-12  Daniel Jacobowitz  <dan@debian.org>
-
-       * configure.in: Add gdb.dwarf2.
-       * configure: Regenerated.
-       * Makefile.in: Add gdb.dwarf2.
-       * gdb.dwarf2/Makefile.in, gdb.dwarf2/dw2-basic.S,
-       gdb.dwarf2/dw2-basic.exp, gdb.dwarf2/main.c,
-       gdb.dwarf2/file1.txt: New files.
-
-2004-10-11  Orjan Friberg  <orjanf@axis.com>
-
-       * gdb.threads/bp_in_thread.exp: Use runto_main and "continue" instead 
-       of "run", since the latter doesn't work with remote targets.  Adjust
-       the breakpoint numbering accordingly.
-       * gdb.threads/pthread_cond_wait.exp: Ditto.
-
-2004-10-08  Michael Chastain  <mec.gnu@mindspring.com>
-
-       * gdb.base/overlays.exp: Update copyright years.
-
-2004-10-08  Kei Sakamoto  <sakamoto.kei@renesas.com>
-
-       * gdb.base/overlays.exp: Disable if target is Linux.
-
-2004-10-06  Felix Lee  <felix+log1@specifixinc.com>
-
-       * config/gdbserver.exp (gdb_load): Use right filename on remote.
-
-2004-10-05  Kei Sakamoto  <sakamoto.kei@renesas.com>
-
-       * gdb.asm/asm-source.exp: Add m32r-linux target.
-       * gdb.asm/m32r-linux.inc: New file.
-
-2004-09-24  Andrew Cagney  <cagney@redhat.com>
-           David Anderson <anderson@redhat.com>
-
-       * gdb.base/bigcore.exp (extract_heap): If the expect "file size"
-       command fails, assume things will work.
-       * gdb.base/bigcore.c: Include <sys/stat.h> and <fcntl.h>.
-       (_GNU_SOURCE): Define.
-       (print_unsigned, print_hex): Change parameter to "long long".
-       (print_byte_count): New function, use to print byte counts.
-       (large_off_t, large_lseek, O_LARGEFILE): Define dependant on
-       O_LARGEFILE.
-       (main): Compute an upper bound on a corefile in max_core_size.
-       Limit memory chunk size to max_core_size.  Limit total memory
-       allocated to max_core_size.
-
-2004-09-23  Andrew Cagney  <cagney@gnu.org>
-
-       * gdb.base/bigcore.exp: Replace the code that creates a corefile
-       from a separate process with code that creates a corefile by
-       making the inferior dump core.
-
-2004-09-23  Mark Kettenis  <kettenis@gnu.org>
-
-       * gdb.base/sigstep.exp: Avoid comments withing gdb_test_multiple
-       block.
-
-2004-09-23  Michael Chastain  <mec.gnu@mindspring.com>
-
-       * gdb.base/constvars.exp (local_compiler_xfail_check_2):
-       New proc.  Accept both gcc 3.x.x and gcc 4.x.x.
-       * gdb.base/volatile.exp (local_compiler_xfail_check_2):
-       Likewise.
-
-2004-09-20  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * gdb.java/jprint.exp: New test case for java inferior call.
-       * gdb.java/jprint.java: Ditto.
-
-2004-09-15  Joel Brobecker  <brobecker@gnat.com>
-
-       * gdb.base/bigcore.exp: Deactivate on IRIX targets.
-
 2004-09-14  Michael Chastain  <mec.gnu@mindspring.com>
 
        * gdb.threads/killed.c: Include <stdlib.h>.
index 5aa82622dd7ed59bd02235832e8377afcc76ead8..d9be89c5e7b4f58802c5bec6a01d28d4f0218bf7 100644 (file)
@@ -36,7 +36,6 @@ EXEEXT = @EXEEXT@
 SUBDIRS = @subdirs@
 RPATH_ENVVAR = @RPATH_ENVVAR@
 ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm \
-       gdb.dwarf2 \
        gdb.fortran gdb.java gdb.mi gdb.objc gdb.threads gdb.trace \
        $(SUBDIRS)
 
index 6dc6b23f494ce158e77fc5f7bd990ba2b845414c..ed812f81aa4840c543860caf82e181de0ed4eb6f 100644 (file)
@@ -207,7 +207,7 @@ proc gdb_load { arg } {
        }
     }
 
-    set res [gdbserver_gdb_load $server_exec]
+    set res [gdbserver_gdb_load $host_exec]
     set protocol [lindex $res 0]
     set gdbport [lindex $res 1]
 
index 43a843f3d8fbc3096c46dcf33df40a8e7754467f..271e11d1281fce1ae6cc79e066af15d33df11de7 100755 (executable)
@@ -1052,8 +1052,8 @@ ac_given_srcdir=$srcdir
 trap 'rm -fr `echo "Makefile \
   gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \
   gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
-  gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
-  gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
+  gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/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
 cat >> $CONFIG_STATUS <<EOF
@@ -1149,8 +1149,8 @@ cat >> $CONFIG_STATUS <<EOF
 CONFIG_FILES=\${CONFIG_FILES-"Makefile \
   gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \
   gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
-  gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
-  gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
+  gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/Makefile \
+  gdb.java/Makefile gdb.mi/Makefile \
   gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
index 02c0a04e9e0b1ab452eacc591071dcb74ba3a459..8b90e04484cf9485b221f7db70a676ee0981a00c 100644 (file)
@@ -121,6 +121,6 @@ AC_CONFIG_SUBDIRS($configdirs)
 AC_OUTPUT([Makefile \
   gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \
   gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
-  gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
-  gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
+  gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/Makefile \
+  gdb.java/Makefile gdb.mi/Makefile \
   gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile])
index fcd0ae0190ba2399d81508a48765eb035daee046..e2c9e8a0c88124156ddff7c0cca10a4fc7b66c8a 100644 (file)
@@ -71,9 +71,6 @@ switch -glob -- [istarget] {
     "i\[3456\]86-*-*" {
         set asm-arch i386
     }
-    "m32r*-linux*" {
-        set asm-arch m32r-linux
-    }
     "m32r*-*" {
         set asm-arch m32r
         append link-flags "--whole-archive -lgloss --no-whole-archive"
diff --git a/gdb/testsuite/gdb.asm/m32r-linux.inc b/gdb/testsuite/gdb.asm/m32r-linux.inc
deleted file mode 100644 (file)
index 64d6504..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-       comment "subroutine prologue"
-       .macro gdbasm_enter
-       push fp -> push lr
-       addi sp,#-4 -> mv fp,sp
-       .endm
-
-       comment "subroutine epilogue"
-       .macro gdbasm_leave
-       addi sp,#4 -> pop lr
-       pop fp -> jmp lr
-       .endm
-
-       .macro gdbasm_call subr
-       bl      \subr
-       .endm
-
-       .macro gdbasm_several_nops
-       nop
-       nop
-       nop
-       nop
-       .endm
-
-       comment "exit (0)"
-       .macro gdbasm_exit0
-       ldi r0,#1 -> ldi r1,#0
-       ldi r2,#0 -> ldi r3,#0
-       trap #0 -> nop
-       .endm
-
-       comment "crt0 startup"
-       .macro gdbasm_startup
-       ldi fp,#0
-       .endm
index 9215b5af7337f5349f74387ff5f0d677eca64ac6..2a8bb077bb804b1287868479548da15dae6d5a07 100644 (file)
    Please email any bugs, comments, and/or additions to this file to:
    bug-gdb@prep.ai.mit.edu  */
 
-/* Get 64-bit stuff if on a GNU system.  */
-#define _GNU_SOURCE
-
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -48,7 +43,7 @@ print_char (char c)
 }
 
 static void
-print_unsigned (unsigned long long u)
+print_unsigned (unsigned long u)
 {
   if (u >= 10)
     print_unsigned (u / 10);
@@ -56,7 +51,7 @@ print_unsigned (unsigned long long u)
 }
 
 static void
-print_hex (unsigned long long u)
+print_hex (unsigned long u)
 {
   if (u >= 16)
     print_hex (u / 16);
@@ -77,16 +72,6 @@ print_address (const void *a)
   print_hex ((unsigned long) a);
 }
 
-static void
-print_byte_count (unsigned long long u)
-{
-  print_unsigned (u);
-  print_string (" (");
-  print_string ("0x");
-  print_hex (u);
-  print_string (") bytes");
-}
-
 /* Print the current values of RESOURCE.  */
 
 static void
@@ -137,20 +122,10 @@ static struct list heap = { &dummy, &dummy };
 
 static unsigned long bytes_allocated;
 
-#ifdef O_LARGEFILE
-#define large_off_t off64_t
-#define large_lseek lseek64
-#else
-#define large_off_t off_t
-#define O_LARGEFILE 0
-#define large_lseek lseek
-#endif
-
 int
 main ()
 {
   size_t max_chunk_size;
-  large_off_t max_core_size;
 
   /* Try to expand all the resource limits beyond the point of sanity
      - we're after the biggest possible core file.  */
@@ -169,46 +144,14 @@ main ()
   maximize_rlimit (RLIMIT_AS, "stack");
 #endif
 
-  print_string ("Maximize allocation limits ...\n");
-
-  /* Compute the largest possible corefile size.  No point in trying
-     to create a corefile larger than the largest file supported by
-     the file system.  What about 64-bit lseek64?  */
-  {
-    int fd;
-    large_off_t tmp;
-    unlink ("bigcore.corefile");
-    fd = open ("bigcore.corefile", O_RDWR | O_CREAT | O_TRUNC | O_LARGEFILE);
-    for (tmp = 1; tmp > 0; tmp <<= 1)
-      {
-       if (large_lseek (fd, tmp, SEEK_SET) > 0)
-         max_core_size = tmp;
-      }
-    close (fd);
-  }
-  
   /* Compute an initial chunk size.  The math is dodgy but it works
-     for the moment.  Perhaphs there's a constant around somewhere.
-     Limit this to max_core_size bytes - no point in trying to
-     allocate more than can be written to the corefile.  */
+     for the moment.  Perhaphs there's a constant around somewhere.  */
   {
     size_t tmp;
-    for (tmp = 1; tmp > 0 && tmp < max_core_size; tmp <<= 1)
+    for (tmp = 1; tmp > 0; tmp <<= 1)
       max_chunk_size = tmp;
   }
 
-  print_string ("  core: ");
-  print_byte_count (max_core_size);
-  print_string ("\n");
-  print_string ("  chunk: ");
-  print_byte_count (max_chunk_size);
-  print_string ("\n");
-  print_string ("  large? ");
-  if (O_LARGEFILE)
-    print_string ("yes\n");
-  else
-    print_string ("no\n");
-
   /* Allocate as much memory as possible creating a linked list of
      each section.  The linking ensures that some, but not all, the
      memory is allocated.  NB: Some kernels handle this efficiently -
@@ -230,10 +173,9 @@ main ()
       {
        unsigned long count = 0;
        print_string ("  ");
-       print_byte_count (chunk_size);
-       print_string (" ... ");
-       while (bytes_allocated + (1 + count) * chunk_size
-              < max_core_size)
+       print_unsigned (chunk_size);
+       print_string (" bytes ... ");
+       while (1)
          {
            struct list *chunk = malloc (chunk_size);
            if (chunk == NULL)
@@ -252,7 +194,7 @@ main ()
        bytes_allocated += chunk_size * count;
       }
     print_string ("Total of ");
-    print_byte_count (bytes_allocated);
+    print_unsigned (bytes_allocated);
     print_string (" bytes ");
     print_unsigned (chunks_allocated);
     print_string (" chunks\n");
index af3098c5f9d754713445a5e8e02eb7205623eaa0..b7201365361e6366730b714fee2c58fd7d3811b1 100644 (file)
@@ -49,13 +49,6 @@ if { [istarget "*-*-*bsd*"]
     return
 }
 
-# This testcase causes too much stress (in terms of memory usage)
-# on certain systems...
-if { [istarget "*-*-*irix*"] } {
-    untested "Testcase too stressful for this system"
-    return
-}
-
 set testfile "bigcore"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
@@ -65,6 +58,36 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
+# Create a core file named "TESTFILE.corefile" rather than just
+# "core", to avoid problems with sys admin types that like to
+# regularly prune all files named "core" from the system.
+
+# Some systems append "core" to the name of the program; others append
+# the name of the program to "core"; still others (like Linux, as of
+# May 2003) create cores named "core.PID".  In the latter case, we
+# could have many core files lying around, and it may be difficult to
+# tell which one is ours, so let's run the program in a subdirectory.
+
+set found 0
+set coredir "${objdir}/${subdir}/coredir.[getpid]"
+file mkdir $coredir
+catch "system \"(cd ${coredir}; ${binfile}; true) >/dev/null 2>&1\""
+set names [glob -nocomplain -directory $coredir *core*]
+if {[llength $names] == 1} {
+    set file [file join $coredir [lindex $names 0]]
+    remote_exec build "mv $file $corefile"
+    set found 1
+}
+
+# Try to clean up after ourselves. 
+remote_file build delete [file join $coredir coremmap.data]
+remote_exec build "rmdir $coredir"
+    
+if { $found == 0  } {
+    warning "can't generate a core file - core tests suppressed - check ulimit -c"
+    return 0
+}
+
 # Run GDB on the bigcore program up-to where it will dump core.
 
 gdb_exit
@@ -83,6 +106,28 @@ gdb_test "tbreak $print_core_line"
 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.
 
@@ -118,79 +163,6 @@ proc extract_heap { dir } {
 set next_heap [extract_heap next]
 set prev_heap [extract_heap prev]
 
-# Now create a core dump
-
-# Rename the core file to "TESTFILE.corefile" rather than just "core",
-# to avoid problems with sys admin types that like to regularly prune
-# all files named "core" from the system.
-
-# Some systems append "core" to the name of the program; others append
-# the name of the program to "core"; still others (like Linux, as of
-# May 2003) create cores named "core.PID".
-
-# Save the process ID.  Some systems dump the core into core.PID.
-set test "grab pid"
-gdb_test_multiple "info program" $test {
-    -re "child process (\[0-9\]+).*$gdb_prompt $" {
-       set inferior_pid $expect_out(1,string)
-       pass $test
-    }
-    -re "$gdb_prompt $" {
-       set inferior_pid unknown
-       pass $test
-    }
-}
-
-# Dump core using SIGABRT
-set oldtimeout $timeout
-set timeout 600
-gdb_test "signal SIGABRT" "Program terminated with signal SIGABRT, .*"
-
-# Find the corefile
-set file ""
-foreach pat [list core.${inferior_pid} ${testfile}.core core] {
-    set names [glob -nocomplain $pat]
-    if {[llength $names] == 1} {
-       set file [lindex $names 0]
-       remote_exec build "mv $file $corefile"
-       break
-    }
-}
-
-if { $file == "" } {
-    untested "Can't generate a core file"
-    return 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
-       }
-    }
-} { 
-    # Probably failed due to the TCL build having problems with very
-    # large values.  Since GDB uses a 64-bit off_t (when possible) it
-    # shouldn't have this problem.  Assume that things are going to
-    # work.  Without this assumption the test is skiped on systems
-    # (such as i386 GNU/Linux with patched kernel) which do pass.
-    pass "check core size"
-    set core_ok 1
-}
-if {! $core_ok} {
-    untested "check core size (system does not support large corefiles)"
-    return 0
-}
-
 # Now load up that core file
 
 set test "load corefile"
index 25f7434e53cfb8ea86c58f198330d04c25c98ea3..68732867d502aa5e5923c096f01b6400079b6052 100644 (file)
@@ -15,6 +15,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
+
 # written by Elena Zannoni (elz@apollo.hp.com)
 #
 # This file is part of the gdb testsuite
@@ -65,9 +68,6 @@ if ![runto_main] then {
 
 get_debug_format
 
-# Many tests xfail with gcc 2 -gstabs+.
-# TODO: check out the hp side of this.
-
 proc local_compiler_xfail_check { } {
     if { [test_compiler_info gcc-2-*] } then {
        if { ![test_debug_format "HP"] \
@@ -82,16 +82,6 @@ proc local_compiler_xfail_check { } {
     }
 }
 
-# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
-
-proc local_compiler_xfail_check_2 { } {
-    if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } {
-       if { [test_debug_format "stabs" ] } {
-           setup_xfail "*-*-*"
-       }
-    }
-}
-
 send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
 
     send_gdb "cont\n"
@@ -128,8 +118,10 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
 # test function parameters
 
 local_compiler_xfail_check
-local_compiler_xfail_check_2
-
+if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then {
+    # With stabs, even GCC 3 does not get the const char arguments correct.
+    setup_xfail "*-*-*"
+}
 send_gdb "ptype qux1\n"
 gdb_expect {
     -re "type = int \\(const char, const char, const char \\*, char \\* const\\).*$gdb_prompt $" {
@@ -281,7 +273,11 @@ proc do_constvar_tests {} {
     gdb_test "ptype locust" "type = double \\* const"
 
     local_compiler_xfail_check
-    local_compiler_xfail_check_2
+    if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then {
+       # With stabs, even GCC 3 does not get the constant structure member
+       # correct.
+       setup_xfail "*-*-*"
+    }
     gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}"
     local_compiler_xfail_check
     gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}"
index 671eab5cfd95c11917afd2af249425f16bc61759..37bfbaa1aa0c166ccb18f5cbb6073812ed4c2d23 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 2001, 2002, 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
@@ -39,11 +39,6 @@ if [istarget "d10v-*-*"] then {
     return 
 }
 
-if [istarget "*-*-linux*"] then {
-    verbose "Skipping overlay test -- Linux doesn't support overlayed programs."
-    return 
-}
-
 set testfile "overlays"
 set binfile ${objdir}/${subdir}/${testfile}
 set srcfile ${testfile}.c
index 81f8eed45338737cdd5f8b8eae16b9e607efe98b..55de44520f88bba56cfe2a38fa94d41e43dabd19 100644 (file)
@@ -211,12 +211,12 @@ proc skip_to_handler { i } {
     set prefix "$i to handler"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     # Advance to the infinite loop
@@ -252,12 +252,12 @@ proc skip_to_handler_entry { i } {
     set prefix "$i to handler entry"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     # Advance to the infinite loop
@@ -285,12 +285,12 @@ proc skip_over_handler { i } {
     set prefix "$i over handler"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     # Advance to the infinite loop
@@ -316,12 +316,12 @@ proc breakpoint_to_handler { i } {
     set prefix "$i on breakpoint, to handler"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     gdb_test "break $infinite_loop" "" "$prefix; break infinite loop"
@@ -361,12 +361,12 @@ proc breakpoint_to_handler_entry { i } {
     set prefix "$i on breakpoint, to handler entry"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     gdb_test "break $infinite_loop" "" "$prefix; break infinite loop"
@@ -398,12 +398,12 @@ proc breakpoint_over_handler { i } {
     set prefix "$i on breakpoint, skip handler"
     
     # Run around to the done
-    # You can add more patterns to this if you need them.
     set test "$prefix; resync"
     gdb_test_multiple "continue" "$test" {
        -re "done = 0.*$gdb_prompt " {
            pass "$test"
        }
+       # other patterns can go here
     }
     
     gdb_test "break $infinite_loop" "" "$prefix; break infinite loop"
index b6623f8ce9aa9919a3eafb3067ba223ab1a2a881..c12e3d88eaefd7a3125844cb4c7a1858aa6322a9 100644 (file)
@@ -14,6 +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
+
 # Written by Satish Pai <pai@apollo.hp.com> 1997-07-07
 #    In the spirit of constvars.exp: added volatile, const-volatile stuff.
 
@@ -71,9 +74,6 @@ if ![runto_main] then {
 
 get_debug_format
 
-# Many tests xfail with gcc 2 -gstabs+.
-# TODO: check out the hp side of this.
-
 proc local_compiler_xfail_check { } {
     if { [test_compiler_info gcc-2-*] } then {
        if { ![test_debug_format "HP"] \
@@ -88,16 +88,6 @@ proc local_compiler_xfail_check { } {
     }
 }
 
-# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
-
-proc local_compiler_xfail_check_2 { } {
-    if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } {
-       if { [test_debug_format "stabs" ] } {
-           setup_xfail "*-*-*"
-       }
-    }
-}
-
 send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
 
     send_gdb "cont\n"
@@ -258,7 +248,11 @@ gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.
 
 # test function parameters
 local_compiler_xfail_check
-local_compiler_xfail_check_2
+if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then {
+    # For reasons unknown, GCC 3 with stabs mangles several cv-qualified
+    # arguments to this function.
+    setup_xfail "*-*-*"
+}
 send_gdb "ptype qux2\n"
 gdb_expect {
     -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.dwarf2/Makefile.in b/gdb/testsuite/gdb.dwarf2/Makefile.in
deleted file mode 100644 (file)
index c338e02..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# Makefile for regression testing the GNU debugger.
-# Copyright 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2003, 2004
-# Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# 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.
-
-# GDB 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.
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-
-EXECUTABLES = *.x
-
-all info install-info dvi install uninstall installcheck check:
-       @echo "Nothing to be done for $@..."
-
-clean mostlyclean:
-       -rm -f *~ *.o a.out *.x *.ci *.tmp
-       -rm -f core core.coremaker coremaker.core corefile
-       -rm -f $(EXECUTABLES)
-
-distclean maintainer-clean realclean: clean
-       -rm -f *~ core
-       -rm -f Makefile config.status config.log
-       -rm -f *-init.exp
-       -rm -fr *.log summary detail *.plog *.sum *.psum site.*
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.S b/gdb/testsuite/gdb.dwarf2/dw2-basic.S
deleted file mode 100644 (file)
index 1e98a4d..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/* 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 a minimal file containing DWARF-2 information.  This test also
-   serves as a skeleton for other DWARF-2 tests.  Most other tests will
-   not be this extensively itemized and commented...  */
-
-/* Dummy function to provide debug information for.  */
-
-       .text
-.Lbegin_text1:
-       .globl func_cu1
-       .type func_cu1, %function
-func_cu1:
-.Lbegin_func_cu1:
-       .int 0
-.Lend_func_cu1:
-       .size func_cu1, .-func_cu1
-.Lend_text1:
-
-/* Debug information */
-
-       .section .debug_info
-.Lcu1_begin:
-       /* CU header */
-       .int    .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
-.Lcu1_start:
-       .short  2                               /* DWARF Version */
-       .int    .Labbrev1_begin                 /* Offset into abbrev section */
-       .byte   4                               /* Pointer size */
-
-       /* CU die */
-       .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
-       .int    .Lline1_begin                   /* DW_AT_stmt_list */
-       .int    .Lend_text1                     /* DW_AT_high_pc */
-       .int    .Lbegin_text1                   /* DW_AT_low_pc */
-       .ascii  "file1.txt\0"                   /* DW_AT_name */
-       .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
-       .byte   1                               /* DW_AT_language (C) */
-
-       /* func_cu1 */
-       .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
-       .byte           1                       /* DW_AT_external */
-       .byte           1                       /* DW_AT_decl_file */
-       .byte           2                       /* DW_AT_decl_line */
-       .ascii          "func_cu1\0"            /* DW_AT_name */
-       .int            .Ltype_int-.Lcu1_begin  /* DW_AT_type */
-       .int            .Lbegin_func_cu1        /* DW_AT_low_pc */
-       .int            .Lend_func_cu1          /* DW_AT_high_pc */
-       .byte           1                       /* DW_AT_frame_base: length */
-       .byte           0x55                    /* DW_AT_frame_base: DW_OP_reg5 */
-
-.Ltype_int:
-       .uleb128        3                       /* Abbrev: DW_TAG_base_type */
-       .ascii          "int\0"                 /* DW_AT_name */
-       .byte           4                       /* DW_AT_byte_size */
-       .byte           5                       /* DW_AT_encoding */
-
-       .byte           0                       /* End of children of CU */
-
-.Lcu1_end:
-
-/* Abbrev table */
-       .section .debug_abbrev
-.Labbrev1_begin:
-       .uleb128        1                       /* Abbrev code */
-       .uleb128        0x11                    /* DW_TAG_compile_unit */
-       .byte           1                       /* has_children */
-       .uleb128        0x10                    /* DW_AT_stmt_list */
-       .uleb128        0x6                     /* DW_FORM_data4 */
-       .uleb128        0x12                    /* DW_AT_high_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x11                    /* DW_AT_low_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x25                    /* DW_AT_producer */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x13                    /* DW_AT_language */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .uleb128        2                       /* Abbrev code */
-       .uleb128        0x2e                    /* DW_TAG_subprogram */
-       .byte           0                       /* has_children */
-       .uleb128        0x3f                    /* DW_AT_external */
-       .uleb128        0xc                     /* DW_FORM_flag */
-       .uleb128        0x3a                    /* DW_AT_decl_file */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3b                    /* DW_AT_decl_line */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x49                    /* DW_AT_type */
-       .uleb128        0x13                    /* DW_FORM_ref4 */
-       .uleb128        0x11                    /* DW_AT_low_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x12                    /* DW_AT_high_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x40                    /* DW_AT_frame_base */
-       .uleb128        0xa                     /* DW_FORM_block1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .uleb128        3                       /* Abbrev code */
-       .uleb128        0x24                    /* DW_TAG_base_type */
-       .byte           0                       /* has_children */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0xb                     /* DW_AT_byte_size */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3e                    /* DW_AT_encoding */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-/* Line table */
-       .section .debug_line
-.Lline1_begin:
-       .int            .Lline1_end - .Lline1_start     /* Initial length */
-.Lline1_start:
-       .short          2                       /* Version */
-       .int            .Lline1_lines - .Lline1_hdr     /* header_length */
-.Lline1_hdr:
-       .byte           1                       /* Minimum insn length */
-       .byte           1                       /* default_is_stmt */
-       .byte           1                       /* line_base */
-       .byte           1                       /* line_range */
-       .byte           0x10                    /* opcode_base */
-
-       /* Standard lengths */
-       .byte           0
-       .byte           1
-       .byte           1
-       .byte           1
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           0
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           0
-
-       /* Include directories */
-       .byte           0
-
-       /* File names */
-       .ascii          "file1.txt\0"
-       .uleb128        0
-       .uleb128        0
-       .uleb128        0
-
-       .byte           0
-
-.Lline1_lines:
-       .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
-       .byte           2
-       .int            .Lbegin_func_cu1
-
-       .byte           3       /* DW_LNS_advance_line */
-       .sleb128        3       /* ... to 4 */
-
-       .byte           1       /* DW_LNS_copy */
-
-       .byte           1       /* DW_LNS_copy (second time as an end-of-prologue marker) */
-
-       .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
-       .byte           2
-       .int            .Lend_func_cu1
-
-       .byte           0       /* DW_LNE_end_of_sequence */
-       .uleb128        1
-       .byte           1
-
-.Lline1_end:
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
deleted file mode 100644 (file)
index 7e0611e..0000000
+++ /dev/null
@@ -1,53 +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.
-
-# Minimal DWARF-2 unit test
-
-# This test can only be run on targets which support DWARF-2 and use gas.
-# For now pick a sampling of likely targets.
-if {![istarget *-*-linux*]
-    && ![istarget *-*-gnu*]
-    && ![istarget *-*-elf*]
-    && ![istarget arm-*-eabi*]
-    && ![istarget powerpc-*-eabi*]} {
-    return 0  
-}
-
-set testfile "dw2-basic"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}.x
-
-if  { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } {
-    return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } {
-    return -1
-}
-
-if  { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } {
-    return -1
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-gdb_test "set listsize 1" ""
-gdb_test "list func_cu1" "4\tFile 1 Line 4"
-gdb_test "ptype func_cu1" "type = int \\(\\)"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S
deleted file mode 100644 (file)
index b612f85..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/* 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 a minimal file containing DWARF-2 information.  This test also
-   serves as a skeleton for other DWARF-2 tests.  Most other tests will
-   not be this extensively itemized and commented...  */
-
-/* Dummy function to provide debug information for.  */
-
-       .text
-.Lbegin_text1:
-       .globl func_cu1
-       .type func_cu1, %function
-func_cu1:
-.Lbegin_func_cu1:
-       .int 0
-.Lend_func_cu1:
-       .size func_cu1, .-func_cu1
-.Lend_text1:
-
-/* Debug information */
-
-       .section .debug_info
-.Lcu1_begin:
-       /* CU header */
-       .int    .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
-.Lcu1_start:
-       .short  2                               /* DWARF Version */
-       .int    .Labbrev1_begin                 /* Offset into abbrev section */
-       .byte   4                               /* Pointer size */
-
-       /* CU die */
-       .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
-       .int    .Lline1_begin                   /* DW_AT_stmt_list */
-       .int    .Lend_text1                     /* DW_AT_high_pc */
-       .int    .Lbegin_text1                   /* DW_AT_low_pc */
-       .ascii  "file1.txt\0"                   /* DW_AT_name */
-       .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
-       .byte   1                               /* DW_AT_language (C) */
-
-       /* func_cu1 */
-       .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
-       .byte           1                       /* DW_AT_external */
-       .byte           1                       /* DW_AT_decl_file */
-       .byte           2                       /* DW_AT_decl_line */
-       .ascii          "func_cu1\0"            /* DW_AT_name */
-       .int            .Ltype_int              /* DW_AT_type */
-       .int            .Lbegin_func_cu1        /* DW_AT_low_pc */
-       .int            .Lend_func_cu1          /* DW_AT_high_pc */
-       .byte           1                       /* DW_AT_frame_base: length */
-       .byte           0x55                    /* DW_AT_frame_base: DW_OP_reg5 */
-
-       .byte           0                       /* End of children of CU */
-
-.Lcu1_end:
-
-       /* Second compilation unit.  */
-.Lcu2_begin:
-       /* CU header */
-       .int    .Lcu2_end - .Lcu2_start         /* Length of Compilation Unit */
-.Lcu2_start:
-       .short  2                               /* DWARF Version */
-       .int    .Labbrev2_begin                 /* Offset into abbrev section */
-       .byte   4                               /* Pointer size */
-
-       /* CU die */
-       .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
-       .ascii  "file1.txt\0"                   /* DW_AT_name */
-       .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
-       .byte   1                               /* DW_AT_language (C) */
-
-.Ltype_int:
-       .uleb128        2                       /* Abbrev: DW_TAG_base_type */
-       .ascii          "int\0"                 /* DW_AT_name */
-       .byte           4                       /* DW_AT_byte_size */
-       .byte           5                       /* DW_AT_encoding */
-
-       .byte           0                       /* End of children of CU */
-
-.Lcu2_end:
-
-/* Abbrev table */
-       .section .debug_abbrev
-.Labbrev1_begin:
-       .uleb128        1                       /* Abbrev code */
-       .uleb128        0x11                    /* DW_TAG_compile_unit */
-       .byte           1                       /* has_children */
-       .uleb128        0x10                    /* DW_AT_stmt_list */
-       .uleb128        0x6                     /* DW_FORM_data4 */
-       .uleb128        0x12                    /* DW_AT_high_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x11                    /* DW_AT_low_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x25                    /* DW_AT_producer */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x13                    /* DW_AT_language */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .uleb128        2                       /* Abbrev code */
-       .uleb128        0x2e                    /* DW_TAG_subprogram */
-       .byte           0                       /* has_children */
-       .uleb128        0x3f                    /* DW_AT_external */
-       .uleb128        0xc                     /* DW_FORM_flag */
-       .uleb128        0x3a                    /* DW_AT_decl_file */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3b                    /* DW_AT_decl_line */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x49                    /* DW_AT_type */
-       .uleb128        0x10                    /* DW_FORM_ref_addr */
-       .uleb128        0x11                    /* DW_AT_low_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x12                    /* DW_AT_high_pc */
-       .uleb128        0x1                     /* DW_FORM_addr */
-       .uleb128        0x40                    /* DW_AT_frame_base */
-       .uleb128        0xa                     /* DW_FORM_block1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-.Labbrev2_begin:
-       .uleb128        1                       /* Abbrev code */
-       .uleb128        0x11                    /* DW_TAG_compile_unit */
-       .byte           1                       /* has_children */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x25                    /* DW_AT_producer */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0x13                    /* DW_AT_language */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .uleb128        2                       /* Abbrev code */
-       .uleb128        0x24                    /* DW_TAG_base_type */
-       .byte           0                       /* has_children */
-       .uleb128        0x3                     /* DW_AT_name */
-       .uleb128        0x8                     /* DW_FORM_string */
-       .uleb128        0xb                     /* DW_AT_byte_size */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .uleb128        0x3e                    /* DW_AT_encoding */
-       .uleb128        0xb                     /* DW_FORM_data1 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-
-/* Line table */
-       .section .debug_line
-.Lline1_begin:
-       .int            .Lline1_end - .Lline1_start     /* Initial length */
-.Lline1_start:
-       .short          2                       /* Version */
-       .int            .Lline1_lines - .Lline1_hdr     /* header_length */
-.Lline1_hdr:
-       .byte           1                       /* Minimum insn length */
-       .byte           1                       /* default_is_stmt */
-       .byte           1                       /* line_base */
-       .byte           1                       /* line_range */
-       .byte           0x10                    /* opcode_base */
-
-       /* Standard lengths */
-       .byte           0
-       .byte           1
-       .byte           1
-       .byte           1
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           0
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           1
-       .byte           0
-       .byte           0
-       .byte           0
-
-       /* Include directories */
-       .byte           0
-
-       /* File names */
-       .ascii          "file1.txt\0"
-       .uleb128        0
-       .uleb128        0
-       .uleb128        0
-
-       .byte           0
-
-.Lline1_lines:
-       .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
-       .byte           2
-       .int            .Lbegin_func_cu1
-
-       .byte           3       /* DW_LNS_advance_line */
-       .sleb128        3       /* ... to 4 */
-
-       .byte           1       /* DW_LNS_copy */
-
-       .byte           1       /* DW_LNS_copy (second time as an end-of-prologue marker) */
-
-       .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
-       .byte           2
-       .int            .Lend_func_cu1
-
-       .byte           0       /* DW_LNE_end_of_sequence */
-       .uleb128        1
-       .byte           1
-
-.Lline1_end:
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
deleted file mode 100644 (file)
index d9a0cfd..0000000
+++ /dev/null
@@ -1,53 +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.
-
-# Minimal DWARF-2 unit test
-
-# This test can only be run on targets which support DWARF-2 and use gas.
-# For now pick a sampling of likely targets.
-if {![istarget *-*-linux*]
-    && ![istarget *-*-gnu*]
-    && ![istarget *-*-elf*]
-    && ![istarget arm-*-eabi*]
-    && ![istarget powerpc-*-eabi*]} {
-    return 0  
-}
-
-set testfile "dw2-intercu"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}.x
-
-if  { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } {
-    return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } {
-    return -1
-}
-
-if  { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } {
-    return -1
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-gdb_test "set listsize 1" ""
-gdb_test "list func_cu1" "4\tFile 1 Line 4"
-gdb_test "ptype func_cu1" "type = int \\(\\)"
diff --git a/gdb/testsuite/gdb.dwarf2/file1.txt b/gdb/testsuite/gdb.dwarf2/file1.txt
deleted file mode 100644 (file)
index b745e3a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-File 1 Line 1
-File 1 Line 2
-File 1 Line 3
-File 1 Line 4
-File 1 Line 5
-File 1 Line 6
-File 1 Line 7
-File 1 Line 8
diff --git a/gdb/testsuite/gdb.dwarf2/main.c b/gdb/testsuite/gdb.dwarf2/main.c
deleted file mode 100644 (file)
index 87442ac..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* 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.  */
-
-/* Dummy main function.  */
-
-int
-main()
-{
-  return 0;
-}
diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp
deleted file mode 100644 (file)
index 0268f87..0000000
+++ /dev/null
@@ -1,80 +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.  
-
-# This file was written by Jeff Johnston. (jjohnstn@redhat.com)
-#
-
-if $tracelevel then {
-       strace $tracelevel
-}
-
-load_lib "java.exp"
-
-set testfile "jprint"
-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 {
-    # Ref PR gdb:java/1565.  Don't use the simpler "break jmisc.main".
-    # As of 2004-02-24 it wasn't working and is being tested separatly.
-    runto "\'${testfile}.main(java.lang.String\[\])\'"
-
-    gdb_test "p jvclass.addprint(4,5,6)" "sum is 15\r\n.*" "unambiguous static call"
-
-    gdb_test "next" ""
-    gdb_test "next" ""
-
-    gdb_test "p x.print(44)" "x is 44\r\n.*" "single argument print call"
-    gdb_test "p x.print(22,33)" "y is 33\r\n.*" "double argument print call"
-    gdb_test "call x.dothat(55)" "new value is 58\r\n.*= 62.*" "virtual fn call"
-    gdb_test "p x.addprint(1,2,3)" "sum is 6\r\n.*" "inherited static call"
-    gdb_test "call x.addk(44)" "adding k gives 121\r\n.*= 121.*" "inherited virtual fn call"
-}
diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java
deleted file mode 100644 (file)
index f17607e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// jprint.java 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.
-
-class jvclass {
-  public static int k;
-  static {
-    k = 77;
-  }
-  public static void addprint (int x, int y, int z) {
-    int sum = x + y + z;
-    System.out.println ("sum is " + sum);
-  }
-
-  public int addk (int x) {
-    int sum = x + k;
-    System.out.println ("adding k gives " + sum);
-    return sum;
-  }
-}
-    
-public class jprint extends jvclass {
-  public int dothat (int x) {
-    int y = x + 3;
-    System.out.println ("new value is " + y);
-    return y + 4;
-  }
-  public static void print (int x) {
-    System.out.println("x is " + x);
-  }
-  public static void print (int x, int y) {
-    System.out.println("y is " + y);
-  }
-  public static void main(String[] args) {
-    jprint x = new jprint ();
-    x.print (44);
-    print (k, 33);
-  }
-}
-
-
index b1e72d2bd514a98e8ed4232e05b977bffbd3ee4a..16e5c2973409e6dcfcb2fe9f4eaf39076d16f0d2 100644 (file)
@@ -11,5 +11,5 @@ int
 main (int argc, char *argv[])
 {
   Foo *foo = 0;
-  return 0;
+  exit (0);
 }
index 91c328332dd4c0f3b6f087d062b40a0ea83b6b74..e9dfadb9b1a2d6d5ab22a9676212c70a91e755b3 100644 (file)
@@ -35,16 +35,15 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-runto_main
 
 gdb_test "break noreturn" \
-         "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+         "Breakpoint 1 at .*: file .*${srcfile}, line .*" \
          "breakpoint on noreturn"
 
 # Run the program and make sure GDB reports that we stopped after
 # hitting breakpoint 1 in noreturn().
 
-gdb_test "continue" \
-         ".*Breakpoint 2, noreturn ().*" \
+gdb_test "run" \
+         ".*Breakpoint 1, noreturn ().*" \
          "run to noreturn"
 
index 91b695f32e03714d3e8c34f29bac696ec3e5af03..72ae03a0cd9f095787ff56e86ea59ea3e44c0f3a 100644 (file)
@@ -36,14 +36,13 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-runto_main
 
 gdb_test "break break_me" \
-    "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+    "Breakpoint 1 at .*: file .*${srcfile}, line .*" \
          "breakpoint on break_me"
 
-gdb_test "continue" \
-         ".*Breakpoint 2, break_me ().*" \
+gdb_test "run" \
+         ".*Breakpoint 1, break_me ().*" \
          "run to break_me"
 
 # 
diff --git a/gdb/testsuite/gdb.threads/watchthreads.c b/gdb/testsuite/gdb.threads/watchthreads.c
deleted file mode 100644 (file)
index e19fe07..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This testcase is part of GDB, the GNU debugger.
-
-   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
-   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 copied from schedlock.c.  */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <pthread.h>
-
-void *thread_function(void *arg); /* Pointer to function executed by each thread */
-
-#define NUM 5
-
-unsigned int args[NUM+1];
-
-int main() {
-    int res;
-    pthread_t threads[NUM];
-    void *thread_result;
-    long i;
-
-    for (i = 0; i < NUM; i++)
-      {
-       args[i] = 1; /* Init value.  */
-       res = pthread_create(&threads[i],
-                            NULL,
-                            thread_function,
-                            (void *) i);
-      }
-
-    args[i] = 1;
-    thread_function ((void *) i);
-
-    exit(EXIT_SUCCESS);
-}
-
-void *thread_function(void *arg) {
-    int my_number =  (long) arg;
-    int *myp = (int *) &args[my_number];
-
-    /* Don't run forever.  Run just short of it :)  */
-    while (*myp > 0)
-      {
-       (*myp) ++;  /* Loop increment.  */
-      }
-
-    pthread_exit(NULL);
-}
-
index 0bb940f6e317d58d8b4ee5ad551bf08fc1de0378..d6e89d9382494c6c800fe317139b29763e321442 100644 (file)
@@ -31,7 +31,7 @@ if [target_info exists gdb,no_hardware_watchpoints] {
     return 0;
 }
 
-set testfile "watchthreads"
+set testfile "schedlock"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
@@ -60,20 +60,17 @@ set args_1 0
 gdb_test "watch args\[0\]" "Hardware watchpoint 2: args\\\[0\\\]"
 gdb_test "watch args\[1\]" "Hardware watchpoint 3: args\\\[1\\\]"
 
-set init_line [expr [gdb_get_line_number "Init value"]+1]
-set inc_line [gdb_get_line_number "Loop increment"]
-
 # Loop and continue to allow both watchpoints to be triggered.
 for {set i 0} {$i < 30} {incr i} {
   set test_flag 0
   gdb_test_multiple "continue" "threaded watch loop" {
-    -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $"
+    -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $"
        { set args_0 1; set test_flag 1 }
-    -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $"
+    -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $"
        { set args_1 1; set test_flag 1 }
-    -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $"
+    -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*schedlock.c:42.*$gdb_prompt $"
        { set args_0 [expr $args_0+1]; set test_flag 1 }
-    -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $"
+    -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*schedlock.c:42.*$gdb_prompt $"
        { set args_1 [expr $args_1+1]; set test_flag 1 }
   }
   # If we fail above, don't bother continuing loop
index 65d9fd51b89f93c7183fde7623b2cafb655db520..8bf52924b3e1e5dfe5c9fe07b12282da58bbd78d 100644 (file)
@@ -987,8 +987,8 @@ thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
     }
 
   xfer =
-    target_beneath->deprecated_xfer_memory (memaddr, myaddr, len, write,
-                                           attrib, target);
+    target_beneath->to_xfer_memory (memaddr, myaddr, len, write, attrib,
+                                   target);
 
   do_cleanups (old_chain);
   return xfer;
@@ -1339,7 +1339,7 @@ init_thread_db_ops (void)
   thread_db_ops.to_wait = thread_db_wait;
   thread_db_ops.to_fetch_registers = thread_db_fetch_registers;
   thread_db_ops.to_store_registers = thread_db_store_registers;
-  thread_db_ops.deprecated_xfer_memory = thread_db_xfer_memory;
+  thread_db_ops.to_xfer_memory = thread_db_xfer_memory;
   thread_db_ops.to_kill = thread_db_kill;
   thread_db_ops.to_create_inferior = thread_db_create_inferior;
   thread_db_ops.to_post_startup_inferior = thread_db_post_startup_inferior;
index 618dc86ecb27438bbe3eb4ebcbb7d58585e24f90..e586efd948132bba2d8fcf2d10fafb9d82a7958b 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -932,11 +932,15 @@ gdb_readline (char *prompt_arg)
        }
 
       if (c == '\n')
+#ifndef CRLF_SOURCE_FILES
+       break;
+#else
        {
          if (input_index > 0 && result[input_index - 1] == '\r')
            input_index--;
          break;
        }
+#endif
 
       result[input_index++] = c;
       while (input_index >= result_size)
index c99f97847fa54793b785796ffcc2416e74689eb6..3dc62d5d50802f6b7fd407e5e8befebb47031ea8 100644 (file)
@@ -94,14 +94,10 @@ box_win (struct tui_gen_win_info * win_info, int highlight_flag)
         attrs = tui_border_attrs;
 
       wattron (win, attrs);
-#ifdef HAVE_WBORDER
       wborder (win, tui_border_vline, tui_border_vline,
                tui_border_hline, tui_border_hline,
                tui_border_ulcorner, tui_border_urcorner,
                tui_border_llcorner, tui_border_lrcorner);
-#else
-      box (win, tui_border_vline, tui_border_hline);
-#endif
       if (win_info->title)
         mvwaddstr (win, 0, 3, win_info->title);
       wattroff (win, attrs);
index e30808c38b4d0f8a848b1f4a30016c31a22aaf49..1c7b73882a58c3041105f568a3c0cef045be780a 100644 (file)
@@ -1168,6 +1168,21 @@ savestring (const char *ptr, size_t size)
   return p;
 }
 
+char *
+msavestring (void *md, const char *ptr, size_t size)
+{
+  char *p = (char *) xmalloc (size + 1);
+  memcpy (p, ptr, size);
+  p[size] = 0;
+  return p;
+}
+
+char *
+mstrsave (void *md, const char *ptr)
+{
+  return (msavestring (md, ptr, strlen (ptr)));
+}
+
 void
 print_spaces (int n, struct ui_file *file)
 {
index a7b6bc261ab5f87d75b822caef5deccd64c3cc3c..c37e0ffeb70b59292de1c086eac3df03e4d2f34c 100644 (file)
@@ -332,9 +332,8 @@ dbgstate (int state)
 static int
 read_thr_debug (struct thread_debug *debugp)
 {
-  return base_ops.deprecated_xfer_memory (thr_debug_addr, (char *)debugp,
-                                         sizeof (*debugp), 0, NULL,
-                                         &base_ops);
+  return base_ops.to_xfer_memory (thr_debug_addr, (char *)debugp,
+                                 sizeof (*debugp), 0, NULL, &base_ops);
 }
 
 /* Read into MAP the contents of the thread map at inferior process address
@@ -343,9 +342,8 @@ read_thr_debug (struct thread_debug *debugp)
 static int
 read_map (CORE_ADDR mapp, struct thread_map *map)
 {
-  return base_ops.deprecated_xfer_memory ((CORE_ADDR)THR_MAP (mapp),
-                                         (char *)map, sizeof (*map),
-                                         0, NULL, &base_ops);
+  return base_ops.to_xfer_memory ((CORE_ADDR)THR_MAP (mapp), (char *)map,
+                                 sizeof (*map), 0, NULL, &base_ops);
 }
 
 /* Read into LWP the contents of the lwp decriptor at inferior process address
@@ -354,8 +352,8 @@ read_map (CORE_ADDR mapp, struct thread_map *map)
 static int
 read_lwp (CORE_ADDR lwpp, __lwp_desc_t *lwp)
 {
-  return base_ops.deprecated_xfer_memory (lwpp, (char *)lwp,
-                                         sizeof (*lwp), 0, NULL, &base_ops);
+  return base_ops.to_xfer_memory (lwpp, (char *)lwp,
+                                 sizeof (*lwp), 0, NULL, &base_ops);
 }
 
 /* Iterate through all user threads, applying FUNC(<map>, <lwp>, DATA) until
@@ -377,9 +375,8 @@ thread_iter (int (*func)(iter_t *, void *), void *data)
 
   if (!read_thr_debug (&debug))
     return 0;
-  if (!base_ops.deprecated_xfer_memory ((CORE_ADDR)debug.thr_map,
-                                       (char *)&mapp, sizeof (mapp), 0, NULL,
-                                       &base_ops))
+  if (!base_ops.to_xfer_memory ((CORE_ADDR)debug.thr_map, (char *)&mapp,
+                               sizeof (mapp), 0, NULL, &base_ops))
     return 0;
   if (!mapp)
     return 0;
@@ -636,12 +633,11 @@ libthread_stub (ptid_t ptid)
 
   /* Retrieve stub args. */
   sp = read_register_pid (SP_REGNUM, ptid);
-  if (!base_ops.deprecated_xfer_memory (sp + SP_ARG0, (char *)&mapp,
-                                       sizeof (mapp), 0, NULL, &base_ops))
+  if (!base_ops.to_xfer_memory (sp + SP_ARG0, (char *)&mapp,
+                               sizeof (mapp), 0, NULL, &base_ops))
     goto err;
-  if (!base_ops.deprecated_xfer_memory (sp + SP_ARG0 + sizeof (mapp),
-                                       (char *)&change, sizeof (change), 0,
-                                       NULL, &base_ops))
+  if (!base_ops.to_xfer_memory (sp + SP_ARG0 + sizeof (mapp), (char *)&change,
+                               sizeof (change), 0, NULL, &base_ops))
     goto err;
 
   /* create_inferior() may not have finished yet, so notice the main
@@ -957,7 +953,7 @@ libthread_init (void)
   if (!(thr_debug_addr = SYMBOL_VALUE_ADDRESS (ms)))
     return;
 
-  /* Initialize base_ops.deprecated_xfer_memory().  */
+  /* Initialize base_ops.to_xfer_memory(). */
   base_ops = current_target;
 
   /* Load _thr_debug's current contents. */
@@ -988,8 +984,8 @@ libthread_init (void)
 
       /* Activate the stub function. */
       onp = (CORE_ADDR)&((struct thread_debug *)thr_debug_addr)->thr_debug_on;
-      if (!base_ops.deprecated_xfer_memory ((CORE_ADDR)onp, (char *)&one,
-                                           sizeof (one), 1, NULL, &base_ops))
+      if (!base_ops.to_xfer_memory ((CORE_ADDR)onp, (char *)&one,
+                                   sizeof (one), 1, NULL, &base_ops))
        {
          delete_breakpoint (b);
          goto err;
index 93746ff92616d42976c987878e8ffb04cc53b2b7..21daeea6f00029acd720b8a5c50505056f24fc12 100644 (file)
@@ -899,7 +899,7 @@ init_850ice_ops (void)
   v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
   v850ice_ops.to_store_registers = v850ice_store_registers;
   v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
-  v850ice_ops.deprecated_xfer_memory = v850ice_xfer_memory;
+  v850ice_ops.to_xfer_memory = v850ice_xfer_memory;
   v850ice_ops.to_files_info = v850ice_files_info;
   v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
   v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
index f88701faee8e784f50ac2bc28a8399238e4aba49..7858f91d0de2ac0e46f35610292c262a9a92cf24 100644 (file)
@@ -202,10 +202,7 @@ value_subscript (struct value *array, struct value *idx)
          LONGEST index = value_as_long (idx);
          if (index >= lowerbound && index <= upperbound)
            return value_subscripted_rvalue (array, idx, lowerbound);
-         /* Emit warning unless we have an array of unknown size.
-            An array of unknown size has lowerbound 0 and upperbound -1.  */
-         if (upperbound > -1)
-           warning ("array or string index out of range");
+         warning ("array or string index out of range");
          /* fall doing C stuff */
          c_style = 1;
        }
index bd505be766e1c18871e755f1da8191e08bce410c..b00e93db3b5e368e0d04fb1d0af684f1612f1de8 100644 (file)
 #include "defs.h"
 #include "inferior.h"
 #include "regcache.h"
-#include "target.h"
 
 #include <sys/types.h>
 #include <sys/ptrace.h>
 #include <machine/reg.h>
 
 #include "vax-tdep.h"
-#include "inf-ptrace.h"
 
 /* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
 
@@ -64,8 +62,8 @@ vaxbsd_collect_gregset (const struct regcache *regcache,
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers.  */
 
-static void
-vaxbsd_fetch_inferior_registers (int regnum)
+void
+fetch_inferior_registers (int regnum)
 {
   struct reg regs;
 
@@ -79,8 +77,8 @@ vaxbsd_fetch_inferior_registers (int regnum)
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
    this for all registers.  */
 
-static void
-vaxbsd_store_inferior_registers (int regnum)
+void
+store_inferior_registers (int regnum)
 {
   struct reg regs;
 
@@ -135,13 +133,6 @@ void _initialize_vaxbsd_nat (void);
 void
 _initialize_vaxbsd_nat (void)
 {
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = vaxbsd_fetch_inferior_registers;
-  t->to_store_registers = vaxbsd_store_inferior_registers;
-  add_target (t);
-
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (vaxbsd_supply_pcb);
 }
index bf4a552983299784dc35b7cd06aff9c096174581..bcce9d2be7b4a8ba24c5f2108efe6db3d95d3fbc 100644 (file)
@@ -1 +1 @@
-6.2.50_2004-10-18-cvs
+2004-09-15-cvs
index 9845d46192d713e8e82390e34c1b69cea9be62a3..601f28bf1294b0e140574aa5ca516c5fa621a4ca 100644 (file)
@@ -86,6 +86,9 @@ static int debug_registers_used;
 #define DEBUG_MEM(x)   if (debug_memory)       printf_unfiltered x
 #define DEBUG_EXCEPT(x)        if (debug_exceptions)   printf_unfiltered x
 
+/* Forward declaration */
+extern struct target_ops child_ops;
+
 static void child_stop (void);
 static int win32_child_thread_alive (ptid_t);
 void child_kill_inferior (void);
@@ -1439,7 +1442,7 @@ do_initial_child_stuff (DWORD pid)
     dr[i] = 0;
   current_event.dwProcessId = pid;
   memset (&current_event, 0, sizeof (current_event));
-  push_target (&deprecated_child_ops);
+  push_target (&child_ops);
   child_init_thread_list ();
   disable_breakpoints_in_shlibs (1);
   child_clear_solibs ();
@@ -1651,7 +1654,7 @@ child_detach (char *args, int from_tty)
       gdb_flush (gdb_stdout);
     }
   inferior_ptid = null_ptid;
-  unpush_target (&deprecated_child_ops);
+  unpush_target (&child_ops);
 }
 
 char *
@@ -1901,7 +1904,7 @@ child_mourn_inferior (void)
 {
   (void) child_continue (DBG_CONTINUE, -1);
   i386_cleanup_dregs();
-  unpush_target (&deprecated_child_ops);
+  unpush_target (&child_ops);
   generic_mourn_inferior ();
 }
 
@@ -2065,46 +2068,48 @@ child_close (int x)
                PIDGET (inferior_ptid)));
 }
 
+struct target_ops child_ops;
+
 static void
 init_child_ops (void)
 {
-  deprecated_child_ops.to_shortname = "child";
-  deprecated_child_ops.to_longname = "Win32 child process";
-  deprecated_child_ops.to_doc = "Win32 child process (started by the \"run\" command).";
-  deprecated_child_ops.to_open = child_open;
-  deprecated_child_ops.to_close = child_close;
-  deprecated_child_ops.to_attach = child_attach;
-  deprecated_child_ops.to_detach = child_detach;
-  deprecated_child_ops.to_resume = child_resume;
-  deprecated_child_ops.to_wait = child_wait;
-  deprecated_child_ops.to_fetch_registers = child_fetch_inferior_registers;
-  deprecated_child_ops.to_store_registers = child_store_inferior_registers;
-  deprecated_child_ops.to_prepare_to_store = child_prepare_to_store;
-  deprecated_child_ops.deprecated_xfer_memory = child_xfer_memory;
-  deprecated_child_ops.to_files_info = child_files_info;
-  deprecated_child_ops.to_insert_breakpoint = memory_insert_breakpoint;
-  deprecated_child_ops.to_remove_breakpoint = memory_remove_breakpoint;
-  deprecated_child_ops.to_terminal_init = terminal_init_inferior;
-  deprecated_child_ops.to_terminal_inferior = terminal_inferior;
-  deprecated_child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
-  deprecated_child_ops.to_terminal_ours = terminal_ours;
-  deprecated_child_ops.to_terminal_save_ours = terminal_save_ours;
-  deprecated_child_ops.to_terminal_info = child_terminal_info;
-  deprecated_child_ops.to_kill = child_kill_inferior;
-  deprecated_child_ops.to_create_inferior = child_create_inferior;
-  deprecated_child_ops.to_mourn_inferior = child_mourn_inferior;
-  deprecated_child_ops.to_can_run = child_can_run;
-  deprecated_child_ops.to_thread_alive = win32_child_thread_alive;
-  deprecated_child_ops.to_pid_to_str = cygwin_pid_to_str;
-  deprecated_child_ops.to_stop = child_stop;
-  deprecated_child_ops.to_stratum = process_stratum;
-  deprecated_child_ops.to_has_all_memory = 1;
-  deprecated_child_ops.to_has_memory = 1;
-  deprecated_child_ops.to_has_stack = 1;
-  deprecated_child_ops.to_has_registers = 1;
-  deprecated_child_ops.to_has_execution = 1;
-  deprecated_child_ops.to_magic = OPS_MAGIC;
-  deprecated_child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
+  child_ops.to_shortname = "child";
+  child_ops.to_longname = "Win32 child process";
+  child_ops.to_doc = "Win32 child process (started by the \"run\" command).";
+  child_ops.to_open = child_open;
+  child_ops.to_close = child_close;
+  child_ops.to_attach = child_attach;
+  child_ops.to_detach = child_detach;
+  child_ops.to_resume = child_resume;
+  child_ops.to_wait = child_wait;
+  child_ops.to_fetch_registers = child_fetch_inferior_registers;
+  child_ops.to_store_registers = child_store_inferior_registers;
+  child_ops.to_prepare_to_store = child_prepare_to_store;
+  child_ops.to_xfer_memory = child_xfer_memory;
+  child_ops.to_files_info = child_files_info;
+  child_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  child_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  child_ops.to_terminal_init = terminal_init_inferior;
+  child_ops.to_terminal_inferior = terminal_inferior;
+  child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  child_ops.to_terminal_ours = terminal_ours;
+  child_ops.to_terminal_save_ours = terminal_save_ours;
+  child_ops.to_terminal_info = child_terminal_info;
+  child_ops.to_kill = child_kill_inferior;
+  child_ops.to_create_inferior = child_create_inferior;
+  child_ops.to_mourn_inferior = child_mourn_inferior;
+  child_ops.to_can_run = child_can_run;
+  child_ops.to_thread_alive = win32_child_thread_alive;
+  child_ops.to_pid_to_str = cygwin_pid_to_str;
+  child_ops.to_stop = child_stop;
+  child_ops.to_stratum = process_stratum;
+  child_ops.to_has_all_memory = 1;
+  child_ops.to_has_memory = 1;
+  child_ops.to_has_stack = 1;
+  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
@@ -2180,7 +2185,7 @@ _initialize_win32_nat (void)
           "Display selectors infos.",
           &info_w32_cmdlist);
 
-  add_target (&deprecated_child_ops);
+  add_target (&child_ops);
 }
 
 /* Hardware watchpoint support, adapted from go32-nat.c code.  */
index 0397bd45c013fec2e2e7cc55aee4dd66e51f992b..a9dafee1cb740a0f0393b6abc9b2d4bdc8e9474f 100644 (file)
@@ -1,6 +1,5 @@
 /* Target-vector operations for controlling Windows CE child processes, for GDB.
-
-   Copyright 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions, A Red Hat Company.
 
    This file is part of GDB.
@@ -127,6 +126,9 @@ upload_options[3] =
 static char *remote_upload = NULL;     /* Set by set remoteupload */
 static int remote_add_host = 0;
 
+/* Forward declaration */
+extern struct target_ops child_ops;
+
 static int win32_child_thread_alive (ptid_t);
 void child_kill_inferior (void);
 
@@ -1763,7 +1765,7 @@ child_create_inferior (char *exec_file, char *args, char **env,
   memset (&current_event, 0, sizeof (current_event));
   current_event.dwThreadId = pi.dwThreadId;
   inferior_ptid = pid_to_ptid (current_event.dwThreadId);
-  push_target (&deprecated_child_ops);
+  push_target (&child_ops);
   child_init_thread_list ();
   child_add_thread (pi.dwThreadId, pi.hThread);
   init_wait_for_inferior ();
@@ -1784,7 +1786,7 @@ static void
 child_mourn_inferior (void)
 {
   (void) child_continue (DBG_CONTINUE, -1);
-  unpush_target (&deprecated_child_ops);
+  unpush_target (&child_ops);
   stop_stub ();
   CeRapiUninit ();
   connection_initialized = 0;
@@ -1886,43 +1888,45 @@ child_load (char *file, int from_tty)
   upload_to_device (file, file);
 }
 
+struct target_ops child_ops;
+
 static void
 init_child_ops (void)
 {
-  memset (&deprecated_child_ops, 0, sizeof (deprecated_child_ops));
-  deprecated_child_ops.to_shortname = (char *) "child";
-  deprecated_child_ops.to_longname = (char *) "Windows CE process";
-  deprecated_child_ops.to_doc = (char *) "Windows CE process (started by the \"run\" command).";
-  deprecated_child_ops.to_open = child_open;
-  deprecated_child_ops.to_close = child_close;
-  deprecated_child_ops.to_resume = child_resume;
-  deprecated_child_ops.to_wait = child_wait;
-  deprecated_child_ops.to_fetch_registers = child_fetch_inferior_registers;
-  deprecated_child_ops.to_store_registers = child_store_inferior_registers;
-  deprecated_child_ops.to_prepare_to_store = child_prepare_to_store;
-  deprecated_child_ops.deprecated_xfer_memory = child_xfer_memory;
-  deprecated_child_ops.to_files_info = child_files_info;
-  deprecated_child_ops.to_insert_breakpoint = memory_insert_breakpoint;
-  deprecated_child_ops.to_remove_breakpoint = memory_remove_breakpoint;
-  deprecated_child_ops.to_terminal_init = terminal_init_inferior;
-  deprecated_child_ops.to_terminal_inferior = terminal_inferior;
-  deprecated_child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
-  deprecated_child_ops.to_terminal_ours = terminal_ours;
-  deprecated_child_ops.to_terminal_save_ours = terminal_save_ours;
-  deprecated_child_ops.to_terminal_info = child_terminal_info;
-  deprecated_child_ops.to_kill = child_kill_inferior;
-  deprecated_child_ops.to_load = child_load;
-  deprecated_child_ops.to_create_inferior = child_create_inferior;
-  deprecated_child_ops.to_mourn_inferior = child_mourn_inferior;
-  deprecated_child_ops.to_can_run = child_can_run;
-  deprecated_child_ops.to_thread_alive = win32_child_thread_alive;
-  deprecated_child_ops.to_stratum = process_stratum;
-  deprecated_child_ops.to_has_all_memory = 1;
-  deprecated_child_ops.to_has_memory = 1;
-  deprecated_child_ops.to_has_stack = 1;
-  deprecated_child_ops.to_has_registers = 1;
-  deprecated_child_ops.to_has_execution = 1;
-  deprecated_child_ops.to_magic = OPS_MAGIC;
+  memset (&child_ops, 0, sizeof (child_ops));
+  child_ops.to_shortname = (char *) "child";
+  child_ops.to_longname = (char *) "Windows CE process";
+  child_ops.to_doc = (char *) "Windows CE process (started by the \"run\" command).";
+  child_ops.to_open = child_open;
+  child_ops.to_close = child_close;
+  child_ops.to_resume = child_resume;
+  child_ops.to_wait = child_wait;
+  child_ops.to_fetch_registers = child_fetch_inferior_registers;
+  child_ops.to_store_registers = child_store_inferior_registers;
+  child_ops.to_prepare_to_store = child_prepare_to_store;
+  child_ops.to_xfer_memory = child_xfer_memory;
+  child_ops.to_files_info = child_files_info;
+  child_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  child_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  child_ops.to_terminal_init = terminal_init_inferior;
+  child_ops.to_terminal_inferior = terminal_inferior;
+  child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  child_ops.to_terminal_ours = terminal_ours;
+  child_ops.to_terminal_save_ours = terminal_save_ours;
+  child_ops.to_terminal_info = child_terminal_info;
+  child_ops.to_kill = child_kill_inferior;
+  child_ops.to_load = child_load;
+  child_ops.to_create_inferior = child_create_inferior;
+  child_ops.to_mourn_inferior = child_mourn_inferior;
+  child_ops.to_can_run = child_can_run;
+  child_ops.to_thread_alive = win32_child_thread_alive;
+  child_ops.to_stratum = process_stratum;
+  child_ops.to_has_all_memory = 1;
+  child_ops.to_has_memory = 1;
+  child_ops.to_has_stack = 1;
+  child_ops.to_has_registers = 1;
+  child_ops.to_has_execution = 1;
+  child_ops.to_magic = OPS_MAGIC;
 }
 
 
@@ -2019,7 +2023,7 @@ debugging over a network.", &setlist),
                  &setlist),
      &showlist);
 
-  add_target (&deprecated_child_ops);
+  add_target (&child_ops);
 }
 
 /* Determine if the thread referenced by "pid" is alive
index 28f5d002af62904a78cafcc99906181d59371a36..771a48e0248e672c537487247059cf976eb34a69 100644 (file)
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "frame.h"
-#include "frame-base.h"
-#include "frame-unwind.h"
-#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
 #include "value.h"
-#include "dis-asm.h"
 #include "inferior.h"
-#include "gdb_string.h"
-#include "gdb_assert.h"
 #include "arch-utils.h"
-#include "floatformat.h"
 #include "regcache.h"
-#include "doublest.h"
-#include "osabi.h"
+#include "gdbcore.h"
 #include "objfiles.h"
+#include "dis-asm.h"
+
+struct gdbarch_tdep
+{
+  /* gdbarch target dependent data here. Currently unused for Xstormy16. */
+};
+
+/* Extra info which is saved in each frame_info. */
+struct frame_extra_info
+{
+  int framesize;
+  int frameless_p;
+};
 
 enum gdb_regnum
 {
@@ -69,20 +69,6 @@ enum gdb_regnum
   E_NUM_REGS
 };
 
-/* Use an invalid address value as 'not available' marker.  */
-enum { REG_UNAVAIL = (CORE_ADDR) -1 };
-
-struct xstormy16_frame_cache
-{
-  /* Base address.  */
-  CORE_ADDR base;
-  CORE_ADDR pc;
-  LONGEST framesize;
-  int uses_fp;
-  CORE_ADDR saved_regs[E_NUM_REGS];
-  CORE_ADDR saved_sp;
-};
-
 /* Size of instructions, registers, etc. */
 enum
 {
@@ -101,8 +87,15 @@ enum
   E_MAX_RETTYPE_SIZE_IN_REGS = E_MAX_RETTYPE_SIZE (E_R2_REGNUM)
 };
 
+
+/* Size of all registers as a whole. */
+enum
+{
+  E_ALL_REGS_SIZE = (E_NUM_REGS - 1) * xstormy16_reg_size + xstormy16_pc_size
+};
+
 /* Function: xstormy16_register_name
-   Returns the name of the standard Xstormy16 register N.  */
+   Returns the name of the standard Xstormy16 register N. */
 
 static const char *
 xstormy16_register_name (int regnum)
@@ -113,7 +106,8 @@ xstormy16_register_name (int regnum)
     "psw", "sp", "pc"
   };
 
-  if (regnum < 0 || regnum >= E_NUM_REGS)
+  if (regnum < 0 ||
+      regnum >= sizeof (register_names) / sizeof (register_names[0]))
     internal_error (__FILE__, __LINE__,
                    "xstormy16_register_name: illegal register number %d",
                    regnum);
@@ -122,18 +116,172 @@ xstormy16_register_name (int regnum)
 
 }
 
+/* Function: xstormy16_register_byte 
+   Returns the byte position in the register cache for register N. */
+
+static int
+xstormy16_register_byte (int regnum)
+{
+  if (regnum < 0 || regnum >= E_NUM_REGS)
+    internal_error (__FILE__, __LINE__,
+                   "xstormy16_register_byte: illegal register number %d",
+                   regnum);
+  else
+    /* All registers occupy 2 bytes in the regcache except for PC
+       which is the last one. Therefore the byte position is still
+       simply a multiple of 2. */
+    return regnum * xstormy16_reg_size;
+}
+
+/* Function: xstormy16_register_raw_size
+   Returns the number of bytes occupied by the register on the target. */
+
+static int
+xstormy16_register_raw_size (int regnum)
+{
+  if (regnum < 0 || regnum >= E_NUM_REGS)
+    internal_error (__FILE__, __LINE__,
+                   "xstormy16_register_raw_size: illegal register number %d",
+                   regnum);
+  /* Only the PC has 4 Byte, all other registers 2 Byte. */
+  else if (regnum == E_PC_REGNUM)
+    return xstormy16_pc_size;
+  else
+    return xstormy16_reg_size;
+}
+
+/* Function: xstormy16_reg_virtual_type 
+   Returns the default type for register N. */
+
 static struct type *
-xstormy16_register_type (struct gdbarch *gdbarch, int regnum)
+xstormy16_reg_virtual_type (int regnum)
 {
-  if (regnum == E_PC_REGNUM)
+  if (regnum < 0 || regnum >= E_NUM_REGS)
+    internal_error (__FILE__, __LINE__,
+                   "xstormy16_register_virtual_type: illegal register number %d",
+                   regnum);
+  else if (regnum == E_PC_REGNUM)
     return builtin_type_uint32;
   else
     return builtin_type_uint16;
 }
 
+/* Function: xstormy16_get_saved_register
+   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,
+                             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);
+          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,
+                                         register_size (current_gdbarch, 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,
+                                           register_size (current_gdbarch, 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,
+                                register_size (current_gdbarch, 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
    Makes the decision if a given type is a scalar types.  Scalar
-   types are returned in the registers r2-r7 as they fit.  */
+   types are returned in the registers r2-r7 as they fit. */
 
 static int
 xstormy16_type_is_scalar (struct type *t)
@@ -143,117 +291,66 @@ xstormy16_type_is_scalar (struct type *t)
          && TYPE_CODE(t) != TYPE_CODE_ARRAY);
 }
 
-/* Function: xstormy16_use_struct_convention 
-   Returns non-zero if the given struct type will be returned using
-   a special convention, rather than the normal function return method.
-   7sed in the contexts of the "return" command, and of
-   target function calls from the debugger.  */ 
-
-static int
-xstormy16_use_struct_convention (struct type *type)
-{
-  return !xstormy16_type_is_scalar (type)
-        || TYPE_LENGTH (type) > E_MAX_RETTYPE_SIZE_IN_REGS;
-} 
-
 /* Function: xstormy16_extract_return_value
-   Find a function's return value in the appropriate registers (in
-   regbuf), and copy it into valbuf.  */
+   Copy the function's return value into VALBUF. 
+   This function is called only in the context of "target function calls",
+   ie. when the debugger forces a function to be called in the child, and
+   when the debugger forces a function to return prematurely via the
+   "return" command. */
 
 static void
-xstormy16_extract_return_value (struct type *type, struct regcache *regcache,
-                               void *valbuf)
+xstormy16_extract_return_value (struct type *type, char *regbuf, char *valbuf)
 {
-  int len = TYPE_LENGTH (type);
-  int i, regnum = E_1ST_ARG_REGNUM;
-
-  for (i = 0; i < len; i += xstormy16_reg_size)
-    regcache_raw_read (regcache, regnum++, (char *) valbuf + i);
-}
+  CORE_ADDR return_buffer;
+  int offset = 0;
 
-/* Function: xstormy16_store_return_value
-   Copy the function return value from VALBUF into the
-   proper location for a function return. 
-   Called only in the context of the "return" command.  */
-
-static void 
-xstormy16_store_return_value (struct type *type, struct regcache *regcache,
-                             const void *valbuf)
-{
-  if (TYPE_LENGTH (type) == 1)
-    {    
-      /* Add leading zeros to the value. */
-      char buf[xstormy16_reg_size];
-      memset (buf, 0, xstormy16_reg_size);
-      memcpy (buf, valbuf, 1);
-      regcache_raw_write (regcache, E_1ST_ARG_REGNUM, buf);
+  if (xstormy16_type_is_scalar (type)
+      && TYPE_LENGTH (type) <= E_MAX_RETTYPE_SIZE_IN_REGS)
+    {
+      /* Scalar return values of <= 12 bytes are returned in 
+         E_1ST_ARG_REGNUM to E_LST_ARG_REGNUM. */
+      memcpy (valbuf,
+             &regbuf[DEPRECATED_REGISTER_BYTE (E_1ST_ARG_REGNUM)] + offset,
+             TYPE_LENGTH (type));
     }
   else
     {
-      int len = TYPE_LENGTH (type);
-      int i, regnum = E_1ST_ARG_REGNUM;
+      /* Aggregates and return values > 12 bytes are returned in memory,
+         pointed to by R2. */
+      return_buffer =
+       extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_PTR_RET_REGNUM),
+                                 register_size (current_gdbarch, E_PTR_RET_REGNUM));
 
-      for (i = 0; i < len; i += xstormy16_reg_size)
-        regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
+      read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
     }
 }
 
-static enum return_value_convention
-xstormy16_return_value (struct gdbarch *gdbarch, struct type *type,
-                       struct regcache *regcache,
-                       void *readbuf, const void *writebuf)
-{
-  if (xstormy16_use_struct_convention (type))
-    return RETURN_VALUE_STRUCT_CONVENTION;
-  if (writebuf)
-    xstormy16_store_return_value (type, regcache, writebuf);
-  else if (readbuf)
-    xstormy16_extract_return_value (type, regcache, readbuf);
-  return RETURN_VALUE_REGISTER_CONVENTION;
-}
-
-static CORE_ADDR
-xstormy16_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
-{
-  if (addr & 1)
-    ++addr;
-  return addr;
-}
-
-/* Function: xstormy16_push_dummy_call
+/* Function: xstormy16_push_arguments
    Setup the function arguments for GDB to call a function in the inferior.
    Called only in the context of a target function call from the debugger.
-   Returns the value of the SP register after the args are pushed.  */
+   Returns the value of the SP register after the args are pushed.
+*/
 
 static CORE_ADDR
-xstormy16_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)
+xstormy16_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+                         int struct_return, CORE_ADDR struct_addr)
 {
   CORE_ADDR stack_dest = sp;
   int argreg = E_1ST_ARG_REGNUM;
   int i, j;
   int typelen, slacklen;
   char *val;
-  char buf[xstormy16_pc_size];
 
   /* If struct_return is true, then the struct return address will
      consume one argument-passing register.  */
   if (struct_return)
-    {
-      regcache_cooked_write_unsigned (regcache, E_PTR_RET_REGNUM, struct_addr);
-      argreg++;
-    }
+    argreg++;
 
   /* Arguments are passed in R2-R7 as they fit. If an argument doesn't
      fit in the remaining registers we're switching over to the stack.
      No argument is put on stack partially and as soon as we switched
      over to stack no further argument is put in a register even if it
-     would fit in the remaining unused registers.  */
+     would fit in the remaining unused registers. */
   for (i = 0; i < nargs && argreg <= E_LST_ARG_REGNUM; i++)
     {
       typelen = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
@@ -263,7 +360,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
       /* Put argument into registers wordwise. */
       val = VALUE_CONTENTS (args[i]);
       for (j = 0; j < typelen; j += xstormy16_reg_size)
-       regcache_cooked_write_unsigned (regcache, argreg++,
+       write_register (argreg++,
                        extract_unsigned_integer (val + j,
                                                  typelen - j ==
                                                  1 ? 1 :
@@ -271,10 +368,11 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
     }
 
   /* Align SP */
-  stack_dest = xstormy16_frame_align (gdbarch, stack_dest);
+  if (stack_dest & 1)
+    ++stack_dest;
 
   /* Loop backwards through remaining arguments and push them on the stack,
-     wordaligned.  */
+     wordaligned. */
   for (j = nargs - 1; j >= i; j--)
     {
       typelen = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[j]));
@@ -288,16 +386,154 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
       stack_dest += typelen + slacklen;
     }
 
-  store_unsigned_integer (buf, xstormy16_pc_size, bp_addr);
-  write_memory (stack_dest, buf, xstormy16_pc_size);
-  stack_dest += xstormy16_pc_size;
+  /* And that should do it.  Return the new stack pointer. */
+  return stack_dest;
+}
+
+/* Function: xstormy16_push_return_address (pc)
+   Setup the return address for GDB to call a function in the inferior.
+   Called only in the context of a target function call from the debugger.
+   Returns the value of the SP register when the operation is finished
+   (which may or may not be the same as before).
+*/
+
+static CORE_ADDR
+xstormy16_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+  unsigned char buf[xstormy16_pc_size];
+
+  store_unsigned_integer (buf, xstormy16_pc_size, entry_point_address ());
+  write_memory (sp, buf, xstormy16_pc_size);
+  return sp + xstormy16_pc_size;
+}
+
+/* Function: xstormy16_pop_frame
+   Destroy the innermost (Top-Of-Stack) stack frame, restoring the 
+   machine state that was in effect before the frame was created. 
+   Used in the contexts of the "return" command, and of 
+   target function calls from the debugger.
+*/
+
+static void
+xstormy16_pop_frame (void)
+{
+  struct frame_info *fi = get_current_frame ();
+  int i;
+
+  if (fi == NULL)
+    return;                    /* paranoia */
+
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
+    {
+      deprecated_pop_dummy_frame ();
+    }
+  else
+    {
+      /* Restore the saved regs. */
+      for (i = 0; i < NUM_REGS; i++)
+       if (deprecated_get_frame_saved_regs (fi)[i])
+         {
+           if (i == SP_REGNUM)
+             write_register (i, deprecated_get_frame_saved_regs (fi)[i]);
+           else if (i == E_PC_REGNUM)
+             write_register (i, read_memory_integer (deprecated_get_frame_saved_regs (fi)[i],
+                                                     xstormy16_pc_size));
+           else
+             write_register (i, read_memory_integer (deprecated_get_frame_saved_regs (fi)[i],
+                                                     xstormy16_reg_size));
+         }
+      /* Restore the PC */
+      write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (fi));
+      flush_cached_frames ();
+    }
+  return;
+}
+
+/* Function: xstormy16_store_struct_return
+   Copy the (struct) function return value to its destined location. 
+   Called only in the context of a target function call from the debugger.
+*/
+
+static void
+xstormy16_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+  write_register (E_PTR_RET_REGNUM, addr);
+}
+
+/* Function: xstormy16_store_return_value
+   Copy the function return value from VALBUF into the 
+   proper location for a function return. 
+   Called only in the context of the "return" command.
+*/
+
+static void
+xstormy16_store_return_value (struct type *type, char *valbuf)
+{
+  CORE_ADDR return_buffer;
+  char buf[xstormy16_reg_size];
+
+  if (xstormy16_type_is_scalar (type) && TYPE_LENGTH (type) == 1)
+    {
+      /* Add leading zeros to the value. */
+      memset (buf, 0, xstormy16_reg_size);
+      memcpy (buf, valbuf, 1);
+      deprecated_write_register_gen (E_1ST_ARG_REGNUM, buf);
+    }
+  else if (xstormy16_type_is_scalar (type) &&
+          TYPE_LENGTH (type) <= E_MAX_RETTYPE_SIZE_IN_REGS)
+    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (E_1ST_ARG_REGNUM),
+                                    valbuf, TYPE_LENGTH (type));
+  else
+    {
+      return_buffer = read_register (E_PTR_RET_REGNUM);
+      write_memory (return_buffer, valbuf, TYPE_LENGTH (type));
+    }
+}
+
+/* Function: xstormy16_extract_struct_value_address
+   Returns the address in which a function should return a struct value. 
+   Used in the contexts of the "return" command, and of 
+   target function calls from the debugger.
+*/
 
-  /* Update stack pointer.  */
-  regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, stack_dest);
+static CORE_ADDR
+xstormy16_extract_struct_value_address (struct regcache *regcache)
+{
+  /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return
+     address regster is preserved across function calls?  Probably
+     not, making this function wrong.  */
+  ULONGEST val;
+  regcache_raw_read_unsigned (regcache, E_PTR_RET_REGNUM, &val);
+  return val;
+}
 
-  /* Return the new stack pointer minus the return address slot since
-     that's what DWARF2/GCC uses as the frame's CFA.  */
-  return stack_dest - xstormy16_pc_size;
+/* Function: xstormy16_use_struct_convention 
+   Returns non-zero if the given struct type will be returned using
+   a special convention, rather than the normal function return method. 
+   7sed in the contexts of the "return" command, and of 
+   target function calls from the debugger.
+*/
+
+static int
+xstormy16_use_struct_convention (int gcc_p, struct type *type)
+{
+  return !xstormy16_type_is_scalar (type)
+    || TYPE_LENGTH (type) > E_MAX_RETTYPE_SIZE_IN_REGS;
+}
+
+/* Function: frame_saved_register
+   Returns the value that regnum had in frame fi
+   (saved in fi or in one of its children).  
+*/
+
+static CORE_ADDR
+xstormy16_frame_saved_register (struct frame_info *fi, int regnum)
+{
+  int size = xstormy16_register_raw_size (regnum);
+  char *buf = (char *) alloca (size);
+
+  xstormy16_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
+  return (CORE_ADDR) extract_unsigned_integer (buf, size);
 }
 
 /* Function: xstormy16_scan_prologue
@@ -305,25 +541,36 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
    Decide when we must have reached the end of the function prologue.
    If a frame_info pointer is provided, fill in its saved_regs etc.
 
-   Returns the address of the first instruction after the prologue.  */
+   Returns the address of the first instruction after the prologue. 
+*/
 
 static CORE_ADDR
-xstormy16_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
-                           struct xstormy16_frame_cache *cache,
-                           struct frame_info *next_frame)
+xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
+                        struct frame_info *fi, int *frameless)
 {
+  CORE_ADDR sp = 0, fp = 0;
   CORE_ADDR next_addr;
   ULONGEST inst, inst2;
   LONGEST offset;
   int regnum;
 
-  /* Initialize framesize with size of PC put on stack by CALLF inst. */
-  cache->saved_regs[E_PC_REGNUM] = 0;
-  cache->framesize = xstormy16_pc_size;
-
-  if (start_addr >= end_addr)
-    return end_addr;
-
+  if (frameless)
+    *frameless = 1;
+  if (fi)
+    {
+      /* In a call dummy, don't touch the frame. */
+      if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
+       return start_addr;
+
+      /* Grab the frame-relative values of SP and FP, needed below. 
+         The frame_saved_register function will find them on the
+         stack or in the registers as appropriate. */
+      sp = xstormy16_frame_saved_register (fi, E_SP_REGNUM);
+      fp = xstormy16_frame_saved_register (fi, E_FP_REGNUM);
+
+      /* Initialize framesize with size of PC put on stack by CALLF inst. */
+      get_frame_extra_info (fi)->framesize = xstormy16_pc_size;
+    }
   for (next_addr = start_addr;
        next_addr < end_addr; next_addr += xstormy16_inst_size)
     {
@@ -333,33 +580,42 @@ xstormy16_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
 
       if (inst >= 0x0082 && inst <= 0x008d)    /* push r2 .. push r13 */
        {
-         regnum = inst & 0x000f;
-         cache->saved_regs[regnum] = cache->framesize;
-         cache->framesize += xstormy16_reg_size;
+         if (fi)
+           {
+             regnum = inst & 0x000f;
+             deprecated_get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize;
+             get_frame_extra_info (fi)->framesize += xstormy16_reg_size;
+           }
        }
 
       /* optional stack allocation for args and local vars <= 4 byte */
       else if (inst == 0x301f || inst == 0x303f)       /* inc r15, #0x1/#0x3 */
        {
-         cache->framesize += ((inst & 0x0030) >> 4) + 1;
+         if (fi)               /* Record the frame size. */
+           get_frame_extra_info (fi)->framesize += ((inst & 0x0030) >> 4) + 1;
        }
 
       /* optional stack allocation for args and local vars > 4 && < 16 byte */
       else if ((inst & 0xff0f) == 0x510f)      /* 51Hf   add r15, #0xH */
        {
-         cache->framesize += (inst & 0x00f0) >> 4;
+         if (fi)               /* Record the frame size. */
+           get_frame_extra_info (fi)->framesize += (inst & 0x00f0) >> 4;
        }
 
       /* optional stack allocation for args and local vars >= 16 byte */
       else if (inst == 0x314f && inst2 >= 0x0010)      /* 314f HHHH  add r15, #0xH */
        {
-         cache->framesize += inst2;
+         if (fi)               /* Record the frame size. */
+           get_frame_extra_info (fi)->framesize += inst2;
          next_addr += xstormy16_inst_size;
        }
 
       else if (inst == 0x46fd) /* mov r13, r15 */
        {
-         cache->uses_fp = 1;
+         if (fi)               /* Record that the frame pointer is in use. */
+           get_frame_extra_info (fi)->frameless_p = 0;
+         if (frameless)
+           *frameless = 0;
        }
 
       /* optional copying of args in r2-r7 to r10-r13 */
@@ -374,21 +630,83 @@ xstormy16_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
       /* 73DS HHHH   mov.w (rD, 0xHHHH), r(S-8) */
       else if ((inst & 0xfed8) == 0x72d8 && (inst & 0x0007) >= 2)
        {
-         regnum = inst & 0x0007;
-         /* Only 12 of 16 bits of the argument are used for the
-            signed offset. */
-         offset = (LONGEST) (inst2 & 0x0fff);
-         if (offset & 0x0800)
-           offset -= 0x1000;
-
-         cache->saved_regs[regnum] = cache->framesize + offset;
+         if (fi)
+           {
+             regnum = inst & 0x0007;
+             /* Only 12 of 16 bits of the argument are used for the
+                signed offset. */
+             offset = (LONGEST) (inst2 & 0x0fff);
+             if (offset & 0x0800)
+               offset -= 0x1000;
+
+             deprecated_get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize + offset;
+           }
+         next_addr += xstormy16_inst_size;
+       }
+
+#if 0
+      /* 2001-08-10: Not part of the prologue anymore due to change in
+         ABI. r8 and r9 are not used for argument passing anymore. */
+
+      /* optional copying of r8, r9 to stack */
+      /* 46S7; 73Df HHHH   mov.w r7,rS; mov.w (rD, 0xHHHH), r7 D=8,9; S=13,15 */
+      /* 46S7; 72df HHHH   mov.w r7,rS; mov.b (rD, 0xHHHH), r7 D=8,9; S=13,15 */
+      else if ((inst & 0xffef) == 0x4687 && (inst2 & 0xfedf) == 0x72df)
+       {
+         next_addr += xstormy16_inst_size;
+         if (fi)
+           {
+             regnum = (inst & 0x00f0) >> 4;
+             inst = inst2;
+             inst2 = read_memory_unsigned_integer (next_addr
+                                                   + xstormy16_inst_size,
+                                                   xstormy16_inst_size);
+             /* Only 12 of 16 bits of the argument are used for the
+                signed offset. */
+             offset = (LONGEST) (inst2 & 0x0fff);
+             if (offset & 0x0800)
+               offset -= 0x1000;
+
+             fi->saved_regs[regnum] = fi->extra_info->framesize + offset;
+           }
          next_addr += xstormy16_inst_size;
        }
+#endif
 
       else                     /* Not a prologue instruction. */
        break;
     }
 
+  if (fi)
+    {
+      /* Special handling for the "saved" address of the SP:
+         The SP is of course never saved on the stack at all, so
+         by convention what we put here is simply the previous 
+         _value_ of the SP (as opposed to an address where the
+         previous value would have been pushed).  */
+      if (get_frame_extra_info (fi)->frameless_p)
+       {
+         deprecated_get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - get_frame_extra_info (fi)->framesize;
+         deprecated_update_frame_base_hack (fi, sp);
+       }
+      else
+       {
+         deprecated_get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - get_frame_extra_info (fi)->framesize;
+         deprecated_update_frame_base_hack (fi, fp);
+       }
+
+      /* So far only offsets to the beginning of the frame are
+         saved in the saved_regs. Now we now the relation between
+         sp, fp and framesize. We know the beginning of the frame
+         so we can translate the register offsets to real addresses. */
+      for (regnum = 0; regnum < E_SP_REGNUM; ++regnum)
+       if (deprecated_get_frame_saved_regs (fi)[regnum])
+         deprecated_get_frame_saved_regs (fi)[regnum] += deprecated_get_frame_saved_regs (fi)[E_SP_REGNUM];
+
+      /* Save address of PC on stack. */
+      deprecated_get_frame_saved_regs (fi)[E_PC_REGNUM] = deprecated_get_frame_saved_regs (fi)[E_SP_REGNUM];
+    }
+
   return next_addr;
 }
 
@@ -412,12 +730,12 @@ xstormy16_skip_prologue (CORE_ADDR pc)
     {
       struct symtab_and_line sal;
       struct symbol *sym;
-      struct xstormy16_frame_cache cache;
 
       /* Don't trust line number debug info in frameless functions. */
-      CORE_ADDR plg_end = xstormy16_analyze_prologue (func_addr, func_end,
-                                                     &cache, NULL);
-      if (!cache.uses_fp)
+      int frameless = 1;
+      CORE_ADDR plg_end = xstormy16_scan_prologue (func_addr, func_end,
+                                                  NULL, &frameless);
+      if (frameless)
         return plg_end;
 
       /* Found a function.  */
@@ -447,7 +765,7 @@ xstormy16_skip_prologue (CORE_ADDR pc)
 static int
 xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  CORE_ADDR func_addr = 0, func_end = 0;
+  CORE_ADDR addr, func_addr = 0, func_end = 0;
 
   if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
     {
@@ -486,6 +804,151 @@ xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   return 0;
 }
 
+/* Function: xstormy16_frame_init_saved_regs
+   Set up the 'saved_regs' array.
+   This is a data structure containing the addresses on the stack 
+   where each register has been saved, for each stack frame.  
+   Registers that have not been saved will have zero here.
+   The stack register is special: rather than the address where the 
+   stack register has been saved, saved_regs[SP_REGNUM] will have the
+   actual value of the previous frame's stack register. 
+
+   This function may be called in any context where the saved register
+   values may be needed (backtrace, frame_info, frame_register).  On
+   many targets, it is called directly by init_extra_frame_info, in
+   part because the information may be needed immediately by
+   frame_chain.  */
+
+static void
+xstormy16_frame_init_saved_regs (struct frame_info *fi)
+{
+  CORE_ADDR func_addr, func_end;
+
+  if (!deprecated_get_frame_saved_regs (fi))
+    {
+      frame_saved_regs_zalloc (fi);
+
+      /* Find the beginning of this function, so we can analyze its
+         prologue. */
+      if (find_pc_partial_function (get_frame_pc (fi), NULL, &func_addr, &func_end))
+       xstormy16_scan_prologue (func_addr, get_frame_pc (fi), fi, NULL);
+      /* Else we're out of luck (can't debug completely stripped code). 
+         FIXME. */
+    }
+}
+
+/* Function: xstormy16_frame_saved_pc
+   Returns the return address for the selected frame. 
+   Called by frame_info, legacy_frame_chain_valid, and sometimes by
+   get_prev_frame.  */
+
+static CORE_ADDR
+xstormy16_frame_saved_pc (struct frame_info *fi)
+{
+  CORE_ADDR saved_pc;
+
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
+    {
+      saved_pc = deprecated_read_register_dummy (get_frame_pc (fi),
+                                                get_frame_base (fi),
+                                                E_PC_REGNUM);
+    }
+  else
+    {
+      saved_pc = read_memory_unsigned_integer (deprecated_get_frame_saved_regs (fi)[E_PC_REGNUM],
+                                              xstormy16_pc_size);
+    }
+
+  return saved_pc;
+}
+
+/* Function: xstormy16_init_extra_frame_info
+   This is the constructor function for the frame_info struct, 
+   called whenever a new frame_info is created (from create_new_frame,
+   and from get_prev_frame).
+*/
+
+static void
+xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+  if (!get_frame_extra_info (fi))
+    {
+      frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
+      get_frame_extra_info (fi)->framesize = 0;
+      get_frame_extra_info (fi)->frameless_p = 1;      /* Default frameless, detect framed */
+
+      /* By default, the fi->frame is set to the value of the FP reg by gdb.
+         This may not always be right; we may be in a frameless function,
+         or we may be in the prologue, before the FP has been set up.
+         Unfortunately, we can't make this determination without first
+         calling scan_prologue, and we can't do that unles we know the
+         get_frame_pc (fi).  */
+
+      if (!get_frame_pc (fi))
+       {
+         /* Sometimes we are called from get_prev_frame without
+            the PC being set up first.  Long history, don't ask.
+            Fortunately this will never happen from the outermost
+            frame, so we should be able to get the saved pc from
+            the next frame. */
+         if (get_next_frame (fi))
+           deprecated_update_frame_pc_hack (fi, xstormy16_frame_saved_pc (get_next_frame (fi)));
+       }
+
+      /* Take care of the saved_regs right here (non-lazy). */
+      xstormy16_frame_init_saved_regs (fi);
+    }
+}
+
+/* Function: xstormy16_frame_chain
+   Returns a pointer to the stack frame of the calling function.
+   Called only from get_prev_frame.  Needed for backtrace, "up", etc.
+*/
+
+static CORE_ADDR
+xstormy16_frame_chain (struct frame_info *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);
+    }
+  else
+    {
+      /* Return computed offset from this frame's fp. */
+      return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
+    }
+}
+
+static int
+xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
+{
+  return chain < 0x8000 && DEPRECATED_FRAME_SAVED_PC (thisframe) >= 0x8000 &&
+    (get_frame_extra_info (thisframe)->frameless_p ||
+     get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
+}
+
+/* Function: xstormy16_saved_pc_after_call Returns the previous PC
+   immediately after a function call.  This function is meant to
+   bypass the regular frame_register() mechanism, ie. it is meant to
+   work even if the frame isn't complete.  Called by
+   step_over_function, and sometimes by get_prev_frame.  */
+
+static CORE_ADDR
+xstormy16_saved_pc_after_call (struct frame_info *ignore)
+{
+  CORE_ADDR sp, pc, tmp;
+
+  sp = read_register (E_SP_REGNUM) - xstormy16_pc_size;
+  pc = read_memory_integer (sp, xstormy16_pc_size);
+
+  /* Skip over jump table entry if necessary.  */
+  if ((tmp = SKIP_TRAMPOLINE_CODE (pc)))
+    pc = tmp;
+
+  return pc;
+}
+
 const static unsigned char *
 xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
@@ -550,6 +1013,7 @@ xstormy16_find_jmp_table_entry (CORE_ADDR faddr)
          for (addr = osect->addr;
               addr < osect->endaddr; addr += 2 * xstormy16_inst_size)
            {
+             int status;
              LONGEST inst, inst2, faddr2;
              char buf[2 * xstormy16_inst_size];
 
@@ -570,7 +1034,7 @@ xstormy16_find_jmp_table_entry (CORE_ADDR faddr)
 static CORE_ADDR
 xstormy16_skip_trampoline_code (CORE_ADDR pc)
 {
-  CORE_ADDR tmp = xstormy16_resolve_jmp_table_entry (pc);
+  int tmp = xstormy16_resolve_jmp_table_entry (pc);
 
   if (tmp && tmp != pc)
     return tmp;
@@ -583,13 +1047,6 @@ xstormy16_in_solib_call_trampoline (CORE_ADDR pc, char *name)
   return xstormy16_skip_trampoline_code (pc) != 0;
 }
 
-/* Function pointers are 16 bit.  The address space is 24 bit, using
-   32 bit addresses.  Pointers to functions on the XStormy16 are implemented
-   by using 16 bit pointers, which are either direct pointers in case the
-   function begins below 0x10000, or indirect pointers into a jump table.
-   The next two functions convert 16 bit pointers into 24 (32) bit addresses
-   and vice versa.  */
-
 static CORE_ADDR
 xstormy16_pointer_to_address (struct type *type, const void *buf)
 {
@@ -620,164 +1077,20 @@ xstormy16_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
   store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
 }
 
-static struct xstormy16_frame_cache *
-xstormy16_alloc_frame_cache (void)
-{
-  struct xstormy16_frame_cache *cache;
-  int i;
-
-  cache = FRAME_OBSTACK_ZALLOC (struct xstormy16_frame_cache);
-
-  cache->base = 0;
-  cache->saved_sp = 0;
-  cache->pc = 0;
-  cache->uses_fp = 0;
-  cache->framesize = 0;
-  for (i = 0; i < E_NUM_REGS; ++i)
-    cache->saved_regs[i] = REG_UNAVAIL;
-
-  return cache;
-}
-
-static struct xstormy16_frame_cache *
-xstormy16_frame_cache (struct frame_info *next_frame, void **this_cache)
-{
-  struct xstormy16_frame_cache *cache;
-  CORE_ADDR current_pc;
-  int i;
-
-  if (*this_cache)
-    return *this_cache;
-
-  cache = xstormy16_alloc_frame_cache ();
-  *this_cache = cache;
-
-  cache->base = frame_unwind_register_unsigned (next_frame, E_FP_REGNUM);
-  if (cache->base == 0)
-    return cache;
-
-  cache->pc = frame_func_unwind (next_frame);
-  current_pc = frame_pc_unwind (next_frame);
-  if (cache->pc)
-    xstormy16_analyze_prologue (cache->pc, current_pc, cache, next_frame);
-
-  if (!cache->uses_fp)
-    cache->base = frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-
-  cache->saved_sp = cache->base - cache->framesize;
-
-  for (i = 0; i < E_NUM_REGS; ++i)
-    if (cache->saved_regs[i] != REG_UNAVAIL)
-      cache->saved_regs[i] += cache->saved_sp;
-
-  return cache;
-}
-
-static void
-xstormy16_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 xstormy16_frame_cache *cache = xstormy16_frame_cache (next_frame,
-                                                               this_cache);
-  gdb_assert (regnum >= 0);
-
-  if (regnum == E_SP_REGNUM && cache->saved_sp)
-    {
-      *optimizedp = 0;
-      *lvalp = not_lval;
-      *addrp = 0;
-      *realnump = -1;
-      if (valuep)
-        {
-          /* Store the value.  */
-          store_unsigned_integer (valuep, xstormy16_reg_size, cache->saved_sp);
-        }
-      return;
-    }
-
-  if (regnum < E_NUM_REGS && cache->saved_regs[regnum] != REG_UNAVAIL)
-    {
-      *optimizedp = 0;
-      *lvalp = lval_memory;
-      *addrp = cache->saved_regs[regnum];
-      *realnump = -1;
-      if (valuep)
-        {
-          /* Read the value in from memory.  */
-          read_memory (*addrp, valuep,
-                       register_size (current_gdbarch, regnum));
-        }
-      return;
-    }
-
-  frame_register_unwind (next_frame, regnum,
-                         optimizedp, lvalp, addrp, realnump, valuep);
-}
-
-static void
-xstormy16_frame_this_id (struct frame_info *next_frame, void **this_cache,
-                        struct frame_id *this_id)
-{
-  struct xstormy16_frame_cache *cache = xstormy16_frame_cache (next_frame,
-                                                              this_cache);
-
-  /* This marks the outermost frame.  */
-  if (cache->base == 0)
-    return;
-
-  *this_id = frame_id_build (cache->saved_sp, cache->pc);
-}
-
-static CORE_ADDR
-xstormy16_frame_base_address (struct frame_info *next_frame, void **this_cache)
-{
-  struct xstormy16_frame_cache *cache = xstormy16_frame_cache (next_frame,
-                                                              this_cache);
-  return cache->base;
-}
-
-static const struct frame_unwind xstormy16_frame_unwind = {
-  NORMAL_FRAME,
-  xstormy16_frame_this_id,
-  xstormy16_frame_prev_register
-};
-
-static const struct frame_base xstormy16_frame_base = {
-  &xstormy16_frame_unwind,
-  xstormy16_frame_base_address,
-  xstormy16_frame_base_address,
-  xstormy16_frame_base_address
-};
-
-static const struct frame_unwind *
-xstormy16_frame_sniffer (struct frame_info *next_frame)
-{
-  return &xstormy16_frame_unwind;
-}
-
 static CORE_ADDR
-xstormy16_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+xstormy16_stack_align (CORE_ADDR addr)
 {
-  return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-}
-
-static CORE_ADDR
-xstormy16_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, E_PC_REGNUM);
+  if (addr & 1)
+    ++addr;
+  return addr;
 }
 
-static struct frame_id
-xstormy16_unwind_dummy_id (struct gdbarch *gdbarch,
-                          struct frame_info *next_frame)
+static void
+xstormy16_save_dummy_frame_tos (CORE_ADDR sp)
 {
-  return frame_id_build (xstormy16_unwind_sp (gdbarch, next_frame),
-                        frame_pc_unwind (next_frame));
+  generic_save_dummy_frame_tos (sp - xstormy16_pc_size);
 }
 
-
 /* Function: xstormy16_gdbarch_init
    Initializer function for the xstormy16 gdbarch vector.
    Called by gdbarch.  Sets up the gdbarch vector(s) for this target. */
@@ -785,6 +1098,7 @@ xstormy16_unwind_dummy_id (struct gdbarch *gdbarch,
 static struct gdbarch *
 xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
+  struct gdbarch_tdep *tdep = NULL;
   struct gdbarch *gdbarch;
 
   /* find a candidate among the list of pre-declared architectures. */
@@ -792,68 +1106,91 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (arches != NULL)
     return (arches->gdbarch);
 
-  gdbarch = gdbarch_alloc (&info, NULL);
+#if 0
+  tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+#endif
+
+  gdbarch = gdbarch_alloc (&info, 0);
+
+  /* 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);
 
   /*
-   * Basic register fields and methods, datatype sizes and stuff.
+   * Basic register fields and methods.
    */
 
   set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
   set_gdbarch_num_pseudo_regs (gdbarch, 0);
   set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
+  set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
   set_gdbarch_register_name (gdbarch, xstormy16_register_name);
-  set_gdbarch_register_type (gdbarch, xstormy16_register_type);
+  set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
+  set_gdbarch_deprecated_register_byte (gdbarch, xstormy16_register_byte);
+  set_gdbarch_deprecated_register_raw_size (gdbarch, xstormy16_register_raw_size);
+  set_gdbarch_deprecated_register_virtual_size (gdbarch, xstormy16_register_raw_size);
+  set_gdbarch_deprecated_register_virtual_type (gdbarch, xstormy16_reg_virtual_type);
 
-  set_gdbarch_char_signed (gdbarch, 0);
-  set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
-  set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
-  set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
-  set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+  /*
+   * Frame Info
+   */
+  set_gdbarch_deprecated_init_extra_frame_info (gdbarch,
+                                    xstormy16_init_extra_frame_info);
+  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
+                                    xstormy16_frame_init_saved_regs);
+  set_gdbarch_deprecated_frame_chain (gdbarch, xstormy16_frame_chain);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, xstormy16_get_saved_register);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
+  set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
+  set_gdbarch_deprecated_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid);
 
-  set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
-  set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
-  set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+  set_gdbarch_in_function_epilogue_p (gdbarch,
+                                     xstormy16_in_function_epilogue_p);
+
+  /* 
+   * Miscelany
+   */
+  /* Stack grows up. */
+  set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
 
+  /*
+   * Call Dummies
+   * 
+   * These values and methods are used when gdb calls a target function.  */
+  set_gdbarch_deprecated_push_return_address (gdbarch, xstormy16_push_return_address);
+  set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
+  set_gdbarch_deprecated_push_arguments (gdbarch, xstormy16_push_arguments);
+  set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame);
+  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_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);
+  set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
   set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+  set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 
   set_gdbarch_address_to_pointer (gdbarch, xstormy16_address_to_pointer);
   set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address);
 
-  set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
-
-  /* Stack grows up. */
-  set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
-
-  /*
-   * Frame Info
-   */
-  set_gdbarch_unwind_sp (gdbarch, xstormy16_unwind_sp);
-  set_gdbarch_unwind_pc (gdbarch, xstormy16_unwind_pc);
-  set_gdbarch_unwind_dummy_id (gdbarch, xstormy16_unwind_dummy_id);
-  set_gdbarch_frame_align (gdbarch, xstormy16_frame_align);
-  frame_base_set_default (gdbarch, &xstormy16_frame_base);
-
-  set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
-  set_gdbarch_in_function_epilogue_p (gdbarch,
-                                     xstormy16_in_function_epilogue_p);
+  set_gdbarch_deprecated_stack_align (gdbarch, xstormy16_stack_align);
 
-  /* These values and methods are used when gdb calls a target function.  */
-  set_gdbarch_push_dummy_call (gdbarch, xstormy16_push_dummy_call);
-  set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
-  set_gdbarch_return_value (gdbarch, xstormy16_return_value);
+  set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos);
 
   set_gdbarch_skip_trampoline_code (gdbarch, xstormy16_skip_trampoline_code);
+
   set_gdbarch_in_solib_call_trampoline (gdbarch,
                                        xstormy16_in_solib_call_trampoline);
 
-  set_gdbarch_print_insn (gdbarch, print_insn_xstormy16);
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
 
-  gdbarch_init_osabi (info, gdbarch);
-
-  frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
-  frame_unwind_append_sniffer (gdbarch, xstormy16_frame_sniffer);
+  set_gdbarch_print_insn (gdbarch, print_insn_xstormy16);
 
   return gdbarch;
 }
index 5f7d3687363e75a571f873f278d04879cbe17d6c..fa03f7cd7fa982a078ae18ab5199842da4b47b03 100644 (file)
@@ -1,129 +1,3 @@
-2004-10-12  Paul Brook  <paul@codesourcery.com>
-
-       * elf/arm.h (EF_ARM_EABI_VER4): Define.
-
-2004-10-08  Daniel Jacobowitz  <dan@debian.org>
-
-       * elf/common.h (PT_SUNW_EH_FRAME): Define.
-       * elf/x86-64.h (SHT_X86_64_UNWIND): Define.
-
-2004-10-07  Bob Wilson  <bob.wilson@acm.org>
-
-       * xtensa-config.h (XSHAL_USE_ABSOLUTE_LITERALS,
-       XCHAL_HAVE_PREDICTED_BRANCHES, XCHAL_INST_FETCH_WIDTH): New.
-       (XCHAL_EXTRA_SA_SIZE, XCHAL_EXTRA_SA_ALIGN): Delete.
-
-       * xtensa-isa-internal.h (ISA_INTERFACE_VERSION): Delete.
-       (config_sturct struct): Delete.
-       (XTENSA_OPERAND_IS_REGISTER, XTENSA_OPERAND_IS_PCRELATIVE,
-       XTENSA_OPERAND_IS_INVISIBLE, XTENSA_OPERAND_IS_UNKNOWN,
-       XTENSA_OPCODE_IS_BRANCH, XTENSA_OPCODE_IS_JUMP,
-       XTENSA_OPCODE_IS_LOOP, XTENSA_OPCODE_IS_CALL,
-       XTENSA_STATE_IS_EXPORTED, XTENSA_INTERFACE_HAS_SIDE_EFFECT): Define.
-       (xtensa_format_encode_fn, xtensa_get_slot_fn, xtensa_set_slot_fn): New.
-       (xtensa_insn_decode_fn): Rename to ...
-       (xtensa_opcode_decode_fn): ... this.
-       (xtensa_immed_decode_fn, xtensa_immed_encode_fn, xtensa_do_reloc_fn,
-       xtensa_undo_reloc_fn): Update.
-       (xtensa_encoding_template_fn): Delete.
-       (xtensa_opcode_encode_fn, xtensa_format_decode_fn,
-       xtensa_length_decode_fn): New.
-       (xtensa_format_internal, xtensa_slot_internal): New types.
-       (xtensa_operand_internal): Delete operand_kind, inout, isPCRelative,
-       get_field, and set_field fields.  Add name, field_id, regfile,
-       num_regs, and flags fields.
-       (xtensa_arg_internal): New type.
-       (xtensa_iclass_internal): Change operands field to array of
-       xtensa_arg_internal.  Add num_stateOperands, stateOperands,
-       num_interfaceOperands, and interfaceOperands fields.
-       (xtensa_opcode_internal): Delete length, template, and iclass fields.
-       Add iclass_id, flags, encode_fns, num_funcUnit_uses, and funcUnit_uses.
-       (opname_lookup_entry): Delete.
-       (xtensa_regfile_internal, xtensa_interface_internal,
-       xtensa_funcUnit_internal, xtensa_state_internal,
-       xtensa_sysreg_internal, xtensa_lookup_entry): New.
-       (xtensa_isa_internal): Replace opcode_table field with opcodes field.
-       Change type of opname_lookup_table.  Delete num_modules,
-       module_opcode_base, module_decode_fn, config, and has_density fields.
-       Add num_formats, formats, format_decode_fn, length_decode_fn,
-       num_slots, slots, num_fields, num_operands, operands, num_iclasses,
-       iclasses, num_regfiles, regfiles, num_states, states,
-       state_lookup_table, num_sysregs, sysregs, sysreg_lookup_table,
-       max_sysreg_num, sysreg_table, num_interfaces, interfaces,
-       interface_lookup_table, num_funcUnits, funcUnits and
-       funcUnit_lookup_table fields.
-       (xtensa_isa_module, xtensa_isa_modules): Delete.
-       (xtensa_isa_name_compare): New prototype.
-       (xtisa_errno, xtisa_error_msg): New.
-       * xtensa-isa.h (XTENSA_ISA_VERSION): Define.
-       (xtensa_isa): Change type.
-       (xtensa_operand): Delete.
-       (xtensa_format, xtensa_regfile, xtensa_state, xtensa_sysreg,
-       xtensa_interface, xtensa_funcUnit, xtensa_isa_status,
-       xtensa_funcUnit_use): New types.
-       (libisa_module_specifier): Delete.
-       (xtensa_isa_errno, xtensa_isa_error_msg): New prototypes.
-       (xtensa_insnbuf_free, xtensa_insnbuf_to_chars,
-       xtensa_insnbuf_from_chars): Update prototypes.
-       (xtensa_load_isa, xtensa_extend_isa, xtensa_default_isa,
-       xtensa_insn_maxlength, xtensa_num_opcodes, xtensa_decode_insn,
-       xtensa_encode_insn, xtensa_insn_length,
-       xtensa_insn_length_from_first_byte, xtensa_num_operands,
-       xtensa_operand_kind, xtensa_encode_result,
-       xtensa_operand_isPCRelative): Delete.
-       (xtensa_isa_init, xtensa_operand_inout, xtensa_operand_get_field,
-       xtensa_operand_set_field, xtensa_operand_encode,
-       xtensa_operand_decode, xtensa_operand_do_reloc,
-       xtensa_operand_undo_reloc): Update prototypes.
-       (xtensa_isa_maxlength, xtensa_isa_length_from_chars,
-       xtensa_isa_num_pipe_stages, xtensa_isa_num_formats,
-       xtensa_isa_num_opcodes, xtensa_isa_num_regfiles, xtensa_isa_num_states,
-       xtensa_isa_num_sysregs, xtensa_isa_num_interfaces,
-       xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup,
-       xtensa_format_decode, xtensa_format_encode, xtensa_format_length,
-       xtensa_format_num_slots, xtensa_format_slot_nop_opcode,
-       xtensa_format_get_slot, xtensa_format_set_slot, xtensa_opcode_decode,
-       xtensa_opcode_encode, xtensa_opcode_is_branch, xtensa_opcode_is_jump,
-       xtensa_opcode_is_loop, xtensa_opcode_is_call,
-       xtensa_opcode_num_operands, xtensa_opcode_num_stateOperands,
-       xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses,
-       xtensa_opcode_funcUnit_use, xtensa_operand_name,
-       xtensa_operand_is_visible, xtensa_operand_is_register,
-       xtensa_operand_regfile, xtensa_operand_num_regs,
-       xtensa_operand_is_known_reg, xtensa_operand_is_PCrelative,
-       xtensa_stateOperand_state, xtensa_stateOperand_inout,
-       xtensa_interfaceOperand_interface, xtensa_regfile_lookup,
-       xtensa_regfile_lookup_shortname, xtensa_regfile_name,
-       xtensa_regfile_shortname, xtensa_regfile_view_parent,
-       xtensa_regfile_num_bits, xtensa_regfile_num_entries,
-       xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits,
-       xtensa_state_is_exported, xtensa_sysreg_lookup,
-       xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number,
-       xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name,
-       xtensa_interface_num_bits, xtensa_interface_inout,
-       xtensa_interface_has_side_effect, xtensa_funcUnit_lookup,
-       xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New prototypes.
-       * elf/xtensa.h (R_XTENSA_DIFF8, R_XTENSA_DIFF16, R_XTENSA_DIFF32,
-       R_XTENSA_SLOT*_OP, R_XTENSA_SLOT*_ALT): New relocations.
-       (XTENSA_PROP_SEC_NAME): Define.
-       (property_table_entry): Add flags field.
-       (XTENSA_PROP_*, GET_XTENSA_PROP_*, SET_XTENSA_PROP_*): Define.
-
-2004-10-07  Jeff Baker  <jbaker@qnx.com>
-
-       * bfdlink.h (bfd_link_info): Add bitfield: warn_shared_textrel.
-
-2004-09-17  Paul Brook  <paul@codesourcery.com>
-
-       * elf/arm.h: Remove R_ARM_STKCHK and R_ARM_THM_STKCHK.
-       Add R_ARM_TARGET2, R_ARM_PREL31, R_ARM_GOT_ABS, R_ARM_GOT_PREL,
-       R_ARM_GOT_BREL12, R_ARM_GOTOFF12 and R_ARM_GOTRELAX.
-
-2004-09-17  Alan Modra  <amodra@bigpond.net.au>
-
-       * bfdlink.h (struct bfd_link_hash_entry): Move und_next into elements
-       of union.
-
 2004-09-13  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
 
        * libiberty.h (basename): Prototype for __MINGW32__.
index db276b02c99b32b61bd3cfaa7c3266d86ce09468..5adad790e6fdb354849cf5debfd02c0ea834a667 100644 (file)
@@ -85,6 +85,26 @@ struct bfd_link_hash_entry
   /* Type of this entry.  */
   enum bfd_link_hash_type type;
 
+  /* Undefined and common symbols are kept in a linked list through
+     this field.  This field is not in the union because that would
+     force us to remove entries from the list when we changed their
+     type, which would force the list to be doubly linked, which would
+     waste more memory.  When an undefined or common symbol is
+     created, it should be added to this list, the head of which is in
+     the link hash table itself.  As symbols are defined, they need
+     not be removed from the list; anything which reads the list must
+     doublecheck the symbol type.
+
+     Weak symbols are not kept on this list.
+
+     Defined and defweak symbols use this field as a reference marker.
+     If the field is not NULL, or this structure is the tail of the
+     undefined symbol list, the symbol has been referenced.  If the
+     symbol is undefined and becomes defined, this field will
+     automatically be non-NULL since the symbol will have been on the
+     undefined symbol list.  */
+  struct bfd_link_hash_entry *und_next;
+
   /* A union of information depending upon the type.  */
   union
     {
@@ -92,46 +112,23 @@ struct bfd_link_hash_entry
       /* bfd_link_hash_undefined, bfd_link_hash_undefweak.  */
       struct
        {
-         /* Undefined and common symbols are kept in a linked list through
-            this field.  This field is present in all of the union element
-            so that we don't need to remove entries from the list when we
-            change their type.  Removing entries would either require the
-            list to be doubly linked, which would waste more memory, or
-            require a traversal.  When an undefined or common symbol is
-            created, it should be added to this list, the head of which is in
-            the link hash table itself.  As symbols are defined, they need
-            not be removed from the list; anything which reads the list must
-            doublecheck the symbol type.
-
-            Weak symbols are not kept on this list.
-
-            Defined and defweak symbols use this field as a reference marker.
-            If the field is not NULL, or this structure is the tail of the
-            undefined symbol list, the symbol has been referenced.  If the
-            symbol is undefined and becomes defined, this field will
-            automatically be non-NULL since the symbol will have been on the
-            undefined symbol list.  */
-         struct bfd_link_hash_entry *next;
          bfd *abfd;            /* BFD symbol was found in.  */
        } undef;
       /* bfd_link_hash_defined, bfd_link_hash_defweak.  */
       struct
        {
-         struct bfd_link_hash_entry *next;
-         asection *section;    /* Symbol section.  */
          bfd_vma value;        /* Symbol value.  */
+         asection *section;    /* Symbol section.  */
        } def;
       /* bfd_link_hash_indirect, bfd_link_hash_warning.  */
       struct
        {
-         struct bfd_link_hash_entry *next;
          struct bfd_link_hash_entry *link;     /* Real symbol.  */
          const char *warning;  /* Warning (bfd_link_hash_warning only).  */
        } i;
       /* bfd_link_hash_common.  */
       struct
        {
-         struct bfd_link_hash_entry *next;
          /* The linker needs to know three things about common
             symbols: the size, the alignment, and the section in
             which the symbol should be placed.  We store the size
@@ -141,12 +138,12 @@ struct bfd_link_hash_entry
             directly because we don't want to increase the size of
             the union; this structure is a major space user in the
             linker.  */
+         bfd_size_type size;   /* Common symbol size.  */
          struct bfd_link_hash_common_entry
            {
              unsigned int alignment_power;     /* Alignment.  */
              asection *section;                /* Symbol section.  */
            } *p;
-         bfd_size_type size;   /* Common symbol size.  */
        } c;
     } u;
 };
@@ -308,9 +305,6 @@ struct bfd_link_info
   /* TRUE if PT_GNU_RELRO segment should be created.  */
   unsigned int relro: 1;
 
-  /* TRUE if we should warn when adding a DT_TEXTREL to a shared object.  */
-  unsigned int warn_shared_textrel: 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
index 7b537b4d4f342dd73b068fd08472b2ede5327928..6b0cf0d4e0d213b567cde41b4b64a468eb6394af 100644 (file)
@@ -1,14 +1,3 @@
-2004-10-06  Eric Christopher  <echristo@redhat.com>
-
-       * dwarf2.h: Sync with gcc dwarf2.h. Fix typo.
-
-2004-10-01  Paul Brook  <paul@codesourcery.com>
-
-       * arm.h (SHT_ARM_EXIDX): Define.
-       (ELF_STRING_ARM_unwind, ELF_STRING_ARM_unwind,
-       ELF_STRING_ARM_unwind_once, ELF_STRING_ARM_unwind_info_once):
-       Define.
-
 2004-08-25  Dmitry Diky  <diwil@spec.ru>
 
        * msp430.h: Add new relocs.
index 9055f622de115dcb8e0440fb22a0fc36248f50d1..34bde17e921bef5206926195a46fc02b3f2237c3 100644 (file)
@@ -51,7 +51,6 @@
 #define EF_ARM_EABI_VER1     0x01000000
 #define EF_ARM_EABI_VER2     0x02000000
 #define EF_ARM_EABI_VER3     0x03000000
-#define EF_ARM_EABI_VER4     0x04000000
 
 /* Local aliases for some flags to match names used by COFF port.  */
 #define F_INTERWORK       EF_ARM_INTERWORK
@@ -65,9 +64,6 @@
 #define STT_ARM_TFUNC      STT_LOPROC   /* A Thumb function.  */
 #define STT_ARM_16BIT      STT_HIPROC   /* A Thumb label.  */
 
-/* Additional section types.  */
-#define SHT_ARM_EXIDX     0x70000001   /* Section holds ARM unwind info.  */
-
 /* ARM-specific values for sh_flags.  */
 #define SHF_ENTRYSECT      0x10000000   /* Section contains an entry point.  */
 #define SHF_COMDEF         0x80000000   /* Section may be multiply defined in the input to a link step.  */
@@ -134,15 +130,10 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
   RELOC_NUMBER (R_ARM_TARGET1,         38)
   RELOC_NUMBER (R_ARM_ROSEGREL32,      39)
   RELOC_NUMBER (R_ARM_V4BX,            40)
-  RELOC_NUMBER (R_ARM_TARGET2,        41)
-  RELOC_NUMBER (R_ARM_PREL31,         42)
+  RELOC_NUMBER (R_ARM_STKCHK,          41)
+  RELOC_NUMBER (R_ARM_THM_STKCHK,      42)
   FAKE_RELOC   (FIRST_INVALID_RELOC2,  43)
-  FAKE_RELOC   (LAST_INVALID_RELOC2,   94)
-  RELOC_NUMBER (R_ARM_GOT_ABS,        95)
-  RELOC_NUMBER (R_ARM_GOT_PREL,               96)
-  RELOC_NUMBER (R_ARM_GOT_BREL12,      97)
-  RELOC_NUMBER (R_ARM_GOTOFF12,               98)
-  RELOC_NUMBER (R_ARM_GOTRELAX,               99)
+  FAKE_RELOC   (LAST_INVALID_RELOC2,   99)
   RELOC_NUMBER (R_ARM_GNU_VTENTRY,    100)
   RELOC_NUMBER (R_ARM_GNU_VTINHERIT,  101)
   RELOC_NUMBER (R_ARM_THM_PC11,       102)   /* Cygnus extension to abi: Thumb unconditional branch.  */
@@ -161,11 +152,5 @@ END_RELOC_NUMBERS (R_ARM_max)
 
 /* The name of the note section used to identify arm variants.  */
 #define ARM_NOTE_SECTION ".note.gnu.arm.ident"
-
-/* Special section names.  */
-#define ELF_STRING_ARM_unwind           ".ARM.exidx"
-#define ELF_STRING_ARM_unwind_info      ".ARM.extab"
-#define ELF_STRING_ARM_unwind_once      ".gnu.linkonce.armexidx."
-#define ELF_STRING_ARM_unwind_info_once ".gnu.linkonce.armextab."
-
+     
 #endif /* _ELF_ARM_H */
index db92ff6a8f8a84487929d03856788e9a92540327..5573fca7678deb89811fc2b28845815d8a8fe92b 100644 (file)
 #define PT_HIPROC      0x7FFFFFFF      /* Processor-specific */
 
 #define PT_GNU_EH_FRAME        (PT_LOOS + 0x474e550) /* Frame unwind information */
-#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
 #define PT_GNU_STACK   (PT_LOOS + 0x474e551) /* Stack flags */
 #define PT_GNU_RELRO   (PT_LOOS + 0x474e552) /* Read-only after relocation */
 
index 94589076f11320990273130412770e6985b97085..bede7e297a3fe7fef698eeea6f5ba647533e8a7a 100644 (file)
@@ -4,7 +4,7 @@
    2003 Free Software Foundation, Inc.
 
    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
-   Office (AJPO), Florida State University and Silicon Graphics Inc.
+   Office (AJPO), Florida State Unviversity and Silicon Graphics Inc.
    provided support for this effort -- June 21, 1995.
 
    Derived from the DWARF 1 implementation written by Ron Guilmette
@@ -605,8 +605,7 @@ enum dwarf_calling_convention
   {
     DW_CC_normal = 0x1,
     DW_CC_program = 0x2,
-    DW_CC_nocall = 0x3,
-    DW_CC_GNU_renesas_sh = 0x40
+    DW_CC_nocall = 0x3
   };
 
 #define DW_CC_lo_user 0x40
index 2252bd0d10a98b545e79e6270074d5c2003ebe34..7e9100dba4a022599dfd1bf351002949e8f6febd 100644 (file)
@@ -53,8 +53,4 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_type)
      RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251)         /* GNU C++ hack  */
 END_RELOC_NUMBERS (R_X86_64_max)
 
-/* Processor specific section types.  */
-
-#define SHT_X86_64_UNWIND      0x70000001      /* unwind information */
-
 #endif
index 14f99132299b5ff3c854464f974a4045a20a8ed1..6c584c7151535b4deff6f2a48169343ab7233b8d 100644 (file)
@@ -1,5 +1,5 @@
 /* Xtensa ELF support for BFD.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
    Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -42,39 +42,6 @@ START_RELOC_NUMBERS (elf_xtensa_reloc_type)
      RELOC_NUMBER (R_XTENSA_ASM_SIMPLIFY, 12)
      RELOC_NUMBER (R_XTENSA_GNU_VTINHERIT, 15)
      RELOC_NUMBER (R_XTENSA_GNU_VTENTRY, 16)
-     RELOC_NUMBER (R_XTENSA_DIFF8, 17)
-     RELOC_NUMBER (R_XTENSA_DIFF16, 18)
-     RELOC_NUMBER (R_XTENSA_DIFF32, 19)
-     RELOC_NUMBER (R_XTENSA_SLOT0_OP, 20)
-     RELOC_NUMBER (R_XTENSA_SLOT1_OP, 21)
-     RELOC_NUMBER (R_XTENSA_SLOT2_OP, 22)
-     RELOC_NUMBER (R_XTENSA_SLOT3_OP, 23)
-     RELOC_NUMBER (R_XTENSA_SLOT4_OP, 24)
-     RELOC_NUMBER (R_XTENSA_SLOT5_OP, 25)
-     RELOC_NUMBER (R_XTENSA_SLOT6_OP, 26)
-     RELOC_NUMBER (R_XTENSA_SLOT7_OP, 27)
-     RELOC_NUMBER (R_XTENSA_SLOT8_OP, 28)
-     RELOC_NUMBER (R_XTENSA_SLOT9_OP, 29)
-     RELOC_NUMBER (R_XTENSA_SLOT10_OP, 30)
-     RELOC_NUMBER (R_XTENSA_SLOT11_OP, 31)
-     RELOC_NUMBER (R_XTENSA_SLOT12_OP, 32)
-     RELOC_NUMBER (R_XTENSA_SLOT13_OP, 33)
-     RELOC_NUMBER (R_XTENSA_SLOT14_OP, 34)
-     RELOC_NUMBER (R_XTENSA_SLOT0_ALT, 35)
-     RELOC_NUMBER (R_XTENSA_SLOT1_ALT, 36)
-     RELOC_NUMBER (R_XTENSA_SLOT2_ALT, 37)
-     RELOC_NUMBER (R_XTENSA_SLOT3_ALT, 38)
-     RELOC_NUMBER (R_XTENSA_SLOT4_ALT, 39)
-     RELOC_NUMBER (R_XTENSA_SLOT5_ALT, 40)
-     RELOC_NUMBER (R_XTENSA_SLOT6_ALT, 41)
-     RELOC_NUMBER (R_XTENSA_SLOT7_ALT, 42)
-     RELOC_NUMBER (R_XTENSA_SLOT8_ALT, 43)
-     RELOC_NUMBER (R_XTENSA_SLOT9_ALT, 44)
-     RELOC_NUMBER (R_XTENSA_SLOT10_ALT, 45)
-     RELOC_NUMBER (R_XTENSA_SLOT11_ALT, 46)
-     RELOC_NUMBER (R_XTENSA_SLOT12_ALT, 47)
-     RELOC_NUMBER (R_XTENSA_SLOT13_ALT, 48)
-     RELOC_NUMBER (R_XTENSA_SLOT14_ALT, 49)
 END_RELOC_NUMBERS (R_XTENSA_max)
 
 /* Processor-specific flags for the ELF header e_flags field.  */
@@ -111,88 +78,11 @@ END_RELOC_NUMBERS (R_XTENSA_max)
 
 #define XTENSA_INSN_SEC_NAME ".xt.insn"
 #define XTENSA_LIT_SEC_NAME  ".xt.lit"
-#define XTENSA_PROP_SEC_NAME ".xt.prop"
 
 typedef struct property_table_entry_t
 {
   bfd_vma address;
   bfd_vma size;
-  flagword flags;
 } property_table_entry;
 
-/* Flags in the property tables to specify whether blocks of memory are
-   literals, instructions, data, or unreachable.  For instructions,
-   blocks that begin loop targets and branch targets are designated.
-   Blocks that do not allow density instructions, instruction reordering
-   or transformation are also specified.  Finally, for branch targets,
-   branch target alignment priority is included.  Alignment of the next
-   block is specified in the current block and the size of the current
-   block does not include any fill required to align to the next
-   block.  */
-   
-#define XTENSA_PROP_LITERAL            0x00000001
-#define XTENSA_PROP_INSN               0x00000002
-#define XTENSA_PROP_DATA               0x00000004
-#define XTENSA_PROP_UNREACHABLE                0x00000008
-/* Instruction-only properties at beginning of code. */
-#define XTENSA_PROP_INSN_LOOP_TARGET   0x00000010
-#define XTENSA_PROP_INSN_BRANCH_TARGET 0x00000020
-/* Instruction-only properties about code. */
-#define XTENSA_PROP_INSN_NO_DENSITY    0x00000040
-#define XTENSA_PROP_INSN_NO_REORDER    0x00000080
-#define XTENSA_PROP_INSN_NO_TRANSFORM  0x00000100
-
-/*  Branch target alignment information.  This transmits information
-    to the linker optimization about the priority of aligning a
-    particular block for branch target alignment: None, low priority,
-    high priority, or required.  These only need to be checked in
-    instruction blocks marked as XTENSA_PROP_INSN_BRANCH_TARGET.
-    Common usage is:
-
-    switch (GET_XTENSA_PROP_BT_ALIGN(flags))
-    case XTENSA_PROP_BT_ALIGN_NONE:
-    case XTENSA_PROP_BT_ALIGN_LOW:
-    case XTENSA_PROP_BT_ALIGN_HIGH:
-    case XTENSA_PROP_BT_ALIGN_REQUIRE:
-*/
-#define XTENSA_PROP_BT_ALIGN_MASK       0x00000600
-
-/* No branch target alignment.  */
-#define XTENSA_PROP_BT_ALIGN_NONE       0x0
-/* Low priority branch target alignment.  */
-#define XTENSA_PROP_BT_ALIGN_LOW        0x1
-/* High priority branch target alignment. */
-#define XTENSA_PROP_BT_ALIGN_HIGH       0x2
-/* Required branch target alignment.  */
-#define XTENSA_PROP_BT_ALIGN_REQUIRE    0x3
-
-#define GET_XTENSA_PROP_BT_ALIGN(flag) \
-  (((unsigned)((flag) & (XTENSA_PROP_BT_ALIGN_MASK))) >> 9)
-#define SET_XTENSA_PROP_BT_ALIGN(flag, align) \
-  (((flag) & (~XTENSA_PROP_BT_ALIGN_MASK)) | \
-    (((align) << 9) & XTENSA_PROP_BT_ALIGN_MASK))
-
-/* Alignment is specified in the block BEFORE the one that needs
-   alignment.  Up to 5 bits.  Use GET_XTENSA_PROP_ALIGNMENT(flags) to
-   get the required alignment specified as a power of 2.  Use
-   SET_XTENSA_PROP_ALIGNMENT(flags, pow2) to set the required
-   alignment.  Be careful of side effects since the SET will evaluate
-   flags twice.  Also, note that the SIZE of a block in the property
-   table does not include the alignment size, so the alignment fill
-   must be calculated to determine if two blocks are contiguous.
-   TEXT_ALIGN is not currently implemented but is a placeholder for a
-   possible future implementation.  */
-
-#define XTENSA_PROP_ALIGN              0x00000800
-
-#define XTENSA_PROP_ALIGNMENT_MASK      0x0001f000
-
-#define GET_XTENSA_PROP_ALIGNMENT(flag) \
-  (((unsigned)((flag) & (XTENSA_PROP_ALIGNMENT_MASK))) >> 12)
-#define SET_XTENSA_PROP_ALIGNMENT(flag, align) \
-  (((flag) & (~XTENSA_PROP_ALIGNMENT_MASK)) | \
-    (((align) << 12) & XTENSA_PROP_ALIGNMENT_MASK))
-
-#define XTENSA_PROP_INSN_ABSLIT        0x00020000
-
 #endif /* _ELF_XTENSA_H */
index 4eb8348531e6803650b09c6dc34835f08f565970..462165c45cfdba8b272dde75aa05dd88059210df 100644 (file)
@@ -1,13 +1,3 @@
-2004-10-07  Tomer Levi  <Tomer.Levi@nsc.com>
-
-       * crx.h: Add COPS_REG_INS - Coprocessor Special register
-       instruction type.
-
-2004-09-30  Paul Brook  <paul@codesourcery.com>
-
-       * arm.h (ARM_EXT_V6K, ARM_EXT_V6Z): Define.
-       (ARM_ARCH_V6K, ARM_ARCH_V6Z, ARM_ARCH_V6ZK): Define.
-
 2004-09-11  Theodore A. Roth  <troth@openavr.org>
 
        * avr.h: Add support for
index dd90e2ac6694a816e50cd637dd4370f86c4e50d7..6ccccbd4ecaa4ff83477d9c4d93a87cd351d6256 100644 (file)
@@ -32,8 +32,6 @@
 #define ARM_EXT_V5E     0x00000400     /* DSP Double transfers.   */
 #define ARM_EXT_V5J     0x00000800     /* Jazelle extension.      */
 #define ARM_EXT_V6       0x00001000     /* ARM V6.                 */
-#define ARM_EXT_V6K      0x00002000     /* ARM V6K.                */
-#define ARM_EXT_V6Z      0x00004000     /* ARM V6Z.                */
 
 /* Co-processor space extensions.  */
 #define ARM_CEXT_XSCALE   0x00800000   /* Allow MIA etc.          */
@@ -62,9 +60,6 @@
 #define ARM_ARCH_V5TE  (ARM_ARCH_V5TExP | ARM_EXT_V5E)
 #define ARM_ARCH_V5TEJ (ARM_ARCH_V5TE  | ARM_EXT_V5J)
 #define ARM_ARCH_V6     (ARM_ARCH_V5TEJ | ARM_EXT_V6)
-#define ARM_ARCH_V6K    (ARM_ARCH_V6    | ARM_EXT_V6K)
-#define ARM_ARCH_V6Z    (ARM_ARCH_V6    | ARM_EXT_V6Z)
-#define ARM_ARCH_V6ZK   (ARM_ARCH_V6    | ARM_EXT_V6K | ARM_EXT_V6Z)
 
 /* Processors with specific extensions in the co-processor space.  */
 #define ARM_ARCH_XSCALE        (ARM_ARCH_V5TE  | ARM_CEXT_XSCALE)
index 58db2f8b3e4b5dbaaeed5362387a02f6f32a19e8..1e0d5733ab321061fa3ef251c3e88ad4e13af01c 100644 (file)
@@ -168,10 +168,9 @@ operand_type;
 #define DIV_INS                 14
 #define COP_BRANCH_INS   15
 #define COP_REG_INS      16
-#define COPS_REG_INS     17
-#define DCR_BRANCH_INS   18
-#define MMC_INS          19
-#define MMU_INS          20
+#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)
index 4ef5d64270f81e65b8b6e213398b0a0216aa6611..4191c3685758f2b2fc37eb6591950d85895163ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Xtensa configuration settings.
-   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.
    Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
 
    This program is free software; you can redistribute it and/or modify
@@ -42,9 +42,6 @@
 #undef XCHAL_HAVE_L32R
 #define XCHAL_HAVE_L32R                        1
 
-#undef XSHAL_USE_ABSOLUTE_LITERALS
-#define XSHAL_USE_ABSOLUTE_LITERALS    0
-
 #undef XCHAL_HAVE_MAC16
 #define XCHAL_HAVE_MAC16               0
 
@@ -90,9 +87,6 @@
 #undef XCHAL_HAVE_WINDOWED
 #define XCHAL_HAVE_WINDOWED            1
 
-#undef XCHAL_HAVE_PREDICTED_BRANCHES
-#define XCHAL_HAVE_PREDICTED_BRANCHES  0
-
 
 #undef XCHAL_ICACHE_SIZE
 #define XCHAL_ICACHE_SIZE              8192
 #define XCHAL_DEBUGLEVEL               4
 
 
-#undef XCHAL_INST_FETCH_WIDTH
-#define XCHAL_INST_FETCH_WIDTH         4
+#undef XCHAL_EXTRA_SA_SIZE
+#define XCHAL_EXTRA_SA_SIZE            0
+
+#undef XCHAL_EXTRA_SA_ALIGN
+#define XCHAL_EXTRA_SA_ALIGN           1
 
 #endif /* !XTENSA_CONFIG_H */
index 50ac4781c3708003d2078b2ad0bcd773b8fc2122..7f221eae48ed87028005077b06182dee0d7efc17 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal definitions for configurable Xtensa ISA support.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#ifndef XTENSA_ISA_INTERNAL_H
-#define XTENSA_ISA_INTERNAL_H
+/* Use the statically-linked version for the GNU tools.  */
+#define STATIC_LIBISA 1
 
-/* Flags.  */
+#define ISA_INTERFACE_VERSION 3
 
-#define XTENSA_OPERAND_IS_REGISTER     0x00000001
-#define XTENSA_OPERAND_IS_PCRELATIVE   0x00000002
-#define XTENSA_OPERAND_IS_INVISIBLE    0x00000004
-#define XTENSA_OPERAND_IS_UNKNOWN      0x00000008
-
-#define XTENSA_OPCODE_IS_BRANCH                0x00000001
-#define XTENSA_OPCODE_IS_JUMP          0x00000002
-#define XTENSA_OPCODE_IS_LOOP          0x00000004
-#define XTENSA_OPCODE_IS_CALL          0x00000008
-
-#define XTENSA_STATE_IS_EXPORTED       0x00000001
+struct config_struct
+{
+    char *param_name;
+    char *param_value;
+};
 
-#define XTENSA_INTERFACE_HAS_SIDE_EFFECT 0x00000001
+/* Encode/decode function types for immediate operands.  */
+typedef uint32 (*xtensa_immed_decode_fn) (uint32);
+typedef xtensa_encode_result (*xtensa_immed_encode_fn) (uint32 *);
 
-/* Function pointer typedefs */
-typedef void (*xtensa_format_encode_fn) (xtensa_insnbuf);
-typedef void (*xtensa_get_slot_fn) (const xtensa_insnbuf, xtensa_insnbuf);
-typedef void (*xtensa_set_slot_fn) (xtensa_insnbuf, const xtensa_insnbuf);
-typedef int (*xtensa_opcode_decode_fn) (const xtensa_insnbuf);
+/* Field accessor function types.  */
 typedef uint32 (*xtensa_get_field_fn) (const xtensa_insnbuf);
 typedef void (*xtensa_set_field_fn) (xtensa_insnbuf, uint32);
-typedef int (*xtensa_immed_decode_fn) (uint32 *);
-typedef int (*xtensa_immed_encode_fn) (uint32 *);
-typedef int (*xtensa_do_reloc_fn) (uint32 *, uint32);
-typedef int (*xtensa_undo_reloc_fn) (uint32 *, uint32);
-typedef void (*xtensa_opcode_encode_fn) (xtensa_insnbuf);
-typedef int (*xtensa_format_decode_fn) (const xtensa_insnbuf);
-typedef int (*xtensa_length_decode_fn) (const char *);
-
-typedef struct xtensa_format_internal_struct
-{
-  const char *name;                    /* Instruction format name.  */
-  int length;                          /* Instruction length in bytes.  */
-  xtensa_format_encode_fn encode_fn;
-  int num_slots;
-  int *slot_id;                                /* Array[num_slots] of slot IDs.  */
-} xtensa_format_internal;
-
-typedef struct xtensa_slot_internal_struct
-{
-  const char *name;                    /* Not necessarily unique.  */
-  const char *format;
-  int position;
-  xtensa_get_slot_fn get_fn;
-  xtensa_set_slot_fn set_fn;
-  xtensa_get_field_fn *get_field_fns;  /* Array[field_id].  */
-  xtensa_set_field_fn *set_field_fns;  /* Array[field_id].  */
-  xtensa_opcode_decode_fn opcode_decode_fn;
-  const char *nop_name;
-} xtensa_slot_internal;
+
+/* PC-relative relocation function types.  */
+typedef uint32 (*xtensa_do_reloc_fn) (uint32, uint32);
+typedef uint32 (*xtensa_undo_reloc_fn) (uint32, uint32);
+
+/* Instruction decode function type.  */
+typedef int (*xtensa_insn_decode_fn) (const xtensa_insnbuf);
+
+/* Instruction encoding template function type (each of these functions
+   returns a constant template; they exist only to make it easier for the
+   TIE compiler to generate endian-independent DLLs).  */
+typedef xtensa_insnbuf (*xtensa_encoding_template_fn) (void);
+
 
 typedef struct xtensa_operand_internal_struct
 {
-  const char *name;
-  int field_id;
-  xtensa_regfile regfile;              /* Register file.  */
-  int num_regs;                                /* Usually 1; 2 for reg pairs, etc.  */
-  uint32 flags;                                /* See XTENSA_OPERAND_* flags.  */
+  char *operand_kind;                  /* e.g., "a", "f", "i", "l"....  */
+  char inout;                          /* '<', '>', or '='.  */
+  char isPCRelative;                   /* Is this a PC-relative offset?  */
+  xtensa_get_field_fn get_field;       /* Get encoded value of the field.  */
+  xtensa_set_field_fn set_field;       /* Set field with an encoded value.  */
   xtensa_immed_encode_fn encode;       /* Encode the operand value.  */
   xtensa_immed_decode_fn decode;       /* Decode the value from the field.  */
-  xtensa_do_reloc_fn do_reloc;         /* Perform a PC-relative reloc.  */
+  xtensa_do_reloc_fn do_reloc;         /* Perform a PC-relative relocation.  */
   xtensa_undo_reloc_fn undo_reloc;     /* Undo a PC-relative relocation.  */
 } xtensa_operand_internal;
 
-typedef struct xtensa_arg_internal_struct
-{
-  union {
-    int operand_id;                    /* For normal operands.  */
-    xtensa_state state;                        /* For stateOperands.  */
-  } u;
-  char inout;                          /* Direction: 'i', 'o', or 'm'.  */
-} xtensa_arg_internal;
 
 typedef struct xtensa_iclass_internal_struct
 {
   int num_operands;                    /* Size of "operands" array.  */
-  xtensa_arg_internal *operands;       /* Array[num_operands].  */
-
-  int num_stateOperands;               /* Size of "stateOperands" array.  */
-  xtensa_arg_internal *stateOperands;  /* Array[num_stateOperands].  */
-
-  int num_interfaceOperands;           /* Size of "interfaceOperands".  */
-  xtensa_interface *interfaceOperands; /* Array[num_interfaceOperands].  */
+  xtensa_operand_internal **operands;  /* Array of operand structures.  */
 } xtensa_iclass_internal;
 
+
 typedef struct xtensa_opcode_internal_struct
 {
   const char *name;                    /* Opcode mnemonic.  */
-  int iclass_id;                       /* Iclass for this opcode.  */
-  uint32 flags;                                /* See XTENSA_OPCODE_* flags.  */
-  xtensa_opcode_encode_fn *encode_fns; /* Array[slot_id].  */
-  int num_funcUnit_uses;               /* Number of funcUnit_use entries.  */
-  xtensa_funcUnit_use *funcUnit_uses;  /* Array[num_funcUnit_uses].  */
+  int length;                          /* Length in bytes of the insn.  */
+  xtensa_encoding_template_fn template;        /* Fn returning encoding template.  */
+  xtensa_iclass_internal *iclass;      /* Iclass for this opcode.  */
 } xtensa_opcode_internal;
 
-typedef struct xtensa_regfile_internal_struct
-{
-  const char *name;                    /* Full name of the regfile.  */
-  const char *shortname;               /* Abbreviated name.  */
-  xtensa_regfile parent;               /* View parent (or identity).  */
-  int num_bits;                                /* Width of the registers.  */
-  int num_entries;                     /* Number of registers.  */
-} xtensa_regfile_internal;
-
-typedef struct xtensa_interface_internal_struct
-{
-  const char *name;                    /* Interface name.  */
-  int num_bits;                                /* Width of the interface.  */
-  uint32 flags;                                /* See XTENSA_INTERFACE_* flags.  */
-  char inout;                          /* "i" or "o".  */
-} xtensa_interface_internal;
-
-typedef struct xtensa_funcUnit_internal_struct
-{
-  const char *name;                    /* Functional unit name.  */
-  int num_copies;                      /* Number of instances.  */
-} xtensa_funcUnit_internal;
 
-typedef struct xtensa_state_internal_struct
+typedef struct opname_lookup_entry_struct
 {
-  const char *name;                    /* State name.  */
-  int num_bits;                                /* Number of state bits.  */
-  uint32 flags;                                /* See XTENSA_STATE_* flags.  */
-} xtensa_state_internal;
+  const char *key;                     /* Opcode mnemonic.  */
+  xtensa_opcode opcode;                        /* Internal opcode number.  */
+} opname_lookup_entry;
 
-typedef struct xtensa_sysreg_internal_struct
-{
-  const char *name;                    /* Register name.  */
-  int number;                          /* Register number.  */
-  int is_user;                         /* Non-zero if a "user register".  */
-} xtensa_sysreg_internal;
-
-typedef struct xtensa_lookup_entry_struct
-{
-  const char *key;
-  union
-  {
-    xtensa_opcode opcode;              /* Internal opcode number.  */
-    xtensa_sysreg sysreg;              /* Internal sysreg number.  */
-    xtensa_state state;                        /* Internal state number.  */
-    xtensa_interface intf;             /* Internal interface number.  */
-    xtensa_funcUnit fun;               /* Internal funcUnit number.  */
-  } u;
-} xtensa_lookup_entry;
 
 typedef struct xtensa_isa_internal_struct
 {
   int is_big_endian;                   /* Endianness.  */
   int insn_size;                       /* Maximum length in bytes.  */
   int insnbuf_size;                    /* Number of insnbuf_words.  */
-
-  int num_formats;
-  xtensa_format_internal *formats;
-  xtensa_format_decode_fn format_decode_fn;
-  xtensa_length_decode_fn length_decode_fn;
-
-  int num_slots;
-  xtensa_slot_internal *slots;
-
-  int num_fields;
-
-  int num_operands;
-  xtensa_operand_internal *operands;
-
-  int num_iclasses;
-  xtensa_iclass_internal *iclasses;
-
-  int num_opcodes;
-  xtensa_opcode_internal *opcodes;
-  xtensa_lookup_entry *opname_lookup_table;
-
-  int num_regfiles;
-  xtensa_regfile_internal *regfiles;
-
-  int num_states;
-  xtensa_state_internal *states;
-  xtensa_lookup_entry *state_lookup_table;
-
-  int num_sysregs;
-  xtensa_sysreg_internal *sysregs;
-  xtensa_lookup_entry *sysreg_lookup_table;
-
-  /* The current Xtensa ISA only supports 256 of each kind of sysreg so
-     we can get away with implementing lookups with tables indexed by
-     the register numbers.  If we ever allow larger sysreg numbers, this
-     may have to be reimplemented.  The first entry in the following
-     arrays corresponds to "special" registers and the second to "user"
-     registers.  */
-  int max_sysreg_num[2];
-  xtensa_sysreg *sysreg_table[2];
-
-  int num_interfaces;
-  xtensa_interface_internal *interfaces;
-  xtensa_lookup_entry *interface_lookup_table;
-
-  int num_funcUnits;
-  xtensa_funcUnit_internal *funcUnits;
-  xtensa_lookup_entry *funcUnit_lookup_table;
-
+  int num_opcodes;                     /* Total number for all modules.  */
+  xtensa_opcode_internal **opcode_table;/* Indexed by internal opcode #.  */
+  int num_modules;                     /* Number of modules (DLLs) loaded.  */
+  int *module_opcode_base;             /* Starting opcode # for each module.  */
+  xtensa_insn_decode_fn *module_decode_fn; /* Decode fn for each module.  */
+  opname_lookup_entry *opname_lookup_table; /* Lookup table for each module.  */
+  struct config_struct *config;                /* Table of configuration parameters.  */
+  int has_density;                     /* Is density option available?  */
 } xtensa_isa_internal;
 
-extern int xtensa_isa_name_compare (const void *, const void *);
 
-extern xtensa_isa_status xtisa_errno;
-extern char xtisa_error_msg[];
+typedef struct xtensa_isa_module_struct
+{
+  int (*get_num_opcodes_fn) (void);
+  xtensa_opcode_internal **(*get_opcodes_fn) (void);
+  int (*decode_insn_fn) (const xtensa_insnbuf);
+  struct config_struct *(*get_config_table_fn) (void);
+} xtensa_isa_module;
+
+extern xtensa_isa_module xtensa_isa_modules[];
 
-#endif /* !XTENSA_ISA_INTERNAL_H */
index 2dc11b924c03adb7accaf2545bb93d6309e97148..54f750c9a1af6880f096706be19cc214b2b5055a 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface definition for configurable Xtensa ISA support.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
 #ifndef XTENSA_LIBISA_H
 #define XTENSA_LIBISA_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Use the statically-linked version for the GNU tools.  */
 #define STATIC_LIBISA 1
 
-/* Version number: This is intended to help support code that works with
-   versions of this library from multiple Xtensa releases.  */
-
-#define XTENSA_ISA_VERSION 7000
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifndef uint32
 #define uint32 unsigned int
 #endif
 
-/* This file defines the interface to the Xtensa ISA library.  This
-   library contains most of the ISA-specific information for a
-   particular Xtensa processor.  For example, the set of valid
-   instructions, their opcode encodings and operand fields are all
-   included here.
+/* This file defines the interface to the Xtensa ISA library.  This library
+   contains most of the ISA-specific information for a particular Xtensa
+   processor.  For example, the set of valid instructions, their opcode
+   encodings and operand fields are all included here.  To support Xtensa's
+   configurability and user-defined instruction extensions (i.e., TIE), the
+   library is initialized by loading one or more dynamic libraries; only a
+   small set of interface code is present in the statically-linked portion
+   of the library.
 
-   This interface basically defines a number of abstract data types.
+   This interface basically defines four abstract data types.
 
    . an instruction buffer - for holding the raw instruction bits
    . ISA info - information about the ISA as a whole
-   . instruction formats - instruction size and slot structure
-   . opcodes - information about individual instructions
-   . operands - information about register and immediate instruction operands
-   . stateOperands - information about processor state instruction operands
-   . interfaceOperands - information about interface instruction operands
-   . register files - register file information
-   . processor states - internal processor state information
-   . system registers - "special registers" and "user registers"
-   . interfaces - TIE interfaces that are external to the processor
-   . functional units - TIE shared functions
-
-   The interface defines a set of functions to access each data type.
-   With the exception of the instruction buffer, the internal
-   representations of the data structures are hidden.  All accesses must
-   be made through the functions defined here.  */
-
-typedef struct xtensa_isa_opaque { int unused; } *xtensa_isa;
-
-
-/* Opcodes, formats, regfiles, states, sysregs, ctypes, and protos are
-   represented here using sequential integers beginning with 0.  The
-   specific values are only fixed for a particular instantiation of an
-   xtensa_isa structure, so these values should only be used
-   internally.  */
-
-typedef int xtensa_opcode;
-typedef int xtensa_format;
-typedef int xtensa_regfile;
-typedef int xtensa_state;
-typedef int xtensa_sysreg;
-typedef int xtensa_interface;
-typedef int xtensa_funcUnit;
-
-
-/* Define a unique value for undefined items.  */
+   . opcode info - information about individual instructions
+   . operand info - information about specific instruction operands
 
-#define XTENSA_UNDEFINED -1
+   It would be nice to implement these as classes in C++, but the library is
+   implemented in C to match the expectations of the GNU tools.
+   Instead, the interface defines a set of functions to access each data
+   type.  With the exception of the instruction buffer, the internal
+   representations of the data structures are hidden.  All accesses must be
+   made through the functions defined here.  */
 
+typedef void* xtensa_isa;
+typedef void* xtensa_operand;
 
-/* Overview of using this interface to decode/encode instructions:
-
-   Each Xtensa instruction is associated with a particular instruction
-   format, where the format defines a fixed number of slots for
-   operations.  The formats for the core Xtensa ISA have only one slot,
-   but FLIX instructions may have multiple slots.  Within each slot,
-   there is a single opcode and some number of associated operands.
-
-   The encoding and decoding functions operate on instruction buffers,
-   not on the raw bytes of the instructions.  The same instruction
-   buffer data structure is used for both entire instructions and
-   individual slots in those instructions -- the contents of a slot need
-   to be extracted from or inserted into the buffer for the instruction
-   as a whole.
-
-   Decoding an instruction involves first finding the format, which
-   identifies the number of slots, and then decoding each slot
-   separately.  A slot is decoded by finding the opcode and then using
-   the opcode to determine how many operands there are.  For example:
-
-   xtensa_insnbuf_from_chars
-   xtensa_format_decode
-   for each slot {
-     xtensa_format_get_slot
-     xtensa_opcode_decode
-     for each operand {
-       xtensa_operand_get_field
-       xtensa_operand_decode
-     }
-   }
-
-   Encoding an instruction is roughly the same procedure in reverse:
-
-   xtensa_format_encode
-   for each slot {
-     xtensa_opcode_encode
-     for each operand {
-       xtensa_operand_encode
-       xtensa_operand_set_field
-     }
-     xtensa_format_set_slot
-   }
-   xtensa_insnbuf_to_chars
-*/
-
-\f
-/* Error handling.  */
-
-/* Error codes.  The code for the most recent error condition can be
-   retrieved with the "errno" function.  For any result other than
-   xtensa_isa_ok, an error message containing additional information
-   about the problem can be retrieved using the "error_msg" function.
-   The error messages are stored in an internal buffer, which should not
-   should be freed and may be overwritten by subsequent operations.  */
-
-typedef enum xtensa_isa_status_enum
-{
-  xtensa_isa_ok = 0,
-  xtensa_isa_bad_format,
-  xtensa_isa_bad_slot,
-  xtensa_isa_bad_opcode,
-  xtensa_isa_bad_operand,
-  xtensa_isa_bad_field,
-  xtensa_isa_bad_iclass,
-  xtensa_isa_bad_regfile,
-  xtensa_isa_bad_sysreg,
-  xtensa_isa_bad_state,
-  xtensa_isa_bad_interface,
-  xtensa_isa_bad_funcUnit,
-  xtensa_isa_wrong_slot,
-  xtensa_isa_no_field,
-  xtensa_isa_out_of_memory,
-  xtensa_isa_buffer_overflow,
-  xtensa_isa_internal_error,
-  xtensa_isa_bad_value
-} xtensa_isa_status;
-
-extern xtensa_isa_status
-xtensa_isa_errno (xtensa_isa isa);
-
-extern char *
-xtensa_isa_error_msg (xtensa_isa isa);
-
-\f
-/* Instruction buffers.  */
 
-typedef uint32 xtensa_insnbuf_word;
-typedef xtensa_insnbuf_word *xtensa_insnbuf;
+/* Opcodes are represented here using sequential integers beginning with 0.
+   The specific value used for a particular opcode is only fixed for a
+   particular instantiation of an xtensa_isa structure, so these values
+   should only be used internally.  */
+typedef int xtensa_opcode;
 
+/* Define a unique value for undefined opcodes ("static const int" doesn't
+   seem to work for this because EGCS 1.0.3 on i686-Linux without -O won't
+   allow it to be used as an initializer).  */
+#define XTENSA_UNDEFINED -1
 
-/* Get the size in "insnbuf_words" of the xtensa_insnbuf array.  */
 
-extern int
-xtensa_insnbuf_size (xtensa_isa isa); 
+typedef int libisa_module_specifier;
 
+extern xtensa_isa xtensa_isa_init (void);
 
-/* Allocate an xtensa_insnbuf of the right size.  */
 
-extern xtensa_insnbuf
-xtensa_insnbuf_alloc (xtensa_isa isa);
+/* Instruction buffers.  */
 
+typedef uint32 xtensa_insnbuf_word;
+typedef xtensa_insnbuf_word *xtensa_insnbuf;
 
-/* Release an xtensa_insnbuf.  */
+/* Get the size in words of the xtensa_insnbuf array.  */
+extern int xtensa_insnbuf_size (xtensa_isa); 
 
-extern void
-xtensa_insnbuf_free (xtensa_isa isa, xtensa_insnbuf buf);
+/* Allocate (with malloc) an xtensa_insnbuf of the right size.  */
+extern xtensa_insnbuf xtensa_insnbuf_alloc (xtensa_isa);
 
+/* Release (with free) an xtensa_insnbuf of the right size.  */
+extern void xtensa_insnbuf_free (xtensa_insnbuf);
 
-/* Conversion between raw memory (char arrays) and our internal
-   instruction representation.  This is complicated by the Xtensa ISA's
-   variable instruction lengths.  When converting to chars, the buffer
-   must contain a valid instruction so we know how many bytes to copy;
-   thus, the "to_chars" function returns the number of bytes copied or
-   XTENSA_UNDEFINED on error.  The "from_chars" function first reads the
-   minimal number of bytes required to decode the instruction length and
-   then proceeds to copy the entire instruction into the buffer; if the
-   memory does not contain a valid instruction, it copies the maximum
-   number of bytes required for the longest Xtensa instruction.  The
-   "num_chars" argument may be used to limit the number of bytes that
-   can be read or written.  Otherwise, if "num_chars" is zero, the
-   functions may read or write past the end of the code.  */
+/* Inward and outward conversion from memory images (byte streams) to our
+   internal instruction representation.  */
+extern void xtensa_insnbuf_to_chars (xtensa_isa, const xtensa_insnbuf,
+                                    char *);
 
-extern int
-xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn,
-                        char *cp, int num_chars);
+extern void xtensa_insnbuf_from_chars (xtensa_isa, xtensa_insnbuf,
+                                      const char *);
 
-extern void
-xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn,
-                          const char *cp, int num_chars);
 
-\f
 /* ISA information.  */
 
-/* Initialize the ISA information.  */
-
-extern xtensa_isa
-xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p);
+/* Load the ISA information from a shared library.  If successful, this returns
+   a value which identifies the ISA for use in subsequent calls to the ISA
+   library; otherwise, it returns NULL.  Multiple ISAs can be loaded to support
+   heterogeneous multiprocessor systems.  */
+extern xtensa_isa xtensa_load_isa (libisa_module_specifier);
 
+/* Extend an existing set of ISA information by loading an additional shared
+   library of ISA information.  This is primarily intended for loading TIE
+   extensions.  If successful, the return value is non-zero.  */
+extern int xtensa_extend_isa (xtensa_isa, libisa_module_specifier);
 
-/* Deallocate an xtensa_isa structure.  */
+/* The default ISA.  This variable is set automatically to the ISA most
+   recently loaded and is provided as a convenience.  An exception is the GNU
+   opcodes library, where there is a fixed interface that does not allow
+   passing the ISA as a parameter and the ISA must be taken from this global
+   variable.  (Note: Since this variable is just a convenience, it is not
+   exported when libisa is built as a DLL, due to the hassle of dealing with
+   declspecs.)  */
+extern xtensa_isa xtensa_default_isa;
 
-extern void
-xtensa_isa_free (xtensa_isa isa);
 
+/* Deallocate an xtensa_isa structure.  */
+extern void xtensa_isa_free (xtensa_isa);
 
 /* Get the maximum instruction size in bytes.  */
+extern int xtensa_insn_maxlength (xtensa_isa); 
 
-extern int
-xtensa_isa_maxlength (xtensa_isa isa); 
-
-
-/* Decode the length in bytes of an instruction in raw memory (not an
-   insnbuf).  This function reads only the minimal number of bytes
-   required to decode the instruction length.  Returns
-   XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_isa_length_from_chars (xtensa_isa isa, const char *cp);
-
-
-/* Get the number of stages in the processor's pipeline.  The pipeline
-   stage values returned by other functions in this library will range
-   from 0 to N-1, where N is the value returned by this function.
-   Note that the stage numbers used here may not correspond to the
-   actual processor hardware, e.g., the hardware may have additional
-   stages before stage 0.  Returns XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_isa_num_pipe_stages (xtensa_isa isa); 
-
-
-/* Get the number of various entities that are defined for this processor.  */
-
-extern int
-xtensa_isa_num_formats (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_opcodes (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_regfiles (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_states (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_sysregs (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_interfaces (xtensa_isa isa);
-
-extern int
-xtensa_isa_num_funcUnits (xtensa_isa isa);
-
-\f
-/* Instruction formats.  */
-
-/* Get the name of a format.  Returns null on error.  */
-
-extern const char *
-xtensa_format_name (xtensa_isa isa, xtensa_format fmt);
-
-
-/* Given a format name, return the format number.  Returns
-   XTENSA_UNDEFINED if the name is not a valid format.  */
-
-extern xtensa_format
-xtensa_format_lookup (xtensa_isa isa, const char *fmtname);
-
-
-/* Decode the instruction format from a binary instruction buffer.
-   Returns XTENSA_UNDEFINED if the format is not recognized.  */
-
-extern xtensa_format
-xtensa_format_decode (xtensa_isa isa, const xtensa_insnbuf insn);
-
-
-/* Set the instruction format field(s) in a binary instruction buffer.
-   All the other fields are set to zero.  Returns non-zero on error.  */
-
-extern int
-xtensa_format_encode (xtensa_isa isa, xtensa_format fmt, xtensa_insnbuf insn);
-
-
-/* Find the length (in bytes) of an instruction.  Returns
-   XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_format_length (xtensa_isa isa, xtensa_format fmt);
-
-
-/* Get the number of slots in an instruction.  Returns XTENSA_UNDEFINED
-   on error.  */
-
-extern int
-xtensa_format_num_slots (xtensa_isa isa, xtensa_format fmt);
-
-
-/* Get the opcode for a no-op in a particular slot.
-   Returns XTENSA_UNDEFINED on error.  */
-
-extern xtensa_opcode
-xtensa_format_slot_nop_opcode (xtensa_isa isa, xtensa_format fmt, int slot);
-
-
-/* Get the bits for a specified slot out of an insnbuf for the
-   instruction as a whole and put them into an insnbuf for that one
-   slot, and do the opposite to set a slot.  Return non-zero on error.  */
-
-extern int
-xtensa_format_get_slot (xtensa_isa isa, xtensa_format fmt, int slot,
-                       const xtensa_insnbuf insn, xtensa_insnbuf slotbuf);
-
-extern int
-xtensa_format_set_slot (xtensa_isa isa, xtensa_format fmt, int slot,
-                       xtensa_insnbuf insn, const xtensa_insnbuf slotbuf);
-
-\f
-/* Opcode information.  */
+/* Get the total number of opcodes for this processor.  */
+extern int xtensa_num_opcodes (xtensa_isa);
 
 /* Translate a mnemonic name to an opcode.  Returns XTENSA_UNDEFINED if
    the name is not a valid opcode mnemonic.  */
+extern xtensa_opcode xtensa_opcode_lookup (xtensa_isa, const char *);
 
-extern xtensa_opcode
-xtensa_opcode_lookup (xtensa_isa isa, const char *opname);
-
-
-/* Decode the opcode for one instruction slot from a binary instruction
-   buffer.  Returns the opcode or XTENSA_UNDEFINED if the opcode is
-   illegal.  */
-
-extern xtensa_opcode
-xtensa_opcode_decode (xtensa_isa isa, xtensa_format fmt, int slot,
-                     const xtensa_insnbuf slotbuf);
+/* Decode a binary instruction buffer.  Returns the opcode or
+   XTENSA_UNDEFINED if the instruction is illegal.  */
+extern xtensa_opcode xtensa_decode_insn (xtensa_isa, const xtensa_insnbuf);
 
 
-/* Set the opcode field(s) for an instruction slot.  All other fields
-   in the slot are set to zero.  Returns non-zero if the opcode cannot
-   be encoded.  */
-
-extern int
-xtensa_opcode_encode (xtensa_isa isa, xtensa_format fmt, int slot,
-                     xtensa_insnbuf slotbuf, xtensa_opcode opc);
-
-
-/* Get the mnemonic name for an opcode.  Returns null on error.  */
-
-extern const char *
-xtensa_opcode_name (xtensa_isa isa, xtensa_opcode opc);
-
-
-/* Check various properties of opcodes.  These functions return 0 if
-   the condition is false, 1 if the condition is true, and
-   XTENSA_UNDEFINED on error.  The instructions are classified as
-   follows:
-
-   branch: conditional branch; may fall through to next instruction (B*)
-   jump: unconditional branch (J, JX, RET*, RF*)
-   loop: zero-overhead loop (LOOP*)
-   call: unconditional call; control returns to next instruction (CALL*)
-
-   For the opcodes that affect control flow in some way, the branch
-   target may be specified by an immediate operand or it may be an
-   address stored in a register.  You can distinguish these by
-   checking if the instruction has a PC-relative immediate
-   operand.  */
-
-extern int
-xtensa_opcode_is_branch (xtensa_isa isa, xtensa_opcode opc);
-
-extern int
-xtensa_opcode_is_jump (xtensa_isa isa, xtensa_opcode opc);
-
-extern int
-xtensa_opcode_is_loop (xtensa_isa isa, xtensa_opcode opc);
-
-extern int
-xtensa_opcode_is_call (xtensa_isa isa, xtensa_opcode opc);
-
-
-/* Find the number of ordinary operands, state operands, and interface
-   operands for an instruction.  These return XTENSA_UNDEFINED on
-   error.  */
-
-extern int
-xtensa_opcode_num_operands (xtensa_isa isa, xtensa_opcode opc);
-
+/* Opcode information.  */
 
-extern int
-xtensa_opcode_num_stateOperands (xtensa_isa isa, xtensa_opcode opc);
+/* Set the opcode field(s) in a binary instruction buffer.  The operand
+   fields are set to zero.  */
+extern void xtensa_encode_insn (xtensa_isa, xtensa_opcode, xtensa_insnbuf);
 
-extern int
-xtensa_opcode_num_interfaceOperands (xtensa_isa isa, xtensa_opcode opc);
+/* Get the mnemonic name for an opcode.  */
+extern const char * xtensa_opcode_name (xtensa_isa, xtensa_opcode);
 
+/* Find the length (in bytes) of an instruction.  */
+extern int xtensa_insn_length (xtensa_isa, xtensa_opcode);
 
-/* Get functional unit usage requirements for an opcode.  Each "use"
-   is identified by a <functional unit, pipeline stage> pair.  The
-   "num_funcUnit_uses" function returns the number of these "uses" or
-   XTENSA_UNDEFINED on error.  The "funcUnit_use" function returns
-   a pointer to a "use" pair or null on error.  */
+/* Find the length of an instruction by looking only at the first byte.  */
+extern int xtensa_insn_length_from_first_byte (xtensa_isa, char);
 
-typedef struct xtensa_funcUnit_use_struct
-{
-  xtensa_funcUnit unit;
-  int stage;
-} xtensa_funcUnit_use;
+/* Find the number of operands for an instruction.  */
+extern int xtensa_num_operands (xtensa_isa, xtensa_opcode);
 
-extern int
-xtensa_opcode_num_funcUnit_uses (xtensa_isa isa, xtensa_opcode opc);
+/* Get the information about operand number "opnd" of a particular opcode.  */
+extern xtensa_operand xtensa_get_operand (xtensa_isa, xtensa_opcode, int);
 
-extern xtensa_funcUnit_use *
-xtensa_opcode_funcUnit_use (xtensa_isa isa, xtensa_opcode opc, int u);
-
-\f
 /* Operand information.  */
 
-/* Get the name of an operand.  Returns null on error.  */
-
-extern const char *
-xtensa_operand_name (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
-
-/* Some operands are "invisible", i.e., not explicitly specified in
-   assembly language.  When assembling an instruction, you need not set
-   the values of invisible operands, since they are either hardwired or
-   derived from other field values.  The values of invisible operands
-   can be examined in the same way as other operands, but remember that
-   an invisible operand may get its value from another visible one, so
-   the entire instruction must be available before examining the
-   invisible operand values.  This function returns 1 if an operand is
-   visible, 0 if it is invisible, or XTENSA_UNDEFINED on error.  Note
-   that whether an operand is visible is orthogonal to whether it is
-   "implicit", i.e., whether it is encoded in a field in the
-   instruction.  */
-
-extern int
-xtensa_operand_is_visible (xtensa_isa isa, xtensa_opcode opc, int opnd);
+/* Find the kind of operand.  There are three possibilities:
+   1) PC-relative immediates (e.g., "l", "L").  These can be identified with
+      the xtensa_operand_isPCRelative function.
+   2) non-PC-relative immediates ("i").
+   3) register-file short names (e.g., "a", "b", "m" and others defined
+      via TIE).  */
+extern char * xtensa_operand_kind (xtensa_operand);
 
-
-/* Check if an operand is an input ('i'), output ('o'), or inout ('m')
+/* Check if an operand is an input ('<'), output ('>'), or inout ('=')
    operand.  Note: The output operand of a conditional assignment
-   (e.g., movnez) appears here as an inout ('m') even if it is declared
-   in the TIE code as an output ('o'); this allows the compiler to
-   properly handle register allocation for conditional assignments.
-   Returns 0 on error.  */
-
-extern char
-xtensa_operand_inout (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
+   (e.g., movnez) appears here as an inout ('=') even if it is declared
+   in the TIE code as an output ('>'); this allows the compiler to
+   properly handle register allocation for conditional assignments.  */
+extern char xtensa_operand_inout (xtensa_operand);
 
 /* Get and set the raw (encoded) value of the field for the specified
    operand.  The "set" function does not check if the value fits in the
-   field; that is done by the "encode" function below.  Both of these
-   functions return non-zero on error, e.g., if the field is not defined
-   for the specified slot.  */
-
-extern int
-xtensa_operand_get_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                         xtensa_format fmt, int slot,
-                         const xtensa_insnbuf slotbuf, uint32 *valp);
-
-extern int 
-xtensa_operand_set_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                         xtensa_format fmt, int slot,
-                         xtensa_insnbuf slotbuf, uint32 val);
-
-
-/* Encode and decode operands.  The raw bits in the operand field may
-   be encoded in a variety of different ways.  These functions hide
-   the details of that encoding.  The result values are returned through
-   the argument pointer.  The return value is non-zero on error.  */
-
-extern int
-xtensa_operand_encode (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                      uint32 *valp);
-
-extern int
-xtensa_operand_decode (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                      uint32 *valp);
-
-
-/* An operand may be either a register operand or an immediate of some
-   sort (e.g., PC-relative or not).  The "is_register" function returns
-   0 if the operand is an immediate, 1 if it is a register, and
-   XTENSA_UNDEFINED on error.  The "regfile" function returns the
-   regfile for a register operand, or XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_operand_is_register (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
-extern xtensa_regfile
-xtensa_operand_regfile (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
-
-/* Register operands may span multiple consecutive registers, e.g., a
-   64-bit data type may occupy two 32-bit registers.  Only the first
-   register is encoded in the operand field.  This function specifies
-   the number of consecutive registers occupied by this operand.  For
-   non-register operands, the return value is undefined.  Returns
-   XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_operand_num_regs (xtensa_isa isa, xtensa_opcode opc, int opnd);
-                                
-
-/* Some register operands do not completely identify the register being
-   accessed.  For example, the operand value may be added to an internal
-   state value.  By definition, this implies that the corresponding
-   regfile is not allocatable.  Unknown registers should generally be
-   treated with worst-case assumptions.  The function returns 0 if the
-   register value is unknown, 1 if known, and XTENSA_UNDEFINED on
-   error.  */
-
-extern int
-xtensa_operand_is_known_reg (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
-
-/* Check if an immediate operand is PC-relative.  Returns 0 for register
-   operands and non-PC-relative immediates, 1 for PC-relative
-   immediates, and XTENSA_UNDEFINED on error.  */
-extern int
-xtensa_operand_is_PCrelative (xtensa_isa isa, xtensa_opcode opc, int opnd);
-
-
-/* For PC-relative offset operands, the interpretation of the offset may
-   vary between opcodes, e.g., is it relative to the current PC or that
-   of the next instruction?  The following functions are defined to
-   perform PC-relative relocations and to undo them (as in the
-   disassembler).  The "do_reloc" function takes the desired address
-   value and the PC of the current instruction and sets the value to the
-   corresponding PC-relative offset (which can then be encoded and
-   stored into the operand field).  The "undo_reloc" function takes the
-   unencoded offset value and the current PC and sets the value to the
-   appropriate address.  The return values are non-zero on error.  Note
-   that these functions do not replace the encode/decode functions; the
-   operands must be encoded/decoded separately and the encode functions
-   are responsible for detecting invalid operand values.  */
-
-extern int
-xtensa_operand_do_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                        uint32 *valp, uint32 pc);
-
-extern int
-xtensa_operand_undo_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
-                          uint32 *valp, uint32 pc);
-
-\f
-/* State Operands.  */
-
-/* Get the state accessed by a state operand.  Returns XTENSA_UNDEFINED
-   on error.  */
-
-extern xtensa_state
-xtensa_stateOperand_state (xtensa_isa isa, xtensa_opcode opc, int stOp);
-
-
-/* Check if a state operand is an input ('i'), output ('o'), or inout
-   ('m') operand.  Returns 0 on error.  */
-
-extern char
-xtensa_stateOperand_inout (xtensa_isa isa, xtensa_opcode opc, int stOp);
-
-\f
-/* Interface Operands.  */
-
-/* Get the external interface accessed by an interface operand.
-   Returns XTENSA_UNDEFINED on error.  */
-
-extern xtensa_interface
-xtensa_interfaceOperand_interface (xtensa_isa isa, xtensa_opcode opc,
-                                  int ifOp);
-
-\f
-/* Register Files.  */
-
-/* Regfiles include both "real" regfiles and "views", where a view
-   allows a group of adjacent registers in a real "parent" regfile to be
-   viewed as a single register.  A regfile view has all the same
-   properties as its parent except for its (long) name, bit width, number
-   of entries, and default ctype.  You can use the parent function to
-   distinguish these two classes.  */
-
-/* Look up a regfile by either its name or its abbreviated "short name".
-   Returns XTENSA_UNDEFINED on error.  The "lookup_shortname" function
-   ignores "view" regfiles since they always have the same shortname as
-   their parents.  */
-
-extern xtensa_regfile
-xtensa_regfile_lookup (xtensa_isa isa, const char *name);
-
-extern xtensa_regfile
-xtensa_regfile_lookup_shortname (xtensa_isa isa, const char *shortname);
-
-
-/* Get the name or abbreviated "short name" of a regfile.
-   Returns null on error.  */
-
-extern const char *
-xtensa_regfile_name (xtensa_isa isa, xtensa_regfile rf);
-
-extern const char *
-xtensa_regfile_shortname (xtensa_isa isa, xtensa_regfile rf);
-
-
-/* Get the parent regfile of a "view" regfile.  If the regfile is not a
-   view, the result is the same as the input parameter.  Returns
-   XTENSA_UNDEFINED on error.  */
-
-extern xtensa_regfile
-xtensa_regfile_view_parent (xtensa_isa isa, xtensa_regfile rf);
-
-
-/* Get the bit width of a regfile or regfile view.
-   Returns XTENSA_UNDEFINED on error.  */
+   field; that is done by the "encode" function below.  */
+extern uint32 xtensa_operand_get_field (xtensa_operand, const xtensa_insnbuf);
 
-extern int
-xtensa_regfile_num_bits (xtensa_isa isa, xtensa_regfile rf);
+extern void xtensa_operand_set_field (xtensa_operand, xtensa_insnbuf, uint32);
 
 
-/* Get the number of regfile entries.  Returns XTENSA_UNDEFINED on
-   error.  */
+/* Encode and decode operands.  The raw bits in the operand field
+   may be encoded in a variety of different ways.  These functions hide the
+   details of that encoding.  The encode function has a special return type
+   (xtensa_encode_result) to indicate success or the reason for failure; the
+   encoded value is returned through the argument pointer.  The decode function
+   has no possibility of failure and returns the decoded value.  */
 
-extern int
-xtensa_regfile_num_entries (xtensa_isa isa, xtensa_regfile rf);
-
-\f
-/* Processor States.  */
-
-/* Look up a state by name.  Returns XTENSA_UNDEFINED on error.  */
-
-extern xtensa_state
-xtensa_state_lookup (xtensa_isa isa, const char *name);
-
-
-/* Get the name for a processor state.  Returns null on error.  */
-
-extern const char *
-xtensa_state_name (xtensa_isa isa, xtensa_state st);
-
-
-/* Get the bit width for a processor state.
-   Returns XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_state_num_bits (xtensa_isa isa, xtensa_state st);
-
-
-/* Check if a state is exported from the processor core.  Returns 0 if
-   the condition is false, 1 if the condition is true, and
-   XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_state_is_exported (xtensa_isa isa, xtensa_state st);
-
-\f
-/* Sysregs ("special registers" and "user registers").  */
-
-/* Look up a register by its number and whether it is a "user register"
-   or a "special register".  Returns XTENSA_UNDEFINED if the sysreg does
-   not exist.  */
-
-extern xtensa_sysreg
-xtensa_sysreg_lookup (xtensa_isa isa, int num, int is_user);
-
-
-/* Check if there exists a sysreg with a given name.
-   If not, this function returns XTENSA_UNDEFINED.  */
-
-extern xtensa_sysreg
-xtensa_sysreg_lookup_name (xtensa_isa isa, const char *name);
-
-
-/* Get the name of a sysreg.  Returns null on error.  */
-
-extern const char *
-xtensa_sysreg_name (xtensa_isa isa, xtensa_sysreg sysreg);
-
-
-/* Get the register number.  Returns XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_sysreg_number (xtensa_isa isa, xtensa_sysreg sysreg);
-
-
-/* Check if a sysreg is a "special register" or a "user register".
-   Returns 0 for special registers, 1 for user registers and
-   XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_sysreg_is_user (xtensa_isa isa, xtensa_sysreg sysreg);
-
-\f
-/* Interfaces.  */
-
-/* Find an interface by name.  The return value is XTENSA_UNDEFINED if
-   the specified interface is not found.  */
-
-extern xtensa_interface
-xtensa_interface_lookup (xtensa_isa isa, const char *ifname);
-
-
-/* Get the name of an interface.  Returns null on error.  */
-
-extern const char *
-xtensa_interface_name (xtensa_isa isa, xtensa_interface intf);
-
-
-/* Get the bit width for an interface.
-   Returns XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_interface_num_bits (xtensa_isa isa, xtensa_interface intf);
-
-
-/* Check if an interface is an input ('i') or output ('o') with respect
-   to the Xtensa processor core.  Returns 0 on error.  */
-
-extern char
-xtensa_interface_inout (xtensa_isa isa, xtensa_interface intf);
-
-
-/* Check if accessing an interface has potential side effects.
-   Currently "data" interfaces have side effects and "control"
-   interfaces do not.  Returns 1 if there are side effects, 0 if not,
-   and XTENSA_UNDEFINED on error.  */
-
-extern int
-xtensa_interface_has_side_effect (xtensa_isa isa, xtensa_interface intf);
-
-\f
-/* Functional Units.  */
-
-/* Find a functional unit by name.  The return value is XTENSA_UNDEFINED if
-   the specified unit is not found.  */
-
-extern xtensa_funcUnit
-xtensa_funcUnit_lookup (xtensa_isa isa, const char *fname);
+typedef enum
+{
+  xtensa_encode_result_ok,
+  xtensa_encode_result_align,
+  xtensa_encode_result_not_in_table,
+  xtensa_encode_result_too_low,
+  xtensa_encode_result_too_high,
+  xtensa_encode_result_not_ok,
+  xtensa_encode_result_max = xtensa_encode_result_not_ok
+} xtensa_encode_result;
 
+extern xtensa_encode_result xtensa_operand_encode (xtensa_operand, uint32 *);
 
-/* Get the name of a functional unit.  Returns null on error.  */
+extern uint32 xtensa_operand_decode (xtensa_operand, uint32);
 
-extern const char *
-xtensa_funcUnit_name (xtensa_isa isa, xtensa_funcUnit fun);
 
+/* For PC-relative offset operands, the interpretation of the offset may vary
+   between opcodes, e.g., is it relative to the current PC or that of the next
+   instruction?  The following functions are defined to perform PC-relative
+   relocations and to undo them (as in the disassembler).  The first function
+   takes the desired address and the PC of the current instruction and returns
+   the unencoded value to be stored in the offset field.  The second function
+   takes the unencoded offset value and the current PC and returns the address.
+   Note that these functions do not replace the encode/decode functions; the
+   operands must be encoded/decoded separately.  */
 
-/* Functional units may be replicated.  See how many instances of a
-   particular function unit exist.  Returns XTENSA_UNDEFINED on error.  */
+extern int xtensa_operand_isPCRelative (xtensa_operand);
 
-extern int
-xtensa_funcUnit_num_copies (xtensa_isa isa, xtensa_funcUnit fun);
+extern uint32 xtensa_operand_do_reloc (xtensa_operand, uint32, uint32);
 
+extern uint32 xtensa_operand_undo_reloc        (xtensa_operand, uint32, uint32);
 
 #ifdef __cplusplus
 }
index dd97db7aa1cae9655149aad9d21c6cf42476c0da..77bc38144f23d186b8f0bac3595c9b1e1f8dfb6f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-09-10.20
+scriptversion=2004-02-15.20
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -58,6 +58,9 @@ stripprog="${STRIPPROG-strip}"
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
+transformbasename=
+transform_arg=
+instcmd="$mvprog"
 chmodcmd="$chmodprog 0755"
 chowncmd=
 chgrpcmd=
@@ -67,27 +70,23 @@ mvcmd="$mvprog"
 src=
 dst=
 dir_arg=
-dstarg=
-no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
+   or: $0 -d DIRECTORIES...
 
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
 
 Options:
--c         (ignored)
+-b=TRANSFORMBASENAME
+-c         copy source (using $cpprog) instead of moving (using $mvprog).
 -d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
+-g GROUP   $chgrp installed files to GROUP.
+-m MODE    $chmod installed files to MODE.
+-o USER    $chown installed files to USER.
+-s         strip installed files (using $stripprog).
+-t=TRANSFORM
 --help     display this help and exit.
 --version  display version info and exit.
 
@@ -97,7 +96,12 @@ Environment variables override the default commands:
 
 while test -n "$1"; do
   case $1 in
-    -c) shift
+    -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+        shift
+        continue;;
+
+    -c) instcmd=$cpprog
+        shift
         continue;;
 
     -d) dir_arg=true
@@ -125,20 +129,14 @@ while test -n "$1"; do
         shift
         continue;;
 
-    -t) dstarg=$2
-       shift
-       shift
-       continue;;
-
-    -T) no_target_directory=true
-       shift
-       continue;;
+    -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+        shift
+        continue;;
 
     --version) echo "$0 $scriptversion"; exit 0;;
 
     *)  # When -d is used, all remaining arguments are directories to create.
-       # When -t is used, the destination is already specified.
-       test -n "$dir_arg$dstarg" && break
+       test -n "$dir_arg" && break
         # Otherwise, the last argument is the destination.  Remove it from $@.
        for arg
        do
@@ -176,13 +174,13 @@ do
     src=
 
     if test -d "$dst"; then
-      mkdircmd=:
+      instcmd=:
       chmodcmd=
     else
-      mkdircmd=$mkdirprog
+      instcmd=$mkdirprog
     fi
   else
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
     if test ! -f "$src" && test ! -d "$src"; then
@@ -204,10 +202,6 @@ do
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-       echo "$0: $dstarg: Is a directory" >&2
-       exit 1
-      fi
       dst=$dst/`basename "$src"`
     fi
   fi
@@ -235,77 +229,77 @@ do
       pathcomp=$pathcomp$1
       shift
       if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
+        $mkdirprog "$pathcomp" || lasterr=$?
        # mkdir can fail with a `File exist' error in case several
        # install-sh are creating the directory concurrently.  This
        # is OK.
-       test -d "$pathcomp" || exit
+       test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; }
       fi
       pathcomp=$pathcomp/
     done
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
+    $doit $instcmd "$dst" \
       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
       && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
 
   else
-    dstfile=`basename "$dst"`
+    # If we're going to rename the final executable, determine the name now.
+    if test -z "$transformarg"; then
+      dstfile=`basename "$dst"`
+    else
+      dstfile=`basename "$dst" $transformbasename \
+               | sed $transformarg`$transformbasename
+    fi
+
+    # don't allow the sed command to completely eliminate the filename.
+    test -z "$dstfile" && dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
     rmtmp=$dstdir/_rm.$$_
 
     # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
     trap '(exit $?); exit' 1 2 13 15
 
-    # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    # Move or copy the file name to the temp name
+    $doit $instcmd "$src" "$dsttmp" &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
     # If any of these fail, we abort the whole thing.  If we want to
     # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    # errors from the above "$doit $instcmd $src $dsttmp" command.
     #
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
       && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
 
+    # Now remove or move aside any old file at destination location.  We
+    # try this two ways since rm can't unlink itself on some systems and
+    # the destination file might be busy for other reasons.  In this case,
+    # the final cleanup might fail but the new file should still install
+    # successfully.
+    {
+      if test -f "$dstdir/$dstfile"; then
+        $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+        || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+        || {
+         echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+         (exit 1); exit
+        }
+      else
+        :
+      fi
+    } &&
+
     # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-          # The rename failed, perhaps because mv can't rename something else
-          # to itself, or perhaps because mv is so ancient that it does not
-          # support -f.
-
-          # Now remove or move aside any old file at destination location.
-          # We try this two ways since rm can't unlink itself on some
-          # systems and the destination file might be busy for other
-          # reasons.  In this case, the final cleanup might fail but the new
-          # file should still install successfully.
-          {
-            if test -f "$dstdir/$dstfile"; then
-              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-              || {
-                echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-                (exit 1); exit
-              }
-            else
-              :
-            fi
-          } &&
-
-          # Now rename the file to the real destination.
-          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-        }
-    }
+    $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
   fi || { (exit 1); exit; }
 done
 
diff --git a/intl/ChangeLog b/intl/ChangeLog
new file mode 100644 (file)
index 0000000..44d88e4
--- /dev/null
@@ -0,0 +1,1091 @@
+2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
+
+       * linux-msg.sed: Comment typo fix.
+       * xopen-msg.sed: Likewise.
+
+1998-04-29  Ulrich Drepper  <drepper@cygnus.com>
+
+       * intl/localealias.c (read_alias_file): Use unsigned char for
+       local variables.  Remove unused variable tp.
+       * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char *
+       for type of codeset.  For loosing Solaris systems.
+       * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset.
+       * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable
+       len if not needed.
+       Patches by Jim Meyering.
+
+1998-04-28  Ulrich Drepper  <drepper@cygnus.com>
+
+       * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if
+       mmap is not supported.
+
+       * hash-string.h: Don't include <values.h>.
+
+1998-04-27  Ulrich Drepper  <drepper@cygnus.com>
+
+       * textdomain.c: Use strdup is available.
+
+       * localealias.c: Define HAVE_MEMPCPY so that we can use this
+       function.  Define and use semapahores to protect modfication of
+       global objects when compiling for glibc.  Add code to allow
+       freeing alias table.
+
+       * l10nflist.c: Don't assume stpcpy not being a macro.
+
+       * gettextP.h: Define internal_function macri if not already done.
+       Use glibc byte-swap macros instead of defining SWAP when compiled
+       for glibc.
+       (struct loaded_domain): Add elements to allow unloading.
+
+       * Makefile.in (distclean): Don't remove libintl.h here.
+
+       * bindtextdomain.c: Carry over changes from glibc.  Use strdup if
+       available.
+
+       * dcgettext.c: Don't assume stpcpy not being a macro.  Mark internal
+       functions.  Add memory freeing code for glibc.
+
+       * dgettext.c: Update copyright.
+
+       * explodename.c: Include stdlib.h and string.h only if they exist.
+       Use strings.h eventually.
+
+       * finddomain.c: Mark internal functions.  Use strdup if available.
+       Add memory freeing code for glibc.
+
+1997-10-10 20:00  Ulrich Drepper  <drepper@cygnus.com>
+
+       * libgettext.h: Fix dummy textdomain and bindtextdomain macros.
+       They should return reasonable values.
+       Reported by Tom Tromey <tromey@cygnus.com>.
+
+1997-09-16 03:33  Ulrich Drepper  <drepper@cygnus.com>
+
+       * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined.
+       * intlh.inst.in: Likewise.
+       Reported by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>.
+
+       * libintl.glibc: Update from current glibc version.
+
+1997-09-06 02:10  Ulrich Drepper  <drepper@cygnus.com>
+
+       * intlh.inst.in: Reformat copyright.
+
+1997-08-19 15:22  Ulrich Drepper  <drepper@cygnus.com>
+
+       * dcgettext.c (DCGETTEXT): Remove wrong comment.
+
+1997-08-16 00:13  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (install-data): Don't change directory to install.
+
+1997-08-01 14:30  Ulrich Drepper  <drepper@cygnus.com>
+
+       * cat-compat.c: Fix copyright.
+
+       * localealias.c: Don't define strchr unless !HAVE_STRCHR.
+
+       * loadmsgcat.c: Update copyright.  Fix typos.
+
+       * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
+       (_nl_make_l10nflist): Handle sponsor and revision correctly.
+
+       * gettext.c: Update copyright.
+       * gettext.h: Likewise.
+       * hash-string.h: Likewise.
+
+       * finddomain.c: Remoave dead code.  Define strchr only if
+       !HAVE_STRCHR.
+
+       * explodename.c: Include <sys/types.h>.
+
+       * explodename.c: Reformat copyright text.
+       (_nl_explode_name): Fix typo.
+
+       * dcgettext.c: Define and use __set_errno.
+       (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
+       not defined.
+
+       * bindtextdom.c: Pretty printing.
+
+1997-05-01 02:25  Ulrich Drepper  <drepper@cygnus.com>
+
+       * dcgettext.c (guess_category_value): Don't depend on
+       HAVE_LC_MESSAGES.  We don't need the macro here.
+       Patch by Bruno Haible <haible@ilog.fr>.
+
+       * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
+       macro.  Instead use HAVE_LOCALE_NULL and define it when using
+       glibc, as in dcgettext.c.
+       Patch by Bruno Haible <haible@ilog.fr>.
+
+       * Makefile.in (CPPFLAGS): New variable.  Reported by Franc,ois
+       Pinard.
+
+Mon Mar 10 06:51:17 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in: Implement handling of libtool.
+
+       * gettextP.h: Change data structures for use of generic lowlevel
+       i18n file handling.
+
+Wed Dec  4 20:21:18 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * textdomain.c: Put parentheses around arguments of memcpy macro
+       definition.
+       * localealias.c: Likewise.
+       * l10nflist.c: Likewise.
+       * finddomain.c: Likewise.
+       * bindtextdom.c: Likewise.
+       Reported by Thomas Esken.
+
+Mon Nov 25 22:57:51 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * textdomain.c: Move definition of `memcpy` macro to right
+       position.
+
+Fri Nov 22 04:01:58 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
+       bcopy if not already defined.  Reported by Thomas Esken.
+       * bindtextdom.c: Likewise.
+       * l10nflist.c: Likewise.
+       * localealias.c: Likewise.
+       * textdomain.c: Likewise.
+
+Tue Oct 29 11:10:27 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (libdir): Change to use exec_prefix instead of
+       prefix.  Reported by Knut-HÃ¥vardAksnes <etokna@eto.ericsson.se>.
+
+Sat Aug 31 03:07:09 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
+       so don't prepend uppercase `ISO' for only numeric arg.
+
+Fri Jul 19 00:15:46 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
+       definition of _GNU_SOURCE.  Patch by Roland McGrath.
+
+       * Makefile.in (uninstall): Fix another bug with `for' loop and
+       empty arguments.  Patch by Jim Meyering.  Correct name os
+       uninstalled files: no intl- prefix anymore.
+
+       * Makefile.in (install-data): Again work around shells which
+       cannot handle mpty for list.  Reported by Jim Meyering.
+
+Sat Jul 13 18:11:35 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (install): Split goal.  Now depend on install-exec
+        and install-data.
+       (install-exec, install-data): New goals.  Created from former
+       install goal.
+       Reported by Karl Berry.
+
+Sat Jun 22 04:58:14 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (MKINSTALLDIRS): New variable.  Path to
+        mkinstalldirs script.
+       (install): use MKINSTALLDIRS variable or if the script is not present
+       try to find it in the $top_scrdir).
+
+Wed Jun 19 02:56:56 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * l10nflist.c: Linux libc *partly* includes the argz_* functions.
+       Grr.  Work around by renaming the static version and use macros
+       for renaming.
+
+Tue Jun 18 20:11:17 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * l10nflist.c: Correct presence test macros of __argz_* functions.
+
+       * l10nflist.c: Include <argz.h> based on test of it instead when
+       __argz_* functions are available.
+       Reported by Andreas Schwab.
+
+Thu Jun 13 15:17:44 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * explodename.c, l10nflist.c: Define NULL for dumb systems.
+
+Tue Jun 11 17:05:13 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
+       result to __result to prevent name clash.
+
+       * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
+        get prototype for stpcpy and strcasecmp.
+
+       * intlh.inst.in, libgettext.h: Move declaration of
+       `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
+       from gcc's -Wnested-extern option.
+
+Fri Jun  7 01:58:00 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (install): Remove comment.
+
+Thu Jun  6 17:28:17 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (install): Work around for another Buglix stupidity.
+       Always use an `else' close for `if's.  Reported by Nelson Beebe.
+
+       * Makefile.in (intlh.inst): Correct typo in phony rule.
+       Reported by Nelson Beebe.
+
+Thu Jun  6 01:49:52 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * dcgettext.c (read_alias_file): Rename variable alloca_list to
+       block_list as the macro calls assume.
+       Patch by Eric Backus.
+
+       * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
+        malloc.
+       (read_alias_file): Rename varriabe alloca_list to block_list as the
+       macro calls assume.
+       Patch by Eric Backus.
+
+       * l10nflist.c: Correct conditional for <argz.h> inclusion.
+       Reported by Roland McGrath.
+
+       * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
+        all-@USE_NLS@.
+
+       * Makefile.in (install): intlh.inst comes from local dir, not
+        $(srcdir).
+
+       * Makefile.in (intlh.inst): Special handling of this goal.  If
+       used in gettext, this is really a rul to construct this file.  If
+       used in any other package it is defined as a .PHONY rule with
+       empty body.
+
+       * finddomain.c: Extract locale file information handling into
+       l10nfile.c.  Rename local stpcpy__ function to stpcpy.
+
+       * dcgettext.c (stpcpy): Add local definition.
+
+       * l10nflist.c: Solve some portability problems.  Patches partly by
+       Thomas Esken.  Add local definition of stpcpy.
+
+Tue Jun  4 02:47:49 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * intlh.inst.in: Don't depend including <locale.h> on
+       HAVE_LOCALE_H.  Instead configure must rewrite this fiile
+       depending on the result of the configure run.
+
+       * Makefile.in (install): libintl.inst is now called intlh.inst.
+       Add rules for updating intlh.inst from intlh.inst.in.
+
+       * libintl.inst: Renamed to intlh.inst.in.
+
+       * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
+        because gcc has __buitlin_alloca.
+       Reported by Roland McGrath.
+
+Mon Jun  3 00:32:16 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile.in (installcheck): New goal to fulfill needs of
+        automake's distcheck.
+
+       * Makefile.in (install): Reorder commands so that VERSION is
+        found.
+
+       * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
+        @datadir@/gettext.
+       (COMSRCS): Add l10nfile.c.
+       (OBJECTS): Add l10nfile.o.
+       (DISTFILES): Rename to DISTFILE.normal.  Remove $(DISTFILES.common).
+       (DISTFILE.gettext): Remove $(DISTFILES.common).
+       (all-gettext): Remove goal.
+       (install): If $(PACKAGE) = gettext install, otherwose do nothing.  No
+       package but gettext itself should install libintl.h + headers.
+       (dist): Extend goal to work for gettext, too.
+       (dist-gettext): Remove goal.
+
+       * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
+
+Sun Jun  2 17:33:06 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
+        find_l10nfile.
+
+Sat Jun  1 02:23:03 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * l10nflist.c (__argz_next): Add definition.
+
+       * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
+       code.  Use new l10nfile handling.
+
+       * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
+        alloca code.
+
+       * l10nflist.c: Initial revision.
+
+Tue Apr  2 18:51:18 1996  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (all-gettext): New goal.  Same as all-yes.
+
+Thu Mar 28 23:01:22 1996  Karl Eichwalder  <ke@ke.central.de>
+
+       * Makefile.in (gettextsrcdir): Define using @datadir@.
+
+Tue Mar 26 12:39:14 1996  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c: Include <ctype.h>.  Reported by Roland McGrath.
+
+Sat Mar 23 02:00:35 1996  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
+        with external declaration.
+
+Sat Mar  2 00:47:09 1996  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (all-no): Rename from all_no.
+
+Sat Feb 17 00:25:59 1996  Ulrich Drepper  <drepper@myware>
+
+       * gettextP.h [loaded_domain]: Array `successor' must now contain up
+        to 63 elements (because of codeset name normalization).
+
+       * finddomain.c: Implement codeset name normalization.
+
+Thu Feb 15 04:39:09 1996  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (all): Define to `all-@USE_NLS@'.
+       (all-yes, all_no): New goals.  `all-no' is noop, `all-yes'
+       is former all.
+
+Mon Jan 15 21:46:01 1996  Howard Gayle  <howard@hal.com>
+
+       * localealias.c (alias_compare): Increment string pointers in loop
+        of strcasecmp replacement.
+
+Fri Dec 29 21:16:34 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (install-src): Who commented this goal out ? :-)
+
+Fri Dec 29 15:08:16 1995  Ulrich Drepper  <drepper@myware>
+
+       * dcgettext.c (DCGETTEXT): Save `errno'.  Failing system calls
+       should not effect it because a missing catalog is no error.
+       Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
+
+Tue Dec 19 22:09:13 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (Makefile): Explicitly use $(SHELL) for running
+        shell scripts.
+
+Fri Dec 15 17:34:59 1995  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makefile.in (install-src): Only install library and header when
+       we use the own implementation.  Don't do it when using the
+       system's gettext or catgets functions.
+
+       * dcgettext.c (find_msg): Must not swap domain->hash_size here.
+
+Sat Dec  9 16:24:37 1995  Ulrich Drepper  <drepper@myware>
+
+       * localealias.c, libintl.inst, libgettext.h, hash-string.h,
+       gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
+       Use PARAMS instead of __P.  Suggested by Roland McGrath.
+
+Tue Dec  5 11:39:14 1995  Larry Schwimmer  <rosebud@cyclone.stanford.edu>
+
+       * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
+       !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
+
+Mon Dec  4 15:42:07 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (install-src):
+       Install libintl.inst instead of libintl.h.install.
+
+Sat Dec  2 22:51:38 1995  Marcus Daniels  <marcus@sysc.pdx.edu>
+
+       * cat-compat.c (textdomain):
+       Reverse order in which files are tried you load.  First
+       try local file, when this failed absolute path.
+
+Wed Nov 29 02:03:53 1995  Nelson H. F. Beebe  <beebe@math.utah.edu>
+
+       * cat-compat.c (bindtextdomain): Add missing { }.
+
+Sun Nov 26 18:21:41 1995  Ulrich Drepper  <drepper@myware>
+
+       * libintl.inst: Add missing __P definition.  Reported by Nelson Beebe.
+
+       * Makefile.in:
+       Add dummy `all' and `dvi' goals.  Reported by Tom Tromey.
+
+Sat Nov 25 16:12:01 1995  Franc,ois Pinard  <pinard@iro.umontreal.ca>
+
+       * hash-string.h: Capitalize arguments of macros.
+
+Sat Nov 25 12:01:36 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (DISTFILES): Prevent files names longer than 13
+       characters.  libintl.h.glibc->libintl.glibc,
+       libintl.h.install->libintl.inst.  Reported by Joshua R. Poulson.
+
+Sat Nov 25 11:31:12 1995  Eric Backus  <ericb@lsid.hp.com>
+
+       * dcgettext.c: Fix bug in preprocessor conditionals.
+
+Sat Nov 25 02:35:27 1995  Nelson H. F. Beebe  <beebe@math.utah.edu>
+
+       * libgettext.h: Solaris cc does not understand
+        #if !SYMBOL1 && !SYMBOL2.  Sad but true.
+
+Thu Nov 23 16:22:14 1995  Ulrich Drepper  <drepper@myware>
+
+       * hash-string.h (hash_string):
+       Fix for machine with >32 bit `unsigned long's.
+
+       * dcgettext.c (DCGETTEXT):
+       Fix horrible bug in loop for alternative translation.
+
+Thu Nov 23 01:45:29 1995  Ulrich Drepper  <drepper@myware>
+
+       * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
+       Some further simplifications in message number generation.
+
+Mon Nov 20 21:08:43 1995  Ulrich Drepper  <drepper@myware>
+
+       * libintl.h.glibc: Use __const instead of const in prototypes.
+
+       * Makefile.in (install-src):
+       Install libintl.h.install instead of libintl.h.  This
+       is a stripped-down version.  Suggested by Peter Miller.
+
+       * libintl.h.install, libintl.h.glibc: Initial revision.
+
+       * localealias.c (_nl_expand_alias, read_alias_file):
+       Protect prototypes in type casts by __P.
+
+Tue Nov 14 16:43:58 1995  Ulrich Drepper  <drepper@myware>
+
+       * hash-string.h: Correct prototype for hash_string.
+
+Sun Nov 12 12:42:30 1995  Ulrich Drepper  <drepper@myware>
+
+       * hash-string.h (hash_string): Add prototype.
+
+       * gettextP.h: Fix copyright.
+       (SWAP): Add prototype.
+
+Wed Nov  8 22:56:33 1995  Ulrich Drepper  <drepper@myware>
+
+       * localealias.c (read_alias_file): Forgot sizeof.
+       Avoid calling *printf function.  This introduces a big overhead.
+       Patch by Roland McGrath.
+
+Tue Nov  7 14:21:08 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
+
+       * finddomain.c (stpcpy):
+       Define substitution function local.  The macro was to flaky.
+
+       * cat-compat.c: Fix typo.
+
+       * xopen-msg.sed, linux-msg.sed:
+       While bringing message number to right place only accept digits.
+
+       * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
+       leading 0s we don't need to remove them.  Reported by Marcus
+       Daniels.
+
+       * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
+       dependency.  Reported by Marcus Daniels.
+
+       * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
+       Generally cleanup using #if instead of #ifndef.
+
+       * Makefile.in: Correct typos in comment.  By Franc,ois Pinard.
+
+Mon Nov  6 00:27:02 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (install-src): Don't install libintl.h and libintl.a
+       if we use an available gettext implementation.
+
+Sun Nov  5 22:02:08 1995  Ulrich Drepper  <drepper@myware>
+
+       * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS.  Reported
+       by Franc,ois Pinard.
+
+       * libgettext.h: Use #if instead of #ifdef/#ifndef.
+
+       * finddomain.c:
+       Comments describing what has to be done should start with FIXME.
+
+Sun Nov  5 19:38:01 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (DISTFILES): Split.  Use DISTFILES with normal meaning.
+       DISTFILES.common names the files common to both dist goals.
+       DISTFILES.gettext are the files only distributed in GNU gettext.
+
+Sun Nov  5 17:32:54 1995  Ulrich Drepper  <drepper@myware>
+
+       * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
+       This was necessary since a change in _nl_find_msg several weeks
+       ago.  I really don't know this is still not fixed.
+
+Sun Nov  5 12:43:12 1995  Ulrich Drepper  <drepper@myware>
+
+       * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL.  This
+       might mark a special condition.
+
+       * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
+
+       * Makefile.in (dist): Suppress error message when ln failed.
+       Get files from $(srcdir) explicitly.
+
+       * libgettext.h (gettext_const): Rename to gettext_noop.
+
+Fri Nov  3 07:36:50 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (make_entry_rec):
+       Protect against wrong locale names by testing mask.
+
+       * libgettext.h (gettext_const): Add macro definition.
+       Capitalize macro arguments.
+
+Thu Nov  2 23:15:51 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (_nl_find_domain):
+       Test for pointer != NULL before accessing value.
+       Reported by Tom Tromey.
+
+       * gettext.c (NULL):
+       Define as (void*)0 instad of 0.  Reported by Franc,ois Pinard.
+
+Mon Oct 30 21:28:52 1995  Ulrich Drepper  <drepper@myware>
+
+       * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
+
+Sat Oct 28 23:20:47 1995  Ulrich Drepper  <drepper@myware>
+
+       * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
+
+       * localealias.c (alias_compare):
+       Peter Miller reported that tolower in some systems is
+       even dumber than I thought.  Protect call by `isupper'.
+
+Fri Oct 27 22:22:51 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (libdir, includedir): New variables.
+       (install-src): Install libintl.a and libintl.h in correct dirs.
+
+Fri Oct 27 22:07:29 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
+
+       * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
+
+       * localealias.c:
+       Fix typo and superflous test.  Reported by Christian von Roques.
+
+Fri Oct  6 11:52:05 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (_nl_find_domain):
+       Correct some remainder from the pre-CEN syntax.  Now
+       we don't have a constant number of successors anymore.
+
+Wed Sep 27 21:41:13 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (DISTFILES): Add libintl.h.glibc.
+
+       * Makefile.in (dist-libc): Add goal for packing sources for glibc.
+       (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
+
+       * loadmsgcat.c: Forget to continue #if line.
+
+       * localealias.c:
+       [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
+       space clean.
+
+       * dcgettext.c, finddomain.c: Better comment to last change.
+
+       * loadmsgcat.c:
+       [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
+       __fstat, __open, __close, __read, __mmap, and __munmap resp
+       to keep ANSI C name space clean.
+
+       * finddomain.c:
+       [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
+
+       * dcgettext.c:
+       [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
+       keep ANSI C name space clean.
+
+       * libgettext.h:
+       Include sys/types.h for those old SysV systems out there.
+       Reported by Francesco Potorti`.
+
+       * loadmsgcat.c (use_mmap): Define if compiled for glibc.
+
+       * bindtextdom.c: Include all those standard headers
+       unconditionally if _LIBC is defined.
+
+       * finddomain.c: Fix 2 times defiend -> defined.
+
+       * textdomain.c: Include libintl.h instead of libgettext.h when
+       compiling for glibc.  Include all those standard headers
+       unconditionally if _LIBC is defined.
+
+       * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
+
+       * gettext.c:
+       Include libintl.h instead of libgettext.h when compiling for glibc.
+       Get NULL from stddef.h if we compile for glibc.
+
+       * finddomain.c: Include libintl.h instead of libgettext.h when
+       compiling for glibc.  Include all those standard headers
+       unconditionally if _LIBC is defined.
+
+       * dcgettext.c: Include all those standard headers unconditionally
+       if _LIBC is defined.
+
+       * dgettext.c: If compiled in glibc include libintl.h instead of
+       libgettext.h.
+       (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
+
+       * dcgettext.c: If compiled in glibc include libintl.h instead of
+       libgettext.h.
+       (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
+
+       * bindtextdom.c:
+       If compiled in glibc include libintl.h instead of libgettext.h.
+
+Mon Sep 25 22:23:06 1995  Ulrich Drepper  <drepper@myware>
+
+       * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
+       Reported by Marcus Daniels.
+
+       * cat-compat.c (bindtextdomain):
+       String used in putenv must not be recycled.
+       Reported by Marcus Daniels.
+
+       * libgettext.h (__USE_GNU_GETTEXT):
+       Additional symbol to signal that we use GNU gettext
+       library.
+
+       * cat-compat.c (bindtextdomain):
+       Fix bug with the strange stpcpy replacement.
+       Reported by Nelson Beebe.
+
+Sat Sep 23 08:23:51 1995  Ulrich Drepper  <drepper@myware>
+
+       * cat-compat.c: Include <string.h> for stpcpy prototype.
+
+       * localealias.c (read_alias_file):
+       While expand strdup code temporary variable `cp' hided
+       higher level variable with same name.  Rename to `tp'.
+
+       * textdomain.c (textdomain):
+       Avoid warning by using temporary variable in strdup code.
+
+       * finddomain.c (_nl_find_domain): Remove unused variable `application'.
+
+Thu Sep 21 15:51:44 1995  Ulrich Drepper  <drepper@myware>
+
+       * localealias.c (alias_compare):
+       Use strcasecmp() only if available.  Else use
+       implementation in place.
+
+       * intl-compat.c:
+       Wrapper functions now call *__ functions instead of __*.
+
+       * libgettext.h: Declare prototypes for *__ functions instead for __*.
+
+       * cat-compat.c, loadmsgcat.c:
+       Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+       of the standard libc and so prevent libintl.a from being used
+       standalone.
+
+       * bindtextdom.c:
+       Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+       of the standard libc and so prevent libintl.a from being used
+       standalone.
+       Rename to bindtextdomain__ if not used in GNU C Library.
+
+       * dgettext.c:
+       Rename function to dgettext__ if not used in GNU C Library.
+
+       * gettext.c:
+       Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+       of the standard libc and so prevent libintl.a from being used
+       standalone.
+       Functions now called gettext__ if not used in GNU C Library.
+
+       * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
+       Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+       of the standard libc and so prevent libintl.a from being used
+       standalone.
+
+Sun Sep 17 23:14:49 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c: Correct some bugs in handling of CEN standard
+       locale definitions.
+
+Thu Sep  7 01:49:28 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c: Implement CEN syntax.
+
+       * gettextP.h (loaded_domain): Extend number of successors to 31.
+
+Sat Aug 19 19:25:29 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (aliaspath): Remove path to X11 locale dir.
+
+       * Makefile.in: Make install-src depend on install.  This helps
+       gettext to install the sources and other packages can use the
+       install goal.
+
+Sat Aug 19 15:19:33 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (uninstall): Remove stuff installed by install-src.
+
+Tue Aug 15 13:13:53 1995  Ulrich Drepper  <drepper@myware>
+
+       * VERSION.in: Initial revision.
+
+       * Makefile.in (DISTFILES):
+       Add VERSION file.  This is not necessary for gettext, but
+       for other packages using this library.
+
+Tue Aug 15 06:16:44 1995  Ulrich Drepper  <drepper@myware>
+
+       * gettextP.h (_nl_find_domain):
+       New prototype after changing search strategy.
+
+       * finddomain.c (_nl_find_domain):
+       We now try only to find a specified catalog.  Fall back to other
+       catalogs listed in the locale list is now done in __dcgettext.
+
+       * dcgettext.c (__dcgettext):
+       Now we provide message fall back even to different languages.
+       I.e. if a message is not available in one language all the other
+       in the locale list a tried.  Formerly fall back was only possible
+       within one language.  Implemented by moving one loop from
+       _nl_find_domain to here.
+
+Mon Aug 14 23:45:50 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (gettextsrcdir):
+       Directory where source of GNU gettext library are made
+       available.
+       (INSTALL, INSTALL_DATA): Programs used for installing sources.
+       (gettext-src): New.  Rule to install GNU gettext sources for use in
+       gettextize shell script.
+
+Sun Aug 13 14:40:48 1995  Ulrich Drepper  <drepper@myware>
+
+       * loadmsgcat.c (_nl_load_domain):
+       Use mmap for loading only when munmap function is
+       also available.
+
+       * Makefile.in (install): Depend on `all' goal.
+
+Wed Aug  9 11:04:33 1995  Ulrich Drepper  <drepper@myware>
+
+       * localealias.c (read_alias_file):
+       Do not overwrite '\n' when terminating alias value string.
+
+       * localealias.c (read_alias_file):
+       Handle long lines.  Ignore the rest not fitting in
+       the buffer after the initial `fgets' call.
+
+Wed Aug  9 00:54:29 1995  Ulrich Drepper  <drepper@myware>
+
+       * gettextP.h (_nl_load_domain):
+       Add prototype, replacing prototype for _nl_load_msg_cat.
+
+       * finddomain.c (_nl_find_domain):
+       Remove unneeded variable filename and filename_len.
+       (expand_alias): Remove prototype because functions does not
+       exist anymore.
+
+       * localealias.c (read_alias_file):
+       Change type of fname_len parameter to int.
+       (xmalloc): Add prototype.
+
+       * loadmsgcat.c: Better prototypes for xmalloc.
+
+Tue Aug  8 22:30:39 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (_nl_find_domain):
+       Allow alias name to be constructed from the four components.
+
+       * Makefile.in (aliaspath): New variable.  Set to preliminary value.
+       (SOURCES): Add localealias.c.
+       (OBJECTS): Add localealias.o.
+
+       * gettextP.h: Add prototype for _nl_expand_alias.
+
+       * finddomain.c: Aliasing handled in intl/localealias.c.
+
+       * localealias.c: Aliasing for locale names.
+
+       * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
+
+Mon Aug  7 23:47:42 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
+
+       * cat-compat.c (bindtextdomain):
+       Correct implementation.  dirname parameter was not used.
+       Reported by Marcus Daniels.
+
+       * gettextP.h (loaded_domain):
+       New fields `successor' and `decided' for oo, lazy
+       message handling implementation.
+
+       * dcgettext.c:
+       Adopt for oo, lazy message handliing.
+       Now we can inherit translations from less specific locales.
+       (find_msg): New function.
+
+       * loadmsgcat.c, finddomain.c:
+       Complete rewrite.  Implement oo, lazy message handling :-).
+       We now have an additional environment variable `LANGUAGE' with
+       a higher priority than LC_ALL for the LC_MESSAGE locale.
+       Here we can set a colon separated list of specifications each
+       of the form `language[_territory[.codeset]][@modifier]'.
+
+Sat Aug  5 09:55:42 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (unistd.h):
+       Include to get _PC_PATH_MAX defined on system having it.
+
+Fri Aug  4 22:42:00 1995  Ulrich Drepper  <drepper@myware>
+
+       * finddomain.c (stpcpy): Include prototype.
+
+       * Makefile.in (dist): Remove `copying instead' message.
+
+Wed Aug  2 18:52:03 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (ID, TAGS): Do not use $^.
+
+Tue Aug  1 20:07:11 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (TAGS, ID): Use $^ as command argument.
+       (TAGS): Give etags -o option t write to current directory,
+       not $(srcdir).
+       (ID): Use $(srcdir) instead os $(top_srcdir)/src.
+       (distclean): Remove ID.
+
+Sun Jul 30 11:51:46 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (gnulocaledir):
+       New variable, always using share/ for data directory.
+       (DEFS): Add GNULOCALEDIR, used in finddomain.c.
+
+       * finddomain.c (_nl_default_dirname):
+       Set to GNULOCALEDIR, because it always has to point
+       to the directory where GNU gettext Library writes it to.
+
+       * intl-compat.c (textdomain, bindtextdomain):
+       Undefine macros before function definition.
+
+Sat Jul 22 01:10:02 1995  Ulrich Drepper  <drepper@myware>
+
+       * libgettext.h (_LIBINTL_H):
+       Protect definition in case where this file is included as
+       libgettext.h on Solaris machines.  Add comment about this.
+
+Wed Jul 19 02:36:42 1995  Ulrich Drepper  <drepper@myware>
+
+       * intl-compat.c (textdomain): Correct typo.
+
+Wed Jul 19 01:51:35 1995  Ulrich Drepper  <drepper@myware>
+
+       * dcgettext.c (dcgettext): Function now called __dcgettext.
+
+       * dgettext.c (dgettext): Now called __dgettext and calls
+       __dcgettext.
+
+       * gettext.c (gettext):
+       Function now called __gettext and calls __dgettext.
+
+       * textdomain.c (textdomain): Function now called __textdomain.
+
+       * bindtextdom.c (bindtextdomain): Function now called
+       __bindtextdomain.
+
+       * intl-compat.c: Initial revision.
+
+       * Makefile.in (SOURCES): Add intl-compat.c.
+       (OBJECTS): We always compile the GNU gettext library functions.
+       OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
+       and intl-compat.o.
+       (GETTOBJS): Contains now only intl-compat.o.
+
+       * libgettext.h:
+       Re-include protection matches dualistic character of libgettext.h.
+       For all functions in GNU gettext library define __ counter part.
+
+       * finddomain.c (strchr): Define as index if not found in C library.
+       (_nl_find_domain): For relative paths paste / in between.
+
+Tue Jul 18 16:37:45 1995  Ulrich Drepper  <drepper@myware>
+
+       * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
+
+       * xopen-msg.sed: Fix bug with `msgstr ""' lines.
+       A little bit better comments.
+
+Tue Jul 18 01:18:27 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in:
+       po-mode.el, makelinks, combine-sh are now found in ../misc.
+
+       * po-mode.el, makelinks, combine-sh, elisp-comp:
+       Moved to ../misc/.
+
+       * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
+
+Sun Jul 16 22:33:02 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (INSTALL, INSTALL_DATA): New variables.
+       (install-data, uninstall): Install/uninstall .elc file.
+
+       * po-mode.el (Installation comment):
+       Add .pox as possible extension of .po files.
+
+Sun Jul 16 13:23:27 1995  Ulrich Drepper  <drepper@myware>
+
+       * elisp-comp: Complete new version by Franc,ois: This does not
+       fail when not compiling in the source directory.
+
+Sun Jul 16 00:12:17 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (../po/cat-id-tbl.o):
+       Use $(MAKE) instead of make for recursive make.
+
+       * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
+       (install-exec): Add missing dummy goal.
+       (install-data, uninstall): @ in multi-line shell command at
+       beginning, not in front of echo.  Reported by Eric Backus.
+
+Sat Jul 15 00:21:28 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (DISTFILES):
+       Rename libgettext.perl to gettext.perl to fit in 14 chars
+       file systems.
+
+       * gettext.perl:
+       Rename to gettext.perl to fit in 14 chars file systems.
+
+Thu Jul 13 23:17:20 1995  Ulrich Drepper  <drepper@myware>
+
+       * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
+
+Thu Jul 13 20:55:02 1995  Ulrich Drepper  <drepper@myware>
+
+       * po2tbl.sed.in: Pretty printing.
+
+       * linux-msg.sed, xopen-msg.sed:
+       Correct bugs with handling substitute flags in branches.
+
+       * hash-string.h (hash_string):
+       Old K&R compilers don't under stand `unsigned char'.
+
+       * gettext.h (nls_uint32):
+       Some old K&R compilers (eg HP) don't understand `unsigned int'.
+
+       * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
+
+Thu Jul 13 01:34:33 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (ELCFILES): New variable.
+       (DISTFILES): Add elisp-comp.
+       Add implicit rule for .el -> .elc compilation.
+       (install-data): install $ELCFILES
+       (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
+
+       * elisp-comp: Initial revision
+
+Wed Jul 12 16:14:52 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in:
+       cat-id-tbl.c is now found in po/.  This enables us to use an identical
+       intl/ directory in all packages.
+
+       * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
+
+       * textdomain.c: fix typo (#if def -> #if defined)
+
+Tue Jul 11 18:44:43 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in (stamp-cat-id): use top_srcdir to address source files
+       (DISTFILES,distclean): move tupdate.perl to src/
+
+       * po-to-tbl.sed.in:
+       add additional jump to clear change flag to recognize multiline strings
+
+Tue Jul 11 01:32:50 1995  Ulrich Drepper  <drepper@myware>
+
+       * textdomain.c: Protect inclusion of stdlib.h and string.h.
+
+       * loadmsgcat.c: Protect inclusion of stdlib.h.
+
+       * libgettext.h: Protect inclusion of locale.h.
+       Allow use in C++ programs.
+       Define NULL is not happened already.
+
+       * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
+       po-to-tbl.sed.
+       (distclean): remove po-to-tbl.sed and tupdate.perl.
+
+       * tupdate.perl.in: Substitute Perl path even in exec line.
+       Don't include entries without translation from old .po file.
+
+Tue Jul  4 00:41:51 1995  Ulrich Drepper  <drepper@myware>
+
+       * tupdate.perl.in: use "Updated: " in msgid "".
+
+       * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
+       Define getenv if !__STDC__.
+
+       * bindtextdom.c: Protect stdlib.h and string.h inclusion.
+       Define free if !__STDC__.
+
+       * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+       Define free if !__STDC__.
+
+       * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+
+Mon Jul  3 23:56:30 1995  Ulrich Drepper  <drepper@myware>
+
+       * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
+       Remove unneeded $(srcdir) from Makefile.in dependency.
+
+       * makelinks: Add copyright and short description.
+
+       * po-mode.el: Last version for 0.7.
+
+       * tupdate.perl.in: Fix die message.
+
+       * dcgettext.c: Protect include of string.h.
+
+       * gettext.c: Protect include of stdlib.h and further tries to get NULL.
+
+       * finddomain.c: Some corrections in includes.
+
+       * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
+
+       * po-to-tbl.sed: Adopt for new .po file format.
+
+       * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
+
+Sun Jul  2 23:55:03 1995  Ulrich Drepper  <drepper@myware>
+
+       * tupdate.perl.in: Complete rewrite for new .po file format.
+
+Sun Jul  2 02:06:50 1995  Ulrich Drepper  <drepper@myware>
+
+       * First official release.  This directory contains all the code
+       needed to internationalize own packages.  It provides functions
+       which allow to use the X/Open catgets function with an interface
+       like the Uniforum gettext function.  For system which does not
+       have neither of those a complete implementation is provided.
diff --git a/intl/Makefile.in b/intl/Makefile.in
new file mode 100644 (file)
index 0000000..09647de
--- /dev/null
@@ -0,0 +1,214 @@
+# Makefile for directory with message catalog handling in GNU NLS Utilities.
+# Copyright (C) 1995, 1996, 1997, 1998 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, 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 = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+transform = @program_transform_name@
+libdir = $(exec_prefix)/lib
+includedir = $(prefix)/include
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = @datadir@/gettext/intl
+aliaspath = $(localedir):.
+subdir = intl
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+l = @l@
+
+AR = ar
+CC = @CC@
+LIBTOOL = @LIBTOOL@
+RANLIB = @RANLIB@
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
+-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+COMHDRS = gettext.h gettextP.h hash-string.h
+SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+explodename.c
+OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+explodename.$lo
+CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
+GETTOBJS = intl-compat.$lo
+DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
+xopen-msg.sed $(HEADERS) $(SOURCES)
+DISTFILES.normal = VERSION
+DISTFILES.gettext = libintl.glibc intlh.inst.in
+
+.SUFFIXES:
+.SUFFIXES: .c .o .lo
+.c.o:
+       $(COMPILE) $<
+.c.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) $<
+
+INCLUDES = -I. -I$(srcdir)
+
+all: all-@USE_INCLUDED_LIBINTL@
+
+all-yes: libintl.$la intlh.inst
+all-no:
+install-info:
+
+libintl.a: $(OBJECTS)
+       rm -f $@
+       $(AR) cru $@ $(OBJECTS)
+       $(RANLIB) $@
+
+libintl.la: $(OBJECTS)
+       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
+                  -version-info 1:0 -rpath $(libdir)
+
+../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
+       cd ../po && $(MAKE) cat-id-tbl.$lo
+
+check: all
+
+# This installation goal is only used in GNU gettext.  Packages which
+# only use the library should use install instead.
+
+# We must not install the libintl.h/libintl.a files if we are on a
+# system which has the gettext() function in its C library or in a
+# separate library or use the catgets interface.  A special case is
+# where configure found a previously installed GNU gettext library.
+# If you want to use the one which comes with this version of the
+# package, you have to use `configure --with-included-gettext'.
+install: install-exec install-data
+install-exec: all
+       if test "$(PACKAGE)" = "gettext" \
+          && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
+         if test -r $(MKINSTALLDIRS); then \
+           $(MKINSTALLDIRS) $(libdir) $(includedir); \
+         else \
+           $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
+         fi; \
+         $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
+         $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+       else \
+         : ; \
+       fi
+install-data: all
+       if test "$(PACKAGE)" = "gettext"; then \
+         if test -r $(MKINSTALLDIRS); then \
+           $(MKINSTALLDIRS) $(gettextsrcdir); \
+         else \
+           $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+         fi; \
+         $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
+         dists="$(DISTFILES.common)"; \
+         for file in $$dists; do \
+           $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
+         done; \
+       else \
+         : ; \
+       fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+       dists="$(DISTFILES.common)"; \
+       for file in $$dists; do \
+         rm -f $(gettextsrcdir)/$$file; \
+       done
+
+info dvi:
+
+$(OBJECTS): config.h libgettext.h
+bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
+dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
+
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES)
+       here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+
+id: ID
+
+ID: $(HEADERS) $(SOURCES)
+       here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
+
+
+mostlyclean:
+       rm -f *.a *.o *.lo core core.*
+
+clean: mostlyclean
+
+distclean: clean
+       rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h config.log
+
+maintainer-clean: distclean
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+
+
+# GNU gettext needs not contain the file `VERSION' but contains some
+# other files which should not be distributed in other packages.
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: Makefile $(DISTFILES)
+       if test "$(PACKAGE)" = gettext; then \
+         additional="$(DISTFILES.gettext)"; \
+       else \
+         additional="$(DISTFILES.normal)"; \
+       fi; \
+       for file in $(DISTFILES.common) $$additional; do \
+         ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+           || cp -p $(srcdir)/$$file $(distdir); \
+       done
+
+dist-libc:
+       tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
+
+Makefile: Makefile.in config.status
+       CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# The dependency for intlh.inst is different in gettext and all other
+# packages.  Because we cannot you GNU make features we have to solve
+# the problem while rewriting Makefile.in.
+@GT_YES@intlh.inst: intlh.inst.in ../config.status
+@GT_YES@       cd .. \
+@GT_YES@       && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+@GT_YES@         $(SHELL) ./config.status
+@GT_NO@.PHONY: intlh.inst
+@GT_NO@intlh.inst:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/intl/acconfig.h b/intl/acconfig.h
new file mode 100644 (file)
index 0000000..70f81f8
--- /dev/null
@@ -0,0 +1,14 @@
+/* Define to 1 if NLS is requested.  */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext.  */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
+#undef HAVE_GETTEXT
+
+/* Define as 1 if you have the stpcpy function.  */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES.  */
+#undef HAVE_LC_MESSAGES
diff --git a/intl/aclocal.m4 b/intl/aclocal.m4
new file mode 100644 (file)
index 0000000..225439f
--- /dev/null
@@ -0,0 +1,387 @@
+dnl aclocal.m4 generated automatically by aclocal 1.3
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated.  We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+  case " <<$>>CONFIG_HEADERS " in
+  *" <<$>>am_file "*<<)>>
+    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+    ;;
+  esac
+  am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+# This file is derived from `gettext.m4'.  The difference is that the
+# included macros assume Cygnus-style source and build trees.
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+AC_DEFUN(CY_WITH_NLS,
+  [AC_MSG_CHECKING([whether NLS is requested])
+    dnl Default is enabled NLS
+    AC_ARG_ENABLE(nls,
+      [  --disable-nls           do not use Native Language Support],
+      USE_NLS=$enableval, USE_NLS=yes)
+    AC_MSG_RESULT($USE_NLS)
+    AC_SUBST(USE_NLS)
+
+    USE_INCLUDED_LIBINTL=no
+
+    dnl If we use NLS figure out what method
+    if test "$USE_NLS" = "yes"; then
+      AC_DEFINE(ENABLE_NLS)
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH(included-gettext,
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If gettext or catgets are available (in this order) we
+        dnl use this.  Else we have to fall back to GNU NLS library.
+       dnl catgets is only used if permitted by option --with-catgets.
+       nls_cv_header_intl=
+       nls_cv_header_libgt=
+       CATOBJEXT=NONE
+
+       AC_CHECK_HEADER(libintl.h,
+         [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+           [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+              gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+          if test "$gt_cv_func_gettext_libc" != "yes"; then
+            AC_CHECK_LIB(intl, bindtextdomain,
+              [AC_CACHE_CHECK([for gettext in libintl],
+                gt_cv_func_gettext_libintl,
+                [AC_TRY_LINK([], [return (int) gettext ("")],
+                gt_cv_func_gettext_libintl=yes,
+                gt_cv_func_gettext_libintl=no)])])
+          fi
+
+          if test "$gt_cv_func_gettext_libc" = "yes" \
+             || test "$gt_cv_func_gettext_libintl" = "yes"; then
+             AC_DEFINE(HAVE_GETTEXT)
+             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+             if test "$MSGFMT" != "no"; then
+               AC_CHECK_FUNCS(dcgettext)
+               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+               AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+               AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+                              return _nl_msg_cat_cntr],
+                 [CATOBJEXT=.gmo
+                  DATADIRNAME=share],
+                 [CATOBJEXT=.mo
+                  DATADIRNAME=lib])
+               INSTOBJEXT=.mo
+             fi
+           fi
+       ])
+
+       dnl In the standard gettext, we would now check for catgets.
+        dnl However, we never want to use catgets for our releases.
+
+        if test "$CATOBJEXT" = "NONE"; then
+         dnl Neither gettext nor catgets in included in the C library.
+         dnl Fall back on GNU gettext library.
+         nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        INTLOBJS="\$(GETTOBJS)"
+        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+        AC_SUBST(MSGFMT)
+       USE_INCLUDED_LIBINTL=yes
+        CATOBJEXT=.gmo
+        INSTOBJEXT=.mo
+        DATADIRNAME=share
+       INTLDEPS='$(top_builddir)/../intl/libintl.a'
+       INTLLIBS=$INTLDEPS
+       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+        nls_cv_header_intl=libintl.h
+        nls_cv_header_libgt=libgettext.h
+      fi
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+       dnl If it is no GNU xgettext we define it as : so that the
+       dnl Makefiles still can work.
+       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+         : ;
+       else
+         AC_MSG_RESULT(
+           [found xgettext programs is not GNU xgettext; ignore it])
+         XGETTEXT=":"
+       fi
+      fi
+
+      # We need to process the po/ directory.
+      POSUB=po
+    else
+      DATADIRNAME=share
+      nls_cv_header_intl=libintl.h
+      nls_cv_header_libgt=libgettext.h
+    fi
+
+    # If this is used in GNU gettext we have to set USE_NLS to `yes'
+    # because some of the sources are only built for this goal.
+    if test "$PACKAGE" = gettext; then
+      USE_NLS=yes
+      USE_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl These rules are solely for the distribution goal.  While doing this
+    dnl we only have to keep exactly one list of the available catalogs
+    dnl in configure.in.
+    for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(USE_INCLUDED_LIBINTL)
+    AC_SUBST(CATALOGS)
+    AC_SUBST(CATOBJEXT)
+    AC_SUBST(DATADIRNAME)
+    AC_SUBST(GMOFILES)
+    AC_SUBST(INSTOBJEXT)
+    AC_SUBST(INTLDEPS)
+    AC_SUBST(INTLLIBS)
+    AC_SUBST(INTLOBJS)
+    AC_SUBST(POFILES)
+    AC_SUBST(POSUB)
+  ])
+
+AC_DEFUN(CY_GNU_GETTEXT,
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_CC])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_ISC_POSIX])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_C_CONST])dnl
+   AC_REQUIRE([AC_C_INLINE])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   if test "${ac_cv_func_stpcpy+set}" != "set"; then
+     AC_CHECK_FUNCS(stpcpy)
+   fi
+   if test "${ac_cv_func_stpcpy}" = "yes"; then
+     AC_DEFINE(HAVE_STPCPY)
+   fi
+
+   AM_LC_MESSAGES
+   CY_WITH_NLS
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+   dnl The reference to <locale.h> in the installed <libintl.h> file
+   dnl must be resolved because we cannot expect the users of this
+   dnl to define HAVE_LOCALE_H.
+   if test $ac_cv_header_locale_h = yes; then
+     INCLUDE_LOCALE_H="#include <locale.h>"
+   else
+     INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>.  Take care yourself.  */"
+   fi
+   AC_SUBST(INCLUDE_LOCALE_H)
+
+   dnl Determine which catalog format we have (if any is needed)
+   dnl For now we know about two different formats:
+   dnl   Linux libc-5 and the normal X/Open format
+   if test -f $srcdir/po2tbl.sed.in; then
+      if test "$CATOBJEXT" = ".cat"; then
+        AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+        dnl Transform the SED scripts while copying because some dumb SEDs
+         dnl cannot handle comments.
+        sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+      fi
+      dnl po2tbl.sed is always needed.
+      sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+        $srcdir/po2tbl.sed.in > po2tbl.sed
+   fi
+
+   dnl In the intl/Makefile.in we have a special dependency which makes
+   dnl only sense for gettext.  We comment this out for non-gettext
+   dnl packages.
+   if test "$PACKAGE" = "gettext"; then
+     GT_NO="#NO#"
+     GT_YES=
+   else
+     GT_NO=
+     GT_YES="#YES#"
+   fi
+   AC_SUBST(GT_NO)
+   AC_SUBST(GT_YES)
+
+   MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+   AC_SUBST(MKINSTALLDIRS)
+
+   dnl *** For now the libtool support in intl/Makefile is not for real.
+   l=
+   AC_SUBST(l)
+
+   dnl Generate list of files to be processed by xgettext which will
+   dnl be included in po/Makefile.  But only do this if the po directory
+   dnl exists in srcdir.
+   if test -d $srcdir/po; then
+      test -d po || mkdir po
+      if test "x$srcdir" != "x."; then
+        if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+           posrcprefix="$srcdir/"
+        else
+           posrcprefix="../$srcdir/"
+        fi
+      else
+        posrcprefix="../"
+      fi
+      rm -f po/POTFILES
+      sed -e "/^#/d" -e "/^\$/d" -e "s,.*,     $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+        < $srcdir/po/POTFILES.in > po/POTFILES
+   fi
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+       ac_cv_path_$1="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES)
+    fi
+  fi])
+
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
new file mode 100644 (file)
index 0000000..d9c3f34
--- /dev/null
@@ -0,0 +1,203 @@
+/* Implementation of the bindtextdomain(3) function
+   Copyright (C) 1995, 1996, 1997, 1998 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+/* Contains the default location of the message catalogs.  */
+extern const char _nl_default_dirname[];
+
+/* List with bindings of specific domains.  */
+extern struct binding *_nl_domain_bindings;
+
+
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define BINDTEXTDOMAIN __bindtextdomain
+# ifndef strdup
+#  define strdup(str) __strdup (str)
+# endif
+#else
+# define BINDTEXTDOMAIN bindtextdomain__
+#endif
+
+/* Specify that the DOMAINNAME message catalog will be found
+   in DIRNAME rather than in the system locale data base.  */
+char *
+BINDTEXTDOMAIN (domainname, dirname)
+     const char *domainname;
+     const char *dirname;
+{
+  struct binding *binding;
+
+  /* Some sanity checks.  */
+  if (domainname == NULL || domainname[0] == '\0')
+    return NULL;
+
+  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+    {
+      int compare = strcmp (domainname, binding->domainname);
+      if (compare == 0)
+       /* We found it!  */
+       break;
+      if (compare < 0)
+       {
+         /* It is not in the list.  */
+         binding = NULL;
+         break;
+       }
+    }
+
+  if (dirname == NULL)
+    /* The current binding has be to returned.  */
+    return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+
+  if (binding != NULL)
+    {
+      /* The domain is already bound.  If the new value and the old
+        one are equal we simply do nothing.  Otherwise replace the
+        old binding.  */
+      if (strcmp (dirname, binding->dirname) != 0)
+       {
+         char *new_dirname;
+
+         if (strcmp (dirname, _nl_default_dirname) == 0)
+           new_dirname = (char *) _nl_default_dirname;
+         else
+           {
+#if defined _LIBC || defined HAVE_STRDUP
+             new_dirname = strdup (dirname);
+             if (new_dirname == NULL)
+               return NULL;
+#else
+             size_t len = strlen (dirname) + 1;
+             new_dirname = (char *) malloc (len);
+             if (new_dirname == NULL)
+               return NULL;
+
+             memcpy (new_dirname, dirname, len);
+#endif
+           }
+
+         if (binding->dirname != _nl_default_dirname)
+           free (binding->dirname);
+
+         binding->dirname = new_dirname;
+       }
+    }
+  else
+    {
+      /* We have to create a new binding.  */
+#if !defined _LIBC && !defined HAVE_STRDUP
+      size_t len;
+#endif
+      struct binding *new_binding =
+       (struct binding *) malloc (sizeof (*new_binding));
+
+      if (new_binding == NULL)
+       return NULL;
+
+#if defined _LIBC || defined HAVE_STRDUP
+      new_binding->domainname = strdup (domainname);
+      if (new_binding->domainname == NULL)
+       return NULL;
+#else
+      len = strlen (domainname) + 1;
+      new_binding->domainname = (char *) malloc (len);
+      if (new_binding->domainname == NULL)
+       return NULL;
+      memcpy (new_binding->domainname, domainname, len);
+#endif
+
+      if (strcmp (dirname, _nl_default_dirname) == 0)
+       new_binding->dirname = (char *) _nl_default_dirname;
+      else
+       {
+#if defined _LIBC || defined HAVE_STRDUP
+         new_binding->dirname = strdup (dirname);
+         if (new_binding->dirname == NULL)
+           return NULL;
+#else
+         len = strlen (dirname) + 1;
+         new_binding->dirname = (char *) malloc (len);
+         if (new_binding->dirname == NULL)
+           return NULL;
+         memcpy (new_binding->dirname, dirname, len);
+#endif
+       }
+
+      /* Now enqueue it.  */
+      if (_nl_domain_bindings == NULL
+         || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
+       {
+         new_binding->next = _nl_domain_bindings;
+         _nl_domain_bindings = new_binding;
+       }
+      else
+       {
+         binding = _nl_domain_bindings;
+         while (binding->next != NULL
+                && strcmp (domainname, binding->next->domainname) > 0)
+           binding = binding->next;
+
+         new_binding->next = binding->next;
+         binding->next = new_binding;
+       }
+
+      binding = new_binding;
+    }
+
+  return binding->dirname;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library.  */
+weak_alias (__bindtextdomain, bindtextdomain);
+#endif
diff --git a/intl/cat-compat.c b/intl/cat-compat.c
new file mode 100644 (file)
index 0000000..867d901
--- /dev/null
@@ -0,0 +1,262 @@
+/* Compatibility code for gettext-using-catgets interface.
+   Copyright (C) 1995, 1997 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# endif
+#endif
+
+#ifdef HAVE_NL_TYPES_H
+# include <nl_types.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+   ``Directs `setlocale()' to query `category' and return the current
+     setting of `local'.''
+   However it does not specify the exact format.  And even worse: POSIX
+   defines this not at all.  So we can use this feature only on selected
+   system (e.g. those using GNU C Library).  */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* The catalog descriptor.  */
+static nl_catd catalog = (nl_catd) -1;
+
+/* Name of the default catalog.  */
+static const char default_catalog_name[] = "messages";
+
+/* Name of currently used catalog.  */
+static const char *catalog_name = default_catalog_name;
+
+/* Get ID for given string.  If not found return -1.  */
+static int msg_to_cat_id PARAMS ((const char *msg));
+
+/* Substitution for systems lacking this function in their C library.  */
+#if !_LIBC && !HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+#endif
+
+
+/* Set currently used domain/catalog.  */
+char *
+textdomain (domainname)
+     const char *domainname;
+{
+  nl_catd new_catalog;
+  char *new_name;
+  size_t new_name_len;
+  char *lang;
+
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
+    && defined HAVE_LOCALE_NULL
+  lang = setlocale (LC_MESSAGES, NULL);
+#else
+  lang = getenv ("LC_ALL");
+  if (lang == NULL || lang[0] == '\0')
+    {
+      lang = getenv ("LC_MESSAGES");
+      if (lang == NULL || lang[0] == '\0')
+       lang = getenv ("LANG");
+    }
+#endif
+  if (lang == NULL || lang[0] == '\0')
+    lang = "C";
+
+  /* See whether name of currently used domain is asked.  */
+  if (domainname == NULL)
+    return (char *) catalog_name;
+
+  if (domainname[0] == '\0')
+    domainname = default_catalog_name;
+
+  /* Compute length of added path element.  */
+  new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
+                + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
+                + sizeof (".cat");
+
+  new_name = (char *) malloc (new_name_len);
+  if (new_name == NULL)
+    return NULL;
+
+  strcpy (new_name, PACKAGE);
+  new_catalog = catopen (new_name, 0);
+
+  if (new_catalog == (nl_catd) -1)
+    {
+      /* NLSPATH search didn't work, try absolute path */
+      sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
+              PACKAGE);
+      new_catalog = catopen (new_name, 0);
+
+      if (new_catalog == (nl_catd) -1)
+       {
+         free (new_name);
+         return (char *) catalog_name;
+       }
+    }
+
+  /* Close old catalog.  */
+  if (catalog != (nl_catd) -1)
+    catclose (catalog);
+  if (catalog_name != default_catalog_name)
+    free ((char *) catalog_name);
+
+  catalog = new_catalog;
+  catalog_name = new_name;
+
+  return (char *) catalog_name;
+}
+
+char *
+bindtextdomain (domainname, dirname)
+     const char *domainname;
+     const char *dirname;
+{
+#if HAVE_SETENV || HAVE_PUTENV
+  char *old_val, *new_val, *cp;
+  size_t new_val_len;
+
+  /* This does not make much sense here but to be compatible do it.  */
+  if (domainname == NULL)
+    return NULL;
+
+  /* Compute length of added path element.  If we use setenv we don't need
+     the first byts for NLSPATH=, but why complicate the code for this
+     peanuts.  */
+  new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
+               + sizeof ("/%L/LC_MESSAGES/%N.cat");
+
+  old_val = getenv ("NLSPATH");
+  if (old_val == NULL || old_val[0] == '\0')
+    {
+      old_val = NULL;
+      new_val_len += 1 + sizeof (LOCALEDIR) - 1
+                    + sizeof ("/%L/LC_MESSAGES/%N.cat");
+    }
+  else
+    new_val_len += strlen (old_val);
+
+  new_val = (char *) malloc (new_val_len);
+  if (new_val == NULL)
+    return NULL;
+
+# if HAVE_SETENV
+  cp = new_val;
+# else
+  cp = stpcpy (new_val, "NLSPATH=");
+# endif
+
+  cp = stpcpy (cp, dirname);
+  cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
+
+  if (old_val == NULL)
+    {
+# if __STDC__
+      stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
+# else
+
+      cp = stpcpy (cp, LOCALEDIR);
+      stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
+# endif
+    }
+  else
+    stpcpy (cp, old_val);
+
+# if HAVE_SETENV
+  setenv ("NLSPATH", new_val, 1);
+  free (new_val);
+# else
+  putenv (new_val);
+  /* Do *not* free the environment entry we just entered.  It is used
+     from now on.   */
+# endif
+
+#endif
+
+  return (char *) domainname;
+}
+
+#undef gettext
+char *
+gettext (msg)
+     const char *msg;
+{
+  int msgid;
+
+  if (msg == NULL || catalog == (nl_catd) -1)
+    return (char *) msg;
+
+  /* Get the message from the catalog.  We always use set number 1.
+     The message ID is computed by the function `msg_to_cat_id'
+     which works on the table generated by `po-to-tbl'.  */
+  msgid = msg_to_cat_id (msg);
+  if (msgid == -1)
+    return (char *) msg;
+
+  return catgets (catalog, 1, msgid, (char *) msg);
+}
+
+/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
+   for the one equal to msg.  If it is found return the ID.  In case when
+   the string is not found return -1.  */
+static int
+msg_to_cat_id (msg)
+     const char *msg;
+{
+  int cnt;
+
+  for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
+    if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
+      return _msg_tbl[cnt]._msg_number;
+
+  return -1;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library.  So we
+   avoid the non-standard function stpcpy.  In GNU C Library this
+   function is available, though.  Also allow the symbol HAVE_STPCPY
+   to be defined.  */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+     char *dest;
+     const char *src;
+{
+  while ((*dest++ = *src++) != '\0')
+    /* Do nothing. */ ;
+  return dest - 1;
+}
+#endif
diff --git a/intl/config.in b/intl/config.in
new file mode 100644 (file)
index 0000000..8a9049b
--- /dev/null
@@ -0,0 +1,128 @@
+/* config.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define if using alloca.c.  */
+#undef C_ALLOCA
+
+/* Define to empty if the keyword does not work.  */
+#undef const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+   This function is required for alloca.c support on those systems.  */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro.  */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have a working `mmap' system call.  */
+#undef HAVE_MMAP
+
+/* Define as __inline if that's what the C compiler calls it.  */
+#undef inline
+
+/* Define to `long' if <sys/types.h> doesn't define.  */
+#undef off_t
+
+/* Define if you need to in order for stat and other things to work.  */
+#undef _POSIX_SOURCE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define to 1 if NLS is requested.  */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext.  */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
+#undef HAVE_GETTEXT
+
+/* Define as 1 if you have the stpcpy function.  */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES.  */
+#undef HAVE_LC_MESSAGES
+
+/* Define if you have the __argz_count function.  */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the __argz_next function.  */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the __argz_stringify function.  */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if you have the dcgettext function.  */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the getcwd function.  */
+#undef HAVE_GETCWD
+
+/* Define if you have the getpagesize function.  */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the munmap function.  */
+#undef HAVE_MUNMAP
+
+/* Define if you have the putenv function.  */
+#undef HAVE_PUTENV
+
+/* Define if you have the setenv function.  */
+#undef HAVE_SETENV
+
+/* Define if you have the setlocale function.  */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the stpcpy function.  */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function.  */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function.  */
+#undef HAVE_STRCHR
+
+/* Define if you have the <argz.h> header file.  */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the <limits.h> header file.  */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file.  */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file.  */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <nl_types.h> header file.  */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the <string.h> header file.  */
+#undef HAVE_STRING_H
+
+/* Define if you have the <sys/param.h> header file.  */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <unistd.h> header file.  */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <values.h> header file.  */
+#undef HAVE_VALUES_H
+
+/* Define if you have the i library (-li).  */
+#undef HAVE_LIBI
diff --git a/intl/configure b/intl/configure
new file mode 100755 (executable)
index 0000000..341eea0
--- /dev/null
@@ -0,0 +1,2950 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --disable-nls           do not use Native Language Support"
+ac_help="$ac_help
+  --with-included-gettext use the GNU gettext library included here"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.12.1"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=dgettext.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+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"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# 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:562: 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
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:616: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 631 "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:637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 648 "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:654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:677: 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
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# 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:706: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # 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:735: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  ac_prog_rejected=no
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:783: 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.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 793 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { 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:817: 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:822: 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
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:831: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:846: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:876: 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
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:903: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+  echo "$ac_t""yes" 1>&6
+  ISC=yes # If later tests want to check for ISC.
+  cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  if test "$GCC" = yes; then
+    CC="$CC -posix"
+  else
+    CC="$CC -Xp"
+  fi
+else
+  echo "$ac_t""no" 1>&6
+  ISC=
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:924: 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 929 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+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 954 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+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 972 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 993 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1028: 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 1033 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this.  */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this.  */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this.  */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+   It does not let you subtract one const X* pointer from another in an arm
+   of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this.  */
+  char *t;
+  char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+  *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  int x[] = {25, 17};
+  const int *foo = &x[0];
+  ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  typedef const int *iptr;
+  iptr p = 0;
+  ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+  struct s { int j; const int *ap[3]; };
+  struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_const=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1103: 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 1110 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:1117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_inline=$ac_kw; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+  inline | yes) ;;
+  no) cat >> confdefs.h <<\EOF
+#define inline 
+EOF
+ ;;
+  *)  cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:1143: 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 1148 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_off_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+  cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1176: 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 1181 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+  cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+# 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:1211: 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 1216 "configure"
+#include "confdefs.h"
+#include <alloca.h>
+int main() {
+char *p = alloca(2 * sizeof(int));
+; return 0; }
+EOF
+if { (eval echo configure:1223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ac_cv_header_alloca_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_alloca_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for alloca""... $ac_c" 1>&6
+echo "configure:1244: 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 1249 "configure"
+#include "confdefs.h"
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#   endif
+#  endif
+# endif
+#endif
+
+int main() {
+char *p = (char *) alloca(1);
+; return 0; }
+EOF
+if { (eval echo configure:1272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ac_cv_func_alloca_works=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_func_alloca_works=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA 1
+EOF
+
+fi
+
+if test $ac_cv_func_alloca_works = no; then
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+  # that cause trouble.  Some versions do not even contain alloca or
+  # contain a buggy version.  If you still want to use their alloca,
+  # use ar to extract alloca.o from them instead of compiling alloca.c.
+  ALLOCA=alloca.o
+  cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
+EOF
+
+
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:1304: 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 1309 "configure"
+#include "confdefs.h"
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "webecray" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_os_cray=yes
+else
+  rm -rf conftest*
+  ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+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:1334: 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 1339 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<EOF
+#define CRAY_STACKSEG_END $ac_func
+EOF
+
+  break
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+done
+fi
+
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:1389: 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
+  if test "$cross_compiling" = yes; then
+  ac_cv_c_stack_direction=0
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1397 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+  static char *addr = 0;
+  auto char dummy;
+  if (addr == 0)
+    {
+      addr = &dummy;
+      return find_stack_direction ();
+    }
+  else
+    return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+  exit (find_stack_direction() < 0);
+}
+EOF
+if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_c_stack_direction=1
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
+
+fi
+
+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:1441: 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 1446 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1480: 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 1485 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:1533: 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
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1541 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the filesystem buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propogated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* 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
+#  define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+       char *data, *data2, *data3;
+       int i, pagesize;
+       int fd;
+
+       pagesize = getpagesize();
+
+       /*
+        * First, make a file with some known garbage in it.
+        */
+       data = malloc(pagesize);
+       if (!data)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               *(data + i) = rand();
+       umask(0);
+       fd = creat("conftestmmap", 0600);
+       if (fd < 0)
+               exit(1);
+       if (write(fd, data, pagesize) != pagesize)
+               exit(1);
+       close(fd);
+
+       /*
+        * Next, try to mmap the file at a fixed address which
+        * already has something else allocated at it.  If we can,
+        * also make sure that we see the same garbage.
+        */
+       fd = open("conftestmmap", O_RDWR);
+       if (fd < 0)
+               exit(1);
+       data2 = malloc(2 * pagesize);
+       if (!data2)
+               exit(1);
+       data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+       if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+           MAP_PRIVATE | MAP_FIXED, fd, 0L))
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data2 + i))
+                       exit(1);
+
+       /*
+        * Finally, make sure that changes to the mapped area
+        * do not percolate back to the file as seen by read().
+        * (This is a bug on some variants of i386 svr4.0.)
+        */
+       for (i = 0; i < pagesize; ++i)
+               *(data2 + i) = *(data2 + i) + 1;
+       data3 = malloc(pagesize);
+       if (!data3)
+               exit(1);
+       if (read(fd, data3, pagesize) != pagesize)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data3 + i))
+                       exit(1);
+       close(fd);
+       unlink("conftestmmap");
+       exit(0);
+}
+
+EOF
+if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+                              
+   for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1709: 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 1714 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+   for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1749: 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 1754 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+   if test "${ac_cv_func_stpcpy+set}" != "set"; then
+     for ac_func in stpcpy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1806: 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 1811 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+   fi
+   if test "${ac_cv_func_stpcpy}" = "yes"; then
+     cat >> confdefs.h <<\EOF
+#define HAVE_STPCPY 1
+EOF
+
+   fi
+
+   if test $ac_cv_header_locale_h = yes; then
+    echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
+echo "configure:1868: 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 1873 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int main() {
+return LC_MESSAGES
+; return 0; }
+EOF
+if { (eval echo configure:1880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  am_cv_val_LC_MESSAGES=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      cat >> confdefs.h <<\EOF
+#define HAVE_LC_MESSAGES 1
+EOF
+
+    fi
+  fi
+   echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
+echo "configure:1901: 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"
+  USE_NLS=$enableval
+else
+  USE_NLS=yes
+fi
+
+    echo "$ac_t""$USE_NLS" 1>&6
+    
+
+    USE_INCLUDED_LIBINTL=no
+
+        if test "$USE_NLS" = "yes"; then
+      cat >> confdefs.h <<\EOF
+#define ENABLE_NLS 1
+EOF
+
+      echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
+echo "configure:1921: 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"
+  nls_cv_force_use_gnu_gettext=$withval
+else
+  nls_cv_force_use_gnu_gettext=no
+fi
+
+      echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+                                       nls_cv_header_intl=
+       nls_cv_header_libgt=
+       CATOBJEXT=NONE
+
+       ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
+echo "configure:1940: 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 1945 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+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:1967: 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 1972 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  gt_cv_func_gettext_libc=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  gt_cv_func_gettext_libc=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+
+          if test "$gt_cv_func_gettext_libc" != "yes"; then
+            echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
+echo "configure:1995: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lintl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2003 "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 bindtextdomain();
+
+int main() {
+bindtextdomain()
+; return 0; }
+EOF
+if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+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:2030: 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 2035 "configure"
+#include "confdefs.h"
+
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:2042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  gt_cv_func_gettext_libintl=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  gt_cv_func_gettext_libintl=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+          fi
+
+          if test "$gt_cv_func_gettext_libc" = "yes" \
+             || test "$gt_cv_func_gettext_libintl" = "yes"; then
+             cat >> confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+             # 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:2070: 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
+  case "$MSGFMT" in
+  /*)
+  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+       ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
+  ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+  echo "$ac_t""$MSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+             if test "$MSGFMT" != "no"; then
+               for ac_func in dcgettext
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2104: 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 2109 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+               # 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:2159: 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
+  case "$GMSGFMT" in
+  /*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+  echo "$ac_t""$GMSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               # 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:2194: 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
+  case "$XGETTEXT" in
+  /*)
+  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+       ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+  ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+  echo "$ac_t""$XGETTEXT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               cat > conftest.$ac_ext <<EOF
+#line 2226 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int _nl_msg_cat_cntr;
+                              return _nl_msg_cat_cntr
+; return 0; }
+EOF
+if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  CATOBJEXT=.gmo
+                  DATADIRNAME=share
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CATOBJEXT=.mo
+                  DATADIRNAME=lib
+fi
+rm -f conftest*
+               INSTOBJEXT=.mo
+             fi
+           fi
+       
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+               
+        if test "$CATOBJEXT" = "NONE"; then
+                         nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+                INTLOBJS="\$(GETTOBJS)"
+        # 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:2266: 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
+  case "$MSGFMT" in
+  /*)
+  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+       ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
+  ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+  echo "$ac_t""$MSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+        # 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:2300: 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
+  case "$GMSGFMT" in
+  /*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+  echo "$ac_t""$GMSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+        # 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:2335: 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
+  case "$XGETTEXT" in
+  /*)
+  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+       ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+       break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+  ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+  echo "$ac_t""$XGETTEXT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+        
+       USE_INCLUDED_LIBINTL=yes
+        CATOBJEXT=.gmo
+        INSTOBJEXT=.mo
+        DATADIRNAME=share
+       INTLDEPS='$(top_builddir)/../intl/libintl.a'
+       INTLLIBS=$INTLDEPS
+       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+        nls_cv_header_intl=libintl.h
+        nls_cv_header_libgt=libgettext.h
+      fi
+
+            if test "$XGETTEXT" != ":"; then
+                       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+         : ;
+       else
+         echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+         XGETTEXT=":"
+       fi
+      fi
+
+      # We need to process the po/ directory.
+      POSUB=po
+    else
+      DATADIRNAME=share
+      nls_cv_header_intl=libintl.h
+      nls_cv_header_libgt=libgettext.h
+    fi
+
+    # If this is used in GNU gettext we have to set USE_NLS to `yes'
+    # because some of the sources are only built for this goal.
+    if test "$PACKAGE" = gettext; then
+      USE_NLS=yes
+      USE_INCLUDED_LIBINTL=yes
+    fi
+
+                for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+        
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
+echo "configure:2425: checking for catalogs to be installed" >&5
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       echo "$ac_t""$LINGUAS" 1>&6
+     fi
+
+          if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+            if test $ac_cv_header_locale_h = yes; then
+     INCLUDE_LOCALE_H="#include <locale.h>"
+   else
+     INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>.  Take care yourself.  */"
+   fi
+   
+
+            if test -f $srcdir/po2tbl.sed.in; then
+      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:2453: 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 2458 "configure"
+#include "confdefs.h"
+#include <linux/version.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  msgformat=linux
+else
+  echo "$ac_t""no" 1>&6
+msgformat=xopen
+fi
+
+
+                        sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+      fi
+            sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+        $srcdir/po2tbl.sed.in > po2tbl.sed
+   fi
+
+            if test "$PACKAGE" = "gettext"; then
+     GT_NO="#NO#"
+     GT_YES=
+   else
+     GT_NO=
+     GT_YES="#YES#"
+   fi
+   
+   
+
+   MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+   
+
+      l=
+   
+
+            if test -d $srcdir/po; then
+      test -d po || mkdir po
+      if test "x$srcdir" != "x."; then
+        if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+           posrcprefix="$srcdir/"
+        else
+           posrcprefix="../$srcdir/"
+        fi
+      else
+        posrcprefix="../"
+      fi
+      rm -f po/POTFILES
+      sed -e "/^#/d" -e "/^\$/d" -e "s,.*,     $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+        < $srcdir/po/POTFILES.in > po/POTFILES
+   fi
+  
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@RANLIB@%$RANLIB%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
+s%@USE_NLS@%$USE_NLS%g
+s%@MSGFMT@%$MSGFMT%g
+s%@GMSGFMT@%$GMSGFMT%g
+s%@XGETTEXT@%$XGETTEXT%g
+s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
+s%@CATALOGS@%$CATALOGS%g
+s%@CATOBJEXT@%$CATOBJEXT%g
+s%@DATADIRNAME@%$DATADIRNAME%g
+s%@GMOFILES@%$GMOFILES%g
+s%@INSTOBJEXT@%$INSTOBJEXT%g
+s%@INTLDEPS@%$INTLDEPS%g
+s%@INTLLIBS@%$INTLLIBS%g
+s%@INTLOBJS@%$INTLOBJS%g
+s%@POFILES@%$POFILES%g
+s%@POSUB@%$POSUB%g
+s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
+s%@GT_NO@%$GT_NO%g
+s%@GT_YES@%$GT_YES%g
+s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
+s%@l@%$l%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='\([     ][      ]*\)[^  ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='\([     ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+  CONFIG_HEADERS="config.h:config.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.  And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
+  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+  rm -f conftest.frag conftest.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
+  if cmp -s $ac_file conftest.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f conftest.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv conftest.h $ac_file
+  fi
+fi; done
+
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+ac_sources="$nls_cv_header_libgt"
+ac_dests="$nls_cv_header_intl"
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+srcdir=$ac_given_srcdir
+while test -n "$ac_sources"; do
+  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
+  set $ac_sources; ac_source=$1; shift; ac_sources=$*
+
+  echo "linking $srcdir/$ac_source to $ac_dest"
+
+  if test ! -r $srcdir/$ac_source; then
+    { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
+  fi
+  rm -f $ac_dest
+
+  # Make relative symlinks.
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
+    # The dest file is in a subdirectory.
+    test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
+    ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dest_dir_suffix.
+    ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dest_dir_suffix= ac_dots=
+  fi
+
+  case "$srcdir" in
+  [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
+  *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
+  esac
+
+  # Make a symlink if possible; otherwise try a hard link.
+  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
+    ln $srcdir/$ac_source $ac_dest; then :
+  else
+    { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
+  fi
+done
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/intl/configure.in b/intl/configure.in
new file mode 100644 (file)
index 0000000..4ba9c24
--- /dev/null
@@ -0,0 +1,10 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(dgettext.c)
+AM_CONFIG_HEADER(config.h:config.in)
+
+AM_PROG_INSTALL
+CY_GNU_GETTEXT
+AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+AC_OUTPUT(Makefile)
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
new file mode 100644 (file)
index 0000000..c4c7a2c
--- /dev/null
@@ -0,0 +1,624 @@
+/* Implementation of the dcgettext(3) function.
+   Copyright (C) 1995, 1996, 1997, 1998 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+#  include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca
+char *alloca ();
+#   endif
+#  endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+#  define _GNU_SOURCE  1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+#  define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "hash-string.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions.  This is required by the standard
+   because some ANSI C functions will require linking with this object
+   file and the name space must not be polluted.  */
+# define getcwd __getcwd
+# ifndef stpcpy
+#  define stpcpy __stpcpy
+# endif
+#else
+# if !defined HAVE_GETCWD
+char *getwd ();
+#  define getcwd(buf, max) getwd (buf)
+# else
+char *getcwd ();
+# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Amount to increase buffer size by in each try.  */
+#define PATH_INCR 32
+
+/* The following is from pathmax.h.  */
+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+   PATH_MAX but might cause redefinition warnings when sys/param.h is
+   later included (as on MORE/BSD 4.3).  */
+#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 255
+#endif
+
+#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
+# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+#endif
+
+/* Don't include sys/param.h if it already has been.  */
+#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
+# include <sys/param.h>
+#endif
+
+#if !defined(PATH_MAX) && defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+   ``Directs `setlocale()' to query `category' and return the current
+     setting of `local'.''
+   However it does not specify the exact format.  And even worse: POSIX
+   defines this not at all.  So we can use this feature only on selected
+   system (e.g. those using GNU C Library).  */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* Name of the default domain used for gettext(3) prior any call to
+   textdomain(3).  The default value for this is "messages".  */
+const char _nl_default_default_domain[] = "messages";
+
+/* Value used as the default domain for gettext(3).  */
+const char *_nl_current_default_domain = _nl_default_default_domain;
+
+/* Contains the default location of the message catalogs.  */
+const char _nl_default_dirname[] = GNULOCALEDIR;
+
+/* List with bindings of specific domains created by bindtextdomain()
+   calls.  */
+struct binding *_nl_domain_bindings;
+
+/* Prototypes for local functions.  */
+static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+                              const char *msgid)) internal_function;
+static const char *category_to_name PARAMS ((int category)) internal_function;
+static const char *guess_category_value PARAMS ((int category,
+                                                const char *categoryname))
+     internal_function;
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+   some additional code emulating it.  */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done.  */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+  void *address;
+  struct block_list *next;
+};
+# define ADD_BLOCK(list, addr)                                               \
+  do {                                                                       \
+    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
+    /* If we cannot get a free block we cannot add the new element to        \
+       the list.  */                                                         \
+    if (newp != NULL) {                                                              \
+      newp->address = (addr);                                                \
+      newp->next = (list);                                                   \
+      (list) = newp;                                                         \
+    }                                                                        \
+  } while (0)
+# define FREE_BLOCKS(list)                                                   \
+  do {                                                                       \
+    while (list != NULL) {                                                   \
+      struct block_list *old = list;                                         \
+      list = list->next;                                                     \
+      free (old);                                                            \
+    }                                                                        \
+  } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define DCGETTEXT __dcgettext
+#else
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+char *
+DCGETTEXT (domainname, msgid, category)
+     const char *domainname;
+     const char *msgid;
+     int category;
+{
+#ifndef HAVE_ALLOCA
+  struct block_list *block_list = NULL;
+#endif
+  struct loaded_l10nfile *domain;
+  struct binding *binding;
+  const char *categoryname;
+  const char *categoryvalue;
+  char *dirname, *xdomainname;
+  char *single_locale;
+  char *retval;
+  int saved_errno = errno;
+
+  /* If no real MSGID is given return NULL.  */
+  if (msgid == NULL)
+    return NULL;
+
+  /* If DOMAINNAME is NULL, we are interested in the default domain.  If
+     CATEGORY is not LC_MESSAGES this might not make much sense but the
+     defintion left this undefined.  */
+  if (domainname == NULL)
+    domainname = _nl_current_default_domain;
+
+  /* First find matching binding.  */
+  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+    {
+      int compare = strcmp (domainname, binding->domainname);
+      if (compare == 0)
+       /* We found it!  */
+       break;
+      if (compare < 0)
+       {
+         /* It is not in the list.  */
+         binding = NULL;
+         break;
+       }
+    }
+
+  if (binding == NULL)
+    dirname = (char *) _nl_default_dirname;
+  else if (binding->dirname[0] == '/')
+    dirname = binding->dirname;
+  else
+    {
+      /* We have a relative path.  Make it absolute now.  */
+      size_t dirname_len = strlen (binding->dirname) + 1;
+      size_t path_max;
+      char *ret;
+
+      path_max = (unsigned) PATH_MAX;
+      path_max += 2;           /* The getcwd docs say to do this.  */
+
+      dirname = (char *) alloca (path_max + dirname_len);
+      ADD_BLOCK (block_list, dirname);
+
+      __set_errno (0);
+      while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
+       {
+         path_max += PATH_INCR;
+         dirname = (char *) alloca (path_max + dirname_len);
+         ADD_BLOCK (block_list, dirname);
+         __set_errno (0);
+       }
+
+      if (ret == NULL)
+       {
+         /* We cannot get the current working directory.  Don't signal an
+            error but simply return the default string.  */
+         FREE_BLOCKS (block_list);
+         __set_errno (saved_errno);
+         return (char *) msgid;
+       }
+
+      stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+    }
+
+  /* Now determine the symbolic name of CATEGORY and its value.  */
+  categoryname = category_to_name (category);
+  categoryvalue = guess_category_value (category, categoryname);
+
+  xdomainname = (char *) alloca (strlen (categoryname)
+                                + strlen (domainname) + 5);
+  ADD_BLOCK (block_list, xdomainname);
+
+  stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+                 domainname),
+         ".mo");
+
+  /* Creating working area.  */
+  single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+  ADD_BLOCK (block_list, single_locale);
+
+
+  /* Search for the given string.  This is a loop because we perhaps
+     got an ordered list of languages to consider for th translation.  */
+  while (1)
+    {
+      /* Make CATEGORYVALUE point to the next element of the list.  */
+      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+       ++categoryvalue;
+      if (categoryvalue[0] == '\0')
+       {
+         /* The whole contents of CATEGORYVALUE has been searched but
+            no valid entry has been found.  We solve this situation
+            by implicitly appending a "C" entry, i.e. no translation
+            will take place.  */
+         single_locale[0] = 'C';
+         single_locale[1] = '\0';
+       }
+      else
+       {
+         char *cp = single_locale;
+         while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+           *cp++ = *categoryvalue++;
+         *cp = '\0';
+       }
+
+      /* If the current locale value is C (or POSIX) we don't load a
+        domain.  Return the MSGID.  */
+      if (strcmp (single_locale, "C") == 0
+         || strcmp (single_locale, "POSIX") == 0)
+       {
+         FREE_BLOCKS (block_list);
+         __set_errno (saved_errno);
+         return (char *) msgid;
+       }
+
+
+      /* Find structure describing the message catalog matching the
+        DOMAINNAME and CATEGORY.  */
+      domain = _nl_find_domain (dirname, single_locale, xdomainname);
+
+      if (domain != NULL)
+       {
+         retval = find_msg (domain, msgid);
+
+         if (retval == NULL)
+           {
+             int cnt;
+
+             for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+               {
+                 retval = find_msg (domain->successor[cnt], msgid);
+
+                 if (retval != NULL)
+                   break;
+               }
+           }
+
+         if (retval != NULL)
+           {
+             FREE_BLOCKS (block_list);
+             __set_errno (saved_errno);
+             return retval;
+           }
+       }
+    }
+  /* NOTREACHED */
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library.  */
+weak_alias (__dcgettext, dcgettext);
+#endif
+
+
+static char *
+internal_function
+find_msg (domain_file, msgid)
+     struct loaded_l10nfile *domain_file;
+     const char *msgid;
+{
+  size_t top, act, bottom;
+  struct loaded_domain *domain;
+
+  if (domain_file->decided == 0)
+    _nl_load_domain (domain_file);
+
+  if (domain_file->data == NULL)
+    return NULL;
+
+  domain = (struct loaded_domain *) domain_file->data;
+
+  /* Locate the MSGID and its translation.  */
+  if (domain->hash_size > 2 && domain->hash_tab != NULL)
+    {
+      /* Use the hashing table.  */
+      nls_uint32 len = strlen (msgid);
+      nls_uint32 hash_val = hash_string (msgid);
+      nls_uint32 idx = hash_val % domain->hash_size;
+      nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+      nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+
+      if (nstr == 0)
+       /* Hash table entry is empty.  */
+       return NULL;
+
+      if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+         && strcmp (msgid,
+                    domain->data + W (domain->must_swap,
+                                      domain->orig_tab[nstr - 1].offset)) == 0)
+       return (char *) domain->data + W (domain->must_swap,
+                                         domain->trans_tab[nstr - 1].offset);
+
+      while (1)
+       {
+         if (idx >= domain->hash_size - incr)
+           idx -= domain->hash_size - incr;
+         else
+           idx += incr;
+
+         nstr = W (domain->must_swap, domain->hash_tab[idx]);
+         if (nstr == 0)
+           /* Hash table entry is empty.  */
+           return NULL;
+
+         if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+             && strcmp (msgid,
+                        domain->data + W (domain->must_swap,
+                                          domain->orig_tab[nstr - 1].offset))
+                == 0)
+           return (char *) domain->data
+             + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
+       }
+      /* NOTREACHED */
+    }
+
+  /* Now we try the default method:  binary search in the sorted
+     array of messages.  */
+  bottom = 0;
+  top = domain->nstrings;
+  while (bottom < top)
+    {
+      int cmp_val;
+
+      act = (bottom + top) / 2;
+      cmp_val = strcmp (msgid, domain->data
+                              + W (domain->must_swap,
+                                   domain->orig_tab[act].offset));
+      if (cmp_val < 0)
+       top = act;
+      else if (cmp_val > 0)
+       bottom = act + 1;
+      else
+       break;
+    }
+
+  /* If an translation is found return this.  */
+  return bottom >= top ? NULL : (char *) domain->data
+                                + W (domain->must_swap,
+                                    domain->trans_tab[act].offset);
+}
+
+
+/* Return string representation of locale CATEGORY.  */
+static const char *
+internal_function
+category_to_name (category)
+     int category;
+{
+  const char *retval;
+
+  switch (category)
+  {
+#ifdef LC_COLLATE
+  case LC_COLLATE:
+    retval = "LC_COLLATE";
+    break;
+#endif
+#ifdef LC_CTYPE
+  case LC_CTYPE:
+    retval = "LC_CTYPE";
+    break;
+#endif
+#ifdef LC_MONETARY
+  case LC_MONETARY:
+    retval = "LC_MONETARY";
+    break;
+#endif
+#ifdef LC_NUMERIC
+  case LC_NUMERIC:
+    retval = "LC_NUMERIC";
+    break;
+#endif
+#ifdef LC_TIME
+  case LC_TIME:
+    retval = "LC_TIME";
+    break;
+#endif
+#ifdef LC_MESSAGES
+  case LC_MESSAGES:
+    retval = "LC_MESSAGES";
+    break;
+#endif
+#ifdef LC_RESPONSE
+  case LC_RESPONSE:
+    retval = "LC_RESPONSE";
+    break;
+#endif
+#ifdef LC_ALL
+  case LC_ALL:
+    /* This might not make sense but is perhaps better than any other
+       value.  */
+    retval = "LC_ALL";
+    break;
+#endif
+  default:
+    /* If you have a better idea for a default value let me know.  */
+    retval = "LC_XXX";
+  }
+
+  return retval;
+}
+
+/* Guess value of current locale from value of the environment variables.  */
+static const char *
+internal_function
+guess_category_value (category, categoryname)
+     int category;
+     const char *categoryname;
+{
+  const char *retval;
+
+  /* The highest priority value is the `LANGUAGE' environment
+     variable.  This is a GNU extension.  */
+  retval = getenv ("LANGUAGE");
+  if (retval != NULL && retval[0] != '\0')
+    return retval;
+
+  /* `LANGUAGE' is not set.  So we have to proceed with the POSIX
+     methods of looking to `LC_ALL', `LC_xxx', and `LANG'.  On some
+     systems this can be done by the `setlocale' function itself.  */
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+  return setlocale (category, NULL);
+#else
+  /* Setting of LC_ALL overwrites all other.  */
+  retval = getenv ("LC_ALL");
+  if (retval != NULL && retval[0] != '\0')
+    return retval;
+
+  /* Next comes the name of the desired category.  */
+  retval = getenv (categoryname);
+  if (retval != NULL && retval[0] != '\0')
+    return retval;
+
+  /* Last possibility is the LANG environment variable.  */
+  retval = getenv ("LANG");
+  if (retval != NULL && retval[0] != '\0')
+    return retval;
+
+  /* We use C as the default domain.  POSIX says this is implementation
+     defined.  */
+  return "C";
+#endif
+}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library.  So we
+   avoid the non-standard function stpcpy.  In GNU C Library this
+   function is available, though.  Also allow the symbol HAVE_STPCPY
+   to be defined.  */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+     char *dest;
+     const char *src;
+{
+  while ((*dest++ = *src++) != '\0')
+    /* Do nothing. */ ;
+  return dest - 1;
+}
+#endif
+
+
+#ifdef _LIBC
+/* If we want to free all resources we have to do some work at
+   program's end.  */
+static void __attribute__ ((unused))
+free_mem (void)
+{
+  struct binding *runp;
+
+  for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next)
+    {
+      free (runp->domainname);
+      if (runp->dirname != _nl_default_dirname)
+       /* Yes, this is a pointer comparison.  */
+       free (runp->dirname);
+    }
+
+  if (_nl_current_default_domain != _nl_default_default_domain)
+    /* Yes, again a pointer comparison.  */
+    free ((char *) _nl_current_default_domain);
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/intl/dgettext.c b/intl/dgettext.c
new file mode 100644 (file)
index 0000000..0510c2b
--- /dev/null
@@ -0,0 +1,59 @@
+/* Implementation of the dgettext(3) function
+   Copyright (C) 1995, 1996, 1997 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined HAVE_LOCALE_H || defined _LIBC
+# include <locale.h>
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT __dcgettext
+#else
+# define DGETTEXT dgettext__
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+   LC_MESSAGES locale.  */
+char *
+DGETTEXT (domainname, msgid)
+     const char *domainname;
+     const char *msgid;
+{
+  return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library.  */
+weak_alias (__dgettext, dgettext);
+#endif
diff --git a/intl/explodename.c b/intl/explodename.c
new file mode 100644 (file)
index 0000000..8066dc2
--- /dev/null
@@ -0,0 +1,188 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#include <sys/types.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found.  Sigh!  */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+#  define NULL ((void *) 0)
+# else
+#  define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+int
+_nl_explode_name (name, language, modifier, territory, codeset,
+                 normalized_codeset, special, sponsor, revision)
+     char *name;
+     const char **language;
+     const char **modifier;
+     const char **territory;
+     const char **codeset;
+     const char **normalized_codeset;
+     const char **special;
+     const char **sponsor;
+     const char **revision;
+{
+  enum { undecided, xpg, cen } syntax;
+  char *cp;
+  int mask;
+
+  *modifier = NULL;
+  *territory = NULL;
+  *codeset = NULL;
+  *normalized_codeset = NULL;
+  *special = NULL;
+  *sponsor = NULL;
+  *revision = NULL;
+
+  /* Now we determine the single parts of the locale name.  First
+     look for the language.  Termination symbols are `_' and `@' if
+     we use XPG4 style, and `_', `+', and `,' if we use CEN syntax.  */
+  mask = 0;
+  syntax = undecided;
+  *language = cp = name;
+  while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
+        && cp[0] != '+' && cp[0] != ',')
+    ++cp;
+
+  if (*language == cp)
+    /* This does not make sense: language has to be specified.  Use
+       this entry as it is without exploding.  Perhaps it is an alias.  */
+    cp = strchr (*language, '\0');
+  else if (cp[0] == '_')
+    {
+      /* Next is the territory.  */
+      cp[0] = '\0';
+      *territory = ++cp;
+
+      while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
+            && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
+       ++cp;
+
+      mask |= TERRITORY;
+
+      if (cp[0] == '.')
+       {
+         /* Next is the codeset.  */
+         syntax = xpg;
+         cp[0] = '\0';
+         *codeset = ++cp;
+
+         while (cp[0] != '\0' && cp[0] != '@')
+           ++cp;
+
+         mask |= XPG_CODESET;
+
+         if (*codeset != cp && (*codeset)[0] != '\0')
+           {
+             *normalized_codeset = _nl_normalize_codeset (*codeset,
+                                                          cp - *codeset);
+             if (strcmp (*codeset, *normalized_codeset) == 0)
+               free ((char *) *normalized_codeset);
+             else
+               mask |= XPG_NORM_CODESET;
+           }
+       }
+    }
+
+  if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
+    {
+      /* Next is the modifier.  */
+      syntax = cp[0] == '@' ? xpg : cen;
+      cp[0] = '\0';
+      *modifier = ++cp;
+
+      while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
+            && cp[0] != ',' && cp[0] != '_')
+       ++cp;
+
+      mask |= XPG_MODIFIER | CEN_AUDIENCE;
+    }
+
+  if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
+    {
+      syntax = cen;
+
+      if (cp[0] == '+')
+       {
+         /* Next is special application (CEN syntax).  */
+         cp[0] = '\0';
+         *special = ++cp;
+
+         while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
+           ++cp;
+
+         mask |= CEN_SPECIAL;
+       }
+
+      if (cp[0] == ',')
+       {
+         /* Next is sponsor (CEN syntax).  */
+         cp[0] = '\0';
+         *sponsor = ++cp;
+
+         while (cp[0] != '\0' && cp[0] != '_')
+           ++cp;
+
+         mask |= CEN_SPONSOR;
+       }
+
+      if (cp[0] == '_')
+       {
+         /* Next is revision (CEN syntax).  */
+         cp[0] = '\0';
+         *revision = ++cp;
+
+         mask |= CEN_REVISION;
+       }
+    }
+
+  /* For CEN syntax values it might be important to have the
+     separator character in the file name, not for XPG syntax.  */
+  if (syntax == xpg)
+    {
+      if (*territory != NULL && (*territory)[0] == '\0')
+       mask &= ~TERRITORY;
+
+      if (*codeset != NULL && (*codeset)[0] == '\0')
+       mask &= ~XPG_CODESET;
+
+      if (*modifier != NULL && (*modifier)[0] == '\0')
+       mask &= ~XPG_MODIFIER;
+    }
+
+  return mask;
+}
diff --git a/intl/finddomain.c b/intl/finddomain.c
new file mode 100644 (file)
index 0000000..81ea29b
--- /dev/null
@@ -0,0 +1,216 @@
+/* Handle list of needed message catalogs
+   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+#  define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+/* List of already loaded domains.  */
+static struct loaded_l10nfile *_nl_loaded_domains;
+
+
+/* Return a data structure describing the message catalog described by
+   the DOMAINNAME and CATEGORY parameters with respect to the currently
+   established bindings.  */
+struct loaded_l10nfile *
+internal_function
+_nl_find_domain (dirname, locale, domainname)
+     const char *dirname;
+     char *locale;
+     const char *domainname;
+{
+  struct loaded_l10nfile *retval;
+  const char *language;
+  const char *modifier;
+  const char *territory;
+  const char *codeset;
+  const char *normalized_codeset;
+  const char *special;
+  const char *sponsor;
+  const char *revision;
+  const char *alias_value;
+  int mask;
+
+  /* LOCALE can consist of up to four recognized parts for the XPG syntax:
+
+               language[_territory[.codeset]][@modifier]
+
+     and six parts for the CEN syntax:
+
+       language[_territory][+audience][+special][,[sponsor][_revision]]
+
+     Beside the first part all of them are allowed to be missing.  If
+     the full specified locale is not found, the less specific one are
+     looked for.  The various parts will be stripped off according to
+     the following order:
+               (1) revision
+               (2) sponsor
+               (3) special
+               (4) codeset
+               (5) normalized codeset
+               (6) territory
+               (7) audience/modifier
+   */
+
+  /* If we have already tested for this locale entry there has to
+     be one data set in the list of loaded domains.  */
+  retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+                              strlen (dirname) + 1, 0, locale, NULL, NULL,
+                              NULL, NULL, NULL, NULL, NULL, domainname, 0);
+  if (retval != NULL)
+    {
+      /* We know something about this locale.  */
+      int cnt;
+
+      if (retval->decided == 0)
+       _nl_load_domain (retval);
+
+      if (retval->data != NULL)
+       return retval;
+
+      for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+       {
+         if (retval->successor[cnt]->decided == 0)
+           _nl_load_domain (retval->successor[cnt]);
+
+         if (retval->successor[cnt]->data != NULL)
+           break;
+       }
+      return cnt >= 0 ? retval : NULL;
+      /* NOTREACHED */
+    }
+
+  /* See whether the locale value is an alias.  If yes its value
+     *overwrites* the alias name.  No test for the original value is
+     done.  */
+  alias_value = _nl_expand_alias (locale);
+  if (alias_value != NULL)
+    {
+#if defined _LIBC || defined HAVE_STRDUP
+      locale = strdup (alias_value);
+      if (locale == NULL)
+       return NULL;
+#else
+      size_t len = strlen (alias_value) + 1;
+      locale = (char *) malloc (len);
+      if (locale == NULL)
+       return NULL;
+
+      memcpy (locale, alias_value, len);
+#endif
+    }
+
+  /* Now we determine the single parts of the locale name.  First
+     look for the language.  Termination symbols are `_' and `@' if
+     we use XPG4 style, and `_', `+', and `,' if we use CEN syntax.  */
+  mask = _nl_explode_name (locale, &language, &modifier, &territory,
+                          &codeset, &normalized_codeset, &special,
+                          &sponsor, &revision);
+
+  /* Create all possible locale entries which might be interested in
+     generalization.  */
+  retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+                              strlen (dirname) + 1, mask, language, territory,
+                              codeset, normalized_codeset, modifier, special,
+                              sponsor, revision, domainname, 1);
+  if (retval == NULL)
+    /* This means we are out of core.  */
+    return NULL;
+
+  if (retval->decided == 0)
+    _nl_load_domain (retval);
+  if (retval->data == NULL)
+    {
+      int cnt;
+      for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+       {
+         if (retval->successor[cnt]->decided == 0)
+           _nl_load_domain (retval->successor[cnt]);
+         if (retval->successor[cnt]->data != NULL)
+           break;
+       }
+    }
+
+  /* The room for an alias was dynamically allocated.  Free it now.  */
+  if (alias_value != NULL)
+    free (locale);
+
+  return retval;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+  struct loaded_l10nfile *runp = _nl_loaded_domains;
+
+  while (runp != NULL)
+    {
+      struct loaded_l10nfile *here = runp;
+      if (runp->data != NULL)
+       _nl_unload_domain ((struct loaded_domain *) runp->data);
+      runp = runp->next;
+      free (here);
+    }
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/intl/gettext.c b/intl/gettext.c
new file mode 100644 (file)
index 0000000..d929f98
--- /dev/null
@@ -0,0 +1,70 @@
+/* Implementation of gettext(3) function.
+   Copyright (C) 1995, 1997 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# ifdef STDC_HEADERS
+#  include <stdlib.h>          /* Just for NULL.  */
+# else
+#  ifdef HAVE_STRING_H
+#   include <string.h>
+#  else
+#   define NULL ((void *) 0)
+#  endif
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define GETTEXT __gettext
+# define DGETTEXT __dgettext
+#else
+# define GETTEXT gettext__
+# define DGETTEXT dgettext__
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+char *
+GETTEXT (msgid)
+     const char *msgid;
+{
+  return DGETTEXT (NULL, msgid);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library.  */
+weak_alias (__gettext, gettext);
+#endif
diff --git a/intl/gettext.h b/intl/gettext.h
new file mode 100644 (file)
index 0000000..3cd23d7
--- /dev/null
@@ -0,0 +1,105 @@
+/* Internal header for GNU gettext internationalization functions.
+   Copyright (C) 1995, 1997 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, 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 Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _GETTEXT_H
+#define _GETTEXT_H 1
+
+#include <stdio.h>
+
+#if HAVE_LIMITS_H || _LIBC
+# include <limits.h>
+#endif
+
+/* @@ end of prolog @@ */
+
+/* The magic number of the GNU message catalog format.  */
+#define _MAGIC 0x950412de
+#define _MAGIC_SWAPPED 0xde120495
+
+/* Revision number of the currently used .mo (binary) file format.  */
+#define MO_REVISION_NUMBER 0
+
+/* The following contortions are an attempt to use the C preprocessor
+   to determine an unsigned integral type that is 32 bits wide.  An
+   alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+   doing that would require that the configure script compile and *run*
+   the resulting executable.  Locally running cross-compiled executables
+   is usually not possible.  */
+
+#if __STDC__
+# define UINT_MAX_32_BITS 4294967295U
+#else
+# define UINT_MAX_32_BITS 0xFFFFFFFF
+#endif
+
+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+   This should be valid for all systems GNU cares about because
+   that doesn't include 16-bit systems, and only modern systems
+   (that certainly have <limits.h>) have 64+-bit integral types.  */
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
+#if UINT_MAX == UINT_MAX_32_BITS
+typedef unsigned nls_uint32;
+#else
+# if USHRT_MAX == UINT_MAX_32_BITS
+typedef unsigned short nls_uint32;
+# else
+#  if ULONG_MAX == UINT_MAX_32_BITS
+typedef unsigned long nls_uint32;
+#  else
+  /* The following line is intended to throw an error.  Using #error is
+     not portable enough.  */
+  "Cannot determine unsigned 32-bit data type."
+#  endif
+# endif
+#endif
+
+
+/* Header for binary .mo file format.  */
+struct mo_file_header
+{
+  /* The magic number.  */
+  nls_uint32 magic;
+  /* The revision number of the file format.  */
+  nls_uint32 revision;
+  /* The number of strings pairs.  */
+  nls_uint32 nstrings;
+  /* Offset of table with start offsets of original strings.  */
+  nls_uint32 orig_tab_offset;
+  /* Offset of table with start offsets of translation strings.  */
+  nls_uint32 trans_tab_offset;
+  /* Size of hashing table.  */
+  nls_uint32 hash_tab_size;
+  /* Offset of first hashing entry.  */
+  nls_uint32 hash_tab_offset;
+};
+
+struct string_desc
+{
+  /* Length of addressed string.  */
+  nls_uint32 length;
+  /* Offset of string in file.  */
+  nls_uint32 offset;
+};
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettext.h  */
diff --git a/intl/gettextP.h b/intl/gettextP.h
new file mode 100644 (file)
index 0000000..00c5203
--- /dev/null
@@ -0,0 +1,89 @@
+/* Header describing internals of gettext library
+   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifndef _GETTEXTP_H
+#define _GETTEXTP_H
+
+#include "loadinfo.h"
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+#ifndef W
+# define W(flag, data) ((flag) ? SWAP (data) : (data))
+#endif
+
+
+#ifdef _LIBC
+# include <byteswap.h>
+# define SWAP(i) bswap_32 (i)
+#else
+static nls_uint32 SWAP PARAMS ((nls_uint32 i));
+
+static inline nls_uint32
+SWAP (i)
+     nls_uint32 i;
+{
+  return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+#endif
+
+
+struct loaded_domain
+{
+  const char *data;
+  int use_mmap;
+  size_t mmap_size;
+  int must_swap;
+  nls_uint32 nstrings;
+  struct string_desc *orig_tab;
+  struct string_desc *trans_tab;
+  nls_uint32 hash_size;
+  nls_uint32 *hash_tab;
+};
+
+struct binding
+{
+  struct binding *next;
+  char *domainname;
+  char *dirname;
+};
+
+struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+                                                char *__locale,
+                                                const char *__domainname))
+     internal_function;
+void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
+     internal_function;
+void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
+     internal_function;
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettextP.h  */
diff --git a/intl/hash-string.h b/intl/hash-string.h
new file mode 100644 (file)
index 0000000..cacb38e
--- /dev/null
@@ -0,0 +1,59 @@
+/* Implements a string hashing function.
+   Copyright (C) 1995, 1997 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, 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 Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+#  define PARAMS(Args) Args
+# else
+#  define PARAMS(Args) ()
+# endif
+#endif
+
+/* We assume to have `unsigned long int' value with at least 32 bits.  */
+#define HASHWORDBITS 32
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+   [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+   1986, 1987 Bell Telephone Laboratories, Inc.]  */
+static unsigned long hash_string PARAMS ((const char *__str_param));
+
+static inline unsigned long
+hash_string (str_param)
+     const char *str_param;
+{
+  unsigned long int hval, g;
+  const char *str = str_param;
+
+  /* Compute the hash value for the given string.  */
+  hval = 0;
+  while (*str != '\0')
+    {
+      hval <<= 4;
+      hval += (unsigned long) *str++;
+      g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
+      if (g != 0)
+       {
+         hval ^= g >> (HASHWORDBITS - 8);
+         hval ^= g;
+       }
+    }
+  return hval;
+}
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
new file mode 100644 (file)
index 0000000..503efa0
--- /dev/null
@@ -0,0 +1,76 @@
+/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+   Library.
+   Copyright (C) 1995 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef textdomain
+#undef bindtextdomain
+
+
+char *
+bindtextdomain (domainname, dirname)
+     const char *domainname;
+     const char *dirname;
+{
+  return bindtextdomain__ (domainname, dirname);
+}
+
+
+char *
+dcgettext (domainname, msgid, category)
+     const char *domainname;
+     const char *msgid;
+     int category;
+{
+  return dcgettext__ (domainname, msgid, category);
+}
+
+
+char *
+dgettext (domainname, msgid)
+     const char *domainname;
+     const char *msgid;
+{
+  return dgettext__ (domainname, msgid);
+}
+
+
+char *
+gettext (msgid)
+     const char *msgid;
+{
+  return gettext__ (msgid);
+}
+
+
+char *
+textdomain (domainname)
+     const char *domainname;
+{
+  return textdomain__ (domainname);
+}
diff --git a/intl/intlh.inst.in b/intl/intlh.inst.in
new file mode 100644 (file)
index 0000000..27cf6c7
--- /dev/null
@@ -0,0 +1,111 @@
+/* Message catalogs for internationalization.
+   Copyright (C) 1995, 1996, 1997 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, 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 _LIBINTL_H
+#define _LIBINTL_H     1
+
+@INCLUDE_LOCALE_H@
+
+/* We define an additional symbol to signal that we use the GNU
+   implementation of gettext.  */
+#define __USE_GNU_GETTEXT 1
+
+#ifndef PARAMS
+# if __STDC__ || defined __cplusplus
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+extern char *gettext PARAMS ((const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+   LC_MESSAGES locale.  */
+extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+                               int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+   If DOMAINNAME is null, return the current default.
+   If DOMAINNAME is "", reset to the default of "messages".  */
+extern char *textdomain PARAMS ((const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+   in DIRNAME rather than in the system locale data base.  */
+extern char *bindtextdomain PARAMS ((const char *__domainname,
+                                    const char *__dirname));
+
+
+/* Optimized version of the functions above.  */
+#if defined __OPTIMIZED
+/* These must be a macro.  Inlined functions are useless because the
+   `__builtin_constant_p' predicate in dcgettext would always return
+   false.  */
+
+# define gettext(msgid) dgettext ((char *) 0, msgid)
+
+# define dgettext(domainname, msgid)                                         \
+  dcgettext (domainname, msgid, LC_MESSAGES)
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+/* This global variable is defined in loadmsgcat.c.  We need a sign,
+   whether a new catalog was loaded, which can be associated with all
+   translations.  */
+extern int _nl_msg_cat_cntr;
+
+#  define dcgettext(domainname, msgid, category)                             \
+  (__extension__                                                             \
+   ({                                                                        \
+     char *__result;                                                         \
+     if (__builtin_constant_p (msgid))                                       \
+       {                                                                     \
+        static char *__translation__;                                        \
+        static int __catalog_counter__;                                      \
+        if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
+          {                                                                  \
+            __translation__ =                                                \
+              (dcgettext) ((domainname), (msgid), (category));               \
+            __catalog_counter__ = _nl_msg_cat_cntr;                          \
+          }                                                                  \
+        __result = __translation__;                                          \
+       }                                                                     \
+     else                                                                    \
+       __result = (dcgettext) ((domainname), (msgid), (category));           \
+     __result;                                                               \
+    }))
+# endif
+#endif /* Optimizing. */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
new file mode 100644 (file)
index 0000000..9c7dc18
--- /dev/null
@@ -0,0 +1,411 @@
+/* Handle list of needed message catalogs
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+#  define _GNU_SOURCE  1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+#  define strchr index
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_ARGZ_H
+# include <argz.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found.  Sigh!  */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+#  define NULL ((void *) 0)
+# else
+#  define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions.  This is required by the standard
+   because some ANSI C functions will require linking with this object
+   file and the name space must not be polluted.  */
+# ifndef stpcpy
+#  define stpcpy(dest, src) __stpcpy(dest, src)
+# endif
+#else
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Define function which are usually not available.  */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+/* Returns the number of strings in ARGZ.  */
+static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+
+static size_t
+argz_count__ (argz, len)
+     const char *argz;
+     size_t len;
+{
+  size_t count = 0;
+  while (len > 0)
+    {
+      size_t part_len = strlen (argz);
+      argz += part_len + 1;
+      len -= part_len + 1;
+      count++;
+    }
+  return count;
+}
+# undef __argz_count
+# define __argz_count(argz, len) argz_count__ (argz, len)
+#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+   except the last into the character SEP.  */
+static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+
+static void
+argz_stringify__ (argz, len, sep)
+     char *argz;
+     size_t len;
+     int sep;
+{
+  while (len > 0)
+    {
+      size_t part_len = strlen (argz);
+      argz += part_len;
+      len -= part_len + 1;
+      if (len > 0)
+       *argz++ = sep;
+    }
+}
+# undef __argz_stringify
+# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
+#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+                                 const char *entry));
+
+static char *
+argz_next__ (argz, argz_len, entry)
+     char *argz;
+     size_t argz_len;
+     const char *entry;
+{
+  if (entry)
+    {
+      if (entry < argz + argz_len)
+        entry = strchr (entry, '\0') + 1;
+
+      return entry >= argz + argz_len ? NULL : (char *) entry;
+    }
+  else
+    if (argz_len > 0)
+      return argz;
+    else
+      return 0;
+}
+# undef __argz_next
+# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
+#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
+
+
+/* Return number of bits set in X.  */
+static int pop PARAMS ((int x));
+
+static inline int
+pop (x)
+     int x;
+{
+  /* We assume that no more than 16 bits are used.  */
+  x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+  x = ((x & ~0x3333) >> 2) + (x & 0x3333);
+  x = ((x >> 4) + x) & 0x0f0f;
+  x = ((x >> 8) + x) & 0xff;
+
+  return x;
+}
+
+\f
+struct loaded_l10nfile *
+_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+                   territory, codeset, normalized_codeset, modifier, special,
+                   sponsor, revision, filename, do_allocate)
+     struct loaded_l10nfile **l10nfile_list;
+     const char *dirlist;
+     size_t dirlist_len;
+     int mask;
+     const char *language;
+     const char *territory;
+     const char *codeset;
+     const char *normalized_codeset;
+     const char *modifier;
+     const char *special;
+     const char *sponsor;
+     const char *revision;
+     const char *filename;
+     int do_allocate;
+{
+  char *abs_filename;
+  struct loaded_l10nfile *last = NULL;
+  struct loaded_l10nfile *retval;
+  char *cp;
+  size_t entries;
+  int cnt;
+
+  /* Allocate room for the full file name.  */
+  abs_filename = (char *) malloc (dirlist_len
+                                 + strlen (language)
+                                 + ((mask & TERRITORY) != 0
+                                    ? strlen (territory) + 1 : 0)
+                                 + ((mask & XPG_CODESET) != 0
+                                    ? strlen (codeset) + 1 : 0)
+                                 + ((mask & XPG_NORM_CODESET) != 0
+                                    ? strlen (normalized_codeset) + 1 : 0)
+                                 + (((mask & XPG_MODIFIER) != 0
+                                     || (mask & CEN_AUDIENCE) != 0)
+                                    ? strlen (modifier) + 1 : 0)
+                                 + ((mask & CEN_SPECIAL) != 0
+                                    ? strlen (special) + 1 : 0)
+                                 + (((mask & CEN_SPONSOR) != 0
+                                     || (mask & CEN_REVISION) != 0)
+                                    ? (1 + ((mask & CEN_SPONSOR) != 0
+                                            ? strlen (sponsor) + 1 : 0)
+                                       + ((mask & CEN_REVISION) != 0
+                                          ? strlen (revision) + 1 : 0)) : 0)
+                                 + 1 + strlen (filename) + 1);
+
+  if (abs_filename == NULL)
+    return NULL;
+
+  retval = NULL;
+  last = NULL;
+
+  /* Construct file name.  */
+  memcpy (abs_filename, dirlist, dirlist_len);
+  __argz_stringify (abs_filename, dirlist_len, ':');
+  cp = abs_filename + (dirlist_len - 1);
+  *cp++ = '/';
+  cp = stpcpy (cp, language);
+
+  if ((mask & TERRITORY) != 0)
+    {
+      *cp++ = '_';
+      cp = stpcpy (cp, territory);
+    }
+  if ((mask & XPG_CODESET) != 0)
+    {
+      *cp++ = '.';
+      cp = stpcpy (cp, codeset);
+    }
+  if ((mask & XPG_NORM_CODESET) != 0)
+    {
+      *cp++ = '.';
+      cp = stpcpy (cp, normalized_codeset);
+    }
+  if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
+    {
+      /* This component can be part of both syntaces but has different
+        leading characters.  For CEN we use `+', else `@'.  */
+      *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
+      cp = stpcpy (cp, modifier);
+    }
+  if ((mask & CEN_SPECIAL) != 0)
+    {
+      *cp++ = '+';
+      cp = stpcpy (cp, special);
+    }
+  if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
+    {
+      *cp++ = ',';
+      if ((mask & CEN_SPONSOR) != 0)
+       cp = stpcpy (cp, sponsor);
+      if ((mask & CEN_REVISION) != 0)
+       {
+         *cp++ = '_';
+         cp = stpcpy (cp, revision);
+       }
+    }
+
+  *cp++ = '/';
+  stpcpy (cp, filename);
+
+  /* Look in list of already loaded domains whether it is already
+     available.  */
+  last = NULL;
+  for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+    if (retval->filename != NULL)
+      {
+       int compare = strcmp (retval->filename, abs_filename);
+       if (compare == 0)
+         /* We found it!  */
+         break;
+       if (compare < 0)
+         {
+           /* It's not in the list.  */
+           retval = NULL;
+           break;
+         }
+
+       last = retval;
+      }
+
+  if (retval != NULL || do_allocate == 0)
+    {
+      free (abs_filename);
+      return retval;
+    }
+
+  retval = (struct loaded_l10nfile *)
+    malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+                               * (1 << pop (mask))
+                               * sizeof (struct loaded_l10nfile *)));
+  if (retval == NULL)
+    return NULL;
+
+  retval->filename = abs_filename;
+  retval->decided = (__argz_count (dirlist, dirlist_len) != 1
+                    || ((mask & XPG_CODESET) != 0
+                        && (mask & XPG_NORM_CODESET) != 0));
+  retval->data = NULL;
+
+  if (last == NULL)
+    {
+      retval->next = *l10nfile_list;
+      *l10nfile_list = retval;
+    }
+  else
+    {
+      retval->next = last->next;
+      last->next = retval;
+    }
+
+  entries = 0;
+  /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+     a real file.  So we have to use the DIRLIST separation mechanism
+     of the inner loop.  */
+  cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+  for (; cnt >= 0; --cnt)
+    if ((cnt & ~mask) == 0
+       && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+       && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+      {
+       /* Iterate over all elements of the DIRLIST.  */
+       char *dir = NULL;
+
+       while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+              != NULL)
+         retval->successor[entries++]
+           = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+                                 language, territory, codeset,
+                                 normalized_codeset, modifier, special,
+                                 sponsor, revision, filename, 1);
+      }
+  retval->successor[entries] = NULL;
+
+  return retval;
+}
+\f
+/* Normalize codeset name.  There is no standard for the codeset
+   names.  Normalization allows the user to use any of the common
+   names.  */
+const char *
+_nl_normalize_codeset (codeset, name_len)
+     const unsigned char *codeset;
+     size_t name_len;
+{
+  int len = 0;
+  int only_digit = 1;
+  char *retval;
+  char *wp;
+  size_t cnt;
+
+  for (cnt = 0; cnt < name_len; ++cnt)
+    if (isalnum (codeset[cnt]))
+      {
+       ++len;
+
+       if (isalpha (codeset[cnt]))
+         only_digit = 0;
+      }
+
+  retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+  if (retval != NULL)
+    {
+      if (only_digit)
+       wp = stpcpy (retval, "iso");
+      else
+       wp = retval;
+
+      for (cnt = 0; cnt < name_len; ++cnt)
+       if (isalpha (codeset[cnt]))
+         *wp++ = tolower (codeset[cnt]);
+       else if (isdigit (codeset[cnt]))
+         *wp++ = codeset[cnt];
+
+      *wp = '\0';
+    }
+
+  return (const char *) retval;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library.  So we
+   avoid the non-standard function stpcpy.  In GNU C Library this
+   function is available, though.  Also allow the symbol HAVE_STPCPY
+   to be defined.  */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+     char *dest;
+     const char *src;
+{
+  while ((*dest++ = *src++) != '\0')
+    /* Do nothing. */ ;
+  return dest - 1;
+}
+#endif
diff --git a/intl/libgettext.h b/intl/libgettext.h
new file mode 100644 (file)
index 0000000..3a92960
--- /dev/null
@@ -0,0 +1,182 @@
+/* Message catalogs for internationalization.
+   Copyright (C) 1995, 1996, 1997, 1998 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, 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.  */
+
+/* Because on some systems (e.g. Solaris) we sometimes have to include
+   the systems libintl.h as well as this file we have more complex
+   include protection above.  But the systems header might perhaps also
+   define _LIBINTL_H and therefore we have to protect the definition here.  */
+
+#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
+#ifndef _LIBINTL_H
+# define _LIBINTL_H    1
+#endif
+#define _LIBGETTEXT_H  1
+
+/* We define an additional symbol to signal that we use the GNU
+   implementation of gettext.  */
+#define __USE_GNU_GETTEXT 1
+
+#include <sys/types.h>
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__ || defined __cplusplus
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef NULL
+# if !defined __cplusplus || defined __GNUC__
+#  define NULL ((void *) 0)
+# else
+#  define NULL (0)
+# endif
+#endif
+
+#if !HAVE_LC_MESSAGES
+/* This value determines the behaviour of the gettext() and dgettext()
+   function.  But some system does not have this defined.  Define it
+   to a default value.  */
+# define LC_MESSAGES (-1)
+#endif
+
+
+/* Declarations for gettext-using-catgets interface.  Derived from
+   Jim Meyering's libintl.h.  */
+struct _msg_ent
+{
+  const char *_msg;
+  int _msg_number;
+};
+
+
+#if HAVE_CATGETS
+/* These two variables are defined in the automatically by po-to-tbl.sed
+   generated file `cat-id-tbl.c'.  */
+extern const struct _msg_ent _msg_tbl[];
+extern int _msg_tbl_length;
+#endif
+
+
+/* For automatical extraction of messages sometimes no real
+   translation is needed.  Instead the string itself is the result.  */
+#define gettext_noop(Str) (Str)
+
+/* Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+extern char *gettext PARAMS ((const char *__msgid));
+extern char *gettext__ PARAMS ((const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+   LC_MESSAGES locale.  */
+extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+extern char *dgettext__ PARAMS ((const char *__domainname,
+                                const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+                               int __category));
+extern char *dcgettext__ PARAMS ((const char *__domainname,
+                                 const char *__msgid, int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+   If DOMAINNAME is null, return the current default.
+   If DOMAINNAME is "", reset to the default of "messages".  */
+extern char *textdomain PARAMS ((const char *__domainname));
+extern char *textdomain__ PARAMS ((const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+   in DIRNAME rather than in the system locale data base.  */
+extern char *bindtextdomain PARAMS ((const char *__domainname,
+                                 const char *__dirname));
+extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+                                   const char *__dirname));
+
+#if ENABLE_NLS
+
+/* Solaris 2.3 has the gettext function but dcgettext is missing.
+   So we omit this optimization for Solaris 2.3.  BTW, Solaris 2.4
+   has dcgettext.  */
+# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+
+#  define gettext(Msgid)                                                     \
+     dgettext (NULL, Msgid)
+
+#  define dgettext(Domainname, Msgid)                                        \
+     dcgettext (Domainname, Msgid, LC_MESSAGES)
+
+#  if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+/* This global variable is defined in loadmsgcat.c.  We need a sign,
+   whether a new catalog was loaded, which can be associated with all
+   translations.  */
+extern int _nl_msg_cat_cntr;
+
+#   define dcgettext(Domainname, Msgid, Category)                            \
+  (__extension__                                                             \
+   ({                                                                        \
+     char *__result;                                                         \
+     if (__builtin_constant_p (Msgid))                                       \
+       {                                                                     \
+        static char *__translation__;                                        \
+        static int __catalog_counter__;                                      \
+        if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
+          {                                                                  \
+            __translation__ =                                                \
+              dcgettext__ (Domainname, Msgid, Category);                     \
+            __catalog_counter__ = _nl_msg_cat_cntr;                          \
+          }                                                                  \
+        __result = __translation__;                                          \
+       }                                                                     \
+     else                                                                    \
+       __result = dcgettext__ (Domainname, Msgid, Category);                 \
+     __result;                                                               \
+    }))
+#  endif
+# endif
+
+#else
+
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define textdomain(Domainname) ((char *) Domainname)
+# define bindtextdomain(Domainname, Dirname) ((char *) Dirname)
+
+#endif
+
+/* @@ begin of epilog @@ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/intl/libintl.glibc b/intl/libintl.glibc
new file mode 100644 (file)
index 0000000..2c8e8a4
--- /dev/null
@@ -0,0 +1,120 @@
+/* Message catalogs for internationalization.
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+   This file is derived from the file libgettext.h in the GNU gettext package.
+
+   This file is part of the GNU C Library.  Its master source is NOT part of
+   the C library, however.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H     1
+
+#include <features.h>
+
+/* We define an additional symbol to signal that we use the GNU
+   implementation of gettext.  */
+#define __USE_GNU_GETTEXT 1
+
+__BEGIN_DECLS
+
+/* Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+extern char *gettext __P ((__const char *__msgid));
+extern char *__gettext __P ((__const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+   LC_MESSAGES locale.  */
+extern char *dgettext __P ((__const char *__domainname,
+                           __const char *__msgid));
+extern char *__dgettext __P ((__const char *__domainname,
+                             __const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+extern char *dcgettext __P ((__const char *__domainname,
+                            __const char *__msgid, int __category));
+extern char *__dcgettext __P ((__const char *__domainname,
+                              __const char *__msgid, int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+   If DOMAINNAME is null, return the current default.
+   If DOMAINNAME is "", reset to the default of "messages".  */
+extern char *textdomain __P ((__const char *__domainname));
+extern char *__textdomain __P ((__const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+   in DIRNAME rather than in the system locale data base.  */
+extern char *bindtextdomain __P ((__const char *__domainname,
+                                 __const char *__dirname));
+extern char *__bindtextdomain __P ((__const char *__domainname,
+                                   __const char *__dirname));
+
+
+/* Optimized version of the function above.  */
+#if defined __OPTIMIZE__
+
+/* We need NULL for `gettext'.  */
+# define __need_NULL
+# include <stddef.h>
+
+/* We need LC_MESSAGES for `dgettext'.  */
+# include <locale.h>
+
+/* These must be macros.  Inlined functions are useless because the
+   `__builtin_constant_p' predicate in dcgettext would always return
+   false.  */
+
+# define gettext(msgid) dgettext (NULL, msgid)
+
+# define dgettext(domainname, msgid)                                         \
+  dcgettext (domainname, msgid, LC_MESSAGES)
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+/* Variable defined in loadmsgcat.c which gets incremented every time a
+   new catalog is loaded.  */
+extern int _nl_msg_cat_cntr;
+
+#  define dcgettext(domainname, msgid, category)                             \
+  (__extension__                                                             \
+   ({                                                                        \
+     char *__result;                                                         \
+     if (__builtin_constant_p (msgid))                                       \
+       {                                                                     \
+        static char *__translation__;                                        \
+        static int __catalog_counter__;                                      \
+        if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
+          {                                                                  \
+            __translation__ =                                                \
+              __dcgettext ((domainname), (msgid), (category));               \
+            __catalog_counter__ = _nl_msg_cat_cntr;                          \
+          }                                                                  \
+        __result = __translation__;                                          \
+       }                                                                     \
+     else                                                                    \
+       __result = __dcgettext ((domainname), (msgid), (category));           \
+     __result;                                                               \
+    }))
+# endif
+#endif /* Optimizing. */
+
+
+__END_DECLS
+
+#endif /* libintl.h */
diff --git a/intl/linux-msg.sed b/intl/linux-msg.sed
new file mode 100644 (file)
index 0000000..6f03912
--- /dev/null
@@ -0,0 +1,100 @@
+# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
+# Copyright 1995, 2002 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number.  We use always set number 1.
+#
+1 {
+  i\
+$set 1 # Automatically created by po2msg.sed
+  h
+  s/.*/0/
+  x
+}
+#
+# Mitch's old catalog format does not allow comments.
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+  s/msgid[     ]*"//
+#
+# This does not work now with the new format.
+# /"$/! {
+#   s/\\$//
+#   s/$/ ... (more lines following)"/
+# }
+  x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+  td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+  :d
+  s/9\(_*\)$/_\1/
+  td
+# Assure at least one digit is available.
+  s/^\(_*\)$/0\1/
+# Increment the last digit.
+  s/8\(_*\)$/9\1/
+  s/7\(_*\)$/8\1/
+  s/6\(_*\)$/7\1/
+  s/5\(_*\)$/6\1/
+  s/4\(_*\)$/5\1/
+  s/3\(_*\)$/4\1/
+  s/2\(_*\)$/3\1/
+  s/1\(_*\)$/2\1/
+  s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+  s/_/0/g
+  x
+  G
+  s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
+}
+#
+# The .msg file contains, other than the .po file, only the translations
+# but each given a unique ID.  Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here.  (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+  s/msgstr[    ]*"\(.*\)"/# \1/
+# Clear substitution flag.
+  tb
+# Append the next line.
+  :b
+  N
+# Look whether second part is continuation line.
+  s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+  ta
+  P
+  D
+# Note that D includes a jump to the start!!
+# We found a continuation line.  But before printing insert '\'.
+  :a
+  s/\(.*\)\(\n.*\)/\1\\\2/
+  P
+# We cannot use D here.
+  s/.*\n\(.*\)/\1/
+  tb
+}
+d
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
new file mode 100644 (file)
index 0000000..f4ebf6d
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   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.  */
+
+#ifndef PARAMS
+# if __STDC__
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+/* Encoding of locale name parts.  */
+#define CEN_REVISION           1
+#define CEN_SPONSOR            2
+#define CEN_SPECIAL            4
+#define XPG_NORM_CODESET       8
+#define XPG_CODESET            16
+#define TERRITORY              32
+#define CEN_AUDIENCE           64
+#define XPG_MODIFIER           128
+
+#define CEN_SPECIFIC   (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
+#define XPG_SPECIFIC   (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
+
+
+struct loaded_l10nfile
+{
+  const char *filename;
+  int decided;
+
+  const void *data;
+
+  struct loaded_l10nfile *next;
+  struct loaded_l10nfile *successor[1];
+};
+
+
+extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
+                                                 size_t name_len));
+
+extern struct loaded_l10nfile *
+_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+                           const char *dirlist, size_t dirlist_len, int mask,
+                           const char *language, const char *territory,
+                           const char *codeset,
+                           const char *normalized_codeset,
+                           const char *modifier, const char *special,
+                           const char *sponsor, const char *revision,
+                           const char *filename, int do_allocate));
+
+
+extern const char *_nl_expand_alias PARAMS ((const char *name));
+
+extern int _nl_explode_name PARAMS ((char *name, const char **language,
+                                    const char **modifier,
+                                    const char **territory,
+                                    const char **codeset,
+                                    const char **normalized_codeset,
+                                    const char **special,
+                                    const char **sponsor,
+                                    const char **revision));
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
new file mode 100644 (file)
index 0000000..515892d
--- /dev/null
@@ -0,0 +1,222 @@
+/* Load needed message catalogs.
+   Copyright (C) 1995, 1996, 1997, 1998 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, 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 HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
+# include <sys/mman.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ISO C functions.  This is required by the standard
+   because some ISO C functions will require linking with this object
+   file and the name space must not be polluted.  */
+# define open   __open
+# define close  __close
+# define read   __read
+# define mmap   __mmap
+# define munmap __munmap
+#endif
+
+/* We need a sign, whether a new catalog was loaded, which can be associated
+   with all translations.  This is important if the translations are
+   cached by one of GCC's features.  */
+int _nl_msg_cat_cntr = 0;
+
+
+/* Load the message catalogs specified by FILENAME.  If it is no valid
+   message catalog do nothing.  */
+void
+internal_function
+_nl_load_domain (domain_file)
+     struct loaded_l10nfile *domain_file;
+{
+  int fd;
+  size_t size;
+  struct stat st;
+  struct mo_file_header *data = (struct mo_file_header *) -1;
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+    || defined _LIBC
+  int use_mmap = 0;
+#endif
+  struct loaded_domain *domain;
+
+  domain_file->decided = 1;
+  domain_file->data = NULL;
+
+  /* If the record does not represent a valid locale the FILENAME
+     might be NULL.  This can happen when according to the given
+     specification the locale file name is different for XPG and CEN
+     syntax.  */
+  if (domain_file->filename == NULL)
+    return;
+
+  /* Try to open the addressed file.  */
+  fd = open (domain_file->filename, O_RDONLY);
+  if (fd == -1)
+    return;
+
+  /* We must know about the size of the file.  */
+  if (fstat (fd, &st) != 0
+      || (size = (size_t) st.st_size) != st.st_size
+      || size < sizeof (struct mo_file_header))
+    {
+      /* Something went wrong.  */
+      close (fd);
+      return;
+    }
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+    || defined _LIBC
+  /* Now we are ready to load the file.  If mmap() is available we try
+     this first.  If not available or it failed we try to load it.  */
+  data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+                                        MAP_PRIVATE, fd, 0);
+
+  if (data != (struct mo_file_header *) -1)
+    {
+      /* mmap() call was successful.  */
+      close (fd);
+      use_mmap = 1;
+    }
+#endif
+
+  /* If the data is not yet available (i.e. mmap'ed) we try to load
+     it manually.  */
+  if (data == (struct mo_file_header *) -1)
+    {
+      size_t to_read;
+      char *read_ptr;
+
+      data = (struct mo_file_header *) malloc (size);
+      if (data == NULL)
+       return;
+
+      to_read = size;
+      read_ptr = (char *) data;
+      do
+       {
+         long int nb = (long int) read (fd, read_ptr, to_read);
+         if (nb == -1)
+           {
+             close (fd);
+             return;
+           }
+
+         read_ptr += nb;
+         to_read -= nb;
+       }
+      while (to_read > 0);
+
+      close (fd);
+    }
+
+  /* Using the magic number we can test whether it really is a message
+     catalog file.  */
+  if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
+    {
+      /* The magic number is wrong: not a message catalog file.  */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+    || defined _LIBC
+      if (use_mmap)
+       munmap ((caddr_t) data, size);
+      else
+#endif
+       free (data);
+      return;
+    }
+
+  domain_file->data
+    = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+  if (domain_file->data == NULL)
+    return;
+
+  domain = (struct loaded_domain *) domain_file->data;
+  domain->data = (char *) data;
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+    || defined _LIBC
+  domain->use_mmap = use_mmap;
+#endif
+  domain->mmap_size = size;
+  domain->must_swap = data->magic != _MAGIC;
+
+  /* Fill in the information about the available tables.  */
+  switch (W (domain->must_swap, data->revision))
+    {
+    case 0:
+      domain->nstrings = W (domain->must_swap, data->nstrings);
+      domain->orig_tab = (struct string_desc *)
+       ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+      domain->trans_tab = (struct string_desc *)
+       ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+      domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+      domain->hash_tab = (nls_uint32 *)
+       ((char *) data + W (domain->must_swap, data->hash_tab_offset));
+      break;
+    default:
+      /* This is an illegal revision.  */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+    || defined _LIBC
+      if (use_mmap)
+       munmap ((caddr_t) data, size);
+      else
+#endif
+       free (data);
+      free (domain);
+      domain_file->data = NULL;
+      return;
+    }
+
+  /* Show that one domain is changed.  This might make some cached
+     translations invalid.  */
+  ++_nl_msg_cat_cntr;
+}
+
+
+#ifdef _LIBC
+void
+internal_function
+_nl_unload_domain (domain)
+     struct loaded_domain *domain;
+{
+  if (domain->use_mmap)
+    munmap ((caddr_t) domain->data, domain->mmap_size);
+  else
+    free ((void *) domain->data);
+
+  free (domain);
+}
+#endif
diff --git a/intl/localealias.c b/intl/localealias.c
new file mode 100644 (file)
index 0000000..bca555a
--- /dev/null
@@ -0,0 +1,424 @@
+/* Handle aliases for locale names.
+   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+#  include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca
+char *alloca ();
+#   endif
+#  endif
+# endif
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+#  define _GNU_SOURCE  1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+#  define strchr index
+# endif
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions.  This is required by the standard
+   because some ANSI C functions will require linking with this object
+   file and the name space must not be polluted.  */
+# define strcasecmp __strcasecmp
+
+# define mempcpy __mempcpy
+# define HAVE_MEMPCPY  1
+
+/* We need locking here since we can be called from different places.  */
+# include <bits/libc-lock.h>
+
+__libc_lock_define_initialized (static, lock);
+#endif
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+   some additional code emulating it.  */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done.  */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+  void *address;
+  struct block_list *next;
+};
+# define ADD_BLOCK(list, addr)                                               \
+  do {                                                                       \
+    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
+    /* If we cannot get a free block we cannot add the new element to        \
+       the list.  */                                                         \
+    if (newp != NULL) {                                                              \
+      newp->address = (addr);                                                \
+      newp->next = (list);                                                   \
+      (list) = newp;                                                         \
+    }                                                                        \
+  } while (0)
+# define FREE_BLOCKS(list)                                                   \
+  do {                                                                       \
+    while (list != NULL) {                                                   \
+      struct block_list *old = list;                                         \
+      list = list->next;                                                     \
+      free (old);                                                            \
+    }                                                                        \
+  } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+struct alias_map
+{
+  const char *alias;
+  const char *value;
+};
+
+
+static char *string_space = NULL;
+static size_t string_space_act = 0;
+static size_t string_space_max = 0;
+static struct alias_map *map;
+static size_t nmap = 0;
+static size_t maxmap = 0;
+
+
+/* Prototypes for local functions.  */
+static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
+     internal_function;
+static void extend_alias_table PARAMS ((void));
+static int alias_compare PARAMS ((const struct alias_map *map1,
+                                 const struct alias_map *map2));
+
+
+const char *
+_nl_expand_alias (name)
+    const char *name;
+{
+  static const char *locale_alias_path = LOCALE_ALIAS_PATH;
+  struct alias_map *retval;
+  const char *result = NULL;
+  size_t added;
+
+#ifdef _LIBC
+  __libc_lock_lock (lock);
+#endif
+
+  do
+    {
+      struct alias_map item;
+
+      item.alias = name;
+
+      if (nmap > 0)
+       retval = (struct alias_map *) bsearch (&item, map, nmap,
+                                              sizeof (struct alias_map),
+                                              (int (*) PARAMS ((const void *,
+                                                                const void *))
+                                               ) alias_compare);
+      else
+       retval = NULL;
+
+      /* We really found an alias.  Return the value.  */
+      if (retval != NULL)
+       {
+         result = retval->value;
+         break;
+       }
+
+      /* Perhaps we can find another alias file.  */
+      added = 0;
+      while (added == 0 && locale_alias_path[0] != '\0')
+       {
+         const char *start;
+
+         while (locale_alias_path[0] == ':')
+           ++locale_alias_path;
+         start = locale_alias_path;
+
+         while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
+           ++locale_alias_path;
+
+         if (start < locale_alias_path)
+           added = read_alias_file (start, locale_alias_path - start);
+       }
+    }
+  while (added != 0);
+
+#ifdef _LIBC
+  __libc_lock_unlock (lock);
+#endif
+
+  return result;
+}
+
+
+static size_t
+internal_function
+read_alias_file (fname, fname_len)
+     const char *fname;
+     int fname_len;
+{
+#ifndef HAVE_ALLOCA
+  struct block_list *block_list = NULL;
+#endif
+  FILE *fp;
+  char *full_fname;
+  size_t added;
+  static const char aliasfile[] = "/locale.alias";
+
+  full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+  ADD_BLOCK (block_list, full_fname);
+#ifdef HAVE_MEMPCPY
+  mempcpy (mempcpy (full_fname, fname, fname_len),
+          aliasfile, sizeof aliasfile);
+#else
+  memcpy (full_fname, fname, fname_len);
+  memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+#endif
+
+  fp = fopen (full_fname, "r");
+  if (fp == NULL)
+    {
+      FREE_BLOCKS (block_list);
+      return 0;
+    }
+
+  added = 0;
+  while (!feof (fp))
+    {
+      /* It is a reasonable approach to use a fix buffer here because
+        a) we are only interested in the first two fields
+        b) these fields must be usable as file names and so must not
+           be that long
+       */
+      unsigned char buf[BUFSIZ];
+      unsigned char *alias;
+      unsigned char *value;
+      unsigned char *cp;
+
+      if (fgets (buf, sizeof buf, fp) == NULL)
+       /* EOF reached.  */
+       break;
+
+      /* Possibly not the whole line fits into the buffer.  Ignore
+        the rest of the line.  */
+      if (strchr (buf, '\n') == NULL)
+       {
+         char altbuf[BUFSIZ];
+         do
+           if (fgets (altbuf, sizeof altbuf, fp) == NULL)
+             /* Make sure the inner loop will be left.  The outer loop
+                will exit at the `feof' test.  */
+             break;
+         while (strchr (altbuf, '\n') == NULL);
+       }
+
+      cp = buf;
+      /* Ignore leading white space.  */
+      while (isspace (cp[0]))
+       ++cp;
+
+      /* A leading '#' signals a comment line.  */
+      if (cp[0] != '\0' && cp[0] != '#')
+       {
+         alias = cp++;
+         while (cp[0] != '\0' && !isspace (cp[0]))
+           ++cp;
+         /* Terminate alias name.  */
+         if (cp[0] != '\0')
+           *cp++ = '\0';
+
+         /* Now look for the beginning of the value.  */
+         while (isspace (cp[0]))
+           ++cp;
+
+         if (cp[0] != '\0')
+           {
+             size_t alias_len;
+             size_t value_len;
+
+             value = cp++;
+             while (cp[0] != '\0' && !isspace (cp[0]))
+               ++cp;
+             /* Terminate value.  */
+             if (cp[0] == '\n')
+               {
+                 /* This has to be done to make the following test
+                    for the end of line possible.  We are looking for
+                    the terminating '\n' which do not overwrite here.  */
+                 *cp++ = '\0';
+                 *cp = '\n';
+               }
+             else if (cp[0] != '\0')
+               *cp++ = '\0';
+
+             if (nmap >= maxmap)
+               extend_alias_table ();
+
+             alias_len = strlen (alias) + 1;
+             value_len = strlen (value) + 1;
+
+             if (string_space_act + alias_len + value_len > string_space_max)
+               {
+                 /* Increase size of memory pool.  */
+                 size_t new_size = (string_space_max
+                                    + (alias_len + value_len > 1024
+                                       ? alias_len + value_len : 1024));
+                 char *new_pool = (char *) realloc (string_space, new_size);
+                 if (new_pool == NULL)
+                   {
+                     FREE_BLOCKS (block_list);
+                     return added;
+                   }
+                 string_space = new_pool;
+                 string_space_max = new_size;
+               }
+
+             map[nmap].alias = memcpy (&string_space[string_space_act],
+                                       alias, alias_len);
+             string_space_act += alias_len;
+
+             map[nmap].value = memcpy (&string_space[string_space_act],
+                                       value, value_len);
+             string_space_act += value_len;
+
+             ++nmap;
+             ++added;
+           }
+       }
+    }
+
+  /* Should we test for ferror()?  I think we have to silently ignore
+     errors.  --drepper  */
+  fclose (fp);
+
+  if (added > 0)
+    qsort (map, nmap, sizeof (struct alias_map),
+          (int (*) PARAMS ((const void *, const void *))) alias_compare);
+
+  FREE_BLOCKS (block_list);
+  return added;
+}
+
+
+static void
+extend_alias_table ()
+{
+  size_t new_size;
+  struct alias_map *new_map;
+
+  new_size = maxmap == 0 ? 100 : 2 * maxmap;
+  new_map = (struct alias_map *) realloc (map, (new_size
+                                               * sizeof (struct alias_map)));
+  if (new_map == NULL)
+    /* Simply don't extend: we don't have any more core.  */
+    return;
+
+  map = new_map;
+  maxmap = new_size;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+  if (string_space != NULL)
+    free (string_space);
+  if (map != NULL)
+    free (map);
+}
+text_set_element (__libc_subfreeres, free_mem);
+#endif
+
+
+static int
+alias_compare (map1, map2)
+     const struct alias_map *map1;
+     const struct alias_map *map2;
+{
+#if defined _LIBC || defined HAVE_STRCASECMP
+  return strcasecmp (map1->alias, map2->alias);
+#else
+  const unsigned char *p1 = (const unsigned char *) map1->alias;
+  const unsigned char *p2 = (const unsigned char *) map2->alias;
+  unsigned char c1, c2;
+
+  if (p1 == p2)
+    return 0;
+
+  do
+    {
+      /* I know this seems to be odd but the tolower() function in
+        some systems libc cannot handle nonalpha characters.  */
+      c1 = isupper (*p1) ? tolower (*p1) : *p1;
+      c2 = isupper (*p2) ? tolower (*p2) : *p2;
+      if (c1 == '\0')
+       break;
+      ++p1;
+      ++p2;
+    }
+  while (c1 == c2);
+
+  return c1 - c2;
+#endif
+}
diff --git a/intl/po2tbl.sed.in b/intl/po2tbl.sed.in
new file mode 100644 (file)
index 0000000..b3bcca4
--- /dev/null
@@ -0,0 +1,102 @@
+# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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.
+#
+1 {
+  i\
+/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot.  */\
+\
+#if HAVE_CONFIG_H\
+# include <config.h>\
+#endif\
+\
+#include "libgettext.h"\
+\
+const struct _msg_ent _msg_tbl[] = {
+  h
+  s/.*/0/
+  x
+}
+#
+# Write msgid entries in C array form.
+#
+/^msgid/ {
+  s/msgid[     ]*\(".*"\)/  {\1/
+  tb
+# Append the next line
+  :b
+  N
+# Look whether second part is continuation line.
+  s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+# Yes, then branch.
+  ta
+# Because we assume that the input file correctly formed the line
+# just read cannot be again be a msgid line.  So it's safe to ignore
+# it.
+  s/\(.*\)\n.*/\1/
+  bc
+# We found a continuation line.  But before printing insert '\'.
+  :a
+  s/\(.*\)\(\n.*\)/\1\\\2/
+  P
+# We cannot use D here.
+  s/.*\n\(.*\)/\1/
+# Some buggy seds do not clear the `successful substitution since last ``t'''
+# flag on `N', so we do a `t' here to clear it.
+  tb
+# Not reached
+  :c
+  x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+  td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+  :d
+  s/9\(_*\)$/_\1/
+  td
+# Assure at least one digit is available.
+  s/^\(_*\)$/0\1/
+# Increment the last digit.
+  s/8\(_*\)$/9\1/
+  s/7\(_*\)$/8\1/
+  s/6\(_*\)$/7\1/
+  s/5\(_*\)$/6\1/
+  s/4\(_*\)$/5\1/
+  s/3\(_*\)$/4\1/
+  s/2\(_*\)$/3\1/
+  s/1\(_*\)$/2\1/
+  s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+  s/_/0/g
+  x
+  G
+  s/\(.*\)\n\([0-9]*\)/\1, \2},/
+  s/\(.*\)"$/\1/
+  p
+}
+#
+# Last line.
+#
+$ {
+  i\
+};\
+
+  g
+  s/0*\(.*\)/int _msg_tbl_length = \1;/p
+}
+d
diff --git a/intl/textdomain.c b/intl/textdomain.c
new file mode 100644 (file)
index 0000000..8855746
--- /dev/null
@@ -0,0 +1,108 @@
+/* Implementation of the textdomain(3) function.
+   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Name of the default text domain.  */
+extern const char _nl_default_default_domain[];
+
+/* Default text domain in which entries for gettext(3) are to be found.  */
+extern const char *_nl_current_default_domain;
+
+
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define TEXTDOMAIN __textdomain
+# ifndef strdup
+#  define strdup(str) __strdup (str)
+# endif
+#else
+# define TEXTDOMAIN textdomain__
+#endif
+
+/* Set the current default message catalog to DOMAINNAME.
+   If DOMAINNAME is null, return the current default.
+   If DOMAINNAME is "", reset to the default of "messages".  */
+char *
+TEXTDOMAIN (domainname)
+     const char *domainname;
+{
+  char *old;
+
+  /* A NULL pointer requests the current setting.  */
+  if (domainname == NULL)
+    return (char *) _nl_current_default_domain;
+
+  old = (char *) _nl_current_default_domain;
+
+  /* If domain name is the null string set to default domain "messages".  */
+  if (domainname[0] == '\0'
+      || strcmp (domainname, _nl_default_default_domain) == 0)
+    _nl_current_default_domain = _nl_default_default_domain;
+  else
+    {
+      /* If the following malloc fails `_nl_current_default_domain'
+        will be NULL.  This value will be returned and so signals we
+        are out of core.  */
+#if defined _LIBC || defined HAVE_STRDUP
+      _nl_current_default_domain = strdup (domainname);
+#else
+      size_t len = strlen (domainname) + 1;
+      char *cp = (char *) malloc (len);
+      if (cp != NULL)
+       memcpy (cp, domainname, len);
+      _nl_current_default_domain = cp;
+#endif
+    }
+
+  if (old != _nl_default_default_domain)
+    free (old);
+
+  return (char *) _nl_current_default_domain;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library.  */
+weak_alias (__textdomain, textdomain);
+#endif
diff --git a/intl/xopen-msg.sed b/intl/xopen-msg.sed
new file mode 100644 (file)
index 0000000..e7a4c99
--- /dev/null
@@ -0,0 +1,104 @@
+# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
+# Copyright 1995, 2002 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number.  We use always set number 1.
+#
+1 {
+  i\
+$set 1 # Automatically created by po2msg.sed
+  h
+  s/.*/0/
+  x
+}
+#
+# We copy all comments into the .msg file.  Perhaps they can help.
+#
+/^#/ s/^#[     ]*/$ /p
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+# Does not work now
+#  /"$/! {
+#    s/\\$//
+#    s/$/ ... (more lines following)"/
+#  }
+  s/^msgid[    ]*"\(.*\)"$/$ Original Message: \1/
+  p
+}
+#
+# The .msg file contains, other than the .po file, only the translations
+# but each given a unique ID.  Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here.  (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+  s/msgstr[    ]*"\(.*\)"/\1/
+  x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+  td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+  :d
+  s/9\(_*\)$/_\1/
+  td
+# Assure at least one digit is available.
+  s/^\(_*\)$/0\1/
+# Increment the last digit.
+  s/8\(_*\)$/9\1/
+  s/7\(_*\)$/8\1/
+  s/6\(_*\)$/7\1/
+  s/5\(_*\)$/6\1/
+  s/4\(_*\)$/5\1/
+  s/3\(_*\)$/4\1/
+  s/2\(_*\)$/3\1/
+  s/1\(_*\)$/2\1/
+  s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+  s/_/0/g
+  x
+# Bring the line in the format `<number> <message>'
+  G
+  s/^[^\n]*$/& /
+  s/\(.*\)\n\([0-9]*\)/\2 \1/
+# Clear flag from last substitution.
+  tb
+# Append the next line.
+  :b
+  N
+# Look whether second part is a continuation line.
+  s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+  ta
+  P
+  D
+# Note that `D' includes a jump to the start!!
+# We found a continuation line.  But before printing insert '\'.
+  :a
+  s/\(.*\)\(\n.*\)/\1\\\2/
+  P
+# We cannot use the sed command `D' here
+  s/.*\n\(.*\)/\1/
+  tb
+}
+d
index 2b02417c46d93d5090f33f494c2da6ab58c018b7..e73ff16f7f879912f4937308a325e756873c8d2a 100644 (file)
--- a/ltcf-c.sh
+++ b/ltcf-c.sh
@@ -223,10 +223,6 @@ EOF
     hardcode_shlibpath_var=no
     ;;
 
-  tpf*)
-    ld_shlibs=yes
-    ;;
-
   *)
     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
index 620b318e09a6d4653caa6150bd14507e93cddee5..465650ff4d5b57d52a95b724e21bab4961257a5f 100644 (file)
@@ -652,9 +652,6 @@ case $host_os in
         ;;
     esac
     ;;
-  tpf*)
-    ld_shlibs=yes
-    ;;
   unixware*)
     # FIXME: insert proper C++ library support
     ld_shlibs=no
index 2fec9afa1ed602c23c27a7d046791ed6b100da68..7972327da0a7f9be7720ecd56b7c3177fffa271f 100755 (executable)
--- a/ltconfig
+++ b/ltconfig
@@ -1371,18 +1371,6 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   esac
   ;;
 
-tpf*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
diff --git a/mmalloc/COPYING.LIB b/mmalloc/COPYING.LIB
new file mode 100644 (file)
index 0000000..eb685a5
--- /dev/null
@@ -0,0 +1,481 @@
+                 GNU LIBRARY GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+                    675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+\f
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+\f
+                 GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+     Appendix: How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/mmalloc/ChangeLog b/mmalloc/ChangeLog
new file mode 100644 (file)
index 0000000..a1e3ad0
--- /dev/null
@@ -0,0 +1,491 @@
+2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * Makefile.in (install-info): Create dest dir. Support DESTDIR.
+       (install): Likewise.
+
+2002-11-28  Elena Zannoni  <ezannoni@redhat.com>
+
+       * Makefile.in (install): Move install-info to here...
+       (all): ...from here.
+
+2002-11-26  Elena Zannoni  <ezannoni@redhat.com>
+
+       * Makefile.in (INFO_DEPS): Define.
+       (all): Add install-info to the rule.
+       (info): Unse INFO_DEPS.
+       (install-info): Rewrite.
+       (uninstall-info): New.
+       (uninstall): New.
+
+2002-04-07  Andrew Cagney  <ac131313@redhat.com>
+
+       From 2002-03-05 Scott Pakin <pakin@uiuc.edu>
+       * mmap-sup.c (MAP_PRIVATE_OR_SHARED): Define.
+       (__mmalloc_mmap_morecore): Use.
+       (__mmalloc_remap_core): Use.
+       
+2000-05-17  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * Makefile.in (install-info): Make sure $(infodir) exists.  Run
+       install-info program on the installed Info files.
+
+2000-03-20  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * Makefile.in (install): Append "n", not ".n" to libmmalloc.a,
+       since the latter loses on DOS 8+3 filesystems.
+
+Mon Feb 28 10:33:51 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * MAINTAINERS: New file.
+
+2000-02-18  Frank Ch. Eigler  <fche@redhat.com>
+
+       From Jason "crash" Molenda <jsm@cygnus.com>:
+       * configure.in: Check for getpagesize declaration.
+       * mvmalloc.c, mmap-sup.c: Conditionally declare getpagesize.
+       * configure: Regenerated.
+
+Fri Feb 18 11:42:21 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * configure.in: Check for <unistd.h>.
+       * configure: Regenerate.
+
+       From 2000-02-17 RodneyBrown@pmsc.com:
+       * mm.c, attach.c, mmap-sup.c, sbrk-sup.c: Include <unistd.h> for
+       sbrk and lseek declarations.  Update copyright.
+
+2000-02-04  Kevin Buettner  (kevinb@cygnus.com)
+
+       * acinclude.m4, aclocal.m4: New files.
+       * configure.in (sbrk): Use BFD_NEED_DECLARATION to test for
+       presence of a suitable declaration in the system headers.
+       * configure: Regenerated.
+       * sbrk-sup.c (sbrk): Ifdef'd with NEED_DECLARATION_SBRK.
+
+1999-01-04  Jason Molenda  (jsm@bugshack.cygnus.com)
+
+       * configure.in: Requires autoconf 2.12.1 or higher.
+       * configure: Regenerated.
+
+1998-07-24  Jim Blandy  <jimb@zwingli.cygnus.com>
+
+       * mcalloc.c: #include <sys/types.h> before <string.h>.  HP/UX 11.0
+       needs this.
+
+Thu Apr 23 12:19:22 1998  Philippe De Muyter  <phdm@macqel.be>
+
+        * mmalloc.h: Include sys/types.h and stdio.h #ifndef HAVE_STDDEF_H.
+        * mmprivate.h: Do not handle HAVE_STDDEF_H here, since we include
+        mmalloc.h.
+
+Tue Mar 24 17:07:02 1998  Stu Grossman  <grossman@bhuna.cygnus.co.uk>
+
+       * Makefile.in:  Get SHELL from configure.
+       * configure:  Regenerate with autoconf 2.12.1 to fix shell issues for
+       NT native builds.
+
+Mon Feb  7 13:06:45 1997  Philippe De Muyter  <phdm@macqel.be>
+
+        * mmalloc/detach.c: Do not include fcntl.h.
+
+Thu Aug 28 13:15:07 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * mrealloc.c (realloc): Store result in local variable before
+       returning it.  Makes debugging much easier at negligible cost.
+
+Tue Feb  4 16:30:59 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * mvalloc.c (cache_pagesize): Rename from pagesize, so that if we
+       are building mm.o, it does not conflict with the variable of the
+       same name in mmap-sup.c.
+
+Sat Dec 28 12:48:32 1996  Fred Fish  <fnf@cygnus.com>
+
+       * Makefile.in (mm.o): New target that combines all the functions
+       into a single object module.  This avoids client programs picking
+       up part of the allocation routines from mmalloc and part from libc,
+       which can lead to undefined behavior.
+       (CFILES): Add mm.c
+       (TARGETOBJS): Define to be either the individual objects or the
+       single combined object.
+       (TARGETLIB): Create the archive using TARGETOBJS.
+       * mm.c: New file that simply #includes the other source C files.
+       
+Thu Oct  3 15:45:23 1996  Jason Molenda  (crash@godzilla.cygnus.co.jp)
+
+       * Makefile.in (maintainer-clean): Depend on distclean, remove
+       duplication.
+
+Tue Sep 10 17:52:06 1996  Fred Fish  <fnf@cygnus.com>
+
+       * mmcheck.c (checkhdr): Add prototype.
+       (mfree_check): Ditto.
+       (mmalloc_check): Ditto.
+       (mrealloc_check): Ditto.
+       * mmtrace.c (tr_break): Ditto.
+       (tr_freehook): Ditto.
+       (tr_mallochook): Ditto.
+       (tr_reallochook): Ditto.
+       * sbrk-sup.c (sbrk_morecore): Ditto.
+
+Wed Sep  4 18:02:45 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+       * configure configure.in:  Don't default CC to cc.  It causes problems
+       when starting a compile in the mmalloc directory.
+
+Wed Jul 24 00:53:34 1996  Fred Fish  <fnf@cygnus.com>
+
+       * mmalloc.h (mmalloc_findbase): Add prototype.
+
+Fri Jul 12 18:35:34 1996  Fred Fish  <fnf@cygnus.com>
+
+       * mmap-sup.c (mmalloc_findbase): Change to not require /dev/zero
+       if MMAP_ANONYMOUS is available.
+
+Wed Jul 10 23:53:42 1996  Fred Fish  <fnf@cygnus.com>
+
+       * detach.c (mmalloc_detach): Fix bug in computation of negative
+       brk value.
+       * mmcheck.c (mmcheckf): Renamed from mmcheck and new FORCE argument
+       added.  Replaced hack that always allowed checking routines to be
+       installed and enforce restriction that they have to be installed
+       prior to allocating any memory on the used heap or the FORCE argument
+       has to be non-NULL.
+       (mmcheck): New function that calls mmcheckf with FORCE set to zero,
+       for backwards compatibility.
+       * mmalloc.c (malloc): Store result in local variable before
+       returning it.  Makes debugging much easier at negligible cost.
+       * mmalloc.h (mmcheckf): Declare.
+       * attach.c (reuse): Call mmcheckf rather than mmcheck.
+       * mmap-sup.c (__mmalloc_mmap_morecore): Improve to allow mmap
+       to select a base mapping address if none is otherwise given.
+       (mmalloc_findbase): New function that user can call to find
+       an available mapping address of a given size.
+       
+Tue Jun 25 22:54:06 1996  Jason Molenda  (crash@godzilla.cygnus.co.jp)
+
+       * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir):
+       Use autoconf-set values.
+       (docdir): Removed.
+       * configure.in (AC_PREREQ): autoconf 2.5 or higher.
+       * configure: Rebuilt.
+
+Tue May 28 13:51:22 1996  Fred Fish  <fnf@cygnus.com>
+
+       From: Thomas A Peterson <tap@src.honeywell.com>
+       * Makefile.in (install-info): Apply patch to install
+       mmalloc.info from srcdir if not found in build dir.
+
+Sun Apr  7 20:55:30 1996  Fred Fish  <fnf@rtl.cygnus.com>
+
+       From: Miles Bader  <miles@gnu.ai.mit.edu>
+       * configure.in: Use AC_CHECK_TOOL to find AR & RANLIB.
+       * configure: Regenerate with autoconf.
+       * Makefile.in: Use AR set by configure substitution.
+       
+Fri Mar 29 09:57:36 1996  Fred Fish  <fnf@cygnus.com>
+
+       * mmalloc.h (mmtrace): Add prototype.
+
+Sat Feb  3 12:41:00 1996  Fred Fish  <fnf@cygnus.com>
+
+       From H.J. Lu (hjl@gnu.ai.mit.edu):
+       * mvalloc.c (valloc): new.
+       * mmemalign.c: Allocate (SIZE + ALIGNMENT - 1) and then trim
+       if possible.
+       (memalign): don't put the node on the _aligned_blocks list more
+       than once.
+
+Mon Nov 20 12:04:32 1995  Fred Fish  <fnf@cygnus.com>
+
+       * Makefile.in (OFILES): Make objects depend upon Makefile,
+       since Makefile sets DEFS which can definitely affect how
+       objects are to be compiled.
+
+Mon Nov  6 14:12:13 1995  Jason Molenda  (crash@phydeaux.cygnus.com)
+
+       * configure.in (AC_CHECK_HEADERS): add limits.h.
+       (AC_HEADER_STDC): remove.
+
+       * mmalloc.h: document necessity of defining size_t before
+       including mmalloc.h.
+
+       * mmprivate.h: add check for limits.h, remove definition of
+       NULL and size_t.
+
+Sun Nov  5 00:27:36 1995  Jason Molenda  (crash@phydeaux.cygnus.com)
+
+       * configure.in: AC_CHECK_HEADERS, not AC_CHECK_HEADER.
+
+Sun Nov  5 00:14:13 1995  Jason Molenda  (crash@phydeaux.cygnus.com)
+
+       * configure.in: add check for stddef.h
+       * mmalloc.h: include stddef.h if HAVE_STDDEF_H is defined.
+
+Sat Nov  4 19:10:13 1995  Jason Molenda  (crash@phydeaux.cygnus.com)
+
+       * configure.in: add AC_HEADER_STDC check.
+
+       * mmalloc.h: check if STDC_HEADERS instead of __STDC__.
+
+       * mmprivate.h: check if STDC_HEADERS instead of __STDC__.
+
+Tue Oct 24 13:17:44 1995  Stan Shebs  <shebs@andros.cygnus.com>
+
+       * mmprivate.h: Remove declarations (PTR, etc) that are already
+       provided by ansidecl.h, include mmalloc.h earlier in file.
+
+Tue Oct 10 11:04:47 1995  Fred Fish  <fnf@cygnus.com>
+
+       * Makefile.in (BISON):  Remove macro.
+
+Wed Sep 20 12:51:13 1995  Ian Lance Taylor  <ian@cygnus.com>
+
+       * Makefile.in (maintainer-clean): New target, synonym for
+       realclean.  Add GNU standard maintainer-clean echos.
+
+Thu Aug  3 10:45:37 1995  Fred Fish  <fnf@cygnus.com>
+
+       * Update all FSF addresses except those in COPYING* files
+       and shar archive of original FSF files.
+
+Mon Jun 12 12:11:57 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
+
+       * Makefile.in (distclean, realclean): Remove config.cache and
+         config.log.
+
+Wed May 17 17:47:44 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
+
+       * Makefile.in (Makefile): Added config.status to dependency list.
+         (config.status): New target.
+
+Fri May  5 15:17:53 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
+
+       * mmap-sup.c: Removed munmap prototype.  Some systems have a
+         slightly different prototype.
+
+Wed May  3 17:18:13 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
+
+       * Makefile.in, configure.in: Converted to use autoconf.
+       * configure: New file, generated with autoconf 2.3.
+       * config/{mh-go32, mh-irix, mh-ncr3000, mh-sunos4, 
+         mh-sysv4}: Removed.
+
+Thu Nov  3 23:55:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
+
+       * Makefile.in (install-info): Name destination file correctly,
+       rather than using undefined shell variable.
+
+Fri Oct 28 16:46:58 1994  Stan Shebs  (shebs@andros.cygnus.com)
+
+       * mmprivate.h: New file, was mmalloc.h.
+       (mmalloc.h): Include.
+       * mmalloc.h: Remove all but declarations of mmalloc functions.
+       (ansidecl.h): Include.
+       * attach.c, et al: Include mmprivate.h instead of mmalloc.h.
+
+Wed Aug 24 12:55:33 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
+
+       * configure.in: Change i[34]86 to i[345]86.
+
+Mon Aug 22 11:36:40 1994  Stan Shebs  (shebs@andros.cygnus.com)
+
+       * Makefile.in (distclean): Separate from realclean.
+       (realclean): Remove mmalloc.info.
+
+Fri May  6 13:04:25 1994  Steve Chamberlain  (sac@cygnus.com)
+
+        * config/go32.mh: New file
+       * configure.in (host==go32):  Use new fragment.
+
+Tue Feb  8 00:32:28 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
+
+       * mmtrace.c (tr_freehook, tr_mallochook, tr_reallochook):
+       Cast addresses put out via fprintf to unsigned long and use %lx.
+
+Tue Nov 16 20:33:17 1993  Jim Kingdon  (kingdon@deneb.cygnus.com)
+
+       * COPYING.LIB: New file (standard version 2 LGPL, as already cited
+       by the source files).
+
+Fri Nov  5 11:47:33 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * Makefile.in (info dvi install-info): Actually make the manual.
+
+Mon Nov  1 14:20:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * mmalloc.texi: Fix typo ("for for" -> "for").
+
+Fri Jul 16 15:27:08 1993  Jim Kingdon  (kingdon@rtl.cygnus.com)
+
+       * test1.c: New file which tests for bug fixed below.
+       * Makefile.in (check): Put in commands to run it (but commented out
+       because it won't work for Canadian cross).
+
+       * mmalloc.c (mmalloc): When extending a free block at the end of the
+       heap, check whether which block is at the end changed.
+
+       * Makefile.in (TAGS): make work when srcdir != objdir.
+
+Thu Jul 15 07:56:47 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * attach.c, detach.c: Include <sys/types.h> before <fcntl.h>.
+
+Wed Jun 30 11:00:53 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * Makefile.in: Add mostlyclean and realclean targets.
+
+Wed Mar 24 01:58:12 1993  david d `zoo' zuhn  (zoo at poseidon.cygnus.com)
+
+       * Makefile.in: add dvi and installcheck targets
+
+Fri Mar 12 18:35:43 1993  david d `zoo' zuhn  (zoo at cirdan.cygnus.com)
+
+       * configure.in: recognize *-*-solaris2* instead of *-*-solaris* (a
+       number of people want to call SunOS 4.1.2 "solaris1.0" and get it right)
+
+Mon Feb 22 18:08:53 1993  John Gilmore  (gnu@cygnus.com)
+
+       * Makefile.in (distclean):  Add.
+
+Tue Feb 16 08:09:15 1993  Fred Fish  (fnf@cygnus.com)
+
+       * Makefile.in, attach.c, detach.c, keys.c, mmap-sup.c, mmtrace.c,
+       sbrk-sup.c:  Use GNU Library General Public License, like other
+       files.
+
+Wed Nov 18 19:18:59 1992  John Gilmore  (gnu@cygnus.com)
+
+       * configure.in:  Regularize list of host configs.
+
+Fri Oct 30 00:59:46 1992  John Gilmore  (gnu@cygnus.com)
+
+       * mmalloc.texi:  Add missing doubled @.  Bugfix by Paul Eggert.
+
+Fri Oct 23 01:50:52 1992  Stu Grossman  (grossman at cygnus.com)
+
+       * configure.in:  Handle solaris same as sysv4.
+
+Thu Oct  1 23:34:20 1992  david d `zoo' zuhn  (zoo at cirdan.cygnus.com)
+
+       * configure.in: use cpu-vendor-os triple instead of nested cases
+
+Sun Aug 23 11:09:46 1992  Fred Fish  (fnf@cygnus.com)
+
+       * sbrk-sup.c (__mmalloc_brk_init):  Ensure base of sbrk'd region
+       is aligned.  Bug reported by Andrew Heybey (ath@lcs.mit.edu).
+
+Wed Aug 19 14:49:23 1992  Ian Lance Taylor  (ian@cygnus.com)
+
+       * Makefile.in: always create installation directories.
+
+Mon Jul 20 21:15:44 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mrealloc.c:  Minor code format style changes for consistency.
+
+Fri Jul  3 20:25:30 1992  Fred Fish  (fnf@cygnus.com)
+
+       * attach.c, detach.c, mcalloc.c, mmalloc.c, mmtrace.c, mrealloc.c,
+       sbrk-sup.c:  Remove "(void)" casts from function calls where the
+       return value is ignored, in accordance with GNU coding standards.
+
+Tue Jun 30 16:44:41 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mmalloc.h (struct mdesc):  Add FIXME comments to point out the
+       need to save some data on a per-process basis for mapped regions
+       that are shared.
+       * attach.c (reuse):  Update the morecore field for reused mapped
+       regions to be correct for the current process.
+
+Mon Jun 29 10:45:25 1992  Fred Fish  (fnf at cygnus.com)
+
+       * mmtrace.c:  Lint.
+
+Mon Jun 15 12:20:16 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mmalloc.h (struct mdesc):  Change member "errno" to
+       "saved_errno" to avoid possible conflict with ANSI C environments,
+       where it is allowed to be a macro.
+       * config/mh-ncr3000 (INSTALL):  Don't use /usr/ucb/install,
+       it is broken on ncr 3000's.
+       * config/mh-ncr3000 (RANLIB):  Use RANLIB=true.
+
+Fri Jun 12 21:34:21 1992  John Gilmore  (gnu at cygnus.com)
+
+       * mmap-sup.c:  Avoid ANSI C "empty translation unit" idiocy.
+
+Tue Jun  9 17:29:04 1992  Fred Fish  (fnf@cygnus.com)
+
+       * config/{mh-ncr3000, mh-sysv4}:  Add definition for INSTALL using
+       /usr/ucb/install.
+
+Thu Apr 30 22:36:31 1992  Fred Fish  (fnf@cygnus.com)
+
+       * sbrk-sup.c (sbrk_morecore):  Fix sbrk() error return test.
+
+Mon Apr 20 21:03:30 1992  K. Richard Pixley  (rich@cygnus.com)
+
+       * Makefile.in: rework CFLAGS so that they can be passed from the
+         command line.  remove MINUS_G.  Default CFLAGS to -g.
+
+Thu Apr 16 20:00:21 1992  Fred Fish  (fnf@cygnus.com)
+
+       * TODO:  New file.
+       * attach.c, mcalloc.c, mfree.c, mmalloc.c, mmalloc.h, mmap-sup.c,
+       mmcheck.c, mtrace.c, mrealloc.c, mvalloc.c, sbrk-sup.c:  Lint.
+
+Fri Apr 10 22:59:17 1992  Fred Fish  (fnf@cygnus.com)
+
+       * configure.in:  Recognize new ncr3000 config.
+       * config/mh-ncr3000:  New config file.
+       * Makefile.in (MINUS_G):  Add macro and default to -g.
+
+Wed Apr  8 09:34:53 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mmalloc.c:  Minor fix to comment.
+       * mmalloc.texi:  Update to match actual implementation
+       * mmalloc.h (morecore):  Change prototype's 2nd arg to int.
+
+Tue Apr  7 22:16:09 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mmalloc.h (size_t, CHAR_BIT):  Only redefine if not already
+       defined.
+
+Mon Apr  6 20:49:33 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mmalloc.h:  Remove include of <stdlib.h>.  This also gets rid
+       of the ugly kludge installed on 1-Apr-92.
+
+Mon Apr  6 16:33:37 1992  Stu Grossman  (grossman at cygnus.com)
+
+       * detach.c (mmalloc_detach):  Arg should be PTR, not void *.
+       Fixes complaints from non __STDC__ systems.
+
+Wed Apr  1 11:47:02 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mcalloc.c, mfree.c, mmalloc.c, mrealloc.c:  Minor comment
+       change.
+       * mmalloc.h:  Add ugly kludge to band-aid over problems with
+       bogus vendor <stdlib.h> files.
+
+Sun Mar 29 12:41:31 1992  John Gilmore  (gnu at cygnus.com)
+
+       * attach.c, mmalloc.c, mmcheck.c:  Lint.
+
+Thu Mar 26 17:06:04 1992  Fred Fish  (fnf@cygnus.com)
+
+       * attach.c (reuse):  Explicitly discard return value of mmcheck.
+       * mmcheck.c (mmcheck):  Document requirements for installing
+       corruption checking hooks and set up to enforce restrictions.
+
+Tue Mar 24 23:41:10 1992  K. Richard Pixley  (rich@cygnus.com)
+
+       * config/mh-irix4: new file.
+
+       * Makefile.in: added standard targets, fixed install directories.
+
+Sat Mar 14 17:34:59 1992  Fred Fish  (fnf@cygnus.com)
+
+       * Initial release, incorporated into gdb.
+
+
diff --git a/mmalloc/MAINTAINERS b/mmalloc/MAINTAINERS
new file mode 100644 (file)
index 0000000..0904867
--- /dev/null
@@ -0,0 +1,5 @@
+The mmalloc directory is maintained by the GDB group's Host
+maintainers.
+
+This code is in a maintain-only phase - only configury patches fixing
+host compile problems are generally accepted.
diff --git a/mmalloc/Makefile.in b/mmalloc/Makefile.in
new file mode 100644 (file)
index 0000000..b05aea7
--- /dev/null
@@ -0,0 +1,247 @@
+# Copyright (C) 1992 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+
+# The GNU C Library 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
+# Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public
+# License along with the GNU C Library; see the file COPYING.LIB.  If
+# not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+#
+# Makefile for mmalloc directory
+#
+
+# Directory containing source files.  Don't clean up the spacing,
+# this exact string is matched for by the "configure" script.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+prefix =       @prefix@
+exec_prefix =  @exec_prefix@
+
+bindir =       @bindir@
+libdir =       @libdir@
+
+datadir =      @datadir@
+mandir =       @mandir@
+man1dir =      $(mandir)/man1
+man2dir =      $(mandir)/man2
+man3dir =      $(mandir)/man3
+man4dir =      $(mandir)/man4
+man5dir =      $(mandir)/man5
+man6dir =      $(mandir)/man6
+man7dir =      $(mandir)/man7
+man8dir =      $(mandir)/man8
+man9dir =      $(mandir)/man9
+infodir =      @infodir@
+includedir =   @includedir@
+
+SHELL =                @SHELL@
+
+INSTALL =      @INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+AR =           @AR@
+AR_FLAGS =     qv
+CFLAGS =       -g
+MAKEINFO =     makeinfo
+RANLIB =       @RANLIB@
+RM =           rm
+
+# where to find makeinfo
+MAKEINFO=makeinfo
+
+SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS
+
+# Files which should be generated via 'info' and installed by 'install-info'
+INFO_DEPS = mmalloc.info
+
+# The TeX formatter
+TEX = tex
+
+TARGETLIB =    libmmalloc.a
+
+CFILES =       mcalloc.c mfree.c mmalloc.c mmcheck.c mmemalign.c mmstats.c \
+               mmtrace.c mrealloc.c mvalloc.c mmap-sup.c attach.c detach.c \
+               keys.c sbrk-sup.c mm.c
+
+HFILES =       mmalloc.h
+
+OFILES =       mcalloc.o mfree.o mmalloc.o mmcheck.o mmemalign.o mmstats.o \
+               mmtrace.o mrealloc.o mvalloc.o mmap-sup.o attach.o detach.o \
+               keys.o sbrk-sup.o
+
+DEFS =         @DEFS@
+
+# The current default is to build a single object module with all the mmalloc
+# functions.  To build a more traditional library, flip this macro definition.
+#TARGETOBJS =  $(OFILES)
+TARGETOBJS =   mm.o
+
+.c.o:
+               $(CC) -c $(CFLAGS) $(DEFS) -I. -I$(srcdir)/../include $<
+
+# Do we want/need any config overrides?
+#       
+
+STAGESTUFF =   $(TARGETLIB) *.o
+
+all:           $(TARGETLIB)
+
+info: $(INFO_DEPS)
+dvi: mmalloc.dvi
+clean-info:
+installcheck:
+
+mmalloc.info: mmalloc.texi
+       $(MAKEINFO) -I $(srcdir) -o ./mmalloc.info mmalloc.texi
+
+# This file doesn't need texindex currently.
+mmalloc.dvi: mmalloc.texi
+       $(SET_TEXINPUTS) $(TEX) mmalloc.texi
+       rm -f mmalloc.?? mmalloc.??s mmalloc.log mmalloc.aux mmalloc.toc
+
+install-info: info
+       $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(infodir)
+       @list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+           if test -f $$d/$$ifile; then \
+             echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+             $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
+           else : ; fi; \
+         done; \
+       done
+       $(POST_INSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+         list='$(INFO_DEPS)'; \
+         for file in $$list; do \
+           echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+           install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+         done; \
+       else : ; fi
+
+uninstall-info:
+       $(PRE_UNINSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+         ii=yes; \
+       else ii=; fi; \
+       list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         test -z "$$ii" \
+           || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
+       done
+       $(NORMAL_UNINSTALL)
+       list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+       done
+
+check: test1.c
+#      $(CC) -g $(srcdir)/test1.c libmmalloc.a
+# This loses for Canadian cross (building mmalloc with a cross-compiler).
+# There is probably some dejagnu-ish solution (such as what we are doing
+# for gdb, perhaps).
+#      ./a.out
+
+install:       all install-info
+               $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libdir)
+               $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(TARGETLIB)n
+               $(RANLIB) $(DESTDIR)$(libdir)/$(TARGETLIB)n
+               mv -f $(DESTDIR)$(libdir)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(TARGETLIB)
+
+uninstall:     uninstall-info
+
+$(TARGETLIB):  $(TARGETOBJS)
+               $(RM) -rf $@
+               $(AR) $(AR_FLAGS) $@ $(TARGETOBJS)
+               $(RANLIB) $@
+
+$(OFILES) :    $(HFILES) Makefile
+
+mm.o:          $(HFILES) $(CFILES)
+               $(CC) -c $(CFLAGS) $(DEFS) -I. -I$(srcdir)/../include $(srcdir)/mm.c
+
+.always.:
+# Do nothing.
+
+.PHONEY: all etags tags ls clean stage1 stage2 .always.
+
+stage1:                force
+               -mkdir stage1
+               -mv -f $(STAGESTUFF) stage1
+
+stage2:                force
+               -mkdir stage2
+               -mv -f $(STAGESTUFF) stage2
+
+stage3:                force
+               -mkdir stage3
+               -mv -f $(STAGESTUFF) stage3
+
+stage4:                force
+               -mkdir stage4
+               -mv -f $(STAGESTUFF) stage4
+
+against=stage2
+
+comparison:    force
+               for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
+
+de-stage1:     force
+               -(cd stage1 ; mv -f * ..)
+               -rmdir stage1
+
+de-stage2:     force
+               -(cd stage2 ; mv -f * ..)
+               -rmdir stage2
+
+de-stage3:     force
+               -(cd stage3 ; mv -f * ..)
+               -rmdir stage3
+
+de-stage4:     force
+               -(cd stage4 ; mv -f * ..)
+               -rmdir stage4
+
+etags tags:    TAGS
+
+TAGS:          $(CFILES)
+       etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
+
+ls:
+               @echo Makefile $(HFILES) $(CFILES)
+
+# Need to deal with profiled libraries, too.
+
+mostlyclean clean:
+               rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors 
+
+distclean:     clean 
+               rm -f config.cache config.log config.status
+               rm -f Makefile depend
+
+maintainer-clean realclean: distclean clean
+               @echo "This command is intended for maintainers to use;"
+               @echo "it deletes files that may require special tools to rebuild."
+               rm -f mmalloc.info
+
+force:
+
+Makefile:      Makefile.in config.status
+               $(SHELL) config.status
+
+config.status: configure
+               $(SHELL) config.status --recheck
diff --git a/mmalloc/TODO b/mmalloc/TODO
new file mode 100644 (file)
index 0000000..9412043
--- /dev/null
@@ -0,0 +1,17 @@
+Things that still need attention:
+
+   *   Make implementation changes necessary to allow multiple processes
+       to use the mmalloc managed region simultaneously.  This requires,
+       at the minimum, some sort of cooperative locking that ensures that
+       only one process at a time is changing any of the mmalloc managed
+       data structures (its ok for the mmalloc managed data regions to be
+       changed at any time since we don't care about their contents).
+
+   *   In order to support multiple processes using the mmalloc managed
+       region, the malloc descriptor needs to be broken into two parts,
+       one part which is specific to the given process and is maintained
+       separately on a per process basis, and another part which is common
+       to all processes.  As an example, the file descriptor is specific
+       to a given process, as are the morecore and abortfunc pointers.
+       However magic[], the version number, the flags field, etc are
+       common to all processes.
diff --git a/mmalloc/acinclude.m4 b/mmalloc/acinclude.m4
new file mode 100644 (file)
index 0000000..71b09b9
--- /dev/null
@@ -0,0 +1 @@
+sinclude(../bfd/acinclude.m4)
diff --git a/mmalloc/aclocal.m4 b/mmalloc/aclocal.m4
new file mode 100644 (file)
index 0000000..7cf2a1e
--- /dev/null
@@ -0,0 +1,14 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../bfd/acinclude.m4)
+
diff --git a/mmalloc/attach.c b/mmalloc/attach.c
new file mode 100644 (file)
index 0000000..2bd70bf
--- /dev/null
@@ -0,0 +1,221 @@
+/* Initialization for access to a mmap'd malloc managed region.
+   Copyright 1992, 2000 Free Software Foundation, Inc.
+
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <sys/types.h>
+#include <fcntl.h> /* After sys/types.h, at least for dpx/2.  */
+#include <sys/stat.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>    /* Prototypes for lseek */
+#endif
+#include "mmprivate.h"
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+
+#if defined(HAVE_MMAP)
+
+/* Forward declarations/prototypes for local functions */
+
+static struct mdesc *reuse PARAMS ((int));
+
+/* Initialize access to a mmalloc managed region.
+
+   If FD is a valid file descriptor for an open file then data for the
+   mmalloc managed region is mapped to that file, otherwise "/dev/zero"
+   is used and the data will not exist in any filesystem object.
+
+   If the open file corresponding to FD is from a previous use of
+   mmalloc and passes some basic sanity checks to ensure that it is
+   compatible with the current mmalloc package, then it's data is
+   mapped in and is immediately accessible at the same addresses in
+   the current process as the process that created the file.
+
+   If BASEADDR is not NULL, the mapping is established starting at the
+   specified address in the process address space.  If BASEADDR is NULL,
+   the mmalloc package chooses a suitable address at which to start the
+   mapped region, which will be the value of the previous mapping if
+   opening an existing file which was previously built by mmalloc, or
+   for new files will be a value chosen by mmap.
+
+   Specifying BASEADDR provides more control over where the regions
+   start and how big they can be before bumping into existing mapped
+   regions or future mapped regions.
+
+   On success, returns a "malloc descriptor" which is used in subsequent
+   calls to other mmalloc package functions.  It is explicitly "void *"
+   ("char *" for systems that don't fully support void) so that users
+   of the package don't have to worry about the actual implementation
+   details.
+
+   On failure returns NULL. */
+
+PTR
+mmalloc_attach (fd, baseaddr)
+  int fd;
+  PTR baseaddr;
+{
+  struct mdesc mtemp;
+  struct mdesc *mdp;
+  PTR mbase;
+  struct stat sbuf;
+
+  /* First check to see if FD is a valid file descriptor, and if so, see
+     if the file has any current contents (size > 0).  If it does, then
+     attempt to reuse the file.  If we can't reuse the file, either
+     because it isn't a valid mmalloc produced file, was produced by an
+     obsolete version, or any other reason, then we fail to attach to
+     this file. */
+
+  if (fd >= 0)
+    {
+      if (fstat (fd, &sbuf) < 0)
+       {
+         return (NULL);
+       }
+      else if (sbuf.st_size > 0)
+       {
+         return ((PTR) reuse (fd));
+       }
+    }
+
+  /* We start off with the malloc descriptor allocated on the stack, until
+     we build it up enough to call _mmalloc_mmap_morecore() to allocate the
+     first page of the region and copy it there.  Ensure that it is zero'd and
+     then initialize the fields that we know values for. */
+
+  mdp = &mtemp;
+  memset ((char *) mdp, 0, sizeof (mtemp));
+  strncpy (mdp -> magic, MMALLOC_MAGIC, MMALLOC_MAGIC_SIZE);
+  mdp -> headersize = sizeof (mtemp);
+  mdp -> version = MMALLOC_VERSION;
+  mdp -> morecore = __mmalloc_mmap_morecore;
+  mdp -> fd = fd;
+  mdp -> base = mdp -> breakval = mdp -> top = baseaddr;
+
+  /* If we have not been passed a valid open file descriptor for the file
+     to map to, then open /dev/zero and use that to map to. */
+
+  if (mdp -> fd < 0)
+    {
+      if ((mdp -> fd = open ("/dev/zero", O_RDWR)) < 0)
+       {
+         return (NULL);
+       }
+      else
+       {
+         mdp -> flags |= MMALLOC_DEVZERO;
+       }
+    }
+
+  /*  Now try to map in the first page, copy the malloc descriptor structure
+      there, and arrange to return a pointer to this new copy.  If the mapping
+      fails, then close the file descriptor if it was opened by us, and arrange
+      to return a NULL. */
+
+  if ((mbase = mdp -> morecore (mdp, sizeof (mtemp))) != NULL)
+    {
+      memcpy (mbase, mdp, sizeof (mtemp));
+      mdp = (struct mdesc *) mbase;
+    }
+  else
+    {
+      if (mdp -> flags & MMALLOC_DEVZERO)
+       {
+         close (mdp -> fd);
+       }
+      mdp = NULL;
+    }
+
+  return ((PTR) mdp);
+}
+
+/* Given an valid file descriptor on an open file, test to see if that file
+   is a valid mmalloc produced file, and if so, attempt to remap it into the
+   current process at the same address to which it was previously mapped.
+
+   Note that we have to update the file descriptor number in the malloc-
+   descriptor read from the file to match the current valid one, before
+   trying to map the file in, and again after a successful mapping and
+   after we've switched over to using the mapped in malloc descriptor 
+   rather than the temporary one on the stack.
+
+   Once we've switched over to using the mapped in malloc descriptor, we
+   have to update the pointer to the morecore function, since it almost
+   certainly will be at a different address if the process reusing the
+   mapped region is from a different executable.
+
+   Also note that if the heap being remapped previously used the mmcheckf()
+   routines, we need to update the hooks since their target functions
+   will have certainly moved if the executable has changed in any way.
+   We do this by calling mmcheckf() internally.
+
+   Returns a pointer to the malloc descriptor if successful, or NULL if
+   unsuccessful for some reason. */
+
+static struct mdesc *
+reuse (fd)
+  int fd;
+{
+  struct mdesc mtemp;
+  struct mdesc *mdp = NULL;
+
+  if ((lseek (fd, 0L, SEEK_SET) == 0) &&
+      (read (fd, (char *) &mtemp, sizeof (mtemp)) == sizeof (mtemp)) &&
+      (mtemp.headersize == sizeof (mtemp)) &&
+      (strcmp (mtemp.magic, MMALLOC_MAGIC) == 0) &&
+      (mtemp.version <= MMALLOC_VERSION))
+    {
+      mtemp.fd = fd;
+      if (__mmalloc_remap_core (&mtemp) == mtemp.base)
+       {
+         mdp = (struct mdesc *) mtemp.base;
+         mdp -> fd = fd;
+         mdp -> morecore = __mmalloc_mmap_morecore;
+         if (mdp -> mfree_hook != NULL)
+           {
+             mmcheckf ((PTR) mdp, (void (*) PARAMS ((void))) NULL, 1);
+           }
+       }
+    }
+  return (mdp);
+}
+
+#else  /* !defined (HAVE_MMAP) */
+
+/* For systems without mmap, the library still supplies an entry point
+   to link to, but trying to initialize access to an mmap'd managed region
+   always fails. */
+
+/* ARGSUSED */
+PTR
+mmalloc_attach (fd, baseaddr)
+  int fd;
+  PTR baseaddr;
+{
+   return (NULL);
+}
+
+#endif /* defined (HAVE_MMAP) */
+
diff --git a/mmalloc/configure b/mmalloc/configure
new file mode 100755 (executable)
index 0000000..8420dfa
--- /dev/null
@@ -0,0 +1,1747 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --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
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -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=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=mmalloc.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+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
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# 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:540: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # 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_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # 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:570: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # 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:621: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # 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_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:653: 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.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 664 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:669: \"$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
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { 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:695: 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:700: 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
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:709: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:728: 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
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# 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:790: 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
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:849: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:870: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+# 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:896: 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
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # 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="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+# 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:928: 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
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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="${ac_tool_prefix}ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+  # 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:960: 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
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  RANLIB=":"
+fi
+fi
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:994: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1009 "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:1015: \"$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
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1026 "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:1032: \"$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
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1043 "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:1049: \"$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
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+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:1077: 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 1082 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1087: \"$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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1116: 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 1121 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1144: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:1169: 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
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1177 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the filesystem buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propogated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* 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
+#  define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+       char *data, *data2, *data3;
+       int i, pagesize;
+       int fd;
+
+       pagesize = getpagesize();
+
+       /*
+        * First, make a file with some known garbage in it.
+        */
+       data = malloc(pagesize);
+       if (!data)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               *(data + i) = rand();
+       umask(0);
+       fd = creat("conftestmmap", 0600);
+       if (fd < 0)
+               exit(1);
+       if (write(fd, data, pagesize) != pagesize)
+               exit(1);
+       close(fd);
+
+       /*
+        * Next, try to mmap the file at a fixed address which
+        * already has something else allocated at it.  If we can,
+        * also make sure that we see the same garbage.
+        */
+       fd = open("conftestmmap", O_RDWR);
+       if (fd < 0)
+               exit(1);
+       data2 = malloc(2 * pagesize);
+       if (!data2)
+               exit(1);
+       data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+       if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+           MAP_PRIVATE | MAP_FIXED, fd, 0L))
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data2 + i))
+                       exit(1);
+
+       /*
+        * Finally, make sure that changes to the mapped area
+        * do not percolate back to the file as seen by read().
+        * (This is a bug on some variants of i386 svr4.0.)
+        */
+       for (i = 0; i < pagesize; ++i)
+               *(data2 + i) = *(data2 + i) + 1;
+       data3 = malloc(pagesize);
+       if (!data3)
+               exit(1);
+       if (read(fd, data3, pagesize) != pagesize)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data3 + i))
+                       exit(1);
+       close(fd);
+       unlink("conftestmmap");
+       exit(0);
+}
+
+EOF
+if { (eval echo configure:1317: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+for ac_hdr in limits.h stddef.h unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1343: 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 1348 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1353: \"$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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
+echo "configure:1381: checking whether sbrk must be declared" >&5
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1386 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) sbrk
+; return 0; }
+EOF
+if { (eval echo configure:1407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  bfd_cv_decl_needed_sbrk=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  bfd_cv_decl_needed_sbrk=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6
+if test $bfd_cv_decl_needed_sbrk = yes; then
+  cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_SBRK 1
+EOF
+
+fi
+
+echo $ac_n "checking whether getpagesize must be declared""... $ac_c" 1>&6
+echo "configure:1428: checking whether getpagesize must be declared" >&5
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_getpagesize'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1433 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) getpagesize
+; return 0; }
+EOF
+if { (eval echo configure:1454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  bfd_cv_decl_needed_getpagesize=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  bfd_cv_decl_needed_getpagesize=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_getpagesize" 1>&6
+if test $bfd_cv_decl_needed_getpagesize = yes; then
+  cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_GETPAGESIZE 1
+EOF
+
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[    `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@CPP@%$CPP%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/mmalloc/configure.in b/mmalloc/configure.in
new file mode 100644 (file)
index 0000000..db7a4c2
--- /dev/null
@@ -0,0 +1,35 @@
+dnl Autoconf configure script for MMALLOC, the GNU mmemory allocator.
+dnl Copyright 2000 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GDB.
+dnl 
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.12.1)dnl
+AC_INIT(mmalloc.c)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+AC_FUNC_MMAP
+AC_CHECK_HEADERS(limits.h stddef.h unistd.h)
+
+BFD_NEED_DECLARATION(sbrk)
+BFD_NEED_DECLARATION(getpagesize)
+
+AC_OUTPUT(Makefile)
diff --git a/mmalloc/detach.c b/mmalloc/detach.c
new file mode 100644 (file)
index 0000000..1780679
--- /dev/null
@@ -0,0 +1,71 @@
+/* Finish access to a mmap'd malloc managed region.
+   Copyright 1992 Free Software Foundation, Inc.
+
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <sys/types.h>
+#include "mmprivate.h"
+
+/* Terminate access to a mmalloc managed region by unmapping all memory pages
+   associated with the region, and closing the file descriptor if it is one
+   that we opened.
+
+   Returns NULL on success.
+
+   Returns the malloc descriptor on failure, which can subsequently be used
+   for further action, such as obtaining more information about the nature of
+   the failure by examining the preserved errno value.
+
+   Note that the malloc descriptor that we are using is currently located in
+   region we are about to unmap, so we first make a local copy of it on the
+   stack and use the copy. */
+
+PTR
+mmalloc_detach (md)
+     PTR md;
+{
+  struct mdesc mtemp;
+
+  if (md != NULL)
+    {
+
+      mtemp = *(struct mdesc *) md;
+      
+      /* Now unmap all the pages associated with this region by asking for a
+        negative increment equal to the current size of the region. */
+      
+      if ((mtemp.morecore (&mtemp, mtemp.base - mtemp.breakval)) == NULL)
+       {
+         /* Deallocating failed.  Update the original malloc descriptor
+            with any changes */
+         *(struct mdesc *) md = mtemp;
+       }
+      else
+       {
+         if (mtemp.flags & MMALLOC_DEVZERO)
+           {
+             close (mtemp.fd);
+           }
+         md = NULL;
+       }
+    }
+
+  return (md);
+}
diff --git a/mmalloc/keys.c b/mmalloc/keys.c
new file mode 100644 (file)
index 0000000..35f00d1
--- /dev/null
@@ -0,0 +1,66 @@
+/* Access for application keys in mmap'd malloc managed region.
+   Copyright 1992 Free Software Foundation, Inc.
+
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* This module provides access to some keys that the application can use to
+   provide persistent access to locations in the mapped memory section.
+   The intent is that these keys are to be used sparingly as sort of
+   persistent global variables which the application can use to reinitialize
+   access to data in the mapped region.
+
+   For the moment, these keys are simply stored in the malloc descriptor
+   itself, in an array of fixed length.  This should be fixed so that there
+   can be an unlimited number of keys, possibly using a multilevel access
+   scheme of some sort. */
+
+#include "mmprivate.h"
+
+int
+mmalloc_setkey (md, keynum, key)
+  PTR md;     
+  int keynum;
+  PTR key;
+{
+  struct mdesc *mdp = (struct mdesc *) md;
+  int result = 0;
+
+  if ((mdp != NULL) && (keynum >= 0) && (keynum < MMALLOC_KEYS))
+    {
+      mdp -> keys [keynum] = key;
+      result++;
+    }
+  return (result);
+}
+
+PTR
+mmalloc_getkey (md, keynum)
+  PTR md;     
+  int keynum;
+{
+  struct mdesc *mdp = (struct mdesc *) md;
+  PTR keyval = NULL;
+
+  if ((mdp != NULL) && (keynum >= 0) && (keynum < MMALLOC_KEYS))
+    {
+      keyval = mdp -> keys [keynum];
+    }
+  return (keyval);
+}
diff --git a/mmalloc/mcalloc.c b/mmalloc/mcalloc.c
new file mode 100644 (file)
index 0000000..c9fcc07
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <sys/types.h>  /* GCC on HP/UX needs this before string.h. */
+#include <string.h>    /* Prototypes for memcpy, memmove, memset, etc */
+
+#include "mmprivate.h"
+
+/* Allocate an array of NMEMB elements each SIZE bytes long.
+   The entire array is initialized to zeros.  */
+
+PTR
+mcalloc (md, nmemb, size)
+  PTR md;
+  register size_t nmemb;
+  register size_t size;
+{
+  register PTR result;
+
+  if ((result = mmalloc (md, nmemb * size)) != NULL)
+    {
+      memset (result, 0, nmemb * size);
+    }
+  return (result);
+}
+
+/* When using this package, provide a version of malloc/realloc/free built
+   on top of it, so that if we use the default sbrk() region we will not
+   collide with another malloc package trying to do the same thing, if
+   the application contains any "hidden" calls to malloc/realloc/free (such
+   as inside a system library). */
+
+PTR
+calloc (nmemb, size)
+  size_t nmemb;
+  size_t size;
+{
+  return (mcalloc ((PTR) NULL, nmemb, size));
+}
diff --git a/mmalloc/mfree.c b/mmalloc/mfree.c
new file mode 100644 (file)
index 0000000..c509ac6
--- /dev/null
@@ -0,0 +1,247 @@
+/* Free a block of memory allocated by `mmalloc'.
+   Copyright 1990, 1991, 1992 Free Software Foundation
+
+   Written May 1989 by Mike Haertel.
+   Heavily modified Mar 1992 by Fred Fish.  (fnf@cygnus.com)
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   The author may be reached (Email) at the address mike@ai.mit.edu,
+   or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+#include "mmprivate.h"
+
+/* Return memory to the heap.
+   Like `mfree' but don't call a mfree_hook if there is one.  */
+
+void
+__mmalloc_free (mdp, ptr)
+  struct mdesc *mdp;
+  PTR ptr;
+{
+  int type;
+  size_t block, blocks;
+  register size_t i;
+  struct list *prev, *next;
+
+  block = BLOCK (ptr);
+
+  type = mdp -> heapinfo[block].busy.type;
+  switch (type)
+    {
+    case 0:
+      /* Get as many statistics as early as we can.  */
+      mdp -> heapstats.chunks_used--;
+      mdp -> heapstats.bytes_used -=
+         mdp -> heapinfo[block].busy.info.size * BLOCKSIZE;
+      mdp -> heapstats.bytes_free +=
+         mdp -> heapinfo[block].busy.info.size * BLOCKSIZE;
+
+      /* Find the free cluster previous to this one in the free list.
+        Start searching at the last block referenced; this may benefit
+        programs with locality of allocation.  */
+      i = mdp -> heapindex;
+      if (i > block)
+       {
+         while (i > block)
+           {
+             i = mdp -> heapinfo[i].free.prev;
+           }
+       }
+      else
+       {
+         do
+           {
+             i = mdp -> heapinfo[i].free.next;
+           }
+         while ((i != 0) && (i < block));
+         i = mdp -> heapinfo[i].free.prev;
+       }
+
+      /* Determine how to link this block into the free list.  */
+      if (block == i + mdp -> heapinfo[i].free.size)
+       {
+         /* Coalesce this block with its predecessor.  */
+         mdp -> heapinfo[i].free.size +=
+           mdp -> heapinfo[block].busy.info.size;
+         block = i;
+       }
+      else
+       {
+         /* Really link this block back into the free list.  */
+         mdp -> heapinfo[block].free.size =
+           mdp -> heapinfo[block].busy.info.size;
+         mdp -> heapinfo[block].free.next = mdp -> heapinfo[i].free.next;
+         mdp -> heapinfo[block].free.prev = i;
+         mdp -> heapinfo[i].free.next = block;
+         mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.prev = block;
+         mdp -> heapstats.chunks_free++;
+       }
+
+      /* Now that the block is linked in, see if we can coalesce it
+        with its successor (by deleting its successor from the list
+        and adding in its size).  */
+      if (block + mdp -> heapinfo[block].free.size ==
+         mdp -> heapinfo[block].free.next)
+       {
+         mdp -> heapinfo[block].free.size
+           += mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.size;
+         mdp -> heapinfo[block].free.next
+           = mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.next;
+         mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.prev = block;
+         mdp -> heapstats.chunks_free--;
+       }
+
+      /* Now see if we can return stuff to the system.  */
+      blocks = mdp -> heapinfo[block].free.size;
+      if (blocks >= FINAL_FREE_BLOCKS && block + blocks == mdp -> heaplimit
+         && mdp -> morecore (mdp, 0) == ADDRESS (block + blocks))
+       {
+         register size_t bytes = blocks * BLOCKSIZE;
+         mdp -> heaplimit -= blocks;
+         mdp -> morecore (mdp, -bytes);
+         mdp -> heapinfo[mdp -> heapinfo[block].free.prev].free.next
+           = mdp -> heapinfo[block].free.next;
+         mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.prev
+           = mdp -> heapinfo[block].free.prev;
+         block = mdp -> heapinfo[block].free.prev;
+         mdp -> heapstats.chunks_free--;
+         mdp -> heapstats.bytes_free -= bytes;
+       }
+
+      /* Set the next search to begin at this block.  */
+      mdp -> heapindex = block;
+      break;
+
+    default:
+      /* Do some of the statistics.  */
+      mdp -> heapstats.chunks_used--;
+      mdp -> heapstats.bytes_used -= 1 << type;
+      mdp -> heapstats.chunks_free++;
+      mdp -> heapstats.bytes_free += 1 << type;
+
+      /* Get the address of the first free fragment in this block.  */
+      prev = (struct list *)
+       ((char *) ADDRESS(block) +
+        (mdp -> heapinfo[block].busy.info.frag.first << type));
+
+      if (mdp -> heapinfo[block].busy.info.frag.nfree ==
+         (BLOCKSIZE >> type) - 1)
+       {
+         /* If all fragments of this block are free, remove them
+            from the fragment list and free the whole block.  */
+         next = prev;
+         for (i = 1; i < (size_t) (BLOCKSIZE >> type); ++i)
+           {
+             next = next -> next;
+           }
+         prev -> prev -> next = next;
+         if (next != NULL)
+           {
+             next -> prev = prev -> prev;
+           }
+         mdp -> heapinfo[block].busy.type = 0;
+         mdp -> heapinfo[block].busy.info.size = 1;
+
+         /* Keep the statistics accurate.  */
+         mdp -> heapstats.chunks_used++;
+         mdp -> heapstats.bytes_used += BLOCKSIZE;
+         mdp -> heapstats.chunks_free -= BLOCKSIZE >> type;
+         mdp -> heapstats.bytes_free -= BLOCKSIZE;
+
+         mfree ((PTR) mdp, (PTR) ADDRESS(block));
+       }
+      else if (mdp -> heapinfo[block].busy.info.frag.nfree != 0)
+       {
+         /* If some fragments of this block are free, link this
+            fragment into the fragment list after the first free
+            fragment of this block. */
+         next = (struct list *) ptr;
+         next -> next = prev -> next;
+         next -> prev = prev;
+         prev -> next = next;
+         if (next -> next != NULL)
+           {
+             next -> next -> prev = next;
+           }
+         ++mdp -> heapinfo[block].busy.info.frag.nfree;
+       }
+      else
+       {
+         /* No fragments of this block are free, so link this
+            fragment into the fragment list and announce that
+            it is the first free fragment of this block. */
+         prev = (struct list *) ptr;
+         mdp -> heapinfo[block].busy.info.frag.nfree = 1;
+         mdp -> heapinfo[block].busy.info.frag.first =
+           RESIDUAL (ptr, BLOCKSIZE) >> type;
+         prev -> next = mdp -> fraghead[type].next;
+         prev -> prev = &mdp -> fraghead[type];
+         prev -> prev -> next = prev;
+         if (prev -> next != NULL)
+           {
+             prev -> next -> prev = prev;
+           }
+       }
+      break;
+    }
+}
+
+/* Return memory to the heap.  */
+
+void
+mfree (md, ptr)
+  PTR md;
+  PTR ptr;
+{
+  struct mdesc *mdp;
+  register struct alignlist *l;
+
+  if (ptr != NULL)
+    {
+      mdp = MD_TO_MDP (md);
+      for (l = mdp -> aligned_blocks; l != NULL; l = l -> next)
+       {
+         if (l -> aligned == ptr)
+           {
+             l -> aligned = NULL;  /* Mark the slot in the list as free. */
+             ptr = l -> exact;
+             break;
+           }
+       }      
+      if (mdp -> mfree_hook != NULL)
+       {
+         (*mdp -> mfree_hook) (md, ptr);
+       }
+      else
+       {
+         __mmalloc_free (mdp, ptr);
+       }
+    }
+}
+
+/* When using this package, provide a version of malloc/realloc/free built
+   on top of it, so that if we use the default sbrk() region we will not
+   collide with another malloc package trying to do the same thing, if
+   the application contains any "hidden" calls to malloc/realloc/free (such
+   as inside a system library). */
+
+void
+free (ptr)
+  PTR ptr;
+{
+  mfree ((PTR) NULL, ptr);
+}
diff --git a/mmalloc/mm.c b/mmalloc/mm.c
new file mode 100644 (file)
index 0000000..d487e0c
--- /dev/null
@@ -0,0 +1,40 @@
+/* Build the entire mmalloc library as a single object module. This
+   avoids having clients pick up part of their allocation routines
+   from mmalloc and part from libc, which results in undefined
+   behavior.  It should also still be possible to build the library
+   as a standard library with multiple objects.
+
+   Copyright 1996, 2000 Free Software Foundation
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>    /* Prototypes for lseek, sbrk (maybe) */
+#endif
+#include "mcalloc.c"
+#include "mfree.c"
+#include "mmalloc.c"
+#include "mmcheck.c"
+#include "mmemalign.c"
+#include "mmstats.c"
+#include "mmtrace.c"
+#include "mrealloc.c"
+#include "mvalloc.c"
+#include "mmap-sup.c"
+#include "attach.c"
+#include "detach.c"
+#include "keys.c"
+#include "sbrk-sup.c"
diff --git a/mmalloc/mmalloc.c b/mmalloc/mmalloc.c
new file mode 100644 (file)
index 0000000..7c60fe2
--- /dev/null
@@ -0,0 +1,337 @@
+/* Memory allocator `malloc'.
+   Copyright 1990, 1991, 1992 Free Software Foundation
+
+   Written May 1989 by Mike Haertel.
+   Heavily modified Mar 1992 by Fred Fish for mmap'd version.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   The author may be reached (Email) at the address mike@ai.mit.edu,
+   or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+#include <string.h>    /* Prototypes for memcpy, memmove, memset, etc */
+
+#include "mmprivate.h"
+
+/* Prototypes for local functions */
+
+static int initialize PARAMS ((struct mdesc *));
+static PTR morecore PARAMS ((struct mdesc *, size_t));
+static PTR align PARAMS ((struct mdesc *, size_t));
+
+/* Aligned allocation.  */
+
+static PTR
+align (mdp, size)
+  struct mdesc *mdp;
+  size_t size;
+{
+  PTR result;
+  unsigned long int adj;
+
+  result = mdp -> morecore (mdp, size);
+  adj = RESIDUAL (result, BLOCKSIZE);
+  if (adj != 0)
+    {
+      adj = BLOCKSIZE - adj;
+      mdp -> morecore (mdp, adj);
+      result = (char *) result + adj;
+    }
+  return (result);
+}
+
+/* Set everything up and remember that we have.  */
+
+static int
+initialize (mdp)
+  struct mdesc *mdp;
+{
+  mdp -> heapsize = HEAP / BLOCKSIZE;
+  mdp -> heapinfo = (malloc_info *) 
+    align (mdp, mdp -> heapsize * sizeof (malloc_info));
+  if (mdp -> heapinfo == NULL)
+    {
+      return (0);
+    }
+  memset ((PTR)mdp -> heapinfo, 0, mdp -> heapsize * sizeof (malloc_info));
+  mdp -> heapinfo[0].free.size = 0;
+  mdp -> heapinfo[0].free.next = mdp -> heapinfo[0].free.prev = 0;
+  mdp -> heapindex = 0;
+  mdp -> heapbase = (char *) mdp -> heapinfo;
+  mdp -> flags |= MMALLOC_INITIALIZED;
+  return (1);
+}
+
+/* Get neatly aligned memory, initializing or
+   growing the heap info table as necessary. */
+
+static PTR
+morecore (mdp, size)
+  struct mdesc *mdp;
+  size_t size;
+{
+  PTR result;
+  malloc_info *newinfo, *oldinfo;
+  size_t newsize;
+
+  result = align (mdp, size);
+  if (result == NULL)
+    {
+      return (NULL);
+    }
+
+  /* Check if we need to grow the info table.  */
+  if ((size_t) BLOCK ((char *) result + size) > mdp -> heapsize)
+    {
+      newsize = mdp -> heapsize;
+      while ((size_t) BLOCK ((char *) result + size) > newsize)
+       {
+         newsize *= 2;
+       }
+      newinfo = (malloc_info *) align (mdp, newsize * sizeof (malloc_info));
+      if (newinfo == NULL)
+       {
+         mdp -> morecore (mdp, -size);
+         return (NULL);
+       }
+      memset ((PTR) newinfo, 0, newsize * sizeof (malloc_info));
+      memcpy ((PTR) newinfo, (PTR) mdp -> heapinfo,
+             mdp -> heapsize * sizeof (malloc_info));
+      oldinfo = mdp -> heapinfo;
+      newinfo[BLOCK (oldinfo)].busy.type = 0;
+      newinfo[BLOCK (oldinfo)].busy.info.size
+       = BLOCKIFY (mdp -> heapsize * sizeof (malloc_info));
+      mdp -> heapinfo = newinfo;
+      __mmalloc_free (mdp, (PTR)oldinfo);
+      mdp -> heapsize = newsize;
+    }
+
+  mdp -> heaplimit = BLOCK ((char *) result + size);
+  return (result);
+}
+
+/* Allocate memory from the heap.  */
+
+PTR
+mmalloc (md, size)
+  PTR md;
+  size_t size;
+{
+  struct mdesc *mdp;
+  PTR result;
+  size_t block, blocks, lastblocks, start;
+  register size_t i;
+  struct list *next;
+  register size_t log;
+
+  if (size == 0)
+    {
+      return (NULL);
+    }
+
+  mdp = MD_TO_MDP (md);
+      
+  if (mdp -> mmalloc_hook != NULL)
+    {
+      return ((*mdp -> mmalloc_hook) (md, size));
+    }
+
+  if (!(mdp -> flags & MMALLOC_INITIALIZED))
+    {
+      if (!initialize (mdp))
+       {
+         return (NULL);
+       }
+    }
+
+  if (size < sizeof (struct list))
+    {
+      size = sizeof (struct list);
+    }
+
+  /* Determine the allocation policy based on the request size.  */
+  if (size <= BLOCKSIZE / 2)
+    {
+      /* Small allocation to receive a fragment of a block.
+        Determine the logarithm to base two of the fragment size. */
+      log = 1;
+      --size;
+      while ((size /= 2) != 0)
+       {
+         ++log;
+       }
+
+      /* Look in the fragment lists for a
+        free fragment of the desired size. */
+      next = mdp -> fraghead[log].next;
+      if (next != NULL)
+       {
+         /* There are free fragments of this size.
+            Pop a fragment out of the fragment list and return it.
+            Update the block's nfree and first counters. */
+         result = (PTR) next;
+         next -> prev -> next = next -> next;
+         if (next -> next != NULL)
+           {
+             next -> next -> prev = next -> prev;
+           }
+         block = BLOCK (result);
+         if (--mdp -> heapinfo[block].busy.info.frag.nfree != 0)
+           {
+             mdp -> heapinfo[block].busy.info.frag.first =
+               RESIDUAL (next -> next, BLOCKSIZE) >> log;
+           }
+
+         /* Update the statistics.  */
+         mdp -> heapstats.chunks_used++;
+         mdp -> heapstats.bytes_used += 1 << log;
+         mdp -> heapstats.chunks_free--;
+         mdp -> heapstats.bytes_free -= 1 << log;
+       }
+      else
+       {
+         /* No free fragments of the desired size, so get a new block
+            and break it into fragments, returning the first.  */
+         result = mmalloc (md, BLOCKSIZE);
+         if (result == NULL)
+           {
+             return (NULL);
+           }
+
+         /* Link all fragments but the first into the free list.  */
+         for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i)
+           {
+             next = (struct list *) ((char *) result + (i << log));
+             next -> next = mdp -> fraghead[log].next;
+             next -> prev = &mdp -> fraghead[log];
+             next -> prev -> next = next;
+             if (next -> next != NULL)
+               {
+                 next -> next -> prev = next;
+               }
+           }
+
+         /* Initialize the nfree and first counters for this block.  */
+         block = BLOCK (result);
+         mdp -> heapinfo[block].busy.type = log;
+         mdp -> heapinfo[block].busy.info.frag.nfree = i - 1;
+         mdp -> heapinfo[block].busy.info.frag.first = i - 1;
+
+         mdp -> heapstats.chunks_free += (BLOCKSIZE >> log) - 1;
+         mdp -> heapstats.bytes_free += BLOCKSIZE - (1 << log);
+         mdp -> heapstats.bytes_used -= BLOCKSIZE - (1 << log);
+       }
+    }
+  else
+    {
+      /* Large allocation to receive one or more blocks.
+        Search the free list in a circle starting at the last place visited.
+        If we loop completely around without finding a large enough
+        space we will have to get more memory from the system.  */
+      blocks = BLOCKIFY(size);
+      start = block = MALLOC_SEARCH_START;
+      while (mdp -> heapinfo[block].free.size < blocks)
+       {
+         block = mdp -> heapinfo[block].free.next;
+         if (block == start)
+           {
+             /* Need to get more from the system.  Check to see if
+                the new core will be contiguous with the final free
+                block; if so we don't need to get as much.  */
+             block = mdp -> heapinfo[0].free.prev;
+             lastblocks = mdp -> heapinfo[block].free.size;
+             if (mdp -> heaplimit != 0 &&
+                 block + lastblocks == mdp -> heaplimit &&
+                 mdp -> morecore (mdp, 0) == ADDRESS(block + lastblocks) &&
+                 (morecore (mdp, (blocks - lastblocks) * BLOCKSIZE)) != NULL)
+               {
+                 /* Which block we are extending (the `final free
+                    block' referred to above) might have changed, if
+                    it got combined with a freed info table.  */
+                 block = mdp -> heapinfo[0].free.prev;
+
+                 mdp -> heapinfo[block].free.size += (blocks - lastblocks);
+                 mdp -> heapstats.bytes_free +=
+                     (blocks - lastblocks) * BLOCKSIZE;
+                 continue;
+               }
+             result = morecore(mdp, blocks * BLOCKSIZE);
+             if (result == NULL)
+               {
+                 return (NULL);
+               }
+             block = BLOCK (result);
+             mdp -> heapinfo[block].busy.type = 0;
+             mdp -> heapinfo[block].busy.info.size = blocks;
+             mdp -> heapstats.chunks_used++;
+             mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
+             return (result);
+           }
+       }
+
+      /* At this point we have found a suitable free list entry.
+        Figure out how to remove what we need from the list. */
+      result = ADDRESS(block);
+      if (mdp -> heapinfo[block].free.size > blocks)
+       {
+         /* The block we found has a bit left over,
+            so relink the tail end back into the free list. */
+         mdp -> heapinfo[block + blocks].free.size
+           = mdp -> heapinfo[block].free.size - blocks;
+         mdp -> heapinfo[block + blocks].free.next
+           = mdp -> heapinfo[block].free.next;
+         mdp -> heapinfo[block + blocks].free.prev
+           = mdp -> heapinfo[block].free.prev;
+         mdp -> heapinfo[mdp -> heapinfo[block].free.prev].free.next
+           = mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.prev
+             = mdp -> heapindex = block + blocks;
+       }
+      else
+       {
+         /* The block exactly matches our requirements,
+            so just remove it from the list. */
+         mdp -> heapinfo[mdp -> heapinfo[block].free.next].free.prev
+           = mdp -> heapinfo[block].free.prev;
+         mdp -> heapinfo[mdp -> heapinfo[block].free.prev].free.next
+           = mdp -> heapindex = mdp -> heapinfo[block].free.next;
+         mdp -> heapstats.chunks_free--;
+       }
+
+      mdp -> heapinfo[block].busy.type = 0;
+      mdp -> heapinfo[block].busy.info.size = blocks;
+      mdp -> heapstats.chunks_used++;
+      mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
+      mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
+    }
+
+  return (result);
+}
+
+/* When using this package, provide a version of malloc/realloc/free built
+   on top of it, so that if we use the default sbrk() region we will not
+   collide with another malloc package trying to do the same thing, if
+   the application contains any "hidden" calls to malloc/realloc/free (such
+   as inside a system library). */
+
+PTR
+malloc (size)
+  size_t size;
+{
+  PTR result;
+
+  result = mmalloc ((PTR) NULL, size);
+  return (result);
+}
diff --git a/mmalloc/mmalloc.h b/mmalloc/mmalloc.h
new file mode 100644 (file)
index 0000000..082547e
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef MMALLOC_H
+#define MMALLOC_H 1
+
+#ifdef HAVE_STDDEF_H
+#  include <stddef.h>
+#else
+#  include <sys/types.h>   /* for size_t */
+#  include <stdio.h>       /* for NULL */
+#endif
+
+#include "ansidecl.h"
+/* Allocate SIZE bytes of memory.  */
+
+extern PTR mmalloc PARAMS ((PTR, size_t));
+
+/* Re-allocate the previously allocated block in PTR, making the new block
+   SIZE bytes long.  */
+
+extern PTR mrealloc PARAMS ((PTR, PTR, size_t));
+
+/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0.  */
+
+extern PTR mcalloc PARAMS ((PTR, size_t, size_t));
+
+/* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'.  */
+
+extern void mfree PARAMS ((PTR, PTR));
+
+/* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
+
+extern PTR mmemalign PARAMS ((PTR, size_t, size_t));
+
+/* Allocate SIZE bytes on a page boundary.  */
+
+extern PTR mvalloc PARAMS ((PTR, size_t));
+
+/* Activate a standard collection of debugging hooks.  */
+
+extern int mmcheck PARAMS ((PTR, void (*) (void)));
+
+extern int mmcheckf PARAMS ((PTR, void (*) (void), int));
+
+/* Pick up the current statistics. (see FIXME elsewhere) */
+
+extern struct mstats mmstats PARAMS ((PTR));
+
+extern PTR mmalloc_attach PARAMS ((int, PTR));
+
+extern PTR mmalloc_detach PARAMS ((PTR));
+
+extern int mmalloc_setkey PARAMS ((PTR, int, PTR));
+
+extern PTR mmalloc_getkey PARAMS ((PTR, int));
+
+extern int mmalloc_errno PARAMS ((PTR));
+
+extern int mmtrace PARAMS ((void));
+
+extern PTR mmalloc_findbase PARAMS ((int));
+
+#endif  /* MMALLOC_H */
diff --git a/mmalloc/mmalloc.texi b/mmalloc/mmalloc.texi
new file mode 100644 (file)
index 0000000..c038f65
--- /dev/null
@@ -0,0 +1,258 @@
+\input texinfo  @c                                  -*- Texinfo -*-
+@setfilename mmalloc.info
+
+@ifinfo
+@format
+START-INFO-DIR-ENTRY
+* Mmalloc: (mmalloc).          The GNU mapped-malloc package.
+END-INFO-DIR-ENTRY
+@end format
+
+This file documents the GNU mmalloc (mapped-malloc) package, written by
+fnf@@cygnus.com, based on GNU malloc written by mike@@ai.mit.edu.
+
+Copyright (C) 1992 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through Tex and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions.
+@end ifinfo
+@iftex
+@c @finalout
+@setchapternewpage odd
+@settitle MMALLOC, the GNU memory-mapped malloc package
+@titlepage
+@title mmalloc
+@subtitle The GNU memory-mapped malloc package
+@author Fred Fish
+@author Cygnus Support
+@author Mike Haertel
+@author Free Software Foundation
+@page
+
+@tex
+\def\$#1${{#1}}  % Kluge: collect RCS revision info without $...$
+\xdef\manvers{\$Revision$}  % For use in headers, footers too
+{\parskip=0pt
+\hfill Cygnus Support\par
+\hfill fnf\@cygnus.com\par
+\hfill {\it MMALLOC, the GNU memory-mapped malloc package}, \manvers\par
+\hfill \TeX{}info \texinfoversion\par
+}
+@end tex
+
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions.
+@end titlepage
+@end iftex
+
+@ifinfo
+@node Top, Overview, (dir), (dir)
+@top mmalloc
+This file documents the GNU memory-mapped malloc package mmalloc.
+
+@menu
+* Overview::                    Overall Description
+* Implementation::              Implementation
+
+ --- The Detailed Node Listing ---
+
+Implementation
+
+* Compatibility::               Backwards Compatibility
+* Functions::                   Function Descriptions
+@end menu
+
+@end ifinfo
+
+@node Overview, Implementation, Top, Top
+@chapter Overall Description
+
+This is a heavily modified version of GNU @code{malloc}.  It uses
+@code{mmap} as the basic mechanism for obtaining memory from the
+system, rather than @code{sbrk}.  This gives it several advantages over the
+more traditional malloc:
+
+@itemize @bullet
+@item
+Several different heaps can be used, each of them growing
+or shinking under control of @code{mmap}, with the @code{mmalloc} functions
+using a specific heap on a call by call basis.
+
+@item
+By using @code{mmap}, it is easy to create heaps which are intended to
+be persistent and exist as a filesystem object after the creating
+process has gone away.
+
+@item
+Because multiple heaps can be managed, data used for a 
+specific purpose can be allocated into its own heap, making
+it easier to allow applications to ``dump'' and ``restore'' initialized
+malloc-managed memory regions.  For example, the ``unexec'' hack popularized
+by GNU Emacs could potentially go away.
+@end itemize
+
+@node Implementation,  , Overview, Top
+@chapter Implementation
+
+The @code{mmalloc} functions contain no internal static state.  All
+@code{mmalloc} internal data is allocated in the mapped in region, along
+with the user data that it manages.  This allows it to manage multiple
+such regions and to ``pick up where it left off'' when such regions are
+later dynamically mapped back in.
+
+In some sense, malloc has been ``purified'' to contain no internal state
+information and generalized to use multiple memory regions rather than a
+single region managed by @code{sbrk}.  However the new routines now need an
+extra parameter which informs @code{mmalloc} which memory region it is dealing
+with (along with other information).  This parameter is called the
+@dfn{malloc descriptor}.
+
+The functions initially provided by @code{mmalloc} are:
+
+@example
+void *mmalloc_attach (int fd, void *baseaddr);
+void *mmalloc_detach (void *md);
+int mmalloc_errno (void *md);
+int mmalloc_setkey (void *md, int keynum, void *key);
+void *mmalloc_getkey (void *md, int keynum);
+
+void *mmalloc (void *md, size_t size);
+void *mrealloc (void *md, void *ptr, size_t size);
+void *mvalloc (void *md, size_t size);
+void mfree (void *md, void *ptr);
+@end example
+
+@menu
+* Compatibility::               Backwards Compatibility
+* Functions::                   Function Descriptions
+@end menu
+
+@node Compatibility, Functions, Implementation, Implementation
+@section Backwards Compatibility
+
+To allow a single malloc package to be used in a given application,
+provision is made for the traditional @code{malloc}, @code{realloc}, and
+@code{free} functions to be implemented as special cases of the
+@code{mmalloc} functions.  In particular, if any of the functions that
+expect malloc descriptors are called with a @code{NULL} pointer rather than a
+valid malloc descriptor, then they default to using an @code{sbrk} managed
+region.
+The @code{mmalloc} package provides compatible @code{malloc}, @code{realloc},
+and @code{free} functions using this mechanism internally.
+Applications can avoid this extra interface layer by simply including the
+following defines:
+
+@example
+#define malloc(size)           mmalloc ((void *)0, (size))
+#define realloc(ptr,size)      mrealloc ((void *)0, (ptr), (size));
+#define free(ptr)              mfree ((void *)0, (ptr))
+@end example
+
+@noindent
+or replace the existing @code{malloc}, @code{realloc}, and @code{free}
+calls with the above patterns if using @code{#define} causes problems.
+
+@node Functions,  , Compatibility, Implementation
+@section Function Descriptions
+
+These are the details on the functions that make up the @code{mmalloc}
+package. 
+
+@table @code
+@item void *mmalloc_attach (int @var{fd}, void *@var{baseaddr});
+Initialize access to a @code{mmalloc} managed region.
+
+If @var{fd} is a valid file descriptor for an open file, then data for the
+@code{mmalloc} managed region is mapped to that file.   Otherwise
+@file{/dev/zero} is used and the data will not exist in any filesystem object.
+
+If the open file corresponding to @var{fd} is from a previous use of
+@code{mmalloc} and passes some basic sanity checks to ensure that it is
+compatible with the current @code{mmalloc} package, then its data is
+mapped in and is immediately accessible at the same addresses in
+the current process as the process that created the file.
+
+If @var{baseaddr} is not @code{NULL}, the mapping is established
+starting at the specified address in the process address space.  If
+@var{baseaddr} is @code{NULL}, the @code{mmalloc} package chooses a
+suitable address at which to start the mapped region, which will be the
+value of the previous mapping if opening an existing file which was
+previously built by @code{mmalloc}, or for new files will be a value
+chosen by @code{mmap}.
+
+Specifying @var{baseaddr} provides more control over where the regions
+start and how big they can be before bumping into existing mapped
+regions or future mapped regions.
+
+On success, returns a malloc descriptor which is used in subsequent
+calls to other @code{mmalloc} package functions.  It is explicitly
+@samp{void *} (@samp{char *} for systems that don't fully support
+@code{void}) so that users of the package don't have to worry about the
+actual implementation details.
+
+On failure returns @code{NULL}.
+
+@item void *mmalloc_detach (void *@var{md});
+Terminate access to a @code{mmalloc} managed region identified by the
+descriptor @var{md}, by closing the base file and unmapping all memory
+pages associated with the region. 
+
+Returns @code{NULL} on success.
+
+Returns the malloc descriptor on failure, which can subsequently
+be used for further action (such as obtaining more information about
+the nature of the failure).
+
+@item void *mmalloc (void *@var{md}, size_t @var{size});
+Given an @code{mmalloc} descriptor @var{md}, allocate additional memory of
+@var{size} bytes in the associated mapped region.
+
+@item *mrealloc (void *@var{md}, void *@var{ptr}, size_t @var{size});
+Given an @code{mmalloc} descriptor @var{md} and a pointer to memory
+previously allocated by @code{mmalloc} in @var{ptr}, reallocate the
+memory to be @var{size} bytes long, possibly moving the existing
+contents of memory if necessary.
+       
+@item void *mvalloc (void *@var{md}, size_t @var{size});
+Like @code{mmalloc} but the resulting memory is aligned on a page boundary.
+
+@item void mfree (void *@var{md}, void *@var{ptr});
+Given an @code{mmalloc} descriptor @var{md} and a pointer to memory previously
+allocated by @code{mmalloc} in @var{ptr}, free the previously allocated memory.
+
+@item int mmalloc_errno (void *@var{md});
+Given a @code{mmalloc} descriptor, if the last @code{mmalloc} operation
+failed for some reason due to a system call failure, then
+returns the associated @code{errno}.  Returns 0 otherwise.
+(This function is not yet implemented).
+@end table
+
+@bye
diff --git a/mmalloc/mmap-sup.c b/mmalloc/mmap-sup.c
new file mode 100644 (file)
index 0000000..b12e43c
--- /dev/null
@@ -0,0 +1,220 @@
+/* Support for an sbrk-like function that uses mmap.
+   Copyright 1992, 2000 Free Software Foundation, Inc.
+
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#if defined(HAVE_MMAP)
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>    /* Prototypes for lseek */
+#endif
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+#include "mmprivate.h"
+
+/* Cache the pagesize for the current host machine.  Note that if the host
+   does not readily provide a getpagesize() function, we need to emulate it
+   elsewhere, not clutter up this file with lots of kluges to try to figure
+   it out. */
+
+static size_t pagesize;
+#if NEED_DECLARATION_GETPAGESIZE
+extern int getpagesize PARAMS ((void));
+#endif
+
+#define PAGE_ALIGN(addr) (caddr_t) (((long)(addr) + pagesize - 1) & \
+                                   ~(pagesize - 1))
+
+
+/* Return MAP_PRIVATE if MDP represents /dev/zero.  Otherwise, return
+   MAP_SHARED.  */
+
+#define MAP_PRIVATE_OR_SHARED(MDP) ((MDP -> flags & MMALLOC_DEVZERO) \
+                                    ? MAP_PRIVATE \
+                                    : MAP_SHARED)
+
+
+/*  Get core for the memory region specified by MDP, using SIZE as the
+    amount to either add to or subtract from the existing region.  Works
+    like sbrk(), but using mmap(). */
+
+PTR
+__mmalloc_mmap_morecore (mdp, size)
+  struct mdesc *mdp;
+  int size;
+{
+  PTR result = NULL;
+  off_t foffset;       /* File offset at which new mapping will start */
+  size_t mapbytes;     /* Number of bytes to map */
+  caddr_t moveto;      /* Address where we wish to move "break value" to */
+  caddr_t mapto;       /* Address we actually mapped to */
+  char buf = 0;                /* Single byte to write to extend mapped file */
+
+  if (pagesize == 0)
+    {
+      pagesize = getpagesize ();
+    }
+  if (size == 0)
+    {
+      /* Just return the current "break" value. */
+      result = mdp -> breakval;
+    }
+  else if (size < 0)
+    {
+      /* We are deallocating memory.  If the amount requested would cause
+        us to try to deallocate back past the base of the mmap'd region
+        then do nothing, and return NULL.  Otherwise, deallocate the
+        memory and return the old break value. */
+      if (mdp -> breakval + size >= mdp -> base)
+       {
+         result = (PTR) mdp -> breakval;
+         mdp -> breakval += size;
+         moveto = PAGE_ALIGN (mdp -> breakval);
+         munmap (moveto, (size_t) (mdp -> top - moveto));
+         mdp -> top = moveto;
+       }
+    }
+  else
+    {
+      /* We are allocating memory.  Make sure we have an open file
+        descriptor and then go on to get the memory. */
+      if (mdp -> fd < 0)
+       {
+         result = NULL;
+       }
+      else if (mdp -> breakval + size > mdp -> top)
+       {
+         /* The request would move us past the end of the currently
+            mapped memory, so map in enough more memory to satisfy
+            the request.  This means we also have to grow the mapped-to
+            file by an appropriate amount, since mmap cannot be used
+            to extend a file. */
+         moveto = PAGE_ALIGN (mdp -> breakval + size);
+         mapbytes = moveto - mdp -> top;
+         foffset = mdp -> top - mdp -> base;
+         /* FIXME:  Test results of lseek() and write() */
+         lseek (mdp -> fd, foffset + mapbytes - 1, SEEK_SET);
+         write (mdp -> fd, &buf, 1);
+         if (mdp -> base == 0)
+           {
+             /* Let mmap pick the map start address */
+             mapto = mmap (0, mapbytes, PROT_READ | PROT_WRITE,
+                           MAP_PRIVATE_OR_SHARED (mdp), mdp -> fd, foffset);
+             if (mapto != (caddr_t) -1)
+               {
+                 mdp -> base = mdp -> breakval = mapto;
+                 mdp -> top = mdp -> base + mapbytes;
+                 result = (PTR) mdp -> breakval;
+                 mdp -> breakval += size;
+               }
+           }
+         else
+           {
+             mapto = mmap (mdp -> top, mapbytes, PROT_READ | PROT_WRITE,
+                           MAP_PRIVATE_OR_SHARED (mdp) | MAP_FIXED, mdp -> fd,
+                           foffset);
+             if (mapto == mdp -> top)
+               {
+                 mdp -> top = moveto;
+                 result = (PTR) mdp -> breakval;
+                 mdp -> breakval += size;
+               }
+           }
+       }
+      else
+       {
+         result = (PTR) mdp -> breakval;
+         mdp -> breakval += size;
+       }
+    }
+  return (result);
+}
+
+PTR
+__mmalloc_remap_core (mdp)
+  struct mdesc *mdp;
+{
+  caddr_t base;
+
+  /* FIXME:  Quick hack, needs error checking and other attention. */
+
+  base = mmap (mdp -> base, mdp -> top - mdp -> base,
+              PROT_READ | PROT_WRITE, MAP_PRIVATE_OR_SHARED (mdp) | MAP_FIXED,
+              mdp -> fd, 0);
+  return ((PTR) base);
+}
+
+PTR
+mmalloc_findbase (size)
+  int size;
+{
+  int fd;
+  int flags;
+  caddr_t base = NULL;
+
+#ifdef MAP_ANONYMOUS
+  flags = MAP_PRIVATE | MAP_ANONYMOUS;
+  fd = -1;
+#else
+#ifdef MAP_FILE
+  flags = MAP_PRIVATE | MAP_FILE;
+#else
+  flags = MAP_PRIVATE;
+#endif
+  fd = open ("/dev/zero", O_RDWR);
+  if (fd != -1)
+    {
+      return ((PTR) NULL);
+    }
+#endif
+  base = mmap (0, size, PROT_READ | PROT_WRITE, flags, fd, 0);
+  if (base != (caddr_t) -1)
+    {
+      munmap (base, (size_t) size);
+    }
+  if (fd != -1)
+    {
+      close (fd);
+    }
+  if (base == 0)
+    {
+      /* Don't allow mapping at address zero.  We use that value
+        to signal an error return, and besides, it is useful to
+        catch NULL pointers if it is unmapped.  Instead start
+        at the next page boundary. */
+      base = (caddr_t) getpagesize ();
+    }
+  else if (base == (caddr_t) -1)
+    {
+      base = NULL;
+    }
+  return ((PTR) base);
+}
+
+#else  /* defined(HAVE_MMAP) */
+/* Prevent "empty translation unit" warnings from the idiots at X3J11. */
+static char ansi_c_idiots = 69;
+#endif /* defined(HAVE_MMAP) */
diff --git a/mmalloc/mmcheck.c b/mmalloc/mmcheck.c
new file mode 100644 (file)
index 0000000..48936b3
--- /dev/null
@@ -0,0 +1,223 @@
+/* Standard debugging hooks for `mmalloc'.
+   Copyright 1990, 1991, 1992 Free Software Foundation
+
+   Written May 1989 by Mike Haertel.
+   Heavily modified Mar 1992 by Fred Fish (fnf@cygnus.com)
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+ The author may be reached (Email) at the address mike@ai.mit.edu,
+ or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+#include "mmprivate.h"
+
+/* Default function to call when something awful happens.  The application
+   can specify an alternate function to be called instead (and probably will
+   want to). */
+
+extern void abort PARAMS ((void));
+
+/* Arbitrary magical numbers.  */
+
+#define MAGICWORD      (unsigned int) 0xfedabeeb       /* Active chunk */
+#define MAGICWORDFREE  (unsigned int) 0xdeadbeef       /* Inactive chunk */
+#define MAGICBYTE      ((char) 0xd7)
+
+/* Each memory allocation is bounded by a header structure and a trailer
+   byte.  I.E.
+
+       <size><magicword><user's allocation><magicbyte>
+
+   The pointer returned to the user points to the first byte in the
+   user's allocation area.  The magic word can be tested to detect
+   buffer underruns and the magic byte can be tested to detect overruns. */
+
+struct hdr
+  {
+    size_t size;               /* Exact size requested by user.  */
+    unsigned long int magic;   /* Magic number to check header integrity.  */
+  };
+
+static void checkhdr PARAMS ((struct mdesc *, CONST struct hdr *));
+static void mfree_check PARAMS ((PTR, PTR));
+static PTR mmalloc_check PARAMS ((PTR, size_t));
+static PTR mrealloc_check PARAMS ((PTR, PTR, size_t));
+
+/* Check the magicword and magicbyte, and if either is corrupted then
+   call the emergency abort function specified for the heap in use. */
+
+static void
+checkhdr (mdp, hdr)
+  struct mdesc *mdp;
+  CONST struct hdr *hdr;
+{
+  if (hdr -> magic != MAGICWORD ||
+      ((char *) &hdr[1])[hdr -> size] != MAGICBYTE)
+    {
+      (*mdp -> abortfunc)();
+    }
+}
+
+static void
+mfree_check (md, ptr)
+  PTR md;
+  PTR ptr;
+{
+  struct hdr *hdr = ((struct hdr *) ptr) - 1;
+  struct mdesc *mdp;
+
+  mdp = MD_TO_MDP (md);
+  checkhdr (mdp, hdr);
+  hdr -> magic = MAGICWORDFREE;
+  mdp -> mfree_hook = NULL;
+  mfree (md, (PTR)hdr);
+  mdp -> mfree_hook = mfree_check;
+}
+
+static PTR
+mmalloc_check (md, size)
+  PTR md;
+  size_t size;
+{
+  struct hdr *hdr;
+  struct mdesc *mdp;
+  size_t nbytes;
+
+  mdp = MD_TO_MDP (md);
+  mdp -> mmalloc_hook = NULL;
+  nbytes = sizeof (struct hdr) + size + 1;
+  hdr = (struct hdr *) mmalloc (md, nbytes);
+  mdp -> mmalloc_hook = mmalloc_check;
+  if (hdr != NULL)
+    {
+      hdr -> size = size;
+      hdr -> magic = MAGICWORD;
+      hdr++;
+      *((char *) hdr + size) = MAGICBYTE;
+    }
+  return ((PTR) hdr);
+}
+
+static PTR
+mrealloc_check (md, ptr, size)
+  PTR md;
+  PTR ptr;
+  size_t size;
+{
+  struct hdr *hdr = ((struct hdr *) ptr) - 1;
+  struct mdesc *mdp;
+  size_t nbytes;
+
+  mdp = MD_TO_MDP (md);
+  checkhdr (mdp, hdr);
+  mdp -> mfree_hook = NULL;
+  mdp -> mmalloc_hook = NULL;
+  mdp -> mrealloc_hook = NULL;
+  nbytes = sizeof (struct hdr) + size + 1;
+  hdr = (struct hdr *) mrealloc (md, (PTR) hdr, nbytes);
+  mdp -> mfree_hook = mfree_check;
+  mdp -> mmalloc_hook = mmalloc_check;
+  mdp -> mrealloc_hook = mrealloc_check;
+  if (hdr != NULL)
+    {
+      hdr -> size = size;
+      hdr++;
+      *((char *) hdr + size) = MAGICBYTE;
+    }
+  return ((PTR) hdr);
+}
+
+/* Turn on default checking for mmalloc/mrealloc/mfree, for the heap specified
+   by MD.  If FUNC is non-NULL, it is a pointer to the function to call
+   to abort whenever memory corruption is detected.  By default, this is the
+   standard library function abort().
+
+   Note that we disallow installation of initial checking hooks if mmalloc
+   has been called at any time for this particular heap, since if any region
+   that is allocated prior to installation of the hooks is subsequently
+   reallocated or freed after installation of the hooks, it is guaranteed
+   to trigger a memory corruption error.  We do this by checking the state
+   of the MMALLOC_INITIALIZED flag.  If the FORCE argument is non-zero, this
+   checking is disabled and it is allowed to install the checking hooks at any
+   time.  This is useful on systems where the C runtime makes one or more
+   malloc calls before the user code had a chance to call mmcheck or mmcheckf,
+   but never calls free with these values.  Thus if we are certain that only
+   values obtained from mallocs after an mmcheck/mmcheckf will ever be passed
+   to free(), we can go ahead and force installation of the useful checking
+   hooks.
+
+   However, we can call this function at any time after the initial call,
+   to update the function pointers to the checking routines and to the
+   user defined corruption handler routine, as long as these function pointers
+   have been previously extablished by the initial call.  Note that we
+   do this automatically when remapping a previously used heap, to ensure
+   that the hooks get updated to the correct values, although the corruption
+   handler pointer gets set back to the default.  The application can then
+   call mmcheck to use a different corruption handler if desired.
+
+   Returns non-zero if checking is successfully enabled, zero otherwise. */
+
+int
+mmcheckf (md, func, force)
+  PTR md;
+  void (*func) PARAMS ((void));
+  int force;
+{
+  struct mdesc *mdp;
+  int rtnval;
+
+  mdp = MD_TO_MDP (md);
+
+  /* We can safely set or update the abort function at any time, regardless
+     of whether or not we successfully do anything else. */
+
+  mdp -> abortfunc = (func != NULL ? func : abort);
+
+  /* If we haven't yet called mmalloc the first time for this heap, or if we
+     have hooks that were previously installed, then allow the hooks to be
+     initialized or updated. */
+
+  if (force ||
+      !(mdp -> flags & MMALLOC_INITIALIZED) ||
+      (mdp -> mfree_hook != NULL))
+    {
+      mdp -> mfree_hook = mfree_check;
+      mdp -> mmalloc_hook = mmalloc_check;
+      mdp -> mrealloc_hook = mrealloc_check;
+      mdp -> flags |= MMALLOC_MMCHECK_USED;
+      rtnval = 1;
+    }
+  else
+    {
+      rtnval = 0;
+    }
+
+  return (rtnval);
+}
+
+/* This routine is for backwards compatibility only, in case there are
+   still callers to the original mmcheck function. */
+
+int
+mmcheck (md, func)
+  PTR md;
+  void (*func) PARAMS ((void));
+{
+  int rtnval;
+
+  rtnval = mmcheckf (md, func, 0);
+  return (rtnval);
+}
diff --git a/mmalloc/mmemalign.c b/mmalloc/mmemalign.c
new file mode 100644 (file)
index 0000000..3ada027
--- /dev/null
@@ -0,0 +1,62 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "mmprivate.h"
+
+PTR
+mmemalign (md, alignment, size)
+  PTR md;
+  size_t alignment;
+  size_t size;
+{
+  PTR result;
+  unsigned long int adj;
+  struct alignlist *l;
+  struct mdesc *mdp;
+
+  if ((result = mmalloc (md, size + alignment - 1)) != NULL)
+    {
+      adj = RESIDUAL (result, alignment);
+      if (adj != 0)
+       {
+         mdp = MD_TO_MDP (md);
+         for (l = mdp -> aligned_blocks; l != NULL; l = l -> next)
+           {
+             if (l -> aligned == NULL)
+               {
+                 /* This slot is free.  Use it.  */
+                 break;
+               }
+           }
+         if (l == NULL)
+           {
+             l = (struct alignlist *) mmalloc (md, sizeof (struct alignlist));
+             if (l == NULL)
+               {
+                 mfree (md, result);
+                 return (NULL);
+               }
+             l -> next = mdp -> aligned_blocks;
+             mdp -> aligned_blocks = l;
+           }
+         l -> exact = result;
+         result = l -> aligned = (char *) result + alignment - adj;
+       }
+    }
+  return (result);
+}
diff --git a/mmalloc/mmprivate.h b/mmalloc/mmprivate.h
new file mode 100644 (file)
index 0000000..4576262
--- /dev/null
@@ -0,0 +1,343 @@
+/* Declarations for `mmalloc' and friends.
+   Copyright 1990, 1991, 1992 Free Software Foundation
+
+   Written May 1989 by Mike Haertel.
+   Heavily modified Mar 1992 by Fred Fish. (fnf@cygnus.com)
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   The author may be reached (Email) at the address mike@ai.mit.edu,
+   or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+
+#ifndef __MMPRIVATE_H
+#define __MMPRIVATE_H 1
+
+#include "mmalloc.h"
+
+#ifdef HAVE_LIMITS_H
+#  include <limits.h>
+#else
+#  ifndef CHAR_BIT
+#    define CHAR_BIT 8
+#  endif
+#endif
+
+#ifndef MIN
+#  define MIN(A, B) ((A) < (B) ? (A) : (B))
+#endif
+
+#define MMALLOC_MAGIC          "mmalloc"       /* Mapped file magic number */
+#define MMALLOC_MAGIC_SIZE     8               /* Size of magic number buf */
+#define MMALLOC_VERSION                1               /* Current mmalloc version */
+#define MMALLOC_KEYS           16              /* Keys for application use */
+
+/* The allocator divides the heap into blocks of fixed size; large
+   requests receive one or more whole blocks, and small requests
+   receive a fragment of a block.  Fragment sizes are powers of two,
+   and all fragments of a block are the same size.  When all the
+   fragments in a block have been freed, the block itself is freed.  */
+
+#define INT_BIT                (CHAR_BIT * sizeof(int))
+#define BLOCKLOG       (INT_BIT > 16 ? 12 : 9)
+#define BLOCKSIZE      ((unsigned int) 1 << BLOCKLOG)
+#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
+
+/* The difference between two pointers is a signed int.  On machines where
+   the data addresses have the high bit set, we need to ensure that the
+   difference becomes an unsigned int when we are using the address as an
+   integral value.  In addition, when using with the '%' operator, the
+   sign of the result is machine dependent for negative values, so force
+   it to be treated as an unsigned int. */
+
+#define ADDR2UINT(addr)        ((unsigned int) ((char *) (addr) - (char *) NULL))
+#define RESIDUAL(addr,bsize) ((unsigned int) (ADDR2UINT (addr) % (bsize)))
+
+/* Determine the amount of memory spanned by the initial heap table
+   (not an absolute limit).  */
+
+#define HEAP           (INT_BIT > 16 ? 4194304 : 65536)
+
+/* Number of contiguous free blocks allowed to build up at the end of
+   memory before they will be returned to the system.  */
+
+#define FINAL_FREE_BLOCKS      8
+
+/* Where to start searching the free list when looking for new memory.
+   The two possible values are 0 and heapindex.  Starting at 0 seems
+   to reduce total memory usage, while starting at heapindex seems to
+   run faster.  */
+
+#define MALLOC_SEARCH_START    mdp -> heapindex
+
+/* Address to block number and vice versa.  */
+
+#define BLOCK(A) (((char *) (A) - mdp -> heapbase) / BLOCKSIZE + 1)
+
+#define ADDRESS(B) ((PTR) (((B) - 1) * BLOCKSIZE + mdp -> heapbase))
+
+/* Data structure giving per-block information.  */
+
+typedef union
+  {
+    /* Heap information for a busy block.  */
+    struct
+      {
+       /* Zero for a large block, or positive giving the
+          logarithm to the base two of the fragment size.  */
+       int type;
+       union
+         {
+           struct
+             {
+               size_t nfree;   /* Free fragments in a fragmented block.  */
+               size_t first;   /* First free fragment of the block.  */
+             } frag;
+           /* Size (in blocks) of a large cluster.  */
+           size_t size;
+         } info;
+      } busy;
+    /* Heap information for a free block (that may be the first of
+       a free cluster).  */
+    struct
+      {
+       size_t size;            /* Size (in blocks) of a free cluster.  */
+       size_t next;            /* Index of next free cluster.  */
+       size_t prev;            /* Index of previous free cluster.  */
+      } free;
+  } malloc_info;
+
+/* List of blocks allocated with `mmemalign' (or `mvalloc').  */
+
+struct alignlist
+  {
+    struct alignlist *next;
+    PTR aligned;               /* The address that mmemaligned returned.  */
+    PTR exact;                 /* The address that malloc returned.  */
+  };
+
+/* Doubly linked lists of free fragments.  */
+
+struct list
+  {
+    struct list *next;
+    struct list *prev;
+  };
+
+/* Statistics available to the user.
+   FIXME:  By design, the internals of the malloc package are no longer
+   exported to the user via an include file, so access to this data needs
+   to be via some other mechanism, such as mmstat_<something> where the
+   return value is the <something> the user is interested in. */
+
+struct mstats
+  {
+    size_t bytes_total;                /* Total size of the heap. */
+    size_t chunks_used;                /* Chunks allocated by the user. */
+    size_t bytes_used;         /* Byte total of user-allocated chunks. */
+    size_t chunks_free;                /* Chunks in the free list. */
+    size_t bytes_free;         /* Byte total of chunks in the free list. */
+  };
+
+/* Internal structure that defines the format of the malloc-descriptor.
+   This gets written to the base address of the region that mmalloc is
+   managing, and thus also becomes the file header for the mapped file,
+   if such a file exists. */
+
+struct mdesc
+{
+  /* The "magic number" for an mmalloc file. */
+
+  char magic[MMALLOC_MAGIC_SIZE];
+
+  /* The size in bytes of this structure, used as a sanity check when reusing
+     a previously created mapped file. */
+
+  unsigned int headersize;
+
+  /* The version number of the mmalloc package that created this file. */
+
+  unsigned char version;
+
+  /* Some flag bits to keep track of various internal things. */
+
+  unsigned int flags;
+
+  /* If a system call made by the mmalloc package fails, the errno is
+     preserved for future examination. */
+
+  int saved_errno;
+
+  /* Pointer to the function that is used to get more core, or return core
+     to the system, for requests using this malloc descriptor.  For memory
+     mapped regions, this is the mmap() based routine.  There may also be
+     a single malloc descriptor that points to an sbrk() based routine
+     for systems without mmap() or for applications that call the mmalloc()
+     package with a NULL malloc descriptor.
+
+     FIXME:  For mapped regions shared by more than one process, this
+     needs to be maintained on a per-process basis. */
+
+  PTR (*morecore) PARAMS ((struct mdesc *, int));
+     
+  /* Pointer to the function that causes an abort when the memory checking
+     features are activated.  By default this is set to abort(), but can
+     be set to another function by the application using mmalloc().
+
+     FIXME:  For mapped regions shared by more than one process, this
+     needs to be maintained on a per-process basis. */
+
+  void (*abortfunc) PARAMS ((void));
+
+  /* Debugging hook for free.
+
+     FIXME:  For mapped regions shared by more than one process, this
+     needs to be maintained on a per-process basis. */
+
+  void (*mfree_hook) PARAMS ((PTR, PTR));
+
+  /* Debugging hook for `malloc'.
+
+     FIXME:  For mapped regions shared by more than one process, this
+     needs to be maintained on a per-process basis. */
+
+  PTR (*mmalloc_hook) PARAMS ((PTR, size_t));
+
+  /* Debugging hook for realloc.
+
+     FIXME:  For mapped regions shared by more than one process, this
+     needs to be maintained on a per-process basis. */
+
+  PTR (*mrealloc_hook) PARAMS ((PTR, PTR, size_t));
+
+  /* Number of info entries.  */
+
+  size_t heapsize;
+
+  /* Pointer to first block of the heap (base of the first block).  */
+
+  char *heapbase;
+
+  /* Current search index for the heap table.  */
+  /* Search index in the info table.  */
+
+  size_t heapindex;
+
+  /* Limit of valid info table indices.  */
+
+  size_t heaplimit;
+
+  /* Block information table.
+     Allocated with malign/__mmalloc_free (not mmalloc/mfree).  */
+  /* Table indexed by block number giving per-block information.  */
+
+  malloc_info *heapinfo;
+
+  /* Instrumentation.  */
+
+  struct mstats heapstats;
+
+  /* Free list headers for each fragment size.  */
+  /* Free lists for each fragment size.  */
+
+  struct list fraghead[BLOCKLOG];
+
+  /* List of blocks allocated by memalign.  */
+
+  struct alignlist *aligned_blocks;
+
+  /* The base address of the memory region for this malloc heap.  This
+     is the location where the bookkeeping data for mmap and for malloc
+     begins. */
+
+  char *base;
+
+  /* The current location in the memory region for this malloc heap which
+     represents the end of memory in use. */
+
+  char *breakval;
+
+  /* The end of the current memory region for this malloc heap.  This is
+     the first location past the end of mapped memory. */
+
+  char *top;
+
+  /* Open file descriptor for the file to which this malloc heap is mapped.
+     This will always be a valid file descriptor, since /dev/zero is used
+     by default if no open file is supplied by the client.  Also note that
+     it may change each time the region is mapped and unmapped. */
+
+  int fd;
+
+  /* An array of keys to data within the mapped region, for use by the
+     application.  */
+
+  PTR keys[MMALLOC_KEYS];
+
+};
+
+/* Bits to look at in the malloc descriptor flags word */
+
+#define MMALLOC_DEVZERO                (1 << 0)        /* Have mapped to /dev/zero */
+#define MMALLOC_INITIALIZED    (1 << 1)        /* Initialized mmalloc */
+#define MMALLOC_MMCHECK_USED   (1 << 2)        /* mmcheckf() called already */
+
+/* Internal version of `mfree' used in `morecore'. */
+
+extern void __mmalloc_free PARAMS ((struct mdesc *, PTR));
+
+/* Hooks for debugging versions.  */
+
+extern void (*__mfree_hook) PARAMS ((PTR, PTR));
+extern PTR (*__mmalloc_hook) PARAMS ((PTR, size_t));
+extern PTR (*__mrealloc_hook) PARAMS ((PTR, PTR, size_t));
+
+/* A default malloc descriptor for the single sbrk() managed region. */
+
+extern struct mdesc *__mmalloc_default_mdp;
+
+/* Initialize the first use of the default malloc descriptor, which uses
+   an sbrk() region. */
+
+extern struct mdesc *__mmalloc_sbrk_init PARAMS ((void));
+
+/* Grow or shrink a contiguous mapped region using mmap().
+   Works much like sbrk() */
+
+#if defined(HAVE_MMAP)
+
+extern PTR __mmalloc_mmap_morecore PARAMS ((struct mdesc *, int));
+
+#endif
+
+/* Remap a mmalloc region that was previously mapped. */
+
+extern PTR __mmalloc_remap_core PARAMS ((struct mdesc *));
+
+/* Macro to convert from a user supplied malloc descriptor to pointer to the
+   internal malloc descriptor.  If the user supplied descriptor is NULL, then
+   use the default internal version, initializing it if necessary.  Otherwise
+   just cast the user supplied version (which is void *) to the proper type
+   (struct mdesc *). */
+
+#define MD_TO_MDP(md) \
+  ((md) == NULL \
+   ? (__mmalloc_default_mdp == NULL \
+      ? __mmalloc_sbrk_init () \
+      : __mmalloc_default_mdp) \
+   : (struct mdesc *) (md))
+
+#endif  /* __MMPRIVATE_H */
diff --git a/mmalloc/mmstats.c b/mmalloc/mmstats.c
new file mode 100644 (file)
index 0000000..ed17323
--- /dev/null
@@ -0,0 +1,46 @@
+/* Access the statistics maintained by `mmalloc'.
+   Copyright 1990, 1991, 1992 Free Software Foundation
+
+   Written May 1989 by Mike Haertel.
+   Modified Mar 1992 by Fred Fish.  (fnf@cygnus.com)
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   The author may be reached (Email) at the address mike@ai.mit.edu,
+   or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+#include "mmprivate.h"
+
+/* FIXME:  See the comment in mmprivate.h where struct mstats is defined.
+   None of the internal mmalloc structures should be externally visible
+   outside the library. */
+
+struct mstats
+mmstats (md)
+  PTR md;
+{
+  struct mstats result;
+  struct mdesc *mdp;
+
+  mdp = MD_TO_MDP (md);
+  result.bytes_total =
+      (char *) mdp -> morecore (mdp, 0) - mdp -> heapbase;
+  result.chunks_used = mdp -> heapstats.chunks_used;
+  result.bytes_used = mdp -> heapstats.bytes_used;
+  result.chunks_free = mdp -> heapstats.chunks_free;
+  result.bytes_free = mdp -> heapstats.bytes_free;
+  return (result);
+}
diff --git a/mmalloc/mmtrace.awk b/mmalloc/mmtrace.awk
new file mode 100644 (file)
index 0000000..d7689ce
--- /dev/null
@@ -0,0 +1,36 @@
+#
+#  Awk program to analyze mtrace.c output.
+#
+$1 == "+"      { if (allocated[$2] != "")
+                   print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
+                 else
+                   allocated[$2] = $3;
+               }
+$1 == "-"      { if (allocated[$2] != "") {
+                   allocated[$2] = "";
+                   if (allocated[$2] != "")
+                       print "DELETE FAILED", $2, allocated[$2];
+                 } else
+                   print "-", $2, "Free", NR, "was never alloc'd";
+               }
+$1 == "<"      { if (allocated[$2] != "")
+                   allocated[$2] = "";
+                 else
+                   print "-", $2, "Realloc", NR, "was never alloc'd";
+               }
+$1 == ">"      { if (allocated[$2] != "")
+                   print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
+                 else
+                   allocated[$2] = $3;
+               }
+
+# Ignore "= Start"
+$1 == "="      { }
+# Ignore failed realloc attempts for now
+$1 == "!"      { }
+
+
+END            { for (x in allocated) 
+                   if (allocated[x] != "")
+                     print "+", x, allocated[x];
+               }
diff --git a/mmalloc/mmtrace.c b/mmalloc/mmtrace.c
new file mode 100644 (file)
index 0000000..563c860
--- /dev/null
@@ -0,0 +1,171 @@
+/* More debugging hooks for `mmalloc'.
+   Copyright 1991, 1992, 1994 Free Software Foundation
+
+   Written April 2, 1991 by John Gilmore of Cygnus Support
+   Based on mcheck.c by Mike Haertel.
+   Modified Mar 1992 by Fred Fish.  (fnf@cygnus.com)
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <stdio.h>
+#include "mmprivate.h"
+
+static void tr_break PARAMS ((void));
+static void tr_freehook PARAMS ((PTR, PTR));
+static PTR tr_mallochook PARAMS ((PTR, size_t));
+static PTR tr_reallochook PARAMS ((PTR, PTR, size_t));
+
+#ifndef        __GNU_LIBRARY__
+extern char *getenv ();
+#endif
+
+static FILE *mallstream;
+
+#if 0  /* FIXME:  Disabled for now. */
+static char mallenv[] = "MALLOC_TRACE";
+static char mallbuf[BUFSIZ];   /* Buffer for the output.  */
+#endif
+
+/* Address to breakpoint on accesses to... */
+static PTR mallwatch;
+
+/* Old hook values.  */
+
+static void (*old_mfree_hook) PARAMS ((PTR, PTR));
+static PTR (*old_mmalloc_hook) PARAMS ((PTR, size_t));
+static PTR (*old_mrealloc_hook) PARAMS ((PTR, PTR, size_t));
+
+/* This function is called when the block being alloc'd, realloc'd, or
+   freed has an address matching the variable "mallwatch".  In a debugger,
+   set "mallwatch" to the address of interest, then put a breakpoint on
+   tr_break.  */
+
+static void
+tr_break ()
+{
+}
+
+static void
+tr_freehook (md, ptr)
+  PTR md;
+  PTR ptr;
+{
+  struct mdesc *mdp;
+
+  mdp = MD_TO_MDP (md);
+  /* Be sure to print it first.  */
+  fprintf (mallstream, "- %08lx\n", (unsigned long) ptr);
+  if (ptr == mallwatch)
+    tr_break ();
+  mdp -> mfree_hook = old_mfree_hook;
+  mfree (md, ptr);
+  mdp -> mfree_hook = tr_freehook;
+}
+
+static PTR
+tr_mallochook (md, size)
+  PTR md;
+  size_t size;
+{
+  PTR hdr;
+  struct mdesc *mdp;
+
+  mdp = MD_TO_MDP (md);
+  mdp -> mmalloc_hook = old_mmalloc_hook;
+  hdr = (PTR) mmalloc (md, size);
+  mdp -> mmalloc_hook = tr_mallochook;
+
+  /* We could be printing a NULL here; that's OK.  */
+  fprintf (mallstream, "+ %08lx %x\n", (unsigned long) hdr, size);
+
+  if (hdr == mallwatch)
+    tr_break ();
+
+  return (hdr);
+}
+
+static PTR
+tr_reallochook (md, ptr, size)
+  PTR md;
+  PTR ptr;
+  size_t size;
+{
+  PTR hdr;
+  struct mdesc *mdp;
+
+  mdp = MD_TO_MDP (md);
+
+  if (ptr == mallwatch)
+    tr_break ();
+
+  mdp -> mfree_hook = old_mfree_hook;
+  mdp -> mmalloc_hook = old_mmalloc_hook;
+  mdp -> mrealloc_hook = old_mrealloc_hook;
+  hdr = (PTR) mrealloc (md, ptr, size);
+  mdp -> mfree_hook = tr_freehook;
+  mdp -> mmalloc_hook = tr_mallochook;
+  mdp -> mrealloc_hook = tr_reallochook;
+  if (hdr == NULL)
+    /* Failed realloc.  */
+    fprintf (mallstream, "! %08lx %x\n", (unsigned long) ptr, size);
+  else
+    fprintf (mallstream, "< %08lx\n> %08lx %x\n", (unsigned long) ptr,
+            (unsigned long) hdr, size);
+
+  if (hdr == mallwatch)
+    tr_break ();
+
+  return hdr;
+}
+
+/* We enable tracing if either the environment variable MALLOC_TRACE
+   is set, or if the variable mallwatch has been patched to an address
+   that the debugging user wants us to stop on.  When patching mallwatch,
+   don't forget to set a breakpoint on tr_break!  */
+
+int
+mmtrace ()
+{
+#if 0  /* FIXME!  This is disabled for now until we figure out how to
+          maintain a stack of hooks per heap, since we might have other
+          hooks (such as set by mmcheck/mmcheckf) active also. */
+  char *mallfile;
+
+  mallfile = getenv (mallenv);
+  if (mallfile  != NULL || mallwatch != NULL)
+    {
+      mallstream = fopen (mallfile != NULL ? mallfile : "/dev/null", "w");
+      if (mallstream != NULL)
+       {
+         /* Be sure it doesn't mmalloc its buffer!  */
+         setbuf (mallstream, mallbuf);
+         fprintf (mallstream, "= Start\n");
+         old_mfree_hook = mdp -> mfree_hook;
+         mdp -> mfree_hook = tr_freehook;
+         old_mmalloc_hook = mdp -> mmalloc_hook;
+         mdp -> mmalloc_hook = tr_mallochook;
+         old_mrealloc_hook = mdp -> mrealloc_hook;
+         mdp -> mrealloc_hook = tr_reallochook;
+       }
+    }
+
+#endif /* 0 */
+
+  return (1);
+}
+
diff --git a/mmalloc/mrealloc.c b/mmalloc/mrealloc.c
new file mode 100644 (file)
index 0000000..e2004aa
--- /dev/null
@@ -0,0 +1,163 @@
+/* Change the size of a block allocated by `mmalloc'.
+   Copyright 1990, 1991 Free Software Foundation
+                 Written May 1989 by Mike Haertel.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   The author may be reached (Email) at the address mike@ai.mit.edu,
+   or (US mail) as Mike Haertel c/o Free Software Foundation. */
+
+#include <string.h>    /* Prototypes for memcpy, memmove, memset, etc */
+
+#include "mmprivate.h"
+
+/* Resize the given region to the new size, returning a pointer
+   to the (possibly moved) region.  This is optimized for speed;
+   some benchmarks seem to indicate that greater compactness is
+   achieved by unconditionally allocating and copying to a
+   new region.  This module has incestuous knowledge of the
+   internals of both mfree and mmalloc. */
+
+PTR
+mrealloc (md, ptr, size)
+  PTR md;
+  PTR ptr;
+  size_t size;
+{
+  struct mdesc *mdp;
+  PTR result;
+  int type;
+  size_t block, blocks, oldlimit;
+
+  if (size == 0)
+    {
+      mfree (md, ptr);
+      return (mmalloc (md, 0));
+    }
+  else if (ptr == NULL)
+    {
+      return (mmalloc (md, size));
+    }
+
+  mdp = MD_TO_MDP (md);
+
+  if (mdp -> mrealloc_hook != NULL)
+    {
+      return ((*mdp -> mrealloc_hook) (md, ptr, size));
+    }
+
+  block = BLOCK (ptr);
+
+  type = mdp -> heapinfo[block].busy.type;
+  switch (type)
+    {
+    case 0:
+      /* Maybe reallocate a large block to a small fragment.  */
+      if (size <= BLOCKSIZE / 2)
+       {
+         result = mmalloc (md, size);
+         if (result != NULL)
+           {
+             memcpy (result, ptr, size);
+             mfree (md, ptr);
+             return (result);
+           }
+       }
+
+      /* The new size is a large allocation as well;
+        see if we can hold it in place. */
+      blocks = BLOCKIFY (size);
+      if (blocks < mdp -> heapinfo[block].busy.info.size)
+       {
+         /* The new size is smaller; return excess memory to the free list. */
+         mdp -> heapinfo[block + blocks].busy.type = 0;
+         mdp -> heapinfo[block + blocks].busy.info.size
+           = mdp -> heapinfo[block].busy.info.size - blocks;
+         mdp -> heapinfo[block].busy.info.size = blocks;
+         mfree (md, ADDRESS (block + blocks));
+         result = ptr;
+       }
+      else if (blocks == mdp -> heapinfo[block].busy.info.size)
+       {
+         /* No size change necessary.  */
+         result = ptr;
+       }
+      else
+       {
+         /* Won't fit, so allocate a new region that will.
+            Free the old region first in case there is sufficient
+            adjacent free space to grow without moving. */
+         blocks = mdp -> heapinfo[block].busy.info.size;
+         /* Prevent free from actually returning memory to the system.  */
+         oldlimit = mdp -> heaplimit;
+         mdp -> heaplimit = 0;
+         mfree (md, ptr);
+         mdp -> heaplimit = oldlimit;
+         result = mmalloc (md, size);
+         if (result == NULL)
+           {
+             mmalloc (md, blocks * BLOCKSIZE);
+             return (NULL);
+           }
+         if (ptr != result)
+           {
+             memmove (result, ptr, blocks * BLOCKSIZE);
+           }
+       }
+      break;
+
+    default:
+      /* Old size is a fragment; type is logarithm
+        to base two of the fragment size.  */
+      if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type))
+       {
+         /* The new size is the same kind of fragment.  */
+         result = ptr;
+       }
+      else
+       {
+         /* The new size is different; allocate a new space,
+            and copy the lesser of the new size and the old. */
+         result = mmalloc (md, size);
+         if (result == NULL)
+           {
+             return (NULL);
+           }
+         memcpy (result, ptr, MIN (size, (size_t) 1 << type));
+         mfree (md, ptr);
+       }
+      break;
+    }
+
+  return (result);
+}
+
+/* When using this package, provide a version of malloc/realloc/free built
+   on top of it, so that if we use the default sbrk() region we will not
+   collide with another malloc package trying to do the same thing, if
+   the application contains any "hidden" calls to malloc/realloc/free (such
+   as inside a system library). */
+
+PTR
+realloc (ptr, size)
+  PTR ptr;
+  size_t size;
+{
+  PTR result;
+
+  result = mrealloc ((PTR) NULL, ptr, size);
+  return (result);
+}
diff --git a/mmalloc/mvalloc.c b/mmalloc/mvalloc.c
new file mode 100644 (file)
index 0000000..e44942f
--- /dev/null
@@ -0,0 +1,50 @@
+/* Allocate memory on a page boundary.
+   Copyright (C) 1991 Free Software Foundation, Inc.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "mmprivate.h"
+
+/* Cache the pagesize for the current host machine.  Note that if the host
+   does not readily provide a getpagesize() function, we need to emulate it
+   elsewhere, not clutter up this file with lots of kluges to try to figure
+   it out. */
+
+static size_t cache_pagesize;
+#if NEED_DECLARATION_GETPAGESIZE
+extern int getpagesize PARAMS ((void));
+#endif
+
+PTR
+mvalloc (md, size)
+  PTR md;
+  size_t size;
+{
+  if (cache_pagesize == 0)
+    {
+      cache_pagesize = getpagesize ();
+    }
+
+  return (mmemalign (md, cache_pagesize, size));
+}
+
+
+PTR
+valloc (size)
+  size_t size;
+{
+  return mvalloc ((PTR) NULL, size);
+}
diff --git a/mmalloc/sbrk-sup.c b/mmalloc/sbrk-sup.c
new file mode 100644 (file)
index 0000000..93c078b
--- /dev/null
@@ -0,0 +1,102 @@
+/* Support for sbrk() regions.
+   Copyright 1992, 2000 Free Software Foundation, Inc.
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>    /* Prototypes for sbrk (maybe) */
+#endif
+#include <string.h>    /* Prototypes for memcpy, memmove, memset, etc */
+
+#include "mmprivate.h"
+
+static PTR sbrk_morecore PARAMS ((struct mdesc *, int));
+#if NEED_DECLARATION_SBRK
+extern PTR sbrk PARAMS ((int));
+#endif
+
+/* The mmalloc() package can use a single implicit malloc descriptor
+   for mmalloc/mrealloc/mfree operations which do not supply an explicit
+   descriptor.  For these operations, sbrk() is used to obtain more core
+   from the system, or return core.  This allows mmalloc() to provide
+   backwards compatibility with the non-mmap'd version. */
+
+struct mdesc *__mmalloc_default_mdp;
+
+/* Use sbrk() to get more core. */
+
+static PTR
+sbrk_morecore (mdp, size)
+  struct mdesc *mdp;
+  int size;
+{
+  PTR result;
+
+  if ((result = sbrk (size)) == (PTR) -1)
+    {
+      result = NULL;
+    }
+  else
+    {
+      mdp -> breakval += size;
+      mdp -> top += size;
+    }
+  return (result);
+}
+
+/* Initialize the default malloc descriptor if this is the first time
+   a request has been made to use the default sbrk'd region.
+
+   Since no alignment guarantees are made about the initial value returned
+   by sbrk, test the initial value and (if necessary) sbrk enough additional
+   memory to start off with alignment to BLOCKSIZE.  We actually only need
+   it aligned to an alignment suitable for any object, so this is overkill.
+   But at most it wastes just part of one BLOCKSIZE chunk of memory and
+   minimizes portability problems by avoiding us having to figure out
+   what the actual minimal alignment is.  The rest of the malloc code
+   avoids this as well, by always aligning to the minimum of the requested
+   size rounded up to a power of two, or to BLOCKSIZE.
+
+   Note that we are going to use some memory starting at this initial sbrk
+   address for the sbrk region malloc descriptor, which is a struct, so the
+   base address must be suitably aligned. */
+
+struct mdesc *
+__mmalloc_sbrk_init ()
+{
+  PTR base;
+  unsigned int adj;
+
+  base = sbrk (0);
+  adj = RESIDUAL (base, BLOCKSIZE);
+  if (adj != 0)
+    {
+      sbrk (BLOCKSIZE - adj);
+      base = sbrk (0);
+    }
+  __mmalloc_default_mdp = (struct mdesc *) sbrk (sizeof (struct mdesc));
+  memset ((char *) __mmalloc_default_mdp, 0, sizeof (struct mdesc));
+  __mmalloc_default_mdp -> morecore = sbrk_morecore;
+  __mmalloc_default_mdp -> base = base;
+  __mmalloc_default_mdp -> breakval = __mmalloc_default_mdp -> top = sbrk (0);
+  __mmalloc_default_mdp -> fd = -1;
+  return (__mmalloc_default_mdp);
+}
+
+
index bf289e9230c0822f0649b9aba98048cb62cc8c49..6405e9f05578be1b7ef01d63ede9491e6a3375b5 100644 (file)
@@ -1,74 +1,3 @@
-2004-10-15  Alan Modra  <amodra@bigpond.net.au>
-
-       * Makefile.am: Run "make dep-am"
-       * Makefile.in: Regenerate.
-
-2004-10-12  Bob Wilson  <bob.wilson@acm.org>
-
-       * xtensa-dis.c: Use ISO C90 formatting.
-
-2004-10-09  Alan Modra  <amodra@bigpond.net.au>
-
-       * ppc-opc.c: Revert 2004-09-09 change.
-
-2004-10-07  Bob Wilson  <bob.wilson@acm.org>
-
-       * xtensa-dis.c (state_names): Delete.
-       (fetch_data): Use xtensa_isa_maxlength.
-       (print_xtensa_operand): Replace operand parameter with opcode/operand
-       pair.  Remove print_sr_name parameter.  Use new xtensa-isa.h functions.
-       (print_insn_xtensa): Use new xtensa-isa.h functions.  Handle multislot
-       instruction bundles.  Use xmalloc instead of malloc.
-
-2004-10-07  David Gibson  <david@gibson.dropbear.id.au>
-
-       * ppc-opc.c: Replace literal "0"s with NULLs in pointer
-       initializers.
-
-2004-10-07  Tomer Levi  <Tomer.Levi@nsc.com>
-
-       * crx-opc.c (crx_instruction): Support Co-processor insns.
-       * crx-dis.c (COP_ARG_TYPE): New enum for CO-Processor arguments.
-       (getregliststring): Change function to use the above enum.
-       (print_arg): Handle CO-Processor insns.
-       (crx_cinvs): Add 'b' option to invalidate the branch-target
-       cache.
-
-2004-10-06  Aldy Hernandez  <aldyh@redhat.com>
-
-       * ppc-opc.c (powerpc_opcodes): Add efscfd, efdabs, efdnabs,
-       efdneg, efdadd, efdsub, efdmul, efddiv, efdcmpgt, efdcmplt,
-       efdcmpeq, efdtstgt, efdtstlt, efdtsteq, efdcfsi, efdcfsid,
-       efdcfui, efdcfuid, efdcfsf, efdcfuf, efdctsi, efdctsidz, efdctsiz,
-       efdctui, efdctuidz, efdctuiz, efdctsf, efdctuf, efdctuf, efdcfs.
-
-2004-10-01  Bill Farmer  <Bill@the-farmers.freeserve.co.uk>
-
-       * pdp11-dis.c (print_insn_pdp11): Subtract the SOB's displacement
-       rather than add it.
-
-2004-09-30  Paul Brook  <paul@codesourcery.com>
-
-       * arm-dis.c (print_insn_arm): Handle 'e' for SMI instruction.
-       * arm-opc.h: Document %e.  Add ARMv6ZK instructions.
-
-2004-09-17  H.J. Lu  <hongjiu.lu@intel.com>
-
-       * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
-       (CONFIG_STATUS_DEPENDENCIES): New.
-       (Makefile): Removed.
-       (config.status): Likewise.
-       * Makefile.in: Regenerated.
-
-2004-09-17  Alan Modra  <amodra@bigpond.net.au>
-
-       * Makefile.am: Run "make dep-am".
-       * Makefile.in: Regenerate.
-       * aclocal.m4: Regenerate.
-       * configure: Regenerate.
-       * po/POTFILES.in: Regenerate.
-       * po/opcodes.pot: Regenerate.
-
 2004-09-11  Andreas Schwab  <schwab@suse.de>
 
        * configure: Rebuild.
index b7d4cba02cfa0d6e20bbe70e5c4c5f683efd30a8..5c28971dade741340b691f8d88f536caff5098b4 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 
-AUTOMAKE_OPTIONS = 1.9 cygnus
+AUTOMAKE_OPTIONS = cygnus
 
 SUBDIRS = po
 
@@ -281,10 +281,6 @@ ALL_MACHINES = \
 
 OFILES = @BFD_MACHINES@
 
-# We should reconfigure whenever bfd/configure.in changes, because
-# that's where the version number in Makefile comes from.
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
-
 INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl
 
 disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
@@ -323,6 +319,11 @@ po/POTFILES.in: @MAINT@ Makefile
        for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
          && mv tmp $(srcdir)/po/POTFILES.in
 
+# We should reconfigure whenever bfd/configure.in changes, because
+# that's where the version number comes from.
+config.status: $(srcdir)/configure $(srcdir)/../bfd/configure.in
+       $(SHELL) ./config.status --recheck
+
 install-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@install_libopcodes
        @$(NORMAL_INSTALL)
 
@@ -464,6 +465,8 @@ s390-opc.tab: s390-mkopc s390-opc.txt
 sh-dis.lo: sh-dis.c
        $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $<
 
+Makefile: $(BFDDIR)/configure.in
+
 # This dependency stuff is copied from BFD.
 
 DEP: dep.sed $(CFILES) $(HFILES) config.h
@@ -549,11 +552,9 @@ cris-dis.lo: cris-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
   $(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)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
-  $(INCDIR)/opcode/crx.h
-crx-opc.lo: crx-opc.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
-  $(INCDIR)/symcat.h $(INCDIR)/opcode/crx.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
@@ -788,7 +789,7 @@ s390-dis.lo: s390-dis.c $(INCDIR)/ansidecl.h sysdep.h \
   config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \
   $(INCDIR)/opcode/s390.h
 sh-dis.lo: sh-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
-  sh-opc.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/dis-asm.h
+  sh-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
 sh64-dis.lo: sh64-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
   $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
   sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \
@@ -845,8 +846,8 @@ xstormy16-opc.lo: xstormy16-opc.c sysdep.h config.h \
   $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h xstormy16-desc.h \
   $(INCDIR)/opcode/cgen.h xstormy16-opc.h $(INCDIR)/libiberty.h
 xtensa-dis.lo: xtensa-dis.c $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h sysdep.h \
-  config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
+  $(INCDIR)/ansidecl.h sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) $(INCDIR)/symcat.h
 z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h z8k-opc.h
 z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \
index 19aee60b553c29e0dbb01934c17ad7dd8e9f3cbd..9acfc0b03a93c64caf00a5d605d84958037f4e84 100644 (file)
@@ -1,8 +1,6 @@
-# Makefile.in generated by automake 1.9.1 from Makefile.am.
-# @configure_input@
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  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.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-@SET_MAKE@
-
 
-SOURCES = libopcodes.c $(libopcodes_la_SOURCES)
+SHELL = @SHELL@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+
 top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
 INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = @build@
+host_alias = @host_alias@
 host_triplet = @host@
-target_triplet = @target@
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub \
-       ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/configure $(am__configure_deps) \
-       $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
-       $(top_srcdir)/po/Make-in $(srcdir)/../ltmain.sh \
-       $(srcdir)/../config.guess $(srcdir)/../config.sub
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/../bfd/acinclude.m4 \
-       $(top_srcdir)/../config/accross.m4 \
-       $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../libtool.m4 \
-       $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = po/Makefile.in
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-libopcodes_a_AR = $(AR) $(ARFLAGS)
-libopcodes_a_LIBADD =
-libopcodes_a_SOURCES = libopcodes.c
-libopcodes_a_OBJECTS = libopcodes.$(OBJEXT)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(bfdlibdir)"
-bfdlibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(bfdlib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-am_libopcodes_la_OBJECTS = dis-buf.lo disassemble.lo dis-init.lo
-libopcodes_la_OBJECTS = $(am_libopcodes_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = libopcodes.c $(libopcodes_la_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-exec-recursive install-info-recursive \
-       install-recursive installcheck-recursive installdirs-recursive \
-       pdf-recursive ps-recursive uninstall-info-recursive \
-       uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
 AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
+AS = @AS@
 BFD_MACHINES = @BFD_MACHINES@
 CATALOGS = @CATALOGS@
 CATOBJEXT = @CATOBJEXT@
 CC = @CC@
-CCDEPMODE = @CCDEPMODE@
 CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
-CGEN_MAINT_FALSE = @CGEN_MAINT_FALSE@
-CGEN_MAINT_TRUE = @CGEN_MAINT_TRUE@
 CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
 DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+DLLTOOL = @DLLTOOL@
 EXEEXT = @EXEEXT@
 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
+GNATBIND = @GNATBIND@
 GT_NO = @GT_NO@
 GT_YES = @GT_YES@
+HAVE_LIB = @HAVE_LIB@
 HDEFINES = @HDEFINES@
 INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@
-INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INSTOBJEXT = @INSTOBJEXT@
 INTLDEPS = @INTLDEPS@
 INTLLIBS = @INTLLIBS@
 INTLOBJS = @INTLOBJS@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
+LIB = @LIB@
 LIBTOOL = @LIBTOOL@
+LN = @LN@
 LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
+LTLIB = @LTLIB@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
 MKINSTALLDIRS = @MKINSTALLDIRS@
 MSGFMT = @MSGFMT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
 POFILES = @POFILES@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
 STRIP = @STRIP@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
 WIN32LDFLAGS = @WIN32LDFLAGS@
 WIN32LIBADD = @WIN32LIBADD@
-XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
 archdefs = @archdefs@
-bfdincludedir = @bfdincludedir@
-bfdlibdir = @bfdlibdir@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
+build_noncanonical = @build_noncanonical@
+build_subdir = @build_subdir@
 cgendir = @cgendir@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
+do_compare = @do_compare@
 host_noncanonical = @host_noncanonical@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
+host_subdir = @host_subdir@
 l = @l@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
+ncn_cv_ = @ncn_cv_@
 target_noncanonical = @target_noncanonical@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS = 1.9 cygnus
+target_subdir = @target_subdir@
+
+AUTOMAKE_OPTIONS = cygnus
+
 SUBDIRS = po
+
 INCDIR = $(srcdir)/../include
 BFDDIR = $(srcdir)/../bfd
 MKDEP = gcc -MM
+
+WARN_CFLAGS = @WARN_CFLAGS@
 AM_CFLAGS = $(WARN_CFLAGS)
+
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
+
 bfdlib_LTLIBRARIES = libopcodes.la
 
 # This is where bfd.h lives.
@@ -244,269 +143,20 @@ BFD_H = ../bfd/bfd.h
 LIBIBERTY = ../libiberty/libiberty.a
 
 # Header files.
-HFILES = \
-       arm-opc.h \
-       fr30-desc.h fr30-opc.h \
-       frv-desc.h frv-opc.h \
-       h8500-opc.h \
-       ia64-asmtab.h \
-       ia64-opc.h \
-       ip2k-desc.h ip2k-opc.h \
-       iq2000-desc.h iq2000-opc.h \
-       m32r-desc.h m32r-opc.h \
-       mcore-opc.h \
-       openrisc-desc.h openrisc-opc.h \
-       sh-opc.h \
-       sh64-opc.h \
-       sysdep.h \
-       w65-opc.h \
-       xstormy16-desc.h xstormy16-opc.h \
-       z8k-opc.h
+HFILES =       arm-opc.h       fr30-desc.h fr30-opc.h  frv-desc.h frv-opc.h    h8500-opc.h     ia64-asmtab.h   ia64-opc.h      ip2k-desc.h ip2k-opc.h  iq2000-desc.h iq2000-opc.h      m32r-desc.h m32r-opc.h  mcore-opc.h     openrisc-desc.h openrisc-opc.h  sh-opc.h        sh64-opc.h      sysdep.h        w65-opc.h       xstormy16-desc.h xstormy16-opc.h        z8k-opc.h
 
 
 # C source files that correspond to .o's.
-CFILES = \
-       a29k-dis.c \
-       alpha-dis.c \
-       alpha-opc.c \
-       arc-dis.c \
-       arc-opc.c \
-       arc-ext.c \
-       arm-dis.c \
-       avr-dis.c \
-       cgen-asm.c \
-       cgen-dis.c \
-       cgen-opc.c \
-       cris-dis.c \
-       cris-opc.c \
-       crx-dis.c \
-       crx-opc.c \
-       d10v-dis.c \
-       d10v-opc.c \
-       d30v-dis.c \
-       d30v-opc.c \
-       dlx-dis.c \
-       dis-buf.c \
-       dis-init.c \
-       disassemble.c \
-       fr30-asm.c \
-       fr30-desc.c \
-       fr30-dis.c \
-       fr30-ibld.c \
-       fr30-opc.c \
-       frv-asm.c \
-       frv-desc.c \
-       frv-dis.c \
-       frv-ibld.c \
-       frv-opc.c \
-       h8300-dis.c \
-       h8500-dis.c \
-       hppa-dis.c \
-       i370-dis.c \
-       i370-opc.c \
-       i386-dis.c \
-       i860-dis.c \
-       i960-dis.c \
-       ia64-dis.c \
-       ia64-opc-a.c \
-       ia64-opc-b.c \
-       ia64-opc-f.c \
-       ia64-opc-i.c \
-       ia64-opc-m.c \
-       ia64-opc-d.c \
-       ia64-opc.c \
-       ia64-gen.c \
-       ia64-asmtab.c \
-       ip2k-asm.c \
-       ip2k-desc.c \
-       ip2k-dis.c \
-       ip2k-ibld.c \
-       ip2k-opc.c \
-       iq2000-asm.c \
-       iq2000-desc.c \
-       iq2000-dis.c \
-       iq2000-ibld.c \
-       iq2000-opc.c \
-       m32r-asm.c \
-       m32r-desc.c \
-       m32r-dis.c \
-       m32r-ibld.c \
-       m32r-opc.c \
-       m32r-opinst.c \
-       m68hc11-dis.c \
-       m68hc11-opc.c \
-       m68k-dis.c \
-       m68k-opc.c \
-       m88k-dis.c \
-       mcore-dis.c \
-       mips-dis.c \
-       mips-opc.c \
-       mips16-opc.c \
-       m10200-dis.c \
-       m10200-opc.c \
-       m10300-dis.c \
-       m10300-opc.c \
-       mmix-dis.c \
-       mmix-opc.c \
-       ns32k-dis.c \
-       openrisc-asm.c \
-       openrisc-desc.c \
-       openrisc-dis.c \
-       openrisc-ibld.c \
-       openrisc-opc.c \
-       or32-dis.c \
-       or32-opc.c \
-       pdp11-dis.c \
-       pdp11-opc.c \
-       pj-dis.c \
-       pj-opc.c \
-       ppc-dis.c \
-       ppc-opc.c \
-       s390-mkopc.c \
-       s390-opc.c \
-       s390-dis.c \
-       sh-dis.c \
-       sh64-dis.c \
-       sh64-opc.c \
-       sparc-dis.c \
-       sparc-opc.c \
-       tic30-dis.c \
-       tic4x-dis.c \
-       tic54x-dis.c \
-       tic54x-opc.c \
-       tic80-dis.c \
-       tic80-opc.c \
-       v850-dis.c \
-       v850-opc.c \
-       vax-dis.c \
-       w65-dis.c \
-       xstormy16-asm.c \
-       xstormy16-desc.c \
-       xstormy16-dis.c \
-       xstormy16-ibld.c \
-       xstormy16-opc.c \
-       xtensa-dis.c \
-       z8k-dis.c \
-       z8kgen.c
-
-ALL_MACHINES = \
-       a29k-dis.lo \
-       alpha-dis.lo \
-       alpha-opc.lo \
-       arc-dis.lo \
-       arc-opc.lo \
-       arc-ext.lo \
-       arm-dis.lo \
-       avr-dis.lo \
-       cgen-asm.lo \
-       cgen-dis.lo \
-       cgen-opc.lo \
-       cris-dis.lo \
-       cris-opc.lo \
-       crx-dis.lo \
-       crx-opc.lo \
-       d10v-dis.lo \
-       d10v-opc.lo \
-       d30v-dis.lo \
-       d30v-opc.lo \
-       dlx-dis.lo \
-       fr30-asm.lo \
-       fr30-desc.lo \
-       fr30-dis.lo \
-       fr30-ibld.lo \
-       fr30-opc.lo \
-       frv-asm.lo \
-       frv-desc.lo \
-       frv-dis.lo \
-       frv-ibld.lo \
-       frv-opc.lo \
-       h8300-dis.lo \
-       h8500-dis.lo \
-       hppa-dis.lo \
-       i386-dis.lo \
-       i370-dis.lo \
-       i370-opc.lo \
-       i860-dis.lo \
-       i960-dis.lo \
-       ia64-dis.lo \
-       ia64-opc.lo \
-       ip2k-asm.lo \
-       ip2k-desc.lo \
-       ip2k-dis.lo \
-       ip2k-ibld.lo \
-       ip2k-opc.lo \
-       iq2000-asm.lo \
-       iq2000-desc.lo \
-       iq2000-dis.lo \
-       iq2000-ibld.lo \
-       iq2000-opc.lo \
-       m32r-asm.lo \
-       m32r-desc.lo \
-       m32r-dis.lo \
-       m32r-ibld.lo \
-       m32r-opc.lo \
-       m32r-opinst.lo \
-       m68hc11-dis.lo \
-       m68hc11-opc.lo \
-       m68k-dis.lo \
-       m68k-opc.lo \
-       m88k-dis.lo \
-       m10200-dis.lo \
-       m10200-opc.lo \
-       m10300-dis.lo \
-       m10300-opc.lo \
-       mcore-dis.lo \
-       mips-dis.lo \
-       mips-opc.lo \
-       mips16-opc.lo \
-       mmix-dis.lo \
-       mmix-opc.lo \
-       msp430-dis.lo \
-       ns32k-dis.lo \
-       openrisc-asm.lo \
-       openrisc-desc.lo \
-       openrisc-dis.lo \
-       openrisc-ibld.lo \
-       openrisc-opc.lo \
-       or32-dis.lo \
-       or32-opc.lo \
-       pdp11-dis.lo \
-       pdp11-opc.lo \
-       pj-dis.lo \
-       pj-opc.lo \
-       ppc-dis.lo \
-       ppc-opc.lo \
-       s390-dis.lo \
-       s390-opc.lo \
-       sh-dis.lo \
-       sh64-dis.lo \
-       sh64-opc.lo \
-       sparc-dis.lo \
-       sparc-opc.lo \
-       tic30-dis.lo \
-       tic4x-dis.lo \
-       tic54x-dis.lo \
-       tic54x-opc.lo \
-       tic80-dis.lo \
-       tic80-opc.lo \
-       v850-dis.lo \
-       v850-opc.lo \
-       vax-dis.lo \
-       w65-dis.lo \
-       xstormy16-asm.lo \
-       xstormy16-desc.lo \
-       xstormy16-dis.lo \
-       xstormy16-ibld.lo \
-       xstormy16-opc.lo \
-       xtensa-dis.lo \
-       z8k-dis.lo
+CFILES =       a29k-dis.c      alpha-dis.c     alpha-opc.c     arc-dis.c       arc-opc.c       arc-ext.c       arm-dis.c       avr-dis.c       cgen-asm.c      cgen-dis.c      cgen-opc.c      cris-dis.c      cris-opc.c      crx-dis.c       crx-opc.c       d10v-dis.c      d10v-opc.c      d30v-dis.c      d30v-opc.c      dlx-dis.c       dis-buf.c       dis-init.c      disassemble.c   fr30-asm.c      fr30-desc.c     fr30-dis.c      fr30-ibld.c     fr30-opc.c      frv-asm.c       frv-desc.c      frv-dis.c       frv-ibld.c      frv-opc.c       h8300-dis.c     h8500-dis.c     hppa-dis.c      i370-dis.c      i370-opc.c      i386-dis.c      i860-dis.c      i960-dis.c      ia64-dis.c      ia64-opc-a.c    ia64-opc-b.c    ia64-opc-f.c    ia64-opc-i.c    ia64-opc-m.c    ia64-opc-d.c    ia64-opc.c      ia64-gen.c      ia64-asmtab.c   ip2k-asm.c      ip2k-desc.c     ip2k-dis.c      ip2k-ibld.c     ip2k-opc.c      iq2000-asm.c    iq2000-desc.c   iq2000-dis.c    iq2000-ibld.c   iq2000-opc.c    m32r-asm.c      m32r-desc.c     m32r-dis.c      m32r-ibld.c     m32r-opc.c      m32r-opinst.c   m68hc11-dis.c   m68hc11-opc.c   m68k-dis.c      m68k-opc.c      m88k-dis.c      mcore-dis.c     mips-dis.c      mips-opc.c      mips16-opc.c    m10200-dis.c    m10200-opc.c    m10300-dis.c    m10300-opc.c    mmix-dis.c      mmix-opc.c      ns32k-dis.c     openrisc-asm.c  openrisc-desc.c         openrisc-dis.c  openrisc-ibld.c         openrisc-opc.c  or32-dis.c      or32-opc.c      pdp11-dis.c     pdp11-opc.c     pj-dis.c        pj-opc.c        ppc-dis.c       ppc-opc.c       s390-mkopc.c    s390-opc.c      s390-dis.c      sh-dis.c        sh64-dis.c      sh64-opc.c      sparc-dis.c     sparc-opc.c     tic30-dis.c     tic4x-dis.c     tic54x-dis.c    tic54x-opc.c    tic80-dis.c     tic80-opc.c     v850-dis.c      v850-opc.c      vax-dis.c       w65-dis.c       xstormy16-asm.c         xstormy16-desc.c        xstormy16-dis.c         xstormy16-ibld.c        xstormy16-opc.c         xtensa-dis.c    z8k-dis.c       z8kgen.c
+
+
+ALL_MACHINES =         a29k-dis.lo     alpha-dis.lo    alpha-opc.lo    arc-dis.lo      arc-opc.lo      arc-ext.lo      arm-dis.lo      avr-dis.lo      cgen-asm.lo     cgen-dis.lo     cgen-opc.lo     cris-dis.lo     cris-opc.lo     crx-dis.lo      crx-opc.lo      d10v-dis.lo     d10v-opc.lo     d30v-dis.lo     d30v-opc.lo     dlx-dis.lo      fr30-asm.lo     fr30-desc.lo    fr30-dis.lo     fr30-ibld.lo    fr30-opc.lo     frv-asm.lo      frv-desc.lo     frv-dis.lo      frv-ibld.lo     frv-opc.lo      h8300-dis.lo    h8500-dis.lo    hppa-dis.lo     i386-dis.lo     i370-dis.lo     i370-opc.lo     i860-dis.lo     i960-dis.lo     ia64-dis.lo     ia64-opc.lo     ip2k-asm.lo     ip2k-desc.lo    ip2k-dis.lo     ip2k-ibld.lo    ip2k-opc.lo     iq2000-asm.lo   iq2000-desc.lo  iq2000-dis.lo   iq2000-ibld.lo  iq2000-opc.lo   m32r-asm.lo     m32r-desc.lo    m32r-dis.lo     m32r-ibld.lo    m32r-opc.lo     m32r-opinst.lo  m68hc11-dis.lo  m68hc11-opc.lo  m68k-dis.lo     m68k-opc.lo     m88k-dis.lo     m10200-dis.lo   m10200-opc.lo   m10300-dis.lo   m10300-opc.lo   mcore-dis.lo    mips-dis.lo     mips-opc.lo     mips16-opc.lo   mmix-dis.lo     mmix-opc.lo     msp430-dis.lo   ns32k-dis.lo    openrisc-asm.lo         openrisc-desc.lo        openrisc-dis.lo         openrisc-ibld.lo        openrisc-opc.lo         or32-dis.lo     or32-opc.lo     pdp11-dis.lo    pdp11-opc.lo    pj-dis.lo       pj-opc.lo       ppc-dis.lo      ppc-opc.lo      s390-dis.lo     s390-opc.lo     sh-dis.lo       sh64-dis.lo     sh64-opc.lo     sparc-dis.lo    sparc-opc.lo    tic30-dis.lo    tic4x-dis.lo    tic54x-dis.lo   tic54x-opc.lo   tic80-dis.lo    tic80-opc.lo    v850-dis.lo     v850-opc.lo     vax-dis.lo      w65-dis.lo      xstormy16-asm.lo        xstormy16-desc.lo       xstormy16-dis.lo        xstormy16-ibld.lo       xstormy16-opc.lo        xtensa-dis.lo   z8k-dis.lo
+
 
 OFILES = @BFD_MACHINES@
 
-# We should reconfigure whenever bfd/configure.in changes, because
-# that's where the version number in Makefile comes from.
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
 INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl
+
 libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
 # It's desirable to list ../bfd/libbfd.la in DEPENDENCIES and LIBADD.
 # Unfortunately this causes libtool to add -L$(libdir), referring to the
@@ -521,125 +171,155 @@ libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
 # the build directory so that we don't have to convert all the
 # programs that use libopcodes.a simultaneously.  This is a hack which
 # should be removed if everything else starts using libtool.  FIXME.
+
 noinst_LIBRARIES = libopcodes.a
+
 POTFILES = $(HFILES) $(CFILES)
-CLEANFILES = \
-       stamp-ip2k stamp-m32r stamp-fr30 stamp-frv stamp-openrisc \
-       stamp-iq2000 stamp-xstormy16 \
-       libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2
+
+CLEANFILES =   stamp-ip2k stamp-m32r stamp-fr30 stamp-frv stamp-openrisc       stamp-iq2000 stamp-xstormy16    libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2
+
 
 CGENDIR = @cgendir@
 CPUDIR = $(CGENDIR)/cpu
 CGEN = `if test -f ../guile/libguile/guile ; then echo ../guile/libguile/guile; else echo guile ; fi`
 CGENFLAGS = -v
-CGENDEPS = \
-       $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm \
-       $(CGENDIR)/opcodes.scm $(CGENDIR)/opc-asmdis.scm \
-       $(CGENDIR)/opc-ibld.scm $(CGENDIR)/opc-itab.scm \
-       $(CGENDIR)/opc-opinst.scm \
-       cgen-asm.in cgen-dis.in cgen-ibld.in
+
+CGENDEPS =     $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm     $(CGENDIR)/opcodes.scm $(CGENDIR)/opc-asmdis.scm        $(CGENDIR)/opc-ibld.scm $(CGENDIR)/opc-itab.scm         $(CGENDIR)/opc-opinst.scm       cgen-asm.in cgen-dis.in cgen-ibld.in
+
 
 CGEN_CPUS = fr30 frv ip2k m32r openrisc xstormy16
-@CGEN_MAINT_FALSE@IP2K_DEPS = 
 @CGEN_MAINT_TRUE@IP2K_DEPS = stamp-ip2k
-@CGEN_MAINT_FALSE@M32R_DEPS = 
+@CGEN_MAINT_FALSE@IP2K_DEPS = 
 @CGEN_MAINT_TRUE@M32R_DEPS = stamp-m32r
-@CGEN_MAINT_FALSE@FR30_DEPS = 
+@CGEN_MAINT_FALSE@M32R_DEPS = 
 @CGEN_MAINT_TRUE@FR30_DEPS = stamp-fr30
-@CGEN_MAINT_FALSE@FRV_DEPS = 
+@CGEN_MAINT_FALSE@FR30_DEPS = 
 @CGEN_MAINT_TRUE@FRV_DEPS = stamp-frv
-@CGEN_MAINT_FALSE@OPENRISC_DEPS = 
+@CGEN_MAINT_FALSE@FRV_DEPS = 
 @CGEN_MAINT_TRUE@OPENRISC_DEPS = stamp-openrisc
-@CGEN_MAINT_FALSE@IQ2000_DEPS = 
+@CGEN_MAINT_FALSE@OPENRISC_DEPS = 
 @CGEN_MAINT_TRUE@IQ2000_DEPS = stamp-iq2000
-@CGEN_MAINT_FALSE@XSTORMY16_DEPS = 
+@CGEN_MAINT_FALSE@IQ2000_DEPS = 
 @CGEN_MAINT_TRUE@XSTORMY16_DEPS = stamp-xstormy16
-all: config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+@CGEN_MAINT_FALSE@XSTORMY16_DEPS = 
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = 
+LIBRARIES =  $(noinst_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libopcodes_a_LIBADD = 
+libopcodes_a_SOURCES = libopcodes.a.c
+libopcodes_a_OBJECTS =  libopcodes.a.$(OBJEXT)
+LTLIBRARIES =  $(bfdlib_LTLIBRARIES)
+
+libopcodes_la_OBJECTS =  dis-buf.lo disassemble.lo dis-init.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON =  ./stamp-h.in ChangeLog Makefile.am Makefile.in \
+acinclude.m4 aclocal.m4 config.in configure configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
+OBJECTS = libopcodes.a.$(OBJEXT) $(libopcodes_la_OBJECTS)
 
+all: all-redirect
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-am--refresh:
-       @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
-             cd $(srcdir) && $(AUTOMAKE) --cygnus  \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus  Makefile'; \
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --cygnus  Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       @case '$?' in \
-         *config.status*) \
-           echo ' $(SHELL) ./config.status'; \
-           $(SHELL) ./config.status;; \
-         *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
-       esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       $(SHELL) ./config.status --recheck
+.SUFFIXES: .S .c .lo .o .obj .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
 
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+       cd $(srcdir) && $(ACLOCAL)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
        cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
-config.h: stamp-h1
+config.h: stamp-h
        @if test ! -f $@; then \
-         rm -f stamp-h1; \
-         $(MAKE) stamp-h1; \
+               rm -f stamp-h; \
+               $(MAKE) stamp-h; \
        else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
-       @rm -f stamp-h1
-       cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+            $(SHELL) ./config.status
+       @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+       @if test ! -f $@; then \
+               rm -f $(srcdir)/stamp-h.in; \
+               $(MAKE) $(srcdir)/stamp-h.in; \
+       else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
        cd $(top_srcdir) && $(AUTOHEADER)
-       rm -f stamp-h1
-       touch $@
+       @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
 
 distclean-hdr:
-       -rm -f config.h stamp-h1
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
-       cd $(top_builddir) && $(SHELL) ./config.status $@
+       -rm -f config.h
+
+maintainer-clean-hdr:
+
+mostlyclean-noinstLIBRARIES:
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 
-clean-bfdlibLTLIBRARIES:
-       -test -z "$(bfdlib_LTLIBRARIES)" || rm -f $(bfdlib_LTLIBRARIES)
-       @list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
-libopcodes.la: $(libopcodes_la_OBJECTS) $(libopcodes_la_DEPENDENCIES) 
-       $(LINK) -rpath $(bfdlibdir) $(libopcodes_la_LDFLAGS) $(libopcodes_la_OBJECTS) $(libopcodes_la_LIBADD) $(LIBS)
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+.c.o:
+       $(COMPILE) -c $<
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+       $(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+       $(COMPILE) -c $<
+
+.S.o:
+       $(COMPILE) -c $<
 
 mostlyclean-compile:
+       -rm -f *.o core *.core
        -rm -f *.$(OBJEXT)
 
+clean-compile:
+
 distclean-compile:
        -rm -f *.tab.c
 
-.c.o:
-       $(COMPILE) -c $<
-
-.c.obj:
-       $(COMPILE) -c `$(CYGPATH_W) '$<'`
+maintainer-clean-compile:
 
 .c.lo:
-       $(LTCOMPILE) -c -o $@ $<
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -648,8 +328,20 @@ clean-libtool:
        -rm -rf .libs _libs
 
 distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+
+maintainer-clean-libtool:
+
+mostlyclean-bfdlibLTLIBRARIES:
+
+clean-bfdlibLTLIBRARIES:
+       -test -z "$(bfdlib_LTLIBRARIES)" || rm -f $(bfdlib_LTLIBRARIES)
+
+distclean-bfdlibLTLIBRARIES:
+
+maintainer-clean-bfdlibLTLIBRARIES:
+
+libopcodes.la: $(libopcodes_la_OBJECTS) $(libopcodes_la_DEPENDENCIES)
+       $(LINK) -rpath $(bfdlibdir) $(libopcodes_la_LDFLAGS) $(libopcodes_la_OBJECTS) $(libopcodes_la_LIBADD) $(LIBS)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -657,8 +349,13 @@ uninstall-info-am:
 # (1) if the variable is set in `config.status', edit `config.status'
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -678,18 +375,13 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
+       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+         rev="$$subdir $$rev"; \
+         test "$$subdir" != "." || dot_seen=yes; \
        done; \
-       rev="$$rev ."; \
+       test "$$dot_seen" = "no" && rev=". $$rev"; \
        target=`echo $@ | sed s/-recursive//`; \
        for subdir in $$rev; do \
          echo "Making $$target in $$subdir"; \
@@ -705,173 +397,196 @@ tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
        done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       mkid -fID $$unique
 tags: TAGS
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       here=`pwd` && cd $(srcdir) \
+         && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
        tags=; \
        here=`pwd`; \
-       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-         include_option=--etags-include; \
-         empty_fix=.; \
-       else \
-         include_option=--include; \
-         empty_fix=; \
-       fi; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test ! -f $$subdir/TAGS || \
-             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
-         fi; \
+   if test "$$subdir" = .; then :; else \
+           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+   fi; \
        done; \
-       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
-              END { for (i in files) print i; }'`; \
-       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-           $$tags $$unique; \
-       fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       here=`pwd`; \
-       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '    { files[$$0] = 1; } \
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
-       test -z "$(CTAGS_ARGS)$$tags$$unique" \
-         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-            $$tags $$unique
+       test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+         || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.in $$unique $(LISP))
+
+mostlyclean-tags:
 
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && cd $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) $$here
+clean-tags:
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       -rm -rf $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+       mkdir $(distdir)/=build
+       mkdir $(distdir)/=inst
+       dc_install_base=`cd $(distdir)/=inst && pwd`; \
+       cd $(distdir)/=build \
+         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) dist
+       -rm -rf $(distdir)
+       @banner="$(distdir).tar.gz is ready for distribution"; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"
+dist: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+dist-all: distdir
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+distdir: $(DISTFILES)
+       -rm -rf $(distdir)
+       mkdir $(distdir)
+       -chmod 777 $(distdir)
+       @for file in $(DISTFILES); do \
+         if test -f $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           cp -pr $$d/$$file $(distdir)/$$file; \
+         else \
+           test -f $(distdir)/$$file \
+           || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+           || cp -p $$d/$$file $(distdir)/$$file || :; \
+         fi; \
+       done
+       for subdir in $(SUBDIRS); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           chmod 777 $(distdir)/$$subdir; \
+           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+             || exit 1; \
+         fi; \
+       done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
 check-am:
 check: check-recursive
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
-installdirs: installdirs-recursive
-installdirs-am:
-       for dir in "$(DESTDIR)$(bfdlibdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
-       done
-install: install-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-info-am: 
+install-info: install-info-recursive
+all-recursive-am: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
 install-exec: install-exec-recursive
+
+install-data-am: install-bfdlibLTLIBRARIES
 install-data: install-data-recursive
-uninstall: uninstall-recursive
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
+install: install-recursive
+uninstall-am: uninstall-bfdlibLTLIBRARIES
+uninstall: uninstall-recursive
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
+all-redirect: all-recursive-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+       $(mkinstalldirs)  $(DESTDIR)$(bfdlibdir)
+
+
 mostlyclean-generic:
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
 
 maintainer-clean-generic:
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-bfdlibLTLIBRARIES clean-generic clean-libtool \
-       clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-hdr distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-bfdlibLTLIBRARIES
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf $(top_srcdir)/autom4te.cache
-       -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
+mostlyclean-am:  mostlyclean-hdr mostlyclean-noinstLIBRARIES \
+               mostlyclean-compile mostlyclean-libtool \
+               mostlyclean-bfdlibLTLIBRARIES mostlyclean-tags \
+               mostlyclean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool
-
-pdf: pdf-recursive
+clean-am:  clean-hdr clean-noinstLIBRARIES clean-compile clean-libtool \
+               clean-bfdlibLTLIBRARIES clean-tags clean-generic \
+               mostlyclean-am
 
-pdf-am:
-
-ps: ps-recursive
+clean: clean-recursive
 
-ps-am:
+distclean-am:  distclean-hdr distclean-noinstLIBRARIES distclean-compile \
+               distclean-libtool distclean-bfdlibLTLIBRARIES \
+               distclean-tags distclean-generic clean-am
+       -rm -f libtool
 
-uninstall-am: uninstall-bfdlibLTLIBRARIES
+distclean: distclean-recursive
+       -rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-hdr \
+               maintainer-clean-noinstLIBRARIES \
+               maintainer-clean-compile maintainer-clean-libtool \
+               maintainer-clean-bfdlibLTLIBRARIES \
+               maintainer-clean-tags maintainer-clean-generic \
+               distclean-am
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
 
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
-       check-am clean clean-bfdlibLTLIBRARIES clean-generic \
-       clean-libtool clean-noinstLIBRARIES clean-recursive ctags \
-       ctags-recursive distclean distclean-compile distclean-generic \
-       distclean-hdr distclean-libtool distclean-recursive \
-       distclean-tags dvi dvi-am html html-am info info-am install \
-       install-am install-bfdlibLTLIBRARIES install-data \
-       install-data-am install-exec install-exec-am install-info \
-       install-info-am install-man install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic maintainer-clean-recursive \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
-       tags tags-recursive uninstall uninstall-am \
-       uninstall-bfdlibLTLIBRARIES uninstall-info-am
+maintainer-clean: maintainer-clean-recursive
+       -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-bfdlibLTLIBRARIES \
+distclean-bfdlibLTLIBRARIES clean-bfdlibLTLIBRARIES \
+maintainer-clean-bfdlibLTLIBRARIES uninstall-bfdlibLTLIBRARIES \
+install-bfdlibLTLIBRARIES install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-info-am \
+install-info all-recursive-am install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
@@ -891,6 +606,11 @@ po/POTFILES.in: @MAINT@ Makefile
        for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
          && mv tmp $(srcdir)/po/POTFILES.in
 
+# We should reconfigure whenever bfd/configure.in changes, because
+# that's where the version number comes from.
+config.status: $(srcdir)/configure $(srcdir)/../bfd/configure.in
+       $(SHELL) ./config.status --recheck
+
 install-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@install_libopcodes
        @$(NORMAL_INSTALL)
 
@@ -994,6 +714,8 @@ s390-opc.tab: s390-mkopc s390-opc.txt
 sh-dis.lo: sh-dis.c
        $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $<
 
+Makefile: $(BFDDIR)/configure.in
+
 # This dependency stuff is copied from BFD.
 
 DEP: dep.sed $(CFILES) $(HFILES) config.h
@@ -1079,11 +801,9 @@ cris-dis.lo: cris-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
   $(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)/dis-asm.h $(BFD_H) \
-  $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
-  $(INCDIR)/opcode/crx.h
-crx-opc.lo: crx-opc.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
-  $(INCDIR)/symcat.h $(INCDIR)/opcode/crx.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
@@ -1318,7 +1038,7 @@ s390-dis.lo: s390-dis.c $(INCDIR)/ansidecl.h sysdep.h \
   config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \
   $(INCDIR)/opcode/s390.h
 sh-dis.lo: sh-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
-  sh-opc.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/dis-asm.h
+  sh-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
 sh64-dis.lo: sh64-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
   $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
   sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \
@@ -1375,13 +1095,14 @@ xstormy16-opc.lo: xstormy16-opc.c sysdep.h config.h \
   $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h xstormy16-desc.h \
   $(INCDIR)/opcode/cgen.h xstormy16-opc.h $(INCDIR)/libiberty.h
 xtensa-dis.lo: xtensa-dis.c $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h sysdep.h \
-  config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
+  $(INCDIR)/ansidecl.h sysdep.h config.h $(INCDIR)/dis-asm.h \
+  $(BFD_H) $(INCDIR)/symcat.h
 z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h z8k-opc.h
 z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/libiberty.h
 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 49e8d5bac91443882ac98502f92aafde0df9b3fb..d5ae23377310b797d9f70665e2685a9e9fea795a 100644 (file)
-# generated automatically by aclocal 1.9.1 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
-# This file 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-#                                                        -*- Autoconf -*-
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-
-# 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
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.9.1])])
-
-# AM_AUX_DIR_EXPAND
-
-# Copyright (C) 2001, 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, 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../bfd/acinclude.m4)
+
+dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_DEFUN([AM_DISABLE_SHARED],)
+AC_SUBST(LIBTOOL)
 ])
 
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 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, 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.
-
-# serial 6
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# serial 7                                             -*- Autoconf -*-
-
-# Copyright (C) 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
-# 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.
-
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
+dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
+ifelse(yes,no,[
+AC_DEFUN([CY_WITH_NLS],)
+AC_SUBST(INTLLIBS)
+])
 
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+dnl AM_INSTALL_LIBBFD already included in bfd/acinclude.m4
+ifelse(yes,no,[
+AC_DEFUN([AM_INSTALL_LIBBFD],)
+AC_SUBST(bfdlibdir)
+AC_SUBST(bfdincludedir)
+])
 
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
       else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
       fi
     fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
 ])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/lib"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/lib"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
 ])
 
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
 ])
 
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 ])
 
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
-
-# Copyright (C) 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
-# 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.
-
-#serial 2
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  undefine([Name])
+  undefine([NAME])
+])
 
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIB[]NAME"
+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
   else
-    continue
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
   fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  undefine([Name])
+  undefine([NAME])
 ])
 
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 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, 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.
-
-# serial 7
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                            -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# Copyright (C) 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
-# 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.
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE(rpath,
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
 
-# 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.
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib$1-prefix],
+[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */lib | */lib/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux*) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/lib"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux*) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+])
 
-# serial 11
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
 
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names.  We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
   else
-    CYGPATH_W=echo
+    PATH_SEPARATOR=:
   fi
+  rm -f conf$$.sh
 fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-                            [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $1 | $1:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-
-# Copyright (C) 2001, 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, 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.
-
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-#                                                          -*- Autoconf -*-
-# Copyright (C) 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, 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.
-
-# serial 1
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot.  For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
 else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 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
-# 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.
-
-# serial 3
-
-AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-  dnl maintainer-mode is disabled by default
-  AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer],
-      USE_MAINTAINER_MODE=$enableval,
-      USE_MAINTAINER_MODE=no)
-  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
-  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
-  MAINT=$MAINTAINER_MODE_TRUE
-  AC_SUBST(MAINT)dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes.     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 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, 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.
-
-# serial 2
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+  AC_MSG_CHECKING([for non-GNU ld])
 fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-#  -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 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, 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.
-
-# serial 3
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
 else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_RESULT(no)
 fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
 ])
 
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+  [
+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+  ]
+)
 
-# 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.
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
 
-# 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.
+# serial 1
 
-# 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.
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# 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
@@ -844,77 +932,42 @@ AC_SUBST([mkdir_p])])
 # 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.
-
-# serial 2
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
 
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+        [AM_AUTOMAKE_VERSION([1.4-p6])])
 
 #
 # Check to make sure that the build environment is sane.
 #
 
-# Copyright (C) 1996, 1997, 2000, 2001, 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, 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.
-
-# serial 3
-
-# AM_SANITY_CHECK
-# ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
 # Just in case
 sleep 1
-echo timestamp > conftest.file
+echo timestamp > conftestfile
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t $srcdir/configure conftestfile`
    fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -924,7 +977,7 @@ if (
 alias in your environment])
    fi
 
-   test "$[2]" = conftest.file
+   test "[$]2" = conftestfile
    )
 then
    # Ok.
@@ -933,153 +986,78 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
+rm -f conftest*
 AC_MSG_RESULT(yes)])
 
-# AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 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, 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.
-
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# 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.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball.                            -*- Autoconf -*-
-
-# 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, or (at your option)
-# any later version.
+AC_SUBST($1)])
 
-# 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.
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated.  We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+  case " <<$>>CONFIG_HEADERS " in
+  *" <<$>>am_file "*<<)>>
+    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+    ;;
+  esac
+  am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
 
-# 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.
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
 
 # serial 1
 
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
 
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-#     tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-#     $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
-
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
-
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
-  rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
+# Define a conditional.
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
 
-m4_include([acinclude.m4])
index 44cdeac344925a4d369426498b2b1ffe4306244d..e918dafa28bba2afe9835ec06138fccad61114cb 100644 (file)
@@ -1,5 +1,5 @@
 /* Instruction printing code for the ARM
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
    Modification by James G. Smith (jsmith@cygnus.co.uk)
@@ -900,15 +900,6 @@ print_insn_arm (pc, info, given)
                        }
                        break;
 
-                     case 'e':
-                       {
-                         int imm;
-
-                         imm = (given & 0xf) | ((given & 0xfff00) >> 4);
-                         func (stream, "%d", imm);
-                       }
-                       break;
-
                      default:
                        abort ();
                      }
index 531f4587ae9219b7debe7a763153df2f31995cd0..4b52f13171973ef91aa73cde044bd160abab6022 100644 (file)
@@ -1,6 +1,6 @@
 /* Opcode table for the ARM.
 
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003
    Free Software Foundation, Inc.
    
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
-struct arm_opcode
-{
-  unsigned long value, mask;   /* Recognise instruction if (op&mask)==value.  */
-  char *assembler;             /* How to disassemble this instruction.  */
+struct arm_opcode {
+    unsigned long value, mask; /* recognise instruction if (op&mask)==value */
+    char *assembler;           /* how to disassemble this instruction */
 };
 
 struct thumb_opcode
 {
-  unsigned short value, mask;  /* Recognise instruction if (op&mask)==value.  */
-  char * assembler;            /* How to disassemble this instruction.  */
+    unsigned short value, mask;        /* recognise instruction if (op&mask)==value */
+    char * assembler;          /* how to disassemble this instruction */
 };
 
-/* Format of the assembler string :
+/* format of the assembler string :
    
    %%                  %
    %<bitfield>d                print the bitfield in decimal
@@ -83,10 +82,10 @@ Thumb specific format options:
    %<bitfield>W         print (bitfield * 4) as a decimal
    %<bitfield>H         print (bitfield * 2) as a decimal
    %<bitfield>a         print (bitfield * 4) as a pc-rel offset + decoded symbol
-   %e                   print arm SMI operand (bits 0..7,8..19).  */
+*/
 
 /* Note: There is a partial ordering in this table - it must be searched from
-   the top to obtain a correct match.  */
+   the top to obtain a correct match. */
 
 static const struct arm_opcode arm_opcodes[] =
 {
@@ -99,26 +98,7 @@ static const struct arm_opcode arm_opcodes[] =
     {0x00800090, 0x0fa000f0, "%22?sumull%c%20's\t%12-15r, %16-19r, %0-3r, %8-11r"},
     {0x00a00090, 0x0fa000f0, "%22?sumlal%c%20's\t%12-15r, %16-19r, %0-3r, %8-11r"},
 
-    /* ARM V6Z instructions.  */
-    {0x01600070, 0x0ff000f0, "smi%c\t%e"},
-    
-    /* ARM V6K instructions.  */
-    {0xf57ff01f, 0xffffffff, "clrex"},
-    {0x01d00f9f, 0x0ff00fff, "ldrexb%c\t%12-15r, [%16-19r]"},
-    {0x01b00f9f, 0x0ff00fff, "ldrexd%c\t%12-15r, [%16-19r]"},
-    {0x01f00f9f, 0x0ff00fff, "ldrexh%c\t%12-15r, [%16-19r]"},
-    {0x01c00f90, 0x0ff00ff0, "strexb%c\t%12-15r, %0-3r, [%16-19r]"},
-    {0x01a00f90, 0x0ff00ff0, "strexd%c\t%12-15r, %0-3r, [%16-19r]"},
-    {0x01e00f90, 0x0ff00ff0, "strexh%c\t%12-15r, %0-3r, [%16-19r]"},
-
-    /* ARM V6K NOP hints.  */
-    {0x0320f001, 0x0fffffff, "yield"},
-    {0x0320f002, 0x0fffffff, "wfe"},
-    {0x0320f003, 0x0fffffff, "wfi"},
-    {0x0320f004, 0x0fffffff, "sev"},
-    {0x0320f000, 0x0fffff00, "nop%c\t{%0-7d}"},
-
-    /* ARM V6 instructions.  */
+    /* ARM V6 instructions. */
     {0xfc500000, 0xfff00000, "mrrc2\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
     {0xfc400000, 0xfff00000, "mcrr2\t%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"},
     {0xf1080000, 0xfffdfe3f, "cpsie\t%8'a%7'i%6'f"},
index c803c94860d69f76150bf4befbd77c05167cbcec..26eaf59b25a76545e94b35e3b0da6327e59b7720 100755 (executable)
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l CC_FOR_BUILD EXEEXT_FOR_BUILD HDEFINES CGEN_MAINT_TRUE CGEN_MAINT_FALSE cgendir WIN32LDFLAGS WIN32LIBADD archdefs BFD_MACHINES LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S STRIP ac_ct_STRIP LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l CC_FOR_BUILD EXEEXT_FOR_BUILD HDEFINES CGEN_MAINT_TRUE CGEN_MAINT_FALSE cgendir WIN32LDFLAGS WIN32LIBADD archdefs BFD_MACHINES LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -850,8 +850,6 @@ if test -n "$ac_init_help"; then
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
   --enable-shared=PKGS  build shared libraries default=no
   --enable-static=PKGS  build static libraries default=yes
   --enable-fast-install=PKGS  optimize for fast installation default=yes
@@ -859,8 +857,8 @@ Optional Features:
   --enable-targets        alternative target configurations
   --enable-commonbfdlib   build shared BFD/opcodes/libiberty library
   --enable-build-warnings Enable build-time compiler warnings if gcc is used
-  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer
   --enable-install-libbfd controls installation of libbfd and related headers
   --disable-nls           do not use Native Language Support
   --enable-cgen-maint=dir    build cgen generated files
@@ -972,7 +970,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -1996,8 +1994,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2055,8 +2052,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2172,8 +2168,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2227,8 +2222,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2273,8 +2267,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2318,8 +2311,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -2359,13 +2351,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for library containing strerror" >&5
-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
-if test "${ac_cv_search_strerror+set}" = set; then
+
+        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_strerror=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -2397,63 +2390,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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_exeext'
-  { (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
-  ac_cv_search_strerror="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_strerror" = no; then
-  for ac_lib in cposix; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strerror ();
-int
-main ()
-{
-strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 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'
+        { 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=$?
@@ -2465,25 +2402,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_strerror="-l$ac_lib"
-break
+  ac_cv_lib_cposix_strerror=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_cposix_strerror=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
+LIBS=$ac_check_lib_save_LIBS
 fi
-LIBS=$ac_func_search_save_LIBS
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
+  LIBS="$LIBS -lcposix"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
-echo "${ECHO_T}$ac_cv_search_strerror" >&6
-if test "$ac_cv_search_strerror" != no; then
-  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
 
-fi
+
 
 
 # We currently only use the version number for the name of any shared
@@ -2491,7 +2427,7 @@ fi
 # number that BFD is using.
 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[        ]*\([^  ]*\)[   ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
 
-am__api_version="1.9"
+am__api_version="1.4"
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -2575,21 +2511,20 @@ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
 # Just in case
 sleep 1
-echo timestamp > conftest.file
+echo timestamp > conftestfile
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t $srcdir/configure conftestfile`
    fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -2602,7 +2537,7 @@ alias in your environment" >&2;}
    { (exit 1); exit 1; }; }
    fi
 
-   test "$2" = conftest.file
+   test "$2" = conftestfile
    )
 then
    # Ok.
@@ -2614,6 +2549,7 @@ echo "$as_me: error: newly created file is older than distributed files!
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
+rm -f conftest*
 echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 test "$program_prefix" != NONE &&
@@ -2629,92 +2565,6 @@ _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-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 "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$AWK" && break
-done
-
 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
@@ -2744,103 +2594,17 @@ echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-          ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-       @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
 
+PACKAGE=opcodes
 
+VERSION=${BFD_VERSION}
 
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=opcodes
- VERSION=${BFD_VERSION}
-
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
 _ACEOF
@@ -2850,234 +2614,86 @@ cat >>confdefs.h <<_ACEOF
 #define VERSION "$VERSION"
 _ACEOF
 
-# Some tools Automake needs.
 
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # 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 "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+missing_dir=`cd $ac_aux_dir && pwd`
+echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
+echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
+# 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.
+if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal-${am__api_version}
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+   ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+echo "$as_me:$LINENO: checking for working autoconf" >&5
+echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
+# 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.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
-  STRIP=$ac_ct_STRIP
+echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
+echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
+# 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.
+if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake-${am__api_version}
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  STRIP="$ac_cv_prog_STRIP"
+   AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-depcc="$CC"   am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working autoheader" >&5
+echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
+# 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.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
 
-if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
+echo "$as_me:$LINENO: checking for working makeinfo" >&5
+echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
+# 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.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$as_me:$LINENO: result: missing" >&5
+echo "${ECHO_T}missing" >&6
 fi
 
 
 
-
 if test -n "$ac_tool_prefix"; then
   # 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
@@ -3978,7 +3594,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3981 "configure"' > conftest.$ac_ext
+  echo '#line 3597 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4074,8 +3690,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -4263,8 +3878,11 @@ if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
 fi
 
 
+
           ac_config_headers="$ac_config_headers config.h:config.in"
 
+          ac_config_commands="$ac_config_commands default-1"
+
 
 if test -z "$target" ; then
     { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5
@@ -4292,7 +3910,6 @@ else
   MAINTAINER_MODE_TRUE='#'
   MAINTAINER_MODE_FALSE=
 fi
-
   MAINT=$MAINTAINER_MODE_TRUE
 
 
@@ -4335,7 +3952,6 @@ else
   INSTALL_LIBBFD_TRUE='#'
   INSTALL_LIBBFD_FALSE=
 fi
-
   # Need _noncanonical variables for this.
 
 
@@ -4723,8 +4339,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -4782,8 +4397,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -4899,8 +4513,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -4954,8 +4567,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5000,8 +4612,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5045,8 +4656,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5450,8 +5060,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5658,8 +5267,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5719,8 +5327,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5799,8 +5406,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5865,8 +5471,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5931,8 +5536,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -5996,8 +5600,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -6078,8 +5681,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -6220,8 +5822,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -6359,8 +5960,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -6544,8 +6144,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -6796,8 +6395,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -6991,8 +6589,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7095,8 +6692,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7167,8 +6763,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7270,8 +6865,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -7407,8 +7001,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7472,8 +7065,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7528,8 +7120,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7669,8 +7260,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -7803,8 +7393,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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'
+        { 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=$?
@@ -8072,8 +7661,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -8383,8 +7971,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   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'
+        { 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=$?
@@ -8528,7 +8115,6 @@ else
 fi
 
 
-
 using_cgen=no
 
 # Horrible hacks to build DLLs on Windows.
@@ -8802,41 +8388,6 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${INSTALL_LIBBFD_TRUE}" && test -z "${INSTALL_LIBBFD_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBBFD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_LIBBFD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${CGEN_MAINT_TRUE}" && test -z "${CGEN_MAINT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"CGEN_MAINT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"CGEN_MAINT\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -9270,7 +8821,7 @@ cat >>$CONFIG_STATUS <<_ACEOF
 # INIT-COMMANDS section.
 #
 
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
 
 
 _ACEOF
@@ -9284,7 +8835,7 @@ do
   # Handling of arguments.
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
@@ -9394,7 +8945,6 @@ s,@OBJEXT@,$OBJEXT,;t t
 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
 s,@PACKAGE@,$PACKAGE,;t t
 s,@VERSION@,$VERSION,;t t
 s,@ACLOCAL@,$ACLOCAL,;t t
@@ -9402,31 +8952,14 @@ s,@AUTOCONF@,$AUTOCONF,;t t
 s,@AUTOMAKE@,$AUTOMAKE,;t t
 s,@AUTOHEADER@,$AUTOHEADER,;t t
 s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
 s,@AR@,$AR,;t t
 s,@ac_ct_AR@,$ac_ct_AR,;t t
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 s,@LN_S@,$LN_S,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
 s,@LIBTOOL@,$LIBTOOL,;t t
 s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
 s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
@@ -9639,11 +9172,6 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -9682,6 +9210,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
         fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
@@ -9932,28 +9466,6 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
     cat $tmp/config.h
     rm -f $tmp/config.h
   fi
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $ac_file | $ac_file:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X$ac_file : 'X\(//\)[^/]' \| \
-        X$ac_file : 'X\(//\)$' \| \
-        X$ac_file : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`/stamp-h$_am_stamp_count
 done
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -10070,91 +9582,7 @@ esac
   { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
 echo "$as_me: executing $ac_dest commands" >&6;}
   case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
- ;;
+    default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
     default ) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
   esac
 done
index b2cf31210f62ef506ab512d447d423490fdff142..5796a2ef08adaa7999cec2c2982365f58af63b6b 100644 (file)
@@ -59,25 +59,10 @@ 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}, {"[b]", 8}, 
-  {"[b,i]", 10}, {"[b,i,u]", 11}, {"[b,d]", 12}, 
-  {"[b,d,u]", 13}, {"[b,d,i]", 14}, {"[b,d,i,u]", 15}
+  {"[i]", 2}, {"[i,u]", 3}, {"[d]", 4},
+  {"[d,u]", 5}, {"[d,i]", 6}, {"[d,i,u]", 7}
 };
 
-/* Enum to distinguish CO-Processor [special] registers arguments 
-   from general purpose regidters.  */
-typedef enum COP_ARG_TYPE
-  {
-    /* Not a CO-Processor argument (probably a general purpose reg.).  */
-    NO_COP_ARG = 0,
-    /* A CO-Processor argument (c<N>).  */
-    COP_ARG,
-    /* A CO-Processor special argument (cs<N>).  */
-    COPS_ARG 
-  }
-COP_ARG_TYPE;
-
 /* Number of valid 'cinv' instruction options.  */
 int NUMCINVS = ((sizeof crx_cinvs)/(sizeof crx_cinvs[0]));
 /* Current opcode table entry we're disassembling.  */
@@ -104,7 +89,7 @@ static char *getcopregname    (copreg, reg_type);
 static char * getprocregname  (int);
 static char *gettrapstring    (unsigned);
 static char *getcinvstring    (unsigned);
-static void getregliststring  (int, char *, enum COP_ARG_TYPE);
+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);
@@ -240,7 +225,7 @@ powerof2 (int x)
 /* Transform a register bit mask to a register list.  */
 
 void
-getregliststring (int trap, char *string, enum COP_ARG_TYPE core_cop)
+getregliststring (int trap, char *string, int core_cop)
 {
   char temp_string[5];
   int i;
@@ -251,21 +236,11 @@ getregliststring (int trap, char *string, enum COP_ARG_TYPE core_cop)
   for (i = 0; i < 16; i++)
     {
       if (trap & 0x1)
-       {
-         switch (core_cop)
-           {
-           case NO_COP_ARG:
-             sprintf (temp_string, "r%d", i);
-             break;
-           case COP_ARG:
-             sprintf (temp_string, "c%d", i);
-             break;
-           case COPS_ARG:
-             sprintf (temp_string, "cs%d", i);
-             break;
-           default:
-             break;
-           }
+        {
+          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, ",");
@@ -515,26 +490,22 @@ print_arg (argument *a, struct disassemble_info *info)
 
       else if (INST_HAS_REG_LIST)
         {
-         COP_ARG_TYPE cop_ins = IS_INSN_TYPE (COP_REG_INS) ? 
-                                COP_ARG : IS_INSN_TYPE (COPS_REG_INS) ? 
-                                COPS_ARG : NO_COP_ARG;
-
-          if (cop_ins != NO_COP_ARG)
-           {
-             /*  Check for proper argument number.  */
-             if (processing_argument_number == 2)
-               {
-                 getregliststring (a->constant, string, cop_ins);
-                 func (stream, "%s", string);
-               }
-             else
-               func (stream, "$0x%x", a->constant);
-           }
-         else
+          if (!IS_INSN_TYPE (COP_REG_INS))
             {
-              getregliststring (a->constant, string, cop_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);
index 846b78c6c2f51d6f10ad7e6401f85464c4205454..b01addfa52546312a58ef00db7d1c65fb2a22b6a 100644 (file)
@@ -488,55 +488,39 @@ const inst crx_instruction[] =
 
   BR_INST ("bal",   0x307, 0x317, 0),
 
-  /* Decrement and Branch instructions */
+  /* 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 */
+  /* Jump and link instructions */
   REG1_INST ("jal",    0xFF8),
   REG2_INST ("jal",    0x37),
   REG2_INST ("jalid",  0x33),
 
-/* Create a CO-processor instruction.  */
-#define  COP_INST(NAME, OPC, TYPE, REG1, REG2) \
-  /* opc12 c4 opc8 REG1 REG2 */                       \
-  {NAME,  2, 0x301030+OPC,  8, TYPE | FMT_2, {{i4,16}, {REG1,4}, {REG2,0}}}
-
-  COP_INST ("mtcr",   0, COP_REG_INS,  regr,     copregr),
-  COP_INST ("mfcr",   1, COP_REG_INS,  copregr,  regr),
-  COP_INST ("mtcsr",  2, COPS_REG_INS, regr,     copsregr),
-  COP_INST ("mfcsr",  3, COPS_REG_INS, copsregr, regr),
-  COP_INST ("ldcr",   4, COP_REG_INS,  regr,     copregr),
-  COP_INST ("stcr",   5, COP_REG_INS,  regr,     copregr),
-  COP_INST ("ldcsr",  6, COPS_REG_INS, regr,     copsregr),
-  COP_INST ("stcsr",  7, COPS_REG_INS, regr,     copsregr),
-
-/* Create a memory-related CO-processor instruction.  */
-#define  COPMEM_INST(NAME, OPC, TYPE) \
-  /* opc12 c4 opc12 r mask16 */              \
-  {NAME,  3, 0x3110300+OPC,  4, TYPE | REG_LIST | FMT_5, {{i4,16}, {regr,0}, {i16,0}}}
-
-  COPMEM_INST("loadmcr",  0,  COP_REG_INS),
-  COPMEM_INST("stormcr",  1,  COP_REG_INS),
-  COPMEM_INST("loadmcsr", 2,  COPS_REG_INS),
-  COPMEM_INST("stormcsr", 3,  COPS_REG_INS),
-
-  /* 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 c4 opc4 cpdo r r */
-  {"cpdop",   2, 0x3010B, 12, COP_REG_INS | FMT_4, {{i4,16}, {i4,8}, {regr,4}, {regr,0}}},
-  /* opc12 c4 opc4 cpdo r r cpdo16 */
-  {"cpdop",   3, 0x3110B, 12, COP_REG_INS | FMT_4, {{i4,16}, {i4,8}, {regr,4}, {regr,0}, {i16,0}}},
+  /* 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}, {copsregr,0}}},
+  /* opc12 c4 opc8 copsreg r */
+  {"mfcsr",   2, 0x301033,  8, COP_REG_INS | FMT_2, {{i4,16}, {copsregr,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}}},
 
-  /* Miscellaneous.  */
   /* opc12 i4 */
   {"excp",    1, 0xFFF,        20, 0, {{i4,16}}},
   /* opc28 i4 */
index 1756e53b7d93538fd0d02ef7bbe8365086a6bfb6..4f5bf84aead8ad8af5451ed78bd20dc9ac73d87d 100644 (file)
@@ -342,8 +342,7 @@ print_insn_pdp11 (memaddr, info)
          case PDP11_OPCODE_REG_DISPL:
            {
              int displ = (opcode & 0x3f) << 10;
-             bfd_vma address = memaddr - (displ >> 9);
-
+             bfd_vma address = memaddr + (sign_extend (displ) >> 9);
              FPRINTF (F, OP.name);
              FPRINTF (F, AFTER_INSTRUCTION);
              print_reg (src, info);
index e71ddced5ed1a435c916a2606fdf8c5e6a5d21db..333c612130b3e1290fd4d06306be4b8020e90afe 100644 (file)
@@ -12,8 +12,6 @@ cgen-dis.c
 cgen-opc.c
 cris-dis.c
 cris-opc.c
-crx-dis.c
-crx-opc.c
 d10v-dis.c
 d10v-opc.c
 d30v-dis.c
index f149ddb35dcb4093ec5795403ef4cd55215fb9fb..9ab879039dde9adb68dc93746ee49bced522d048 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-09-16 23:00+0930\n"
+"POT-Creation-Date: 2004-03-19 14:59+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"
@@ -94,14 +94,14 @@ msgstr ""
 msgid "Address 0x%x is out of bounds.\n"
 msgstr ""
 
-#: fr30-asm.c:323 frv-asm.c:967 ip2k-asm.c:574 iq2000-asm.c:460 m32r-asm.c:338
+#: fr30-asm.c:323 frv-asm.c:967 ip2k-asm.c:574 iq2000-asm.c:460 m32r-asm.c:335
 #: openrisc-asm.c:261 xstormy16-asm.c:284
 #, c-format
 msgid "Unrecognized field %d while parsing.\n"
 msgstr ""
 
 #: fr30-asm.c:372 frv-asm.c:1016 ip2k-asm.c:623 iq2000-asm.c:509
-#: m32r-asm.c:387 openrisc-asm.c:310 xstormy16-asm.c:333
+#: m32r-asm.c:384 openrisc-asm.c:310 xstormy16-asm.c:333
 msgid "missing mnemonic in syntax string"
 msgstr ""
 
@@ -109,43 +109,43 @@ msgstr ""
 #: fr30-asm.c:507 fr30-asm.c:511 fr30-asm.c:598 fr30-asm.c:699 frv-asm.c:1151
 #: frv-asm.c:1155 frv-asm.c:1242 frv-asm.c:1343 ip2k-asm.c:758 ip2k-asm.c:762
 #: ip2k-asm.c:849 ip2k-asm.c:950 iq2000-asm.c:644 iq2000-asm.c:648
-#: iq2000-asm.c:735 iq2000-asm.c:836 m32r-asm.c:522 m32r-asm.c:526
-#: m32r-asm.c:613 m32r-asm.c:714 openrisc-asm.c:445 openrisc-asm.c:449
+#: iq2000-asm.c:735 iq2000-asm.c:836 m32r-asm.c:519 m32r-asm.c:523
+#: m32r-asm.c:610 m32r-asm.c:711 openrisc-asm.c:445 openrisc-asm.c:449
 #: openrisc-asm.c:536 openrisc-asm.c:637 xstormy16-asm.c:468
 #: xstormy16-asm.c:472 xstormy16-asm.c:559 xstormy16-asm.c:660
 msgid "unrecognized instruction"
 msgstr ""
 
 #: fr30-asm.c:554 frv-asm.c:1198 ip2k-asm.c:805 iq2000-asm.c:691
-#: m32r-asm.c:569 openrisc-asm.c:492 xstormy16-asm.c:515
+#: m32r-asm.c:566 openrisc-asm.c:492 xstormy16-asm.c:515
 #, c-format
 msgid "syntax error (expected char `%c', found `%c')"
 msgstr ""
 
 #: fr30-asm.c:564 frv-asm.c:1208 ip2k-asm.c:815 iq2000-asm.c:701
-#: m32r-asm.c:579 openrisc-asm.c:502 xstormy16-asm.c:525
+#: m32r-asm.c:576 openrisc-asm.c:502 xstormy16-asm.c:525
 #, c-format
 msgid "syntax error (expected char `%c', found end of instruction)"
 msgstr ""
 
 #: fr30-asm.c:592 frv-asm.c:1236 ip2k-asm.c:843 iq2000-asm.c:729
-#: m32r-asm.c:607 openrisc-asm.c:530 xstormy16-asm.c:553
+#: m32r-asm.c:604 openrisc-asm.c:530 xstormy16-asm.c:553
 msgid "junk at end of line"
 msgstr ""
 
 #: fr30-asm.c:698 frv-asm.c:1342 ip2k-asm.c:949 iq2000-asm.c:835
-#: m32r-asm.c:713 openrisc-asm.c:636 xstormy16-asm.c:659
+#: m32r-asm.c:710 openrisc-asm.c:636 xstormy16-asm.c:659
 msgid "unrecognized form of instruction"
 msgstr ""
 
 #: fr30-asm.c:710 frv-asm.c:1354 ip2k-asm.c:961 iq2000-asm.c:847
-#: m32r-asm.c:725 openrisc-asm.c:648 xstormy16-asm.c:671
+#: m32r-asm.c:722 openrisc-asm.c:648 xstormy16-asm.c:671
 #, c-format
 msgid "bad instruction `%.50s...'"
 msgstr ""
 
 #: fr30-asm.c:713 frv-asm.c:1357 ip2k-asm.c:964 iq2000-asm.c:850
-#: m32r-asm.c:728 openrisc-asm.c:651 xstormy16-asm.c:674
+#: m32r-asm.c:725 openrisc-asm.c:651 xstormy16-asm.c:674
 #, c-format
 msgid "bad instruction `%.50s'"
 msgstr ""
@@ -219,7 +219,7 @@ msgstr ""
 msgid "Hmmmm 0x%x"
 msgstr ""
 
-#: h8300-dis.c:744
+#: h8300-dis.c:741
 #, c-format
 msgid "Don't understand 0x%x \n"
 msgstr ""
@@ -230,12 +230,12 @@ msgid "can't cope with insert %d\n"
 msgstr ""
 
 #. Couldn't understand anything.
-#: h8500-dis.c:342
+#: h8500-dis.c:350
 #, c-format
 msgid "%02x\t\t*unknown*"
 msgstr ""
 
-#: i386-dis.c:1720
+#: i386-dis.c:1712
 msgid "<internal disassembler error>"
 msgstr ""
 
@@ -275,72 +275,72 @@ msgstr ""
 msgid "overlapping field %s->%s\n"
 msgstr ""
 
-#: ia64-gen.c:1242
+#: ia64-gen.c:1236
 #, c-format
 msgid "overwriting note %d with note %d (IC:%s)\n"
 msgstr ""
 
-#: ia64-gen.c:1441
+#: ia64-gen.c:1435
 #, c-format
 msgid "don't know how to specify %% dependency %s\n"
 msgstr ""
 
-#: ia64-gen.c:1463
+#: ia64-gen.c:1457
 #, c-format
 msgid "Don't know how to specify # dependency %s\n"
 msgstr ""
 
-#: ia64-gen.c:1502
+#: ia64-gen.c:1496
 #, c-format
 msgid "IC:%s [%s] has no terminals or sub-classes\n"
 msgstr ""
 
-#: ia64-gen.c:1505
+#: ia64-gen.c:1499
 #, c-format
 msgid "IC:%s has no terminals or sub-classes\n"
 msgstr ""
 
-#: ia64-gen.c:1514
+#: ia64-gen.c:1508
 #, c-format
 msgid "no insns mapped directly to terminal IC %s [%s]"
 msgstr ""
 
-#: ia64-gen.c:1517
+#: ia64-gen.c:1511
 #, c-format
 msgid "no insns mapped directly to terminal IC %s\n"
 msgstr ""
 
-#: ia64-gen.c:1528
+#: ia64-gen.c:1522
 #, c-format
 msgid "class %s is defined but not used\n"
 msgstr ""
 
-#: ia64-gen.c:1539
+#: ia64-gen.c:1533
 #, c-format
 msgid "Warning: rsrc %s (%s) has no chks%s\n"
 msgstr ""
 
-#: ia64-gen.c:1543
+#: ia64-gen.c:1537
 #, c-format
 msgid "rsrc %s (%s) has no regs\n"
 msgstr ""
 
-#: ia64-gen.c:2442
+#: ia64-gen.c:2436
 #, c-format
 msgid "IC note %d in opcode %s (IC:%s) conflicts with resource %s note %d\n"
 msgstr ""
 
-#: ia64-gen.c:2470
+#: ia64-gen.c:2464
 #, c-format
 msgid "IC note %d for opcode %s (IC:%s) conflicts with resource %s note %d\n"
 msgstr ""
 
-#: ia64-gen.c:2484
+#: ia64-gen.c:2478
 #, c-format
 msgid "opcode %s has no class (ops %d %d %d)\n"
 msgstr ""
 
-#: ia64-gen.c:2795
+#: ia64-gen.c:2789
 #, c-format
 msgid "unable to change directory to \"%s\", errno = %s\n"
 msgstr ""
@@ -430,12 +430,12 @@ msgstr ""
 msgid "unknown\t0x%04x"
 msgstr ""
 
-#: m68k-dis.c:295
+#: m68k-dis.c:432
 #, c-format
 msgid "<internal error in opcode table: %s %s>\n"
 msgstr ""
 
-#: m68k-dis.c:1089
+#: m68k-dis.c:1025
 #, c-format
 msgid "<function code %d>"
 msgstr ""
@@ -573,87 +573,83 @@ msgstr ""
 msgid "$<undefined>"
 msgstr ""
 
-#: ppc-opc.c:794 ppc-opc.c:822
+#: ppc-opc.c:791 ppc-opc.c:819
 msgid "invalid conditional option"
 msgstr ""
 
-#: ppc-opc.c:824
+#: ppc-opc.c:821
 msgid "attempt to set y bit when using + or - modifier"
 msgstr ""
 
-#: ppc-opc.c:852
+#: ppc-opc.c:849
 msgid "offset not a multiple of 16"
 msgstr ""
 
-#: ppc-opc.c:871
+#: ppc-opc.c:868
 msgid "offset not a multiple of 2"
 msgstr ""
 
-#: ppc-opc.c:873
+#: ppc-opc.c:870
 msgid "offset greater than 62"
 msgstr ""
 
-#: ppc-opc.c:892 ppc-opc.c:937 ppc-opc.c:981
+#: ppc-opc.c:889 ppc-opc.c:934 ppc-opc.c:978
 msgid "offset not a multiple of 4"
 msgstr ""
 
-#: ppc-opc.c:894
+#: ppc-opc.c:891
 msgid "offset greater than 124"
 msgstr ""
 
-#: ppc-opc.c:913
+#: ppc-opc.c:910
 msgid "offset not a multiple of 8"
 msgstr ""
 
-#: ppc-opc.c:915
+#: ppc-opc.c:912
 msgid "offset greater than 248"
 msgstr ""
 
-#: ppc-opc.c:958
+#: ppc-opc.c:955
 msgid "offset not between -2048 and 2047"
 msgstr ""
 
-#: ppc-opc.c:979
+#: ppc-opc.c:976
 msgid "offset not between -8192 and 8191"
 msgstr ""
 
-#: ppc-opc.c:1007
-msgid "invalid mask field"
-msgstr ""
-
-#: ppc-opc.c:1033
+#: ppc-opc.c:1014
 msgid "ignoring invalid mfcr mask"
 msgstr ""
 
-#: ppc-opc.c:1075
+#: ppc-opc.c:1061
 msgid "ignoring least significant bits in branch offset"
 msgstr ""
 
-#: ppc-opc.c:1105 ppc-opc.c:1140
+#: ppc-opc.c:1091 ppc-opc.c:1126
 msgid "illegal bitmask"
 msgstr ""
 
-#: ppc-opc.c:1205
+#: ppc-opc.c:1191
 msgid "value out of range"
 msgstr ""
 
-#: ppc-opc.c:1273
+#: ppc-opc.c:1259
 msgid "index register in load range"
 msgstr ""
 
-#: ppc-opc.c:1289
+#: ppc-opc.c:1275
 msgid "source and target register operands must be different"
 msgstr ""
 
-#: ppc-opc.c:1304
+#: ppc-opc.c:1290
 msgid "invalid register operand when updating"
 msgstr ""
 
-#: ppc-opc.c:1343
+#: ppc-opc.c:1329
 msgid "target register operand must be even"
 msgstr ""
 
-#: ppc-opc.c:1357
+#: ppc-opc.c:1343
 msgid "source register operand must be even"
 msgstr ""
 
index c7351e8f2cfd6ccfcc6c3def389fdc7de6f9d4ef..af70ae6ac2a853ad28eb8144c0f701502a9480ef 100644 (file)
@@ -109,12 +109,12 @@ const struct powerpc_operand powerpc_operands[] =
   /* The zero index is used to indicate the end of the list of
      operands.  */
 #define UNUSED 0
-  { 0, 0, NULL, NULL, 0 },
+  { 0, 0, 0, 0, 0 },
 
   /* The BA field in an XL form instruction.  */
 #define BA UNUSED + 1
 #define BA_MASK (0x1f << 16)
-  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
+  { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BA field in an XL form instruction when it must be the same
      as the BT field in the same instruction.  */
@@ -124,7 +124,7 @@ const struct powerpc_operand powerpc_operands[] =
   /* The BB field in an XL form instruction.  */
 #define BB BAT + 1
 #define BB_MASK (0x1f << 11)
-  { 5, 11, NULL, NULL, PPC_OPERAND_CR },
+  { 5, 11, 0, 0, PPC_OPERAND_CR },
 
   /* The BB field in an XL form instruction when it must be the same
      as the BA field in the same instruction.  */
@@ -167,21 +167,21 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The BF field in an X or XL form instruction.  */
 #define BF BDPA + 1
-  { 3, 23, NULL, NULL, PPC_OPERAND_CR },
+  { 3, 23, 0, 0, PPC_OPERAND_CR },
 
   /* An optional BF field.  This is used for comparison instructions,
      in which an omitted BF field is taken as zero.  */
 #define OBF BF + 1
-  { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The BFA field in an X or XL form instruction.  */
 #define BFA OBF + 1
-  { 3, 18, NULL, NULL, PPC_OPERAND_CR },
+  { 3, 18, 0, 0, PPC_OPERAND_CR },
 
   /* The BI field in a B form or XL form instruction.  */
 #define BI BFA + 1
 #define BI_MASK (0x1f << 16)
-  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
+  { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BO field in a B form instruction.  Certain values are
      illegal.  */
@@ -195,40 +195,40 @@ const struct powerpc_operand powerpc_operands[] =
   { 5, 21, insert_boe, extract_boe, 0 },
 
 #define BH BOE + 1
-  { 2, 11, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 2, 11, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The BT field in an X or XL form instruction.  */
 #define BT BH + 1
-  { 5, 21, NULL, NULL, PPC_OPERAND_CR },
+  { 5, 21, 0, 0, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
      or XL form instruction.  This is used for the extended
      conditional branch mnemonics, which set the lower two bits of the
      BI field.  This field is optional.  */
 #define CR BT + 1
-  { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The CRB field in an X form instruction.  */
 #define CRB CR + 1
-  { 5, 6, NULL, NULL, 0 },
+  { 5, 6, 0, 0, 0 },
 
   /* The CRFD field in an X form instruction.  */
 #define CRFD CRB + 1
-  { 3, 23, NULL, NULL, PPC_OPERAND_CR },
+  { 3, 23, 0, 0, PPC_OPERAND_CR },
 
   /* The CRFS field in an X form instruction.  */
 #define CRFS CRFD + 1
-  { 3, 0, NULL, NULL, PPC_OPERAND_CR },
+  { 3, 0, 0, 0, PPC_OPERAND_CR },
 
   /* The CT field in an X form instruction.  */
 #define CT CRFS + 1
-  { 5, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The D field in a D form instruction.  This is a displacement off
      a register, and implies that the next operand is a register in
      parentheses.  */
 #define D CT + 1
-  { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+  { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The DE field in a DE form instruction.  This is like D, but is 12
      bits only.  */
@@ -254,40 +254,40 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The E field in a wrteei instruction.  */
 #define E DS + 1
-  { 1, 15, NULL, NULL, 0 },
+  { 1, 15, 0, 0, 0 },
 
   /* The FL1 field in a POWER SC form instruction.  */
 #define FL1 E + 1
-  { 4, 12, NULL, NULL, 0 },
+  { 4, 12, 0, 0, 0 },
 
   /* The FL2 field in a POWER SC form instruction.  */
 #define FL2 FL1 + 1
-  { 3, 2, NULL, NULL, 0 },
+  { 3, 2, 0, 0, 0 },
 
   /* The FLM field in an XFL form instruction.  */
 #define FLM FL2 + 1
-  { 8, 17, NULL, NULL, 0 },
+  { 8, 17, 0, 0, 0 },
 
   /* The FRA field in an X or A form instruction.  */
 #define FRA FLM + 1
 #define FRA_MASK (0x1f << 16)
-  { 5, 16, NULL, NULL, PPC_OPERAND_FPR },
+  { 5, 16, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRB field in an X or A form instruction.  */
 #define FRB FRA + 1
 #define FRB_MASK (0x1f << 11)
-  { 5, 11, NULL, NULL, PPC_OPERAND_FPR },
+  { 5, 11, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRC field in an A form instruction.  */
 #define FRC FRB + 1
 #define FRC_MASK (0x1f << 6)
-  { 5, 6, NULL, NULL, PPC_OPERAND_FPR },
+  { 5, 6, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRS field in an X form instruction or the FRT field in a D, X
      or A form instruction.  */
 #define FRS FRC + 1
 #define FRT FRS
-  { 5, 21, NULL, NULL, PPC_OPERAND_FPR },
+  { 5, 21, 0, 0, PPC_OPERAND_FPR },
 
   /* The FXM field in an XFX instruction.  */
 #define FXM FRS + 1
@@ -300,11 +300,11 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The L field in a D or X form instruction.  */
 #define L FXM4 + 1
-  { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 1, 21, 0, 0, 0 },
 
   /* The LEV field in a POWER SC form instruction.  */
 #define LEV L + 1
-  { 7, 5, NULL, NULL, 0 },
+  { 7, 5, 0, 0, 0 },
 
   /* The LI field in an I form instruction.  The lower two bits are
      forced to zero.  */
@@ -318,24 +318,24 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The LS field in an X (sync) form instruction.  */
 #define LS LIA + 1
-  { 2, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 2, 21, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The MB field in an M form instruction.  */
 #define MB LS + 1
 #define MB_MASK (0x1f << 6)
-  { 5, 6, NULL, NULL, 0 },
+  { 5, 6, 0, 0, 0 },
 
   /* The ME field in an M form instruction.  */
 #define ME MB + 1
 #define ME_MASK (0x1f << 1)
-  { 5, 1, NULL, NULL, 0 },
+  { 5, 1, 0, 0, 0 },
 
   /* The MB and ME fields in an M form instruction expressed a single
      operand which is a bitmask indicating which bits to select.  This
      is a two operand form using PPC_OPERAND_NEXT.  See the
      description in opcode/ppc.h for what this means.  */
 #define MBE ME + 1
-  { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
+  { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
   { 32, 0, insert_mbe, extract_mbe, 0 },
 
   /* The MB or ME field in an MD or MDS form instruction.  The high
@@ -347,7 +347,7 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The MO field in an mbar instruction.  */
 #define MO MB6 + 1
-  { 5, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The NB field in an X form instruction.  The value 32 is stored as
      0.  */
@@ -363,42 +363,42 @@ const struct powerpc_operand powerpc_operands[] =
   /* The RA field in an D, DS, DQ, X, XO, M, or MDS form instruction.  */
 #define RA NSI + 1
 #define RA_MASK (0x1f << 16)
-  { 5, 16, NULL, NULL, PPC_OPERAND_GPR },
+  { 5, 16, 0, 0, PPC_OPERAND_GPR },
 
   /* As above, but 0 in the RA field means zero, not r0.  */
 #define RA0 RA + 1
-  { 5, 16, NULL, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 16, 0, 0, PPC_OPERAND_GPR_0 },
 
   /* The RA field in the DQ form lq instruction, which has special
      value restrictions.  */
 #define RAQ RA0 + 1
-  { 5, 16, insert_raq, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 16, insert_raq, 0, PPC_OPERAND_GPR_0 },
 
   /* The RA field in a D or X form instruction which is an updating
      load, which means that the RA field may not be zero and may not
      equal the RT field.  */
 #define RAL RAQ + 1
-  { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 16, insert_ral, 0, PPC_OPERAND_GPR_0 },
 
   /* The RA field in an lmw instruction, which has special value
      restrictions.  */
 #define RAM RAL + 1
-  { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 16, insert_ram, 0, PPC_OPERAND_GPR_0 },
 
   /* The RA field in a D or X form instruction which is an updating
      store or an updating floating point load, which means that the RA
      field may not be zero.  */
 #define RAS RAM + 1
-  { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 16, insert_ras, 0, PPC_OPERAND_GPR_0 },
 
   /* The RA field of the tlbwe instruction, which is optional.  */
 #define RAOPT RAS + 1
-  { 5, 16, NULL, NULL, PPC_OPERAND_GPR | PPC_OPERAND_OPTIONAL },
+  { 5, 16, 0, 0, PPC_OPERAND_GPR | PPC_OPERAND_OPTIONAL },
 
   /* The RB field in an X, XO, M, or MDS form instruction.  */
 #define RB RAOPT + 1
 #define RB_MASK (0x1f << 11)
-  { 5, 11, NULL, NULL, PPC_OPERAND_GPR },
+  { 5, 11, 0, 0, PPC_OPERAND_GPR },
 
   /* The RB field in an X form instruction when it must be the same as
      the RS field in the instruction.  This is used for extended
@@ -412,26 +412,26 @@ const struct powerpc_operand powerpc_operands[] =
 #define RS RBS + 1
 #define RT RS
 #define RT_MASK (0x1f << 21)
-  { 5, 21, NULL, NULL, PPC_OPERAND_GPR },
+  { 5, 21, 0, 0, PPC_OPERAND_GPR },
 
   /* The RS field of the DS form stq instruction, which has special
      value restrictions.  */
 #define RSQ RS + 1
-  { 5, 21, insert_rsq, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 21, insert_rsq, 0, PPC_OPERAND_GPR_0 },
 
   /* The RT field of the DQ form lq instruction, which has special
      value restrictions.  */
 #define RTQ RSQ + 1
-  { 5, 21, insert_rtq, NULL, PPC_OPERAND_GPR_0 },
+  { 5, 21, insert_rtq, 0, PPC_OPERAND_GPR_0 },
 
   /* The RS field of the tlbwe instruction, which is optional.  */
 #define RSO RTQ + 1
-  { 5, 21, NULL, NULL, PPC_OPERAND_GPR | PPC_OPERAND_OPTIONAL },
+  { 5, 21, 0, 0, PPC_OPERAND_GPR | PPC_OPERAND_OPTIONAL },
 
   /* The SH field in an X or M form instruction.  */
 #define SH RSO + 1
 #define SH_MASK (0x1f << 11)
-  { 5, 11, NULL, NULL, 0 },
+  { 5, 11, 0, 0, 0 },
 
   /* The SH field in an MD form instruction.  This is split.  */
 #define SH6 SH + 1
@@ -440,16 +440,16 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The SH field of the tlbwe instruction, which is optional.  */
 #define SHO SH6 + 1
-  { 5, 11,NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 5, 11,0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The SI field in a D form instruction.  */
 #define SI SHO + 1
-  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
+  { 16, 0, 0, 0, PPC_OPERAND_SIGNED },
 
   /* The SI field in a D form instruction when we accept a wide range
      of positive values.  */
 #define SISIGNOPT SI + 1
-  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
+  { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
 
   /* The SPR field in an XFX form instruction.  This is flipped--the
      lower 5 bits are stored in the upper 5 and vice- versa.  */
@@ -461,25 +461,25 @@ const struct powerpc_operand powerpc_operands[] =
   /* The BAT index number in an XFX form m[ft]ibat[lu] instruction.  */
 #define SPRBAT SPR + 1
 #define SPRBAT_MASK (0x3 << 17)
-  { 2, 17, NULL, NULL, 0 },
+  { 2, 17, 0, 0, 0 },
 
   /* The SPRG register number in an XFX form m[ft]sprg instruction.  */
 #define SPRG SPRBAT + 1
 #define SPRG_MASK (0x3 << 16)
-  { 2, 16, NULL, NULL, 0 },
+  { 2, 16, 0, 0, 0 },
 
   /* The SR field in an X form instruction.  */
 #define SR SPRG + 1
-  { 4, 16, NULL, NULL, 0 },
+  { 4, 16, 0, 0, 0 },
 
   /* The STRM field in an X AltiVec form instruction.  */
 #define STRM SR + 1
 #define STRM_MASK (0x3 << 21)
-  { 2, 21, NULL, NULL, 0 },
+  { 2, 21, 0, 0, 0 },
 
   /* The SV field in a POWER SC form instruction.  */
 #define SV STRM + 1
-  { 14, 2, NULL, NULL, 0 },
+  { 14, 2, 0, 0, 0 },
 
   /* The TBR field in an XFX form instruction.  This is like the SPR
      field, but it is optional.  */
@@ -489,52 +489,52 @@ const struct powerpc_operand powerpc_operands[] =
   /* The TO field in a D or X form instruction.  */
 #define TO TBR + 1
 #define TO_MASK (0x1f << 21)
-  { 5, 21, NULL, NULL, 0 },
+  { 5, 21, 0, 0, 0 },
 
   /* The U field in an X form instruction.  */
 #define U TO + 1
-  { 4, 12, NULL, NULL, 0 },
+  { 4, 12, 0, 0, 0 },
 
   /* The UI field in a D form instruction.  */
 #define UI U + 1
-  { 16, 0, NULL, NULL, 0 },
+  { 16, 0, 0, 0, 0 },
 
   /* The VA field in a VA, VX or VXR form instruction.  */
 #define VA UI + 1
 #define VA_MASK        (0x1f << 16)
-  { 5, 16, NULL, NULL, PPC_OPERAND_VR },
+  { 5, 16, 0, 0, PPC_OPERAND_VR },
 
   /* The VB field in a VA, VX or VXR form instruction.  */
 #define VB VA + 1
 #define VB_MASK (0x1f << 11)
-  { 5, 11, NULL, NULL, PPC_OPERAND_VR },
+  { 5, 11, 0, 0, PPC_OPERAND_VR },
 
   /* The VC field in a VA form instruction.  */
 #define VC VB + 1
 #define VC_MASK (0x1f << 6)
-  { 5, 6, NULL, NULL, PPC_OPERAND_VR },
+  { 5, 6, 0, 0, PPC_OPERAND_VR },
 
   /* The VD or VS field in a VA, VX, VXR or X form instruction.  */
 #define VD VC + 1
 #define VS VD
 #define VD_MASK (0x1f << 21)
-  { 5, 21, NULL, NULL, PPC_OPERAND_VR },
+  { 5, 21, 0, 0, PPC_OPERAND_VR },
 
   /* The SIMM field in a VX form instruction.  */
 #define SIMM VD + 1
-  { 5, 16, NULL, NULL, PPC_OPERAND_SIGNED},
+  { 5, 16, 0, 0, PPC_OPERAND_SIGNED},
 
   /* The UIMM field in a VX form instruction.  */
 #define UIMM SIMM + 1
-  { 5, 16, NULL, NULL, 0 },
+  { 5, 16, 0, 0, 0 },
 
   /* The SHB field in a VA form instruction.  */
 #define SHB UIMM + 1
-  { 4, 6, NULL, NULL, 0 },
+  { 4, 6, 0, 0, 0 },
 
   /* The other UIMM field in a EVX form instruction.  */
 #define EVUIMM SHB + 1
-  { 5, 11, NULL, NULL, 0 },
+  { 5, 11, 0, 0, 0 },
 
   /* The other UIMM field in a half word EVX form instruction.  */
 #define EVUIMM_2 EVUIMM + 1
@@ -551,11 +551,11 @@ const struct powerpc_operand powerpc_operands[] =
   /* The WS field.  */
 #define WS EVUIMM_8 + 1
 #define WS_MASK (0x7 << 11)
-  { 3, 11, NULL, NULL, 0 },
+  { 3, 11, 0, 0, 0 },
 
   /* The L field in an mtmsrd instruction */
 #define MTMSRD_L WS + 1
-  { 1, 16, NULL, NULL, PPC_OPERAND_OPTIONAL },
+  { 1, 16, 0, 0, PPC_OPERAND_OPTIONAL },
 
 };
 
@@ -1958,41 +1958,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "nmaclhwso.",        XO(4,494,1,1), XO_MASK, PPC405|PPC440,  { RT, RA, RB } },
 { "mfvscr",  VX(4, 1540), VX_MASK,     PPCVEC,         { VD } },
 { "mtvscr",  VX(4, 1604), VX_MASK,     PPCVEC,         { VB } },
-
-  /* Double-precision opcodes.  */
-  /* Some of these conflict with AltiVec, so move them before, since
-     PPCVEC includes the PPC_OPCODE_PPC set.  */
-{ "efscfd",   VX(4, 719), VX_MASK,     PPCEFS,         { RS, RA } },
-{ "efdabs",   VX(4, 740), VX_MASK,     PPCEFS,         { RS, RA } },
-{ "efdnabs",  VX(4, 741), VX_MASK,     PPCEFS,         { RS, RA } },
-{ "efdneg",   VX(4, 742), VX_MASK,     PPCEFS,         { RS, RA } },
-{ "efdadd",   VX(4, 736), VX_MASK,     PPCEFS,         { RS, RA, RB } },
-{ "efdsub",   VX(4, 737), VX_MASK,     PPCEFS,         { RS, RA, RB } },
-{ "efdmul",   VX(4, 744), VX_MASK,     PPCEFS,         { RS, RA, RB } },
-{ "efddiv",   VX(4, 745), VX_MASK,     PPCEFS,         { RS, RA, RB } },
-{ "efdcmpgt", VX(4, 748), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdcmplt", VX(4, 749), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdcmpeq", VX(4, 750), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdtstgt", VX(4, 764), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdtstlt", VX(4, 765), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdtsteq", VX(4, 766), VX_MASK,     PPCEFS,         { CRFD, RA, RB } },
-{ "efdcfsi",  VX(4, 753), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfsid", VX(4, 739), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfui",  VX(4, 752), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfuid", VX(4, 738), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfsf",  VX(4, 755), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfuf",  VX(4, 754), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctsi",  VX(4, 757), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctsidz",VX(4, 747), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctsiz", VX(4, 762), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctui",  VX(4, 756), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctuidz",VX(4, 746), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctuiz", VX(4, 760), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctsf",  VX(4, 759), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdctuf",  VX(4, 758), VX_MASK,     PPCEFS,         { RS, RB } },
-{ "efdcfs",   VX(4, 751), VX_MASK,     PPCEFS,         { RS, RB } },
-  /* End of double-precision opcodes.  */
-
 { "vaddcuw", VX(4,  384), VX_MASK,     PPCVEC,         { VD, VA, VB } },
 { "vaddfp",  VX(4,   10), VX_MASK,     PPCVEC,         { VD, VA, VB } },
 { "vaddsbs", VX(4,  768), VX_MASK,     PPCVEC,         { VD, VA, VB } },
index 16fc4a95c68470640d0b63c92fe3f90346e6f53b..8c310854a8a98b7575219a32bb1136c6fa003f00 100644 (file)
@@ -1,5 +1,5 @@
 /* xtensa-dis.c.  Disassembly functions for Xtensa.
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003 Free Software Foundation, Inc.
    Contributed by Bob Wilson at Tensilica, Inc. (bwilson@tensilica.com)
 
    This file is part of GDB, GAS, and the GNU binutils.
 #include <string.h>
 #include "xtensa-isa.h"
 #include "ansidecl.h"
-#include "libiberty.h"
 #include "sysdep.h"
 #include "dis-asm.h"
 
 #include <setjmp.h>
 
-extern xtensa_isa xtensa_default_isa;
-
 #ifndef MAX
 #define MAX(a,b) (a > b ? a : b)
 #endif
 
+static char* state_names[256] =
+{
+  "lbeg",                      /* 0 */
+  "lend",                      /* 1 */
+  "lcount",                    /* 2 */
+  "sar",                       /* 3 */
+  "br",                                /* 4 */
+
+  "reserved_5",                        /* 5 */
+  "reserved_6",                        /* 6 */
+  "reserved_7",                        /* 7 */
+
+  "av",                                /* 8 */
+  "avh",                       /* 9 */
+  "bv",                                /* 10 */
+  "sav",                       /* 11 */
+  "scompare1",                 /* 12 */
+
+  "reserved_13",               /* 13 */
+  "reserved_14",               /* 14 */
+  "reserved_15",               /* 15 */
+
+  "acclo",                     /* 16 */
+  "acchi",                     /* 17 */
+
+  "reserved_18",               /* 18 */
+  "reserved_19",               /* 19 */
+  "reserved_20",               /* 20 */
+  "reserved_21",               /* 21 */
+  "reserved_22",               /* 22 */
+  "reserved_23",               /* 23 */
+  "reserved_24",               /* 24 */
+  "reserved_25",               /* 25 */
+  "reserved_26",               /* 26 */
+  "reserved_27",               /* 27 */
+  "reserved_28",               /* 28 */
+  "reserved_29",               /* 29 */
+  "reserved_30",               /* 30 */
+  "reserved_31",               /* 31 */
+
+  "mr0",                       /* 32 */
+  "mr1",                       /* 33 */
+  "mr2",                       /* 34 */
+  "mr3",                       /* 35 */
+
+  "reserved_36",               /* 36 */
+  "reserved_37",               /* 37 */
+  "reserved_38",               /* 38 */
+  "reserved_39",               /* 39 */
+  "reserved_40",               /* 40 */
+  "reserved_41",               /* 41 */
+  "reserved_42",               /* 42 */
+  "reserved_43",               /* 43 */
+  "reserved_44",               /* 44 */
+  "reserved_45",               /* 45 */
+  "reserved_46",               /* 46 */
+  "reserved_47",               /* 47 */
+  "reserved_48",               /* 48 */
+  "reserved_49",               /* 49 */
+  "reserved_50",               /* 50 */
+  "reserved_51",               /* 51 */
+  "reserved_52",               /* 52 */
+  "reserved_53",               /* 53 */
+  "reserved_54",               /* 54 */
+  "reserved_55",               /* 55 */
+  "reserved_56",               /* 56 */
+  "reserved_57",               /* 57 */
+  "reserved_58",               /* 58 */
+  "reserved_59",               /* 59 */
+  "reserved_60",               /* 60 */
+  "reserved_61",               /* 61 */
+  "reserved_62",               /* 62 */
+  "reserved_63",               /* 63 */
+
+  "reserved_64",               /* 64 */
+  "reserved_65",               /* 65 */
+  "reserved_66",               /* 66 */
+  "reserved_67",               /* 67 */
+  "reserved_68",               /* 68 */
+  "reserved_69",               /* 69 */
+  "reserved_70",               /* 70 */
+  "reserved_71",               /* 71 */
+
+  "wb",                                /* 72 */
+  "ws",                                /* 73 */
+
+  "reserved_74",               /* 74 */
+  "reserved_75",               /* 75 */
+  "reserved_76",               /* 76 */
+  "reserved_77",               /* 77 */
+  "reserved_78",               /* 78 */
+  "reserved_79",               /* 79 */
+  "reserved_80",               /* 80 */
+  "reserved_81",               /* 81 */
+  "reserved_82",               /* 82 */
+
+  "ptevaddr",                  /* 83 */
+
+  "reserved_84",               /* 84 */
+  "reserved_85",               /* 85 */
+  "reserved_86",               /* 86 */
+  "reserved_87",               /* 87 */
+  "reserved_88",               /* 88 */
+  "reserved_89",               /* 89 */
+
+  "rasid",                     /* 90 */
+  "itlbcfg",                   /* 91 */
+  "dtlbcfg",                   /* 92 */
+
+  "reserved_93",               /* 93 */
+  "reserved_94",               /* 94 */
+  "reserved_95",               /* 95 */
+
+  "ibreakenable",              /* 96 */
+
+  "reserved_97",               /* 97 */
+
+  "cacheattr",                 /* 98 */
+
+  "reserved_99",               /* 99 */
+  "reserved_100",              /* 100 */
+  "reserved_101",              /* 101 */
+  "reserved_102",              /* 102 */
+  "reserved_103",              /* 103 */
+
+  "ddr",                       /* 104 */
+
+  "reserved_105",              /* 105 */
+  "reserved_106",              /* 106 */
+  "reserved_107",              /* 107 */
+  "reserved_108",              /* 108 */
+  "reserved_109",              /* 109 */
+  "reserved_110",              /* 110 */
+  "reserved_111",              /* 111 */
+  "reserved_112",              /* 112 */
+  "reserved_113",              /* 113 */
+  "reserved_114",              /* 114 */
+  "reserved_115",              /* 115 */
+  "reserved_116",              /* 116 */
+  "reserved_117",              /* 117 */
+  "reserved_118",              /* 118 */
+  "reserved_119",              /* 119 */
+  "reserved_120",              /* 120 */
+  "reserved_121",              /* 121 */
+  "reserved_122",              /* 122 */
+  "reserved_123",              /* 123 */
+  "reserved_124",              /* 124 */
+  "reserved_125",              /* 125 */
+  "reserved_126",              /* 126 */
+  "reserved_127",              /* 127 */
+
+  "ibreaka0",                  /* 128 */
+  "ibreaka1",                  /* 129 */
+  "ibreaka2",                  /* 130 */
+  "ibreaka3",                  /* 131 */
+  "ibreaka4",                  /* 132 */
+  "ibreaka5",                  /* 133 */
+  "ibreaka6",                  /* 134 */
+  "ibreaka7",                  /* 135 */
+  "ibreaka8",                  /* 136 */
+  "ibreaka9",                  /* 137 */
+  "ibreaka10",                 /* 138 */
+  "ibreaka11",                 /* 139 */
+  "ibreaka12",                 /* 140 */
+  "ibreaka13",                 /* 141 */
+  "ibreaka14",                 /* 142 */
+  "ibreaka15",                 /* 143 */
+                          
+  "dbreaka0",                  /* 144 */
+  "dbreaka1",                  /* 145 */
+  "dbreaka2",                  /* 146 */
+  "dbreaka3",                  /* 147 */
+  "dbreaka4",                  /* 148 */
+  "dbreaka5",                  /* 149 */
+  "dbreaka6",                  /* 150 */
+  "dbreaka7",                  /* 151 */
+  "dbreaka8",                  /* 152 */
+  "dbreaka9",                  /* 153 */
+  "dbreaka10",                 /* 154 */
+  "dbreaka11",                 /* 155 */
+  "dbreaka12",                 /* 156 */
+  "dbreaka13",                 /* 157 */
+  "dbreaka14",                 /* 158 */
+  "dbreaka15",                 /* 159 */
+                          
+  "dbreakc0",                  /* 160 */
+  "dbreakc1",                  /* 161 */
+  "dbreakc2",                  /* 162 */
+  "dbreakc3",                  /* 163 */
+  "dbreakc4",                  /* 164 */
+  "dbreakc5",                  /* 165 */
+  "dbreakc6",                  /* 166 */
+  "dbreakc7",                  /* 167 */
+  "dbreakc8",                  /* 168 */
+  "dbreakc9",                  /* 169 */
+  "dbreakc10",                 /* 170 */
+  "dbreakc11",                 /* 171 */
+  "dbreakc12",                 /* 172 */
+  "dbreakc13",                 /* 173 */
+  "dbreakc14",                 /* 174 */
+  "dbreakc15",                 /* 175 */
+
+  "reserved_176",              /* 176 */
+
+  "epc1",                      /* 177 */
+  "epc2",                      /* 178 */
+  "epc3",                      /* 179 */
+  "epc4",                      /* 180 */
+  "epc5",                      /* 181 */
+  "epc6",                      /* 182 */
+  "epc7",                      /* 183 */
+  "epc8",                      /* 184 */
+  "epc9",                      /* 185 */
+  "epc10",                     /* 186 */
+  "epc11",                     /* 187 */
+  "epc12",                     /* 188 */
+  "epc13",                     /* 189 */
+  "epc14",                     /* 190 */
+  "epc15",                     /* 191 */
+  "depc",                      /* 192 */
+
+  "reserved_193",              /* 193 */
+
+  "eps2",                      /* 194 */
+  "eps3",                      /* 195 */
+  "eps4",                      /* 196 */
+  "eps5",                      /* 197 */
+  "eps6",                      /* 198 */
+  "eps7",                      /* 199 */
+  "eps8",                      /* 200 */
+  "eps9",                      /* 201 */
+  "eps10",                     /* 202 */
+  "eps11",                     /* 203 */
+  "eps12",                     /* 204 */
+  "eps13",                     /* 205 */
+  "eps14",                     /* 206 */
+  "eps15",                     /* 207 */
+
+  "reserved_208",              /* 208 */
+
+  "excsave1",                  /* 209 */
+  "excsave2",                  /* 210 */
+  "excsave3",                  /* 211 */
+  "excsave4",                  /* 212 */
+  "excsave5",                  /* 213 */
+  "excsave6",                  /* 214 */
+  "excsave7",                  /* 215 */
+  "excsave8",                  /* 216 */
+  "excsave9",                  /* 217 */
+  "excsave10",                 /* 218 */
+  "excsave11",                 /* 219 */
+  "excsave12",                 /* 220 */
+  "excsave13",                 /* 221 */
+  "excsave14",                 /* 222 */
+  "excsave15",                 /* 223 */
+  "cpenable",                  /* 224 */
+
+  "reserved_225",              /* 225 */
+
+  "interrupt",                 /* 226 */
+  "interrupt2",                        /* 227 */
+  "intenable",                 /* 228 */
+
+  "reserved_229",              /* 229 */
+
+  "ps",                                /* 230 */
+
+  "reserved_231",              /* 231 */
+
+  "exccause",                  /* 232 */
+  "debugcause",                        /* 233 */
+  "ccount",                    /* 234 */
+  "prid",                      /* 235 */
+  "icount",                    /* 236 */
+  "icountlvl",                         /* 237 */
+  "excvaddr",                  /* 238 */
+
+  "reserved_239",              /* 239 */
+
+  "ccompare0",                 /* 240 */
+  "ccompare1",                 /* 241 */
+  "ccompare2",                 /* 242 */
+  "ccompare3",                 /* 243 */
+
+  "misc0",                     /* 244 */
+  "misc1",                     /* 245 */
+  "misc2",                     /* 246 */
+  "misc3",                     /* 247 */
+
+  "reserved_248",              /* 248 */
+  "reserved_249",              /* 249 */
+  "reserved_250",              /* 250 */
+  "reserved_251",              /* 251 */
+  "reserved_252",              /* 252 */
+  "reserved_253",              /* 253 */
+  "reserved_254",              /* 254 */
+  "reserved_255",              /* 255 */
+};
+
+
 int show_raw_fields;
 
-struct dis_private
-{
+static int fetch_data
+  PARAMS ((struct disassemble_info *info, bfd_vma memaddr));
+static void print_xtensa_operand
+  PARAMS ((bfd_vma, struct disassemble_info *, xtensa_operand,
+          unsigned operand_val, int print_sr_name));
+
+struct dis_private {
   bfd_byte *byte_buf;
   jmp_buf bailout;
 };
 
-
 static int
-fetch_data (struct disassemble_info *info, bfd_vma memaddr)
+fetch_data (info, memaddr)
+     struct disassemble_info *info;
+     bfd_vma memaddr;
 {
   int length, status = 0;
   struct dis_private *priv = (struct dis_private *) info->private_data;
-  int insn_size = xtensa_isa_maxlength (xtensa_default_isa);
+  int insn_size = xtensa_insn_maxlength (xtensa_default_isa);
 
   /* Read the maximum instruction size, padding with zeros if we go past
      the end of the text section.  This code will automatically adjust
@@ -72,13 +375,14 @@ fetch_data (struct disassemble_info *info, bfd_vma memaddr)
 
 
 static void
-print_xtensa_operand (bfd_vma memaddr,
-                     struct disassemble_info *info,
-                     xtensa_opcode opc,
-                     int opnd,
-                     unsigned operand_val)
+print_xtensa_operand (memaddr, info, opnd, operand_val, print_sr_name)
+     bfd_vma memaddr;
+     struct disassemble_info *info;
+     xtensa_operand opnd;
+     unsigned operand_val;
+     int print_sr_name;
 {
-  xtensa_isa isa = xtensa_default_isa;
+  char *kind = xtensa_operand_kind (opnd);
   int signed_operand_val;
     
   if (show_raw_fields)
@@ -90,42 +394,29 @@ print_xtensa_operand (bfd_vma memaddr,
       return;
     }
 
-  (void) xtensa_operand_decode (isa, opc, opnd, &operand_val);
+  operand_val = xtensa_operand_decode (opnd, operand_val);
   signed_operand_val = (int) operand_val;
 
-  if (xtensa_operand_is_register (isa, opc, opnd) == 0)
+  if (xtensa_operand_isPCRelative (opnd))
     {
-      if (xtensa_operand_is_PCrelative (isa, opc, opnd) == 1)
-       {
-         (void) xtensa_operand_undo_reloc (isa, opc, opnd,
-                                           &operand_val, memaddr);
-         info->target = operand_val;
-         (*info->print_address_func) (info->target, info);
-       }
-      else
-       {
-         if ((signed_operand_val > -256) && (signed_operand_val < 256))
-           (*info->fprintf_func) (info->stream, "%d", signed_operand_val);
-         else
-           (*info->fprintf_func) (info->stream, "0x%x", signed_operand_val);
-       }
+      operand_val = xtensa_operand_undo_reloc (opnd, operand_val, memaddr);
+      info->target = operand_val;
+      (*info->print_address_func) (info->target, info);
     }
-  else
+  else if (!strcmp (kind, "i"))
     {
-      int i = 1;
-      xtensa_regfile opnd_rf = xtensa_operand_regfile (isa, opc, opnd);
-      (*info->fprintf_func) (info->stream, "%s%u",
-                            xtensa_regfile_shortname (isa, opnd_rf),
-                            operand_val);
-      while (i < xtensa_operand_num_regs (isa, opc, opnd))
-       {
-         operand_val++;
-         (*info->fprintf_func) (info->stream, ":%s%u",
-                                xtensa_regfile_shortname (isa, opnd_rf),
-                                operand_val);
-         i++;
-       } 
+      if (print_sr_name
+         && signed_operand_val >= 0
+         && signed_operand_val <= 255)
+       (*info->fprintf_func) (info->stream, "%s",
+                              state_names[signed_operand_val]);
+      else if ((signed_operand_val > -256) && (signed_operand_val < 256))
+       (*info->fprintf_func) (info->stream, "%d", signed_operand_val);
+      else
+       (*info->fprintf_func) (info->stream, "0x%x",signed_operand_val);
     }
+  else
+    (*info->fprintf_func) (info->stream, "%s%u", kind, operand_val);
 }
 
 
@@ -133,24 +424,25 @@ print_xtensa_operand (bfd_vma memaddr,
    Returns length of the instruction in bytes.  */
 
 int
-print_insn_xtensa (bfd_vma memaddr, struct disassemble_info *info)
+print_insn_xtensa (memaddr, info)
+     bfd_vma memaddr;
+     struct disassemble_info *info;
 {
   unsigned operand_val;
-  int bytes_fetched, size, maxsize, i, n, noperands, nslots;
+  int bytes_fetched, size, maxsize, i, noperands;
   xtensa_isa isa;
   xtensa_opcode opc;
-  xtensa_format fmt;
+  char *op_name;
+  int print_sr_name;
   struct dis_private priv;
   static bfd_byte *byte_buf = NULL;
   static xtensa_insnbuf insn_buffer = NULL;
-  static xtensa_insnbuf slot_buffer = NULL;
-  int first, first_slot, valid_insn;
 
   if (!xtensa_default_isa)
-    xtensa_default_isa = xtensa_isa_init (0, 0);
+    (void) xtensa_isa_init ();
 
   info->target = 0;
-  maxsize = xtensa_isa_maxlength (xtensa_default_isa);
+  maxsize = xtensa_insn_maxlength (xtensa_default_isa);
 
   /* Set bytes_per_line to control the amount of whitespace between the hex
      values and the opcode.  For Xtensa, we always print one "chunk" and we
@@ -166,23 +458,19 @@ print_insn_xtensa (bfd_vma memaddr, struct disassemble_info *info)
 
   /* Allocate buffers the first time through.  */
   if (!insn_buffer)
-    {
-      insn_buffer = xtensa_insnbuf_alloc (xtensa_default_isa);
-      slot_buffer = xtensa_insnbuf_alloc (xtensa_default_isa);
-      byte_buf = (bfd_byte *) xmalloc (MAX (maxsize, 4));
-    }
+    insn_buffer = xtensa_insnbuf_alloc (xtensa_default_isa);
+  if (!byte_buf)
+    byte_buf = (bfd_byte *) malloc (MAX (maxsize, 4));
 
   priv.byte_buf = byte_buf;
 
-  info->private_data = (void *) &priv;
+  info->private_data = (PTR) &priv;
   if (setjmp (priv.bailout) != 0)
       /* Error return.  */
       return -1;
 
   /* Don't set "isa" before the setjmp to keep the compiler from griping.  */
   isa = xtensa_default_isa;
-  size = 0;
-  nslots = 0;
 
   /* Fetch the maximum size instruction.  */
   bytes_fetched = fetch_data (info, memaddr);
@@ -190,75 +478,44 @@ print_insn_xtensa (bfd_vma memaddr, struct disassemble_info *info)
   /* Copy the bytes into the decode buffer.  */
   memset (insn_buffer, 0, (xtensa_insnbuf_size (isa) *
                           sizeof (xtensa_insnbuf_word)));
-  xtensa_insnbuf_from_chars (isa, insn_buffer, priv.byte_buf, bytes_fetched);
-
-  fmt = xtensa_format_decode (isa, insn_buffer);
-  if (fmt == XTENSA_UNDEFINED
-      || ((size = xtensa_format_length (isa, fmt)) > bytes_fetched))
-    valid_insn = 0;
-  else
-    {
-      /* Make sure all the opcodes are valid.  */
-      valid_insn = 1;
-      nslots = xtensa_format_num_slots (isa, fmt);
-      for (n = 0; n < nslots; n++)
-       {
-         xtensa_format_get_slot (isa, fmt, n, insn_buffer, slot_buffer);
-         if (xtensa_opcode_decode (isa, fmt, n, slot_buffer)
-             == XTENSA_UNDEFINED)
-           {
-             valid_insn = 0;
-             break;
-           }
-       }
-    }
+  xtensa_insnbuf_from_chars (isa, insn_buffer, priv.byte_buf);
 
-  if (!valid_insn)
+  opc = xtensa_decode_insn (isa, insn_buffer);
+  if (opc == XTENSA_UNDEFINED
+      || ((size = xtensa_insn_length (isa, opc)) > bytes_fetched))
     {
       (*info->fprintf_func) (info->stream, ".byte %#02x", priv.byte_buf[0]);
       return 1;
     }
 
-  if (nslots > 1)
-    (*info->fprintf_func) (info->stream, "{ ");
+  op_name = (char *) xtensa_opcode_name (isa, opc);
+  (*info->fprintf_func) (info->stream, "%s", op_name);
 
-  first_slot = 1;
-  for (n = 0; n < nslots; n++)
-    {
-      if (first_slot)
-       first_slot = 0;
-      else
-       (*info->fprintf_func) (info->stream, "; ");
+  print_sr_name = (!strcasecmp (op_name, "wsr")
+                  || !strcasecmp (op_name, "xsr")
+                  || !strcasecmp (op_name, "rsr"));
 
-      xtensa_format_get_slot (isa, fmt, n, insn_buffer, slot_buffer);
-      opc = xtensa_opcode_decode (isa, fmt, n, slot_buffer);
-      (*info->fprintf_func) (info->stream, "%s",
-                            xtensa_opcode_name (isa, opc));
+  /* Print the operands (if any).  */
+  noperands = xtensa_num_operands (isa, opc);
+  if (noperands > 0)
+    {
+      int first = 1;
 
-      /* Print the operands (if any).  */
-      noperands = xtensa_opcode_num_operands (isa, opc);
-      first = 1;
+      (*info->fprintf_func) (info->stream, "\t");
       for (i = 0; i < noperands; i++)
        {
-         if (xtensa_operand_is_visible (isa, opc, i) == 0)
-           continue;
+         xtensa_operand opnd = xtensa_get_operand (isa, opc, i);
+
          if (first)
-           {
-             (*info->fprintf_func) (info->stream, "\t");
-             first = 0;
-           }
+           first = 0;
          else
            (*info->fprintf_func) (info->stream, ", ");
-         (void) xtensa_operand_get_field (isa, opc, i, fmt, n,
-                                          slot_buffer, &operand_val);
-
-         print_xtensa_operand (memaddr, info, opc, i, operand_val);
-       }
+         operand_val = xtensa_operand_get_field (opnd, insn_buffer);
+         print_xtensa_operand (memaddr, info, opnd, operand_val,
+                               print_sr_name);
+        }
     }
 
-  if (nslots > 1)
-    (*info->fprintf_func) (info->stream, " }");
-
   info->bytes_per_chunk = size;
   info->display_endian = info->endian;
 
index ba104bd57f1efc0bb0d1bb1548f1021f1829cb78..0099da089e5e88be0094df3024749a20e991538a 100644 (file)
@@ -1,7 +1,3 @@
-2004-10-07  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
-       * cgen-defs.h (ENDSWITCH): Changed to compile with gcc-3.4.2.
-
 2004-07-26  Andrew Cagney  <cagney@gnu.org>
 
        Problem from Olaf Hering <olh@suse.de>.
index cf9c0283c1a7d0a02f18881cf1873320af61923c..fbdfb9a279164478a5cc21157075b328fa7b9e7c 100644 (file)
@@ -130,7 +130,7 @@ typedef enum {
 #define CASE(N, X) case_##N##_##X
 #define BREAK(N) goto end_switch_##N
 #define DEFAULT(N) default_##N
-#define ENDSWITCH(N) end_switch_##N:;
+#define ENDSWITCH(N) end_switch_##N:
 #else
 #define SWITCH(N, X) switch (X)
 #define CASE(N, X) case X /* FIXME: old sem-switch had (@arch@_,X) here */
index ea4acfbfacecbd9fd8489a7cf14075f6056b1568..7cf731455497f4c4b2355a296bed2e568c99d35f 100644 (file)
@@ -1,8 +1,3 @@
-2004-09-24  Monika Chaddha  <monika@acmet.com>
-       
-       Committed by Andrew Cagney.
-       * m16.igen (CMP, CMPI): Fix assembler.
-
 2004-08-18  Chris Demetriou  <cgd@broadcom.com>
 
        * configure.in (mipsisa64sb1*-*-*): Add mips3d to sim_igen_machine.
index f87a863629bfe0789ffb940c87dfbf290b772ac5..833d7cae70ed80ca6866ffb971644409b9ee6cfc 100644 (file)
 
 
 11101,3.RX,3.RY,01010:RR:16::CMP
-"cmp r<TRX>, r<TRY>"
+"sltiu r<TRX>, r<TRY>"
 *mips16:
 *vr4100:
 {
 
 
 01110,3.RX,8.IMMED:RI:16::CMPI
-"cmpi r<TRX>, <IMMED>"
+"sltiu r<TRX>, <IMMED>"
 *mips16:
 *vr4100:
 {
index 066aa7568c9253bb4676edf5ba6b966b175feb3e..4d5567990d61efc79885c82b625f3694c38fad6f 100644 (file)
@@ -1,11 +1,3 @@
-2004-09-24  Ian Lance Taylor <ian@wasabisystems.com>
-
-       Committed by Andrew Cagney.
-       * configure.in: Check for sys/mount.h, sys/vfs.h, sys/statfs.h.
-       Check for struct statfs.
-       * emul_netbsd.c: If not HAVE_STRUCT_STATFS, #undef HAVE_FSTATFS.
-       * configure, config.in: Regenerate.
-
 2004-08-05  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * Makefile.in (GDB_INCLUDES): Remove bogus reference to mmalloc.
index 53f67e6e73aeaa87d74c04ea910b4c04411a1280..c53a833c01ccc30d2d4c9bd679371ce737fa571c 100644 (file)
 /* Define if you have the <sys/stat.h> header file.  */
 #undef HAVE_SYS_STAT_H
 
-/* Define if you have the <sys/statfs.h> header file.  */
-#undef HAVE_SYS_STATFS_H
-
 /* Define if you have the <sys/termio.h> header file.  */
 #undef HAVE_SYS_TERMIO_H
 
 /* Define if you have the <sys/types.h> header file.  */
 #undef HAVE_SYS_TYPES_H
 
-/* Define if you have the <sys/vfs.h> header file.  */
-#undef HAVE_SYS_VFS_H
-
 /* Define if you have the <time.h> header file.  */
 #undef HAVE_TIME_H
 
 
 /* Define if you have the <values.h> header file.  */
 #undef HAVE_VALUES_H
-
-/* Define if struct statfs is defined in <sys/mount.h> */
-#undef HAVE_STRUCT_STATFS
-
index c687e66e98eca32b87e8967a4b99b2c563b8641c..51f50c522dc578a078f9ee85c62a41fc480dec87 100755 (executable)
@@ -4294,7 +4294,7 @@ fi
 done
 
 
-for ac_hdr in fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h sys/vfs.h sys/statfs.h
+for ac_hdr in fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -4609,54 +4609,9 @@ else
   ac_cv_termio_cline=no
 fi
 
-echo $ac_n "checking for struct statfs""... $ac_c" 1>&6
-echo "configure:4614: checking for struct statfs" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_statfs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4619 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif
-int main() {
-static struct statfs s;
-; return 0; }
-EOF
-if { (eval echo configure:4638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_struct_statfs=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_statfs=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_statfs" 1>&6
-if test $ac_cv_struct_statfs = yes; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_STRUCT_STATFS 1
-EOF
-
-fi
-
 sim_devzero=""
 echo $ac_n "checking for /dev/zero""... $ac_c" 1>&6
-echo "configure:4660: checking for /dev/zero" >&5
+echo "configure:4615: checking for /dev/zero" >&5
 if eval "test \"`echo '$''{'ac_cv_devzero'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4664,7 +4619,7 @@ else
   ac_cv_devzero=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 4668 "configure"
+#line 4623 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
 main () {
@@ -4683,7 +4638,7 @@ main () {
   return 0;
 }
 EOF
-if { (eval echo configure:4687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_devzero=yes
 else
@@ -4705,7 +4660,7 @@ else
 fi
 
 echo $ac_n "checking for common simulator directory""... $ac_c" 1>&6
-echo "configure:4709: checking for common simulator directory" >&5
+echo "configure:4664: checking for common simulator directory" >&5
 if test -f "${srcdir}/../common/callback.c"; then
   echo "$ac_t""yes" 1>&6
   sim_callback="callback.o targ-map.o"
@@ -4717,7 +4672,7 @@ else
 fi
 
 echo $ac_n "checking for common simulator directory fpu implementation""... $ac_c" 1>&6
-echo "configure:4721: checking for common simulator directory fpu implementation" >&5
+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../common -I${srcdir}/../common"
@@ -4729,12 +4684,12 @@ else
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:4733: checking for Cygwin environment" >&5
+echo "configure:4688: 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 4738 "configure"
+#line 4693 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4745,7 +4700,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:4749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -4762,19 +4717,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4766: checking for mingw32 environment" >&5
+echo "configure:4721: 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 4771 "configure"
+#line 4726 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:4778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -4793,7 +4748,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4797: checking for executable suffix" >&5
+echo "configure:4752: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4803,7 +4758,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:4762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -4832,7 +4787,7 @@ AR=${AR-ar}
 # 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:4836: checking for $ac_word" >&5
+echo "configure:4791: 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
index 7884a411bf49118102f6a93212ebc6e358d69c8e..1f0693c25b60421f8bb98324f1420e4ae851d19f 100644 (file)
@@ -585,7 +585,7 @@ AC_TYPE_UID_T
 
 AC_CHECK_FUNCS(access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
 
-AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h sys/vfs.h sys/statfs.h)
+AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h)
 AC_HEADER_DIRENT
 
 dnl Figure out what type of termio/termios support there is
@@ -658,30 +658,6 @@ else
   ac_cv_termio_cline=no
 fi
 
-dnl Check for struct statfs
-AC_MSG_CHECKING(for struct statfs)
-AC_CACHE_VAL(ac_cv_struct_statfs,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif],
-[static struct statfs s;],
-ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
-AC_MSG_RESULT($ac_cv_struct_statfs)
-if test $ac_cv_struct_statfs = yes; then
-  AC_DEFINE(HAVE_STRUCT_STATFS, 1,
-           [Define if struct statfs is defined in <sys/mount.h>])
-fi
-
 dnl Figure out if /dev/zero exists or not
 sim_devzero=""
 AC_MSG_CHECKING(for /dev/zero)
index 18ca73befec62fb59c95d771b9faff59c0bac6e6..3ea03f635c41b8490fbcb974742a6785091d408c 100644 (file)
@@ -94,14 +94,6 @@ int getrusage();
 #include <sys/sysctl.h>
 #include <sys/mount.h>
 extern int getdirentries(int fd, char *buf, int nbytes, long *basep);
-
-/* NetBSD post 2.0 has the statfs system call (if COMPAT_20), but does
-   not have struct statfs.  In this case don't implement fstatfs.
-   FIXME: Should implement fstatvfs.  */
-#ifndef HAVE_STRUCT_STATFS
-#undef HAVE_FSTATFS
-#endif
-
 #else
 
 /* If this is not netbsd, don't allow fstatfs or getdirentries at this time */