Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <>2000-04-04 18:32:33 +0400
committercvs2svn <>2000-04-04 18:32:33 +0400
commit69b6206fef6dd986a554334b6519b0543cab4f5e (patch)
tree1092995ccf9aad86f4c3e43be94406c03d02a5cd
parent929ce68fe67a171b2e3ff506450ca893ed6532b3 (diff)
This commit was manufactured by cvs2svn to create branch 'binutils-
2_10-branch'. Sprout from cygnus 2000-02-22 16:18:13 UTC Ian Lance Taylor <iant@google.com> 'import libiberty from egcs' Cherrypick from master 2000-03-30 02:19:55 UTC Jason Merrill <jason@redhat.com> ' * configure.in: -linux-gnu*, not -linux-gnu.': ChangeLog Makefile.in config.guess config.sub config/ChangeLog config/mh-i370pic config/mt-aix43 config/mt-i370pic config/mt-wince configure configure.in include/ChangeLog include/ansidecl.h include/aout/ChangeLog include/aout/aout64.h include/bfdlink.h include/coff/ChangeLog include/coff/arm.h include/coff/internal.h include/coff/mcore.h include/coff/mipspe.h include/coff/pe.h include/coff/sh.h include/dis-asm.h include/elf/ChangeLog include/elf/arm-oabi.h include/elf/arm.h include/elf/avr.h include/elf/common.h include/elf/dwarf.h include/elf/dwarf2.h include/elf/hppa.h include/elf/i370.h include/elf/i386.h include/elf/i960.h include/elf/m32r.h include/elf/m68k.h include/elf/mcore.h include/elf/mips.h include/elf/mn10300.h include/elf/pj.h include/elf/reloc-macros.h include/elf/sh.h include/elf/sparc.h include/hashtab.h include/hp-symtab.h include/opcode/ChangeLog include/opcode/alpha.h include/opcode/cgen.h include/opcode/d10v.h include/opcode/d30v.h include/opcode/hppa.h include/opcode/i370.h include/opcode/i386.h include/opcode/m68k.h include/opcode/mips.h include/opcode/mn10300.h include/opcode/pj.h include/opcode/ppc.h include/partition.h include/remote-sim.h include/sim-d10v.h ltconfig ltmain.sh mkdep texinfo/texinfo.tex Cherrypick from master 2000-04-04 14:32:32 UTC Alan Modra <modra@gmail.com> 'Move translated part of bug report string back into .c files so': include/bin-bugs.h Delete: config/mh-aix43 configure.bat include/wait.h makeall.bat
-rw-r--r--ChangeLog177
-rw-r--r--Makefile.in91
-rwxr-xr-xconfig.guess515
-rwxr-xr-xconfig.sub368
-rw-r--r--config/ChangeLog14
-rw-r--r--config/mh-i370pic1
-rw-r--r--config/mt-aix43 (renamed from config/mh-aix43)0
-rw-r--r--config/mt-i370pic1
-rw-r--r--config/mt-wince10
-rwxr-xr-xconfigure40
-rw-r--r--configure.bat17
-rw-r--r--configure.in84
-rw-r--r--include/ChangeLog228
-rw-r--r--include/ansidecl.h1
-rw-r--r--include/aout/ChangeLog5
-rw-r--r--include/aout/aout64.h4
-rw-r--r--include/bfdlink.h14
-rw-r--r--include/bin-bugs.h3
-rw-r--r--include/coff/ChangeLog81
-rw-r--r--include/coff/arm.h125
-rw-r--r--include/coff/internal.h58
-rw-r--r--include/coff/mcore.h3
-rw-r--r--include/coff/mipspe.h223
-rw-r--r--include/coff/pe.h65
-rw-r--r--include/coff/sh.h38
-rw-r--r--include/dis-asm.h35
-rw-r--r--include/elf/ChangeLog251
-rw-r--r--include/elf/arm-oabi.h39
-rw-r--r--include/elf/arm.h25
-rw-r--r--include/elf/avr.h58
-rw-r--r--include/elf/common.h123
-rw-r--r--include/elf/dwarf.h5
-rw-r--r--include/elf/dwarf2.h1
-rw-r--r--include/elf/hppa.h341
-rw-r--r--include/elf/i370.h46
-rw-r--r--include/elf/i386.h2
-rw-r--r--include/elf/i960.h38
-rw-r--r--include/elf/m32r.h2
-rw-r--r--include/elf/m68k.h2
-rw-r--r--include/elf/mcore.h6
-rw-r--r--include/elf/mips.h48
-rw-r--r--include/elf/mn10300.h1
-rw-r--r--include/elf/pj.h45
-rw-r--r--include/elf/reloc-macros.h4
-rw-r--r--include/elf/sh.h27
-rw-r--r--include/elf/sparc.h25
-rw-r--r--include/hashtab.h109
-rw-r--r--include/hp-symtab.h11
-rw-r--r--include/opcode/ChangeLog304
-rw-r--r--include/opcode/alpha.h4
-rw-r--r--include/opcode/cgen.h21
-rw-r--r--include/opcode/d10v.h4
-rw-r--r--include/opcode/d30v.h83
-rw-r--r--include/opcode/hppa.h971
-rw-r--r--include/opcode/i370.h265
-rw-r--r--include/opcode/i386.h689
-rw-r--r--include/opcode/m68k.h33
-rw-r--r--include/opcode/mips.h26
-rw-r--r--include/opcode/mn10300.h23
-rw-r--r--include/opcode/pj.h46
-rw-r--r--include/opcode/ppc.h3
-rw-r--r--include/partition.h81
-rw-r--r--include/remote-sim.h52
-rw-r--r--include/sim-d10v.h103
-rw-r--r--include/wait.h63
-rwxr-xr-xltconfig816
-rw-r--r--ltmain.sh748
-rw-r--r--makeall.bat16
-rwxr-xr-xmkdep87
-rw-r--r--texinfo/texinfo.tex5431
70 files changed, 11235 insertions, 2044 deletions
diff --git a/ChangeLog b/ChangeLog
index 2604b21d5..78a812274 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,147 @@
+2000-03-29 Jason Merrill <jason@casey.cygnus.com>
+
+ * configure.in: -linux-gnu*, not -linux-gnu.
+
+2000-03-10 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.in (all-gcc): Backed out the last change.
+
+2000-03-10 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.in (all-gcc): Run ld/ld-new if necessary.
+
+Fri Mar 3 18:44:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (taz): Set PACKAGE to TOOL when not defined.
+ (do-tar-bz2): Replace TOOL with PACKAGE.
+ (gdb.tar.bz2): Remove GDBTK from GDB package.
+ (gdb+dejagnu.tar.bz2, insight.tar.bz2, insight+dejagnu.tar.bz2,
+ dejagnu.tar.bz2): New packages.
+
+2000-02-27 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Add entry for mips*-*-linux*, move catch all
+ *-*-*linux* entry below this one.
+
+2000-02-27 Ian Lance Taylor <ian@zembu.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.3.4.
+
+2000-02-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Support an OS of "wince".
+
+Thu Feb 24 16:15:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config.guess, config.sub: Updated to match config's 2000-02-15
+ version.
+
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * config.sub: Add support for Linux/IBM 370.
+ * configure.in: Likewise.
+
+2000-02-22 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Add mips-pe, sh-pe and arm-wince-pe targets.
+
+2000-02-20 Christopher Faylor <cgf@cygnus.com>
+
+ * config.guess: Guess "cygwin" rather than "cygwin32".
+
+2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure (gcc_version): When setting, narrow search to
+ lines containing `version_string'.
+
+2000-01-06 Geoff Keating <geoffk@cygnus.com>
+
+ * configure.in: Use mt-aix43 to handle *_TARGET defs,
+ not mh-aix43.
+
+1999-09-04 Steve Chamberlain <sac@pobox.com>
+
+ * config.sub: Add support for configuring for pj.
+
+1999-08-31 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub (maybe_os): Add support for configuring for fr30.
+
+1999-08-27 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Do not configure or build ld for AIX
+ platforms. ld is known to be broken on these platforms.
+
+1999-08-09 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in (LDFLAGS): Define.
+
+1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * configure.in (i[3456]-*-mingw32*): Don't put gprof in
+ noconfigdirs.
+ (*-*-cygwin*): Likewise.
+
+1999-08-08 Ian Lance Taylor <ian@zembu.com>
+
+ * mkdep: New file.
+ * Makefile.in (GAS_SUPPORT_DIRS): Add mkdep.
+ (BINUTILS_SUPPORT_DIRS): Add mkdep.
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * configure (tmpfile): Change cONf$$ to cNf$$ to avoid an overly
+ long file name when using DJGPP on MS-DOS.
+
+1999-07-30 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * Makefile.in (check-target-libio): Remove all-target-libstdc++
+ dependency as this causes "make check" to globally "make all"
+
+1999-07-22 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in (binutils.tar.bz2): Don't pass makeall.bat and
+ configure.bat in SUPPORT_FILES.
+ (gas+binutils.tar.bz2): Likewise.
+
+ * makeall.bat: Remove; obsolete.
+
+1999-07-21 Ian Lance Taylor <ian@zembu.com>
+
+ From Mark Elbrecht:
+ * configure.bat: Remove; obsolete.
+
+1999-07-11 Ian Lance Taylor <ian@zembu.com>
+
+ * configure: Add -W -Wall to the default CFLAGS when compiling with
+ gcc.
+
+Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * configure.in: Build ld, binutils & gas for hppa*-*-linux-gnu*.
+
+1999-06-30 Mark Mitchell <mark@codesourcery.com>
+
+ * configure.in: Build ld on IRIX6.
+
+1999-06-12 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in: Change distribution targets to use bzip2 instead of
+ gzip.
+ (TEXINFO_SUPPORT): Set to just texinfo/texinfo.tex.
+ (taz): Don't use texinfo/gpl.texinfo or texinfo/lgpl.texinfo.
+
+1999-06-04 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Add mcore target.
+
+Sun May 30 16:03:16 1999 Cort Dougan <cort@cs.nmt.edu>
+
+ * config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux.
+
+1999-05-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Updated to match latest EGCS version.
+
1999-04-30 Tom Tromey <tromey@cygnus.com>
* ltmain.sh: [mode link] Always use CC given by ltconfig.
@@ -131,7 +275,7 @@ Wed Feb 17 01:38:59 1999 H.J. Lu (hjl@gnu.org)
Patch from: Scott Bambrough <scottb@corelcomputer.com>
- * config.guess: Modified to recognize uname's armv* syntax.
+ * config.guess: Modified to recognize uname's armv* syntax.
* config.sub: Modified to recognize uname's armv* syntax.
@@ -653,6 +797,11 @@ Tue May 5 18:02:24 1998 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (EXTRA_GCC_FLAGS): Remove backslash at end;
Solaris `make' causes it to continue to next definition.
+Tue Apr 28 16:24:24 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (install-gdbtk): Call this 'install-gdb' so that
+ the right GUI libraries and files are installed along with GDB.
+
Tue Apr 28 18:11:24 1998 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Change alpha to alpha* in several places.
@@ -754,6 +903,10 @@ Thu Mar 26 12:53:20 1998 Tom Tromey <tromey@cygnus.com>
(noconfigdirs) [various cases]: Likewise.
(host_libs): Added intl.
+Thu Mar 26 15:00:11 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * configure: Do not disable building gdbtk for cygwin32 hosts.
+
Wed Mar 25 11:49:12 1998 Jason Molenda (crash@bugshack.cygnus.com)
* Makefile.in: Revert yesterday's change.
@@ -1202,6 +1355,11 @@ Thu Sep 18 21:43:23 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
(all-bootstrap): Remove outdated and confusing target.
(bootstrap, bootstrap2, bootstrap3): Don't pass BOOT_CFLAGS down.
+Thu Sep 18 15:37:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure (tooldir): enable_gdbtk=YES for cygwin32, NO for
+ windows. Consistent with gdb/configure.
+
1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
@@ -2295,6 +2453,7 @@ Mon Jun 17 16:34:46 1996 Jason Merrill <jason@yorick.cygnus.com>
Sat Jun 15 17:13:25 1996 Geoffrey Noer <noer@cygnus.com>
+ * configure: enable_gdbtk=no for cygwin32-hosted toolchains
* configure.in: remove make from disable-if-Can-Cross list
enable gdb if ${host} and ${target} are cygwin32
@@ -2687,6 +2846,12 @@ Fri Jan 12 15:25:35 1996 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Make sure that ${CC} can be used to compile an
executable.
+Sat Jan 6 07:23:33 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * Makefile.in (all-gdb): Depend on $(GDB_TK).
+ * configure (GDB_TK): Set GDB_TK to either "all-tcl all-tk" or
+ nothing depending on whether gdbtk is being built.
+
Wed Jan 3 17:54:41 1996 Doug Evans <dje@canuck.cygnus.com>
* Makefile.in (newlib.tar.gz): Delete building of newlib's info files.
@@ -3284,6 +3449,11 @@ Mon Aug 7 09:21:35 1995 Doug Evans <dje@canuck.cygnus.com>
* configure.in (i386-go32 host): Fix typo (deja-gnu -> dejagnu).
(i386-win32 host): Likewise. Don't build readline.
+Sat Aug 5 09:51:49 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * Makefile.in (GDBTK_SUPPORT_DIRS): Define and pass as part of
+ SUPPORT_FILES to submakes.
+
Fri Aug 4 13:04:36 1995 Fred Fish <fnf@cygnus.com>
* Makefile.in (GDB_SUPPORT_DIRS): Add utils.
@@ -3462,6 +3632,11 @@ Tue Apr 11 18:55:40 1995 Doug Evans <dje@canuck.cygnus.com>
* configure.in: Recognize --with-newlib.
(sparc-*-sunos4*): Build sim, dejagnu, expect, tcl if cross target.
+Mon Apr 10 14:38:20 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in: move {all,check,install}-gdb from *_MODULES
+ to *_X11_MODULES due to gdbtk needing X include files et al.
+
Mon Apr 10 11:42:22 1995 Stan Shebs <shebs@andros.cygnus.com>
Merge in support for Mac MPW as a host.
diff --git a/Makefile.in b/Makefile.in
index 7f1bb8c2b..beab8be4f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -84,6 +84,7 @@ HOST_PREFIX_1 = loser-
CFLAGS = -g
CXXFLAGS = -g -O2
+LDFLAGS =
LIBCFLAGS = $(CFLAGS)
CFLAGS_FOR_TARGET = $(CFLAGS)
LDFLAGS_FOR_TARGET =
@@ -109,8 +110,7 @@ NM = nm
LD = ld
-# Not plain GZIP, since gzip looks there for extra command-line options.
-GZIPPROG = gzip
+BZIPPROG = bzip2
# These values are substituted by configure.
DEFAULT_YACC = yacc
@@ -1584,7 +1584,7 @@ configure-target-libgloss: $(ALL_GCC)
all-target-libgloss: configure-target-libgloss configure-target-newlib
configure-target-libio: $(ALL_GCC)
all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
-check-target-libio: all-target-libstdc++
+check-target-libio:
all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
all-libiberty:
configure-target-librx: $(ALL_GCC) configure-target-newlib
@@ -1632,6 +1632,7 @@ configure-target-libiberty: $(ALL_GCC)
all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
all-target: $(ALL_TARGET_MODULES)
install-target: $(INSTALL_TARGET_MODULES)
+install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
### other supporting targets
MAKEDIRS= \
@@ -1691,8 +1692,7 @@ SUPPORT_FILES = list-of-support-files-for-tool-in-question
.PHONY: taz
-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
- texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
# Take out texinfo from a few places.
sed -e '/^all\.normal: /s/\all-texinfo //' \
-e '/^ install-texinfo /d' \
@@ -1737,8 +1737,6 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
#
mkdir proto-toplev/texinfo
ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
- ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
- ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
if test -r texinfo/util/tex3patch ; then \
mkdir proto-toplev/texinfo/util && \
ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
@@ -1749,55 +1747,84 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
else \
ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
fi; \
- $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
+ if test x"$(PACKAGE)" = x; then \
+ package="$(TOOL)"; \
+ else \
+ package="$(PACKAGE)"; \
+ fi; \
+ $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver PACKAGE=$$package
-do-tar-gz:
- echo "==> Making $(TOOL)-$(VER).tar.gz"
- -rm -f $(TOOL)-$(VER)
- ln -s proto-toplev $(TOOL)-$(VER)
- tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
- $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
+do-tar-bz2:
+ echo "==> Making $(PACKAGE)-$(VER).tar.bz2"
+ -rm -f $(PACKAGE)-$(VER)
+ ln -s proto-toplev $(PACKAGE)-$(VER)
+ tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER)
+ $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
-TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+TEXINFO_SUPPORT= texinfo/texinfo.tex
DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
-.PHONY: gas.tar.gz
-GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms
-gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
+.PHONY: gas.tar.bz2
+GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
+gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
$(MAKE) -f Makefile.in taz TOOL=gas \
SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
# The FSF "binutils" release includes gprof and ld.
-.PHONY: binutils.tar.gz
-BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms
-binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
+.PHONY: binutils.tar.bz2
+BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
+binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
$(MAKE) -f Makefile.in taz TOOL=binutils \
- SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
+ SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
-.PHONY: gas+binutils.tar.gz
+.PHONY: gas+binutils.tar.bz2
GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
-gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
+gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
$(MAKE) -f Makefile.in taz TOOL=gas \
- SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
+ SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
-.PHONY: libg++.tar.gz
+.PHONY: libg++.tar.bz2
LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
-libg++.tar.gz: $(DIST_SUPPORT) libg++
+libg++.tar.bz2: $(DIST_SUPPORT) libg++
$(MAKE) -f Makefile.in taz TOOL=libg++ \
SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
GNATS_SUPPORT_DIRS=include libiberty send-pr
-gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
+gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
$(MAKE) -f Makefile.in taz TOOL=gnats \
SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
-.PHONY: gdb.tar.gz
+.PHONY: gdb.tar.bz2
GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
-gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
$(MAKE) -f Makefile.in taz TOOL=gdb \
SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
-.PHONY: newlib.tar.gz
+.PHONY: dejagnu.tar.bz2
+DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
+dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
+ $(MAKE) -f Makefile.in taz TOOL=dejagnu \
+ SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
+
+.PHONY: gdb+dejagnu.tar.bz2
+GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
+gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=gdb+dejagnu \
+ SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
+
+.PHONY: insight.tar.bz2
+INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
+insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=insight \
+ SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
+
+.PHONY: insight+dejagnu.tar.bz2
+INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
+insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE="insight+dejagnu" \
+ SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
+
+.PHONY: newlib.tar.bz2
NEWLIB_SUPPORT_DIRS=libgloss
# taz configures for the sun4 target which won't configure newlib.
# We need newlib configured so that the .info files are made.
@@ -1810,7 +1837,7 @@ NEWLIB_SUPPORT_DIRS=libgloss
# the make distclean. For now punt on the issue of shipping newlib info files
# with newlib net releases and wait for a day when some native target (sun4?)
# supports newlib (if only minimally).
-newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
+newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
$(MAKE) -f Makefile.in taz TOOL=newlib \
SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
diff --git a/config.guess b/config.guess
index 3c75a80de..20c971aae 100755
--- a/config.guess
+++ b/config.guess
@@ -1,6 +1,7 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
#
# 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
@@ -22,7 +23,7 @@
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Please send patches to <config-patches@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -35,6 +36,20 @@
# (but try to keep the structure clean).
#
+# Use $HOST_CC if defined. $CC may point to a cross-compiler
+if test x"$CC_FOR_BUILD" = x; then
+ if test x"$HOST_CC" != x; then
+ CC_FOR_BUILD="$HOST_CC"
+ else
+ if test x"$CC" != x; then
+ CC_FOR_BUILD="$CC"
+ else
+ CC_FOR_BUILD=cc
+ fi
+ fi
+fi
+
+
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,11 +61,49 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # Netbsd (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ # Determine the machine/vendor (is the vendor relevant).
+ case "${UNAME_MACHINE}" in
+ amiga) machine=m68k-cbm ;;
+ arm32) machine=arm-unknown ;;
+ atari*) machine=m68k-atari ;;
+ sun3*) machine=m68k-sun ;;
+ mac68k) machine=m68k-apple ;;
+ macppc) machine=powerpc-apple ;;
+ hp3[0-9][05]) machine=m68k-hp ;;
+ ibmrt|romp-ibm) machine=romp-ibm ;;
+ *) machine=${UNAME_MACHINE}-unknown ;;
+ esac
+ # The Operating System including object format.
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ # The OS release
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -59,56 +112,69 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- cat <<EOF >dummy.s
+ cat <<EOF >$dummy.s
+ .data
+\$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
.globl main
+ .align 4
.ent main
main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
.end main
EOF
- ${CC-cc} dummy.s -o dummy 2>/dev/null
+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
+ case `./$dummy` in
+ 0-0)
UNAME_MACHINE="alpha"
;;
- 15)
+ 1-0)
UNAME_MACHINE="alphaev5"
;;
- 14)
+ 1-1)
UNAME_MACHINE="alphaev56"
;;
- 10)
+ 1-101)
UNAME_MACHINE="alphapca56"
;;
- 16)
+ 2-303)
UNAME_MACHINE="alphaev6"
;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
esac
fi
- rm -f dummy.s dummy
+ rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -133,16 +199,16 @@ EOF
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
- arm32:NetBSD:*:*)
- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -150,7 +216,7 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
- NILE:*:*:dcosx)
+ NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
@@ -195,21 +261,38 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -231,12 +314,17 @@ EOF
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
- 2020:CLIX:*:*)
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >dummy.c
- int main (argc, argv) int argc; char **argv; {
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -251,10 +339,10 @@ EOF
exit (-1);
}
EOF
- ${CC-cc} dummy.c -o dummy \
- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy \
+ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
@@ -272,15 +360,18 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
echo m88k-dg-dgux${UNAME_RELEASE}
- else
+ else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
fi
- else echo i586-dg-dgux${UNAME_RELEASE}
- fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
@@ -306,7 +397,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
+ sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
@@ -317,8 +408,8 @@ EOF
exit(0);
}
EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -327,7 +418,8 @@ EOF
fi
exit 0 ;;
*:AIX:*:4)
- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -345,7 +437,7 @@ EOF
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
@@ -360,33 +452,29 @@ EOF
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
- *9??*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
9000/[34678]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9] )
-
- sed 's/^ //' << EOF >dummy.c
+ 9000/[678][0-9][0-9])
+ sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h>
#include <unistd.h>
-
+
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
- #endif
+ #endif
long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
+
+ switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
+ case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
- switch (bits)
+ switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
@@ -394,20 +482,20 @@ EOF
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
- #endif
+ #endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
- (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
- rm -f dummy.c dummy
+ (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+ rm -f $dummy.c $dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
+ sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
@@ -432,8 +520,8 @@ EOF
exit (0);
}
EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +530,9 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
+ *9??*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
@@ -491,7 +582,13 @@ EOF
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
@@ -504,15 +601,18 @@ EOF
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- i?86:BSD/386:*:* | *:BSD/OS:*:*)
+ i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
@@ -520,32 +620,28 @@ EOF
exit 0
fi
fi
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
- i*:[Cc][Yy][Gg][Ww][Ii][Nn]*:*)
- echo ${UNAME_MACHINE}-pc-cygwin32
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than generic posix subsystem?
+ # How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # change UNAME_MACHINE based on the output of uname instead of
- # i386?
+ # UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin32
+ echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -554,16 +650,11 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
- arm* | sa110*) UNAME_MACHINE="arm" ;;
- esac
# The BFD linker knows what the default object file format is, so
- # first see if it will tell us.
- ld_help_string=`ld --help 2>&1`
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
@@ -571,14 +662,41 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc)
+ *ia64)
+ echo "${UNAME_MACHINE}-unknown-linux"
+ exit 0
+ ;;
+ i?86linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0
+ ;;
+ i?86coff)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0
+ ;;
+ sparclinux)
+ echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+ exit 0
+ ;;
+ armlinux)
+ echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+ exit 0
+ ;;
+ elf32arm*)
+ echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
+ exit 0
+ ;;
+ armelf_linux*)
+ echo "${UNAME_MACHINE}-unknown-linux-gnu"
+ exit 0
+ ;;
+ m68klinux)
+ echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+ exit 0
+ ;;
+ elf32ppc | elf32ppclinux)
# Determine Lib Version
- cat >dummy.c <<EOF
+ cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@@ -597,71 +715,85 @@ main(argc, argv)
}
EOF
LIBC=""
- ${CC-cc} dummy.c -o dummy 2>/dev/null
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./dummy | grep 1\.99 > /dev/null
+ ./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
- rm -f dummy.c dummy
- echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
+ rm -f $dummy.c $dummy
+ echo powerpc-unknown-linux-gnu${LIBC}
+ exit 0
+ ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
+ cat <<EOF >$dummy.s
+ .data
+ \$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
+ .globl main
+ .align 4
+ .ent main
+ main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
EOF
LIBC=""
- ${CC-cc} dummy.s -o dummy 2>/dev/null
+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
+ case `./$dummy` in
+ 0-0)
UNAME_MACHINE="alpha"
;;
- 15)
+ 1-0)
UNAME_MACHINE="alphaev5"
;;
- 14)
+ 1-1)
UNAME_MACHINE="alphaev56"
;;
- 10)
+ 1-101)
UNAME_MACHINE="alphapca56"
;;
- 16)
+ 2-303)
UNAME_MACHINE="alphaev6"
;;
- esac
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
+ esac
- objdump --private-headers dummy | \
+ objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
- fi
- rm -f dummy.s dummy
+ fi
+ rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >dummy.c <<EOF
-main(argc, argv)
- int argc;
- char *argv[];
-{
+ cat >$dummy.c <<EOF
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
@@ -671,8 +803,10 @@ main(argc, argv)
return 0;
}
EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ elif test "${UNAME_MACHINE}" = "s390"; then
+ echo s390-ibm-linux && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -691,12 +825,14 @@ EOF
;;
esac
# Determine whether the default compiler is a.out or elf
- cat >dummy.c <<EOF
+ cat >$dummy.c <<EOF
#include <features.h>
-main(argc, argv)
- int argc;
- char *argv[];
-{
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
@@ -713,8 +849,8 @@ main(argc, argv)
return 0;
}
EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
@@ -730,24 +866,22 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i?86:*:5:7*)
+ # Fixed at (any) Pentium or better
+ UNAME_MACHINE=i586
+ if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
+ echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
- i?86:*:5:7)
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
-# 5.0.4c returns "Pent II". 5.0.5 returns PentII
- (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
- exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -757,18 +891,20 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*PentII' >/dev/null) \
+ (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pent II' >/dev/null) \
+ (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
+ i?86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
pc:*:*:*)
+ # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
@@ -809,7 +945,7 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i?86:LynxOS:2.*:*)
+ i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
@@ -821,6 +957,9 @@ EOF
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
@@ -851,7 +990,7 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
@@ -867,12 +1006,33 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Mac*OS:*:*)
+ echo powerpc-apple-macos${UNAME_RELEASE}
+ exit 0 ;;
+ *:Mac*OS:*:*)
+ echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-qnx-qnx${UNAME_VERSION}
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-cat >dummy.c <<EOF
+cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -910,7 +1070,10 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -970,8 +1133,8 @@ main ()
}
EOF
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
diff --git a/config.sub b/config.sub
index 3d4f5fd21..5d7562404 100755
--- a/config.sub
+++ b/config.sub
@@ -1,6 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+#
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -25,6 +27,9 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+# Written by Per Bothner <bothner@cygnus.com>.
+# Please send patches to <config-patches@gnu.org>.
+#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
@@ -64,18 +69,6 @@ case $1 in
;;
esac
-# CYGNUS LOCAL marketing-names
-# Here we handle any "marketing" names - translating them to
-# standard triplets
-case $1 in
- mips-tx39-elf)
- set mipstx39-unknown-elf
- ;;
- *)
- ;;
-esac
-# END CYGNUS LOCAL marketing-names
-
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
@@ -110,14 +103,14 @@ case $os in
os=
basic_machine=$1
;;
- -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL
+ -sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
- -scout) # EGCS LOCAL
+ -scout)
;;
- -wrs) # EGCS LOCAL
- os=vxworks
+ -wrs)
+ os=-vxworks
basic_machine=$1
;;
-hiux*)
@@ -168,74 +161,34 @@ case $os in
-psos*)
os=-psos
;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 \
- | tron | a29k | 580 | i960 | h8300 \
+ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+ | 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | alpha | alphaev[45678] | alphaev56 | alphapca5[67] \
+ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
+ | alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | sparc86x | v850 \
- | c4x)
- basic_machine=$basic_machine-unknown
- ;;
- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
- | h8500 | w65 | fr30 | mcore) # CYGNUS / EGCS LOCAL
- basic_machine=$basic_machine-unknown
- ;;
- strongarm) # CYGNUS LOCAL nickc/strongarm
- basic_machine=$basic_machine-unknown
- ;;
- thumb)
- basic_machine=$basic_machine-unknown
- ;;
- # CYGNUS LOCAL vr4111/gavin
- mips64vr4111 | mips64vr4111el)
- basic_machine=$basic_machine-unknown
- ;;
- # END CYGNUS LOCAL vr4111/gavin
- mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
- basic_machine=$basic_machine-unknown
- ;;
- mips16)
+ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+ | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+ | mips64vr5000 | miprs64vr5000el | mcore \
+ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
+ | thumb | d10v | fr30 | avr)
basic_machine=$basic_machine-unknown
;;
- tic30) # CYGNUS LOCAL ian/tic30
- basic_machine=$basic_machine-unknown
- ;;
- c30) # CYGNUS LOCAL ian/tic30
- basic_machine=tic30-unknown
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
;;
- tic80) # CYGNUS LOCAL fnf/TIc80
- basic_machine=$basic_machine-unknown
- ;;
- v850e) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- v850ea) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- d10v)
- basic_machine=$basic_machine-unknown
- ;;
- d30v) # CYGNUS LOCAL hunt/d30v
- basic_machine=$basic_machine-unknown
- ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -248,57 +201,29 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+ # FIXME: clean up the formatting here.
+ vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* \
- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
- | alpha-* | alphaev[45678]-* | alphaev56-* | alphapca5[67]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
- | xps100-* | clipper-* | orion-* \
+ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+ | alphaev6[78]-* \
+ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+ | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mipstx39-* | mipstx39el-* \
- | f301-* | arm*-* \
- | fr30-* | mcore-*) # CYGNUS LOCAL
- ;;
- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
- ;;
- strongarm-*) # CYGNUS LOCAL nickc/strongarm
- ;;
- thumb-*) # EGCS LOCAL angela/thumb
- ;;
- v850-*) # EGCS LOCAL
- ;;
- v850e-*) # CYGNUS LOCAL
- ;;
- v850ea-*) # CYGNUS LOCAL
- ;;
- d30v-*) # EGCS LOCAL
- ;;
- # CYGNUS LOCAL vr4111/gavin
- mips64vr4111-* | mips64vr4111el-*)
- ;;
- # END CYGNUS LOCAL vr4111/gavin
- mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
- ;;
- mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
- ;;
- mips16-*) # EGCS LOCAL krk/mips16
- ;;
- tic30-*) # EGCS LOCAL ian/tic30
- ;;
- c30-*) # EGCS LOCAL ian/tic30
- basic_machine=tic30-unknown
- ;;
- tic80-*) # CYGNUS LOCAL fnf/TIc80
+ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+ | mipstx39-* | mipstx39el-* | mcore-* \
+ | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
+ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd) # EGCS LOCAL
+ 386bsd)
basic_machine=i386-unknown
os=-bsd
;;
@@ -308,11 +233,11 @@ case $basic_machine in
3b*)
basic_machine=we32k-att
;;
- a29khif) # EGCS LOCAL
+ a29khif)
basic_machine=a29k-amd
os=-udi
;;
- adobe68k) # EGCS LOCAL
+ adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
@@ -345,7 +270,7 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
- apollo68bsd) # EGCS LOCAL
+ apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
@@ -425,7 +350,7 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
- es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL
+ es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
@@ -447,11 +372,11 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
- h8300xray) # EGCS LOCAL
+ h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
- h8500hms) # EGCS LOCAL
+ h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
@@ -470,22 +395,6 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
- w89k-*) # EGCS LOCAL
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- op50n-*) # EGCS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- op60c-*) # EGCS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- hppro) # EGCS LOCAL
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
@@ -495,22 +404,21 @@ case $basic_machine in
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
- hp9k78[0-9] | hp78[0-9] )
+ hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[0-9][13679] | hp8[0-9][13679] )
+ hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -519,13 +427,16 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
- hppaosf) # EGCS LOCAL
+ hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
- os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
@@ -544,15 +455,15 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
- i386mach) # EGCS LOCAL
+ i386mach)
basic_machine=i386-mach
os=-mach
;;
- i386-vsta | vsta) # EGCS LOCAL
+ i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
- i386-go32 | go32) # EGCS LOCAL
+ i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
@@ -560,6 +471,9 @@ case $basic_machine in
basic_machine=i386-unknown
os=-mingw32
;;
+ i386-qnx | qnx)
+ basic_machine=i386-qnx
+ ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -588,6 +502,10 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
@@ -602,24 +520,32 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- monitor) # EGCS LOCAL
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
basic_machine=m68k-rom68k
os=-coff
;;
- msdos) # EGCS LOCAL
- basic_machine=i386-unknown
+ msdos)
+ basic_machine=i386-unknown
os=-msdos
;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
- basic_machine=i386-unknown # EGCS LOCAL
+ basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
- basic_machine=armv4l-corel
+ basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
@@ -634,7 +560,7 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
- necv70) # EGCS LOCAL
+ necv70)
basic_machine=v70-nec
os=-sysv
;;
@@ -663,18 +589,22 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
- mon960) # EGCS LOCAL
+ mon960)
basic_machine=i960-intel
os=-mon960
;;
np1)
basic_machine=np1-gould
;;
- OSE68000 | ose68000) # EGCS LOCAL
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
- os68k) # EGCS LOCAL
+ os68k)
basic_machine=m68k-none
os=-os68k
;;
@@ -695,19 +625,19 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | nexen)
+ pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
- pentiumpro | p6 | k6 | 6x86)
+ pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
- pentium-* | p5-* | k5-* | nexen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | k6-* | 6x86-*)
+ pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -731,7 +661,7 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
- rom68k) # EGCS LOCAL
+ rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
@@ -741,7 +671,7 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
- sa29200) # EGCS LOCAL
+ sa29200)
basic_machine=a29k-amd
os=-udi
;;
@@ -752,7 +682,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs) # EGCS LOCAL
+ sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -763,10 +693,10 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
- st2000) # EGCS LOCAL
+ st2000)
basic_machine=m68k-tandem
;;
- stratus) # EGCS LOCAL
+ stratus)
basic_machine=i860-stratus
os=-sysv4
;;
@@ -810,10 +740,18 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
+ t3e)
+ basic_machine=t3e-cray
+ os=-unicos
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -831,7 +769,7 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
- v810 | necv810) # EGCS LOCAL
+ v810 | necv810)
basic_machine=v810-nec
os=-none
;;
@@ -858,9 +796,13 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
- w65*) # EGCS LOCAL
- basic_machine=w65-wdc
- os=-none
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
;;
xmp)
basic_machine=xmp-cray
@@ -869,7 +811,7 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
- z8k-*-coff) # EGCS LOCAL
+ z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
@@ -880,13 +822,13 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
- w89k) # EGCS LOCAL
+ w89k)
basic_machine=hppa1.1-winbond
;;
- op50n) # EGCS LOCAL
+ op50n)
basic_machine=hppa1.1-oki
;;
- op60c) # EGCS LOCAL
+ op60c)
basic_machine=hppa1.1-oki
;;
mips)
@@ -923,16 +865,16 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
- mac | mpw | mac-mpw) # EGCS LOCAL
+ mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
- pmac | pmac-mpw) # EGCS LOCAL
+ pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
+ c4x*)
+ basic_machine=c4x-none
+ os=-coff
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -991,18 +933,16 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* )
+ | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
- # EGCS LOCAL
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
- # END EGCS LOCAL
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1012,6 +952,12 @@ case $os in
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
-osfrose*)
os=-osfrose
;;
@@ -1027,7 +973,7 @@ case $os in
-acis*)
os=-aos
;;
- -386bsd) # EGCS LOCAL
+ -386bsd)
os=-bsd
;;
-ctix* | -uts*)
@@ -1049,6 +995,9 @@ case $os in
-oss*)
os=-sysv3
;;
+ -qnx)
+ os=-qnx4
+ ;;
-svr4)
os=-sysv4
;;
@@ -1061,15 +1010,18 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
- -ose*) # EGCS LOCAL
+ -ose*)
os=-ose
;;
- -es1800*) # EGCS LOCAL
+ -es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
+ -*mint | -*MiNT)
+ os=-mint
+ ;;
-none)
;;
*)
@@ -1095,7 +1047,7 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
- arm*-corel)
+ arm*-rebel)
os=-linux
;;
arm*-semi)
@@ -1119,15 +1071,15 @@ case $basic_machine in
# default.
# os=-sunos4
;;
- m68*-cisco) # EGCS LOCAL
+ m68*-cisco)
os=-aout
;;
- mips*-cisco) # EGCS LOCAL
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
os=-elf
;;
- mips*-*) # EGCS LOCAL
- os=-elf
- ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1140,13 +1092,13 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-wec) # EGCS LOCAL
+ *-wec)
os=-proelf
;;
- *-winbond) # EGCS LOCAL
+ *-winbond)
os=-proelf
;;
- *-oki) # EGCS LOCAL
+ *-oki)
os=-proelf
;;
*-hp)
@@ -1212,15 +1164,18 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
- *-rom68k) # EGCS LOCAL
+ *-rom68k)
os=-coff
;;
- *-*bug) # EGCS LOCAL
+ *-*bug)
os=-coff
;;
- *-apple) # EGCS LOCAL
+ *-apple)
os=-macos
;;
+ *-atari*)
+ os=-mint
+ ;;
*)
os=-none
;;
@@ -1266,7 +1221,7 @@ case $basic_machine in
-genix*)
vendor=ns
;;
- -mvs*)
+ -mvs* | -opened*)
vendor=ibm
;;
-ptx*)
@@ -1278,12 +1233,15 @@ case $basic_machine in
-aux*)
vendor=apple
;;
- -hms*) # EGCS LOCAL
+ -hms*)
vendor=hitachi
;;
- -mpw* | -macos*) # EGCS LOCAL
+ -mpw* | -macos*)
vendor=apple
;;
+ -*mint | -*MiNT)
+ vendor=atari
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
diff --git a/config/ChangeLog b/config/ChangeLog
index 7d6fc6093..b5746b102 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,17 @@
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * mh-i370pic: New file.
+ * mt-i370pic: New file.
+
+2000-02-22 Nick Clifton <nickc@cygnus.com>
+
+ * config/mt-wince: new file: Makefile fragment for WinCE targets.
+
+2000-01-06 Geoff Keating <geoffk@cygnus.com>
+
+ * mh-aix43: Delete, move to mt-aix43.
+ * mt-aix43: New file.
+
1999-04-07 Michael Meissner <meissner@cygnus.com>
* mt-d30v: New file, pass -g -Os -Wa,-C as default options.
diff --git a/config/mh-i370pic b/config/mh-i370pic
new file mode 100644
index 000000000..35cf2c8ee
--- /dev/null
+++ b/config/mh-i370pic
@@ -0,0 +1 @@
+PICFLAG=-fPIC
diff --git a/config/mh-aix43 b/config/mt-aix43
index 9eb750c29..9eb750c29 100644
--- a/config/mh-aix43
+++ b/config/mt-aix43
diff --git a/config/mt-i370pic b/config/mt-i370pic
new file mode 100644
index 000000000..35b8c9e4d
--- /dev/null
+++ b/config/mt-i370pic
@@ -0,0 +1 @@
+PICFLAG_FOR_TARGET=-fPIC
diff --git a/config/mt-wince b/config/mt-wince
new file mode 100644
index 000000000..cc7d67b58
--- /dev/null
+++ b/config/mt-wince
@@ -0,0 +1,10 @@
+# For Windows CE, we need to build the program that converts, copies,
+# and renames the platform SDK files into gcc directories.
+
+EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils
+EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils
+
+all-utils : all-libiberty
+
+install-utils : all-libiberty
+
diff --git a/configure b/configure
index cad60b77c..c5f029134 100755
--- a/configure
+++ b/configure
@@ -3,7 +3,7 @@
### WARNING: this file contains embedded tabs. Do not run untabify on this file.
# Configuration script
-# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 1997
+# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -587,12 +587,12 @@ esac
# the gcc version number changes.
if [ "${with_gcc_version_trigger+set}" = set ]; then
gcc_version_trigger="$with_gcc_version_trigger"
- gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${with_gcc_version_trigger}`
+ gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
else
# If gcc's sources are available, define the trigger file.
if [ -f ${topsrcdir}/gcc/version.c ] ; then
gcc_version_trigger=${topsrcdir}/gcc/version.c
- gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
+ gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
case "$arguments" in
*--with-gcc-version-trigger=$gcc_version_trigger* )
;;
@@ -655,8 +655,8 @@ case "${TMPDIR}" in
*) ;;
esac
-# keep this filename short for &%*%$*# 14 char file names
-tmpfile=${TMPDIR}/cONf$$
+# keep this filename short for &%*%$*# 14 char file names and 8+3 file names
+tmpfile=${TMPDIR}/cNf$$
# Note that under many versions of sh a trap handler for 0 will *override* any
# exit status you explicitly specify! At this point, the only non-error exit
# is at the end of the script; these actions are duplicated there, minus
@@ -902,6 +902,9 @@ do
test -n "$DEFAULT_LEX" && break
done
+# BINUTILS LOCAL: This is included in the default CFLAGS when using gcc.
+warn_cflags="-W -Wall"
+
if [ "${build}" != "${host}" ]; then
# If we are doing a Canadian Cross, in which the host and build systems
# are not the same, we set reasonable default values for the tools.
@@ -935,7 +938,7 @@ t loop
AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
BISON=${BISON-bison}
CC=${CC-${host_alias}-gcc}
- CFLAGS=${CFLAGS-"-g -O2"}
+ CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
CXX=${CXX-${host_alias}-c++}
CXXFLAGS=${CXXFLAGS-"-g -O2"}
CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
@@ -1015,10 +1018,10 @@ else
CC="gcc"
echo 'void f(){}' > conftest.c
if test -z "`${CC} -g -c conftest.c 2>&1`"; then
- CFLAGS=${CFLAGS-"-g -O2"}
+ CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
CXXFLAGS=${CXXFLAGS-"-g -O2"}
else
- CFLAGS=${CFLAGS-"-O2"}
+ CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"}
CXXFLAGS=${CXXFLAGS-"-O2"}
fi
rm -f conftest*
@@ -1035,10 +1038,10 @@ else
*gcc)
echo 'void f(){}' > conftest.c
if test -z "`${CC} -g -c conftest.c 2>&1`"; then
- CFLAGS=${CFLAGS-"-g -O2"}
+ CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"}
CXXFLAGS=${CXXFLAGS-"-g -O2"}
else
- CFLAGS=${CFLAGS-"-O2"}
+ CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"}
CXXFLAGS=${CXXFLAGS-"-O2"}
fi
rm -f conftest*
@@ -1057,6 +1060,21 @@ export CXX
export CFLAGS
export CXXFLAGS
+# FIXME: This should be in configure.in, not configure
+case "$host" in
+ *go32*)
+ enable_gdbtk=no ;;
+ *msdosdjgpp*)
+ enable_gdbtk=no ;;
+esac
+
+# FIXME: This should be in configure.in, not configure
+# Determine whether gdb needs tk/tcl or not.
+if [ "$enable_gdbtk" != "no" ]; then
+ GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui"
+else
+ GDB_TK=""
+fi
for subdir in . ${subdirs} ; do
@@ -1398,6 +1416,8 @@ EOF
-e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \
${subdir}/Makefile.tem >> ${Makefile}
+ sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem
+ mv -f ${Makefile}.tem ${Makefile}
# If this is a Canadian Cross, preset the values of many more
# tools.
diff --git a/configure.bat b/configure.bat
deleted file mode 100644
index d76a37ecd..000000000
--- a/configure.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-
-chdir libiberty
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\bfd
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\opcodes
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\gprof
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\binutils
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\gas
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\ld
-call configure %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..
diff --git a/configure.in b/configure.in
index e4e5c43c6..ca1b04f9d 100644
--- a/configure.in
+++ b/configure.in
@@ -14,7 +14,7 @@
## For more information on these two systems, check out the documentation
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1992-99, 2000 Free Software Foundation, Inc.
#
# 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
@@ -223,9 +223,6 @@ case "${host}" in
*-*-lynxos*)
host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
;;
- *-*-aix4.[3456789]* | *-*-aix[56789].*)
- host_makefile_frag="${host_makefile_frag} config/mh-aix43"
- ;;
*-*-sysv4*)
host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
;;
@@ -291,6 +288,9 @@ if [ x${shared} = xyes ]; then
i[3456]86-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
;;
+ i370-*-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-i370pic"
+ ;;
sparc64-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
;;
@@ -329,9 +329,15 @@ case "${target}" in
powerpc-*-netware*)
target_makefile_frag="${target_makefile_frag} config/mt-netware"
;;
- *-*-linux-gnu)
+ *-*-linux-gnu*)
target_makefile_frag="${target_makefile_frag} config/mt-linux"
;;
+ *-*-aix4.[3456789]* | *-*-aix[56789].*)
+ target_makefile_frag="${target_makefile_frag} config/mt-aix43"
+ ;;
+ mips*-*-pe | sh*-*-pe | *arm-wince-pe)
+ target_makefile_frag="${target_makefile_frag} config/mt-wince"
+ ;;
esac
# If --enable-target-optspace always use -Os instead of -O2 to build
@@ -341,7 +347,6 @@ case "${enable_target_optspace}:${target}" in
yes:*)
target_makefile_frag="${target_makefile_frag} config/mt-ospace"
;;
- # CYGNUS LOCAL d10v, d30v, fr30
:d30v-*)
target_makefile_frag="${target_makefile_frag} config/mt-d30v"
;;
@@ -523,13 +528,13 @@ case "${host}" in
;;
i[3456]86-*-mingw32*)
# noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
- noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
+ noconfigdirs="expect dejagnu cvs autoconf automake send-pr rcs guile perl texinfo apache inet libtool"
;;
i[3456]86-*-beos*)
noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
;;
*-*-cygwin*)
- noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
+ noconfigdirs="autoconf automake send-pr rcs guile perl texinfo apache inet"
;;
*-*-netbsd*)
noconfigdirs="rcs"
@@ -569,6 +574,21 @@ case "${target}" in
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+ noconfigdirs="$noconfigdirs target-libjava target-libffi target-zlib"
+ noconfigdirs="$noconfigdirs target-boehm-gc target-qthreads target-examples"
+ noconfigdirs="$noconfigdirs target-librx target-libiberty texinfo send-pr"
+ noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
+ noconfigdirs="$noconfigdirs expect dejagnu"
+ # the C++ libraries don't build on top of CE's C libraries
+ noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio"
+ skipdirs="$skipdirs target-newlib"
+ case "${host}" in
+ *-*-cygwin*) ;; # keep gdb and readline
+ *) noconfigdirs="$noconfigdirs gdb readline target-libio target-libstdc++ target-libg++"
+ ;;
+ esac
+ ;;
arc-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
@@ -596,15 +616,12 @@ case "${target}" in
thumb-*-coff)
noconfigdirs="$noconfigdirs target-libgloss"
;;
-# CYGNUS LOCAL clm/arm-elf
thumb-*-elf)
noconfigdirs="$noconfigdirs target-libgloss"
;;
thumb-*-oabi)
noconfigdirs="$noconfigdirs target-libgloss"
;;
-# END CYGNUS LOCAL
-# CYGNUS LOCAL nickc/strongarm
strongarm-*-elf)
noconfigdirs="$noconfigdirs target-libgloss"
if [ x${is_cross_compiler} != xno ] ; then
@@ -617,8 +634,7 @@ case "${target}" in
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
-# END CYGNUS LOCAL
- thumb-*-pe) # CYGNUS LOCAL nickc/thumb
+ thumb-*-pe)
noconfigdirs="$noconfigdirs target-libgloss"
;;
arm-*-riscix*)
@@ -627,24 +643,21 @@ case "${target}" in
d10v-*-*)
noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio"
;;
-# CYGNUS LOCAL d30v
d30v-*-*)
;;
-# END CYGNUS LOCAL
-# CYGNUS LOCAL fr30
fr30-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
;;
-# END CYGNUS LOCAL
h8300*-*-* | \
h8500-*-*)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
;;
hppa*-*-*elf* | \
+ hppa*-*-linux-gnu* | \
hppa*-*-lites*)
- # Do configure ld/binutils/gas for this case.
+ # Do configure ld/binutils/gas for the above cases.
;;
hppa*-*-*)
# HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
@@ -665,10 +678,6 @@ case "${target}" in
# but don't build gdb
noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
;;
- *-*-linux*)
- # linux has rx in libc
- skipdirs="$skipdirs target-librx"
- ;;
i[3456]86-*-mingw32*)
target_configdirs="$target_configdirs target-mingw"
noconfigdirs="$noconfigdirs expect target-libgloss"
@@ -743,8 +752,11 @@ case "${target}" in
;;
powerpc-*-aix*)
# copied from rs6000-*-* entry
- noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
- # This is needed until gcc and ld are fixed to work together.
+ # The configure and build of ld are currently disabled because
+ # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
+ # The symptom is that GDBtk 4.18 fails at startup with a segfault
+ # if linked by GNU ld, but not if linked by the native ld.
+ noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss ld"
use_gnu_ld=no
;;
powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
@@ -768,8 +780,11 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
;;
rs6000-*-aix*)
- noconfigdirs="$noconfigdirs gprof"
- # This is needed until gcc and ld are fixed to work together.
+ # The configure and build of ld are currently disabled because
+ # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
+ # The symptom is that GDBtk 4.18 fails at startup with a segfault
+ # if linked by GNU ld, but not if linked by the native ld.
+ noconfigdirs="$noconfigdirs gprof ld"
use_gnu_ld=no
;;
rs6000-*-*)
@@ -784,9 +799,14 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
;;
mips*-*-irix6*)
- # The GNU assembler and linker do not support IRIX 6.
+ # The GNU assembler does not support IRIX 6.
# emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
- noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
+ noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
+ ;;
+ mips*-*-linux*)
+ noconfigdirs="$noconfigdirs gprof"
+ # linux has rx in libc
+ skipdirs="$skipdirs target-librx"
;;
mips*-dec-bsd*)
noconfigdirs="$noconfigdirs gprof target-libgloss"
@@ -841,18 +861,22 @@ case "${target}" in
v850-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
- v850e-*-*) # CYGNUS LOCAL v850e
+ v850e-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
v850ea-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
- ;; # END CYGNUS LOCAL
+ ;;
vax-*-vms)
noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
;;
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ *-*-linux*)
+ # linux has rx in libc
+ skipdirs="$skipdirs target-librx"
+ ;;
*-*-lynxos*)
# Newlib makes problems for libg++ in crosses.
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff --git a/include/ChangeLog b/include/ChangeLog
index 04f9f02a3..cb15edca0 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,8 +1,99 @@
+2000-03-27 Denis Chertykov <denisc@overta.ru>
+
+ * dis-asm.h (print_insn_avr): Declare.
+
+2000-03-14 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * hashtab.h (htab_trav): Modify type so that first arg is of type
+ void **.
+ (htab_find_with_hash, htab_find_slot_with_hash): Declare new
+ functions.
+
+2000-03-09 Alex Samuel <samuel@codesourcery.com>
+
+ * partition.h: New file.
+
+2000-03-09 Zack Weinberg <zack@wolery.cumb.org>
+
+ * hashtab.h (struct htab): Add del_f.
+ (htab_del): New type.
+ (htab_create): Add fourth argument.
+
+2000-03-08 Zack Weinberg <zack@wolery.cumb.org>
+
+ * hashtab.h (hash_table_t): Rename to htab_t.
+ (struct hash_table): Rename to struct htab. Shorten element
+ names. Reorder elements by size.
+ (htab_hash, htab_eq, htab_trav): New typedefs for the callback
+ function pointers.
+ (hash_table_entry_t): Discard; just use void * for element
+ type.
+
+2000-03-01 H.J. Lu <hjl@gnu.org>
+
+ * bfdlink.h (bfd_link_callbacks): Add a boolean arg to
+ the undefined_symbol callback.
+
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * dis-asm.h (print_insn_i370): Declare.
+
+2000-02-22 Chandra Chavva <cchavva@cygnus.com>
+
+ * opcode/d30v.h (FLAG_NOT_WITH_ADDSUBppp): Redefined as operation
+ cannot be combined in parallel with ADD/SUBppp.
+
+Tue Feb 22 15:19:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_trace): Document return values.
+ (sim_set_trace): Declare. Deprecate.
+
+2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * dis-asm.h (struct disassemble_info): Change `length' param of
+ read_memory_func to unsigned. Change type of `buffer_length' and
+ `octets_per_byte' to unsigned.
+ (buffer_read_memory): Change `length' param to unsigned.
+
+2000-02-16 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h: Add prototypes for ARM register name functions.
+
+Wed Feb 9 18:45:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * wait.h: Delete. No longer used by GDB.
+
+Tue Feb 8 17:01:13 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_resume): Clarify use of SIGGNAL.
+ (sim_stop_reason): Clarify meaning of sim_signalled.
+
+2000-02-03 Timothy Wall <twall@redhat.com>
+
+ * dis-asm.h (struct disassemble_info): Added octets_per_byte
+ field and initialize it to one (1).
+
+2000-01-27 Nick Clifton <nickc@redhat.com>
+
+ * dis-asm.h: Add prototype for disassembler_usage().
+ Add prototype for arm_disassembler_options().
+ Remove prototype for arm_toggle_regnames().
+ Add prototype for parse_arm_disassembler_option().
+
Sat Jan 1 19:06:52 2000 Hans-Peter Nilsson <hp@bitrange.com>
* symcat.h (STRINGX) [!__STDC__ || ALMOST_STDC]: Change "?" to "s"
to stringify argument s.
+Wed Dec 15 11:22:56 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hp-symtab.h (HP_LANGUAGE_FORTRAN): New enumeration constant.
+ (HP_LANGUAGE_F77): Define using HP_LANGUAGE_FORTRAN.
+
+1999-12-15 Doug Evans <dje@transmeta.com>
+
+ * dis-asm.h: Enclose in extern "C" ifdef __cplusplus.
+
1999-12-05 Mark Mitchell <mark@codesourcery.com>
* splay-tree.h (struct splay_tree_node): Rename to ...
@@ -25,16 +116,30 @@ Sat Jan 1 19:06:52 2000 Hans-Peter Nilsson <hp@bitrange.com>
(asprintf, vasprintf): Provide declarations.
Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
- Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.
-
+
+1999-11-04 Jimmy Guo <guo@cup.hp.com>
+
+ * hp-symtab.h (dntt_type_fparam): Add doc_ranges, misc_kind
+ fields, change location type to CORE_ADDR from int.
+ (dntt_type_const): Name the 5th field location_type.
+
+Sun Oct 24 19:11:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-d10v.h (SIM_D10V_TS2_DMAP_REGNUM): Define.
+
1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com>
* hashtab.h: Give hash_table_t a struct tag. Add prototypes
for clear_hash_table_slot and traverse_hash_table. Correct
prototype of all_hash_table_collisions.
+Sat Oct 23 19:00:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-d10v.h: New file.
+
Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com>
* hashtab.h: New file.
@@ -43,7 +148,7 @@ Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com>
* ansidecl.h (HAVE_GCC_VERSION): New macro. Use it instead of
explicitly testing __GNUC__ and __GNUC_MINOR__.
-
+
(ATTRIBUTE_PRINTF): Use `__format__', not `format'.
1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
@@ -59,6 +164,10 @@ Tue Sep 14 00:35:02 1999 Marc Espie <espie@cvs.openbsd.org>
* libiberty.h (xmemdup): Add prototype for new function.
+1999-09-04 Steve Chamberlain <sac@pobox.com>
+
+ * dis-asm.h (print_insn_pj): Declare.
+
1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* obstack.h (obstack_grow, obstack_grow0): Move (char*) casts
@@ -79,6 +188,37 @@ Tue Sep 14 00:35:02 1999 Marc Espie <espie@cvs.openbsd.org>
* ansidecl.h: Copy attribute support macros from egcs.
+1999-06-22 Mark Mitchell <mark@codesourcery.com>
+
+ * bfdlink.h (struct bfd_link_hash_entry): Add init_function and
+ fini_function.
+
+1999-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ * mips.h (Elf32_Internal_Msym): New structure.
+ (Elf32_External_Msym): Likewise.
+ (ELF32_MS_REL_INDEX): New macro.
+ (ELF32_MS_FLAGS): Likewise.
+ (ELF32_MS_INFO): Likewise.
+
+1999-06-14 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h (arm_toggle_regnames): New prototype.
+ (struct diassemble_info): New field: disassembler_options.
+
+1999-04-11 Richard Henderson <rth@cygnus.com>
+
+ * bfdlink.h (bfd_elf_version_expr): Rename `match' to `pattern'.
+ Add `match' callback function.
+
+1999-04-10 Richard Henderson <rth@cygnus.com>
+
+ * bfdlink.h (bfd_link_info): Add no_undefined.
+
+1999-04-08 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h: Add prototype for print_insn_mcore.
+
1999-04-02 Mark Mitchell <mark@codesourcery.com>
* splay-tree.h (splay_tree_compare_pointers): Declare.
@@ -91,25 +231,63 @@ Wed Mar 24 12:46:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
* libiberty.h (basename): Cygwin{,32} should have the prototype.
+1999-02-22 Jim Lemke <jlemke@cygnus.com>
+
+ * bfdlink.h (bfd_link_info): add field "mpc860c0".
+
+Mon Feb 1 21:05:46 1999 Catherine Moore <clm@cygnus.com>
+
+ * dis-asm.h (print_insn_i386_att): Declare.
+ (print_insn_i386_intel): Declare.
+
+998-12-30 Michael Meissner <meissner@cygnus.com>
+
+ * dis-asm.h (INIT_DISASSEMBLE_INFO_NO_ARCH): Cast STREAM and
+ FPRINTF_FUNC to avoid compiler warnings.
+
+Wed Dec 30 16:07:14 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * dis-asm.h: change void * to PTR (two places).
+
Mon Dec 14 09:53:31 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h: Don't check IN_GCC anymore.
* splay-tree.h: Likewise.
-Tue Dec 8 00:30:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+Tue Dec 8 00:30:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ The following changes were made by Elena Zannoni
+ <ezannoni@kwikemart.cygnus.com> and Edith Epstein
+ <eepstein@sophia.cygnus.com> as part of a project to merge in
+ changes made by HP; HP did not create ChangeLog entries.
+
+ * dis-asm.h (struct disassemble_info): change the type of stream
+ from FILE* to void*, for use with gdb's new type GDB_FILE.
+ (fprintf_ftype): change FILE* parameter type to void*.
+
+ * demangle.h: (DMGL_EDG): new macro for Kuck and Associates
+ (DMGL_STYLE_MASK): modify to include Kuck and Assoc style
+ (demangling_styles): add new edg_demangling style
+ (EDG_DEMANGLING_STYLE_STRING): new macro
+ (EDG_DEMANGLING): new macro
- * demangle.h: (DMGL_EDG): new macro for Kuck and Associates
- (DMGL_STYLE_MASK): modify to include Kuck and Assoc style
- (demangling_styles): add new edg_demangling style
- (EDG_DEMANGLING_STYLE_STRING): new macro
- (EDG_DEMANGLING): new macro
+ * demangle.h (DMGL_HP): new macro, for HP/aCC compiler.
+ (DMGL_STYLE_MASK): modify to include new HP's style.
+ (demangling_styles): add new hp_demangling value.
+ (HP_DEMANGLING_STYLE_STRING): new macro.
+ (ARM_DEMANGLING): coerce to int.
+ (HP_DEMANGLING): new macro.
- * demangle.h (DMGL_HP): new macro, for HP/aCC compiler.
- (DMGL_STYLE_MASK): modify to include new HP's style.
- (demangling_styles): add new hp_demangling value.
- (HP_DEMANGLING_STYLE_STRING): new macro.
- (ARM_DEMANGLING): coerce to int.
- (HP_DEMANGLING): new macro.
+ * hp-symtab.h: rewritten, from HP.
+ (quick_procedure): change type of language field to unsigned int
+ (quick_module): change type of language field to unsigned int
+ (struct dntt_type_svar): add field thread_specific.
+ (hp_language): add languages modcal and dmpascal.
+
+Mon Nov 30 15:25:58 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * elf/sh.h (elf_sh_reloc_type): Add R_SH_FIRST_INVALID_RELOC,
+ R_SH_LAST_INVALID_RELOC, R_SH_SWITCH8 and R_SH_max.
Fri Nov 20 13:14:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
@@ -126,11 +304,19 @@ Sun Nov 8 17:42:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h: Never define PARAMS().
* splay-tree.h: Likewise.
+Sat Nov 7 18:30:20 1998 Peter Schauer <peter.schauer@regent.e-technik.tu-muenchen.de>
+
+ * dis-asm.h (print_insn_vax): Declare.
+
Sat Nov 7 16:04:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h: Don't include gansidecl.h.
* splay-tree.h: Likewise.
+1998-10-26 16:03 Ulrich Drepper <drepper@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add new field optimize.
+
Thu Oct 22 19:58:00 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* splay-tree.h: Wrap function pointer parameter declarations in
@@ -157,6 +343,10 @@ Mon Jun 1 13:48:32 1998 Jason Molenda (crash@bugshack.cygnus.com)
* obstack.h: Update to latest FSF version.
+Tue May 26 20:57:43 1998 Stan Cox <scox@equinox.cygnus.com>
+
+ * elf/sparc.h (EF_SPARC_LEDATA, R_SPARC_32LE): Added.
+
Tue Feb 24 13:05:02 1998 Doug Evans <devans@canuck.cygnus.com>
* dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols'
@@ -429,6 +619,10 @@ Thu Feb 6 14:20:01 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
bytes_per_chunk and display_endian to control the
display of raw instructions.
+Fri Dec 27 22:17:37 1996 Fred Fish <fnf@cygnus.com>
+
+ * dis-asm.h (print_insn_tic80): Declare.
+
Sun Dec 8 17:11:12 1996 Doug Evans <dje@canuck.cygnus.com>
* callback.h (host_callback): New member `error'.
@@ -806,8 +1000,8 @@ Thu Apr 28 19:06:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu)
- * obstack.h: Delete use of IN_GCC to control whether
- stddef.h or gstddef.h is included.
+ * obstack.h: Delete use of IN_GCC to control whether
+ stddef.h or gstddef.h is included.
Tue Mar 22 13:06:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 9e8a457c2..10308676f 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -160,7 +160,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* ANSI C. */
-
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
older preprocessors. Thus we can't define something like this:
diff --git a/include/aout/ChangeLog b/include/aout/ChangeLog
index 854cfd5b5..63f17ec83 100644
--- a/include/aout/ChangeLog
+++ b/include/aout/ChangeLog
@@ -1,3 +1,8 @@
+1999-07-12 Ian Lance Taylor <ian@zembu.com>
+
+ * aout64.h (N_SHARED_LIB): Define as 0 if TEXT_START_ADDR is
+ defined as 0.
+
Sun Jun 28 11:33:48 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
* stab.def: Add N_ALIAS from SunPro F77.
diff --git a/include/aout/aout64.h b/include/aout/aout64.h
index 76f1140b6..bf743c486 100644
--- a/include/aout/aout64.h
+++ b/include/aout/aout64.h
@@ -121,8 +121,12 @@ struct external_exec
/* Sun shared libraries, not linux. This macro is only relevant for ZMAGIC
files. */
#ifndef N_SHARED_LIB
+#if defined (TEXT_START_ADDR) && TEXT_START_ADDR == 0
+#define N_SHARED_LIB(x) (0)
+#else
#define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR)
#endif
+#endif
/* Returning 0 not TEXT_START_ADDR for OMAGIC and NMAGIC is based on
the assumption that we are dealing with a .o file, not an
diff --git a/include/bfdlink.h b/include/bfdlink.h
index a055fa082..bb827a35f 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -237,6 +237,13 @@ struct bfd_link_info
MPC860 C0 (or earlier) should be checked for and modified. It gives the
number of bytes that should be checked at the end of each text page. */
int mpc860c0;
+
+ /* The function to call when the executable or shared object is
+ loaded. */
+ const char *init_function;
+ /* The function to call when the executable or shared object is
+ unloaded. */
+ const char *fini_function;
};
/* This structures holds a set of callback functions. These are
@@ -322,10 +329,13 @@ struct bfd_link_callbacks
/* A function which is called when a relocation is attempted against
an undefined symbol. NAME is the symbol which is undefined.
ABFD, SECTION and ADDRESS identify the location from which the
- reference is made. In some cases SECTION may be NULL. */
+ reference is made. FATAL indicates whether an undefined symbol is
+ a fatal error or not. In some cases SECTION may be NULL. */
boolean (*undefined_symbol) PARAMS ((struct bfd_link_info *,
const char *name, bfd *abfd,
- asection *section, bfd_vma address));
+ asection *section,
+ bfd_vma address,
+ boolean fatal));
/* A function which is called when a reloc overflow occurs. NAME is
the name of the symbol or section the reloc is against,
RELOC_NAME is the name of the relocation, and ADDEND is any
diff --git a/include/bin-bugs.h b/include/bin-bugs.h
new file mode 100644
index 000000000..cb14a66bf
--- /dev/null
+++ b/include/bin-bugs.h
@@ -0,0 +1,3 @@
+#ifndef REPORT_BUGS_TO
+#define REPORT_BUGS_TO "bug-gnu-utils@gnu.org"
+#endif
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 8ad6e0cec..76b52c023 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,82 @@
+2000-03-15 Kazu Hirata <kazu@hxi.com>
+
+ * internal.h: Fix a typo in the comment for R_MOVL2.
+
+2000-02-28 Nick Clifton <nickc@cygnus.com>
+
+ * mipspe.h (MIPS_PE_MAGIC): Define.
+ * sh.h (SH_PE_MAGIC): Define.
+
+2000-02-22 Nick Clifton <nickc@cygnus.com> DJ Delorie <dj@cygnus.com>
+
+ * sh.h: Add Windows CE definitions.
+ * arm.h: Add Windows CE definitions.
+ * mipspe.h: New file: Windows CE definitions for MIPS.
+ * pe.h: Add constants for ILF support.
+
+2000-01-05 Nick Clifton <nickc@cygnus.com>
+
+ * pe.h: Fix formatting of comments.
+ (IMAGE_FILE_AGGRESSIVE_WS_TRIM): Define.
+ (IMAGE_FILE_LARGE_ADDRESS_AWARE): Define.
+ (IMAGE_FILE_16BIT_MACHINE): Define.
+ (IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP): Define.
+ (IMAGE_FILE_UP_SYSTEM_ONLY): Define.
+ (IMAGE_FILE_MACHINE_UNKNOWN): Define.
+ (IMAGE_FILE_MACHINE_ALPHA): Define.
+ (IMAGE_FILE_MACHINE_ALPHA64): Define.
+ (IMAGE_FILE_MACHINE_I386): Define.
+ (IMAGE_FILE_MACHINE_IA64): Define.
+ (IMAGE_FILE_MACHINE_M68K): Define.
+ (IMAGE_FILE_MACHINE_MIPS16): Define.
+ (IMAGE_FILE_MACHINE_MIPSFPU): Define.
+ (IMAGE_FILE_MACHINE_MIPSFPU16): Define.
+ (IMAGE_FILE_MACHINE_POWERPC): Define.
+ (IMAGE_FILE_MACHINE_R3000): Define.
+ (IMAGE_FILE_MACHINE_R4000): Define.
+ (IMAGE_FILE_MACHINE_R10000): Define.
+ (IMAGE_FILE_MACHINE_SH3): Define.
+ (IMAGE_FILE_MACHINE_SH4): Define.
+ (IMAGE_FILE_MACHINE_THUMB): Define.
+
+1999-09-20 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * internal.h: Delete bogus R_PCLONG, duplicate R_RELBYTE and
+ R_RELWORD, and rewrite some R_* as decimal.
+
+1999-09-06 Donn Terry <donn@interix.com>
+
+ * internal.h (DTYPE): Define.
+ * pe.h (struct external_PEI_filehdr): Rename from
+ external_PE_filehdr. Define even if COFF_IMAGE_WITH_PE is not
+ defined.
+
+1999-07-17 Nick Clifton <nickc@cygnus.com>
+
+ * arm.h (F_SOFT_FLOAT): Rename from F_SOFTFLOAT.
+
+1999-06-21 Philip Blundell <pb@nexus.co.uk>
+
+ * arm.h (F_SOFTFLOAT): Define.
+
+1999-07-05 Nick Clifton <nickc@cygnus.com>
+
+ * arm.h (F_ARM_5): Define.
+
+Wed Jun 2 18:08:18 1999 Richard Henderson <rth@cygnus.com>
+
+ * internal.h (BEOS_EXE_IMAGE_BASE, BEOS_DLL_IMAGE_BASE): New.
+
+Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com>
+
+ * coff/arm.h (F_PIC, F_ARM_2, F_ARM_2a, F_ARM_3, F_ARM_3M,
+ F_ARM_4, F_ARM_4T, F_APCS26): Changed values to distinguish
+ F_ARM_2a, F_ARM_3M, F_ARM_4T.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (IMAGE_REL_MCORE_RVA): Define.
+
1999-04-21 Nick Clifton <nickc@cygnus.com>
* mcore.h (GET_LINENO_LNNO): New macro.
@@ -5,7 +84,7 @@
1999-04-08 Nick Clifton <nickc@cygnus.com>
- * mcore.h: New header file. Defines for Motorolla's MCore
+ * mcore.h: New header file. Defines for Motorola's MCore
processor.
Sun Dec 6 21:36:37 1998 Mark Elbrecht <snowball3@usa.net>
diff --git a/include/coff/arm.h b/include/coff/arm.h
index dd578b1a7..7ca93299a 100644
--- a/include/coff/arm.h
+++ b/include/coff/arm.h
@@ -1,10 +1,28 @@
-/*** coff information for the ARM */
+/* ARM COFF support for BFD.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define COFFARM 1
/********************** FILE HEADER **********************/
-struct external_filehdr {
+struct external_filehdr
+{
char f_magic[2]; /* magic number */
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
@@ -26,6 +44,7 @@ struct external_filehdr {
* F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
* F_APCS_26 file uses 26 bit ARM Procedure Calling Standard
* F_APCS_SET the F_APCS_26, F_APCS_FLOAT and F_PIC bits have been initialised
+ * F_SOFT_FLOAT code does not use floating point instructions
*/
#define F_RELFLG (0x0001)
@@ -40,20 +59,22 @@ struct external_filehdr {
#define F_AR32WR (0x0100)
#define F_APCS_26 (0x0400)
#define F_APCS_SET (0x0800)
+#define F_SOFT_FLOAT (0x2000)
/* Bits stored in flags field of the internal_f structure */
#define F_INTERWORK (0x0010)
-#define F_PIC_INT (0x0020)
#define F_APCS_FLOAT (0x0040)
-#define F_ARM_ARCHITECTURE_MASK (0x0c00)
-#define F_ARM_2 (0x0000)
-#define F_ARM_2a (0x0000)
-#define F_ARM_3 (0x0400)
-#define F_ARM_3M (0x0400)
-#define F_ARM_4 (0x0800)
-#define F_ARM_4T (0x0c00)
-#define F_APCS26 (0x4000)
+#define F_PIC (0x0080)
+#define F_APCS26 (0x1000)
+#define F_ARM_ARCHITECTURE_MASK (0x4000+0x0800+0x0400)
+#define F_ARM_2 (0x0400)
+#define F_ARM_2a (0x0800)
+#define F_ARM_3 (0x0c00)
+#define F_ARM_3M (0x4000)
+#define F_ARM_4 (0x4400)
+#define F_ARM_4T (0x4800)
+#define F_ARM_5 (0x4c00)
/*
* ARMMAGIC ought to encoded the procesor type,
@@ -64,10 +85,16 @@ struct external_filehdr {
* XXX - NC 5/6/97
*/
-#define ARMMAGIC 0xa00 /* I just made this up */
+#define ARMMAGIC 0xa00 /* I just made this up */
#define ARMBADMAG(x) (((x).f_magic != ARMMAGIC))
+#define ARMPEMAGIC 0x1c0
+#define THUMBPEMAGIC 0x1c2
+
+#undef ARMBADMAG
+#define ARMBADMAG(x) (((x).f_magic != ARMMAGIC) && ((x).f_magic != ARMPEMAGIC) && ((x).f_magic != THUMBPEMAGIC))
+
#define FILHDR struct external_filehdr
#define FILHSZ 20
@@ -85,8 +112,6 @@ typedef struct
char entry[4]; /* entry pt. */
char text_start[4]; /* base of text used for this file */
char data_start[4]; /* base of data used for this file */
-
-
}
AOUTHDR;
@@ -108,9 +133,8 @@ AOUTHDR;
#define NT_DEF_COMMIT 0x1000
/********************** SECTION HEADER **********************/
-
-
-struct external_scnhdr {
+struct external_scnhdr
+{
char s_name[8]; /* section name */
char s_paddr[4]; /* physical address, aliased s_nlib */
char s_vaddr[4]; /* virtual address */
@@ -145,8 +169,10 @@ struct external_scnhdr {
* grouping will have l_lnno = 0 and in place of physical address will be the
* symbol table index of the function name.
*/
-struct external_lineno {
- union {
+struct external_lineno
+{
+ union
+ {
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
char l_paddr[4]; /* (physical) address of line number */
} l_addr;
@@ -166,9 +192,11 @@ struct external_lineno {
struct external_syment
{
- union {
+ union
+ {
char e_name[E_SYMNMLEN];
- struct {
+ struct
+ {
char e_zeroes[4];
char e_offset[4];
} e;
@@ -185,37 +213,47 @@ struct external_syment
#define N_BTSHFT (4)
#define N_TSHIFT (2)
-union external_auxent {
- struct {
+union external_auxent
+{
+ struct
+ {
char x_tagndx[4]; /* str, un, or enum tag indx */
- union {
- struct {
+ union
+ {
+ struct
+ {
char x_lnno[2]; /* declaration line number */
char x_size[2]; /* str/union/array size */
} x_lnsz;
char x_fsize[4]; /* size of function */
} x_misc;
- union {
- struct { /* if ISFCN, tag, or .bb */
+ union
+ {
+ struct /* if ISFCN, tag, or .bb */
+ {
char x_lnnoptr[4]; /* ptr to fcn line # */
char x_endndx[4]; /* entry ndx past block end */
} x_fcn;
- struct { /* if ISARY, up to 4 dimen. */
+ struct /* if ISARY, up to 4 dimen. */
+ {
char x_dimen[E_DIMNUM][2];
} x_ary;
} x_fcnary;
char x_tvndx[2]; /* tv index */
} x_sym;
- union {
+ union
+ {
char x_fname[E_FILNMLEN];
- struct {
+ struct
+ {
char x_zeroes[4];
char x_offset[4];
} x_n;
} x_file;
- struct {
+ struct
+ {
char x_scnlen[4]; /* section length */
char x_nreloc[2]; /* # relocation entries */
char x_nlinno[2]; /* # line numbers */
@@ -224,13 +262,12 @@ union external_auxent {
char x_comdat[1]; /* COMDAT selection number */
} x_scn;
- struct {
+ struct
+ {
char x_tvfill[4]; /* tv fill value */
char x_tvlen[2]; /* length of .tv */
char x_tvran[2][2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
-
-
};
#define SYMENT struct external_syment
@@ -238,21 +275,29 @@ union external_auxent {
#define AUXENT union external_auxent
#define AUXESZ 18
-
-# define _ETEXT "etext"
-
+#define _ETEXT "etext"
/********************** RELOCATION DIRECTIVES **********************/
+#ifdef ARM_WINCE
+struct external_reloc
+{
+ char r_vaddr[4];
+ char r_symndx[4];
+ char r_type[2];
+};
+#define RELOC struct external_reloc
+#define RELSZ 10
-
-struct external_reloc {
+#else
+struct external_reloc
+{
char r_vaddr[4];
char r_symndx[4];
char r_type[2];
char r_offset[4];
};
-
#define RELOC struct external_reloc
#define RELSZ 14
+#endif
diff --git a/include/coff/internal.h b/include/coff/internal.h
index d5ea95103..e89b52875 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -89,10 +89,14 @@ typedef struct _IMAGE_DATA_DIRECTORY
} IMAGE_DATA_DIRECTORY;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
-/* default image base for NT */
+/* Default image base for NT. */
#define NT_EXE_IMAGE_BASE 0x400000
#define NT_DLL_IMAGE_BASE 0x10000000
+/* Default image base for BeOS. */
+#define BEOS_EXE_IMAGE_BASE 0x80000000
+#define BEOS_DLL_IMAGE_BASE 0x10000000
+
/* Extra stuff in a PE aouthdr */
#define PE_DEF_SECTION_ALIGNMENT 0x1000
@@ -417,6 +421,7 @@ struct internal_syment
#define DT_ARY (3) /* array */
#define BTYPE(x) ((x) & N_BTMASK)
+#define DTYPE(x) (((x) & N_TMASK) >> N_BTSHFT)
#define ISPTR(x) \
(((unsigned long) (x) & N_TMASK) == ((unsigned long) DT_PTR << N_BTSHFT))
@@ -585,33 +590,28 @@ struct internal_reloc
unsigned long r_offset; /* Used by Alpha ECOFF, SPARC, others */
};
-#define R_RELBYTE 017
-#define R_RELWORD 020
-#define R_PCRBYTE 022
-#define R_PCRWORD 023
-#define R_PCRLONG 024
-
-#define R_DIR16 01
-#define R_DIR32 06
-#define R_PCLONG 020
-#define R_RELBYTE 017
-#define R_RELWORD 020
-#define R_IMAGEBASE 07
-
-
-#define R_PCR16L 128
-#define R_PCR26L 129
-#define R_VRT16 130
-#define R_HVRT16 131
-#define R_LVRT16 132
-#define R_VRT32 133
-#define R_RELLONG (0x11) /* Direct 32-bit relocation */
-#define R_IPRSHORT (0x18)
-#define R_IPRLONG (0x1a)
-#define R_GETSEG (0x1d)
-#define R_GETPA (0x1e)
-#define R_TAGWORD (0x1f)
-#define R_JUMPTARG 0x20 /* strange 29k 00xx00xx reloc */
+#define R_DIR16 1
+#define R_DIR32 6
+#define R_IMAGEBASE 7
+#define R_RELBYTE 15
+#define R_RELWORD 16
+#define R_RELLONG 17
+#define R_PCRBYTE 18
+#define R_PCRWORD 19
+#define R_PCRLONG 20
+#define R_IPRSHORT 24
+#define R_IPRLONG 26
+#define R_GETSEG 29
+#define R_GETPA 30
+#define R_TAGWORD 31
+#define R_JUMPTARG 32 /* strange 29k 00xx00xx reloc */
+
+#define R_PCR16L 128
+#define R_PCR26L 129
+#define R_VRT16 130
+#define R_HVRT16 131
+#define R_LVRT16 132
+#define R_VRT32 133
/* This reloc identifies mov.b instructions with a 16bit absolute
@@ -671,7 +671,7 @@ struct internal_reloc
#define R_MOVL1 0x4c
/* This reloc identifies mov.[wl] insns which formerlly had
- a 32/24bit absolute address and how have a 16bit absolute address. */
+ a 32/24bit absolute address and now have a 16bit absolute address. */
#define R_MOVL2 0x4d
/* This reloc identifies a bCC:8 which will have it's condition
diff --git a/include/coff/mcore.h b/include/coff/mcore.h
index 974b62e16..0fa319c97 100644
--- a/include/coff/mcore.h
+++ b/include/coff/mcore.h
@@ -1,4 +1,4 @@
-/* Motorolla MCore support for BFD.
+/* Motorola MCore support for BFD.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define IMAGE_REL_MCORE_PCREL_IMM4BY2 0x0004
#define IMAGE_REL_MCORE_PCREL_32 0x0005
#define IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2 0x0006
+#define IMAGE_REL_MCORE_RVA 0x0007
#define PEMCORE
diff --git a/include/coff/mipspe.h b/include/coff/mipspe.h
new file mode 100644
index 000000000..1927d991d
--- /dev/null
+++ b/include/coff/mipspe.h
@@ -0,0 +1,223 @@
+/*** coff information for Windows CE with MIPS VR4111 */
+
+/********************** FILE HEADER **********************/
+
+struct external_filehdr {
+ char f_magic[2]; /* magic number */
+ char f_nscns[2]; /* number of sections */
+ char f_timdat[4]; /* time & date stamp */
+ char f_symptr[4]; /* file pointer to symtab */
+ char f_nsyms[4]; /* number of symtab entries */
+ char f_opthdr[2]; /* sizeof(optional hdr) */
+ char f_flags[2]; /* flags */
+};
+
+
+
+#define MIPS_ARCH_MAGIC_WINCE 0x0166 /* Windows CE - little endian */
+#define MIPS_PE_MAGIC 0x010b
+
+#define MIPSBADMAG(x) \
+ ((x).f_magic!=MIPS_ARCH_MAGIC_WINCE)
+
+#define FILHDR struct external_filehdr
+#define FILHSZ 20
+
+
+/********************** AOUT "OPTIONAL HEADER" **********************/
+
+
+typedef struct
+{
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes, padded to FW bdry*/
+ char dsize[4]; /* initialized data " " */
+ char bsize[4]; /* uninitialized data " " */
+ char entry[4]; /* entry pt. */
+ char text_start[4]; /* base of text used for this file */
+ char data_start[4]; /* base of data used for this file */
+}
+AOUTHDR;
+
+
+#define AOUTHDRSZ 28
+#define AOUTSZ 28
+
+
+
+
+/* define some NT default values */
+/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
+#define NT_SECTION_ALIGNMENT 0x1000
+#define NT_FILE_ALIGNMENT 0x200
+#define NT_DEF_RESERVE 0x100000
+#define NT_DEF_COMMIT 0x1000
+
+/********************** SECTION HEADER **********************/
+
+
+struct external_scnhdr {
+ char s_name[8]; /* section name */
+ char s_paddr[4]; /* physical address, aliased s_nlib */
+ char s_vaddr[4]; /* virtual address */
+ char s_size[4]; /* section size */
+ char s_scnptr[4]; /* file ptr to raw data for section */
+ char s_relptr[4]; /* file ptr to relocation */
+ char s_lnnoptr[4]; /* file ptr to line numbers */
+ char s_nreloc[2]; /* number of relocation entries */
+ char s_nlnno[2]; /* number of line number entries*/
+ char s_flags[4]; /* flags */
+};
+
+/*
+ * names of "special" sections
+ */
+#define _TEXT ".text"
+#define _DATA ".data"
+#define _BSS ".bss"
+
+
+#define SCNHDR struct external_scnhdr
+#define SCNHSZ 40
+
+
+/********************** LINE NUMBERS **********************/
+
+/* 1 line number entry for every "breakpointable" source line in a section.
+ * Line numbers are grouped on a per function basis; first entry in a function
+ * grouping will have l_lnno = 0 and in place of physical address will be the
+ * symbol table index of the function name.
+ */
+struct external_lineno {
+ union {
+ char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
+ char l_paddr[4]; /* (physical) address of line number */
+ } l_addr;
+ char l_lnno[2]; /* line number */
+};
+
+#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
+#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
+
+#define LINENO struct external_lineno
+#define LINESZ 6
+
+
+/********************** SYMBOLS **********************/
+
+#define E_SYMNMLEN 8 /* # characters in a symbol name */
+#define E_FILNMLEN 14 /* # characters in a file name */
+#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
+
+struct external_syment
+{
+ union {
+ char e_name[E_SYMNMLEN];
+ struct {
+ char e_zeroes[4];
+ char e_offset[4];
+ } e;
+ } e;
+ char e_value[4];
+ char e_scnum[2];
+ char e_type[2];
+ char e_sclass[1];
+ char e_numaux[1];
+};
+
+
+
+#define N_BTMASK (017)
+#define N_TMASK (060)
+#define N_BTSHFT (4)
+#define N_TSHIFT (2)
+
+
+union external_auxent {
+ struct {
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ union {
+ struct {
+ char x_lnno[2]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ char x_fsize[4]; /* size of function */
+ } x_misc;
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ char x_lnnoptr[4]; /* ptr to fcn line # */
+ char x_endndx[4]; /* entry ndx past block end */
+ } x_fcn;
+ struct { /* if ISARY, up to 4 dimen. */
+ char x_dimen[E_DIMNUM][2];
+ } x_ary;
+ } x_fcnary;
+ char x_tvndx[2]; /* tv index */
+ } x_sym;
+
+ union {
+ char x_fname[E_FILNMLEN];
+ struct {
+ char x_zeroes[4];
+ char x_offset[4];
+ } x_n;
+ } x_file;
+
+ struct {
+ char x_scnlen[4]; /* section length */
+ char x_nreloc[2]; /* # relocation entries */
+ char x_nlinno[2]; /* # line numbers */
+ char x_checksum[4]; /* section COMDAT checksum */
+ char x_associated[2]; /* COMDAT associated section index */
+ char x_comdat[1]; /* COMDAT selection number */
+ } x_scn;
+
+ struct {
+ char x_tvfill[4]; /* tv fill value */
+ char x_tvlen[2]; /* length of .tv */
+ char x_tvran[2][2]; /* tv range */
+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
+
+
+};
+
+#define SYMENT struct external_syment
+#define SYMESZ 18
+#define AUXENT union external_auxent
+#define AUXESZ 18
+
+
+
+/********************** RELOCATION DIRECTIVES **********************/
+
+/* The external reloc has an offset field, because some of the reloc
+ types on the h8 don't have room in the instruction for the entire
+ offset - eg the strange jump and high page addressing modes */
+
+struct external_reloc {
+ char r_vaddr[4];
+ char r_symndx[4];
+ char r_type[2];
+};
+
+
+#define RELOC struct external_reloc
+#define RELSZ 10
+
+/* MIPS PE relocation types. */
+
+#define MIPS_R_ABSOLUTE 0 /* ignored */
+#define MIPS_R_REFHALF 1
+#define MIPS_R_REFWORD 2
+#define MIPS_R_JMPADDR 3
+#define MIPS_R_REFHI 4 /* PAIR follows */
+#define MIPS_R_REFLO 5
+#define MIPS_R_GPREL 6
+#define MIPS_R_LITERAL 7 /* same as GPREL */
+#define MIPS_R_SECTION 10
+#define MIPS_R_SECREL 11
+#define MIPS_R_SECRELLO 12
+#define MIPS_R_SECRELHI 13 /* PAIR follows */
+#define MIPS_R_RVA 34 /* 0x22 */
+#define MIPS_R_PAIR 37 /* 0x25 - symndx is really a signed 16-bit addend */
diff --git a/include/coff/pe.h b/include/coff/pe.h
index 7e676a508..6932ee87b 100644
--- a/include/coff/pe.h
+++ b/include/coff/pe.h
@@ -3,29 +3,32 @@
#ifndef _PE_H
#define _PE_H
-/* NT specific file attributes */
+/* NT specific file attributes. */
#define IMAGE_FILE_RELOCS_STRIPPED 0x0001
#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
+#define IMAGE_FILE_AGGRESSIVE_WS_TRIM 0x0010
+#define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020
+#define IMAGE_FILE_16BIT_MACHINE 0x0040
#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080
#define IMAGE_FILE_32BIT_MACHINE 0x0100
#define IMAGE_FILE_DEBUG_STRIPPED 0x0200
+#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400
#define IMAGE_FILE_SYSTEM 0x1000
#define IMAGE_FILE_DLL 0x2000
+#define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000
#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
-/* additional flags to be set for section headers to allow the NT loader to
+/* Additional flags to be set for section headers to allow the NT loader to
read and write to the section data (to replace the addresses of data in
- dlls for one thing); also to execute the section in .text's case */
+ dlls for one thing); also to execute the section in .text's case. */
#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
#define IMAGE_SCN_MEM_EXECUTE 0x20000000
#define IMAGE_SCN_MEM_READ 0x40000000
#define IMAGE_SCN_MEM_WRITE 0x80000000
-/*
- * Section characteristics added for ppc-nt
- */
+/* Section characteristics added for ppc-nt. */
#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 /* Reserved. */
@@ -53,7 +56,6 @@
#define IMAGE_SCN_ALIGN_32BYTES 0x00600000
#define IMAGE_SCN_ALIGN_64BYTES 0x00700000
-
#define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 /* Section contains extended relocations. */
#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 /* Section is not cachable. */
#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 /* Section is not pageable. */
@@ -67,6 +69,26 @@
#define IMAGE_COMDAT_SELECT_EXACT_MATCH (4) /* Warn if different. */
#define IMAGE_COMDAT_SELECT_ASSOCIATIVE (5) /* Base on other section. */
+/* Machine numbers. */
+
+#define IMAGE_FILE_MACHINE_UNKNOWN 0x0
+#define IMAGE_FILE_MACHINE_ALPHA 0x184
+#define IMAGE_FILE_MACHINE_ARM 0x1c0
+#define IMAGE_FILE_MACHINE_ALPHA64 0x284
+#define IMAGE_FILE_MACHINE_I386 0x14c
+#define IMAGE_FILE_MACHINE_IA64 0x200
+#define IMAGE_FILE_MACHINE_M68K 0x268
+#define IMAGE_FILE_MACHINE_MIPS16 0x266
+#define IMAGE_FILE_MACHINE_MIPSFPU 0x366
+#define IMAGE_FILE_MACHINE_MIPSFPU16 0x466
+#define IMAGE_FILE_MACHINE_POWERPC 0x1f0
+#define IMAGE_FILE_MACHINE_R3000 0x162
+#define IMAGE_FILE_MACHINE_R4000 0x166
+#define IMAGE_FILE_MACHINE_R10000 0x168
+#define IMAGE_FILE_MACHINE_SH3 0x1a2
+#define IMAGE_FILE_MACHINE_SH4 0x1a6
+#define IMAGE_FILE_MACHINE_THUMB 0x1c2
+
/* Magic values that are true for all dos/nt implementations */
#define DOSMAGIC 0x5a4d
#define NT_SIGNATURE 0x00004550
@@ -76,12 +98,7 @@
#undef FILNMLEN
#define FILNMLEN 18 /* # characters in a file name */
-
-#ifdef COFF_IMAGE_WITH_PE
-/* The filehdr is only weired in images */
-
-#undef FILHDR
-struct external_PE_filehdr
+struct external_PEI_filehdr
{
/* DOS header fields */
char e_magic[2]; /* Magic number, 0x5a4d */
@@ -108,7 +125,6 @@ struct external_PE_filehdr
/* From standard header */
-
char f_magic[2]; /* magic number */
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
@@ -119,12 +135,16 @@ struct external_PE_filehdr
};
+#ifdef COFF_IMAGE_WITH_PE
+
+/* The filehdr is only weird in images. */
-#define FILHDR struct external_PE_filehdr
-#undef FILHSZ
+#undef FILHDR
+#define FILHDR struct external_PEI_filehdr
+#undef FILHSZ
#define FILHSZ 152
-#endif
+#endif /* COFF_IMAGE_WITH_PE */
typedef struct
{
@@ -163,7 +183,16 @@ typedef struct
#undef E_FILNMLEN
#define E_FILNMLEN 18 /* # characters in a file name */
-#endif
+/* Import Tyoes fot ILF format object files.. */
+#define IMPORT_CODE 0
+#define IMPORT_DATA 1
+#define IMPORT_CONST 2
+/* Import Name Tyoes for ILF format object files. */
+#define IMPORT_ORDINAL 0
+#define IMPORT_NAME 1
+#define IMPORT_NAME_NOPREFIX 2
+#define IMPORT_NAME_UNDECORATE 3
+#endif /* _PE_H */
diff --git a/include/coff/sh.h b/include/coff/sh.h
index 41957df7f..f7271f210 100644
--- a/include/coff/sh.h
+++ b/include/coff/sh.h
@@ -16,10 +16,13 @@ struct external_filehdr {
#define SH_ARCH_MAGIC_BIG 0x0500
#define SH_ARCH_MAGIC_LITTLE 0x0550 /* Little endian SH */
+#define SH_ARCH_MAGIC_WINCE 0x01a2 /* Windows CE - little endian */
+#define SH_PE_MAGIC 0x010b
#define SHBADMAG(x) \
(((x).f_magic!=SH_ARCH_MAGIC_BIG) && \
+ ((x).f_magic!=SH_ARCH_MAGIC_WINCE) && \
((x).f_magic!=SH_ARCH_MAGIC_LITTLE))
#define FILHDR struct external_filehdr
@@ -48,6 +51,12 @@ AOUTHDR;
+/* Define some NT default values. */
+/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
+#define NT_SECTION_ALIGNMENT 0x1000
+#define NT_FILE_ALIGNMENT 0x200
+#define NT_DEF_RESERVE 0x100000
+#define NT_DEF_COMMIT 0x1000
/********************** SECTION HEADER **********************/
@@ -89,14 +98,26 @@ struct external_lineno {
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
char l_paddr[4]; /* (physical) address of line number */
} l_addr;
+#ifdef COFF_WITH_PE
+ char l_lnno[2]; /* line number */
+#else
char l_lnno[4]; /* line number */
+#endif
};
#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno));
#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_32(abfd,val, (bfd_byte *) (ext->l_lnno));
#define LINENO struct external_lineno
+#ifdef COFF_WITH_PE
+#define LINESZ 6
+#undef GET_LINENO_LNNO
+#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
+#undef PUT_LINENO_LNNO
+#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
+#else
#define LINESZ 8
+#endif
/********************** SYMBOLS **********************/
@@ -163,6 +184,9 @@ union external_auxent {
char x_scnlen[4]; /* section length */
char x_nreloc[2]; /* # relocation entries */
char x_nlinno[2]; /* # line numbers */
+ char x_checksum[4]; /* section COMDAT checksum */
+ char x_associated[2]; /* COMDAT associated section index */
+ char x_comdat[1]; /* COMDAT selection number */
} x_scn;
struct {
@@ -187,6 +211,7 @@ union external_auxent {
types on the h8 don't have room in the instruction for the entire
offset - eg the strange jump and high page addressing modes */
+#ifndef COFF_WITH_PE
struct external_reloc {
char r_vaddr[4];
char r_symndx[4];
@@ -194,14 +219,26 @@ struct external_reloc {
char r_type[2];
char r_stuff[2];
};
+#else
+struct external_reloc {
+ char r_vaddr[4];
+ char r_symndx[4];
+ char r_type[2];
+};
+#endif
#define RELOC struct external_reloc
+#ifdef COFF_WITH_PE
+#define RELSZ 10
+#else
#define RELSZ 16
+#endif
/* SH relocation types. Not all of these are actually used. */
#define R_SH_UNUSED 0 /* only used internally */
+#define R_SH_IMM32CE 2 /* 32 bit immediate for WinCE */
#define R_SH_PCREL8 3 /* 8 bit pcrel */
#define R_SH_PCREL16 4 /* 16 bit pcrel */
#define R_SH_HIGH8 5 /* high 8 bits of 24 bit address */
@@ -213,6 +250,7 @@ struct external_reloc {
#define R_SH_PCDISP 12 /* 12 bit branch */
#define R_SH_IMM32 14 /* 32 bit immediate */
#define R_SH_IMM8 16 /* 8 bit immediate */
+#define R_SH_IMAGEBASE 16 /* Windows CE */
#define R_SH_IMM8BY2 17 /* 8 bit immediate *2 */
#define R_SH_IMM8BY4 18 /* 8 bit immediate *4 */
#define R_SH_IMM4 19 /* 4 bit immediate */
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 666ed6901..6e6c04b53 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -9,6 +9,10 @@
#ifndef DIS_ASM_H
#define DIS_ASM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>
#include "bfd.h"
@@ -74,7 +78,7 @@ typedef struct disassemble_info {
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
- PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,
+ PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
struct disassemble_info *info));
/* Function which should be called if we get an error that we can't
@@ -101,7 +105,7 @@ typedef struct disassemble_info {
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
- int buffer_length;
+ unsigned int buffer_length;
/* This variable may be set by the instruction decoder. It suggests
the number of bytes objdump should display on a single line. If
@@ -117,6 +121,11 @@ typedef struct disassemble_info {
int bytes_per_chunk;
enum bfd_endian display_endian;
+ /* Number of octets per incremented target address
+ Normally one, but some DSPs have byte sizes of 16 or 32 bits
+ */
+ unsigned int octets_per_byte;
+
/* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is
decoded, and is only valid for the last such instruction.
@@ -133,6 +142,9 @@ typedef struct disassemble_info {
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
+ /* Command line options specific to the target disassembler. */
+ char * disassembler_options;
+
} disassemble_info;
@@ -145,6 +157,7 @@ extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i386_att PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i386_intel PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_i370 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
@@ -180,10 +193,21 @@ extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_vax PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_tic80 PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_pj PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_avr PARAMS ((bfd_vma, disassemble_info*));
+
+extern void print_arm_disassembler_options PARAMS ((FILE *));
+extern void parse_arm_disassembler_option PARAMS ((char *));
+extern int get_arm_regname_num_options PARAMS ((void));
+extern int set_arm_regname_option PARAMS ((int));
+extern int get_arm_regnames PARAMS ((int, const char **, const char **, const char ***));
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler PARAMS ((bfd *));
+/* Document any target specific options available from the disassembler. */
+extern void disassembler_usage PARAMS ((FILE *));
+
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */
@@ -191,7 +215,7 @@ extern disassembler_ftype disassembler PARAMS ((bfd *));
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
- PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));
+ PARAMS ((bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *));
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
@@ -215,6 +239,7 @@ extern int generic_symbol_at_address
(INFO).arch = bfd_arch_unknown, \
(INFO).mach = 0, \
(INFO).endian = BFD_ENDIAN_UNKNOWN, \
+ (INFO).octets_per_byte = 1, \
INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC)
/* Call this macro to initialize only the internal variables for the
@@ -240,4 +265,8 @@ extern int generic_symbol_at_address
(INFO).display_endian = BFD_ENDIAN_UNKNOWN, \
(INFO).insn_info_valid = 0
+#ifdef __cplusplus
+};
+#endif
+
#endif /* ! defined (DIS_ASM_H) */
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index deaccd412..e1f68c39b 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,244 @@
+2000-03-27 Denis Chertykov <denisc@overta.ru>
+
+ * avr.h: New file. AVR ELF support for BFD.
+ * common.h: Add AVR magic number.
+
+2000-03-10 Geoffrey Keating <geoffk@cygnus.com>
+
+ * mips.h: Add R_MIPS_GNU_REL_HI16, R_MIPS_GNU_REL_LO16,
+ R_MIPS_GNU_REL16_S2, R_MIPS_PC64 and R_MIPS_PC32 relocation
+ numbers.
+
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * i370.h: New file.
+
+2000-02-22 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (ELF_ST_OTHER): Remove definition.
+ (ELF32_ST_OTHER): Remove definition.
+ (ELF64_ST_OTHER): Remove definition.
+
+2000-02-22 H.J. Lu <hjl@gnu.org>
+
+ * common.h (ELFOSABI_LINUX): Define.
+
+Thu Feb 17 00:18:33 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros.
+ (EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise.
+ (EF_SH_HAS_FP, EF_SH3E, EF_SH4, EF_SH_MERGE_MACH): Likewise.
+
+2000-02-03 H.J. Lu <hjl@gnu.org>
+
+ * arm-oabi.h: Duplicate changes made to arm.h on Jan. 27,
+ 2000 by Thomas de Lellis <tdel@windriver.com>.
+
+2000-01-27 Thomas de Lellis <tdel@windriver.com>
+
+ * arm.h (STT_ARM_TFUNC): Define in terms of STT_LOPROC.
+ (STT_ARM_16BIT): New flag. Denotes a label that was defined in
+ Thumb block but was does not identify a function.
+
+2000-01-20 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (EM_MCORE): Fix spelling of Motorola.
+ * mcore.h (EM_MCORE): Fix spelling of Motorola.
+
+2000-01-13 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (EM_S370): Change comment - this is now the IBM
+ System/370.
+ (EM_IA_64): Change comment - this is now the IA-64.
+
+2000-01-11 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (DT_ENCODING): Fix definition of this value.
+ (DT_LOOS): Fix definition of this value.
+ (DT_HIOS): Fix definition of this value.
+ (OLD_DT_LOOS): Value of DT_LOOS before Oct 4, 1999 draft
+ of ELF spec changed it.
+ (OLD_DT_HIOS): Value of DT_HIOS before Oct 4, 1999 draft
+ of ELF spec changed it.
+
+2000-01-10 Egor Duda <deo@logos-m.ru>
+
+ * common.h (NT_WIN32PSTATUS): Define. (cygwin elf core dumps).
+
+1999-12-28 Nick Clifton <nickc@cygnus.com>
+
+ * mips.h (STO_*): Redefine in terms of STV_* values now in
+ common.h.
+
+1999-12-27 Nick Clifton <nickc@cygnus.com>
+
+ * common.h: Upgrade to match Oct4, 1999 Draft ELF ABI Spec.
+ (EM_MIPS_RS3_LE): New machine number.
+ (EM_RCE): New machine number.
+ (EM_MMA): New machine number.
+ (EM_PCP): New machine number.
+ (EM_NCPU): New machine number.
+ (EM_NDR1): New machine number.
+ (EM_STARCORE): New machine number.
+ (EM_ME16): New machine number.
+ (EM_ST100): New machine number.
+ (EM_TINYJ): New machine number.
+ (EM_FX66): New machine number.
+ (EM_ST9PLUS): New machine number.
+ (EM_ST7): New machine number.
+ (EM_68HC16): New machine number.
+ (EM_68HC11): New machine number.
+ (EM_68HC08): New machine number.
+ (EM_68HC05): New machine number.
+ (EM_SVX): New machine number.
+ (EM_VAX): New machine number.
+ (PF_MASKOS): Change value.
+ (SHT_INIT_ARRAY): New value for sh_type field.
+ (SHT_FINI_ARRAY): New value for sh_type field.
+ (SHT_PREINIT_ARRAY): New value for sh_type field.
+ (SHT_HIUSER): Change value.
+ (SHF_MERGE): New valye for sh_flags field.
+ (SHF_STRINGS): New valye for sh_flags field.
+ (SHF_INFO_LINK): New valye for sh_flags field.
+ (SHF_OS_NONCONFORMING): New valye for sh_flags field.
+ (SHF_MASKOS): Change value.
+ (ELF_ST_VISIBILITY): New macro.
+ (ELF_ST_OTHER): New macro.
+ (STT_COMMON): New symbol type.
+ (STV_DEFAULT): Value for symbol visibility.
+ (STV_INTERNAL): Value for symbol visibility.
+ (STV_HIDDEN): Value for symbol visibility.
+ (STV_PROTECTED): Value for symbol visibility.
+ (DT_RUNPATH): New dynamic section tag.
+ (DT_FLAGS): New dynamic section tag.
+ (DT_ENCODING): New dynamic section tag.
+ (DT_PREINIT_ARRAY): New dynamic section tag.
+ (DT_PREINIT_ARRAYSZ): New dynamic section tag.
+ (DT_LOPROC): New dynamic section tag index.
+ (DT_HIPROC): New dynamic section tag index.
+ (DF_ORIGIN): Value for dynamic section flag.
+ (DF_SYMBOLIC): Value for dynamic section flag.
+ (DF_TEXTREL): Value for dynamic section flag.
+ (DF_BIND_NOW): Value for dynamic section flag.
+
+1999-12-09 Fred Fish <fnf@cygnus.com>
+
+ * i960.h (reloc-macros.h): Include using relative dir elf/.
+ * i386.h (reloc-macros.h): Include using relative dir elf/.
+ * hppa.h (reloc-macros.h): Include using relative dir elf/.
+
+1999-12-07 Jim Blandy <jimb@cygnus.com>
+
+ * common.h (NT_PRXFPREG): New definition.
+
+Wed Dec 1 03:02:15 1999 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300.h (E_MN10300_MACH_AM33): Define.
+
+Mon Oct 11 22:42:37 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (PF_HP_PAGE_SIZE): Define.
+ (PF_HP_FAR_SHARED, PF_HP_NEAR_SHARED, PF_HP_CODE): Likewise.
+ (PF_HP_MODIFY, PF_HP_LAZYSWAP, PF_HP_SBP): Likewise.
+
+Mon Oct 4 17:42:38 1999 Doug Evans <devans@canuck.cygnus.com>
+
+ * m32r.h (E_M32RX_ARCH): Define.
+
+1999-09-15 Ulrich Drepper <drepper@cygnus.com>
+
+ * hppa.h: Add DT_HP_GST_SIZE, DT_HP_GST_VERSION, and DT_HP_GST_HASHVAL.
+
+1999-09-04 Steve Chamberlain <sac@pobox.com>
+
+ * pj.h: New file.
+ * common.h (EM_PJ): Define.
+
+1999-09-02 Ulrich Drepper <drepper@cygnus.com>
+
+ * hppa.h: Add HPUX specific symbol type definitions.
+
+ * hppa.h: Add HPUX specific dynamic and program header table
+ specific definitions.
+
+1999-08-31 Scott Bambrough <scottb@netwinder.org>
+
+ * common.h (NT_TASKSTRUCT): Define.
+
+1999-07-16 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * sparc.h (EF_SPARC_SUN_US3): Define in Cheetah extensions
+ flag (as per SCD2.4.1).
+
+1999-07-16 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * sparc.h (ELF64_R_TYPE_DATA): Only use ELF64_R_TYPE bits, not
+ ELF64_R_SYM bits.
+
+1999-06-21 Philip Blundell <pb@nexus.co.uk>
+
+ * arm.h (EF_SOFT_FLOAT, F_SOFT_FLOAT): Define.
+
+1999-07-13 Andreas Schwab <schwab@suse.de>
+
+ * m68k.h (EF_CPU32): Move definition inside multiple inclusion
+ guard.
+
+1999-07-08 Richard Henderson <rth@cygnus.com>
+
+ * sparc.h (ELF64_R_TYPE_DATA): Sign extend the value.
+ (ELF64_R_TYPE_INFO): Mask out all but low 24 bits of data.
+ (DT_SPARC_PLTFMT): Delete.
+ Based on a patch from Jakub Jelinek.
+
+Mon Jun 21 16:36:02 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (elf_hppa_reloc_type): Renamed from elf32_hppa_reloc_type.
+
+1999-06-10 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * sparc.h (R_SPARC_max_std): Define.
+
+Wed Jun 9 15:16:34 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h: Update with various changes from newest PA ELF
+ specifications.
+
+1999-06-03 Ian Lance Taylor <ian@zembu.com>
+
+ * common.h (EM_PPC64): Define.
+
+1999-06-02 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * dwarf.h: Add LANG_JAVA.
+ * dwarf2.h: Add DW_LANG_Java.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (ELFOSABI_ARM): Define.
+
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * reloc-macros.h: Update comment.
+
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * i960.h: New file.
+
+1999-05-16 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (R_MCORE_COPY): Define.
+ (R_MCORE_GLOB_DAT): Define.
+ (R_MCORE_JUMP_SLOT): Define.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (R_MCORE_RELATIVE): Define.
+
+999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * m68k.h (EF_CPU32): Define.
+
1999-04-21 Nick Clifton <nickc@cygnus.com>
* reloc-macros.h (START_RELOC_NUMBERS): Prepend an underscore to
@@ -10,22 +251,22 @@
1999-04-08 Nick Clifton <nickc@cygnus.com>
- * mcore.h: New header file. Defines for Motorolla's MCore
- processor.
+ * mcore.h: New header file. Defines for Motorola's MCore
+ processor.
1999-04-08 Nick Clifton <nickc@cygnus.com>
* common.h: Add new constants defined in: "System V Application
- Binary Interface - DRAFT - April 29, 1998" found at the web site:
+ Binary Interface - DRAFT - April 29, 1998" found at the web site:
http://www.sco.com/developer/gabi/contents.html
(EM_MMA): Removed. Replaced with EM_MCORE as Motorolla own this
- value.
+ value.
1999-03-31 Nick Clifton <nickc@cygnus.com>
* reloc-macros.h: Fixed to not generate an enum with a trailing
- comma.
+ comma.
1999-03-16 Gavin Romig-Koch <gavin@cygnus.com>
diff --git a/include/elf/arm-oabi.h b/include/elf/arm-oabi.h
index 6109842e8..da5e7316e 100644
--- a/include/elf/arm-oabi.h
+++ b/include/elf/arm-oabi.h
@@ -1,5 +1,5 @@
/* ARM ELF support for BFD.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -29,7 +29,7 @@
#define EF_APCS_26 0x08
#define EF_APCS_FLOAT 0x10
#define EF_PIC 0x20
-#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use */
+#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use. */
#define EF_NEW_ABI 0x80
#define EF_OLD_ABI 0x100
@@ -39,15 +39,16 @@
#define F_APCS_FLOAT EF_APCS_FLOAT
#define F_PIC EF_PIC
-/* Additional symbol types for Thumb */
-#define STT_ARM_TFUNC 0xd
+/* Additional symbol types for Thumb. */
+#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
+#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
-/* 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 */
+/* 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. */
-/* ARM-specific program header flags */
-#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base */
+/* ARM-specific program header flags. */
+#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */
/* Relocation types. */
START_RELOC_NUMBERS (elf_arm_reloc_type)
@@ -62,18 +63,18 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
RELOC_NUMBER (R_ARM_THM_PC22, 8)
RELOC_NUMBER (R_ARM_SBREL32, 9)
RELOC_NUMBER (R_ARM_AMP_VCALL9, 10)
- RELOC_NUMBER (R_ARM_THM_PC11, 11) /* cygnus extension to abi: thumb unconditional branch */
- RELOC_NUMBER (R_ARM_THM_PC9, 12) /* cygnus extension to abi: thumb conditional branch */
+ RELOC_NUMBER (R_ARM_THM_PC11, 11) /* Cygnus extension to abi: Thumb unconditional branch. */
+ RELOC_NUMBER (R_ARM_THM_PC9, 12) /* Cygnus extension to abi: Thumb conditional branch. */
RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 13)
RELOC_NUMBER (R_ARM_GNU_VTENTRY, 14)
- RELOC_NUMBER (R_ARM_COPY, 20) /* copy symbol at runtime */
- RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* create GOT entry */
- RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* create PLT entry */
- RELOC_NUMBER (R_ARM_RELATIVE, 23) /* adjust by program base */
- RELOC_NUMBER (R_ARM_GOTOFF, 24) /* 32 bit offset to GOT */
- RELOC_NUMBER (R_ARM_GOTPC, 25) /* 32 bit PC relative offset to GOT */
- RELOC_NUMBER (R_ARM_GOT32, 26) /* 32 bit GOT entry */
- RELOC_NUMBER (R_ARM_PLT32, 27) /* 32 bit PLT address */
+ RELOC_NUMBER (R_ARM_COPY, 20) /* Copy symbol at runtime. */
+ RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* Create GOT entry. */
+ RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* Create PLT entry. */
+ RELOC_NUMBER (R_ARM_RELATIVE, 23) /* Adjust by program base. */
+ RELOC_NUMBER (R_ARM_GOTOFF, 24) /* 32 bit offset to GOT. */
+ RELOC_NUMBER (R_ARM_GOTPC, 25) /* 32 bit PC relative offset to GOT. */
+ RELOC_NUMBER (R_ARM_GOT32, 26) /* 32 bit GOT entry. */
+ RELOC_NUMBER (R_ARM_PLT32, 27) /* 32 bit PLT address. */
FAKE_RELOC (FIRST_INVALID_RELOC, 28)
FAKE_RELOC (LAST_INVALID_RELOC, 249)
RELOC_NUMBER (R_ARM_RSBREL32, 250)
diff --git a/include/elf/arm.h b/include/elf/arm.h
index 2c94b13e2..4d3405dd7 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -1,5 +1,5 @@
/* ARM ELF support for BFD.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -29,25 +29,28 @@
#define EF_APCS_26 0x08
#define EF_APCS_FLOAT 0x10
#define EF_PIC 0x20
-#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use */
+#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use. */
#define EF_NEW_ABI 0x80
#define EF_OLD_ABI 0x100
+#define EF_SOFT_FLOAT 0x200
/* Local aliases for some flags to match names used by COFF port. */
#define F_INTERWORK EF_INTERWORK
#define F_APCS26 EF_APCS_26
#define F_APCS_FLOAT EF_APCS_FLOAT
#define F_PIC EF_PIC
+#define F_SOFT_FLOAT EF_SOFT_FLOAT
-/* Additional symbol types for Thumb */
-#define STT_ARM_TFUNC 0xd
+/* Additional symbol types for Thumb. */
+#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
+#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
-/* 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 */
+/* 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. */
-/* ARM-specific program header flags */
-#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base */
+/* ARM-specific program header flags. */
+#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */
/* Relocation types. */
START_RELOC_NUMBERS (elf_arm_reloc_type)
@@ -80,8 +83,8 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
FAKE_RELOC (LAST_INVALID_RELOC1, 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 */
- RELOC_NUMBER (R_ARM_THM_PC9, 103) /* cygnus extension to abi: thumb conditional branch */
+ RELOC_NUMBER (R_ARM_THM_PC11, 102) /* Cygnus extension to abi: Thumb unconditional branch */
+ RELOC_NUMBER (R_ARM_THM_PC9, 103) /* Cygnus extension to abi: Thumb conditional branch */
FAKE_RELOC (FIRST_INVALID_RELOC2, 104)
FAKE_RELOC (LAST_INVALID_RELOC2, 248)
RELOC_NUMBER (R_ARM_RXPC25, 249)
diff --git a/include/elf/avr.h b/include/elf/avr.h
new file mode 100644
index 000000000..152745599
--- /dev/null
+++ b/include/elf/avr.h
@@ -0,0 +1,58 @@
+/* AVR ELF support for BFD.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Denis Chertykov <denisc@overta.ru>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _ELF_AVR_H
+#define _ELF_AVR_H
+
+#include "elf/reloc-macros.h"
+
+/* Processor specific flags for the ELF header e_flags field. */
+#define EF_AVR_MACH 0xf
+
+#define E_AVR_MACH_AVR1 1
+#define E_AVR_MACH_AVR2 2
+#define E_AVR_MACH_AVR3 3
+#define E_AVR_MACH_AVR4 4
+
+/* Relocations. */
+START_RELOC_NUMBERS (elf_avr_reloc_type)
+ RELOC_NUMBER (R_AVR_NONE, 0)
+ RELOC_NUMBER (R_AVR_32, 1)
+ RELOC_NUMBER (R_AVR_7_PCREL, 2)
+ RELOC_NUMBER (R_AVR_13_PCREL, 3)
+ RELOC_NUMBER (R_AVR_16, 4)
+ RELOC_NUMBER (R_AVR_16_PM, 5)
+ RELOC_NUMBER (R_AVR_LO8_LDI, 6)
+ RELOC_NUMBER (R_AVR_HI8_LDI, 7)
+ RELOC_NUMBER (R_AVR_HH8_LDI, 8)
+ RELOC_NUMBER (R_AVR_LO8_LDI_NEG, 9)
+ RELOC_NUMBER (R_AVR_HI8_LDI_NEG, 10)
+ RELOC_NUMBER (R_AVR_HH8_LDI_NEG, 11)
+ RELOC_NUMBER (R_AVR_LO8_LDI_PM, 12)
+ RELOC_NUMBER (R_AVR_HI8_LDI_PM, 13)
+ RELOC_NUMBER (R_AVR_HH8_LDI_PM, 14)
+ RELOC_NUMBER (R_AVR_LO8_LDI_PM_NEG, 15)
+ RELOC_NUMBER (R_AVR_HI8_LDI_PM_NEG, 16)
+ RELOC_NUMBER (R_AVR_HH8_LDI_PM_NEG, 17)
+ RELOC_NUMBER (R_AVR_CALL, 18)
+ EMPTY_RELOC (R_AVR_max)
+END_RELOC_NUMBERS
+
+#endif /* _ELF_AVR_H */
diff --git a/include/elf/common.h b/include/elf/common.h
index cda3ba0d9..fe8c2169d 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1,5 +1,6 @@
/* ELF support for BFD.
- Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -59,7 +60,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EI_OSABI 7 /* Operating System/ABI indication */
#define ELFOSABI_SYSV 0 /* UNIX System V ABI */
#define ELFOSABI_HPUX 1 /* HP-UX operating system */
+#define ELFOSABI_LINUX 3 /* GNU/Linux */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+#define ELFOSABI_ARM 97 /* ARM */
#define EI_ABIVERSION 8 /* ABI version */
@@ -89,19 +92,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EM_486 6 /* Intel 80486 */
#define EM_860 7 /* Intel 80860 */
#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
-#define EM_S370 9 /* Amdahl */
-#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
+#define EM_S370 9 /* IBM System/370 */
+#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ /* Depreciated */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian (Oct 4 1999 Draft)*/ /* Depreciated */
#define EM_PARISC 15 /* HPPA */
+
#define EM_VPP550 17 /* Fujitsu VPP500 */
#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* 64-bit PowerPC */
#define EM_V800 36 /* NEC V800 series */
#define EM_FR20 37 /* Fujitsu FR20 */
#define EM_RH32 38 /* TRW RH32 */
-#define EM_MCORE 39 /* Motorolla MCore */ /* May also be taken by Fujitsu MMA */
+#define EM_MCORE 39 /* Motorola M*Core */ /* May also be taken by Fujitsu MMA */
+#define EM_RCE 39 /* Old name for MCore */
#define EM_ARM 40 /* ARM */
#define EM_OLD_ALPHA 41 /* Digital Alpha */
#define EM_SH 42 /* Hitachi SH */
@@ -112,10 +119,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
-#define EM_IA_64 50 /* Intel MercedTM Processor */
+#define EM_IA_64 50 /* Intel IA-64 Processor */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola Coldfire */
#define EM_68HC12 53 /* Motorola M68HC12 */
+#define EM_MMA 54 /* Fujitsu Multimedia Accelerator */
+#define EM_PCP 55 /* Siemens PCP */
+#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */
+#define EM_NDR1 57 /* Denso NDR1 microprocesspr */
+#define EM_STARCORE 58 /* Motorola Star*Core processor */
+#define EM_ME16 59 /* Toyota ME16 processor */
+#define EM_ST100 60 /* STMicroelectronics ST100 processor */
+#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor */
+
+#define EM_FX66 66 /* Siemens FX66 microcontroller */
+#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */
+#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */
+#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */
+#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */
+#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */
+#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */
+#define EM_SVX 73 /* Silicon Graphics SVx */
+#define EM_ST19 74 /* STMicroelectronics ST19 8-bit microcontroller */
+#define EM_VAX 75 /* Digital VAX */
+
+#define EM_PJ 99 /* picoJava */
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
@@ -161,6 +189,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* FR30 magic number - no EABI available. */
#define EM_CYGNUS_FR30 0x3330
+/* AVR magic number
+ Written in the absense of an ABI. */
+#define EM_AVR 0x1057
+
/* See the above comment before you add a new EM_* value here. */
/* Values for e_version */
@@ -187,7 +219,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define PF_X (1 << 0) /* Segment is executable */
#define PF_W (1 << 1) /* Segment is writable */
#define PF_R (1 << 2) /* Segment is readable */
-#define PF_MASKOS 0x0F000000 /* OS-specific reserved bits */
+/* #define PF_MASKOS 0x0F000000 *//* OS-specific reserved bits */
+#define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
/* Values for section header, sh_type field */
@@ -205,6 +238,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define SHT_SHLIB 10 /* Reserved, unspecified semantics */
#define SHT_DYNSYM 11 /* Dynamic linking symbol table */
+#define SHT_INIT_ARRAY 14 /* Array of pointers to init functions */
+#define SHT_FINI_ARRAY 15 /* Array of pointers to finish functions */
+#define SHT_PREINIT_ARRAY 16 /* Array of pointers to pre-init functions */
+
#define SHT_LOOS 0x60000000 /* Operating system specific semantics, lo */
#define SHT_HIOS 0x6fffffff /* Operating system specific semantics, hi */
@@ -222,14 +259,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define SHT_LOPROC 0x70000000 /* Processor-specific semantics, lo */
#define SHT_HIPROC 0x7FFFFFFF /* Processor-specific semantics, hi */
#define SHT_LOUSER 0x80000000 /* Application-specific semantics */
-#define SHT_HIUSER 0x8FFFFFFF /* Application-specific semantics */
+/* #define SHT_HIUSER 0x8FFFFFFF *//* Application-specific semantics */
+#define SHT_HIUSER 0xFFFFFFFF /* New value, defined in Oct 4, 1999 Draft */
/* Values for section header, sh_flags field */
#define SHF_WRITE (1 << 0) /* Writable data during execution */
#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
#define SHF_EXECINSTR (1 << 2) /* Executable machine instructions */
-#define SHF_MASKOS 0x0F000000 /* OS-specific semantics */
+#define SHF_MERGE (1 << 4) /* Data in this section can be merged */
+#define SHF_STRINGS (1 << 5) /* Contains null terminated character strings */
+#define SHF_INFO_LINK (1 << 6) /* sh_info holds section header table index */
+#define SHF_LINK_ORDER (1 << 7) /* Preserve section ordering when linking */
+#define SHF_OS_NONCONFORMING (1 << 8) /* OS specifci processing required */
+
+/* #define SHF_MASKOS 0x0F000000 *//* OS-specific semantics */
+#define SHF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
#define SHF_MASKPROC 0xF0000000 /* Processor-specific semantics */
/* Values of note segment descriptor types for core files. */
@@ -237,6 +282,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
+#define NT_TASKSTRUCT 4 /* Contains copy of task struct */
+#define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */
+ /* note name must be "LINUX". */
/* Note segments for core files on dir-style procfs systems. */
@@ -245,6 +293,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NT_PSINFO 13 /* Has a struct psinfo */
#define NT_LWPSTATUS 16 /* Has a struct lwpstatus_t */
#define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */
+#define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */
/* Values of note segment descriptor types for object files. */
/* (Only for hppa right now. Should this be moved elsewhere?) */
@@ -259,6 +308,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ELF_ST_TYPE(val) ((val) & 0xF)
#define ELF_ST_INFO(bind,type) (((bind) << 4) + ((type) & 0xF))
+/* The 64bit and 32bit versions of these macros are identical, but
+ the ELF spec defines them, so here they are. */
+#define ELF32_ST_BIND ELF_ST_BIND
+#define ELF32_ST_TYPE ELF_ST_TYPE
+#define ELF32_ST_INFO ELF_ST_INFO
+#define ELF64_ST_BIND ELF_ST_BIND
+#define ELF64_ST_TYPE ELF_ST_TYPE
+#define ELF64_ST_INFO ELF_ST_INFO
+
+/* This macro disassembles and assembles a symbol's visibility into
+ the st_other field. The STV_ defines specificy the actual visibility. */
+
+#define ELF_ST_VISIBILITY(v) ((v) & 0x3)
+/* The remaining bits in the st_other field are not currently used.
+ They should be set to zero. */
+
+#define ELF32_ST_VISIBILITY ELF_ST_VISIBILITY
+#define ELF64_ST_VISIBILITY ELF_ST_VISIBILITY
+
+
#define STN_UNDEF 0 /* undefined symbol index */
#define STB_LOCAL 0 /* Symbol not visible outside obj */
@@ -274,6 +343,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define STT_FUNC 2 /* Symbol is a code object */
#define STT_SECTION 3 /* Symbol associated with a section */
#define STT_FILE 4 /* Symbol gives a file name */
+#define STT_COMMON 5 /* An uninitialised common block */
#define STT_LOOS 10 /* OS-specific semantics */
#define STT_HIOS 12 /* OS-specific semantics */
#define STT_LOPROC 13 /* Application-specific semantics */
@@ -292,6 +362,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define SHN_COMMON 0xFFF2 /* Associated symbol is in common */
#define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */
+/* The following constants control how a symbol may be accessed once it has
+ become part of an executable or shared library. */
+
+#define STV_DEFAULT 0 /* Visibility is specified by binding type */
+#define STV_INTERNAL 1 /* OS specific version of STV_HIDDEN */
+#define STV_HIDDEN 2 /* Can only be seen inside currect component */
+#define STV_PROTECTED 3 /* Treat as STB_LOCAL inside current component */
+
+
/* relocation info handling macros */
#define ELF32_R_SYM(i) ((i) >> 8)
@@ -333,12 +412,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define DT_FINI_ARRAY 26
#define DT_INIT_ARRAYSZ 27
#define DT_FINI_ARRAYSZ 28
+#define DT_RUNPATH 29
+#define DT_FLAGS 30
-#define DT_LOOS 0x60000000
-#define DT_HIOS 0x6fffffff
+#define DT_ENCODING 32
+#define DT_PREINIT_ARRAY 32
+#define DT_PREINIT_ARRAYSZ 33
+
+/* Note, the Oct 4, 1999 draft of the ELF ABI changed the values
+ for DT_LOOS and DT_HIOS. Some implementations however, use
+ values outside of the new range (see below). */
+#define OLD_DT_LOOS 0x60000000
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6fff0000
+#define OLD_DT_HIOS 0x6fffffff
+
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
/* The next four dynamic tags are used on Solaris. We support them
- everywhere. */
+ everywhere. Note these values lie outside of the (new) range for
+ OS specific values. This is a deliberate special case and we
+ maintain it for backwards compatability. */
#define DT_VALRNGLO 0x6ffffd00
#define DT_PLTPADSZ 0x6ffffdf9
#define DT_MOVEENT 0x6ffffdfa
@@ -394,6 +489,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define DF_1_TRANS 0x00000200
#define DF_1_INTERPOSE 0x00000400
+/* Flag values for the DT_FLAGS entry. */
+#define DF_ORIGIN (1 << 0)
+#define DF_SYMBOLIC (1 << 1)
+#define DF_TEXTREL (1 << 2)
+#define DF_BIND_NOW (1 << 3)
+
/* These constants are used for the version number of a Elf32_Verdef
structure. */
diff --git a/include/elf/dwarf.h b/include/elf/dwarf.h
index 4333d5eda..1e72cd70d 100644
--- a/include/elf/dwarf.h
+++ b/include/elf/dwarf.h
@@ -3,7 +3,7 @@
Written by Ron Guilmette (rfg@ncd.com)
-Copyright (C) 1992 Free Software Foundation, Inc.
+Copyright (C) 1992, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -301,7 +301,8 @@ enum dwarf_source_language {
/* GNU extensions */
- LANG_CHILL = 0x00009af3 /* random value for GNU Chill */
+ LANG_CHILL = 0x00009af3, /* random value for GNU Chill */
+ LANG_JAVA = 0x00009af4 /* random value + 1 for GNU Java */
};
#define LANG_lo_user 0x00008000 /* implementation-defined range start */
diff --git a/include/elf/dwarf2.h b/include/elf/dwarf2.h
index b2cbb24d9..1bd4fa6ca 100644
--- a/include/elf/dwarf2.h
+++ b/include/elf/dwarf2.h
@@ -616,6 +616,7 @@ enum dwarf_source_language
DW_LANG_Fortran90 = 0x0008,
DW_LANG_Pascal83 = 0x0009,
DW_LANG_Modula2 = 0x000a,
+ DW_LANG_Java = 0x9af4,
DW_LANG_Mips_Assembler = 0x8001
};
diff --git a/include/elf/hppa.h b/include/elf/hppa.h
index 2952e2398..0e45d7451 100644
--- a/include/elf/hppa.h
+++ b/include/elf/hppa.h
@@ -1,5 +1,5 @@
/* HPPA ELF support for BFD.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,87 +25,92 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Processor specific flags for the ELF header e_flags field. */
-/* Target processor IDs to be placed in the low 16 bits of the flags
- field. Note these names are shared with SOM, and therefore do not
- follow ELF naming conventions. */
+/* Trap null address dereferences. */
+#define EF_PARISC_TRAPNIL 0x00010000
-/* PA 1.0 big endian. */
-#ifndef CPU_PA_RISC1_0
-#define CPU_PA_RISC1_0 0x0000020b
-#endif
+/* .PARISC.archext section is present. */
+#define EF_PARISC_EXT 0x00020000
-/* PA 1.1 big endian. */
-#ifndef CPU_PA_RISC1_1
-#define CPU_PA_RISC1_1 0x00000210
-#endif
+/* Program expects little-endian mode. */
+#define EF_PARISC_LSB 0x00040000
-/* PA 1.0 little endian (unsupported) is 0x0000028b. */
-/* PA 1.1 little endian (unsupported) is 0x00000290. */
+/* Program expects wide mode. */
+#define EF_PARISC_WIDE 0x00080000
-/* Trap null address dereferences. */
-#define ELF_PARISC_TRAPNIL 0x00010000
+/* Do not allow kernel-assisted branch prediction. */
+#define EF_PARISC_NO_KABP 0x00100000
-/* .PARISC.archext section is present. */
-#define EF_PARISC_EXT 0x00020000
+/* Allow lazy swap for dynamically allocated program segments. */
+#define EF_PARISC_LAZYSWAP 0x00400000
-/* Processor specific section types. */
+/* Architecture version */
+#define EF_PARISC_ARCH 0x0000ffff
-/* Holds the global offset table, a table of pointers to external
- data. */
-#define SHT_PARISC_GOT SHT_LOPROC+0
+#define EFA_PARISC_1_0 0x020b
+#define EFA_PARISC_1_1 0x0210
+#define EFA_PARISC_2_0 0x0214
-/* Nonloadable section containing information in architecture
- extensions used by the code. */
-#define SHT_PARISC_ARCH SHT_LOPROC+1
+/* Special section indices. */
+/* A symbol that has been declared as a tentative definition in an ANSI C
+ compilation. */
+#define SHN_PARISC_ANSI_COMMON 0xff00
-/* Section in which $global$ is defined. */
-#define SHT_PARISC_GLOBAL SHT_LOPROC+2
+/* A symbol that has been declared as a common block using the
+ huge memory model. */
+#define SHN_PARISC_HUGE_COMMON 0xff01
-/* Section holding millicode routines (mul, div, rem, dyncall, etc. */
-#define SHT_PARISC_MILLI SHT_LOPROC+3
+/* Processor specific section types. */
+
+/* Section contains product specific extension bits. */
+#define SHT_PARISC_EXT 0x70000000
-/* Section holding unwind information for use by debuggers. */
-#define SHT_PARISC_UNWIND SHT_LOPROC+4
+/* Section contains unwind table entries. */
+#define SHT_PARISC_UNWIND 0x70000001
-/* Section holding the procedure linkage table. */
-#define SHT_PARISC_PLT SHT_LOPROC+5
+/* Section contains debug information for optimized code. */
+#define SHT_PARISC_DOC 0x70000002
-/* Short initialized and uninitialized data. */
-#define SHT_PARISC_SDATA SHT_LOPROC+6
-#define SHT_PARISC_SBSS SHT_LOPROC+7
+/* Section contains code annotations. */
+#define SHT_PARISC_ANNOT 0x70000003
+/* These are strictly for compatibility with the older elf32-hppa
+ implementation. Hopefully we can eliminate them in the future. */
/* Optional section holding argument location/relocation info. */
-#define SHT_PARISC_SYMEXTN SHT_LOPROC+8
+#define SHT_PARISC_SYMEXTN SHT_LOPROC+8
/* Option section for linker stubs. */
-#define SHT_PARISC_STUBS SHT_LOPROC+9
+#define SHT_PARISC_STUBS SHT_LOPROC+9
/* Processor specific section flags. */
-/* This section is near the global data pointer and thus allows short
- addressing modes to be used. */
-#define SHF_PARISC_SHORT 0x20000000
+/* Section contains code compiled for static branch prediction. */
+#define SHF_PARISC_SBP 0x80000000
+
+/* Section should be allocated from from GP. */
+#define SHF_PARISC_HUGE 0x40000000
-/* Processor specific symbol types. */
+/* Section should go near GP. */
+#define SHF_PARISC_SHORT 0x20000000
-/* Millicode function entry point. */
-#define STT_PARISC_MILLICODE STT_LOPROC+0
+/* Identifies the entry point of a millicode routine. */
+#define STT_PARISC_MILLI 13
/* ELF/HPPA relocation types */
-#include "reloc-macros.h"
+/* Note: PA-ELF is defined to use only RELA relocations. */
+#include "elf/reloc-macros.h"
-START_RELOC_NUMBERS (elf32_hppa_reloc_type)
+START_RELOC_NUMBERS (elf_hppa_reloc_type)
RELOC_NUMBER (R_PARISC_NONE, 0) /* No reloc */
-
+
/* These relocation types do simple base + offset relocations. */
- RELOC_NUMBER (R_PARISC_DIR32, 0x01)
- RELOC_NUMBER (R_PARISC_DIR21L, 0x02)
- RELOC_NUMBER (R_PARISC_DIR17R, 0x03)
- RELOC_NUMBER (R_PARISC_DIR17F, 0x04)
- RELOC_NUMBER (R_PARISC_DIR14R, 0x06)
+ RELOC_NUMBER (R_PARISC_DIR32, 1)
+ RELOC_NUMBER (R_PARISC_DIR21L, 2)
+ RELOC_NUMBER (R_PARISC_DIR17R, 3)
+ RELOC_NUMBER (R_PARISC_DIR17F, 4)
+ RELOC_NUMBER (R_PARISC_DIR14R, 6)
/* PC-relative relocation types
Typically used for calls.
@@ -113,25 +118,28 @@ START_RELOC_NUMBERS (elf32_hppa_reloc_type)
PCREL17C never reports a relocation error.
When supporting argument relocations, function calls must be
- accompanied by parameter relocation information. This information is
+ accompanied by parameter relocation information. This information is
carried in the ten high-order bits of the addend field. The remaining
22 bits of of the addend field are sign-extended to form the Addend.
- Note the code to build argument relocations depends on the
+ Note the code to build argument relocations depends on the
addend being zero. A consequence of this limitation is GAS
can not perform relocation reductions for function symbols. */
-
- RELOC_NUMBER (R_PARISC_PCREL21L, 0x0a)
- RELOC_NUMBER (R_PARISC_PCREL17R, 0x0b)
- RELOC_NUMBER (R_PARISC_PCREL17F, 0x0c)
- RELOC_NUMBER (R_PARISC_PCREL17C, 0x0d)
- RELOC_NUMBER (R_PARISC_PCREL14R, 0x0e)
- RELOC_NUMBER (R_PARISC_PCREL14F, 0x0f)
+
+ RELOC_NUMBER (R_PARISC_PCREL32, 9)
+ RELOC_NUMBER (R_PARISC_PCREL21L, 10)
+ RELOC_NUMBER (R_PARISC_PCREL17R, 11)
+ RELOC_NUMBER (R_PARISC_PCREL17F, 12)
+ RELOC_NUMBER (R_PARISC_PCREL17C, 13)
+ RELOC_NUMBER (R_PARISC_PCREL14R, 14)
+ RELOC_NUMBER (R_PARISC_PCREL14F, 15)
/* DP-relative relocation types. */
- RELOC_NUMBER (R_PARISC_DPREL21L, 0x12)
- RELOC_NUMBER (R_PARISC_DPREL14R, 0x16)
- RELOC_NUMBER (R_PARISC_DPREL14F, 0x17)
+ RELOC_NUMBER (R_PARISC_DPREL21L, 18)
+ RELOC_NUMBER (R_PARISC_DPREL14WR, 19)
+ RELOC_NUMBER (R_PARISC_DPREL14DR, 20)
+ RELOC_NUMBER (R_PARISC_DPREL14R, 22)
+ RELOC_NUMBER (R_PARISC_DPREL14F, 23)
/* Data linkage table (DLT) relocation types
@@ -139,49 +147,190 @@ START_RELOC_NUMBERS (elf32_hppa_reloc_type)
from position-independent code within shared libraries. They are
similar to the GOT relocation types in some SVR4 implementations. */
- RELOC_NUMBER (R_PARISC_DLTREL21L, 0x1a)
- RELOC_NUMBER (R_PARISC_DLTREL14R, 0x1e)
- RELOC_NUMBER (R_PARISC_DLTREL14F, 0x1f)
+ RELOC_NUMBER (R_PARISC_DLTREL21L, 26)
+ RELOC_NUMBER (R_PARISC_DLTREL14R, 30)
+ RELOC_NUMBER (R_PARISC_DLTREL14F, 31)
/* DLT indirect relocation types */
- RELOC_NUMBER (R_PARISC_DLTIND21L, 0x22)
- RELOC_NUMBER (R_PARISC_DLTIND14R, 0x26)
- RELOC_NUMBER (R_PARISC_DLTIND14F, 0x27)
+ RELOC_NUMBER (R_PARISC_DLTIND21L, 34)
+ RELOC_NUMBER (R_PARISC_DLTIND14R, 38)
+ RELOC_NUMBER (R_PARISC_DLTIND14F, 39)
/* Base relative relocation types. Ugh. These imply lots of state */
- RELOC_NUMBER (R_PARISC_SETBASE, 0x28)
- RELOC_NUMBER (R_PARISC_BASEREL32, 0x29)
- RELOC_NUMBER (R_PARISC_BASEREL21L, 0x2a)
- RELOC_NUMBER (R_PARISC_BASEREL17R, 0x2b)
- RELOC_NUMBER (R_PARISC_BASEREL17F, 0x2c)
- RELOC_NUMBER (R_PARISC_BASEREL14R, 0x2e)
- RELOC_NUMBER (R_PARISC_BASEREL14F, 0x2f)
+ RELOC_NUMBER (R_PARISC_SETBASE, 40)
+ RELOC_NUMBER (R_PARISC_SECREL32, 41)
+ RELOC_NUMBER (R_PARISC_BASEREL21L, 42)
+ RELOC_NUMBER (R_PARISC_BASEREL17R, 43)
+ RELOC_NUMBER (R_PARISC_BASEREL17F, 44)
+ RELOC_NUMBER (R_PARISC_BASEREL14R, 46)
+ RELOC_NUMBER (R_PARISC_BASEREL14F, 47)
/* Segment relative relocation types. */
- RELOC_NUMBER (R_PARISC_TEXTREL32, 0x31)
- RELOC_NUMBER (R_PARISC_DATAREL32, 0x39)
+ RELOC_NUMBER (R_PARISC_SEGBASE, 48)
+ RELOC_NUMBER (R_PARISC_SEGREL32, 49)
+
+ /* Offsets from the PLT. */
+ RELOC_NUMBER (R_PARISC_PLTOFF21L, 50)
+ RELOC_NUMBER (R_PARISC_PLTOFF14R, 54)
+ RELOC_NUMBER (R_PARISC_PLTOFF14F, 55)
+
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR32, 57)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR21L, 58)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR14R, 62)
+
+ RELOC_NUMBER (R_PARISC_FPTR64, 64)
/* Plabel relocation types. */
- RELOC_NUMBER (R_PARISC_PLABEL32, 0x41)
- RELOC_NUMBER (R_PARISC_PLABEL21L, 0x42)
- RELOC_NUMBER (R_PARISC_PLABEL14R, 0x46)
-
- /* PLT relocations. */
- RELOC_NUMBER (R_PARISC_PLTIND21L, 0x82)
- RELOC_NUMBER (R_PARISC_PLTIND14R, 0x86)
- RELOC_NUMBER (R_PARISC_PLTIND14F, 0x87)
-
- /* Misc relocation types. */
- RELOC_NUMBER (R_PARISC_COPY, 0x88)
- RELOC_NUMBER (R_PARISC_GLOB_DAT, 0x89)
- RELOC_NUMBER (R_PARISC_JMP_SLOT, 0x8a)
- RELOC_NUMBER (R_PARISC_RELATIVE, 0x8b)
-
- EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
+ RELOC_NUMBER (R_PARISC_PLABEL32, 65)
+ RELOC_NUMBER (R_PARISC_PLABEL21L, 66)
+ RELOC_NUMBER (R_PARISC_PLABEL14R, 70)
+
+ /* PCREL relocations. */
+ RELOC_NUMBER (R_PARISC_PCREL64, 72)
+ RELOC_NUMBER (R_PARISC_PCREL22C, 73)
+ RELOC_NUMBER (R_PARISC_PCREL22F, 74)
+ RELOC_NUMBER (R_PARISC_PCREL14WR, 75)
+ RELOC_NUMBER (R_PARISC_PCREL14DR, 76)
+ RELOC_NUMBER (R_PARISC_PCREL16F, 77)
+ RELOC_NUMBER (R_PARISC_PCREL16WF, 78)
+ RELOC_NUMBER (R_PARISC_PCREL16DF, 79)
+
+
+ RELOC_NUMBER (R_PARISC_DIR64, 80)
+ RELOC_NUMBER (R_PARISC_DIR64WR, 81)
+ RELOC_NUMBER (R_PARISC_DIR64DR, 82)
+ RELOC_NUMBER (R_PARISC_DIR14WR, 83)
+ RELOC_NUMBER (R_PARISC_DIR14DR, 84)
+ RELOC_NUMBER (R_PARISC_DIR16F, 85)
+ RELOC_NUMBER (R_PARISC_DIR16WF, 86)
+ RELOC_NUMBER (R_PARISC_DIR16DF, 87)
+
+ RELOC_NUMBER (R_PARISC_GPREL64, 88)
+
+ RELOC_NUMBER (R_PARISC_DLTREL14WR, 91)
+ RELOC_NUMBER (R_PARISC_DLTREL14DR, 92)
+ RELOC_NUMBER (R_PARISC_GPREL16F, 93)
+ RELOC_NUMBER (R_PARISC_GPREL16WF, 94)
+ RELOC_NUMBER (R_PARISC_GPREL16DF, 95)
+
+
+ RELOC_NUMBER (R_PARISC_LTOFF64, 96)
+ RELOC_NUMBER (R_PARISC_DLTIND14WR, 99)
+ RELOC_NUMBER (R_PARISC_DLTIND14DR, 100)
+ RELOC_NUMBER (R_PARISC_LTOFF16F, 101)
+ RELOC_NUMBER (R_PARISC_LTOFF16WF, 102)
+ RELOC_NUMBER (R_PARISC_LTOFF16DF, 103)
+
+ RELOC_NUMBER (R_PARISC_SECREL64, 104)
+
+ RELOC_NUMBER (R_PARISC_BASEREL14WR, 107)
+ RELOC_NUMBER (R_PARISC_BASEREL14DR, 108)
+
+ RELOC_NUMBER (R_PARISC_SEGREL64, 112)
+
+ RELOC_NUMBER (R_PARISC_PLTOFF14WR, 115)
+ RELOC_NUMBER (R_PARISC_PLTOFF14DR, 116)
+ RELOC_NUMBER (R_PARISC_PLTOFF16F, 117)
+ RELOC_NUMBER (R_PARISC_PLTOFF16WF, 118)
+ RELOC_NUMBER (R_PARISC_PLTOFF16DF, 119)
+
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR64, 120)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR14WR, 123)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR14DR, 124)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR16F, 125)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR16WF, 126)
+ RELOC_NUMBER (R_PARISC_LTOFF_FPTR16DF, 127)
+
+
+ RELOC_NUMBER (R_PARISC_COPY, 128)
+ RELOC_NUMBER (R_PARISC_IPLT, 129)
+ RELOC_NUMBER (R_PARISC_EPLT, 130)
+
+ RELOC_NUMBER (R_PARISC_TPREL32, 153)
+ RELOC_NUMBER (R_PARISC_TPREL21L, 154)
+ RELOC_NUMBER (R_PARISC_TPREL14R, 158)
+
+ RELOC_NUMBER (R_PARISC_LTOFF_TP21L, 162)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP14R, 166)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP14F, 167)
+
+ RELOC_NUMBER (R_PARISC_TPREL64, 216)
+ RELOC_NUMBER (R_PARISC_TPREL14WR, 219)
+ RELOC_NUMBER (R_PARISC_TPREL14DR, 220)
+ RELOC_NUMBER (R_PARISC_TPREL16F, 221)
+ RELOC_NUMBER (R_PARISC_TPREL16WF, 222)
+ RELOC_NUMBER (R_PARISC_TPREL16DF, 223)
+
+ RELOC_NUMBER (R_PARISC_LTOFF_TP64, 224)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP14WR, 227)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP14DR, 228)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP16F, 229)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP16WF, 230)
+ RELOC_NUMBER (R_PARISC_LTOFF_TP16DF, 231)
+ EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
END_RELOC_NUMBERS
#ifndef RELOC_MACROS_GEN_FUNC
-typedef enum elf32_hppa_reloc_type elf32_hppa_reloc_type;
+typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
#endif
+#define PT_PARISC_ARCHEXT 0x70000000
+#define PT_PARISC_UNWIND 0x70000001
+#define PF_PARISC_SBP 0x08000000
+#define PF_HP_PAGE_SIZE 0x00100000
+#define PF_HP_FAR_SHARED 0x00200000
+#define PF_HP_NEAR_SHARED 0x00400000
+#define PF_HP_CODE 0x01000000
+#define PF_HP_MODIFY 0x02000000
+#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_SBP 0x08000000
+
+
+/* Processor specific dynamic array tags. */
+
+#define DT_HP_LOAD_MAP (DT_LOOS + 0x0)
+#define DT_HP_DLD_FLAGS (DT_LOOS + 0x1)
+#define DT_HP_DLD_HOOK (DT_LOOS + 0x2)
+#define DT_HP_UX10_INIT (DT_LOOS + 0x3)
+#define DT_HP_UX10_INITSZ (DT_LOOS + 0x4)
+#define DT_HP_PREINIT (DT_LOOS + 0x5)
+#define DT_HP_PREINITSZ (DT_LOOS + 0x6)
+#define DT_HP_NEEDED (DT_LOOS + 0x7)
+#define DT_HP_TIME_STAMP (DT_LOOS + 0x8)
+#define DT_HP_CHECKSUM (DT_LOOS + 0x9)
+#define DT_HP_GST_SIZE (DT_LOOS + 0xa)
+#define DT_HP_GST_VERSION (DT_LOOS + 0xb)
+#define DT_HP_GST_HASHVAL (DT_LOOS + 0xc)
+
+/* Values for DT_HP_DLD_FLAGS. */
+#define DT_HP_DEBUG_PRIVATE 0x0001 /* Map text private */
+#define DT_HP_DEBUG_CALLBACK 0x0002 /* Callback */
+#define DT_HP_DEBUG_CALLBACK_BOR 0x0004 /* BOR callback */
+#define DT_HP_NO_ENVVAR 0x0008 /* No env var */
+#define DT_HP_BIND_NOW 0x0010 /* Bind now */
+#define DT_HP_BIND_NONFATAL 0x0020 /* Bind non-fatal */
+#define DT_HP_BIND_VERBOSE 0x0040 /* Bind verbose */
+#define DT_HP_BIND_RESTRICTED 0x0080 /* Bind restricted */
+#define DT_HP_BIND_SYMBOLIC 0x0100 /* Bind symbolic */
+#define DT_HP_RPATH_FIRST 0x0200 /* RPATH first */
+#define DT_HP_BIND_DEPTH_FIRST 0x0400 /* Bind depth-first */
+
+/* Program header extensions. */
+#define PT_HP_TLS (PT_LOOS + 0x0)
+#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
+#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
+#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
+#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
+#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
+#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
+#define PT_HP_PARALLEL (PT_LOOS + 0x10)
+#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+
+/* Additional symbol types. */
+#define STT_HP_OPAQUE (STT_LOOS + 0x1)
+#define STT_HP_STUB (STT_LOOS + 0x2)
+
#endif /* _ELF_HPPA_H */
diff --git a/include/elf/i370.h b/include/elf/i370.h
new file mode 100644
index 000000000..9c021f00e
--- /dev/null
+++ b/include/elf/i370.h
@@ -0,0 +1,46 @@
+/* i370 ELF support for BFD.
+ Copyright (C) 1995, 2000 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file holds definitions specific to the i370 ELF ABI. Note
+ that most of this is not actually implemented by BFD. */
+
+#ifndef _ELF_I370_H
+#define _ELF_I370_H
+
+/* Processor specific section headers, sh_type field */
+
+#define SHT_ORDERED SHT_HIPROC /* Link editor is to sort the \
+ entries in this section \
+ based on the address \
+ specified in the associated \
+ symbol table entry. */
+
+#define EF_I370_RELOCATABLE 0x00010000 /* i370 -mrelocatable flag */
+#define EF_I370_RELOCATABLE_LIB 0x00008000 /* i370 -mrelocatable-lib flag */
+/* Processor specific section flags, sh_flags field */
+
+#define SHF_EXCLUDE 0x80000000 /* Link editor is to exclude \
+ this section from executable \
+ and shared objects that it \
+ builds when those objects \
+ are not to be furhter \
+ relocated. */
+#endif /* _ELF_I370_H */
+
+
diff --git a/include/elf/i386.h b/include/elf/i386.h
index 219f10511..058666172 100644
--- a/include/elf/i386.h
+++ b/include/elf/i386.h
@@ -20,7 +20,7 @@
#ifndef _ELF_I386_H
#define _ELF_I386_H
-#include "reloc-macros.h"
+#include "elf/reloc-macros.h"
START_RELOC_NUMBERS (elf_i386_reloc_type)
RELOC_NUMBER (R_386_NONE, 0) /* No reloc */
diff --git a/include/elf/i960.h b/include/elf/i960.h
new file mode 100644
index 000000000..3e60289ea
--- /dev/null
+++ b/include/elf/i960.h
@@ -0,0 +1,38 @@
+/* Intel 960 ELF support for BFD.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _ELF_I960_H
+#define _ELF_I960_H
+
+#include "elf/reloc-macros.h"
+
+
+START_RELOC_NUMBERS (elf_i960_reloc_type)
+ RELOC_NUMBER (R_960_NONE, 0)
+ RELOC_NUMBER (R_960_12, 1)
+ RELOC_NUMBER (R_960_32, 2)
+ RELOC_NUMBER (R_960_IP24, 3)
+ RELOC_NUMBER (R_960_SUB, 4)
+ RELOC_NUMBER (R_960_OPTCALL, 5)
+ RELOC_NUMBER (R_960_OPTCALLX, 6)
+ RELOC_NUMBER (R_960_OPTCALLXA, 7)
+ EMPTY_RELOC (R_960_max)
+END_RELOC_NUMBERS
+
+#endif /* _ELF_I960_H */
diff --git a/include/elf/m32r.h b/include/elf/m32r.h
index 0537d1369..a12ae16ae 100644
--- a/include/elf/m32r.h
+++ b/include/elf/m32r.h
@@ -62,5 +62,7 @@ END_RELOC_NUMBERS
/* m32r code. */
#define E_M32R_ARCH 0x00000000
+/* m32rx code. */
+#define E_M32RX_ARCH 0x10000000
#endif
diff --git a/include/elf/m68k.h b/include/elf/m68k.h
index db31cdcda..e2d51ef4a 100644
--- a/include/elf/m68k.h
+++ b/include/elf/m68k.h
@@ -53,4 +53,6 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type)
EMPTY_RELOC (R_68K_max)
END_RELOC_NUMBERS
+#define EF_CPU32 0x00810000
+
#endif
diff --git a/include/elf/mcore.h b/include/elf/mcore.h
index a7c4dad11..62a88c909 100644
--- a/include/elf/mcore.h
+++ b/include/elf/mcore.h
@@ -1,4 +1,4 @@
-/* Motorolla MCore support for BFD.
+/* Motorola MCore support for BFD.
Copyright (C) 1995, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -34,6 +34,10 @@ START_RELOC_NUMBERS (elf_mcore_reloc_type)
RELOC_NUMBER (R_MCORE_PCRELJSR_IMM11BY2, 6)
RELOC_NUMBER (R_MCORE_GNU_VTINHERIT, 7)
RELOC_NUMBER (R_MCORE_GNU_VTENTRY, 8)
+ RELOC_NUMBER (R_MCORE_RELATIVE, 9)
+ RELOC_NUMBER (R_MCORE_COPY, 10)
+ RELOC_NUMBER (R_MCORE_GLOB_DAT, 11)
+ RELOC_NUMBER (R_MCORE_JUMP_SLOT, 12)
EMPTY_RELOC (R_MCORE_max)
END_RELOC_NUMBERS
diff --git a/include/elf/mips.h b/include/elf/mips.h
index c967248da..1e2a9f99a 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -75,6 +75,12 @@ START_RELOC_NUMBERS (elf_mips_reloc_type)
/* These relocs are used for the mips16. */
RELOC_NUMBER (R_MIPS16_26, 100)
RELOC_NUMBER (R_MIPS16_GPREL, 101)
+ /* These are GNU extensions to handle embedded-pic. */
+ RELOC_NUMBER (R_MIPS_PC32, 248)
+ RELOC_NUMBER (R_MIPS_PC64, 249)
+ RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250)
+ RELOC_NUMBER (R_MIPS_GNU_REL_LO16, 251)
+ RELOC_NUMBER (R_MIPS_GNU_REL_HI16, 252)
/* These are GNU extensions to enable C++ vtable garbage collection. */
RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253)
RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254)
@@ -617,10 +623,10 @@ extern void bfd_mips_elf32_swap_reginfo_out
/* Special values for the st_other field in the symbol table. These
are used in an Irix 5 dynamic symbol table. */
-#define STO_DEFAULT 0x00
-#define STO_INTERNAL 0x01
-#define STO_HIDDEN 0x02
-#define STO_PROTECTED 0x03
+#define STO_DEFAULT STV_DEFAULT
+#define STO_INTERNAL STV_INTERNAL
+#define STO_HIDDEN STV_HIDDEN
+#define STO_PROTECTED STV_PROTECTED
/* This value is used for a mips16 .text symbol. */
#define STO_MIPS16 0xf0
@@ -816,6 +822,40 @@ typedef struct
bfd_vma ri_gp_value;
} Elf64_Internal_RegInfo;
+typedef struct
+{
+ /* The hash value computed from the name of the corresponding
+ dynamic symbol. */
+ unsigned char ms_hash_value[4];
+ /* Contains both the dynamic relocation index and the symbol flags
+ field. The macros ELF32_MS_REL_INDEX and ELF32_MS_FLAGS are used
+ to access the individual values. The dynamic relocation index
+ identifies the first entry in the .rel.dyn section that
+ references the dynamic symbol corresponding to this msym entry.
+ If the index is 0, no dynamic relocations are associated with the
+ symbol. The symbol flags field is reserved for future use. */
+ unsigned char ms_info[4];
+} Elf32_External_Msym;
+
+typedef struct
+{
+ /* The hash value computed from the name of the corresponding
+ dynamic symbol. */
+ unsigned long ms_hash_value;
+ /* Contains both the dynamic relocation index and the symbol flags
+ field. The macros ELF32_MS_REL_INDEX and ELF32_MS_FLAGS are used
+ to access the individual values. The dynamic relocation index
+ identifies the first entry in the .rel.dyn section that
+ references the dynamic symbol corresponding to this msym entry.
+ If the index is 0, no dynamic relocations are associated with the
+ symbol. The symbol flags field is reserved for future use. */
+ unsigned long ms_info;
+} Elf32_Internal_Msym;
+
+#define ELF32_MS_REL_INDEX(i) ((i) >> 8)
+#define ELF32_MS_FLAGS(i) (i) & 0xff)
+#define ELF32_MS_INFO(r, f) (((r) << 8) + ((f) & 0xff))
+
/* MIPS ELF reginfo swapping routines. */
extern void bfd_mips_elf64_swap_reginfo_in
PARAMS ((bfd *, const Elf64_External_RegInfo *, Elf64_Internal_RegInfo *));
diff --git a/include/elf/mn10300.h b/include/elf/mn10300.h
index 64a075045..1b90a1379 100644
--- a/include/elf/mn10300.h
+++ b/include/elf/mn10300.h
@@ -50,4 +50,5 @@ END_RELOC_NUMBERS
the rest are open. */
#define E_MN10300_MACH_MN10300 0x00810000
+#define E_MN10300_MACH_AM33 0x00820000
#endif /* _ELF_MN10300_H */
diff --git a/include/elf/pj.h b/include/elf/pj.h
new file mode 100644
index 000000000..6bb830652
--- /dev/null
+++ b/include/elf/pj.h
@@ -0,0 +1,45 @@
+/* picoJava ELF support for BFD.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _ELF_PJ_H
+#define _ELF_PJ_H
+
+#include "elf/reloc-macros.h"
+
+/* Relocations. */
+
+START_RELOC_NUMBERS (elf_pj_reloc_type)
+ RELOC_NUMBER (R_PJ_NONE, 0)
+ RELOC_NUMBER (R_PJ_DATA_DIR32, 1)
+ RELOC_NUMBER (R_PJ_CODE_REL32, 2)
+ RELOC_NUMBER (R_PJ_CODE_REL16, 3)
+ RELOC_NUMBER (R_PJ_CODE_DIR32, 6)
+ RELOC_NUMBER (R_PJ_CODE_DIR16, 7)
+ RELOC_NUMBER (R_PJ_CODE_LO16, 13)
+ RELOC_NUMBER (R_PJ_CODE_HI16, 14)
+ RELOC_NUMBER (R_PJ_GNU_VTINHERIT, 15)
+ RELOC_NUMBER (R_PJ_GNU_VTENTRY, 16)
+ EMPTY_RELOC (R_PJ_max)
+END_RELOC_NUMBERS
+
+#define EF_PICOJAVA_ARCH 0x0000000f
+#define EF_PICOJAVA_NEWCALLS 0x00000010
+#define EF_PICOJAVA_GNUCALLS 0x00000020 /* The (currently) non standard GNU calling convention */
+
+#endif
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index 976229129..42174caee 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -46,8 +46,8 @@
If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
following function will be generated:
- static char * foo PARAMS ((unsigned long rtype));
- static char *
+ static const char * foo PARAMS ((unsigned long rtype));
+ static const char *
foo (rtype)
unsigned long rtype;
{
diff --git a/include/elf/sh.h b/include/elf/sh.h
index 4a476679a..faee50994 100644
--- a/include/elf/sh.h
+++ b/include/elf/sh.h
@@ -20,6 +20,33 @@
#ifndef _ELF_SH_H
#define _ELF_SH_H
+/* Processor specific flags for the ELF header e_flags field. */
+
+#define EF_SH_MACH_MASK 0x1f
+#define EF_SH_UNKNOWN 0 /* For backwards compatibility. */
+#define EF_SH1 1
+#define EF_SH2 2
+#define EF_SH3 3
+#define EF_SH_HAS_DSP(flags) ((flags) & 4)
+#define EF_SH_DSP 4
+#define EF_SH3_DSP 5
+#define EF_SH_HAS_FP(flags) ((flags) & 8)
+#define EF_SH3E 8
+#define EF_SH4 9
+
+#define EF_SH_MERGE_MACH(mach1, mach2) \
+ (((((mach1) == EF_SH3 || (mach1) == EF_SH_UNKNOWN) && (mach2) == EF_SH_DSP) \
+ || ((mach1) == EF_SH_DSP \
+ && ((mach2) == EF_SH3 || (mach2) == EF_SH_UNKNOWN))) \
+ ? EF_SH3_DSP \
+ : (((mach1) < EF_SH3 && (mach2) == EF_SH_UNKNOWN) \
+ || ((mach2) < EF_SH3 && (mach1) == EF_SH_UNKNOWN)) \
+ ? EF_SH3 \
+ : (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \
+ || ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \
+ ? EF_SH4 \
+ : ((mach1) > (mach2) ? (mach1) : (mach2)))
+
#include "elf/reloc-macros.h"
/* Relocations. */
diff --git a/include/elf/sparc.h b/include/elf/sparc.h
index c9e4cdd40..390e4a844 100644
--- a/include/elf/sparc.h
+++ b/include/elf/sparc.h
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */
#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
+#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */
#define EF_SPARC_LEDATA 0x800000 /* little endian data */
@@ -128,6 +129,8 @@ START_RELOC_NUMBERS (elf_sparc_reloc_type)
/* little endian data relocs */
RELOC_NUMBER (R_SPARC_REV32, 56)
+ EMPTY_RELOC (R_SPARC_max_std)
+
RELOC_NUMBER (R_SPARC_GNU_VTINHERIT, 250)
RELOC_NUMBER (R_SPARC_GNU_VTENTRY, 251)
@@ -136,21 +139,15 @@ END_RELOC_NUMBERS
/* Relocation macros. */
-#define ELF64_R_TYPE_DATA(info) (((bfd_vma) (info) << 32) >> 40)
-#define ELF64_R_TYPE_ID(info) (((bfd_vma) (info) << 56) >> 56)
-#define ELF64_R_TYPE_INFO(data, type) (((bfd_vma) (data) << 8) \
- + (bfd_vma) (type))
-
-#define DT_SPARC_REGISTER 0x70000001
+#define ELF64_R_TYPE_DATA(info) \
+ (((bfd_signed_vma)(ELF64_R_TYPE(info) >> 8) ^ 0x800000) - 0x800000)
+#define ELF64_R_TYPE_ID(info) \
+ ((info) & 0xff)
+#define ELF64_R_TYPE_INFO(data, type) \
+ (((bfd_vma) ((data) & 0xffffff) << 8) | (bfd_vma) (type))
-/*
- * FIXME: NOT ABI -- GET RID OF THIS
- * Defines the format used by the .plt. Currently defined values are
- * 0 -- reserved to SI
- * 1 -- absolute address in .got.plt
- * 2 -- got-relative address in .got.plt
- */
+/* Values for Elf64_Dyn.d_tag. */
-#define DT_SPARC_PLTFMT 0x70000001
+#define DT_SPARC_REGISTER 0x70000001
#endif /* _ELF_SPARC_H */
diff --git a/include/hashtab.h b/include/hashtab.h
index 3990c14cb..5fe239391 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -38,69 +38,88 @@ extern "C" {
#include <ansidecl.h>
-/* The hash table element is represented by the following type. */
-
-typedef const void *hash_table_entry_t;
+/* Callback function pointer types. */
+
+/* Calculate hash of a table entry. */
+typedef unsigned int (*htab_hash) PARAMS ((const void *));
+
+/* Compare a table entry with a possible entry. The entry already in
+ the table always comes first, so the second element can be of a
+ different type (but in this case htab_find and htab_find_slot
+ cannot be used; instead the variants that accept a hash value
+ must be used). */
+typedef int (*htab_eq) PARAMS ((const void *, const void *));
+
+/* Cleanup function called whenever a live element is removed from
+ the hash table. */
+typedef void (*htab_del) PARAMS ((void *));
+
+/* Function called by htab_traverse for each live element. The first
+ arg is the slot of the element (which can be passed to htab_clear_slot
+ if desired), the second arg is the auxiliary pointer handed to
+ htab_traverse. Return 1 to continue scan, 0 to stop. */
+typedef int (*htab_trav) PARAMS ((void **, void *));
/* Hash tables are of the following type. The structure
(implementation) of this type is not needed for using the hash
tables. All work with hash table should be executed only through
functions mentioned below. */
-typedef struct hash_table
+struct htab
{
- /* Current size (in entries) of the hash table */
- size_t size;
- /* Current number of elements including also deleted elements */
- size_t number_of_elements;
- /* Current number of deleted elements in the table */
- size_t number_of_deleted_elements;
- /* The following member is used for debugging. Its value is number
- of all calls of `find_hash_table_entry' for the hash table. */
- int searches;
- /* The following member is used for debugging. Its value is number
- of collisions fixed for time of work with the hash table. */
- int collisions;
- /* Pointer to function for evaluation of hash value (any unsigned value).
- This function has one parameter of type hash_table_entry_t. */
- unsigned (*hash_function) PARAMS ((hash_table_entry_t));
- /* Pointer to function for test on equality of hash table elements (two
- parameter of type hash_table_entry_t. */
- int (*eq_function) PARAMS ((hash_table_entry_t, hash_table_entry_t));
- /* Table itself */
- hash_table_entry_t *entries;
-} *hash_table_t;
-
+ /* Pointer to hash function. */
+ htab_hash hash_f;
-/* The prototypes of the package functions. */
+ /* Pointer to comparison function. */
+ htab_eq eq_f;
-extern hash_table_t create_hash_table
- PARAMS ((size_t, unsigned (*) (hash_table_entry_t),
- int (*) (hash_table_entry_t, hash_table_entry_t)));
+ /* Pointer to cleanup function. */
+ htab_del del_f;
-extern void delete_hash_table PARAMS ((hash_table_t));
+ /* Table itself. */
+ void **entries;
-extern void empty_hash_table PARAMS ((hash_table_t));
+ /* Current size (in entries) of the hash table */
+ size_t size;
-extern hash_table_entry_t *find_hash_table_entry
- PARAMS ((hash_table_t, hash_table_entry_t, int));
+ /* Current number of elements including also deleted elements */
+ size_t n_elements;
-extern void remove_element_from_hash_table_entry PARAMS ((hash_table_t,
- hash_table_entry_t));
+ /* Current number of deleted elements in the table */
+ size_t n_deleted;
-extern void clear_hash_table_slot PARAMS ((hash_table_t, hash_table_entry_t *));
+ /* The following member is used for debugging. Its value is number
+ of all calls of `htab_find_slot' for the hash table. */
+ unsigned int searches;
-extern void traverse_hash_table PARAMS ((hash_table_t,
- int (*) (hash_table_entry_t, void *),
- void *));
-
-extern size_t hash_table_size PARAMS ((hash_table_t));
+ /* The following member is used for debugging. Its value is number
+ of collisions fixed for time of work with the hash table. */
+ unsigned int collisions;
+};
-extern size_t hash_table_elements_number PARAMS ((hash_table_t));
+typedef struct htab *htab_t;
-extern int hash_table_collisions PARAMS ((hash_table_t));
+/* The prototypes of the package functions. */
-extern int all_hash_table_collisions PARAMS ((void));
+extern htab_t htab_create PARAMS ((size_t, htab_hash,
+ htab_eq, htab_del));
+extern void htab_delete PARAMS ((htab_t));
+extern void htab_empty PARAMS ((htab_t));
+
+extern void *htab_find PARAMS ((htab_t, const void *));
+extern void **htab_find_slot PARAMS ((htab_t, const void *, int));
+extern void *htab_find_with_hash PARAMS ((htab_t, const void *,
+ unsigned int));
+extern void **htab_find_slot_with_hash PARAMS ((htab_t, const void *,
+ unsigned int, int));
+extern void htab_clear_slot PARAMS ((htab_t, void **));
+extern void htab_remove_elt PARAMS ((htab_t, void *));
+
+extern void htab_traverse PARAMS ((htab_t, htab_trav, void *));
+
+extern size_t htab_size PARAMS ((htab_t));
+extern size_t htab_elements PARAMS ((htab_t));
+extern double htab_collisions PARAMS ((htab_t));
#ifdef __cplusplus
}
diff --git a/include/hp-symtab.h b/include/hp-symtab.h
index fff56688e..cf626c073 100644
--- a/include/hp-symtab.h
+++ b/include/hp-symtab.h
@@ -88,7 +88,8 @@ enum hp_language
{
HP_LANGUAGE_UNKNOWN,
HP_LANGUAGE_C,
- HP_LANGUAGE_F77,
+ HP_LANGUAGE_FORTRAN,
+ HP_LANGUAGE_F77 = HP_LANGUAGE_FORTRAN,
HP_LANGUAGE_PASCAL,
HP_LANGUAGE_MODCAL,
HP_LANGUAGE_COBOL,
@@ -485,9 +486,11 @@ struct dntt_type_fparam
unsigned int longaddr: 1;
unsigned int copyparam: 1;
unsigned int dflt: 1;
- unsigned int unused: 16;
+ unsigned int doc_ranges: 1;
+ unsigned int misc_kind: 1;
+ unsigned int unused: 14;
vtpointer name;
- int location;
+ CORE_ADDR location;
dnttpointer type;
dnttpointer nextparam;
int misc;
@@ -595,7 +598,7 @@ struct dntt_type_const
unsigned int kind: 10;
unsigned int global: 1;
unsigned int indirect: 1;
- unsigned int: 3;
+ unsigned int location_type: 3;
unsigned int classmem: 1;
unsigned int unused: 15;
vtpointer name;
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 79bc3cc7c..7452c2bea 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,307 @@
+2000-03-27 Nick Clifton <nickc@cygnus.com>
+
+ * d30v.h (SHORT_A1): Fix value.
+ (SHORT_AR): Renumber so that it is at the end of the list of short
+ instructions, not the end of the list of long instructions.
+
+2000-03-26 Alan Modra <alan@linuxcare.com>
+
+ * i386.h: (UNIXWARE_COMPAT): Rename to SYSV386_COMPAT as the
+ problem isn't really specific to Unixware.
+ (OLDGCC_COMPAT): Define.
+ (i386_optab): If !OLDGCC_COMPAT, don't handle fsubp etc. with
+ destination %st(0).
+ Fix lots of comments.
+
+2000-03-02 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * d30v.h:
+ (SHORT_B2r, SHORT_B3, SHORT_B3r, SHORT_B3b, SHORT_B3br): Updated.
+ (SHORT_D1r, SHORT_D2, SHORT_D2r, SHORT_D2Br, SHORT_U): Updated.
+ (SHORT_F, SHORT_AF, SHORT_T, SHORT_A5, SHORT_CMP, SHORT_CMPU): Updated.
+ (SHORT_A1, SHORT_AA, SHORT_RA, SHORT_MODINC, SHORT_MODDEC): Updated.
+ (SHORT_C1, SHORT_C2, SHORT_UF, SHORT_A2, SHORT_NONE, LONG): Updated.
+ (LONG_U, LONG_Ur, LONG_CMP, LONG_M, LONG_M2, LONG_2, LONG_2r): Updated.
+ (LONG_2b, LONG_2br, LONG_D, LONG_Dr, LONG_Dbr): Updated.
+
+2000-02-25 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h (fild, fistp): Change intel d_Suf form to fildd and
+ fistpd without suffix.
+
+2000-02-24 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.h (cgen_cpu_desc): Rename field 'flags' to
+ 'signed_overflow_ok_p'.
+ Delete prototypes for cgen_set_flags() and cgen_get_flags().
+
+2000-02-24 Andrew Haley <aph@cygnus.com>
+
+ * cgen.h (CGEN_INSN_MACH_HAS_P): New macro.
+ (CGEN_CPU_TABLE): flags: new field.
+ Add prototypes for new functions.
+
+2000-02-24 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Add some more UNIXWARE_COMPAT comments.
+
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * i370.h: New file.
+
+2000-02-22 Andrew Haley <aph@cygnus.com>
+
+ * mips.h: (OPCODE_IS_MEMBER): Add comment.
+
+1999-12-30 Andrew Haley <aph@cygnus.com>
+
+ * mips.h (OPCODE_IS_MEMBER): Add gp32 arg, which determines
+ whether synthetic opcodes (e.g. move) generate 32-bit or 64-bit
+ insns.
+
+2000-01-15 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Qualify intel mode far call and jmp with x_Suf.
+
+1999-12-27 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Add JumpAbsolute qualifier to all non-intel mode
+ indirect jumps and calls. Add FF/3 call for intel mode.
+
+Wed Dec 1 03:05:25 1999 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300.h: Add new operand types. Add new instruction formats.
+
+Wed Nov 24 20:28:58 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Correctly handle immediate for PA2.0 "bb"
+ instruction.
+
+1999-11-18 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * mips.h (INSN_ISA5): New.
+
+1999-11-01 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * mips.h (OPCODE_IS_MEMBER): New.
+
+1999-10-29 Nick Clifton <nickc@cygnus.com>
+
+ * d30v.h (SHORT_AR): Define.
+
+1999-10-18 Michael Meissner <meissner@cygnus.com>
+
+ * alpha.h (alpha_num_opcodes): Convert to unsigned.
+ (alpha_num_operands): Ditto.
+
+Sun Oct 10 01:46:56 1999 Jerry Quinn <jerry.quinn.adv91@alum.dartmouth.org>
+
+ * hppa.h (pa_opcodes): Add load and store cache control to
+ instructions. Add ordered access load and store.
+
+ * hppa.h (pa_opcode): Add new entries for addb and addib.
+
+ * hppa.h (pa_opcodes): Fix cmpb and cmpib entries.
+
+ * hppa.h (pa_opcodes): Add entries for cmpb and cmpib.
+
+Thu Oct 7 00:12:25 MDT 1999 Diego Novillo <dnovillo@cygnus.com>
+
+ * d10v.h: Add flag RESTRICTED_NUM3 for imm3 operands.
+
+Thu Sep 23 07:08:38 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+
+ * hppa.h (pa_opcodes): Add "call" and "ret". Clean up "b", "bve"
+ and "be" using completer prefixes.
+
+ * hppa.h (pa_opcodes): Add initializers to silence compiler.
+
+ * hppa.h: Update comments about character usage.
+
+Mon Sep 20 03:55:31 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Fix minor thinkos introduced while cleaning
+ up the new fstw & bve instructions.
+
+Sun Sep 19 10:40:59 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Add remaining PA2.0 integer load/store
+ instructions.
+
+ * hppa.h (pa_opcodes): Add remaining PA2.0 FP load/store instructions.
+
+ * hppa.h (pa_opcodes): Add long offset double word load/store
+ instructions.
+
+ * hppa.h (pa_opcodes): Add FLAG_STRICT variants of FP loads and
+ stores.
+
+ * hppa.h (pa_opcodes): Handle PA2.0 fcnv, fcmp and ftest insns.
+
+ * hppa.h (pa_opcodes): Finish support for PA2.0 "b" instructions.
+
+ * hppa.h (pa_opcodes): Handle PA2.0 "bve" instructions.
+
+ * hppa.h (pa_opcodes): Add new syntax "be" instructions.
+
+ * hppa.h (pa_opcodes): Note use of 'M' and 'L'.
+
+ * hppa.h (pa_opcodes): Add support for "b,l".
+
+ * hppa.h (pa_opcodes): Add support for "b,gate".
+
+Sat Sep 18 11:41:16 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Use 'fX' for first register operand
+ in xmpyu.
+
+ * hppa.h (pa_opcodes): Fix mask for probe and probei.
+
+ * hppa.h (pa_opcodes): Fix mask for depwi.
+
+Tue Sep 7 13:44:25 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Add "addil" variant which has the %r1 as
+ an explicit output argument.
+
+Mon Sep 6 04:41:42 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h: Add strict variants of PA1.0/PA1.1 loads and stores.
+ Add a few PA2.0 loads and store variants.
+
+1999-09-04 Steve Chamberlain <sac@pobox.com>
+
+ * pj.h: New file.
+
+1999-08-29 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h (i386_regtab): Move %st to top of table, and split off
+ other fp reg entries.
+ (i386_float_regtab): To here.
+
+Sat Aug 28 00:25:25 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+
+ * hppa.h (pa_opcodes): Replace 'f' by 'v'. Prefix float register args
+ by 'f'.
+
+ * hppa.h (pa_opcodes): Add extrd, extrw, depd, depdi, depw, depwi.
+ Add supporting args.
+
+ * hppa.h: Document new completers and args.
+ * hppa.h (pa_opcodes): Add 64 bit patterns and pa2.0 syntax for uxor,
+ uaddcm, dcor, addi, add, sub, subi, shladd, rfi, and probe. Add pa2.0
+ extensions for ssm, rsm, pdtlb, pitlb. Add performance instructions
+ pmenb and pmdis.
+
+ * hppa.h (pa_opcodes): Add pa2.0 instructions hadd, hshl,
+ hshr, hsub, mixh, mixw, permh.
+
+ * hppa.h (pa_opcodes): Change completers in instructions to
+ use 'c' prefix.
+
+ * hppa.h (pa_opcodes): Add popbts, new forms of bb, havg,
+ hshladd, hshradd, shrpd, and shrpw instructions. Update arg comments.
+
+ * hppa.h (pa_opcodes): Change fmpyfadd, fmpynfadd, fneg,
+ fnegabs to use 'I' instead of 'F'.
+
+1999-08-21 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Add AMD athlon instructions, pfnacc, pfpnacc, pswapd.
+ Document pf2iw and pi2fw as athlon insns. Remove pswapw.
+ Alphabetically sort PIII insns.
+
+Wed Aug 18 18:14:40 1999 Doug Evans <devans@canuck.cygnus.com>
+
+ * cgen.h (CGEN_INSN_MACH_HAS_P): New macro.
+
+Fri Aug 6 09:46:35 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+
+ * hppa.h (pa_opcodes): Add 64 bit versions of or, xor, and,
+ and andcm. Add 32 and 64 bit version of cmpclr, cmpiclr.
+
+ * hppa.h: Document 64 bit condition completers.
+
+Thu Aug 5 16:56:07 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+
+ * hppa.h (pa_opcodes): Change condition args to use '?' prefix.
+
+1999-08-04 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h (i386_optab): Add DefaultSize modifier to all insns
+ that implicitly modify %esp. #undef d_Suf, x_suf, sld_suf,
+ sldx_suf, bwld_Suf, d_FP, x_FP, sld_FP, sldx_FP at end of table.
+
+Wed Jul 28 02:04:24 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+ Jeff Law <law@cygnus.com>
+
+ * hppa.h (pa_opcodes): Add "pushnom" and "pushbts".
+
+ * hppa.h (pa_opcodes): Mark all PA2.0 opcodes with FLAG_STRICT.
+
+ * hppa.h (pa_opcodes): Change xmpyu, fmpyfadd,
+ and fmpynfadd to use 'J' and 'K' instead of 'E' and 'X'.
+
+1999-07-13 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Add "undocumented" AMD 3DNow! pf2iw, pi2fw, pswapw insns.
+
+Thu Jul 1 00:17:24 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (struct pa_opcode): Add new field "flags".
+ (FLAGS_STRICT): Define.
+
+Fri Jun 25 04:22:04 1999 Jerry Quinn <jquinn@nortelnetworks.com>
+ Jeff Law <law@cygnus.com>
+
+ * hppa.h (pa_opcodes): Add pa2.0 clrbts instruction.
+
+ * hppa.h (pa_opcodes): Add entries for mfia and mtsarcm instructions.
+
+1999-06-23 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h: Allow `l' suffix on bswap. Allow `w' suffix on arpl,
+ lldt, lmsw, ltr, str, verr, verw. Add FP flag to fcmov*. Add FP
+ flag to fcomi and friends.
+
+Fri May 28 15:26:11 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Move integer arithmetic instructions after
+ integer logical instructions.
+
+1999-05-28 Linus Nordberg <linus.nordberg@canit.se>
+
+ * m68k.h: Document new formats `E', `G', `H' and new places `N',
+ `n', `o'.
+
+ * m68k.h: Define mcf5206e, mcf5307, mcf. Document new format `u'
+ and new places `m', `M', `h'.
+
+Thu May 27 04:13:54 1999 Joel Sherrill (joel@OARcorp.com
+
+ * hppa.h (pa_opcodes): Add several processor specific system
+ instructions.
+
+Wed May 26 16:57:44 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Add second entry for "comb", "comib",
+ "addb", and "addib" to be used by the disassembler.
+
+1999-05-12 Alan Modra <alan@apri.levels.unisa.edu.au>
+
+ * i386.h (ReverseModrm): Remove all occurences.
+ (InvMem): Add to control/debug/test mov insns, movhlps, movlhps,
+ movmskps, pextrw, pmovmskb, maskmovq.
+ Change NoSuf to FP on all MMX, XMM and AMD insns as these all
+ ignore the data size prefix.
+
+ * i386.h (i386_optab, i386_regtab): Add support for PIII SIMD.
+ Mostly stolen from Doug Ledford <dledford@redhat.com>
+
+Sat May 8 23:27:35 1999 Richard Henderson <rth@cygnus.com>
+
+ * ppc.h (PPC_OPCODE_64_BRIDGE): New.
+
1999-04-14 Doug Evans <devans@casey.cygnus.com>
* cgen.h (CGEN_ATTR): Delete member num_nonbools.
diff --git a/include/opcode/alpha.h b/include/opcode/alpha.h
index d18eb0445..6f31e9ae0 100644
--- a/include/opcode/alpha.h
+++ b/include/opcode/alpha.h
@@ -54,7 +54,7 @@ struct alpha_opcode
in the order in which the disassembler should consider
instructions. */
extern const struct alpha_opcode alpha_opcodes[];
-extern const int alpha_num_opcodes;
+extern const unsigned alpha_num_opcodes;
/* Values defined for the flags field of a struct alpha_opcode. */
@@ -135,7 +135,7 @@ struct alpha_operand
the operands field of the alpha_opcodes table. */
extern const struct alpha_operand alpha_operands[];
-extern const int alpha_num_operands;
+extern const unsigned alpha_num_operands;
/* Values defined for the flags field of a struct alpha_operand. */
diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h
index 84542a37c..0cff7c826 100644
--- a/include/opcode/cgen.h
+++ b/include/opcode/cgen.h
@@ -1,6 +1,6 @@
/* Header file for targets using CGEN: Cpu tools GENerator.
-Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB, the GNU debugger, and the GNU Binutils.
@@ -1037,6 +1037,12 @@ extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC));
/* Return value of base part of INSN. */
#define CGEN_INSN_BASE_VALUE(insn) \
CGEN_OPCODE_BASE_VALUE (CGEN_INSN_OPCODE (insn))
+
+/* Standard way to test whether INSN is supported by MACH.
+ MACH is one of enum mach_attr.
+ The "|1" is because the base mach is always selected. */
+#define CGEN_INSN_MACH_HAS_P(insn, mach) \
+((CGEN_INSN_ATTR_VALUE ((insn), CGEN_INSN_MACH) & ((1 << (mach)) | 1)) != 0)
/* Macro instructions.
Macro insns aren't real insns, they map to one or more real insns.
@@ -1275,6 +1281,10 @@ typedef struct cgen_cpu_desc
/* Disassembler instruction hash table. */
CGEN_INSN_LIST **dis_hash_table;
CGEN_INSN_LIST *dis_hash_table_entries;
+
+ /* This field could be turned into a bitfield if room for other flags is needed. */
+ unsigned int signed_overflow_ok_p;
+
} CGEN_CPU_TABLE;
/* wip */
@@ -1377,4 +1387,13 @@ extern void cgen_put_insn_value
extern const char * cgen_read_cpu_file
PARAMS ((CGEN_CPU_DESC, const char * filename_));
+/* Allow signed overflow of instruction fields. */
+extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+
+/* Generate an error message if a signed field in an instruction overflows. */
+extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+
+/* Will an error message be generated if a signed field in an instruction overflows ? */
+extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC));
+
#endif /* CGEN_H */
diff --git a/include/opcode/d10v.h b/include/opcode/d10v.h
index 4b74c9862..7c6d32ddf 100644
--- a/include/opcode/d10v.h
+++ b/include/opcode/d10v.h
@@ -176,6 +176,10 @@ extern const struct d10v_operand d10v_operands[];
/* general purpose register */
#define OPERAND_GPR (0x40000)
+/* special imm3 values with range restricted to -2 <= imm3 <= 3 */
+/* needed for rac/rachi */
+#define RESTRICTED_NUM3 (0x80000)
+
/* Structure to hold information about predefined registers. */
struct pd_reg
{
diff --git a/include/opcode/d30v.h b/include/opcode/d30v.h
index b828dab32..f90b7a420 100644
--- a/include/opcode/d30v.h
+++ b/include/opcode/d30v.h
@@ -1,5 +1,5 @@
/* d30v.h -- Header file for D30V opcode table
- Copyright 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
Written by Martin Hunt (hunt@cygnus.com), Cygnus Solutions
This file is part of GDB, GAS, and the GNU binutils.
@@ -85,39 +85,46 @@ struct d30v_opcode
#define SHORT_A 9
#define SHORT_B1 11
#define SHORT_B2 12
-#define SHORT_B3 13
-#define SHORT_B3b 15
-#define SHORT_D1 17
-#define SHORT_D2 19
-#define SHORT_D2B 21
-#define SHORT_U 23 /* unary SHORT_A. ABS for example */
-#define SHORT_F 25 /* SHORT_A with flag registers */
-#define SHORT_AF 27 /* SHORT_A with only the first register a flag register */
-#define SHORT_T 29 /* for trap instruction */
-#define SHORT_A5 30 /* SHORT_A with a 5-bit immediate instead of 6 */
-#define SHORT_CMP 32 /* special form for CMPcc */
-#define SHORT_CMPU 34 /* special form for CMPUcc */
-#define SHORT_A1 36 /* special form of SHORT_A for MACa opcodes where a=1 */
-#define SHORT_AA 38 /* SHORT_A with the first register an accumulator */
-#define SHORT_RA 40 /* SHORT_A with the second register an accumulator */
-#define SHORT_MODINC 42
-#define SHORT_MODDEC 43
-#define SHORT_C1 44
-#define SHORT_C2 45
-#define SHORT_UF 46
-#define SHORT_A2 47
-#define SHORT_A5S 49
-#define SHORT_NONE 51 /* no operands */
-#define LONG 52
-#define LONG_U 53 /* unary LONG */
-#define LONG_AF 54 /* LONG with the first register a flag register */
-#define LONG_CMP 55 /* special form for CMPcc and CMPUcc */
-#define LONG_M 56 /* Memory long for ldb, stb */
-#define LONG_M2 57 /* Memory long for ld2w, st2w */
-#define LONG_2 58 /* LONG with 2 operands; bratnz */
-#define LONG_2b 59 /* LONG_2 with modifier of 3 */
-#define LONG_D 60 /* for DBRAI*/
-#define LONG_Db 61 /* for repeati*/
+#define SHORT_B2r 13
+#define SHORT_B3 14
+#define SHORT_B3r 16
+#define SHORT_B3b 18
+#define SHORT_B3br 20
+#define SHORT_D1r 22
+#define SHORT_D2 24
+#define SHORT_D2r 26
+#define SHORT_D2Br 28
+#define SHORT_U 30 /* unary SHORT_A. ABS for example */
+#define SHORT_F 31 /* SHORT_A with flag registers */
+#define SHORT_AF 33 /* SHORT_A with only the first register a flag register */
+#define SHORT_T 35 /* for trap instruction */
+#define SHORT_A5 36 /* SHORT_A with a 5-bit immediate instead of 6 */
+#define SHORT_CMP 38 /* special form for CMPcc */
+#define SHORT_CMPU 40 /* special form for CMPUcc */
+#define SHORT_A1 42 /* special form of SHORT_A for MACa opcodes where a=1 */
+#define SHORT_AA 44 /* SHORT_A with the first register an accumulator */
+#define SHORT_RA 46 /* SHORT_A with the second register an accumulator */
+#define SHORT_MODINC 48
+#define SHORT_MODDEC 49
+#define SHORT_C1 50
+#define SHORT_C2 51
+#define SHORT_UF 52
+#define SHORT_A2 53
+#define SHORT_NONE 55 /* no operands */
+#define SHORT_AR 56 /* like SHORT_AA but only accept register as third parameter */
+#define LONG 57
+#define LONG_U 58 /* unary LONG */
+#define LONG_Ur 59 /* LONG pc-relative */
+#define LONG_CMP 60 /* special form for CMPcc and CMPUcc */
+#define LONG_M 61 /* Memory long for ldb, stb */
+#define LONG_M2 62 /* Memory long for ld2w, st2w */
+#define LONG_2 63 /* LONG with 2 operands; jmptnz */
+#define LONG_2r 64 /* LONG with 2 operands; bratnz */
+#define LONG_2b 65 /* LONG_2 with modifier of 3 */
+#define LONG_2br 66 /* LONG_2r with modifier of 3 */
+#define LONG_D 67 /* for DJMPI */
+#define LONG_Dr 68 /* for DBRAI */
+#define LONG_Dbr 69 /* for repeati */
/* the execution unit(s) used */
int unit;
@@ -146,7 +153,9 @@ struct d30v_opcode
#define FLAG_JMP (1L<<13) /* instruction is a branch */
#define FLAG_JSR (1L<<14) /* subroutine call. must be aligned */
#define FLAG_MEM (1L<<15) /* reads/writes memory */
-#define FLAG_2WORD (1L<<16) /* 2 word/4 byte operation */
+#define FLAG_NOT_WITH_ADDSUBppp (1L<<16) /* Old meaning: a 2 word 4 byter operation
+ New meaning: operation cannot be
+ combined in parallel with ADD/SUBppp. */
#define FLAG_MUL16 (1L<<17) /* 16 bit multiply */
#define FLAG_MUL32 (1L<<18) /* 32 bit multiply */
#define FLAG_ADDSUBppp (1L<<19) /* ADDppp or SUBppp */
@@ -246,6 +255,10 @@ extern const struct d30v_operand d30v_operand_table[];
/* let the optimizer know that two registers are affected */
#define OPERAND_2REG (0x10000)
+/* This operand is pc-relative. Note that repeati can have two immediate
+ operands, one of which is pcrel, the other (the IMM6U one) is not. */
+#define OPERAND_PCREL (0x20000)
+
/* The format table is an array of struct d30v_format. */
struct d30v_format
{
diff --git a/include/opcode/hppa.h b/include/opcode/hppa.h
index 30ccb6ccf..1c41ff07c 100644
--- a/include/opcode/hppa.h
+++ b/include/opcode/hppa.h
@@ -43,8 +43,12 @@ struct pa_opcode
unsigned long int mask; /* ... in these bits. */
char *args;
enum pa_arch arch;
+ char flags;
};
+/* Enable/disable strict syntax checking. Not currently used, but will
+ be necessary for PA2.0 support in the future. */
+#define FLAG_STRICT 0x1
/*
All hppa opcodes are 32 bits.
@@ -53,8 +57,9 @@ struct pa_opcode
particular opcode in order for an instruction to be an instance
of that opcode.
- The args component is a string containing one character
- for each operand of the instruction.
+ The args component is a string containing one character for each operand of
+ the instruction. Characters used as a prefix allow any second character to
+ be used without conflicting with the main operand characters.
Bit positions in this description follow HP usage of lsb = 31,
"at" is lsb of field.
@@ -65,9 +70,9 @@ struct pa_opcode
In the args field, the following characters are unused:
- ' "#$% *+- ./ :; '
- ' [\] '
- ' { } '
+ ' " & - / 34 6789:;< > @'
+ ' C M [\] '
+ ' e g l y } '
Here are all the characters:
@@ -79,20 +84,10 @@ Kinds of operands:
x integer register field at 15.
b integer register field at 10.
t integer register field at 31.
- y floating point register field at 31
+ a integer register field at 10 and 15 (for PERMH)
5 5 bit immediate at 15.
s 2 bit space specifier at 17.
S 3 bit space specifier at 18.
- c indexed load completer.
- C short load and store completer.
- Y Store Bytes Short completer
- < non-negated compare/subtract conditions.
- a compare/subtract conditions
- d non-negated add conditions
- & logical instruction conditions
- U unit instruction conditions
- > shift/extract/deposit conditions.
- ~ bvb,bb conditions
V 5 bit immediate value at 31
i 11 bit immediate value at 31
j 14 bit immediate value at 31
@@ -101,20 +96,28 @@ Kinds of operands:
N nullification for spop and copr instructions
w 12 bit branch displacement
W 17 bit branch displacement (PC relative)
+ X 22 bit branch displacement (PC relative)
z 17 bit branch displacement (just a number, not an address)
Also these:
+ . 2 bit shift amount at 25
+ * 4 bit shift amount at 25
p 5 bit shift count at 26 (to support the SHD instruction) encoded as
31-p
+ ~ 6 bit shift count at 20,22:26 encoded as 63-~.
P 5 bit bit position at 26
+ q 6 bit bit position at 20,22:26
T 5 bit field length at 31 (encoded as 32-T)
+ % 6 bit field length at 23,27:31 (variable extract/deposit)
+ | 6 bit field length at 19,27:31 (fixed extract/deposit)
A 13 bit immediate at 18 (to support the BREAK instruction)
^ like b, but describes a control register
- Z System Control Completer (to support LPA, LHA, etc.)
+ ! sar (cr11) register
D 26 bit immediate at 31 (to support the DIAG instruction)
+ $ 9 bit immediate at 28 (to support POPBTS)
- f 3 bit Special Function Unit identifier at 25
+ v 3 bit Special Function Unit identifier at 25
O 20 bit Special Function Unit operation split between 15 bits at 20
and 5 bits at 31
o 15 bit Special Function Unit operation at 20
@@ -129,37 +132,126 @@ Also these:
I Source Floating Point Operand Format Completer encoded 1 bits at 20
(for 0xe format FP instructions)
G Destination Floating Point Operand Format Completer encoded 2 bits at 18
- M Floating-Point Compare Conditions (encoded as 5 bits at 31)
- ? non-negated/negated compare/subtract conditions.
- @ non-negated/negated add conditions.
- ! non-negated add conditions.
+ H Floating Point Operand Format at 26 for 'fmpyadd' and 'fmpysub'
+ (very similar to 'F')
- s 2 bit space specifier at 17.
- b register field at 10.
r 5 bit immediate value at 31 (for the break instruction)
(very similar to V above, except the value is unsigned instead of
low_sign_ext)
R 5 bit immediate value at 15 (for the ssm, rsm, probei instructions)
(same as r above, except the value is in a different location)
+ U 10 bit immediate value at 15 (for SSM, RSM on pa2.0)
Q 5 bit immediate value at 10 (a bit position specified in
the bb instruction. It's the same as r above, except the
value is in a different location)
- | shift/extract/deposit conditions when used in a conditional branch
-
-And these (PJH) for PA-89 F.P. registers and instructions:
-
- v a 't' operand type extended to handle L/R register halves.
- E a 'b' operand type extended to handle L/R register halves.
- X an 'x' operand type extended to handle L/R register halves.
- J a 'b' operand type further extended to handle extra 1.1 registers
- K a 'x' operand type further extended to handle extra 1.1 registers
- 4 a variation of the 'b' operand type for 'fmpyadd' and 'fmpysub'
- 6 a variation of the 'x' operand type for 'fmpyadd' and 'fmpysub'
- 7 a variation of the 't' operand type for 'fmpyadd' and 'fmpysub'
- 8 5 bit register field at 20 (used in 'fmpyadd' and 'fmpysub')
- 9 5 bit register field at 25 (used in 'fmpyadd' and 'fmpysub')
- H Floating Point Operand Format at 26 for 'fmpyadd' and 'fmpysub'
- (very similar to 'F')
+ B 5 bit immediate value at 10 (a bit position specified in
+ the bb instruction. Similar to Q, but 64bit handling is
+ different.
+ Z %r1 -- implicit target of addil instruction.
+ L ,%r2 completer for new syntax branch
+ { Source format completer for fcnv
+ _ Destination format completer for fcnv
+ h cbit for fcmp
+ = gfx tests for ftest
+ d 14bit offset for single precision FP long load/store.
+ # 14bit offset for double precision FP load long/store.
+ J Yet another 14bit offset with an unusual encoding.
+ K Yet another 14bit offset with an unusual encoding.
+ Y %sr0,%r31 -- implicit target of be,l instruction.
+ @ implicit immediate value of 0
+
+Completer operands all have 'c' as the prefix:
+
+ cx indexed load completer.
+ cm short load and store completer.
+ cq long load and store completer (like cm, but inserted into a
+ different location in the target instruction).
+ cs store bytes short completer.
+ ce long load/store completer for LDW/STW with a different encoding than the
+ others
+ cc load cache control hint
+ cd load and clear cache control hint
+ cC store cache control hint
+ co ordered access
+
+ cp branch link and push completer
+ cP branch pop completer
+ cl branch link completer
+ cg branch gate completer
+
+ cw read/write completer for PROBE
+ cW wide completer for MFCTL
+ cL local processor completer for cache control
+ cZ System Control Completer (to support LPA, LHA, etc.)
+
+ ci correction completer for DCOR
+ ca add completer
+ cy 32 bit add carry completer
+ cY 64 bit add carry completer
+ cv signed overflow trap completer
+ ct trap on condition completer for ADDI, SUB
+ cT trap on condition completer for UADDCM
+ cb 32 bit borrow completer for SUB
+ cB 64 bit borrow completer for SUB
+
+ ch left/right half completer
+ cH signed/unsigned saturation completer
+ cS signed/unsigned completer at 21
+ c* permutation completer
+
+Condition operands all have '?' as the prefix:
+
+ ?f Floating point compare conditions (encoded as 5 bits at 31)
+
+ ?a add conditions
+ ?A 64 bit add conditions
+ ?@ add branch conditions followed by nullify
+ ?d non-negated add branch conditions
+ ?D negated add branch conditions
+ ?w wide mode non-negated add branch conditions
+ ?W wide mode negated add branch conditions
+
+ ?s compare/subtract conditions
+ ?S 64 bit compare/subtract conditions
+ ?t non-negated compare and branch conditions
+ ?n 32 bit compare and branch conditions followed by nullify
+ ?N 64 bit compare and branch conditions followed by nullify
+ ?Q 64 bit compare and branch conditions for CMPIB instruction
+
+ ?l logical conditions
+ ?L 64 bit logical conditions
+
+ ?b branch on bit conditions
+ ?B 64 bit branch on bit conditions
+
+ ?x shift/extract/deposit conditions
+ ?X 64 bit shift/extract/deposit conditions
+ ?y shift/extract/deposit conditions followed by nullify for conditional
+ branches
+
+ ?u unit conditions
+ ?U 64 bit unit conditions
+
+Floating point registers all have 'f' as a prefix:
+
+ ft target register at 31
+ fT target register with L/R halves at 31
+ fa operand 1 register at 10
+ fA operand 1 register with L/R halves at 10
+ fX Same as fA, except prints a space before register during disasm
+ fb operand 2 register at 15
+ fB operand 2 register with L/R halves at 15
+ fC operand 3 register with L/R halves at 16:18,21:23
+ fe Like fT, but encoding is different.
+
+Float registers for fmpyadd and fmpysub:
+
+ fi mult operand 1 register at 10
+ fj mult operand 2 register at 15
+ fk mult target register at 20
+ fl add/sub operand register at 25
+ fm add/sub target register at 31
+
*/
@@ -178,299 +270,562 @@ static const char *const completer_chars = ",CcY<>?!@+&U~FfGHINnOoZMadu|/=0123%e
static const struct pa_opcode pa_opcodes[] =
{
-
/* pseudo-instructions */
-{ "b", 0xe8000000, 0xffe0e000, "nW", pa10}, /* bl foo,r0 */
-{ "ldi", 0x34000000, 0xffe0c000, "j,x", pa10}, /* ldo val(r0),r */
-{ "comib", 0x84000000, 0xfc000000, "?n5,b,w", pa10}, /* comib{tf}*/
-{ "comb", 0x80000000, 0xfc000000, "?nx,b,w", pa10}, /* comb{tf} */
-{ "addb", 0xa0000000, 0xfc000000, "@nx,b,w", pa10}, /* addb{tf} */
-{ "addib", 0xa4000000, 0xfc000000, "@n5,b,w", pa10}, /* addib{tf}*/
-{ "nop", 0x08000240, 0xffffffff, "", pa10}, /* or 0,0,0 */
-{ "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10}, /* or r,0,t */
-{ "mtsar", 0x01601840, 0xffe0ffff, "x", pa10}, /* mtctl r,cr11 */
+{ "ldi", 0x34000000, 0xffe0c000, "j,x", pa10, 0},/* ldo val(r0),r */
+
+{ "call", 0xe800f000, 0xfc1ffffd, "n(b)", pa20, FLAG_STRICT},
+{ "call", 0xe800a000, 0xffe0e000, "nW", pa10, FLAG_STRICT},
+{ "ret", 0xe840d000, 0xfffffffd, "n", pa20, FLAG_STRICT},
+
+{ "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT},
+{ "cmpib", 0x84000000, 0xf4000000, "?nn5,b,w", pa10, FLAG_STRICT},
+{ "comib", 0x84000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "comib", 0x8c000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
+{ "cmpb", 0x9c000000, 0xdc000000, "?Nnx,b,w", pa20, FLAG_STRICT},
+{ "cmpb", 0x80000000, 0xf4000000, "?nnx,b,w", pa10, FLAG_STRICT},
+{ "comb", 0x80000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "comb", 0x88000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
+{ "addb", 0xa0000000, 0xf4000000, "?Wnx,b,w", pa20, FLAG_STRICT},
+{ "addb", 0xa0000000, 0xfc000000, "?@nx,b,w", pa10, 0}, /* addb{tf} */
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "addb", 0xa8000000, 0xfc000000, "?@nx,b,w", pa10, 0},
+{ "addib", 0xa4000000, 0xf4000000, "?Wn5,b,w", pa20, FLAG_STRICT},
+{ "addib", 0xa4000000, 0xfc000000, "?@n5,b,w", pa10, 0}, /* addib{tf}*/
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "addib", 0xac000000, 0xfc000000, "?@n5,b,w", pa10, 0}, /* addib{tf}*/
+{ "nop", 0x08000240, 0xffffffff, "", pa10, 0}, /* or 0,0,0 */
+{ "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10, 0}, /* or r,0,t */
+{ "mtsar", 0x01601840, 0xffe0ffff, "x", pa10, 0}, /* mtctl r,cr11 */
/* Loads and Stores for integer registers. */
-{ "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10},
-{ "ldw", 0x48000000, 0xfc000000, "j(b),x", pa10},
-{ "ldh", 0x44000000, 0xfc000000, "j(s,b),x", pa10},
-{ "ldh", 0x44000000, 0xfc000000, "j(b),x", pa10},
-{ "ldb", 0x40000000, 0xfc000000, "j(s,b),x", pa10},
-{ "ldb", 0x40000000, 0xfc000000, "j(b),x", pa10},
-{ "stw", 0x68000000, 0xfc000000, "x,j(s,b)", pa10},
-{ "stw", 0x68000000, 0xfc000000, "x,j(b)", pa10},
-{ "sth", 0x64000000, 0xfc000000, "x,j(s,b)", pa10},
-{ "sth", 0x64000000, 0xfc000000, "x,j(b)", pa10},
-{ "stb", 0x60000000, 0xfc000000, "x,j(s,b)", pa10},
-{ "stb", 0x60000000, 0xfc000000, "x,j(b)", pa10},
-{ "ldwm", 0x4c000000, 0xfc000000, "j(s,b),x", pa10},
-{ "ldwm", 0x4c000000, 0xfc000000, "j(b),x", pa10},
-{ "stwm", 0x6c000000, 0xfc000000, "x,j(s,b)", pa10},
-{ "stwm", 0x6c000000, 0xfc000000, "x,j(b)", pa10},
-{ "ldwx", 0x0c000080, 0xfc001fc0, "cx(s,b),t", pa10},
-{ "ldwx", 0x0c000080, 0xfc001fc0, "cx(b),t", pa10},
-{ "ldhx", 0x0c000040, 0xfc001fc0, "cx(s,b),t", pa10},
-{ "ldhx", 0x0c000040, 0xfc001fc0, "cx(b),t", pa10},
-{ "ldbx", 0x0c000000, 0xfc001fc0, "cx(s,b),t", pa10},
-{ "ldbx", 0x0c000000, 0xfc001fc0, "cx(b),t", pa10},
-{ "ldwax", 0x0c000180, 0xfc00dfc0, "cx(b),t", pa10},
-{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cx(s,b),t", pa10},
-{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cx(b),t", pa10},
-{ "ldws", 0x0c001080, 0xfc001fc0, "C5(s,b),t", pa10},
-{ "ldws", 0x0c001080, 0xfc001fc0, "C5(b),t", pa10},
-{ "ldhs", 0x0c001040, 0xfc001fc0, "C5(s,b),t", pa10},
-{ "ldhs", 0x0c001040, 0xfc001fc0, "C5(b),t", pa10},
-{ "ldbs", 0x0c001000, 0xfc001fc0, "C5(s,b),t", pa10},
-{ "ldbs", 0x0c001000, 0xfc001fc0, "C5(b),t", pa10},
-{ "ldwas", 0x0c001180, 0xfc00dfc0, "C5(b),t", pa10},
-{ "ldcws", 0x0c0011c0, 0xfc001fc0, "C5(s,b),t", pa10},
-{ "ldcws", 0x0c0011c0, 0xfc001fc0, "C5(b),t", pa10},
-{ "stws", 0x0c001280, 0xfc001fc0, "Cx,V(s,b)", pa10},
-{ "stws", 0x0c001280, 0xfc001fc0, "Cx,V(b)", pa10},
-{ "sths", 0x0c001240, 0xfc001fc0, "Cx,V(s,b)", pa10},
-{ "sths", 0x0c001240, 0xfc001fc0, "Cx,V(b)", pa10},
-{ "stbs", 0x0c001200, 0xfc001fc0, "Cx,V(s,b)", pa10},
-{ "stbs", 0x0c001200, 0xfc001fc0, "Cx,V(b)", pa10},
-{ "stwas", 0x0c001380, 0xfc00dfc0, "Cx,V(b)", pa10},
-{ "stbys", 0x0c001300, 0xfc001fc0, "Yx,V(s,b)", pa10},
-{ "stbys", 0x0c001300, 0xfc001fc0, "Yx,V(b)", pa10},
+
+{ "ldd", 0x0c0010e0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x0c0010e0, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(s,b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x0c0010c0, 0xfc0013c0, "cmcc5(s,b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x0c0010c0, 0xfc0013c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldd", 0x50000000, 0xfc000002, "cq#(s,b),x", pa20, FLAG_STRICT},
+{ "ldd", 0x50000000, 0xfc000002, "cq#(b),x", pa20, FLAG_STRICT},
+{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT},
+{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT},
+{ "ldw", 0x0c0010a0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
+{ "ldw", 0x0c0010a0, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT},
+{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT},
+{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldw", 0x4c000000, 0xfc000000, "ceJ(s,b),x", pa10, FLAG_STRICT},
+{ "ldw", 0x4c000000, 0xfc000000, "ceJ(b),x", pa10, FLAG_STRICT},
+{ "ldw", 0x5c000004, 0xfc000006, "ceK(s,b),x", pa20, FLAG_STRICT},
+{ "ldw", 0x5c000004, 0xfc000006, "ceK(b),x", pa20, FLAG_STRICT},
+{ "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10, 0},
+{ "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10, 0},
+{ "ldw", 0x48000000, 0xfc000000, "j(b),x", pa10, 0},
+{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT},
+{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT},
+{ "ldh", 0x0c001060, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
+{ "ldh", 0x0c001060, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT},
+{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT},
+{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldh", 0x44000000, 0xfc000000, "j(s,b),x", pa10, 0},
+{ "ldh", 0x44000000, 0xfc000000, "j(b),x", pa10, 0},
+{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT},
+{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT},
+{ "ldb", 0x0c001020, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT},
+{ "ldb", 0x0c001020, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT},
+{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT},
+{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldb", 0x40000000, 0xfc000000, "j(s,b),x", pa10, 0},
+{ "ldb", 0x40000000, 0xfc000000, "j(b),x", pa10, 0},
+{ "std", 0x0c0012e0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
+{ "std", 0x0c0012e0, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "std", 0x0c0012c0, 0xfc0013c0, "cmcCx,V(s,b)", pa20, FLAG_STRICT},
+{ "std", 0x0c0012c0, 0xfc0013c0, "cmcCx,V(b)", pa20, FLAG_STRICT},
+{ "std", 0x70000000, 0xfc000002, "cqx,#(s,b)", pa20, FLAG_STRICT},
+{ "std", 0x70000000, 0xfc000002, "cqx,#(b)", pa20, FLAG_STRICT},
+{ "stw", 0x0c0012a0, 0xfc0013ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
+{ "stw", 0x0c0012a0, 0xfc0013ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT},
+{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT},
+{ "stw", 0x6c000000, 0xfc000000, "cex,J(s,b)", pa10, FLAG_STRICT},
+{ "stw", 0x6c000000, 0xfc000000, "cex,J(b)", pa10, FLAG_STRICT},
+{ "stw", 0x7c000004, 0xfc000006, "cex,K(s,b)", pa20, FLAG_STRICT},
+{ "stw", 0x7c000004, 0xfc000006, "cex,K(b)", pa20, FLAG_STRICT},
+{ "stw", 0x68000000, 0xfc000000, "x,j(s,b)", pa10, 0},
+{ "stw", 0x68000000, 0xfc000000, "x,j(b)", pa10, 0},
+{ "sth", 0x0c001260, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
+{ "sth", 0x0c001260, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT},
+{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT},
+{ "sth", 0x64000000, 0xfc000000, "x,j(s,b)", pa10, 0},
+{ "sth", 0x64000000, 0xfc000000, "x,j(b)", pa10, 0},
+{ "stb", 0x0c001220, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
+{ "stb", 0x0c001220, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT},
+{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT},
+{ "stb", 0x60000000, 0xfc000000, "x,j(s,b)", pa10, 0},
+{ "stb", 0x60000000, 0xfc000000, "x,j(b)", pa10, 0},
+{ "ldwm", 0x4c000000, 0xfc000000, "j(s,b),x", pa10, 0},
+{ "ldwm", 0x4c000000, 0xfc000000, "j(b),x", pa10, 0},
+{ "stwm", 0x6c000000, 0xfc000000, "x,j(s,b)", pa10, 0},
+{ "stwm", 0x6c000000, 0xfc000000, "x,j(b)", pa10, 0},
+{ "ldwx", 0x0c000080, 0xfc001fc0, "cxx(s,b),t", pa10, 0},
+{ "ldwx", 0x0c000080, 0xfc001fc0, "cxx(b),t", pa10, 0},
+{ "ldhx", 0x0c000040, 0xfc001fc0, "cxx(s,b),t", pa10, 0},
+{ "ldhx", 0x0c000040, 0xfc001fc0, "cxx(b),t", pa10, 0},
+{ "ldbx", 0x0c000000, 0xfc001fc0, "cxx(s,b),t", pa10, 0},
+{ "ldbx", 0x0c000000, 0xfc001fc0, "cxx(b),t", pa10, 0},
+{ "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
+{ "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT},
+{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT},
+{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT},
+{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(b),t", pa10, FLAG_STRICT},
+{ "stwa", 0x0c0013a0, 0xfc00d3ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "stwa", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa10, FLAG_STRICT},
+{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa10, FLAG_STRICT},
+{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT},
+{ "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
+{ "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT},
+{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT},
+{ "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT},
+{ "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(b),t", pa20, FLAG_STRICT},
+{ "stda", 0x0c0013e0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT},
+{ "stda", 0x0c0013e0, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT},
+{ "stda", 0x0c0013c0, 0xfc0013c0, "cmcCx,V(s,b)", pa20, FLAG_STRICT},
+{ "stda", 0x0c0013c0, 0xfc0013c0, "cmcCx,V(b)", pa20, FLAG_STRICT},
+{ "ldwax", 0x0c000180, 0xfc00dfc0, "cxx(b),t", pa10, 0},
+{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cxx(s,b),t", pa10, 0},
+{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cxx(b),t", pa10, 0},
+{ "ldws", 0x0c001080, 0xfc001fc0, "cm5(s,b),t", pa10, 0},
+{ "ldws", 0x0c001080, 0xfc001fc0, "cm5(b),t", pa10, 0},
+{ "ldhs", 0x0c001040, 0xfc001fc0, "cm5(s,b),t", pa10, 0},
+{ "ldhs", 0x0c001040, 0xfc001fc0, "cm5(b),t", pa10, 0},
+{ "ldbs", 0x0c001000, 0xfc001fc0, "cm5(s,b),t", pa10, 0},
+{ "ldbs", 0x0c001000, 0xfc001fc0, "cm5(b),t", pa10, 0},
+{ "ldwas", 0x0c001180, 0xfc00dfc0, "cm5(b),t", pa10, 0},
+{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cm5(s,b),t", pa10, 0},
+{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cm5(b),t", pa10, 0},
+{ "stws", 0x0c001280, 0xfc001fc0, "cmx,V(s,b)", pa10, 0},
+{ "stws", 0x0c001280, 0xfc001fc0, "cmx,V(b)", pa10, 0},
+{ "sths", 0x0c001240, 0xfc001fc0, "cmx,V(s,b)", pa10, 0},
+{ "sths", 0x0c001240, 0xfc001fc0, "cmx,V(b)", pa10, 0},
+{ "stbs", 0x0c001200, 0xfc001fc0, "cmx,V(s,b)", pa10, 0},
+{ "stbs", 0x0c001200, 0xfc001fc0, "cmx,V(b)", pa10, 0},
+{ "stwas", 0x0c001380, 0xfc00dfc0, "cmx,V(b)", pa10, 0},
+{ "stdby", 0x0c001340, 0xfc0013c0, "cscCx,V(s,b)", pa20, FLAG_STRICT},
+{ "stdby", 0x0c001340, 0xfc0013c0, "cscCx,V(b)", pa20, FLAG_STRICT},
+{ "stbys", 0x0c001300, 0xfc001fc0, "csx,V(s,b)", pa10, 0},
+{ "stbys", 0x0c001300, 0xfc001fc0, "csx,V(b)", pa10, 0},
/* Immediate instructions. */
-{ "ldo", 0x34000000, 0xfc00c000, "j(b),x", pa10},
-{ "ldil", 0x20000000, 0xfc000000, "k,b", pa10},
-{ "addil", 0x28000000, 0xfc000000, "k,b", pa10},
+{ "ldo", 0x34000000, 0xfc00c000, "j(b),x", pa10, 0},
+{ "ldil", 0x20000000, 0xfc000000, "k,b", pa10, 0},
+{ "addil", 0x28000000, 0xfc000000, "k,b,Z", pa10, 0},
+{ "addil", 0x28000000, 0xfc000000, "k,b", pa10, 0},
/* Branching instructions. */
-{ "bl", 0xe8000000, 0xfc00e000, "nW,b", pa10},
-{ "gate", 0xe8002000, 0xfc00e000, "nW,b", pa10},
-{ "blr", 0xe8004000, 0xfc00e001, "nx,b", pa10},
-{ "bv", 0xe800c000, 0xfc00fffd, "nx(b)", pa10},
-{ "bv", 0xe800c000, 0xfc00fffd, "n(b)", pa10},
-{ "be", 0xe0000000, 0xfc000000, "nz(S,b)", pa10},
-{ "ble", 0xe4000000, 0xfc000000, "nz(S,b)", pa10},
-{ "movb", 0xc8000000, 0xfc000000, "|nx,b,w", pa10},
-{ "movib", 0xcc000000, 0xfc000000, "|n5,b,w", pa10},
-{ "combt", 0x80000000, 0xfc000000, "<nx,b,w", pa10},
-{ "combf", 0x88000000, 0xfc000000, "<nx,b,w", pa10},
-{ "comibt", 0x84000000, 0xfc000000, "<n5,b,w", pa10},
-{ "comibf", 0x8c000000, 0xfc000000, "<n5,b,w", pa10},
-{ "addbt", 0xa0000000, 0xfc000000, "!nx,b,w", pa10},
-{ "addbf", 0xa8000000, 0xfc000000, "!nx,b,w", pa10},
-{ "addibt", 0xa4000000, 0xfc000000, "!n5,b,w", pa10},
-{ "addibf", 0xac000000, 0xfc000000, "!n5,b,w", pa10},
-{ "bb", 0xc4004000, 0xfc004000, "~nx,Q,w", pa10},
-{ "bvb", 0xc0004000, 0xffe04000, "~nx,w", pa10},
+{ "b", 0xe8008000, 0xfc00e000, "cpnXL", pa20, FLAG_STRICT},
+{ "b", 0xe800a000, 0xfc00e000, "clnXL", pa20, FLAG_STRICT},
+{ "b", 0xe8000000, 0xfc00e000, "clnW,b", pa10, FLAG_STRICT},
+{ "b", 0xe8002000, 0xfc00e000, "cgnW,b", pa10, FLAG_STRICT},
+{ "b", 0xe8000000, 0xffe0e000, "nW", pa10, 0}, /* b,l foo,r0 */
+{ "bl", 0xe8000000, 0xfc00e000, "nW,b", pa10, 0},
+{ "gate", 0xe8002000, 0xfc00e000, "nW,b", pa10, 0},
+{ "blr", 0xe8004000, 0xfc00e001, "nx,b", pa10, 0},
+{ "bv", 0xe800c000, 0xfc00fffd, "nx(b)", pa10, 0},
+{ "bv", 0xe800c000, 0xfc00fffd, "n(b)", pa10, 0},
+{ "bve", 0xe800f001, 0xfc1ffffd, "cpn(b)L", pa20, FLAG_STRICT},
+{ "bve", 0xe800f000, 0xfc1ffffd, "cln(b)L", pa20, FLAG_STRICT},
+{ "bve", 0xe800d001, 0xfc1ffffd, "cPn(b)", pa20, FLAG_STRICT},
+{ "bve", 0xe800d000, 0xfc1ffffd, "n(b)", pa20, FLAG_STRICT},
+{ "be", 0xe4000000, 0xfc000000, "clnz(S,b),Y", pa10, FLAG_STRICT},
+{ "be", 0xe4000000, 0xfc000000, "clnz(b),Y", pa10, FLAG_STRICT},
+{ "be", 0xe0000000, 0xfc000000, "nz(S,b)", pa10, 0},
+{ "be", 0xe0000000, 0xfc000000, "nz(b)", pa10, 0},
+{ "ble", 0xe4000000, 0xfc000000, "nz(S,b)", pa10, 0},
+{ "movb", 0xc8000000, 0xfc000000, "?ynx,b,w", pa10, 0},
+{ "movib", 0xcc000000, 0xfc000000, "?yn5,b,w", pa10, 0},
+{ "combt", 0x80000000, 0xfc000000, "?tnx,b,w", pa10, 0},
+{ "combf", 0x88000000, 0xfc000000, "?tnx,b,w", pa10, 0},
+{ "comibt", 0x84000000, 0xfc000000, "?tn5,b,w", pa10, 0},
+{ "comibf", 0x8c000000, 0xfc000000, "?tn5,b,w", pa10, 0},
+{ "addbt", 0xa0000000, 0xfc000000, "?dnx,b,w", pa10, 0},
+{ "addbf", 0xa8000000, 0xfc000000, "?dnx,b,w", pa10, 0},
+{ "addibt", 0xa4000000, 0xfc000000, "?dn5,b,w", pa10, 0},
+{ "addibf", 0xac000000, 0xfc000000, "?dn5,b,w", pa10, 0},
+{ "bb", 0xc0006000, 0xffe06000, "?Bnx,!,w", pa20, FLAG_STRICT},
+{ "bb", 0xc4004000, 0xfc004000, "?Bnx,B,w", pa20, FLAG_STRICT},
+{ "bb", 0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT},
+{ "bb", 0xc4004000, 0xfc004000, "?bnx,Q,w", pa10, 0},
+{ "bvb", 0xc0004000, 0xffe04000, "?bnx,w", pa10, 0},
+{ "clrbts", 0xe8004005, 0xffffffff, "", pa20, FLAG_STRICT},
+{ "popbts", 0xe8004005, 0xfffff007, "$", pa20, FLAG_STRICT},
+{ "pushnom", 0xe8004001, 0xffffffff, "", pa20, FLAG_STRICT},
+{ "pushbts", 0xe8004001, 0xffe0ffff, "x", pa20, FLAG_STRICT},
/* Computation Instructions */
-{ "add", 0x08000600, 0xfc000fe0, "dx,b,t", pa10},
-{ "addl", 0x08000a00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addo", 0x08000e00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addc", 0x08000700, 0xfc000fe0, "dx,b,t", pa10},
-{ "addco", 0x08000f00, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1add", 0x08000640, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addl", 0x08000a40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addo", 0x08000e40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2add", 0x08000680, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addl", 0x08000a80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addo", 0x08000e80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3add", 0x080006c0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addl", 0x08000ac0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addo", 0x08000ec0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sub", 0x08000400, 0xfc000fe0, "ax,b,t", pa10},
-{ "subo", 0x08000c00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subb", 0x08000500, 0xfc000fe0, "ax,b,t", pa10},
-{ "subbo", 0x08000d00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subt", 0x080004c0, 0xfc000fe0, "ax,b,t", pa10},
-{ "subto", 0x08000cc0, 0xfc000fe0, "ax,b,t", pa10},
-{ "ds", 0x08000440, 0xfc000fe0, "ax,b,t", pa10},
-{ "comclr", 0x08000880, 0xfc000fe0, "ax,b,t", pa10},
-{ "or", 0x08000240, 0xfc000fe0, "&x,b,t", pa10},
-{ "xor", 0x08000280, 0xfc000fe0, "&x,b,t", pa10},
-{ "and", 0x08000200, 0xfc000fe0, "&x,b,t", pa10},
-{ "andcm", 0x08000000, 0xfc000fe0, "&x,b,t", pa10},
-{ "uxor", 0x08000380, 0xfc000fe0, "Ux,b,t", pa10},
-{ "uaddcm", 0x08000980, 0xfc000fe0, "Ux,b,t", pa10},
-{ "uaddcmt", 0x080009c0, 0xfc000fe0, "Ux,b,t", pa10},
-{ "dcor", 0x08000b80, 0xfc1f0fe0, "Ub,t", pa10},
-{ "idcor", 0x08000bc0, 0xfc1f0fe0, "Ub,t", pa10},
-{ "addi", 0xb4000000, 0xfc000800, "di,b,x", pa10},
-{ "addio", 0xb4000800, 0xfc000800, "di,b,x", pa10},
-{ "addit", 0xb0000000, 0xfc000800, "di,b,x", pa10},
-{ "addito", 0xb0000800, 0xfc000800, "di,b,x", pa10},
-{ "subi", 0x94000000, 0xfc000800, "ai,b,x", pa10},
-{ "subio", 0x94000800, 0xfc000800, "ai,b,x", pa10},
-{ "comiclr", 0x90000000, 0xfc000800, "ai,b,x", pa10},
+{ "cmpclr", 0x080008a0, 0xfc000fe0, "?Sx,b,t", pa20, FLAG_STRICT},
+{ "cmpclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, FLAG_STRICT},
+{ "comclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "or", 0x08000260, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
+{ "or", 0x08000240, 0xfc000fe0, "?lx,b,t", pa10, 0},
+{ "xor", 0x080002a0, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
+{ "xor", 0x08000280, 0xfc000fe0, "?lx,b,t", pa10, 0},
+{ "and", 0x08000220, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
+{ "and", 0x08000200, 0xfc000fe0, "?lx,b,t", pa10, 0},
+{ "andcm", 0x08000020, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT},
+{ "andcm", 0x08000000, 0xfc000fe0, "?lx,b,t", pa10, 0},
+{ "uxor", 0x080003a0, 0xfc000fe0, "?Ux,b,t", pa20, FLAG_STRICT},
+{ "uxor", 0x08000380, 0xfc000fe0, "?ux,b,t", pa10, 0},
+{ "uaddcm", 0x080009a0, 0xfc000fa0, "cT?Ux,b,t", pa20, FLAG_STRICT},
+{ "uaddcm", 0x08000980, 0xfc000fa0, "cT?ux,b,t", pa10, FLAG_STRICT},
+{ "uaddcm", 0x08000980, 0xfc000fe0, "?ux,b,t", pa10, 0},
+{ "uaddcmt", 0x080009c0, 0xfc000fe0, "?ux,b,t", pa10, 0},
+{ "dcor", 0x08000ba0, 0xfc1f0fa0, "ci?Ub,t", pa20, FLAG_STRICT},
+{ "dcor", 0x08000b80, 0xfc1f0fa0, "ci?ub,t", pa10, FLAG_STRICT},
+{ "dcor", 0x08000b80, 0xfc1f0fe0, "?ub,t", pa10, 0},
+{ "idcor", 0x08000bc0, 0xfc1f0fe0, "?ub,t", pa10, 0},
+{ "addi", 0xb0000000, 0xfc000000, "ct?ai,b,x", pa10, FLAG_STRICT},
+{ "addi", 0xb4000000, 0xfc000000, "cv?ai,b,x", pa10, FLAG_STRICT},
+{ "addi", 0xb4000000, 0xfc000800, "?ai,b,x", pa10, 0},
+{ "addio", 0xb4000800, 0xfc000800, "?ai,b,x", pa10, 0},
+{ "addit", 0xb0000000, 0xfc000800, "?ai,b,x", pa10, 0},
+{ "addito", 0xb0000800, 0xfc000800, "?ai,b,x", pa10, 0},
+{ "add", 0x08000720, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT},
+{ "add", 0x08000700, 0xfc0007e0, "cy?ax,b,t", pa10, FLAG_STRICT},
+{ "add", 0x08000220, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT},
+{ "add", 0x08000200, 0xfc0003e0, "ca?ax,b,t", pa10, FLAG_STRICT},
+{ "add", 0x08000600, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "addl", 0x08000a00, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "addo", 0x08000e00, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "addc", 0x08000700, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "addco", 0x08000f00, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sub", 0x080004e0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub", 0x080004c0, 0xfc0007e0, "ct?sx,b,t", pa10, FLAG_STRICT},
+{ "sub", 0x08000520, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub", 0x08000500, 0xfc0007e0, "cb?sx,b,t", pa10, FLAG_STRICT},
+{ "sub", 0x08000420, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT},
+{ "sub", 0x08000400, 0xfc0007e0, "cv?sx,b,t", pa10, FLAG_STRICT},
+{ "sub", 0x08000400, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subo", 0x08000c00, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subb", 0x08000500, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subbo", 0x08000d00, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subt", 0x080004c0, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subto", 0x08000cc0, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "ds", 0x08000440, 0xfc000fe0, "?sx,b,t", pa10, 0},
+{ "subi", 0x94000000, 0xfc000000, "cv?si,b,x", pa10, FLAG_STRICT},
+{ "subi", 0x94000000, 0xfc000800, "?si,b,x", pa10, 0},
+{ "subio", 0x94000800, 0xfc000800, "?si,b,x", pa10, 0},
+{ "cmpiclr", 0x90000800, 0xfc000800, "?Si,b,x", pa20, FLAG_STRICT},
+{ "cmpiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, FLAG_STRICT},
+{ "comiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, 0},
+{ "shladd", 0x08000220, 0xfc000320, "ca?Ax,.,b,t", pa20, FLAG_STRICT},
+{ "shladd", 0x08000200, 0xfc000320, "ca?ax,.,b,t", pa10, FLAG_STRICT},
+{ "sh1add", 0x08000640, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh1addl", 0x08000a40, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh1addo", 0x08000e40, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh2add", 0x08000680, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh2addl", 0x08000a80, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh2addo", 0x08000e80, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh3add", 0x080006c0, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh3addl", 0x08000ac0, 0xfc000fe0, "?ax,b,t", pa10, 0},
+{ "sh3addo", 0x08000ec0, 0xfc000fe0, "?ax,b,t", pa10, 0},
+
+/* Subword Operation Instructions */
+
+{ "hadd", 0x08000300, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT},
+{ "havg", 0x080002c0, 0xfc00ffe0, "x,b,t", pa20, FLAG_STRICT},
+{ "hshl", 0xf8008800, 0xffe0fc20, "x,*,t", pa20, FLAG_STRICT},
+{ "hshladd", 0x08000700, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT},
+{ "hshr", 0xf800c800, 0xfc1ff820, "cSb,*,t", pa20, FLAG_STRICT},
+{ "hshradd", 0x08000500, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT},
+{ "hsub", 0x08000100, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT},
+{ "mixh", 0xf8008400, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT},
+{ "mixw", 0xf8008000, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT},
+{ "permh", 0xf8000000, 0xfc009020, "c*a,t", pa20, FLAG_STRICT},
+
/* Extract and Deposit Instructions */
-{ "vshd", 0xd0000000, 0xfc001fe0, ">x,b,t", pa10},
-{ "shd", 0xd0000800, 0xfc001c00, ">x,b,p,t", pa10},
-{ "vextru", 0xd0001000, 0xfc001fe0, ">b,T,x", pa10},
-{ "vextrs", 0xd0001400, 0xfc001fe0, ">b,T,x", pa10},
-{ "extru", 0xd0001800, 0xfc001c00, ">b,P,T,x", pa10},
-{ "extrs", 0xd0001c00, 0xfc001c00, ">b,P,T,x", pa10},
-{ "zvdep", 0xd4000000, 0xfc001fe0, ">x,T,b", pa10},
-{ "vdep", 0xd4000400, 0xfc001fe0, ">x,T,b", pa10},
-{ "zdep", 0xd4000800, 0xfc001c00, ">x,p,T,b", pa10},
-{ "dep", 0xd4000c00, 0xfc001c00, ">x,p,T,b", pa10},
-{ "zvdepi", 0xd4001000, 0xfc001fe0, ">5,T,b", pa10},
-{ "vdepi", 0xd4001400, 0xfc001fe0, ">5,T,b", pa10},
-{ "zdepi", 0xd4001800, 0xfc001c00, ">5,p,T,b", pa10},
-{ "depi", 0xd4001c00, 0xfc001c00, ">5,p,T,b", pa10},
+{ "shrpd", 0xd0000200, 0xfc001fe0, "?Xx,b,!,t", pa20, FLAG_STRICT},
+{ "shrpd", 0xd0000400, 0xfc001400, "?Xx,b,~,t", pa20, FLAG_STRICT},
+{ "shrpw", 0xd0000000, 0xfc001fe0, "?xx,b,!,t", pa10, FLAG_STRICT},
+{ "shrpw", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, FLAG_STRICT},
+{ "vshd", 0xd0000000, 0xfc001fe0, "?xx,b,t", pa10, 0},
+{ "shd", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, 0},
+{ "extrd", 0xd0001200, 0xfc001ae0, "cS?Xb,!,%,x", pa20, FLAG_STRICT},
+{ "extrd", 0xd8000000, 0xfc000000, "cS?Xb,q,|,x", pa20, FLAG_STRICT},
+{ "extrw", 0xd0001000, 0xfc001be0, "cS?xb,!,T,x", pa10, FLAG_STRICT},
+{ "extrw", 0xd0001800, 0xfc001800, "cS?xb,P,T,x", pa10, FLAG_STRICT},
+{ "vextru", 0xd0001000, 0xfc001fe0, "?xb,T,x", pa10, 0},
+{ "vextrs", 0xd0001400, 0xfc001fe0, "?xb,T,x", pa10, 0},
+{ "extru", 0xd0001800, 0xfc001c00, "?xb,P,T,x", pa10, 0},
+{ "extrs", 0xd0001c00, 0xfc001c00, "?xb,P,T,x", pa10, 0},
+{ "depd", 0xd4000200, 0xfc001ae0, "cz?Xx,!,%,b", pa20, FLAG_STRICT},
+{ "depd", 0xf0000000, 0xfc000000, "cz?Xx,~,|,b", pa20, FLAG_STRICT},
+{ "depdi", 0xd4001200, 0xfc001ae0, "cz?X5,!,%,b", pa20, FLAG_STRICT},
+{ "depdi", 0xf4000000, 0xfc000000, "cz?X5,~,|,b", pa20, FLAG_STRICT},
+{ "depw", 0xd4000000, 0xfc001be0, "cz?xx,!,T,b", pa10, FLAG_STRICT},
+{ "depw", 0xd4000800, 0xfc001800, "cz?xx,p,T,b", pa10, FLAG_STRICT},
+{ "depwi", 0xd4001000, 0xfc001be0, "cz?x5,!,T,b", pa10, FLAG_STRICT},
+{ "depwi", 0xd4001800, 0xfc001800, "cz?x5,p,T,b", pa10, FLAG_STRICT},
+{ "zvdep", 0xd4000000, 0xfc001fe0, "?xx,T,b", pa10, 0},
+{ "vdep", 0xd4000400, 0xfc001fe0, "?xx,T,b", pa10, 0},
+{ "zdep", 0xd4000800, 0xfc001c00, "?xx,p,T,b", pa10, 0},
+{ "dep", 0xd4000c00, 0xfc001c00, "?xx,p,T,b", pa10, 0},
+{ "zvdepi", 0xd4001000, 0xfc001fe0, "?x5,T,b", pa10, 0},
+{ "vdepi", 0xd4001400, 0xfc001fe0, "?x5,T,b", pa10, 0},
+{ "zdepi", 0xd4001800, 0xfc001c00, "?x5,p,T,b", pa10, 0},
+{ "depi", 0xd4001c00, 0xfc001c00, "?x5,p,T,b", pa10, 0},
/* System Control Instructions */
-{ "break", 0x00000000, 0xfc001fe0, "r,A", pa10},
-{ "rfi", 0x00000c00, 0xffffffff, "", pa10},
-{ "rfir", 0x00000ca0, 0xffffffff, "", pa11},
-{ "ssm", 0x00000d60, 0xffe0ffe0, "R,t", pa10},
-{ "rsm", 0x00000e60, 0xffe0ffe0, "R,t", pa10},
-{ "mtsm", 0x00001860, 0xffe0ffff, "x", pa10},
-{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(s,b),t", pa10},
-{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(b),t", pa10},
-{ "mtsp", 0x00001820, 0xffe01fff, "x,S", pa10},
-{ "mtctl", 0x00001840, 0xfc00ffff, "x,^", pa10},
-{ "mfsp", 0x000004a0, 0xffff1fe0, "S,t", pa10},
-{ "mfctl", 0x000008a0, 0xfc1fffe0, "^,t", pa10},
-{ "sync", 0x00000400, 0xffffffff, "", pa10},
-{ "syncdma", 0x00100400, 0xffffffff, "", pa10},
-{ "prober", 0x04001180, 0xfc003fe0, "(s,b),x,t", pa10},
-{ "prober", 0x04001180, 0xfc003fe0, "(b),x,t", pa10},
-{ "proberi", 0x04003180, 0xfc003fe0, "(s,b),R,t", pa10},
-{ "proberi", 0x04003180, 0xfc003fe0, "(b),R,t", pa10},
-{ "probew", 0x040011c0, 0xfc003fe0, "(s,b),x,t", pa10},
-{ "probew", 0x040011c0, 0xfc003fe0, "(b),x,t", pa10},
-{ "probewi", 0x040031c0, 0xfc003fe0, "(s,b),R,t", pa10},
-{ "probewi", 0x040031c0, 0xfc003fe0, "(b),R,t", pa10},
-{ "lpa", 0x04001340, 0xfc003fc0, "Zx(s,b),t", pa10},
-{ "lpa", 0x04001340, 0xfc003fc0, "Zx(b),t", pa10},
-{ "lha", 0x04001300, 0xfc003fc0, "Zx(s,b),t", pa10},
-{ "lha", 0x04001300, 0xfc003fc0, "Zx(b),t", pa10},
-{ "lci", 0x04001300, 0xfc003fe0, "x(s,b),t", pa10},
-{ "lci", 0x04001300, 0xfc003fe0, "x(b),t", pa10},
-{ "pdtlb", 0x04001200, 0xfc003fdf, "Zx(s,b)", pa10},
-{ "pdtlb", 0x04001200, 0xfc003fdf, "Zx(b)", pa10},
-{ "pitlb", 0x04000200, 0xfc001fdf, "Zx(S,b)", pa10},
-{ "pitlb", 0x04000200, 0xfc001fdf, "Zx(b)", pa10},
-{ "pdtlbe", 0x04001240, 0xfc003fdf, "Zx(s,b)", pa10},
-{ "pdtlbe", 0x04001240, 0xfc003fdf, "Zx(b)", pa10},
-{ "pitlbe", 0x04000240, 0xfc001fdf, "Zx(S,b)", pa10},
-{ "pitlbe", 0x04000240, 0xfc001fdf, "Zx(b)", pa10},
-{ "idtlba", 0x04001040, 0xfc003fff, "x,(s,b)", pa10},
-{ "idtlba", 0x04001040, 0xfc003fff, "x,(b)", pa10},
-{ "iitlba", 0x04000040, 0xfc001fff, "x,(S,b)", pa10},
-{ "iitlba", 0x04000040, 0xfc001fff, "x,(b)", pa10},
-{ "idtlbp", 0x04001000, 0xfc003fff, "x,(s,b)", pa10},
-{ "idtlbp", 0x04001000, 0xfc003fff, "x,(b)", pa10},
-{ "iitlbp", 0x04000000, 0xfc001fff, "x,(S,b)", pa10},
-{ "iitlbp", 0x04000000, 0xfc001fff, "x,(b)", pa10},
-{ "pdc", 0x04001380, 0xfc003fdf, "Zx(s,b)", pa10},
-{ "pdc", 0x04001380, 0xfc003fdf, "Zx(b)", pa10},
-{ "fdc", 0x04001280, 0xfc003fdf, "Zx(s,b)", pa10},
-{ "fdc", 0x04001280, 0xfc003fdf, "Zx(b)", pa10},
-{ "fic", 0x04000280, 0xfc001fdf, "Zx(S,b)", pa10},
-{ "fic", 0x04000280, 0xfc001fdf, "Zx(b)", pa10},
-{ "fdce", 0x040012c0, 0xfc003fdf, "Zx(s,b)", pa10},
-{ "fdce", 0x040012c0, 0xfc003fdf, "Zx(b)", pa10},
-{ "fice", 0x040002c0, 0xfc001fdf, "Zx(S,b)", pa10},
-{ "fice", 0x040002c0, 0xfc001fdf, "Zx(b)", pa10},
-{ "diag", 0x14000000, 0xfc000000, "D", pa10},
+{ "break", 0x00000000, 0xfc001fe0, "r,A", pa10, 0},
+{ "rfi", 0x00000c00, 0xffffff1f, "cr", pa10, FLAG_STRICT},
+{ "rfi", 0x00000c00, 0xffffffff, "", pa10, 0},
+{ "rfir", 0x00000ca0, 0xffffffff, "", pa11, 0},
+{ "ssm", 0x00000d60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT},
+{ "ssm", 0x00000d60, 0xffe0ffe0, "R,t", pa10, 0},
+{ "rsm", 0x00000e60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT},
+{ "rsm", 0x00000e60, 0xffe0ffe0, "R,t", pa10, 0},
+{ "mtsm", 0x00001860, 0xffe0ffff, "x", pa10, 0},
+{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(s,b),t", pa10, 0},
+{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(b),t", pa10, 0},
+{ "mtsp", 0x00001820, 0xffe01fff, "x,S", pa10, 0},
+{ "mtctl", 0x00001840, 0xfc00ffff, "x,^", pa10, 0},
+{ "mtsarcm", 0x016018C0, 0xffe0ffff, "x", pa20, FLAG_STRICT},
+{ "mfia", 0x000014A0, 0xffffffe0, "t", pa20, FLAG_STRICT},
+{ "mfsp", 0x000004a0, 0xffff1fe0, "S,t", pa10, 0},
+{ "mfctl", 0x016048a0, 0xffffffe0, "cW!,t", pa20, FLAG_STRICT},
+{ "mfctl", 0x000008a0, 0xfc1fffe0, "^,t", pa10, 0},
+{ "sync", 0x00000400, 0xffffffff, "", pa10, 0},
+{ "syncdma", 0x00100400, 0xffffffff, "", pa10, 0},
+{ "probe", 0x04001180, 0xfc003fa0, "cw(s,b),x,t", pa10, FLAG_STRICT},
+{ "probe", 0x04001180, 0xfc003fa0, "cw(b),x,t", pa10, FLAG_STRICT},
+{ "probei", 0x04003180, 0xfc003fa0, "cw(s,b),R,t", pa10, FLAG_STRICT},
+{ "probei", 0x04003180, 0xfc003fa0, "cw(b),R,t", pa10, FLAG_STRICT},
+{ "prober", 0x04001180, 0xfc003fe0, "(s,b),x,t", pa10, 0},
+{ "prober", 0x04001180, 0xfc003fe0, "(b),x,t", pa10, 0},
+{ "proberi", 0x04003180, 0xfc003fe0, "(s,b),R,t", pa10, 0},
+{ "proberi", 0x04003180, 0xfc003fe0, "(b),R,t", pa10, 0},
+{ "probew", 0x040011c0, 0xfc003fe0, "(s,b),x,t", pa10, 0},
+{ "probew", 0x040011c0, 0xfc003fe0, "(b),x,t", pa10, 0},
+{ "probewi", 0x040031c0, 0xfc003fe0, "(s,b),R,t", pa10, 0},
+{ "probewi", 0x040031c0, 0xfc003fe0, "(b),R,t", pa10, 0},
+{ "lpa", 0x04001340, 0xfc003fc0, "cZx(s,b),t", pa10, 0},
+{ "lpa", 0x04001340, 0xfc003fc0, "cZx(b),t", pa10, 0},
+{ "lha", 0x04001300, 0xfc003fc0, "cZx(s,b),t", pa10, 0},
+{ "lha", 0x04001300, 0xfc003fc0, "cZx(b),t", pa10, 0},
+{ "lci", 0x04001300, 0xfc003fe0, "x(s,b),t", pa10, 0},
+{ "lci", 0x04001300, 0xfc003fe0, "x(b),t", pa10, 0},
+{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(s,b)", pa20, FLAG_STRICT},
+{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(b)", pa20, FLAG_STRICT},
+{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(s,b)", pa10, 0},
+{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(b)", pa10, 0},
+{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(S,b)", pa20, FLAG_STRICT},
+{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(b)", pa20, FLAG_STRICT},
+{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(S,b)", pa10, 0},
+{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(b)", pa10, 0},
+{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(s,b)", pa10, 0},
+{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(b)", pa10, 0},
+{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(S,b)", pa10, 0},
+{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(b)", pa10, 0},
+{ "idtlba", 0x04001040, 0xfc003fff, "x,(s,b)", pa10, 0},
+{ "idtlba", 0x04001040, 0xfc003fff, "x,(b)", pa10, 0},
+{ "iitlba", 0x04000040, 0xfc001fff, "x,(S,b)", pa10, 0},
+{ "iitlba", 0x04000040, 0xfc001fff, "x,(b)", pa10, 0},
+{ "idtlbp", 0x04001000, 0xfc003fff, "x,(s,b)", pa10, 0},
+{ "idtlbp", 0x04001000, 0xfc003fff, "x,(b)", pa10, 0},
+{ "iitlbp", 0x04000000, 0xfc001fff, "x,(S,b)", pa10, 0},
+{ "iitlbp", 0x04000000, 0xfc001fff, "x,(b)", pa10, 0},
+{ "pdc", 0x04001380, 0xfc003fdf, "cZx(s,b)", pa10, 0},
+{ "pdc", 0x04001380, 0xfc003fdf, "cZx(b)", pa10, 0},
+{ "fdc", 0x04001280, 0xfc003fdf, "cZx(s,b)", pa10, 0},
+{ "fdc", 0x04001280, 0xfc003fdf, "cZx(b)", pa10, 0},
+{ "fic", 0x04000280, 0xfc001fdf, "cZx(S,b)", pa10, 0},
+{ "fic", 0x04000280, 0xfc001fdf, "cZx(b)", pa10, 0},
+{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(s,b)", pa10, 0},
+{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(b)", pa10, 0},
+{ "fice", 0x040002c0, 0xfc001fdf, "cZx(S,b)", pa10, 0},
+{ "fice", 0x040002c0, 0xfc001fdf, "cZx(b)", pa10, 0},
+{ "diag", 0x14000000, 0xfc000000, "D", pa10, 0},
+{ "idtlbt", 0x04001800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT},
+{ "iitlbt", 0x04000800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT},
+
+/* These may be specific to certain versions of the PA. Joel claimed
+ they were 72000 (7200?) specific. However, I'm almost certain the
+ mtcpu/mfcpu were undocumented, but available in the older 700 machines. */
+{ "mtcpu", 0x14001600, 0xfc00ffff, "x,^", pa10, 0},
+{ "mfcpu", 0x14001A00, 0xfc00ffff, "^,x", pa10, 0},
+{ "tocen", 0x14403600, 0xffffffff, "", pa10, 0},
+{ "tocdis", 0x14401620, 0xffffffff, "", pa10, 0},
+{ "shdwgr", 0x14402600, 0xffffffff, "", pa10, 0},
+{ "grshdw", 0x14400620, 0xffffffff, "", pa10, 0},
/* gfw and gfr are not in the HP PA 1.1 manual, but they are in either
the Timex FPU or the Mustang ERS (not sure which) manual. */
-{ "gfw", 0x04001680, 0xfc003fdf, "Zx(s,b)", pa11},
-{ "gfw", 0x04001680, 0xfc003fdf, "Zx(b)", pa11},
-{ "gfr", 0x04001a80, 0xfc003fdf, "Zx(s,b)", pa11},
-{ "gfr", 0x04001a80, 0xfc003fdf, "Zx(b)", pa11},
+{ "gfw", 0x04001680, 0xfc003fdf, "cZx(s,b)", pa11, 0},
+{ "gfw", 0x04001680, 0xfc003fdf, "cZx(b)", pa11, 0},
+{ "gfr", 0x04001a80, 0xfc003fdf, "cZx(s,b)", pa11, 0},
+{ "gfr", 0x04001a80, 0xfc003fdf, "cZx(b)", pa11, 0},
/* Floating Point Coprocessor Instructions */
-
-{ "fldwx", 0x24000000, 0xfc001f80, "cx(s,b),v", pa10},
-{ "fldwx", 0x24000000, 0xfc001f80, "cx(b),v", pa10},
-{ "flddx", 0x2c000000, 0xfc001fc0, "cx(s,b),y", pa10},
-{ "flddx", 0x2c000000, 0xfc001fc0, "cx(b),y", pa10},
-{ "fstwx", 0x24000200, 0xfc001f80, "cv,x(s,b)", pa10},
-{ "fstwx", 0x24000200, 0xfc001f80, "cv,x(b)", pa10},
-{ "fstdx", 0x2c000200, 0xfc001fc0, "cy,x(s,b)", pa10},
-{ "fstdx", 0x2c000200, 0xfc001fc0, "cy,x(b)", pa10},
-{ "fstqx", 0x3c000200, 0xfc001fc0, "cy,x(s,b)", pa10},
-{ "fstqx", 0x3c000200, 0xfc001fc0, "cy,x(b)", pa10},
-{ "fldws", 0x24001000, 0xfc001f80, "C5(s,b),v", pa10},
-{ "fldws", 0x24001000, 0xfc001f80, "C5(b),v", pa10},
-{ "fldds", 0x2c001000, 0xfc001fc0, "C5(s,b),y", pa10},
-{ "fldds", 0x2c001000, 0xfc001fc0, "C5(b),y", pa10},
-{ "fstws", 0x24001200, 0xfc001f80, "Cv,5(s,b)", pa10},
-{ "fstws", 0x24001200, 0xfc001f80, "Cv,5(b)", pa10},
-{ "fstds", 0x2c001200, 0xfc001fc0, "Cy,5(s,b)", pa10},
-{ "fstds", 0x2c001200, 0xfc001fc0, "Cy,5(b)", pa10},
-{ "fstqs", 0x3c001200, 0xfc001fc0, "Cy,5(s,b)", pa10},
-{ "fstqs", 0x3c001200, 0xfc001fc0, "Cy,5(b)", pa10},
-{ "fadd", 0x30000600, 0xfc00e7e0, "FE,X,v", pa10},
-{ "fadd", 0x38000600, 0xfc00e720, "IJ,K,v", pa10},
-{ "fsub", 0x30002600, 0xfc00e7e0, "FE,X,v", pa10},
-{ "fsub", 0x38002600, 0xfc00e720, "IJ,K,v", pa10},
-{ "fmpy", 0x30004600, 0xfc00e7e0, "FE,X,v", pa10},
-{ "fmpy", 0x38004600, 0xfc00e720, "IJ,K,v", pa10},
-{ "fdiv", 0x30006600, 0xfc00e7e0, "FE,X,v", pa10},
-{ "fdiv", 0x38006600, 0xfc00e720, "IJ,K,v", pa10},
-{ "fsqrt", 0x30008000, 0xfc1fe7e0, "FE,v", pa10},
-{ "fsqrt", 0x38008000, 0xfc1fe720, "FJ,v", pa10},
-{ "fabs", 0x30006000, 0xfc1fe7e0, "FE,v", pa10},
-{ "fabs", 0x38006000, 0xfc1fe720, "FJ,v", pa10},
-{ "frem", 0x30008600, 0xfc00e7e0, "FE,X,v", pa10},
-{ "frem", 0x38008600, 0xfc00e720, "FJ,K,v", pa10},
-{ "frnd", 0x3000a000, 0xfc1fe7e0, "FE,v", pa10},
-{ "frnd", 0x3800a000, 0xfc1fe720, "FJ,v", pa10},
-{ "fcpy", 0x30004000, 0xfc1fe7e0, "FE,v", pa10},
-{ "fcpy", 0x38004000, 0xfc1fe720, "FJ,v", pa10},
-{ "fcnvff", 0x30000200, 0xfc1f87e0, "FGE,v", pa10},
-{ "fcnvff", 0x38000200, 0xfc1f8720, "FGJ,v", pa10},
-{ "fcnvxf", 0x30008200, 0xfc1f87e0, "FGE,v", pa10},
-{ "fcnvxf", 0x38008200, 0xfc1f8720, "FGJ,v", pa10},
-{ "fcnvfx", 0x30010200, 0xfc1f87e0, "FGE,v", pa10},
-{ "fcnvfx", 0x38010200, 0xfc1f8720, "FGJ,v", pa10},
-{ "fcnvfxt", 0x30018200, 0xfc1f87e0, "FGE,v", pa10},
-{ "fcnvfxt", 0x38018200, 0xfc1f8720, "FGJ,v", pa10},
-{ "fmpyfadd", 0xb8000000, 0xfc000020, "FE,X,3,v", pa20},
-{ "fmpynfadd", 0xb8000020, 0xfc000020, "FE,X,3,v", pa20},
-{ "fneg", 0x3000c000, 0xfc1fe7e0, "FE,v", pa20},
-{ "fneg", 0x3800c000, 0xfc1fe720, "FJ,v", pa20},
-{ "fnegabs", 0x3000e000, 0xfc1fe7e0, "FE,v", pa20},
-{ "fnegabs", 0x3800e000, 0xfc1fe720, "FJ,v", pa20},
-{ "fcmp", 0x30000400, 0xfc00e7e0, "FME,X", pa10},
-{ "fcmp", 0x38000400, 0xfc00e720, "IMJ,K", pa10},
-{ "xmpyu", 0x38004700, 0xfc00e720, "E,X,v", pa11},
-{ "fmpyadd", 0x18000000, 0xfc000000, "H4,6,7,9,8", pa11},
-{ "fmpysub", 0x98000000, 0xfc000000, "H4,6,7,9,8", pa11},
-{ "ftest", 0x30002420, 0xffffffff, "", pa10},
-{ "fid", 0x30000000, 0xffffffff, "", pa11},
-
+
+{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(s,b),fT", pa20, FLAG_STRICT},
+{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(b),fT", pa20, FLAG_STRICT},
+{ "fldw", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa10, FLAG_STRICT},
+{ "fldw", 0x24000000, 0xfc001380, "cxccx(b),fT", pa10, FLAG_STRICT},
+{ "fldw", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa10, FLAG_STRICT},
+{ "fldw", 0x24001000, 0xfc001380, "cmcc5(b),fT", pa10, FLAG_STRICT},
+{ "fldw", 0x5c000000, 0xfc000004, "d(s,b),fe", pa20, FLAG_STRICT},
+{ "fldw", 0x5c000000, 0xfc000004, "d(b),fe", pa20, FLAG_STRICT},
+{ "fldw", 0x58000000, 0xfc000004, "cJd(s,b),fe", pa20, FLAG_STRICT},
+{ "fldw", 0x58000000, 0xfc000004, "cJd(b),fe", pa20, FLAG_STRICT},
+{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(s,b),ft", pa20, FLAG_STRICT},
+{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(b),ft", pa20, FLAG_STRICT},
+{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa10, FLAG_STRICT},
+{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(b),ft", pa10, FLAG_STRICT},
+{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa10, FLAG_STRICT},
+{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(b),ft", pa10, FLAG_STRICT},
+{ "fldd", 0x50000002, 0xfc000002, "cq#(s,b),x", pa20, FLAG_STRICT},
+{ "fldd", 0x50000002, 0xfc000002, "cq#(b),x", pa20, FLAG_STRICT},
+{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(s,b)", pa10, FLAG_STRICT},
+{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(b)", pa10, FLAG_STRICT},
+{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa10, FLAG_STRICT},
+{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(b)", pa10, FLAG_STRICT},
+{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(s,b)", pa10, FLAG_STRICT},
+{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(b)", pa10, FLAG_STRICT},
+{ "fstw", 0x7c000000, 0xfc000004, "fe,d(s,b)", pa20, FLAG_STRICT},
+{ "fstw", 0x7c000000, 0xfc000004, "fe,d(b)", pa20, FLAG_STRICT},
+{ "fstw", 0x78000000, 0xfc000004, "cJfe,d(s,b)", pa20, FLAG_STRICT},
+{ "fstw", 0x78000000, 0xfc000004, "cJfe,d(b)", pa20, FLAG_STRICT},
+{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(s,b)", pa10, FLAG_STRICT},
+{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(b)", pa10, FLAG_STRICT},
+{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa10, FLAG_STRICT},
+{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(b)", pa10, FLAG_STRICT},
+{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa10, FLAG_STRICT},
+{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(b)", pa10, FLAG_STRICT},
+{ "fstd", 0x70000002, 0xfc000002, "cqx,#(s,b)", pa20, FLAG_STRICT},
+{ "fstd", 0x70000002, 0xfc000002, "cqx,#(b)", pa20, FLAG_STRICT},
+{ "fldwx", 0x24000000, 0xfc001f80, "cxx(s,b),fT", pa10, 0},
+{ "fldwx", 0x24000000, 0xfc001f80, "cxx(b),fT", pa10, 0},
+{ "flddx", 0x2c000000, 0xfc001fc0, "cxx(s,b),ft", pa10, 0},
+{ "flddx", 0x2c000000, 0xfc001fc0, "cxx(b),ft", pa10, 0},
+{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(s,b)", pa10, 0},
+{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(b)", pa10, 0},
+{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0},
+{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(b)", pa10, 0},
+{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0},
+{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(b)", pa10, 0},
+{ "fldws", 0x24001000, 0xfc001f80, "cm5(s,b),fT", pa10, 0},
+{ "fldws", 0x24001000, 0xfc001f80, "cm5(b),fT", pa10, 0},
+{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(s,b),ft", pa10, 0},
+{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(b),ft", pa10, 0},
+{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(s,b)", pa10, 0},
+{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(b)", pa10, 0},
+{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0},
+{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(b)", pa10, 0},
+{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0},
+{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(b)", pa10, 0},
+{ "fadd", 0x30000600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
+{ "fadd", 0x38000600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
+{ "fsub", 0x30002600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
+{ "fsub", 0x38002600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
+{ "fmpy", 0x30004600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
+{ "fmpy", 0x38004600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
+{ "fdiv", 0x30006600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
+{ "fdiv", 0x38006600, 0xfc00e720, "IfA,fB,fT", pa10, 0},
+{ "fsqrt", 0x30008000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
+{ "fsqrt", 0x38008000, 0xfc1fe720, "FfA,fT", pa10, 0},
+{ "fabs", 0x30006000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
+{ "fabs", 0x38006000, 0xfc1fe720, "FfA,fT", pa10, 0},
+{ "frem", 0x30008600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0},
+{ "frem", 0x38008600, 0xfc00e720, "FfA,fB,fT", pa10, 0},
+{ "frnd", 0x3000a000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
+{ "frnd", 0x3800a000, 0xfc1fe720, "FfA,fT", pa10, 0},
+{ "fcpy", 0x30004000, 0xfc1fe7e0, "Ffa,fT", pa10, 0},
+{ "fcpy", 0x38004000, 0xfc1fe720, "FfA,fT", pa10, 0},
+{ "fcnvff", 0x30000200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
+{ "fcnvff", 0x38000200, 0xfc1f8720, "FGfA,fT", pa10, 0},
+{ "fcnvxf", 0x30008200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
+{ "fcnvxf", 0x38008200, 0xfc1f8720, "FGfA,fT", pa10, 0},
+{ "fcnvfx", 0x30010200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
+{ "fcnvfx", 0x38010200, 0xfc1f8720, "FGfA,fT", pa10, 0},
+{ "fcnvfxt", 0x30018200, 0xfc1f87e0, "FGfa,fT", pa10, 0},
+{ "fcnvfxt", 0x38018200, 0xfc1f8720, "FGfA,fT", pa10, 0},
+{ "fmpyfadd", 0xb8000000, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT},
+{ "fmpynfadd", 0xb8000020, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT},
+{ "fneg", 0x3000c000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT},
+{ "fneg", 0x3800c000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT},
+{ "fnegabs", 0x3000e000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT},
+{ "fnegabs", 0x3800e000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT},
+{ "fcnv", 0x30000200, 0xfc1c0720, "{_fa,fT", pa20, FLAG_STRICT},
+{ "fcnv", 0x38000200, 0xfc1c0720, "FGfA,fT", pa20, FLAG_STRICT},
+{ "fcmp", 0x30000400, 0xfc0007e0, "F?ffa,fb,h", pa20, FLAG_STRICT},
+{ "fcmp", 0x38000400, 0xfc000720, "I?ffA,fB,h", pa20, FLAG_STRICT},
+{ "fcmp", 0x30000400, 0xfc00e7e0, "F?ffa,fb", pa10, 0},
+{ "fcmp", 0x38000400, 0xfc00e720, "I?ffA,fB", pa10, 0},
+{ "xmpyu", 0x38004700, 0xfc00e720, "fX,fB,fT", pa11, 0},
+{ "fmpyadd", 0x18000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0},
+{ "fmpysub", 0x98000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0},
+{ "ftest", 0x30002420, 0xffffffe0, ",=", pa20, FLAG_STRICT},
+{ "ftest", 0x30000420, 0xffff1fff, "m", pa20, FLAG_STRICT},
+{ "ftest", 0x30002420, 0xffffffff, "", pa10, 0},
+{ "fid", 0x30000000, 0xffffffff, "", pa11, 0},
+
+/* Performance Monitor Instructions */
+
+{ "pmdis", 0x30000280, 0xffffffdf, "N", pa20, FLAG_STRICT},
+{ "pmenb", 0x30000680, 0xffffffff, "", pa20, FLAG_STRICT},
/* Assist Instructions */
-{ "spop0", 0x10000000, 0xfc000600, "f,ON", pa10},
-{ "spop1", 0x10000200, 0xfc000600, "f,oNt", pa10},
-{ "spop2", 0x10000400, 0xfc000600, "f,1Nb", pa10},
-{ "spop3", 0x10000600, 0xfc000600, "f,0Nx,b", pa10},
-{ "copr", 0x30000000, 0xfc000000, "u,2N", pa10},
-{ "cldwx", 0x24000000, 0xfc001e00, "ucx(s,b),t", pa10},
-{ "cldwx", 0x24000000, 0xfc001e00, "ucx(b),t", pa10},
-{ "clddx", 0x2c000000, 0xfc001e00, "ucx(s,b),t", pa10},
-{ "clddx", 0x2c000000, 0xfc001e00, "ucx(b),t", pa10},
-{ "cstwx", 0x24000200, 0xfc001e00, "uct,x(s,b)", pa10},
-{ "cstwx", 0x24000200, 0xfc001e00, "uct,x(b)", pa10},
-{ "cstdx", 0x2c000200, 0xfc001e00, "uct,x(s,b)", pa10},
-{ "cstdx", 0x2c000200, 0xfc001e00, "uct,x(b)", pa10},
-{ "cldws", 0x24001000, 0xfc001e00, "uC5(s,b),t", pa10},
-{ "cldws", 0x24001000, 0xfc001e00, "uC5(b),t", pa10},
-{ "cldds", 0x2c001000, 0xfc001e00, "uC5(s,b),t", pa10},
-{ "cldds", 0x2c001000, 0xfc001e00, "uC5(b),t", pa10},
-{ "cstws", 0x24001200, 0xfc001e00, "uCt,5(s,b)", pa10},
-{ "cstws", 0x24001200, 0xfc001e00, "uCt,5(b)", pa10},
-{ "cstds", 0x2c001200, 0xfc001e00, "uCt,5(s,b)", pa10},
-{ "cstds", 0x2c001200, 0xfc001e00, "uCt,5(b)", pa10},
+{ "spop0", 0x10000000, 0xfc000600, "v,ON", pa10, 0},
+{ "spop1", 0x10000200, 0xfc000600, "v,oNt", pa10, 0},
+{ "spop2", 0x10000400, 0xfc000600, "v,1Nb", pa10, 0},
+{ "spop3", 0x10000600, 0xfc000600, "v,0Nx,b", pa10, 0},
+{ "copr", 0x30000000, 0xfc000000, "u,2N", pa10, 0},
+{ "cldwx", 0x24000000, 0xfc001e00, "ucxx(s,b),t", pa10, 0},
+{ "cldwx", 0x24000000, 0xfc001e00, "ucxx(b),t", pa10, 0},
+{ "clddx", 0x2c000000, 0xfc001e00, "ucxx(s,b),t", pa10, 0},
+{ "clddx", 0x2c000000, 0xfc001e00, "ucxx(b),t", pa10, 0},
+{ "cstwx", 0x24000200, 0xfc001e00, "ucxt,x(s,b)", pa10, 0},
+{ "cstwx", 0x24000200, 0xfc001e00, "ucxt,x(b)", pa10, 0},
+{ "cstdx", 0x2c000200, 0xfc001e00, "ucxt,x(s,b)", pa10, 0},
+{ "cstdx", 0x2c000200, 0xfc001e00, "ucxt,x(b)", pa10, 0},
+{ "cldws", 0x24001000, 0xfc001e00, "ucm5(s,b),t", pa10, 0},
+{ "cldws", 0x24001000, 0xfc001e00, "ucm5(b),t", pa10, 0},
+{ "cldds", 0x2c001000, 0xfc001e00, "ucm5(s,b),t", pa10, 0},
+{ "cldds", 0x2c001000, 0xfc001e00, "ucm5(b),t", pa10, 0},
+{ "cstws", 0x24001200, 0xfc001e00, "ucmt,5(s,b)", pa10, 0},
+{ "cstws", 0x24001200, 0xfc001e00, "ucmt,5(b)", pa10, 0},
+{ "cstds", 0x2c001200, 0xfc001e00, "ucmt,5(s,b)", pa10, 0},
+{ "cstds", 0x2c001200, 0xfc001e00, "ucmt,5(b)", pa10, 0},
+{ "cldw", 0x24000000, 0xfc001e00, "ucxx(s,b),t", pa10, FLAG_STRICT},
+{ "cldw", 0x24000000, 0xfc001e00, "ucxx(b),t", pa10, FLAG_STRICT},
+{ "cldw", 0x24001000, 0xfc001e00, "ucm5(s,b),t", pa10, FLAG_STRICT},
+{ "cldw", 0x24001000, 0xfc001e00, "ucm5(b),t", pa10, FLAG_STRICT},
+{ "cldd", 0x2c000000, 0xfc001e00, "ucxx(s,b),t", pa10, FLAG_STRICT},
+{ "cldd", 0x2c000000, 0xfc001e00, "ucxx(b),t", pa10, FLAG_STRICT},
+{ "cldd", 0x2c001000, 0xfc001e00, "ucm5(s,b),t", pa10, FLAG_STRICT},
+{ "cldd", 0x2c001000, 0xfc001e00, "ucm5(b),t", pa20, FLAG_STRICT},
+{ "cstw", 0x24000200, 0xfc001e00, "ucxt,x(s,b)", pa10, FLAG_STRICT},
+{ "cstw", 0x24000200, 0xfc001e00, "ucxt,x(b)", pa10, FLAG_STRICT},
+{ "cstw", 0x24001200, 0xfc001e00, "ucmt,5(s,b)", pa10, FLAG_STRICT},
+{ "cstw", 0x24001200, 0xfc001e00, "ucmt,5(b)", pa10, FLAG_STRICT},
+{ "cstd", 0x2c000200, 0xfc001e00, "ucxt,x(s,b)", pa10, FLAG_STRICT},
+{ "cstd", 0x2c000200, 0xfc001e00, "ucxt,x(b)", pa10, FLAG_STRICT},
+{ "cstd", 0x2c001200, 0xfc001e00, "ucmt,5(s,b)", pa10, FLAG_STRICT},
+{ "cstd", 0x2c001200, 0xfc001e00, "ucmt,5(b)", pa10, FLAG_STRICT},
};
#define NUMOPCODES ((sizeof pa_opcodes)/(sizeof pa_opcodes[0]))
diff --git a/include/opcode/i370.h b/include/opcode/i370.h
new file mode 100644
index 000000000..f2049e741
--- /dev/null
+++ b/include/opcode/i370.h
@@ -0,0 +1,265 @@
+/* i370.h -- Header file for S/390 opcode table
+ Copyright 1994, 95, 98, 99, 2000 Free Software Foundation, Inc.
+ PowerPC version written by Ian Lance Taylor, Cygnus Support
+ Rewritten for i370 ESA/390 support, Linas Vepstas <linas@linas.org>
+
+This file is part of GDB, GAS, and the GNU binutils.
+
+GDB, GAS, and the GNU binutils are free software; you can redistribute
+them and/or modify them under the terms of the GNU General Public
+License as published by the Free Software Foundation; either version
+1, or (at your option) any later version.
+
+GDB, GAS, and the GNU binutils are distributed in the hope that they
+will be useful, but WITHOUT ANY WARRANTY; without even the implied
+warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this file; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef I370_H
+#define I370_H
+
+/* The opcode table is an array of struct i370_opcode. */
+typedef union
+{
+ unsigned int i[2];
+ unsigned short s[4];
+ unsigned char b[8];
+} i370_insn_t;
+
+struct i370_opcode
+{
+ /* The opcode name. */
+ const char *name;
+
+ /* the length of the instruction */
+ char len;
+
+ /* The opcode itself. Those bits which will be filled in with
+ operands are zeroes. */
+ i370_insn_t opcode;
+
+ /* The opcode mask. This is used by the disassembler. This is a
+ mask containing ones indicating those bits which must match the
+ opcode field, and zeroes indicating those bits which need not
+ match (and are presumably filled in by operands). */
+ i370_insn_t mask;
+
+ /* One bit flags for the opcode. These are used to indicate which
+ specific processors support the instructions. The defined values
+ are listed below. */
+ unsigned long flags;
+
+ /* An array of operand codes. Each code is an index into the
+ operand table. They appear in the order which the operands must
+ appear in assembly code, and are terminated by a zero. */
+ unsigned char operands[8];
+};
+
+/* The table itself is sorted by major opcode number, and is otherwise
+ in the order in which the disassembler should consider
+ instructions. */
+extern const struct i370_opcode i370_opcodes[];
+extern const int i370_num_opcodes;
+
+/* Values defined for the flags field of a struct i370_opcode. */
+
+/* Opcode is defined for the original 360 architecture. */
+#define I370_OPCODE_360 (0x01)
+
+/* Opcode is defined for the 370 architecture. */
+#define I370_OPCODE_370 (0x02)
+
+/* Opcode is defined for the 370-XA architecture. */
+#define I370_OPCODE_370_XA (0x04)
+
+/* Opcode is defined for the ESA/370 architecture. */
+#define I370_OPCODE_ESA370 (0x08)
+
+/* Opcode is defined for the ESA/390 architecture. */
+#define I370_OPCODE_ESA390 (0x10)
+
+/* Opcode is defined for the ESA/390 w/ BFP facility. */
+#define I370_OPCODE_ESA390_BF (0x20)
+
+/* Opcode is defined for the ESA/390 w/ branch & set authority facility. */
+#define I370_OPCODE_ESA390_BS (0x40)
+
+/* Opcode is defined for the ESA/390 w/ checksum facility. */
+#define I370_OPCODE_ESA390_CK (0x80)
+
+/* Opcode is defined for the ESA/390 w/ compare & move extended facility. */
+#define I370_OPCODE_ESA390_CM (0x100)
+
+/* Opcode is defined for the ESA/390 w/ flt.pt. support extensions facility. */
+#define I370_OPCODE_ESA390_FX (0x200)
+
+/* Opcode is defined for the ESA/390 w/ HFP facility. */
+#define I370_OPCODE_ESA390_HX (0x400)
+
+/* Opcode is defined for the ESA/390 w/ immediate & relative facility. */
+#define I370_OPCODE_ESA390_IR (0x800)
+
+/* Opcode is defined for the ESA/390 w/ move-inverse facility. */
+#define I370_OPCODE_ESA390_MI (0x1000)
+
+/* Opcode is defined for the ESA/390 w/ program-call-fast facility. */
+#define I370_OPCODE_ESA390_PC (0x2000)
+
+/* Opcode is defined for the ESA/390 w/ perform-locked-op facility. */
+#define I370_OPCODE_ESA390_PL (0x4000)
+
+/* Opcode is defined for the ESA/390 w/ square-root facility. */
+#define I370_OPCODE_ESA390_QR (0x8000)
+
+/* Opcode is defined for the ESA/390 w/ resume-program facility. */
+#define I370_OPCODE_ESA390_RP (0x10000)
+
+/* Opcode is defined for the ESA/390 w/ set-address-space-fast facility. */
+#define I370_OPCODE_ESA390_SA (0x20000)
+
+/* Opcode is defined for the ESA/390 w/ subspace group facility. */
+#define I370_OPCODE_ESA390_SG (0x40000)
+
+/* Opcode is defined for the ESA/390 w/ string facility. */
+#define I370_OPCODE_ESA390_SR (0x80000)
+
+/* Opcode is defined for the ESA/390 w/ trap facility. */
+#define I370_OPCODE_ESA390_TR (0x100000)
+
+#define I370_OPCODE_ESA390_SUPERSET (0x1fffff)
+
+
+/* The operands table is an array of struct i370_operand. */
+
+struct i370_operand
+{
+ /* The number of bits in the operand. */
+ int bits;
+
+ /* How far the operand is left shifted in the instruction. */
+ int shift;
+
+ /* Insertion function. This is used by the assembler. To insert an
+ operand value into an instruction, check this field.
+
+ If it is NULL, execute
+ i |= (op & ((1 << o->bits) - 1)) << o->shift;
+ (i is the instruction which we are filling in, o is a pointer to
+ this structure, and op is the opcode value; this assumes twos
+ complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction and the operand value. It will return the new value
+ of the instruction. If the ERRMSG argument is not NULL, then if
+ the operand value is illegal, *ERRMSG will be set to a warning
+ string (the operand will be inserted in any case). If the
+ operand value is legal, *ERRMSG will be unchanged (most operands
+ can accept any value). */
+ i370_insn_t (*insert) PARAMS ((i370_insn_t instruction, long op,
+ const char **errmsg));
+
+ /* Extraction function. This is used by the disassembler. To
+ extract this operand type from an instruction, check this field.
+
+ If it is NULL, compute
+ op = ((i) >> o->shift) & ((1 << o->bits) - 1);
+ if ((o->flags & I370_OPERAND_SIGNED) != 0
+ && (op & (1 << (o->bits - 1))) != 0)
+ op -= 1 << o->bits;
+ (i is the instruction, o is a pointer to this structure, and op
+ is the result; this assumes twos complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction value. It will return the value of the operand. If
+ the INVALID argument is not NULL, *INVALID will be set to
+ non-zero if this operand type can not actually be extracted from
+ this operand (i.e., the instruction does not match). If the
+ operand is valid, *INVALID will not be changed. */
+ long (*extract) PARAMS ((i370_insn_t instruction, int *invalid));
+
+ /* One bit syntax flags. */
+ unsigned long flags;
+
+ /* name -- handy for debugging, otherwise pointless */
+ char * name;
+};
+
+/* Elements in the table are retrieved by indexing with values from
+ the operands field of the i370_opcodes table. */
+
+extern const struct i370_operand i370_operands[];
+
+/* Values defined for the flags field of a struct i370_operand. */
+
+/* This operand should be wrapped in parentheses rather than
+ separated from the previous by a comma. This is used for S, RS and
+ SS form instructions which want their operands to look like
+ reg,displacement(basereg) */
+#define I370_OPERAND_SBASE (0x01)
+
+/* This operand is a base register. It may or may not appear next
+ to an index register, i.e. either of the two forms
+ reg,displacement(basereg)
+ reg,displacement(index,basereg) */
+#define I370_OPERAND_BASE (0x02)
+
+/* This pair of operands should be wrapped in parentheses rather than
+ separated from the last by a comma. This is used for the RX form
+ instructions which want their operands to look like
+ reg,displacement(index,basereg) */
+#define I370_OPERAND_INDEX (0x04)
+
+/* This operand names a register. The disassembler uses this to print
+ register names with a leading 'r'. */
+#define I370_OPERAND_GPR (0x08)
+
+/* This operand names a floating point register. The disassembler
+ prints these with a leading 'f'. */
+#define I370_OPERAND_FPR (0x10)
+
+/* This operand is a displacement. */
+#define I370_OPERAND_RELATIVE (0x20)
+
+/* This operand is a length, such as that in SS form instructions. */
+#define I370_OPERAND_LENGTH (0x40)
+
+/* This operand is optional, and is zero if omitted. This is used for
+ the optional B2 field in the shift-left, shift-right instructions. The
+ assembler must count the number of operands remaining on the line,
+ and the number of operands remaining for the opcode, and decide
+ whether this operand is present or not. The disassembler should
+ print this operand out only if it is not zero. */
+#define I370_OPERAND_OPTIONAL (0x80)
+
+
+/* Define some misc macros. We keep them with the operands table
+ for simplicity. The macro table is an array of struct i370_macro. */
+
+struct i370_macro
+{
+ /* The macro name. */
+ const char *name;
+
+ /* The number of operands the macro takes. */
+ unsigned int operands;
+
+ /* One bit flags for the opcode. These are used to indicate which
+ specific processors support the instructions. The values are the
+ same as those for the struct i370_opcode flags field. */
+ unsigned long flags;
+
+ /* A format string to turn the macro into a normal instruction.
+ Each %N in the string is replaced with operand number N (zero
+ based). */
+ const char *format;
+};
+
+extern const struct i370_macro i370_macros[];
+extern const int i370_num_macros;
+
+
+#endif /* I370_H */
diff --git a/include/opcode/i386.h b/include/opcode/i386.h
index ef8fece15..d399f4eb2 100644
--- a/include/opcode/i386.h
+++ b/include/opcode/i386.h
@@ -17,32 +17,38 @@ 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 UnixWare assembler, and probably other AT&T derived ix86 Unix
- assemblers, generate floating point instructions with reversed
- source and destination registers in certain cases. Unfortunately,
- gcc and possibly many other programs use this reversed syntax, so
- we're stuck with it.
+/* The SystemV/386 SVR3.2 assembler, and probably all AT&T derived
+ ix86 Unix assemblers, generate floating point instructions with
+ reversed source and destination registers in certain cases.
+ Unfortunately, gcc and possibly many other programs use this
+ reversed syntax, so we're stuck with it.
- eg. `fsub %st(3),%st' results in st <- st - st(3) as expected, but
- `fsub %st,%st(3)' results in st(3) <- st - st(3), rather than
- the expected st(3) <- st(3) - st !
+ eg. `fsub %st(3),%st' results in st = st - st(3) as expected, but
+ `fsub %st,%st(3)' results in st(3) = st - st(3), rather than
+ the expected st(3) = st(3) - st
This happens with all the non-commutative arithmetic floating point
operations with two register operands, where the source register is
- %st, and destination register is %st(i). Look for FloatDR below. */
+ %st, and destination register is %st(i). See FloatDR below.
-#ifndef UNIXWARE_COMPAT
+ The affected opcode map is dceX, dcfX, deeX, defX. */
+
+#ifndef SYSV386_COMPAT
/* Set non-zero for broken, compatible instructions. Set to zero for
- non-broken opcodes at your peril. gcc generates UnixWare
+ non-broken opcodes at your peril. gcc generates SystemV/386
compatible instructions. */
-#define UNIXWARE_COMPAT 1
+#define SYSV386_COMPAT 1
+#endif
+#ifndef OLDGCC_COMPAT
+/* Set non-zero to cater for old (<= 2.8.1) versions of gcc that could
+ generate nonsense fsubp, fsubrp, fdivp and fdivrp with operands
+ reversed. */
+#define OLDGCC_COMPAT SYSV386_COMPAT
#endif
-
static const template i386_optab[] = {
#define X None
-#define ReverseModrm (ReverseRegRegmem|Modrm)
#define NoSuf (No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
#define b_Suf (No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
#define w_Suf (No_bSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
@@ -64,13 +70,16 @@ static const template i386_optab[] = {
#define sl_FP (sl_Suf|IgnoreSize)
#define sld_FP (sld_Suf|IgnoreSize)
#define sldx_FP (sldx_Suf|IgnoreSize)
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
+/* Someone forgot that the FloatR bit reverses the operation when not
+ equal to the FloatD bit. ie. Changing only FloatD results in the
+ destination being swapped *and* the direction being reversed. */
#define FloatDR FloatD
#else
#define FloatDR (FloatD|FloatR)
#endif
-/* move instructions */
+/* Move instructions. */
#define MOV_AX_DISP32 0xa0
{ "mov", 2, 0xa0, X, bwl_Suf|D|W, { Disp16|Disp32, Acc, 0 } },
{ "mov", 2, 0x88, X, bwl_Suf|D|W|Modrm, { Reg, Reg|AnyMem, 0 } },
@@ -83,55 +92,53 @@ static const template i386_optab[] = {
the implementation defined value is zero). */
{ "mov", 2, 0x8c, X, wl_Suf|Modrm, { SReg3|SReg2, WordReg|WordMem, 0 } },
{ "mov", 2, 0x8e, X, wl_Suf|Modrm|IgnoreSize, { WordReg|WordMem, SReg3|SReg2, 0 } },
-/* move to/from control debug registers */
-{ "mov", 2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize, { Control, Reg32, 0} },
-{ "mov", 2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize, { Debug, Reg32, 0} },
-{ "mov", 2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize, { Test, Reg32, 0} },
+/* Move to/from control debug registers. */
+{ "mov", 2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize, { Control, Reg32|InvMem, 0} },
+{ "mov", 2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize, { Debug, Reg32|InvMem, 0} },
+{ "mov", 2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize, { Test, Reg32|InvMem, 0} },
-/* move with sign extend */
+/* Move with sign extend. */
/* "movsbl" & "movsbw" must not be unified into "movsb" to avoid
conflict with the "movs" string move instruction. */
-{"movsbl", 2, 0x0fbe, X, NoSuf|ReverseModrm, { Reg8|ByteMem, Reg32, 0} },
-{"movsbw", 2, 0x0fbe, X, NoSuf|ReverseModrm, { Reg8|ByteMem, Reg16, 0} },
-{"movswl", 2, 0x0fbf, X, NoSuf|ReverseModrm, { Reg16|ShortMem, Reg32, 0} },
+{"movsbl", 2, 0x0fbe, X, NoSuf|Modrm, { Reg8|ByteMem, Reg32, 0} },
+{"movsbw", 2, 0x0fbe, X, NoSuf|Modrm, { Reg8|ByteMem, Reg16, 0} },
+{"movswl", 2, 0x0fbf, X, NoSuf|Modrm, { Reg16|ShortMem, Reg32, 0} },
/* Intel Syntax */
-{"movsx", 2, 0x0fbf, X, w_Suf|ReverseModrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
-{"movsx", 2, 0x0fbe, X, b_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
+{"movsx", 2, 0x0fbf, X, w_Suf|Modrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
+{"movsx", 2, 0x0fbe, X, b_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
-/* move with zero extend */
-{"movzb", 2, 0x0fb6, X, wl_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
-{"movzwl", 2, 0x0fb7, X, NoSuf|ReverseModrm, { Reg16|ShortMem, Reg32, 0} },
+/* Move with zero extend. */
+{"movzb", 2, 0x0fb6, X, wl_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
+{"movzwl", 2, 0x0fb7, X, NoSuf|Modrm, { Reg16|ShortMem, Reg32, 0} },
/* Intel Syntax */
-{"movzx", 2, 0x0fb7, X, w_Suf|ReverseModrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
-{"movzx", 2, 0x0fb6, X, b_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
-
-/* push instructions */
-{"push", 1, 0x50, X, wl_Suf|ShortForm, { WordReg,0,0 } },
-{"push", 1, 0xff, 6, wl_Suf|Modrm, { WordReg|WordMem, 0, 0 } },
-{"push", 1, 0x6a, X, wl_Suf, { Imm8S, 0, 0} },
-{"push", 1, 0x68, X, wl_Suf, { Imm16|Imm32, 0, 0} },
-{"push", 1, 0x06, X, wl_Suf|Seg2ShortForm, { SReg2,0,0 } },
-{"push", 1, 0x0fa0, X, wl_Suf|Seg3ShortForm, { SReg3,0,0 } },
-/* push all */
-{"pusha", 0, 0x60, X, wl_Suf, { 0, 0, 0 } },
-
-/* pop instructions */
-{"pop", 1, 0x58, X, wl_Suf|ShortForm, { WordReg,0,0 } },
-{"pop", 1, 0x8f, 0, wl_Suf|Modrm, { WordReg|WordMem, 0, 0 } },
+{"movzx", 2, 0x0fb7, X, w_Suf|Modrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
+{"movzx", 2, 0x0fb6, X, b_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
+
+/* Push instructions. */
+{"push", 1, 0x50, X, wl_Suf|ShortForm|DefaultSize, { WordReg, 0, 0 } },
+{"push", 1, 0xff, 6, wl_Suf|Modrm|DefaultSize, { WordReg|WordMem, 0, 0 } },
+{"push", 1, 0x6a, X, wl_Suf|DefaultSize, { Imm8S, 0, 0} },
+{"push", 1, 0x68, X, wl_Suf|DefaultSize, { Imm16|Imm32, 0, 0} },
+{"push", 1, 0x06, X, wl_Suf|Seg2ShortForm|DefaultSize, { SReg2, 0, 0 } },
+{"push", 1, 0x0fa0, X, wl_Suf|Seg3ShortForm|DefaultSize, { SReg3, 0, 0 } },
+{"pusha", 0, 0x60, X, wl_Suf|DefaultSize, { 0, 0, 0 } },
+
+/* Pop instructions. */
+{"pop", 1, 0x58, X, wl_Suf|ShortForm|DefaultSize, { WordReg, 0, 0 } },
+{"pop", 1, 0x8f, 0, wl_Suf|Modrm|DefaultSize, { WordReg|WordMem, 0, 0 } },
#define POP_SEG_SHORT 0x07
-{"pop", 1, 0x07, X, wl_Suf|Seg2ShortForm, { SReg2,0,0 } },
-{"pop", 1, 0x0fa1, X, wl_Suf|Seg3ShortForm, { SReg3,0,0 } },
-/* pop all */
-{"popa", 0, 0x61, X, wl_Suf, { 0, 0, 0 } },
+{"pop", 1, 0x07, X, wl_Suf|Seg2ShortForm|DefaultSize, { SReg2, 0, 0 } },
+{"pop", 1, 0x0fa1, X, wl_Suf|Seg3ShortForm|DefaultSize, { SReg3, 0, 0 } },
+{"popa", 0, 0x61, X, wl_Suf|DefaultSize, { 0, 0, 0 } },
-/* xchg exchange instructions
- xchg commutes: we allow both operand orders */
+/* Exchange instructions.
+ xchg commutes: we allow both operand orders. */
{"xchg", 2, 0x90, X, wl_Suf|ShortForm, { WordReg, Acc, 0 } },
{"xchg", 2, 0x90, X, wl_Suf|ShortForm, { Acc, WordReg, 0 } },
{"xchg", 2, 0x86, X, bwl_Suf|W|Modrm, { Reg, Reg|AnyMem, 0 } },
{"xchg", 2, 0x86, X, bwl_Suf|W|Modrm, { Reg|AnyMem, Reg, 0 } },
-/* in/out from ports */
+/* In/out from ports. */
{"in", 2, 0xe4, X, bwl_Suf|W, { Imm8, Acc, 0 } },
{"in", 2, 0xec, X, bwl_Suf|W, { InOutPortReg, Acc, 0 } },
{"in", 1, 0xe4, X, bwl_Suf|W, { Imm8, 0, 0 } },
@@ -141,17 +148,17 @@ static const template i386_optab[] = {
{"out", 1, 0xe6, X, bwl_Suf|W, { Imm8, 0, 0 } },
{"out", 1, 0xee, X, bwl_Suf|W, { InOutPortReg, 0, 0 } },
-/* load effective address */
+/* Load effective address. */
{"lea", 2, 0x8d, X, wl_Suf|Modrm, { WordMem, WordReg, 0 } },
-/* load segment registers from memory */
+/* Load segment registers from memory. */
{"lds", 2, 0xc5, X, wl_Suf|Modrm, { WordMem, WordReg, 0} },
{"les", 2, 0xc4, X, wl_Suf|Modrm, { WordMem, WordReg, 0} },
{"lfs", 2, 0x0fb4, X, wl_Suf|Modrm, { WordMem, WordReg, 0} },
{"lgs", 2, 0x0fb5, X, wl_Suf|Modrm, { WordMem, WordReg, 0} },
{"lss", 2, 0x0fb2, X, wl_Suf|Modrm, { WordMem, WordReg, 0} },
-/* flags register instructions */
+/* Flags register instructions. */
{"clc", 0, 0xf8, X, NoSuf, { 0, 0, 0} },
{"cld", 0, 0xfc, X, NoSuf, { 0, 0, 0} },
{"cli", 0, 0xfa, X, NoSuf, { 0, 0, 0} },
@@ -159,13 +166,13 @@ static const template i386_optab[] = {
{"cmc", 0, 0xf5, X, NoSuf, { 0, 0, 0} },
{"lahf", 0, 0x9f, X, NoSuf, { 0, 0, 0} },
{"sahf", 0, 0x9e, X, NoSuf, { 0, 0, 0} },
-{"pushf", 0, 0x9c, X, wl_Suf, { 0, 0, 0} },
-{"popf", 0, 0x9d, X, wl_Suf, { 0, 0, 0} },
+{"pushf", 0, 0x9c, X, wl_Suf|DefaultSize, { 0, 0, 0} },
+{"popf", 0, 0x9d, X, wl_Suf|DefaultSize, { 0, 0, 0} },
{"stc", 0, 0xf9, X, NoSuf, { 0, 0, 0} },
{"std", 0, 0xfd, X, NoSuf, { 0, 0, 0} },
{"sti", 0, 0xfb, X, NoSuf, { 0, 0, 0} },
-/* arithmetic */
+/* Arithmetic. */
{"add", 2, 0x00, X, bwl_Suf|D|W|Modrm, { Reg, Reg|AnyMem, 0} },
{"add", 2, 0x83, 0, wl_Suf|Modrm, { Imm8S, WordReg|WordMem, 0} },
{"add", 2, 0x04, X, bwl_Suf|W, { Imm, Acc, 0} },
@@ -212,7 +219,7 @@ static const template i386_optab[] = {
{"xor", 2, 0x34, X, bwl_Suf|W, { Imm, Acc, 0} },
{"xor", 2, 0x80, 6, bwl_Suf|W|Modrm, { Imm, Reg|AnyMem, 0} },
-/* iclr with 1 operand is really xor with 2 operands. */
+/* iclr with 1 operand is really xor with 2 operands. */
{"clr", 1, 0x30, X, bwl_Suf|W|Modrm|regKludge, { Reg, 0, 0 } },
{"adc", 2, 0x10, X, bwl_Suf|D|W|Modrm, { Reg, Reg|AnyMem, 0} },
@@ -232,13 +239,13 @@ static const template i386_optab[] = {
{"aam", 0, 0xd40a, X, NoSuf, { 0, 0, 0} },
{"aam", 1, 0xd4, X, NoSuf, { Imm8S, 0, 0} },
-/* conversion insns */
-/* conversion: intel naming */
+/* Conversion insns. */
+/* Intel naming */
{"cbw", 0, 0x98, X, NoSuf|Size16, { 0, 0, 0} },
{"cwde", 0, 0x98, X, NoSuf|Size32, { 0, 0, 0} },
{"cwd", 0, 0x99, X, NoSuf|Size16, { 0, 0, 0} },
{"cdq", 0, 0x99, X, NoSuf|Size32, { 0, 0, 0} },
-/* att naming */
+/* AT&T naming */
{"cbtw", 0, 0x98, X, NoSuf|Size16, { 0, 0, 0} },
{"cwtl", 0, 0x98, X, NoSuf|Size32, { 0, 0, 0} },
{"cwtd", 0, 0x99, X, NoSuf|Size16, { 0, 0, 0} },
@@ -250,9 +257,9 @@ static const template i386_optab[] = {
These multiplies can only be selected with single operand forms. */
{"mul", 1, 0xf6, 4, bwl_Suf|W|Modrm, { Reg|AnyMem, 0, 0} },
{"imul", 1, 0xf6, 5, bwl_Suf|W|Modrm, { Reg|AnyMem, 0, 0} },
-{"imul", 2, 0x0faf, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"imul", 3, 0x6b, X, wl_Suf|ReverseModrm, { Imm8S, WordReg|WordMem, WordReg} },
-{"imul", 3, 0x69, X, wl_Suf|ReverseModrm, { Imm16|Imm32, WordReg|WordMem, WordReg} },
+{"imul", 2, 0x0faf, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"imul", 3, 0x6b, X, wl_Suf|Modrm, { Imm8S, WordReg|WordMem, WordReg} },
+{"imul", 3, 0x69, X, wl_Suf|Modrm, { Imm16|Imm32, WordReg|WordMem, WordReg} },
/* imul with 2 operands mimics imul with 3 by putting the register in
both i.rm.reg & i.rm.regmem fields. regKludge enables this
transformation. */
@@ -311,31 +318,34 @@ static const template i386_optab[] = {
{"sar", 2, 0xd2, 7, bwl_Suf|W|Modrm, { ShiftCount, Reg|AnyMem, 0} },
{"sar", 1, 0xd0, 7, bwl_Suf|W|Modrm, { Reg|AnyMem, 0, 0} },
-/* control transfer instructions */
-{"call", 1, 0xe8, X, wl_Suf|JumpDword, { Disp16|Disp32, 0, 0} },
-{"call", 1, 0xff, 2, wl_Suf|Modrm, { WordReg|WordMem|JumpAbsolute, 0, 0} },
+/* Control transfer instructions. */
+{"call", 1, 0xe8, X, wl_Suf|JumpDword|DefaultSize, { Disp16|Disp32, 0, 0} },
+{"call", 1, 0xff, 2, wl_Suf|Modrm|DefaultSize, { WordReg|WordMem|JumpAbsolute, 0, 0} },
/* Intel Syntax */
-{"call", 2, 0x9a, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
-{"lcall", 2, 0x9a, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
-{"lcall", 1, 0xff, 3, wl_Suf|Modrm, { WordMem, 0, 0} },
+{"call", 2, 0x9a, X, wl_Suf|JumpInterSegment|DefaultSize, { Imm16, Imm16|Imm32, 0} },
+/* Intel Syntax */
+{"call", 1, 0xff, 3, x_Suf|Modrm|DefaultSize, { WordMem, 0, 0} },
+{"lcall", 2, 0x9a, X, wl_Suf|JumpInterSegment|DefaultSize, { Imm16, Imm16|Imm32, 0} },
+{"lcall", 1, 0xff, 3, wl_Suf|Modrm|DefaultSize, { WordMem|JumpAbsolute, 0, 0} },
#define JUMP_PC_RELATIVE 0xeb
{"jmp", 1, 0xeb, X, NoSuf|Jump, { Disp, 0, 0} },
{"jmp", 1, 0xff, 4, wl_Suf|Modrm, { WordReg|WordMem|JumpAbsolute, 0, 0} },
/* Intel Syntax */
-{"jmp", 2, 0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
-{"jmp", 1, 0xff, 5, wl_Suf|Modrm, { WordMem, 0, 0} },
+{"jmp", 2, 0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
+/* Intel Syntax */
+{"jmp", 1, 0xff, 5, x_Suf|Modrm, { WordMem, 0, 0} },
{"ljmp", 2, 0xea, X, wl_Suf|JumpInterSegment, { Imm16, Imm16|Imm32, 0} },
-{"ljmp", 1, 0xff, 5, wl_Suf|Modrm, { WordMem, 0, 0} },
+{"ljmp", 1, 0xff, 5, wl_Suf|Modrm, { WordMem|JumpAbsolute, 0, 0} },
-{"ret", 0, 0xc3, X, wl_Suf, { 0, 0, 0} },
-{"ret", 1, 0xc2, X, wl_Suf, { Imm16, 0, 0} },
-{"lret", 0, 0xcb, X, wl_Suf, { 0, 0, 0} },
-{"lret", 1, 0xca, X, wl_Suf, { Imm16, 0, 0} },
-{"enter", 2, 0xc8, X, wl_Suf, { Imm16, Imm8, 0} },
-{"leave", 0, 0xc9, X, wl_Suf, { 0, 0, 0} },
+{"ret", 0, 0xc3, X, wl_Suf|DefaultSize, { 0, 0, 0} },
+{"ret", 1, 0xc2, X, wl_Suf|DefaultSize, { Imm16, 0, 0} },
+{"lret", 0, 0xcb, X, wl_Suf|DefaultSize, { 0, 0, 0} },
+{"lret", 1, 0xca, X, wl_Suf|DefaultSize, { Imm16, 0, 0} },
+{"enter", 2, 0xc8, X, wl_Suf|DefaultSize, { Imm16, Imm8, 0} },
+{"leave", 0, 0xc9, X, wl_Suf|DefaultSize, { 0, 0, 0} },
-/* conditional jumps */
+/* Conditional jumps. */
{"jo", 1, 0x70, X, NoSuf|Jump, { Disp, 0, 0} },
{"jno", 1, 0x71, X, NoSuf|Jump, { Disp, 0, 0} },
{"jb", 1, 0x72, X, NoSuf|Jump, { Disp, 0, 0} },
@@ -381,7 +391,7 @@ static const template i386_optab[] = {
{"loopnz", 1, 0xe0, X, wl_Suf|JumpByte, { Disp, 0, 0} },
{"loopne", 1, 0xe0, X, wl_Suf|JumpByte, { Disp, 0, 0} },
-/* set byte on flag instructions */
+/* Set byte on flag instructions. */
{"seto", 1, 0x0f90, 0, b_Suf|Modrm, { Reg8|ByteMem, 0, 0} },
{"setno", 1, 0x0f91, 0, b_Suf|Modrm, { Reg8|ByteMem, 0, 0} },
{"setb", 1, 0x0f92, 0, b_Suf|Modrm, { Reg8|ByteMem, 0, 0} },
@@ -413,7 +423,7 @@ static const template i386_optab[] = {
{"setnle", 1, 0x0f9f, 0, b_Suf|Modrm, { Reg8|ByteMem, 0, 0} },
{"setg", 1, 0x0f9f, 0, b_Suf|Modrm, { Reg8|ByteMem, 0, 0} },
-/* string manipulation */
+/* String manipulation. */
{"cmps", 0, 0xa6, X, bwld_Suf|W|IsString, { 0, 0, 0} },
{"cmps", 2, 0xa6, X, bwld_Suf|W|IsString, { AnyMem|EsSeg, AnyMem, 0} },
{"scmp", 0, 0xa6, X, bwld_Suf|W|IsString, { 0, 0, 0} },
@@ -447,9 +457,9 @@ static const template i386_optab[] = {
{"xlat", 0, 0xd7, X, b_Suf|IsString, { 0, 0, 0} },
{"xlat", 1, 0xd7, X, b_Suf|IsString, { AnyMem, 0, 0} },
-/* bit manipulation */
-{"bsf", 2, 0x0fbc, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"bsr", 2, 0x0fbd, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+/* Bit manipulation. */
+{"bsf", 2, 0x0fbc, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"bsr", 2, 0x0fbd, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"bt", 2, 0x0fa3, X, wl_Suf|Modrm, { WordReg, WordReg|WordMem, 0} },
{"bt", 2, 0x0fba, 4, wl_Suf|Modrm, { Imm8, WordReg|WordMem, 0} },
{"btc", 2, 0x0fbb, X, wl_Suf|Modrm, { WordReg, WordReg|WordMem, 0} },
@@ -459,44 +469,44 @@ static const template i386_optab[] = {
{"bts", 2, 0x0fab, X, wl_Suf|Modrm, { WordReg, WordReg|WordMem, 0} },
{"bts", 2, 0x0fba, 5, wl_Suf|Modrm, { Imm8, WordReg|WordMem, 0} },
-/* interrupts & op. sys insns */
+/* Interrupts & op. sys insns. */
/* See gas/config/tc-i386.c for conversion of 'int $3' into the special
- int 3 insn. */
+ int 3 insn. */
#define INT_OPCODE 0xcd
#define INT3_OPCODE 0xcc
{"int", 1, 0xcd, X, NoSuf, { Imm8, 0, 0} },
{"int3", 0, 0xcc, X, NoSuf, { 0, 0, 0} },
{"into", 0, 0xce, X, NoSuf, { 0, 0, 0} },
{"iret", 0, 0xcf, X, wl_Suf, { 0, 0, 0} },
-/* i386sl, i486sl, later 486, and Pentium */
+/* i386sl, i486sl, later 486, and Pentium. */
{"rsm", 0, 0x0faa, X, NoSuf, { 0, 0, 0} },
{"bound", 2, 0x62, X, wl_Suf|Modrm, { WordReg, WordMem, 0} },
{"hlt", 0, 0xf4, X, NoSuf, { 0, 0, 0} },
-/* nop is actually 'xchgl %eax, %eax' */
+/* nop is actually 'xchgl %eax, %eax'. */
{"nop", 0, 0x90, X, NoSuf, { 0, 0, 0} },
-/* protection control */
-{"arpl", 2, 0x63, X, NoSuf|Modrm|IgnoreSize,{ Reg16, Reg16|ShortMem, 0} },
-{"lar", 2, 0x0f02, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+/* Protection control. */
+{"arpl", 2, 0x63, X, w_Suf|Modrm|IgnoreSize,{ Reg16, Reg16|ShortMem, 0} },
+{"lar", 2, 0x0f02, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"lgdt", 1, 0x0f01, 2, wl_Suf|Modrm, { WordMem, 0, 0} },
{"lidt", 1, 0x0f01, 3, wl_Suf|Modrm, { WordMem, 0, 0} },
-{"lldt", 1, 0x0f00, 2, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"lmsw", 1, 0x0f01, 6, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"lsl", 2, 0x0f03, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"ltr", 1, 0x0f00, 3, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lldt", 1, 0x0f00, 2, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lmsw", 1, 0x0f01, 6, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"lsl", 2, 0x0f03, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"ltr", 1, 0x0f00, 3, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
{"sgdt", 1, 0x0f01, 0, wl_Suf|Modrm, { WordMem, 0, 0} },
{"sidt", 1, 0x0f01, 1, wl_Suf|Modrm, { WordMem, 0, 0} },
{"sldt", 1, 0x0f00, 0, wl_Suf|Modrm, { WordReg|WordMem, 0, 0} },
{"smsw", 1, 0x0f01, 4, wl_Suf|Modrm, { WordReg|WordMem, 0, 0} },
-{"str", 1, 0x0f00, 1, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"str", 1, 0x0f00, 1, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"verr", 1, 0x0f00, 4, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"verw", 1, 0x0f00, 5, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"verr", 1, 0x0f00, 4, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
+{"verw", 1, 0x0f00, 5, w_Suf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-/* floating point instructions */
+/* Floating point instructions. */
/* load */
{"fld", 1, 0xd9c0, X, FP|ShortForm, { FloatReg, 0, 0} }, /* register */
@@ -506,7 +516,7 @@ static const template i386_optab[] = {
{"fld", 1, 0xdb, 5, x_FP|Modrm, { LLongMem, 0, 0} }, /* %st0 <-- mem efloat */
{"fild", 1, 0xdf, 0, sl_Suf|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} }, /* %st0 <-- mem word(16)/dword(32) */
/* Intel Syntax */
-{"fild", 1, 0xdf, 5, d_Suf|IgnoreSize|Modrm,{ LLongMem, 0, 0} }, /* %st0 <-- mem qword (64) */
+{"fildd", 1, 0xdf, 5, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 <-- mem qword (64) */
{"fildq", 1, 0xdf, 5, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 <-- mem qword (64) */
{"fildll", 1, 0xdf, 5, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 <-- mem qword (64) */
{"fldt", 1, 0xdb, 5, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 <-- mem efloat */
@@ -526,7 +536,7 @@ static const template i386_optab[] = {
{"fstp", 1, 0xdb, 7, x_FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem efloat */
{"fistp", 1, 0xdf, 3, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} }, /* %st0 --> mem word(16)/dword(32) */
/* Intel Syntax */
-{"fistp", 1, 0xdf, 7, d_FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem qword (64) */
+{"fistpd", 1, 0xdf, 7, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem qword (64) */
{"fistpq", 1, 0xdf, 7, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem qword (64) */
{"fistpll",1, 0xdf, 7, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem qword (64) */
{"fstpt", 1, 0xdb, 7, FP|Modrm, { LLongMem, 0, 0} }, /* %st0 --> mem efloat */
@@ -575,7 +585,7 @@ static const template i386_optab[] = {
/* add */
{"fadd", 2, 0xd8c0, X, FP|ShortForm|FloatD, { FloatReg, FloatAcc, 0} },
{"fadd", 1, 0xd8c0, X, FP|ShortForm, { FloatReg, 0, 0} }, /* alias for fadd %st(i), %st */
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fadd", 0, 0xdec1, X, FP|Ugh, { 0, 0, 0} }, /* alias for faddp */
#endif
{"fadd", 1, 0xd8, 0, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
@@ -589,17 +599,19 @@ static const template i386_optab[] = {
/* subtract */
{"fsub", 2, 0xd8e0, X, FP|ShortForm|FloatDR, { FloatReg, FloatAcc, 0} },
{"fsub", 1, 0xd8e0, X, FP|ShortForm, { FloatReg, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fsub", 0, 0xdee1, X, FP|Ugh, { 0, 0, 0} }, /* alias for fsubp */
#endif
{"fsub", 1, 0xd8, 4, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
{"fisub", 1, 0xde, 4, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fsubp", 2, 0xdee0, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fsubp", 1, 0xdee0, X, FP|ShortForm, { FloatReg, 0, 0} },
{"fsubp", 0, 0xdee1, X, FP, { 0, 0, 0} },
+#if OLDGCC_COMPAT
{"fsubp", 2, 0xdee0, X, FP|ShortForm|Ugh, { FloatReg, FloatAcc, 0} },
+#endif
#else
{"fsubp", 2, 0xdee8, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fsubp", 1, 0xdee8, X, FP|ShortForm, { FloatReg, 0, 0} },
@@ -609,17 +621,19 @@ static const template i386_optab[] = {
/* subtract reverse */
{"fsubr", 2, 0xd8e8, X, FP|ShortForm|FloatDR, { FloatReg, FloatAcc, 0} },
{"fsubr", 1, 0xd8e8, X, FP|ShortForm, { FloatReg, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fsubr", 0, 0xdee9, X, FP|Ugh, { 0, 0, 0} }, /* alias for fsubrp */
#endif
{"fsubr", 1, 0xd8, 5, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
{"fisubr", 1, 0xde, 5, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fsubrp", 2, 0xdee8, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fsubrp", 1, 0xdee8, X, FP|ShortForm, { FloatReg, 0, 0} },
{"fsubrp", 0, 0xdee9, X, FP, { 0, 0, 0} },
+#if OLDGCC_COMPAT
{"fsubrp", 2, 0xdee8, X, FP|ShortForm|Ugh, { FloatReg, FloatAcc, 0} },
+#endif
#else
{"fsubrp", 2, 0xdee0, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fsubrp", 1, 0xdee0, X, FP|ShortForm, { FloatReg, 0, 0} },
@@ -629,7 +643,7 @@ static const template i386_optab[] = {
/* multiply */
{"fmul", 2, 0xd8c8, X, FP|ShortForm|FloatD, { FloatReg, FloatAcc, 0} },
{"fmul", 1, 0xd8c8, X, FP|ShortForm, { FloatReg, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fmul", 0, 0xdec9, X, FP|Ugh, { 0, 0, 0} }, /* alias for fmulp */
#endif
{"fmul", 1, 0xd8, 1, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
@@ -643,17 +657,19 @@ static const template i386_optab[] = {
/* divide */
{"fdiv", 2, 0xd8f0, X, FP|ShortForm|FloatDR, { FloatReg, FloatAcc, 0} },
{"fdiv", 1, 0xd8f0, X, FP|ShortForm, { FloatReg, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fdiv", 0, 0xdef1, X, FP|Ugh, { 0, 0, 0} }, /* alias for fdivp */
#endif
{"fdiv", 1, 0xd8, 6, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
{"fidiv", 1, 0xde, 6, sld_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fdivp", 2, 0xdef0, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fdivp", 1, 0xdef0, X, FP|ShortForm, { FloatReg, 0, 0} },
{"fdivp", 0, 0xdef1, X, FP, { 0, 0, 0} },
+#if OLDGCC_COMPAT
{"fdivp", 2, 0xdef0, X, FP|ShortForm|Ugh, { FloatReg, FloatAcc, 0} },
+#endif
#else
{"fdivp", 2, 0xdef8, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fdivp", 1, 0xdef8, X, FP|ShortForm, { FloatReg, 0, 0} },
@@ -663,17 +679,19 @@ static const template i386_optab[] = {
/* divide reverse */
{"fdivr", 2, 0xd8f8, X, FP|ShortForm|FloatDR, { FloatReg, FloatAcc, 0} },
{"fdivr", 1, 0xd8f8, X, FP|ShortForm, { FloatReg, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fdivr", 0, 0xdef9, X, FP|Ugh, { 0, 0, 0} }, /* alias for fdivrp */
#endif
{"fdivr", 1, 0xd8, 7, sld_FP|FloatMF|Modrm, { LongMem|LLongMem, 0, 0} },
{"fidivr", 1, 0xde, 7, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{"fdivrp", 2, 0xdef8, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fdivrp", 1, 0xdef8, X, FP|ShortForm, { FloatReg, 0, 0} },
{"fdivrp", 0, 0xdef9, X, FP, { 0, 0, 0} },
+#if OLDGCC_COMPAT
{"fdivrp", 2, 0xdef8, X, FP|ShortForm|Ugh, { FloatReg, FloatAcc, 0} },
+#endif
#else
{"fdivrp", 2, 0xdef0, X, FP|ShortForm, { FloatAcc, FloatReg, 0} },
{"fdivrp", 1, 0xdef0, X, FP|ShortForm, { FloatReg, 0, 0} },
@@ -713,8 +731,7 @@ static const template i386_optab[] = {
{"fstsw", 0, 0xdfe0, X, FP|FWait, { 0, 0, 0} },
{"fnclex", 0, 0xdbe2, X, FP, { 0, 0, 0} },
{"fclex", 0, 0xdbe2, X, FP|FWait, { 0, 0, 0} },
-/* Short forms of fldenv, fstenv use data size prefix.
- FIXME: Are these the right suffixes? */
+/* Short forms of fldenv, fstenv use data size prefix. */
{"fnstenv",1, 0xd9, 6, sl_Suf|Modrm, { LLongMem, 0, 0} },
{"fstenv", 1, 0xd9, 6, sl_Suf|FWait|Modrm, { LLongMem, 0, 0} },
{"fldenv", 1, 0xd9, 4, sl_Suf|Modrm, { LLongMem, 0, 0} },
@@ -729,9 +746,8 @@ static const template i386_optab[] = {
#define FWAIT_OPCODE 0x9b
{"fwait", 0, 0x9b, X, FP, { 0, 0, 0} },
-/*
- opcode prefixes; we allow them as seperate insns too
-*/
+/* Opcode prefixes; we allow them as separate insns too. */
+
#define ADDR_PREFIX_OPCODE 0x67
{"addr16", 0, 0x67, X, NoSuf|IsPrefix|Size16|IgnoreSize, { 0, 0, 0} },
{"addr32", 0, 0x67, X, NoSuf|IsPrefix|Size32|IgnoreSize, { 0, 0, 0} },
@@ -765,202 +781,305 @@ static const template i386_optab[] = {
{"repne", 0, 0xf2, X, NoSuf|IsPrefix, { 0, 0, 0} },
{"repnz", 0, 0xf2, X, NoSuf|IsPrefix, { 0, 0, 0} },
-/* 486 extensions */
+/* 486 extensions. */
-{"bswap", 1, 0x0fc8, X, NoSuf|ShortForm, { Reg32,0,0 } },
+{"bswap", 1, 0x0fc8, X, l_Suf|ShortForm, { Reg32, 0, 0 } },
{"xadd", 2, 0x0fc0, X, bwl_Suf|W|Modrm, { Reg, Reg|AnyMem, 0 } },
{"cmpxchg", 2, 0x0fb0, X, bwl_Suf|W|Modrm, { Reg, Reg|AnyMem, 0 } },
{"invd", 0, 0x0f08, X, NoSuf, { 0, 0, 0} },
{"wbinvd", 0, 0x0f09, X, NoSuf, { 0, 0, 0} },
{"invlpg", 1, 0x0f01, 7, NoSuf|Modrm, { AnyMem, 0, 0} },
-/* 586 and late 486 extensions */
+/* 586 and late 486 extensions. */
{"cpuid", 0, 0x0fa2, X, NoSuf, { 0, 0, 0} },
-/* Pentium extensions */
+/* Pentium extensions. */
{"wrmsr", 0, 0x0f30, X, NoSuf, { 0, 0, 0} },
{"rdtsc", 0, 0x0f31, X, NoSuf, { 0, 0, 0} },
{"rdmsr", 0, 0x0f32, X, NoSuf, { 0, 0, 0} },
{"cmpxchg8b",1,0x0fc7, 1, NoSuf|Modrm, { LLongMem, 0, 0} },
-{"sysenter", 0, 0x0f34, X, NoSuf, { 0, 0, 0} },
-{"sysexit", 0, 0x0f35, X, NoSuf, { 0, 0, 0} },
-{"fxsave", 1, 0x0fae, 0, FP|Modrm, { LLongMem, 0, 0} },
-{"fxrstor", 1, 0x0fae, 1, FP|Modrm, { LLongMem, 0, 0} },
+{"sysenter",0, 0x0f34, X, NoSuf, { 0, 0, 0} },
+{"sysexit", 0, 0x0f35, X, NoSuf, { 0, 0, 0} },
+{"fxsave", 1, 0x0fae, 0, FP|Modrm, { LLongMem, 0, 0} },
+{"fxrstor", 1, 0x0fae, 1, FP|Modrm, { LLongMem, 0, 0} },
-/* Pentium Pro extensions */
+/* Pentium Pro extensions. */
{"rdpmc", 0, 0x0f33, X, NoSuf, { 0, 0, 0} },
{"ud2", 0, 0x0f0b, X, NoSuf, { 0, 0, 0} }, /* official undefined instr. */
{"ud2a", 0, 0x0f0b, X, NoSuf, { 0, 0, 0} }, /* alias for ud2 */
{"ud2b", 0, 0x0fb9, X, NoSuf, { 0, 0, 0} }, /* 2nd. official undefined instr. */
-{"cmovo", 2, 0x0f40, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovno", 2, 0x0f41, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovb", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovc", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnae", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovae", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnc", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnb", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmove", 2, 0x0f44, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovz", 2, 0x0f44, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovne", 2, 0x0f45, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnz", 2, 0x0f45, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovbe", 2, 0x0f46, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovna", 2, 0x0f46, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmova", 2, 0x0f47, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnbe", 2, 0x0f47, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovs", 2, 0x0f48, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovns", 2, 0x0f49, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovp", 2, 0x0f4a, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnp", 2, 0x0f4b, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovl", 2, 0x0f4c, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnge", 2, 0x0f4c, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovge", 2, 0x0f4d, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnl", 2, 0x0f4d, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovle", 2, 0x0f4e, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovng", 2, 0x0f4e, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovg", 2, 0x0f4f, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnle", 2, 0x0f4f, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-
-{"fcmovb", 2, 0xdac0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovnae",2, 0xdac0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmove", 2, 0xdac8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovbe", 2, 0xdad0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovna", 2, 0xdad0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovu", 2, 0xdad8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovae", 2, 0xdbc0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovnb", 2, 0xdbc0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovne", 2, 0xdbc8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmova", 2, 0xdbd0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovnbe",2, 0xdbd0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcmovnu", 2, 0xdbd8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-
-{"fcomi", 2, 0xdbf0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcomi", 0, 0xdbf1, X, NoSuf|ShortForm, { 0, 0, 0} },
-{"fcomi", 1, 0xdbf0, X, NoSuf|ShortForm, { FloatReg, 0, 0} },
-{"fucomi", 2, 0xdbe8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fucomi", 0, 0xdbe9, X, NoSuf|ShortForm, { 0, 0, 0} },
-{"fucomi", 1, 0xdbe8, X, NoSuf|ShortForm, { FloatReg, 0, 0} },
-{"fcomip", 2, 0xdff0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcompi", 2, 0xdff0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fcompi", 0, 0xdff1, X, NoSuf|ShortForm, { 0, 0, 0} },
-{"fcompi", 1, 0xdff0, X, NoSuf|ShortForm, { FloatReg, 0, 0} },
-{"fucomip", 2, 0xdfe8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fucompi", 2, 0xdfe8, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
-{"fucompi", 0, 0xdfe9, X, NoSuf|ShortForm, { 0, 0, 0} },
-{"fucompi", 1, 0xdfe8, X, NoSuf|ShortForm, { FloatReg, 0, 0} },
+{"cmovo", 2, 0x0f40, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovno", 2, 0x0f41, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovb", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovc", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnae", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovae", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnc", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnb", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmove", 2, 0x0f44, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovz", 2, 0x0f44, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovne", 2, 0x0f45, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnz", 2, 0x0f45, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovbe", 2, 0x0f46, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovna", 2, 0x0f46, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmova", 2, 0x0f47, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnbe", 2, 0x0f47, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovs", 2, 0x0f48, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovns", 2, 0x0f49, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovp", 2, 0x0f4a, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnp", 2, 0x0f4b, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovl", 2, 0x0f4c, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnge", 2, 0x0f4c, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovge", 2, 0x0f4d, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnl", 2, 0x0f4d, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovle", 2, 0x0f4e, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovng", 2, 0x0f4e, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovg", 2, 0x0f4f, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnle", 2, 0x0f4f, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+
+{"fcmovb", 2, 0xdac0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovnae",2, 0xdac0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmove", 2, 0xdac8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovbe", 2, 0xdad0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovna", 2, 0xdad0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovu", 2, 0xdad8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovae", 2, 0xdbc0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovnb", 2, 0xdbc0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovne", 2, 0xdbc8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmova", 2, 0xdbd0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovnbe",2, 0xdbd0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcmovnu", 2, 0xdbd8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+
+{"fcomi", 2, 0xdbf0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcomi", 0, 0xdbf1, X, FP|ShortForm, { 0, 0, 0} },
+{"fcomi", 1, 0xdbf0, X, FP|ShortForm, { FloatReg, 0, 0} },
+{"fucomi", 2, 0xdbe8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fucomi", 0, 0xdbe9, X, FP|ShortForm, { 0, 0, 0} },
+{"fucomi", 1, 0xdbe8, X, FP|ShortForm, { FloatReg, 0, 0} },
+{"fcomip", 2, 0xdff0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcompi", 2, 0xdff0, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fcompi", 0, 0xdff1, X, FP|ShortForm, { 0, 0, 0} },
+{"fcompi", 1, 0xdff0, X, FP|ShortForm, { FloatReg, 0, 0} },
+{"fucomip", 2, 0xdfe8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fucompi", 2, 0xdfe8, X, FP|ShortForm, { FloatReg, FloatAcc, 0} },
+{"fucompi", 0, 0xdfe9, X, FP|ShortForm, { 0, 0, 0} },
+{"fucompi", 1, 0xdfe8, X, FP|ShortForm, { FloatReg, 0, 0} },
/* MMX instructions. */
-{"emms", 0, 0x0f77, X, NoSuf, { 0, 0, 0 } },
-{"movd", 2, 0x0f6e, X, NoSuf|Modrm, { Reg32|LongMem, RegMMX, 0 } },
-{"movd", 2, 0x0f7e, X, NoSuf|Modrm, { RegMMX, Reg32|LongMem, 0 } },
-{"movq", 2, 0x0f6f, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"movq", 2, 0x0f7f, X, NoSuf|Modrm, { RegMMX, RegMMX|LongMem, 0 } },
-{"packssdw", 2, 0x0f6b, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"packsswb", 2, 0x0f63, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"packuswb", 2, 0x0f67, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddb", 2, 0x0ffc, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddw", 2, 0x0ffd, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddd", 2, 0x0ffe, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddsb", 2, 0x0fec, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddsw", 2, 0x0fed, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddusb", 2, 0x0fdc, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddusw", 2, 0x0fdd, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pand", 2, 0x0fdb, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pandn", 2, 0x0fdf, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqb", 2, 0x0f74, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqw", 2, 0x0f75, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqd", 2, 0x0f76, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtb", 2, 0x0f64, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtw", 2, 0x0f65, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtd", 2, 0x0f66, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmaddwd", 2, 0x0ff5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhw", 2, 0x0fe5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmullw", 2, 0x0fd5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"por", 2, 0x0feb, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllw", 2, 0x0ff1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllw", 2, 0x0f71, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"pslld", 2, 0x0ff2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pslld", 2, 0x0f72, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psllq", 2, 0x0ff3, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllq", 2, 0x0f73, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psraw", 2, 0x0fe1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psraw", 2, 0x0f71, 4, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrad", 2, 0x0fe2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrad", 2, 0x0f72, 4, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrlw", 2, 0x0fd1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrlw", 2, 0x0f71, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrld", 2, 0x0fd2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrld", 2, 0x0f72, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrlq", 2, 0x0fd3, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrlq", 2, 0x0f73, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psubb", 2, 0x0ff8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubw", 2, 0x0ff9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubd", 2, 0x0ffa, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubsb", 2, 0x0fe8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubsw", 2, 0x0fe9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubusb", 2, 0x0fd8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubusw", 2, 0x0fd9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhbw",2, 0x0f68, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhwd",2, 0x0f69, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhdq",2, 0x0f6a, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklbw",2, 0x0f60, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklwd",2, 0x0f61, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckldq",2, 0x0f62, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pxor", 2, 0x0fef, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-
-
-/* AMD 3DNow! instructions */
-#define AMD_3DNOW_OPCODE 0x0f0f
-
-{"prefetch", 1, 0x0f0d, 0, NoSuf|Modrm, { ByteMem, 0, 0 } },
-{"prefetchw",1, 0x0f0d, 1, NoSuf|Modrm, { ByteMem, 0, 0 } },
-{"femms", 0, 0x0f0e, X, NoSuf, { 0, 0, 0 } },
-{"pavgusb", 2, 0x0f0f, 0xbf, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pf2id", 2, 0x0f0f, 0x1d, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfacc", 2, 0x0f0f, 0xae, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfadd", 2, 0x0f0f, 0x9e, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpeq", 2, 0x0f0f, 0xb0, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpge", 2, 0x0f0f, 0x90, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpgt", 2, 0x0f0f, 0xa0, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmax", 2, 0x0f0f, 0xa4, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmin", 2, 0x0f0f, 0x94, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmul", 2, 0x0f0f, 0xb4, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcp", 2, 0x0f0f, 0x96, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit1", 2, 0x0f0f, 0xa6, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit2", 2, 0x0f0f, 0xb6, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqit1", 2, 0x0f0f, 0xa7, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqrt", 2, 0x0f0f, 0x97, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfsub", 2, 0x0f0f, 0x9a, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfsubr", 2, 0x0f0f, 0xaa, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pi2fd", 2, 0x0f0f, 0x0d, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhrw", 2, 0x0f0f, 0xb7, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"emms", 0, 0x0f77, X, FP, { 0, 0, 0 } },
+{"movd", 2, 0x0f6e, X, FP|Modrm, { Reg32|LongMem, RegMMX, 0 } },
+{"movd", 2, 0x0f7e, X, FP|Modrm, { RegMMX, Reg32|LongMem, 0 } },
+{"movq", 2, 0x0f6f, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"movq", 2, 0x0f7f, X, FP|Modrm, { RegMMX, RegMMX|LongMem, 0 } },
+{"packssdw", 2, 0x0f6b, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"packsswb", 2, 0x0f63, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"packuswb", 2, 0x0f67, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddb", 2, 0x0ffc, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddw", 2, 0x0ffd, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddd", 2, 0x0ffe, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddsb", 2, 0x0fec, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddsw", 2, 0x0fed, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddusb", 2, 0x0fdc, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddusw", 2, 0x0fdd, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pand", 2, 0x0fdb, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pandn", 2, 0x0fdf, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqb", 2, 0x0f74, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqw", 2, 0x0f75, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqd", 2, 0x0f76, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtb", 2, 0x0f64, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtw", 2, 0x0f65, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtd", 2, 0x0f66, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmaddwd", 2, 0x0ff5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmulhw", 2, 0x0fe5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmullw", 2, 0x0fd5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"por", 2, 0x0feb, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllw", 2, 0x0ff1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllw", 2, 0x0f71, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"pslld", 2, 0x0ff2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pslld", 2, 0x0f72, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psllq", 2, 0x0ff3, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllq", 2, 0x0f73, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psraw", 2, 0x0fe1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psraw", 2, 0x0f71, 4, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrad", 2, 0x0fe2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrad", 2, 0x0f72, 4, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrlw", 2, 0x0fd1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrlw", 2, 0x0f71, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrld", 2, 0x0fd2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrld", 2, 0x0f72, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrlq", 2, 0x0fd3, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrlq", 2, 0x0f73, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psubb", 2, 0x0ff8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubw", 2, 0x0ff9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubd", 2, 0x0ffa, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubsb", 2, 0x0fe8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubsw", 2, 0x0fe9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubusb", 2, 0x0fd8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubusw", 2, 0x0fd9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhbw",2, 0x0f68, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhwd",2, 0x0f69, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhdq",2, 0x0f6a, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklbw",2, 0x0f60, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklwd",2, 0x0f61, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckldq",2, 0x0f62, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pxor", 2, 0x0fef, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+
+
+/* PIII Katmai New Instructions / SIMD instructions. */
+
+{"addps", 2, 0x0f58, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"addss", 2, 0xf30f58, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"andnps", 2, 0x0f55, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"andps", 2, 0x0f54, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpeqps", 2, 0x0fc2, 0, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpeqss", 2, 0xf30fc2, 0, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpleps", 2, 0x0fc2, 2, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpless", 2, 0xf30fc2, 2, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpltps", 2, 0x0fc2, 1, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpltss", 2, 0xf30fc2, 1, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpneqps", 2, 0x0fc2, 4, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpneqss", 2, 0xf30fc2, 4, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnleps", 2, 0x0fc2, 6, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnless", 2, 0xf30fc2, 6, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnltps", 2, 0x0fc2, 5, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnltss", 2, 0xf30fc2, 5, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpordps", 2, 0x0fc2, 7, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpordss", 2, 0xf30fc2, 7, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpunordps",2, 0x0fc2, 3, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpunordss",2, 0xf30fc2, 3, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpps", 3, 0x0fc2, X, FP|Modrm, { Imm8, RegXMM|LLongMem, RegXMM } },
+{"cmpss", 3, 0xf30fc2, X, FP|Modrm, { Imm8, RegXMM|WordMem, RegXMM } },
+{"comiss", 2, 0x0f2f, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"cvtpi2ps", 2, 0x0f2a, X, FP|Modrm, { RegMMX|LLongMem, RegXMM, 0 } },
+{"cvtps2pi", 2, 0x0f2d, X, FP|Modrm, { RegXMM|LLongMem, RegMMX, 0 } },
+{"cvtsi2ss", 2, 0xf30f2a, X, FP|Modrm, { Reg32|WordMem, RegXMM, 0 } },
+{"cvtss2si", 2, 0xf30f2d, X, FP|Modrm, { RegXMM|WordMem, Reg32, 0 } },
+{"cvttps2pi", 2, 0x0f2c, X, FP|Modrm, { RegXMM|LLongMem, RegMMX, 0 } },
+{"cvttss2si", 2, 0xf30f2c, X, FP|Modrm, { RegXMM|WordMem, Reg32, 0 } },
+{"divps", 2, 0x0f5e, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"divss", 2, 0xf30f5e, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"ldmxcsr", 1, 0x0fae, 2, FP|Modrm, { WordMem, 0, 0 } },
+{"maskmovq", 2, 0x0ff7, X, FP|Modrm, { RegMMX|InvMem, RegMMX, 0 } },
+{"maxps", 2, 0x0f5f, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"maxss", 2, 0xf30f5f, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"minps", 2, 0x0f5d, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"minss", 2, 0xf30f5d, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"movaps", 2, 0x0f28, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"movaps", 2, 0x0f29, X, FP|Modrm, { RegXMM, RegXMM|LLongMem, 0 } },
+{"movhlps", 2, 0x0f12, X, FP|Modrm, { RegXMM|InvMem, RegXMM, 0 } },
+{"movhps", 2, 0x0f16, X, FP|Modrm, { LLongMem, RegXMM, 0 } },
+{"movhps", 2, 0x0f17, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movlhps", 2, 0x0f16, X, FP|Modrm, { RegXMM|InvMem, RegXMM, 0 } },
+{"movlps", 2, 0x0f12, X, FP|Modrm, { LLongMem, RegXMM, 0 } },
+{"movlps", 2, 0x0f13, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movmskps", 2, 0x0f50, X, FP|Modrm, { RegXMM|InvMem, Reg32, 0 } },
+{"movntps", 2, 0x0f2b, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movntq", 2, 0x0fe7, X, FP|Modrm, { RegMMX, LLongMem, 0 } },
+{"movss", 2, 0xf30f10, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"movss", 2, 0xf30f11, X, FP|Modrm, { RegXMM, RegXMM|WordMem, 0 } },
+{"movups", 2, 0x0f10, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"movups", 2, 0x0f11, X, FP|Modrm, { RegXMM, RegXMM|LLongMem, 0 } },
+{"mulps", 2, 0x0f59, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"mulss", 2, 0xf30f59, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"orps", 2, 0x0f56, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"pavgb", 2, 0x0fe0, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pavgw", 2, 0x0fe3, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pextrw", 3, 0x0fc5, X, FP|Modrm, { Imm8, RegMMX, Reg32|InvMem } },
+{"pinsrw", 3, 0x0fc4, X, FP|Modrm, { Imm8, Reg32|ShortMem, RegMMX } },
+{"pmaxsw", 2, 0x0fee, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pmaxub", 2, 0x0fde, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pminsw", 2, 0x0fea, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pminub", 2, 0x0fda, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pmovmskb", 2, 0x0fd7, X, FP|Modrm, { RegMMX, Reg32|InvMem, 0 } },
+{"pmulhuw", 2, 0x0fe4, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"prefetchnta", 1, 0x0f18, 0, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht0", 1, 0x0f18, 1, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht1", 1, 0x0f18, 2, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht2", 1, 0x0f18, 3, FP|Modrm, { LLongMem, 0, 0 } },
+{"psadbw", 2, 0x0ff6, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pshufw", 3, 0x0f70, X, FP|Modrm, { Imm8, RegMMX|LLongMem, RegMMX } },
+{"rcpps", 2, 0x0f53, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"rcpss", 2, 0xf30f53, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"rsqrtps", 2, 0x0f52, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"rsqrtss", 2, 0xf30f52, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"sfence", 0, 0x0faef8, X, FP, { 0, 0, 0 } },
+{"shufps", 3, 0x0fc6, X, FP|Modrm, { Imm8, RegXMM|LLongMem, RegXMM } },
+{"sqrtps", 2, 0x0f51, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"sqrtss", 2, 0xf30f51, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"stmxcsr", 1, 0x0fae, 3, FP|Modrm, { WordMem, 0, 0 } },
+{"subps", 2, 0x0f5c, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"subss", 2, 0xf30f5c, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"ucomiss", 2, 0x0f2e, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"unpckhps", 2, 0x0f15, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"unpcklps", 2, 0x0f14, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"xorps", 2, 0x0f57, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+
+/* AMD 3DNow! instructions. */
+
+{"prefetch", 1, 0x0f0d, 0, FP|Modrm, { ByteMem, 0, 0 } },
+{"prefetchw",1, 0x0f0d, 1, FP|Modrm, { ByteMem, 0, 0 } },
+{"femms", 0, 0x0f0e, X, FP, { 0, 0, 0 } },
+{"pavgusb", 2, 0x0f0f, 0xbf, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pf2id", 2, 0x0f0f, 0x1d, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pf2iw", 2, 0x0f0f, 0x1c, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } }, /* Athlon */
+{"pfacc", 2, 0x0f0f, 0xae, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfadd", 2, 0x0f0f, 0x9e, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpeq", 2, 0x0f0f, 0xb0, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpge", 2, 0x0f0f, 0x90, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpgt", 2, 0x0f0f, 0xa0, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmax", 2, 0x0f0f, 0xa4, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmin", 2, 0x0f0f, 0x94, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmul", 2, 0x0f0f, 0xb4, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfnacc", 2, 0x0f0f, 0x8a, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } }, /* Athlon */
+{"pfpnacc", 2, 0x0f0f, 0x8e, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } }, /* Athlon */
+{"pfrcp", 2, 0x0f0f, 0x96, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit1", 2, 0x0f0f, 0xa6, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit2", 2, 0x0f0f, 0xb6, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqit1", 2, 0x0f0f, 0xa7, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqrt", 2, 0x0f0f, 0x97, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfsub", 2, 0x0f0f, 0x9a, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfsubr", 2, 0x0f0f, 0xaa, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pi2fd", 2, 0x0f0f, 0x0d, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pi2fw", 2, 0x0f0f, 0x0c, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } }, /* Athlon */
+{"pmulhrw", 2, 0x0f0f, 0xb7, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pswapd", 2, 0x0f0f, 0xbb, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } }, /* Athlon */
{NULL, 0, 0, 0, 0, { 0, 0, 0} } /* sentinel */
};
#undef X
-#undef ReverseModrm
#undef NoSuf
#undef b_Suf
#undef w_Suf
#undef l_Suf
+#undef d_Suf
+#undef x_Suf
#undef bw_Suf
#undef bl_Suf
#undef wl_Suf
#undef sl_Suf
+#undef sld_Suf
+#undef sldx_Suf
#undef bwl_Suf
+#undef bwld_Suf
#undef FP
#undef l_FP
+#undef d_FP
+#undef x_FP
#undef sl_FP
+#undef sld_FP
+#undef sldx_FP
#define MAX_MNEM_SIZE 16 /* for parsing insn mnemonics from input */
-/* 386 register table */
+/* 386 register table. */
static const reg_entry i386_regtab[] = {
+ /* make %st first as we test for it */
+ {"st", FloatReg|FloatAcc, 0},
/* 8 bit regs */
{"al", Reg8|Acc, 0},
{"cl", Reg8|ShiftCount, 1},
@@ -1030,16 +1149,7 @@ static const reg_entry i386_regtab[] = {
{"tr5", Test, 5},
{"tr6", Test, 6},
{"tr7", Test, 7},
- /* float registers */
- {"st(0)", FloatReg|FloatAcc, 0},
- {"st", FloatReg|FloatAcc, 0},
- {"st(1)", FloatReg, 1},
- {"st(2)", FloatReg, 2},
- {"st(3)", FloatReg, 3},
- {"st(4)", FloatReg, 4},
- {"st(5)", FloatReg, 5},
- {"st(6)", FloatReg, 6},
- {"st(7)", FloatReg, 7},
+ /* mmx and simd registers */
{"mm0", RegMMX, 0},
{"mm1", RegMMX, 1},
{"mm2", RegMMX, 2},
@@ -1047,7 +1157,26 @@ static const reg_entry i386_regtab[] = {
{"mm4", RegMMX, 4},
{"mm5", RegMMX, 5},
{"mm6", RegMMX, 6},
- {"mm7", RegMMX, 7}
+ {"mm7", RegMMX, 7},
+ {"xmm0", RegXMM, 0},
+ {"xmm1", RegXMM, 1},
+ {"xmm2", RegXMM, 2},
+ {"xmm3", RegXMM, 3},
+ {"xmm4", RegXMM, 4},
+ {"xmm5", RegXMM, 5},
+ {"xmm6", RegXMM, 6},
+ {"xmm7", RegXMM, 7}
+};
+
+static const reg_entry i386_float_regtab[] = {
+ {"st(0)", FloatReg|FloatAcc, 0},
+ {"st(1)", FloatReg, 1},
+ {"st(2)", FloatReg, 2},
+ {"st(3)", FloatReg, 3},
+ {"st(4)", FloatReg, 4},
+ {"st(5)", FloatReg, 5},
+ {"st(6)", FloatReg, 6},
+ {"st(7)", FloatReg, 7}
};
#define MAX_REG_NAME_SIZE 8 /* for parsing register names from input */
diff --git a/include/opcode/m68k.h b/include/opcode/m68k.h
index ecb3f95dd..3208b77f4 100644
--- a/include/opcode/m68k.h
+++ b/include/opcode/m68k.h
@@ -1,5 +1,5 @@
/* Opcode table header for m680[01234]0/m6888[12]/m68851.
- Copyright 1989, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
+ Copyright 1989, 91, 92, 93, 94, 95, 96, 97, 1999 Free Software Foundation.
This file is part of GDB, GAS, and the GNU binutils.
@@ -36,6 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define m68851 0x080
#define cpu32 0x100 /* e.g., 68332 */
#define mcf5200 0x200
+#define mcf5206e 0x400
+#define mcf5307 0x800
/* handy aliases */
#define m68040up (m68040 | m68060)
@@ -43,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define m68020up (m68020 | m68030up)
#define m68010up (m68010 | cpu32 | m68020up)
#define m68000up (m68000 | m68010up)
+#define mcf (mcf5200 | mcf5206e | mcf5307)
#define mfloat (m68881 | m68882 | m68040 | m68060)
#define mmmu (m68851 | m68030 | m68040 | m68060)
@@ -87,7 +90,7 @@ struct m68k_opcode_alias
operand; the second, the place it is stored. */
/* Kinds of operands:
- Characters used: AaBCcDdFfIJkLlMmnOopQqRrSsTtUVvWXYZ0123|*~%;@!&$?/<>#^+-
+ Characters used: AaBCcDdEFfGHIJkLlMmnOopQqRrSsTtU VvWXYZ0123|*~%;@!&$?/<>#^+-
D data register only. Stored as 3 bits.
A address register only. Stored as 3 bits.
@@ -121,6 +124,9 @@ struct m68k_opcode_alias
C the CCR. No need to store it; this is just for filtering validity.
S the SR. No need to store, just as with CCR.
U the USP. No need to store, just as with CCR.
+ E the ACC. No need to store, just as with CCR.
+ G the MACSR. No need to store, just as with CCR.
+ H the MASK. No need to store, just as with CCR.
I Coprocessor ID. Not printed if 1. The Coprocessor ID is always
extracted from the 'd' field of word one, which means that an extended
@@ -170,6 +176,9 @@ struct m68k_opcode_alias
for both caches. Used in cinv and cpush. Always
stored in position "d".
+ u Any register, with ``upper'' or ``lower'' specification. Used
+ in the mac instructions with size word.
+
The remainder are all stored as 6 bits using an address mode and a
register number; they differ in which addressing modes they match.
@@ -260,6 +269,8 @@ struct m68k_opcode_alias
*/
/* Places to put an operand, for non-general operands:
+ Characters used: BbCcDdghijkLlMmNnostWw123456789
+
s source, low bits of first word.
d dest, shifted 9 in first word
1 second word, shifted 12
@@ -293,6 +304,24 @@ struct m68k_opcode_alias
C floating point coprocessor constant - 7 bits. Also used for static
K-factors...
j Movec register #, stored in 12 low bits of second word.
+ m For M[S]ACx; 4 bits split with MSB shifted 6 bits in first word
+ and remaining 3 bits of register shifted 9 bits in first word.
+ Indicate upper/lower in 1 bit shifted 7 bits in second word.
+ Use with `R' or `u' format.
+ n `m' withouth upper/lower indication. (For M[S]ACx; 4 bits split
+ with MSB shifted 6 bits in first word and remaining 3 bits of
+ register shifted 9 bits in first word. No upper/lower
+ indication is done.) Use with `R' or `u' format.
+ o For M[S]ACw; 4 bits shifted 12 in second word (like `1').
+ Indicate upper/lower in 1 bit shifted 7 bits in second word.
+ Use with `R' or `u' format.
+ M For M[S]ACw; 4 bits in low bits of first word. Indicate
+ upper/lower in 1 bit shifted 6 bits in second word. Use with
+ `R' or `u' format.
+ N For M[S]ACw; 4 bits in low bits of second word. Indicate
+ upper/lower in 1 bit shifted 6 bits in second word. Use with
+ `R' or `u' format.
+ h shift indicator (scale factor), 1 bit shifted 10 in second word
Places to put operand, for general operands:
d destination, shifted 6 bits in first word
diff --git a/include/opcode/mips.h b/include/opcode/mips.h
index f0a8c7ef9..68fe57a8a 100644
--- a/include/opcode/mips.h
+++ b/include/opcode/mips.h
@@ -308,6 +308,7 @@ struct mips_opcode
#define INSN_ISA3 0x00000003
/* MIPS ISA 4 instruction (R8000). */
#define INSN_ISA4 0x00000004
+#define INSN_ISA5 0x00000005
/* Chip specific instructions. These are bitmasks. */
/* MIPS R4650 instruction. */
@@ -319,6 +320,31 @@ struct mips_opcode
/* Toshiba R3900 instruction. */
#define INSN_3900 0x00000080
+/* 32-bit code running on a ISA3+ CPU. */
+#define INSN_GP32 0x00001000
+
+/* Test for membership in an ISA including chip specific ISAs.
+ INSN is pointer to an element of the opcode table; ISA is the
+ specified ISA to test against; and CPU is the CPU specific ISA
+ to test, or zero if no CPU specific ISA test is desired.
+ The gp32 arg is set when you need to force 32-bit register usage on
+ a machine with 64-bit registers; see the documentation under -mgp32
+ in the MIPS gas docs. */
+
+#define OPCODE_IS_MEMBER(insn,isa,cpu,gp32) \
+ ((((insn)->membership & INSN_ISA) != 0 \
+ && ((insn)->membership & INSN_ISA) <= isa \
+ && ((insn)->membership & INSN_GP32 ? gp32 : 1)) \
+ || (cpu == 4650 \
+ && ((insn)->membership & INSN_4650) != 0) \
+ || (cpu == 4010 \
+ && ((insn)->membership & INSN_4010) != 0) \
+ || ((cpu == 4100 \
+ || cpu == 4111 \
+ ) \
+ && ((insn)->membership & INSN_4100) != 0) \
+ || (cpu == 3900 \
+ && ((insn)->membership & INSN_3900) != 0))
/* This is a list of macro expanded instructions.
*
diff --git a/include/opcode/mn10300.h b/include/opcode/mn10300.h
index 34e4b0b43..12f03670f 100644
--- a/include/opcode/mn10300.h
+++ b/include/opcode/mn10300.h
@@ -117,6 +117,23 @@ extern const struct mn10300_operand mn10300_operands[];
#define MN10300_OPERAND_RELAX 0x4000
+#define MN10300_OPERAND_USP 0x8000
+
+#define MN10300_OPERAND_SSP 0x10000
+
+#define MN10300_OPERAND_MSP 0x20000
+
+#define MN10300_OPERAND_PC 0x40000
+
+#define MN10300_OPERAND_EPSW 0x80000
+
+#define MN10300_OPERAND_RREG 0x100000
+
+#define MN10300_OPERAND_XRREG 0x200000
+
+#define MN10300_OPERAND_PLUS 0x400000
+
+#define MN10300_OPERAND_24BIT 0x800000
/* Opcode Formats. */
#define FMT_S0 1
@@ -129,10 +146,16 @@ extern const struct mn10300_operand mn10300_operands[];
#define FMT_D2 8
#define FMT_D4 9
#define FMT_D5 10
+#define FMT_D6 11
+#define FMT_D7 12
+#define FMT_D8 13
+#define FMT_D9 14
+#define FMT_D10 15
/* Variants of the mn10300 which have additional opcodes. */
#define MN103 300
#define AM30 300
+#define AM33 330
#endif /* MN10300_H */
diff --git a/include/opcode/pj.h b/include/opcode/pj.h
new file mode 100644
index 000000000..8759b627e
--- /dev/null
+++ b/include/opcode/pj.h
@@ -0,0 +1,46 @@
+/* Definitions for decoding the picoJava opcode table.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ Contributed by Steve Chamberlain of Transmeta (sac@pobox.com).
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+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. */
+
+
+/* Names used to describe the type of instruction arguments, used by
+ the assembler and disassembler. Attributes are encoded in various fields. */
+
+/* reloc size pcrel uns */
+#define O_N 0
+#define O_16 (1<<4 | 2 | (0<<6) | (0<<3))
+#define O_U16 (1<<4 | 2 | (0<<6) | (1<<3))
+#define O_R16 (2<<4 | 2 | (1<<6) | (0<<3))
+#define O_8 (3<<4 | 1 | (0<<6) | (0<<3))
+#define O_U8 (3<<4 | 1 | (0<<6) | (1<<3))
+#define O_R8 (4<<4 | 1 | (0<<6) | (0<<3))
+#define O_R32 (5<<4 | 4 | (1<<6) | (0<<3))
+#define O_32 (6<<4 | 4 | (0<<6) | (0<<3))
+
+#define ASIZE(x) ((x) & 0x7)
+#define PCREL(x) (!!((x) & (1<<6)))
+#define UNS(x) (!!((x) & (1<<3)))
+
+
+typedef struct
+{
+ short opcode;
+ short opcode_next;
+ char len;
+ unsigned char arg[2];
+ const char *name;
+} pj_opc_info_t;
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index a9e3b24ab..974f0dfa5 100644
--- a/include/opcode/ppc.h
+++ b/include/opcode/ppc.h
@@ -85,6 +85,9 @@ extern const int powerpc_num_opcodes;
for the assembler's -many option, and it eliminates duplicates). */
#define PPC_OPCODE_ANY (0200)
+/* Opcode is supported as part of the 64-bit bridge. */
+#define PPC_OPCODE_64_BRIDGE (0400)
+
/* A macro to extract the major opcode from an instruction. */
#define PPC_OP(i) (((i) >> 26) & 0x3f)
diff --git a/include/partition.h b/include/partition.h
new file mode 100644
index 000000000..f49d67a8c
--- /dev/null
+++ b/include/partition.h
@@ -0,0 +1,81 @@
+/* List implentation of a partition of consecutive integers.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, LLC.
+
+ This file is part of GNU CC.
+
+ GNU CC 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.
+
+ GNU CC 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 GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This package implements a partition of consecutive integers. The
+ elements are partitioned into classes. Each class is represented
+ by one of its elements, the canonical element, which is chosen
+ arbitrarily from elements in the class. The principal operations
+ on a partition are FIND, which takes an element, determines its
+ class, and returns the canonical element for that class, and UNION,
+ which unites the two classes that contain two given elements into a
+ single class.
+
+ The list implementation used here provides constant-time finds. By
+ storing the size of each class with the class's canonical element,
+ it is able to perform unions over all the classes in the partition
+ in O (N log N) time. */
+
+#ifndef _PARTITION_H
+#define _PARTITION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <ansidecl.h>
+#include <stdio.h>
+
+struct partition_elem
+{
+ /* The canonical element that represents the class containing this
+ element. */
+ int class_element;
+ /* The next element in this class. Elements in each class form a
+ circular list. */
+ struct partition_elem* next;
+ /* The number of elements in this class. Valid only if this is the
+ canonical element for its class. */
+ unsigned class_count;
+};
+
+typedef struct partition_def
+{
+ /* The number of elements in this partition. */
+ int num_elements;
+ /* The elements in the partition. */
+ struct partition_elem elements[1];
+} *partition;
+
+extern partition partition_new PARAMS((int));
+extern void partition_delete PARAMS((partition));
+extern int partition_union PARAMS((partition,
+ int,
+ int));
+extern void partition_print PARAMS((partition,
+ FILE*));
+
+/* Returns the canonical element corresponding to the class containing
+ ELEMENT__ in PARTITION__. */
+
+#define partition_find(partition__, element__) \
+ ((partition__)->elements[(element__)].class_element)
+
+#endif /* _PARTITION_H */
diff --git a/include/remote-sim.h b/include/remote-sim.h
index a4480b49c..b32f93fdd 100644
--- a/include/remote-sim.h
+++ b/include/remote-sim.h
@@ -211,7 +211,27 @@ int sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int
void sim_info PARAMS ((SIM_DESC sd, int verbose));
-/* Run (or resume) the simulated program. */
+/* Run (or resume) the simulated program.
+
+ STEP, when non-zero indicates that only a single simulator cycle
+ should be emulated.
+
+ SIGGNAL, if non-zero is a (HOST) SIGRC value indicating the type of
+ event (hardware interrupt, signal) to be delivered to the simulated
+ program.
+
+ Hardware simulator: If the SIGRC value returned by
+ sim_stop_reason() is passed back to the simulator via SIGGNAL then
+ the hardware simulator shall correctly deliver the hardware event
+ indicated by that signal. If a value of zero is passed in then the
+ simulation will continue as if there were no outstanding signal.
+ The effect of any other SIGGNAL value is is implementation
+ dependant.
+
+ Process simulator: If SIGRC is non-zero then the corresponding
+ signal is delivered to the simulated program and execution is then
+ continued. A zero SIGRC value indicates that the program should
+ continue as normal. */
void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal));
@@ -234,13 +254,13 @@ int sim_stop PARAMS ((SIM_DESC sd));
(SIGTRAP); a completed single step (SIGTRAP); an internal error
condition (SIGABRT); an illegal instruction (SIGILL); Access to an
undefined memory region (SIGSEGV); Mis-aligned memory access
- (SIGBUS).
+ (SIGBUS). For some signals information in addition to the signal
+ number may be retained by the simulator (e.g. offending address),
+ that information is not directly accessable via this interface.
- SIM_SIGNALLED: The program has stopped. The simulator has
- encountered target code that requires the (HOST) signal SIGRC to be
- delivered to the simulated program. Ex: `kill (getpid (),
- TARGET_SIGxxx)'. Where TARGET_SIGxxx has been translated into a
- host signal. FIXME: This is not always possible..
+ SIM_SIGNALLED: The program has been terminated by a signal. The
+ simulator has encountered target code that causes the the program
+ to exit with signal SIGRC.
SIM_RUNNING, SIM_POLLING: The return of one of these values
indicates a problem internal to the simulator. */
@@ -288,15 +308,27 @@ void sim_set_callbacks PARAMS ((struct host_callback_struct *));
void sim_size PARAMS ((int i));
-/* Run a simulation with tracing enabled.
+/* Single-step simulator with tracing enabled.
THIS PROCEDURE IS DEPRECIATED.
+ THIS PROCEDURE IS EVEN MORE DEPRECATED THAN SIM_SET_TRACE
GDB and NRUN do not use this interface.
- This procedure does not take a SIM_DESC argument as it is
- used before sim_open. */
+ This procedure returns: ``0'' indicating that the simulator should
+ be continued using sim_trace() calls; ``1'' indicating that the
+ simulation has finished. */
int sim_trace PARAMS ((SIM_DESC sd));
+/* Enable tracing.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure returns: ``0'' indicating that the simulator should
+ be continued using sim_trace() calls; ``1'' indicating that the
+ simulation has finished. */
+
+void sim_set_trace PARAMS ((void));
+
+
/* Configure the size of the profile buffer.
THIS PROCEDURE IS DEPRECIATED.
GDB and NRUN do not use this interface.
diff --git a/include/sim-d10v.h b/include/sim-d10v.h
new file mode 100644
index 000000000..84eab2a1a
--- /dev/null
+++ b/include/sim-d10v.h
@@ -0,0 +1,103 @@
+/* This file defines the interface between the d10v simulator and gdb.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if !defined (SIM_D10V_H)
+#define SIM_D10V_H
+
+#ifdef __cplusplus
+extern "C" { // }
+#endif
+
+/* GDB interprets addresses as:
+
+ 0x00xxxxxx: Physical unified memory segment (Unified memory)
+ 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
+ 0x02xxxxxx: Physical data memory segment (On-chip data memory)
+ 0x10xxxxxx: Logical data address segment (DMAP translated memory)
+ 0x11xxxxxx: Logical instruction address segment (IMAP translated memory)
+
+ The remote d10v board interprets addresses as:
+
+ 0x00xxxxxx: Physical unified memory segment (Unified memory)
+ 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
+ 0x02xxxxxx: Physical data memory segment (On-chip data memory)
+
+ The following translate a virtual DMAP/IMAP offset into a physical
+ memory segment assigning the translated address to PHYS. Since a
+ memory access may cross a page boundrary the number of bytes for
+ which the translation is applicable (or 0 for an invalid virtual
+ offset) is returned. */
+
+enum
+ {
+ SIM_D10V_MEMORY_UNIFIED = 0x00000000,
+ SIM_D10V_MEMORY_INSN = 0x01000000,
+ SIM_D10V_MEMORY_DATA = 0x02000000,
+ SIM_D10V_MEMORY_DMAP = 0x10000000,
+ SIM_D10V_MEMORY_IMAP = 0x11000000
+ };
+
+extern unsigned long sim_d10v_translate_dmap_addr
+ (unsigned long offset,
+ int nr_bytes,
+ unsigned long *phys,
+ unsigned long (*dmap_register) (int reg_nr));
+
+extern unsigned long sim_d10v_translate_imap_addr
+ (unsigned long offset,
+ int nr_bytes,
+ unsigned long *phys,
+ unsigned long (*imap_register) (int reg_nr));
+
+extern unsigned long sim_d10v_translate_addr
+ (unsigned long vaddr,
+ int nr_bytes,
+ unsigned long *phys,
+ unsigned long (*dmap_register) (int reg_nr),
+ unsigned long (*imap_register) (int reg_nr));
+
+
+/* The simulator makes use of the following register information. */
+
+enum
+ {
+ SIM_D10V_R0_REGNUM = 0,
+ SIM_D10V_CR0_REGNUM = 16,
+ SIM_D10V_A0_REGNUM = 32,
+ SIM_D10V_SPI_REGNUM = 34,
+ SIM_D10V_SPU_REGNUM = 35,
+ SIM_D10V_IMAP0_REGNUM = 36,
+ SIM_D10V_DMAP0_REGNUM = 38,
+ SIM_D10V_TS2_DMAP_REGNUM = 40
+ };
+
+enum
+ {
+ SIM_D10V_NR_R_REGS = 16,
+ SIM_D10V_NR_A_REGS = 2,
+ SIM_D10V_NR_IMAP_REGS = 2,
+ SIM_D10V_NR_DMAP_REGS = 4,
+ SIM_D10V_NR_CR_REGS = 16
+ };
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/wait.h b/include/wait.h
deleted file mode 100644
index fa3c9ccb1..000000000
--- a/include/wait.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Define how to access the int that the wait system call stores.
- This has been compatible in all Unix systems since time immemorial,
- but various well-meaning people have defined various different
- words for the same old bits in the same old int (sometimes claimed
- to be a struct). We just know it's an int and we use these macros
- to access the bits. */
-
-/* The following macros are defined equivalently to their definitions
- in POSIX.1. We fail to define WNOHANG and WUNTRACED, which POSIX.1
- <sys/wait.h> defines, since our code does not use waitpid(). We
- also fail to declare wait() and waitpid(). */
-
-#ifndef WIFEXITED
-#define WIFEXITED(w) (((w)&0377) == 0)
-#endif
-
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
-#endif
-
-#ifndef WIFSTOPPED
-#ifdef IBM6000
-
-/* Unfortunately, the above comment (about being compatible in all Unix
- systems) is not quite correct for AIX, sigh. And AIX 3.2 can generate
- status words like 0x57c (sigtrap received after load), and gdb would
- choke on it. */
-
-#define WIFSTOPPED(w) ((w)&0x40)
-
-#else
-#define WIFSTOPPED(w) (((w)&0377) == 0177)
-#endif
-#endif
-
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(w) (((w) >> 8) & 0377) /* same as WRETCODE */
-#endif
-
-#ifndef WTERMSIG
-#define WTERMSIG(w) ((w) & 0177)
-#endif
-
-#ifndef WSTOPSIG
-#define WSTOPSIG WEXITSTATUS
-#endif
-
-/* These are not defined in POSIX, but are used by our programs. */
-
-#define WAITTYPE int
-
-#ifndef WCOREDUMP
-#define WCOREDUMP(w) (((w)&0200) != 0)
-#endif
-
-#ifndef WSETEXIT
-#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
-#endif
-
-#ifndef WSETSTOP
-#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
-#endif
-
diff --git a/ltconfig b/ltconfig
index ab304fd3b..a01334f92 100755
--- a/ltconfig
+++ b/ltconfig
@@ -2,7 +2,7 @@
# ltconfig - Create a system-specific libtool.
# Copyright (C) 1996-1999 Free Software Foundation, Inc.
-# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# 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
@@ -32,12 +32,8 @@ if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
+ # Avoid inline document here, it may be left over
+ :
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
@@ -46,9 +42,18 @@ else
exec "$SHELL" "$0" --no-reexec ${1+"$@"}
fi
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
# Find the correct PATH separator. Usually this is `:', but
# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != "Xset"; then
+if test "X${PATH_SEPARATOR+set}" != Xset; then
UNAME=${UNAME-`uname 2>/dev/null`}
case X$UNAME in
*-DOS) PATH_SEPARATOR=';' ;;
@@ -58,9 +63,9 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-if test "X${echo_test_string+set}" != "Xset"; then
+if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
@@ -82,7 +87,7 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
for dir in $PATH /usr/ucb; do
- if test -f $dir/echo &&
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
echo="$dir/echo"
@@ -97,7 +102,8 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
# This shell has a builtin print -r that does the trick.
echo='print -r'
- elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
# If we have ksh, try running ltconfig again with it.
ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
export ORIGINAL_CONFIG_SHELL
@@ -163,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
-VERSION=1.2f
-TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
+VERSION=1.3.4
+TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
+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'
rm="rm -f"
help="Try \`$progname --help' for more information."
@@ -175,10 +181,12 @@ help="Try \`$progname --help' for more information."
default_ofile=libtool
can_build_shared=yes
enable_shared=yes
-# All known linkers require a `.a' archive for static linking.
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
enable_static=yes
enable_fast_install=yes
enable_dlopen=unknown
+enable_win32_dll=no
ltmain=
silent=
srcdir=
@@ -194,17 +202,21 @@ need_locks=yes
ac_ext=c
objext=o
libext=a
+exeext=
cache_file=
old_AR="$AR"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
old_CPPFLAGS="$CPPFLAGS"
+old_LDFLAGS="$LDFLAGS"
old_LD="$LD"
old_LN_S="$LN_S"
+old_LIBS="$LIBS"
old_NM="$NM"
old_RANLIB="$RANLIB"
old_DLLTOOL="$DLLTOOL"
+old_OBJDUMP="$OBJDUMP"
old_AS="$AS"
# Parse the command line options.
@@ -235,7 +247,7 @@ Generate a system-specific libtool script.
--disable-static do not build static libraries
--disable-fast-install do not optimize for fast installation
--enable-dlopen enable dlopen support
- --enable-dlopen-self enable support for dlopening programs
+ --enable-win32-dll enable building dlls on win32 hosts
--help display this help and exit
--no-verify do not verify that HOST is a valid host type
-o, --output=FILE specify the output file [default=$default_ofile]
@@ -269,6 +281,8 @@ EOM
--enable-dlopen) enable_dlopen=yes ;;
+ --enable-win32-dll) enable_win32_dll=yes ;;
+
--quiet | --silent) silent=yes ;;
--srcdir) prev=srcdir ;;
@@ -355,8 +369,8 @@ exec 5>>./config.log
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
+if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
if test -n "$cache_file" && test -r "$cache_file"; then
echo "loading cache $cache_file within ltconfig"
@@ -448,7 +462,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "${COLLECT_NAMES+set}" != set; then
+ if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -463,6 +477,9 @@ old_postuninstall_cmds=
# Set a sane default for `AR'.
test -z "$AR" && AR=ar
+# Set a sane default for `OBJDUMP'.
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
# If RANLIB is not set, then run the test.
if test "${RANLIB+set}" != "set"; then
result=no
@@ -471,7 +488,7 @@ if test "${RANLIB+set}" != "set"; then
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/ranlib; then
+ if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
RANLIB="ranlib"
result="ranlib"
break
@@ -487,8 +504,9 @@ if test -n "$RANLIB"; then
old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
fi
-# Set sane defaults for `DLLTOOL' and `AS', used on cygwin.
+# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$OBJDUMP" && OBJDUMP=objdump
test -z "$AS" && AS=as
# Check to see if we are using GCC.
@@ -498,9 +516,8 @@ if test "$with_gcc" != yes || test -z "$CC"; then
echo $ac_n "checking for gcc... $ac_c" 1>&6
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
for dir in $PATH; do
- IFS="$save_ifs"
test -z "$dir" && dir=.
- if test -f $dir/gcc; then
+ if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
CC="gcc"
break
fi
@@ -521,7 +538,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then
cc_rejected=no
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/cc; then
+ if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
if test "$dir/cc" = "/usr/ucb/cc"; then
cc_rejected=yes
continue
@@ -561,7 +578,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then
# Now see if the compiler is really GCC.
with_gcc=no
echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
- echo "$progname:564: checking whether we are using GNU C" >&5
+ echo "$progname:581: checking whether we are using GNU C" >&5
$rm conftest.c
cat > conftest.c <<EOF
@@ -569,7 +586,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then
yes;
#endif
EOF
- if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$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 $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
with_gcc=yes
fi
$rm conftest.c
@@ -583,8 +600,8 @@ compiler="$2"
echo $ac_n "checking for object suffix... $ac_c" 1>&6
$rm conftest*
echo 'int i = 1;' > conftest.c
-echo "$progname:586: checking for object suffix" >& 5
-if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
+echo "$progname:603: checking for object suffix" >& 5
+if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
# Append any warnings to the config.log.
cat conftest.err 1>&5
@@ -602,6 +619,38 @@ fi
$rm conftest*
echo "$ac_t$objext" 1>&6
+echo $ac_n "checking for executable suffix... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_exeext="no"
+ $rm conftest*
+ echo 'main () { return 0; }' > conftest.c
+ echo "$progname:629: checking for executable suffix" >& 5
+ if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then
+ # Append any warnings to the config.log.
+ cat conftest.err 1>&5
+
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c | *.err | *.$objext ) ;;
+ *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+ else
+ cat conftest.err 1>&5
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ $rm conftest*
+fi
+if test "X$ac_cv_exeext" = Xno; then
+ exeext=""
+else
+ exeext="$ac_cv_exeext"
+fi
+echo "$ac_t$ac_cv_exeext" 1>&6
+
echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
pic_flag=
special_shlib_compile_flags=
@@ -614,7 +663,7 @@ if test "$with_gcc" = yes; then
link_static_flag='-static'
case "$host_os" in
- beos* | irix5* | irix6* | osf3* | osf4*)
+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
aix*)
@@ -635,6 +684,11 @@ if test "$with_gcc" = yes; then
# like `-m68040'.
pic_flag='-m68020 -resident32 -malways-restore-a4'
;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ pic_flag=-Kconform_pic
+ fi
+ ;;
*)
pic_flag='-fPIC'
;;
@@ -664,7 +718,7 @@ else
# We can build DLLs from non-PIC.
;;
- osf3* | osf4*)
+ osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
wl='-Wl,'
link_static_flag='-non_shared'
@@ -688,7 +742,7 @@ else
wl='-Qoption ld '
;;
- sysv4.2uw2* | sysv4.3* | sysv5*)
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
pic_flag='-KPIC'
link_static_flag='-Bstatic'
wl='-Wl,'
@@ -698,7 +752,12 @@ else
pic_flag='-pic'
link_static_flag='-Bstatic'
;;
-
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ pic_flag='-Kconform_pic'
+ link_static_flag='-Bstatic'
+ fi
+ ;;
*)
can_build_shared=no
;;
@@ -714,8 +773,8 @@ if test -n "$pic_flag"; then
echo "int some_variable = 0;" > conftest.c
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pic_flag -DPIC"
- echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5
- if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
+ echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5
+ if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
# Append any warnings to the config.log.
cat conftest.err 1>&5
@@ -753,16 +812,26 @@ fi
# Check to see if options -o and -c are simultaneously supported by compiler
echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
$rm conftest*
echo "int some_variable = 0;" > conftest.c
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory. Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -c -o conftest2.o"
-echo "$progname:760: checking if $compiler supports -c -o file.o" >&5
-if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
+CFLAGS="$CFLAGS -o out/conftest2.o"
+echo "$progname:829: checking if $compiler supports -c -o file.o" >&5
+if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- if test -s conftest.err; then
+ if test -s out/conftest.err; then
echo "$ac_t"no 1>&6
compiler_c_o=no
else
@@ -771,12 +840,17 @@ if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conft
fi
else
# Append any errors to the config.log.
- cat conftest.err 1>&5
+ cat out/conftest.err 1>&5
compiler_c_o=no
echo "$ac_t"no 1>&6
fi
CFLAGS="$save_CFLAGS"
-$rm conftest*
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
if test x"$compiler_c_o" = x"yes"; then
# Check to see if we can write to a .lo
@@ -785,8 +859,8 @@ if test x"$compiler_c_o" = x"yes"; then
echo "int some_variable = 0;" > conftest.c
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -c -o conftest.lo"
- echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5
-if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
+ echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5
+if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -837,8 +911,8 @@ if test "$with_gcc" = yes; then
echo "int some_variable = 0;" > conftest.c
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
- echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
- if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
+ echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+ if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -881,8 +955,8 @@ $rm conftest*
echo 'main(){return(0);}' > conftest.c
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $link_static_flag"
-echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5
-if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5
+if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
echo "$ac_t$link_static_flag" 1>&6
else
echo "$ac_t"none 1>&6
@@ -894,9 +968,9 @@ $rm conftest*
if test -z "$LN_S"; then
# Check to see if we can use ln -s, or we need hard links.
echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
- $rm conftestdata
- if ln -s X conftestdata 2>/dev/null; then
- $rm conftestdata
+ $rm conftest.dat
+ if ln -s X conftest.dat 2>/dev/null; then
+ $rm conftest.dat
LN_S="ln -s"
else
LN_S=ln
@@ -914,11 +988,11 @@ if test -z "$LD"; then
if test "$with_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
- echo "$progname:917: checking for ld used by GCC" >&5
+ echo "$progname:991: checking for ld used by GCC" >&5
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
- /* | [A-Za-z]:[\\/]*)
+ [\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
@@ -938,17 +1012,17 @@ if test -z "$LD"; then
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld... $ac_c" 1>&6
- echo "$progname:941: checking for GNU ld" >&5
+ echo "$progname:1015: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
- echo "$progname:944: checking for non-GNU ld" >&5
+ echo "$progname:1018: checking for non-GNU ld" >&5
fi
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"; then
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
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.
@@ -1007,7 +1081,7 @@ hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
always_export_symbols=no
-export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
@@ -1015,7 +1089,12 @@ include_expsyms=
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
-exclude_expsyms=
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+# platforms (ab)use it in PIC code, but their linkers get confused if
+# the symbol is explicitly referenced. Since portable code cannot
+# rely on this symbol name, it's probably fine to never include it in
+# preloaded symbol tables.
case "$host_os" in
cygwin* | mingw*)
@@ -1027,10 +1106,6 @@ cygwin* | mingw*)
fi
;;
-freebsd2* | sunos4*)
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
- ;;
-
esac
ld_shlibs=yes
@@ -1058,18 +1133,21 @@ EOF
archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
- ;;
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
- wlarc=
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can use
+ # them.
+ ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
else
ld_shlibs=no
@@ -1086,25 +1164,64 @@ EOF
# Extract the symbol export list from an `--export-all' def file,
# then regenerate the def file from the symbol export list, so that
# the compiled dll only exports the symbol export list.
- export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
- sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
- (cd $objdir && $CC -c $soname-ltdll.c)~
- $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+ export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
+ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
_lt_hint=1;
for symbol in `cat $export_symbols`; do
- echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
+ echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
_lt_hint=`expr 1 + \$_lt_hint`;
done~
+ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
$CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
$CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
$CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
- old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
+ old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
+ # can we support soname and/or expsyms with a.out? -oliva
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
;;
*)
@@ -1121,7 +1238,20 @@ EOF
runpath_var=LD_RUN_PATH
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ case $host_os in
+ cygwin* | mingw*)
+ # dlltool doesn't understand --whole-archive et. al.
+ whole_archive_flag_spec=
+ ;;
+ *)
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ ;;
+ esac
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
@@ -1141,35 +1271,45 @@ else
;;
aix4*)
- allow_undefined_flag=
+ hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
+ hardcode_libdir_separator=':'
if test "$with_gcc" = yes; then
- if strings `${CC} -print-prog-name=collect2` | \
- grep resolve_lib_name >/dev/null
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
else
# We have old collect2
hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
fi
- archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
+ shared_flag='-shared'
else
- always_export_symbols=yes
- archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
+ shared_flag='${wl}-bM:SRE'
hardcode_direct=yes
fi
- hardcode_minus_L=yes
- # Though LIBPATH variable hardcodes shlibpath into executable,
- # it doesn't affect searching for -l* libraries; this confuses
- # tests in mdemo.
- hardcode_shlibpath_var=unsupported
- hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=' ${wl}-berok'
+ archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
+ case "$host_os" in aix4.[01]|aix4.[01].*)
+ # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
+ always_export_symbols=yes ;;
+ esac
;;
amigaos*)
archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
;;
cygwin* | mingw*)
@@ -1192,7 +1332,6 @@ else
freebsd1*)
ld_shlibs=no
- can_build_shared=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
@@ -1203,7 +1342,6 @@ else
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
- hardcode_minus_L=no # verified on 2.2.6
hardcode_shlibpath_var=no
;;
@@ -1220,31 +1358,27 @@ else
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
- hardcode_minus_L=no
hardcode_shlibpath_var=no
;;
- hpux9*)
- archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10* | hpux11*)
- archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts'
+ hpux9* | hpux10* | hpux11*)
+ case "$host_os" in
+ hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
+ esac
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
hardcode_direct=yes
- hardcode_minus_L=yes
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
+ # location of the library.
export_dynamic_flag_spec='${wl}-E'
;;
irix5* | irix6*)
if test "$with_gcc" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
- archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+ archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
@@ -1276,21 +1410,35 @@ else
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;;
- osf3* | osf4*)
+ osf3*)
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # As osf3* with the addition of the -msym flag
+ if test "$with_gcc" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
sco3.2v5*)
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
- hardcode_direct=yes
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
;;
solaris*)
@@ -1302,63 +1450,100 @@ else
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
+ case "$host_os" in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
;;
sunos4*)
- # Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
- if test "$with_gcc" = yes; then
- # Use -fPIC here because libgcc is multilibbed
- archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
- fi
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
+ sysv4)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+
sysv4.3*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
- hardcode_direct=no
- hardcode_minus_L=no
hardcode_shlibpath_var=no
export_dynamic_flag_spec='-Bexport'
;;
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
+ hardcode_libdir_flag_spec=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=no
- hardcode_minus_L=no
hardcode_shlibpath_var=no
;;
dgux*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
+ hardcode_direct=yes
hardcode_minus_L=no
hardcode_shlibpath_var=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ unixware7*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
;;
*)
ld_shlibs=no
- can_build_shared=no
;;
esac
fi
echo "$ac_t$ld_shlibs" 1>&6
+test "$ld_shlibs" = no && can_build_shared=no
if test -z "$NM"; then
echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
case "$NM" in
- /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
+ [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm; then
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
@@ -1416,6 +1601,9 @@ irix*)
solaris*)
symcode='[BDT]'
;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
esac
# If we're using GNU nm, then use its standard symbol codes.
@@ -1444,11 +1632,11 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);}
EOF
- echo "$progname:1447: checking if global_symbol_pipe works" >&5
- if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
+ echo "$progname:1635: checking if global_symbol_pipe works" >&5
+ if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+ if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -1495,12 +1683,12 @@ EOF
#endif
EOF
# Now try linking the two files.
- mv conftest.$objext conftestm.$objext
+ mv conftest.$objext conftstm.$objext
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
- LIBS="conftestm.$objext"
+ LIBS="conftstm.$objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes
else
echo "$progname: failed program was:" >&5
@@ -1520,7 +1708,7 @@ EOF
echo "$progname: failed program was:" >&5
cat conftest.c >&5
fi
- $rm conftest*
+ $rm conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -1529,7 +1717,11 @@ EOF
global_symbol_pipe=
fi
done
-echo "$ac_t$pipe_works" 1>&6
+if test "$pipe_works" = yes; then
+ echo "${ac_t}ok" 1>&6
+else
+ echo "${ac_t}failed" 1>&6
+fi
if test -z "$global_symbol_pipe"; then
global_symbol_to_cdecl=
@@ -1542,10 +1734,12 @@ if test -n "$hardcode_libdir_flag_spec" || \
test -n "$runpath_var"; then
# We can hardcode non-existant directories.
- if test "$hardcode_direct" != no && \
- test "$hardcode_minus_L" != no && \
- test "$hardcode_shlibpath_var" != no; then
-
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$hardcode_shlibpath_var" != no &&
+ test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
@@ -1628,19 +1822,25 @@ beos*)
library_names_spec='${libname}.so'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
+ deplibs_check_method=pass_all
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
;;
bsdi4*)
version_type=linux
- library_names_spec='${libname}.so$major ${libname}.so'
- soname_spec='${libname}.so'
- finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
- deplibs_check_method='file_magic ELF 32-bit LSB shared object'
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
file_magic_cmd=/usr/bin/file
file_magic_test_file=/shlib/libc.so
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ export_dynamic_flag_spec=-rdynamic
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
@@ -1648,17 +1848,20 @@ bsdi4*)
cygwin* | mingw*)
version_type=windows
+ need_version=no
+ need_lib_prefix=no
if test "$with_gcc" = yes; then
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
else
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
fi
dynamic_linker='Win32 ld.exe'
- deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
- file_magic_cmd='objdump -f'
- need_lib_prefix=no
+ deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ file_magic_cmd='${OBJDUMP} -f'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
;;
freebsd1*)
@@ -1683,13 +1886,23 @@ freebsd*)
need_version=yes
;;
esac
- finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ case "$host_os" in
+ freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ ;;
+ esac
;;
gnu*)
version_type=linux
- library_names_spec='${libname}${release}.so$versuffix ${libname}.so'
+ 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
;;
@@ -1701,46 +1914,41 @@ hpux9* | hpux10* | hpux11*)
need_lib_prefix=no
need_version=no
shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
soname_spec='${libname}${release}.sl$major'
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
;;
-irix5*)
- version_type=irix
- soname_spec='${libname}${release}.so'
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
- shlibpath_var=LD_LIBRARY_PATH
- deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all?
- file_magic_cmd=/usr/bin/file
- file_magic_test_file=`echo /lib/libc.so*`
- shlibpath_overrides_runpath=no
- ;;
-
-irix6*)
+irix5* | irix6*)
version_type=irix
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}.so'
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
- case "$LD" in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
+ soname_spec='${libname}${release}.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
+ case "$host_os" in
+ irix5*)
+ libsuff= shlibsuff=
+ # this will be overridden with pass_all, but let us keep it just in case
+ deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
- # even though /usr/local/lib is always searched, the man-page says
- # shared libraries should not be installed there if they use an ABI
- # different from -32, so we'd better not search for shared libraries
- # there either
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all?
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
file_magic_cmd=/usr/bin/file
file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ deplibs_check_method='pass_all'
;;
# No shared lib support for Linux oldld, aout, or coff.
@@ -1755,7 +1963,7 @@ linux-gnu*)
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
- finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
@@ -1777,7 +1985,7 @@ netbsd*)
version_type=sunos
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
- finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
@@ -1806,19 +2014,17 @@ os2*)
shlibpath_var=LIBPATH
;;
-osf3* | osf4*)
+osf3* | osf4* | osf5*)
version_type=osf
+ need_version=no
soname_spec='${libname}${release}.so'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
shlibpath_var=LD_LIBRARY_PATH
- # deplibs_check_method='pass_all'
- # Although pass_all appears to work, it copies symbols from static libraries
- # into shared ones and exports them. So, when a program is linked with two
- # or more libraries that have got copies of the same symbols, link fails
- # This was only tested on osf4:
+ # this will be overridden with pass_all, but let us keep it just in case
deplibs_check_method='file_magic COFF format alpha shared library'
file_magic_cmd=/usr/bin/file
file_magic_test_file=/shlib/libc.so
+ deplibs_check_method='pass_all'
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
@@ -1857,7 +2063,7 @@ sunos4*)
need_version=yes
;;
-sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
@@ -1866,6 +2072,15 @@ sysv4.2uw2* | sysv4.3* | sysv5*)
ncr)
deplibs_check_method='pass_all'
;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
esac
;;
@@ -1885,6 +2100,15 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='$libname.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
*)
dynamic_linker=no
;;
@@ -1895,6 +2119,17 @@ test "$dynamic_linker" = no && can_build_shared=no
# Report the final consequences.
echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
+# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
+# configure.in, otherwise build static only libraries.
+case "$host_os" in
+cygwin* | mingw* | os2*)
+ if test x$can_build_shared = xyes; then
+ test x$enable_win32_dll = xno && can_build_shared=no
+ echo "checking if package supports dlls... $can_build_shared" 1>&6
+ fi
+;;
+esac
+
if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
case "$deplibs_check_method" in
"file_magic "*)
@@ -1973,90 +2208,95 @@ if test "x$enable_dlopen" != xyes; then
else
if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
lt_cv_dlopen=no lt_cv_dlopen_libs=
-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "$progname:1977: checking for dlopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "$progname:2212: 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
else
- cat > conftest.$ac_ext <<EOF
-#line 1982 "ltconfig"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen(); below. */
-#include <assert.h>
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2220 "ltconfig"
/* 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. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dlopen();
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_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-dlopen();
-#endif
-
+dlopen()
; return 0; }
EOF
-if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_dlopen=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_dlopen=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "$progname:2022: 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 "checking for dlopen""... $ac_c" 1>&6
+echo "$progname:2252: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-ldl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2030 "ltconfig"
+ cat > conftest.$ac_ext <<EOF
+#line 2257 "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); 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. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dlopen();
int main() {
-dlopen()
+
+/* 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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
; return 0; }
EOF
-if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2282: \"$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"
+ eval "ac_cv_func_dlopen=yes"
else
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ eval "ac_cv_func_dlopen=no"
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
echo "$ac_t""yes" 1>&6
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ lt_cv_dlopen="dlopen"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "$progname:2059: checking for dld_link in -ldld" >&5
+echo "$progname:2299: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2064,17 +2304,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2067 "ltconfig"
+#line 2307 "ltconfig"
/* 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. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dld_link();
int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo $progname:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2320: \"$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
@@ -2093,18 +2336,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "$progname:2096: checking for shl_load" >&5
+echo "$progname:2339: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2101 "ltconfig"
+#line 2344 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); 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. */
+#ifdef __cplusplus
+extern "C"
+#endif
char shl_load();
int main() {
@@ -2120,7 +2366,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -2137,54 +2383,50 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
lt_cv_dlopen="shl_load"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6
-echo "$progname:2141: checking for LoadLibrary" >&5
-if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then
+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "$progname:2387: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | 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
- cat > conftest.$ac_ext <<EOF
-#line 2146 "ltconfig"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char LoadLibrary(); below. */
-#include <assert.h>
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2395 "ltconfig"
+#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 LoadLibrary();
-
-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_LoadLibrary) || defined (__stub___LoadLibrary)
-choke me
-#else
-LoadLibrary();
+#ifdef __cplusplus
+extern "C"
#endif
+char shl_load();
+int main() {
+shl_load()
; return 0; }
EOF
-if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_LoadLibrary=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_LoadLibrary=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
echo "$ac_t""no" 1>&6
fi
-
+
fi
@@ -2207,17 +2449,17 @@ fi
for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "$progname:2210: checking for $ac_hdr" >&5
+echo "$progname:2452: 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 2215 "ltconfig"
+#line 2457 "ltconfig"
#include <$ac_hdr>
int fnord = 0;
EOF
-ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_try="$ac_compile >/dev/null 2>conftest.out"
+{ (eval echo $progname:2462: \"$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*
@@ -2245,7 +2487,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:2248: checking whether a program can dlopen itself" >&5
+echo "$progname:2490: checking whether a program can dlopen itself" >&5
if test "${lt_cv_dlopen_self+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2253,7 +2495,7 @@ else
lt_cv_dlopen_self=cross
else
cat > conftest.c <<EOF
-#line 2256 "ltconfig"
+#line 2498 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2296,10 +2538,10 @@ else
fnord() { int i=42;}
main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 || ptr2) exit(0); } exit(1); }
+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self=yes
else
@@ -2318,7 +2560,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5
+echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5
if test "${lt_cv_dlopen_self_static+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2326,7 +2568,7 @@ else
lt_cv_dlopen_self_static=cross
else
cat > conftest.c <<EOF
-#line 2329 "ltconfig"
+#line 2571 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2369,10 +2611,10 @@ else
fnord() { int i=42;}
main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 || ptr2) exit(0); } exit(1); }
+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self_static=yes
else
@@ -2416,8 +2658,10 @@ LTCONFIG_VERSION="$VERSION"
case "$ltmain" in
*.sh)
# Now quote all the things that may contain metacharacters.
- for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
- old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
+ for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
+ old_LD old_LDFLAGS old_LIBS \
+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
+ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
reload_flag reload_cmds wl \
pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
thread_safe_flag_spec whole_archive_flag_spec libname_spec \
@@ -2462,7 +2706,7 @@ case "$ltmain" in
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
# Copyright (C) 1996-1999 Free Software Foundation, Inc.
-# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
@@ -2488,7 +2732,7 @@ Xsed="sed -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
### BEGIN LIBTOOL CONFIG
EOF
@@ -2497,8 +2741,9 @@ EOF
*)
# Double-quote the variables that need it (for aesthetics).
- for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
- old_LN_S old_DLLTOOL old_AS; do
+ for var in old_CC old_CFLAGS old_CPPFLAGS \
+ old_LD old_LDFLAGS old_LIBS \
+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
eval "$var=\\\"\$var\\\""
done
@@ -2518,8 +2763,9 @@ cat <<EOF >> "$cfgfile"
# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
-# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
-# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
+# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
+# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
+# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
# $0$ltconfig_args
#
# Compiler and other test output produced by $progname, useful for
@@ -2565,6 +2811,9 @@ NM=$NM
# Used on cygwin: DLL creation program.
DLLTOOL="$DLLTOOL"
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
# Used on cygwin: assembler.
AS="$AS"
@@ -2584,10 +2833,13 @@ objext="$objext"
# Old archive suffix (normally "a").
libext="$libext"
+# Executable file suffix (normally "").
+exeext="$exeext"
+
# Additional compiler flags for building library objects.
pic_flag=$pic_flag
-# Does compiler simultaneously support -c and -o options
+# Does compiler simultaneously support -c and -o options?
compiler_c_o=$compiler_c_o
# Can we write directly to a .lo ?
@@ -2657,7 +2909,7 @@ postuninstall_cmds=$postuninstall_cmds
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$deplibs_check_method
-# Command to use when deplibs_check_method == file_magic
+# Command to use when deplibs_check_method == file_magic.
file_magic_cmd=$file_magic_cmd
# Flag that allows shared libraries with undefined symbols to be built.
@@ -2718,16 +2970,16 @@ sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
fix_srcfile_path="$fix_srcfile_path"
-# Set to yes if exported symbols are required
+# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols
-# The command to extract exported symbols
+# The commands to list exported symbols.
export_symbols_cmds=$export_symbols_cmds
-# Symbols that should not be listed in the preloaded symbols
+# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$exclude_expsyms
-# Symbols that must always be exported
+# Symbols that must always be exported.
include_expsyms=$include_expsyms
EOF
@@ -2743,7 +2995,7 @@ case "$ltmain" in
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
-if test "${COLLECT_NAMES+set}" != set; then
+if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -2752,7 +3004,11 @@ EOF
esac
# Append the ltmain.sh script.
- cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
+ sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
chmod +x "$ofile"
;;
diff --git a/ltmain.sh b/ltmain.sh
index 878787a3c..c32939ee8 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,8 +1,8 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
#
-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
-# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+# Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
@@ -28,12 +28,8 @@ if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
+ # Avoid inline document here, it may be left over
+ :
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
@@ -42,6 +38,15 @@ else
exec $SHELL "$0" --no-reexec ${1+"$@"}
fi
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
# The name of this program.
progname=`$echo "$0" | sed 's%^.*/%%'`
modename="$progname"
@@ -49,8 +54,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.2f
-TIMESTAMP=" (1.33 1999/04/26 16:28:53)"
+VERSION=1.3.4
+TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -64,7 +69,7 @@ rm="rm -f"
Xsed='sed -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
SP2NL='tr \040 \012'
-NL2SP='tr \012 \040'
+NL2SP='tr \015\012 \040\040'
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
@@ -100,6 +105,7 @@ show="$echo"
show_help=
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
# Parse our command line options once, thoroughly.
while test $# -gt 0
@@ -429,7 +435,13 @@ compiler."
fbsd_hideous_sh_bug=$base_compile
# All platforms use -DPIC, to notify preprocessed assembler code.
- command="$base_compile $pic_flag -DPIC $srcfile"
+ # However, make sure we only set it for non-Java code.
+ case "$srcfile" in
+ *.java|*.class)
+ command="$base_compile $pic_flag $srcfile";;
+ *)
+ command="$base_compile $srcfile $pic_flag -DPIC";;
+ esac
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@@ -460,6 +472,7 @@ compiler."
command="$command -o $output_obj"
fi
+ $run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
@@ -514,9 +527,17 @@ compiler."
exit $error
fi
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
+ libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
- $show "$LN_S $obj $lo_libobj"
- if $run $LN_S $obj $lo_libobj; then
+ $show "(cd $xdir && $LN_S $baseobj $libobj)"
+ if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
exit 0
else
error=$?
@@ -539,6 +560,7 @@ compiler."
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
+ $run $rm "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
@@ -606,9 +628,18 @@ compiler."
link)
modename="$modename: link"
C_compiler="$CC" # save it, to compile generated C sources
- # CYGNUS LOCAL: tromey/java
# Always respect the CC configured in by ltconfig.
- # CC="$nonopt"
+ CC="$nonopt"
+ # CYGNUS LOCAL: tromey/java
+ # Add -B options to link line.
+ for arg
+ do
+ case "$arg" in
+ -B*)
+ CC="$CC $arg"
+ ;;
+ esac
+ done
# END CYGNUS LOCAL
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*)
@@ -633,10 +664,24 @@ compiler."
# #undef WIN32_LEAN_AND_MEAN
# #include <stdio.h>
#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
#
+# #ifdef __CYGWIN__
# #include <cygwin/cygwin_dll.h>
# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
# HINSTANCE __hDllInstance_base;
#
# BOOL APIENTRY
@@ -783,8 +828,8 @@ compiler."
allow_undefined=yes
;;
esac
- compile_command="$CC"
- finalize_command="$CC"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
@@ -818,6 +863,7 @@ compiler."
ltlibs=
module=no
objs=
+ prefer_static_libs=no
preload=no
prev=
prevarg=
@@ -834,11 +880,21 @@ compiler."
do
case "$arg" in
-all-static | -static)
- if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
fi
build_libtool_libs=no
build_old_libs=yes
+ prefer_static_libs=yes
break
;;
esac
@@ -871,18 +927,32 @@ compiler."
fi
case "$arg" in
*.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
self)
if test "$prev" = dlprefiles; then
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
fi
prev=
continue
;;
*)
- dlprefiles="$dlprefiles $arg"
- test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
prev=
;;
esac
@@ -906,13 +976,26 @@ compiler."
prev=
continue
;;
- rpath)
- rpath="$rpath $arg"
- prev=
- continue
- ;;
- xrpath)
- xrpath="$xrpath $arg"
+ rpath | xrpath)
+ # We need an absolute path.
+ case "$arg" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
prev=
continue
;;
@@ -931,7 +1014,6 @@ compiler."
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
- dlopen_self=$dlopen_self_static
fi
continue
;;
@@ -958,22 +1040,16 @@ compiler."
;;
-export-dynamic)
- if test "$export_dynamic" != yes; then
- export_dynamic=yes
- if test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- else
- arg=
- fi
- fi
+ export_dynamic=yes
+ continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: cannot have more than one -exported-symbols"
+ $echo "$modename: not more than one -exported-symbols argument allowed"
exit 1
fi
- if test "$arg" = "-export-symbols"; then
+ if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
@@ -982,14 +1058,18 @@ compiler."
;;
-L*)
- dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
case "$dir" in
- /* | [A-Za-z]:[/\\]*)
- # Add the corresponding hardcode_libdir_flag, if it is not identical.
- ;;
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
- exit 1
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
+ fi
+ dir="$absdir"
;;
esac
case " $deplibs " in
@@ -1013,20 +1093,29 @@ compiler."
;;
-l*)
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # These systems don't actually have c library (as such)
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lm"; then
+ case "$host" in
+ *-*-cygwin* | *-*-beos*)
+ # These systems don't actually have math library (as such)
+ continue
+ ;;
+ esac
+ fi
deplibs="$deplibs $arg"
;;
-module)
- if test "$module" != yes; then
- module=yes
- if test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- else
- arg=
- fi
- fi
+ module=yes
+ continue
;;
-
+
-no-undefined)
allow_undefined=no
continue
@@ -1050,7 +1139,19 @@ compiler."
;;
-R*)
- xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
continue
;;
@@ -1059,7 +1160,6 @@ compiler."
if test -z "$pic_flag" && test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
- dlopen_self=$dlopen_self_static
fi
continue
;;
@@ -1131,6 +1231,7 @@ compiler."
# it will not redefine variable installed.
installed=yes
+ # Read the .la file
# If there is no directory component, then add one.
case "$arg" in
*/* | *\\*) . $arg ;;
@@ -1163,7 +1264,7 @@ compiler."
fi
if test -n "$dependency_libs"; then
- # Extract -R from dependency_libs
+ # Extract -R and -L from dependency_libs
temp_deplibs=
for deplib in $dependency_libs; do
case "$deplib" in
@@ -1175,7 +1276,13 @@ compiler."
-L*) case "$compile_command $temp_deplibs " in
*" $deplib "*) ;;
*) temp_deplibs="$temp_deplibs $deplib";;
- esac;;
+ esac
+ temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ case " $lib_search_path " in
+ *" $temp_dir "*) ;;
+ *) lib_search_path="$lib_search_path $temp_dir";;
+ esac
+ ;;
*) temp_deplibs="$temp_deplibs $deplib";;
esac
done
@@ -1221,7 +1328,8 @@ compiler."
prev=
fi
- if test "$build_libtool_libs" = yes && test -n "$library_names"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
link_against_libtool_libs="$link_against_libtool_libs $arg"
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
@@ -1233,12 +1341,13 @@ compiler."
# We need an absolute path.
case "$dir" in
- /* | [A-Za-z]:[/\\]*) absdir="$dir" ;;
+ [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
- $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2
- exit 1
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
fi
;;
esac
@@ -1247,24 +1356,24 @@ compiler."
# Skip directories that are in the system default run-time
# search path, unless they have been requested with -R.
case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
+ *" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
- esac
+ esac
case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
+ *" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
- esac
+ esac
lib_linked=yes
case "$hardcode_action" in
@@ -1422,6 +1531,12 @@ compiler."
exit 1
fi
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
@@ -1444,7 +1559,7 @@ compiler."
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
- if test -n "$dlfiles$dlprefiles"; then
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
@@ -1464,7 +1579,7 @@ compiler."
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
- if test -n "$export_symbols"; then
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi
@@ -1503,11 +1618,6 @@ compiler."
output_objdir="$output_objdir/$objdir"
fi
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
if test -n "$objs"; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
exit 1
@@ -1519,7 +1629,7 @@ compiler."
exit 1
fi
- if test -n "$dlfiles$dlprefiles"; then
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
fi
@@ -1702,7 +1812,7 @@ compiler."
dependency_libs="$deplibs"
case "$host" in
- *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*)
@@ -1750,12 +1860,13 @@ compiler."
droppeddeps=no
case "$deplibs_check_method" in
pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behaviour.
newdeplibs=$deplibs
- ;; # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behaviour.
+ ;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
@@ -1766,7 +1877,7 @@ compiler."
int main() { return 0; }
EOF
$rm conftest
- $C_compiler -o conftest conftest.c $deplibs
+ $CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
@@ -1799,24 +1910,24 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" ; then
$rm conftest
- $C_compiler -o conftest conftest.c $i
+ $CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- echo
- echo "*** Warning: This library needs some functionality provided by $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
- fi
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
else
droppeddeps=yes
echo
@@ -1830,7 +1941,6 @@ EOF
fi
done
fi
- deplibs=$newdeplibs
;;
file_magic*)
set dummy $deplibs_check_method
@@ -1844,7 +1954,7 @@ EOF
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
- if ls -lLd "$potlib" 2>/dev/null \
+ if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then
continue
fi
@@ -1857,11 +1967,11 @@ EOF
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
case "$potliblink" in
- /*) potlib="$potliblink";;
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
- if eval $file_magic_cmd \"\$potlib\" \
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| sed 10q \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
@@ -1884,7 +1994,8 @@ EOF
fi
done # Gone through all deplibs.
;;
- none | unknown | *) newdeplibs=""
+ none | unknown | *)
+ newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
grep . >/dev/null; then
@@ -1926,21 +2037,23 @@ EOF
else
build_libtool_libs=no
fi
- dlname=
- library_names=
else
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
fi
fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
fi
- # test again, we may have decided not to build it any more
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- deplibs=$newdeplibs
- # Done checking deplibs!
-
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
set dummy $library_names
@@ -1960,52 +2073,30 @@ EOF
done
# Ensure that we have .o objects for linkers which dislike .lo
- # (e.g. aix) incase we are running --disable-static
+ # (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
- oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
- test -f $oldobj || ${LN_S} $obj $oldobj
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+ if test ! -f $xdir/$oldobj; then
+ $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+ $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
+ fi
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- if test -n "$whole_archive_flag_spec"; then
- if test -n "$convenience"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- fi
- else
- for xlib in $convenience; do
- # Extract the objects.
- xdir="$xlib"x
- generated="$generated $xdir"
- xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-
- $show "${rm}r $xdir"
- $run ${rm}r "$xdir"
- $show "mkdir $xdir"
- $run mkdir "$xdir"
- status=$?
- if test $status -ne 0 && test ! -d "$xdir"; then
- exit $status
- fi
- $show "(cd $xdir && $AR x ../$xlib)"
- $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
-
- libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
- done
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
-
- linkopts="$linkopts $flag"
- fi
-
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
$show "generating symbol list for \`$libname.la'"
- export_symbols="$objdir/$libname.exp"
+ export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
@@ -2028,6 +2119,51 @@ EOF
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linkopts="$linkopts $flag"
+ fi
+
# Do each of the archive commands.
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
@@ -2068,7 +2204,7 @@ EOF
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
- if test -n "$dlfiles$dlprefiles"; then
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
fi
@@ -2106,8 +2242,58 @@ EOF
# Delete the old objects.
$run $rm $obj $libobj
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
# Create the old-style object.
- reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
output="$obj"
eval cmds=\"$reload_cmds\"
@@ -2120,9 +2306,21 @@ EOF
IFS="$save_ifs"
# Exit if we aren't doing a library object file.
- test -z "$libobj" && exit 0
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
$show "echo timestamp > $libobj"
@@ -2132,7 +2330,7 @@ EOF
if test -n "$pic_flag"; then
# Only do commands if we really have different PIC objects.
- reload_objs="$libobjs"
+ reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
eval cmds=\"$reload_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
@@ -2146,8 +2344,21 @@ EOF
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
- $show "$LN_S $obj $libobj"
- $run $LN_S $obj $libobj || exit $?
+ xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$libobj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+ $show "(cd $xdir && $LN_S $oldobj $baseobj)"
+ $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
fi
exit 0
@@ -2170,11 +2381,6 @@ EOF
fi
fi
- if test "$dlself" = yes && test "$export_dynamic" = no; then
- $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
- exit 1
- fi
-
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
@@ -2210,7 +2416,6 @@ EOF
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
-
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
@@ -2247,7 +2452,6 @@ EOF
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
-
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
@@ -2272,6 +2476,16 @@ EOF
output_objdir="$output_objdir/$objdir"
fi
+ # Create the binary in the object directory, then wrap it.
+ if test ! -d $output_objdir; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
@@ -2279,7 +2493,7 @@ EOF
fi
dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
@@ -2292,24 +2506,15 @@ EOF
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
- nlist="$objdir/${output}.nm"
+ nlist="$output_objdir/${outputname}.nm"
- if test -d $objdir; then
- $show "$rm $nlist ${nlist}S ${nlist}T"
- $run $rm "$nlist" "${nlist}S" "${nlist}T"
- else
- $show "$mkdir $objdir"
- $run $mkdir $objdir
- status=$?
- if test $status -ne 0 && test ! -d $objdir; then
- exit $status
- fi
- fi
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
# Parse the name list into a source file.
- $show "creating $objdir/$dlsyms"
+ $show "creating $output_objdir/$dlsyms"
- $echo > "$objdir/$dlsyms" "\
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
@@ -2326,7 +2531,7 @@ extern \"C\" {
if test "$dlself" = yes; then
$show "generating symbol list for \`$output'"
- echo ': @PROGRAM@ ' > "$nlist"
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
@@ -2347,13 +2552,12 @@ extern \"C\" {
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- export_symbols="$objdir/$output.exp"
+ export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
- $run $rm $export_symbols
- $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
- $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
@@ -2429,26 +2633,35 @@ static const void *lt_preloaded_setup() {
fi
pic_flag_for_symtable=
- case "$host" in
+ case "$host" in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*)
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac
esac
# Now compile the dynamic symbol file.
- $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+ $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
@@ -2473,7 +2686,15 @@ static const void *lt_preloaded_setup() {
# We have no uninstalled library dependencies, so finalize right now.
$show "$link_command"
$run eval "$link_command"
- exit $?
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
fi
if test -n "$shlibpath_var"; then
@@ -2481,7 +2702,7 @@ static const void *lt_preloaded_setup() {
rpath=
for dir in $temp_rpath; do
case "$dir" in
- /* | [A-Za-z]:[/\\]*)
+ [\\/]* | [A-Za-z]:[\\/]*)
# Absolute path.
rpath="$rpath$dir:"
;;
@@ -2527,7 +2748,6 @@ static const void *lt_preloaded_setup() {
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
- # AGH! Flame the AIX and HP-UX people for me, will ya?
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
$echo "$modename: \`$output' will be relinked during installation" 1>&2
else
@@ -2548,17 +2768,7 @@ static const void *lt_preloaded_setup() {
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
- # Create the binary in the object directory, then wrap it.
- if test ! -d $output_objdir; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- status=$?
- if test $status -ne 0 && test ! -d $objdir; then
- exit $status
- fi
- fi
-
- # Delete the old output file.
+ # Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
@@ -2575,7 +2785,7 @@ static const void *lt_preloaded_setup() {
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
case "$0" in
- /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";;
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
@@ -2612,7 +2822,7 @@ sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
@@ -2652,7 +2862,7 @@ else
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
- /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
@@ -2790,31 +3000,65 @@ fi\
addlibs="$old_convenience"
fi
- # Add in members from convenience archives.
- for xlib in $addlibs; do
- # Extract the objects.
- xdir="$xlib"x
- generated="$generated $xdir"
- xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-
- $show "${rm}r $xdir"
- $run ${rm}r "$xdir"
- $show "mkdir $xdir"
- $run mkdir "$xdir"
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
status=$?
- if test $status -ne 0 && test ! -d "$xdir"; then
+ if test $status -ne 0 && test ! -d "$gentop"; then
exit $status
fi
- $show "(cd $xdir && $AR x ../$xlib)"
- $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
- oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
- done
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
+ # Ensure that we have .o objects in place in case we decided
+ # not to build a shared library, and have fallen back to building
+ # static libs even though --disable-static was passed!
+ for oldobj in $oldobjs; do
+ if test ! -f $oldobj; then
+ xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$oldobj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+ obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+ $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+ $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+ fi
+ done
+
eval cmds=\"$old_archive_cmds\"
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
@@ -2848,9 +3092,20 @@ fi\
# Only create the output if not a dry run.
if test -z "$run"; then
- $echo > $output "\
-# $output - a libtool library file
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ fi
+ $rm $output
+ $echo > $output "\
+# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$dlname'
@@ -2870,15 +3125,12 @@ age=$age
revision=$revision
# Is this an already installed library?
-installed=no
+installed=$installed
# Directory that this library needs to be installed in:
libdir='$install_libdir'\
"
-
- $rm "$output_objdir/$outputname"i
- sed 's/^installed=no$/installed=yes/' \
- < "$output" > "$output_objdir/$outputname"i || exit 1
+ done
fi
# Do a symbolic link so that the libtool archive can be found in
@@ -3015,7 +3267,7 @@ libdir='$install_libdir'\
fi
fi
case "$destdir" in
- /* | [A-Za-z]:[/\\]*) ;;
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case "$file" in
@@ -3091,13 +3343,11 @@ libdir='$install_libdir'\
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$realname $destdir/$realname"
$run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
- test "X$dlname" = "X$realname" && dlname=
if test $# -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
- test "X$dlname" = "X$linkname" && dlname=
if test "$linkname" != "$realname"; then
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
@@ -3105,12 +3355,6 @@ libdir='$install_libdir'\
done
fi
- if test -n "$dlname"; then
- # Install the dynamically-loadable library.
- $show "$install_prog $dir/$dlname $destdir/$dlname"
- $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
- fi
-
# Do each command in the postinstall commands.
lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\"
@@ -3126,12 +3370,6 @@ libdir='$install_libdir'\
# Install the pseudo-library for information purposes.
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
- if test ! -f "$instname"; then
- # Just in case it was removed...
- $show "Creating $instname"
- $rm "$instname"
- sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
- fi
$show "$install_prog $instname $destdir/$name"
$run eval "$install_prog $instname $destdir/$name" || exit $?
@@ -3229,21 +3467,29 @@ libdir='$install_libdir'\
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
- if test "$finalize" = yes; then
- outputname="/tmp/$$-$file"
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
- $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
continue
fi
file="$outputname"
else
- $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
fi
else
# Install the binary that we compiled earlier.
@@ -3253,7 +3499,7 @@ libdir='$install_libdir'\
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && $rm $outputname
+ test -n "$outputname" && ${rm}r "$tmpdir"
;;
esac
done
@@ -3479,8 +3725,10 @@ libdir='$install_libdir'\
done
if test -z "$run"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
@@ -3497,8 +3745,10 @@ libdir='$install_libdir'\
exit 1
else
# Display what would be done.
- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
- $echo "export $shlibpath_var"
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
$echo "$cmd$args"
exit 0
fi
@@ -3540,9 +3790,7 @@ libdir='$install_libdir'\
# Delete the libtool libraries and symlinks.
for n in $library_names; do
rmfiles="$rmfiles $dir/$n"
- test "X$n" = "X$dlname" && dlname=
done
- test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
$show "$rm $rmfiles"
@@ -3721,6 +3969,8 @@ The following components of LINK-COMMAND are treated specially:
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
@@ -3751,7 +4001,7 @@ is created, otherwise an executable program is created."
;;
uninstall)
- $echo
+ $echo \
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
diff --git a/makeall.bat b/makeall.bat
deleted file mode 100644
index d2d415f0a..000000000
--- a/makeall.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-chdir libiberty
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\bfd
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\opcodes
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\gprof
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\binutils
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\gas
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..\ld
-make %1 %2 %3 %4 %5 %6 %7 %8 %9
-chdir ..
diff --git a/mkdep b/mkdep
new file mode 100755
index 000000000..3c5b508f1
--- /dev/null
+++ b/mkdep
@@ -0,0 +1,87 @@
+#!/bin/sh -
+#
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley. The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+# @(#)mkdep.sh 5.12 (Berkeley) 6/30/88
+#
+
+MAKE=Makefile # default makefile name is "Makefile"
+
+while :
+ do case "$1" in
+ # -f allows you to select a makefile name
+ -f)
+ MAKE=$2
+ shift; shift ;;
+
+ # the -p flag produces "program: program.c" style dependencies
+ # so .o's don't get produced
+ -p)
+ SED='s;\.o;;'
+ shift ;;
+ *)
+ break ;;
+ esac
+done
+
+if [ $# = 0 ] ; then
+ echo 'usage: mkdep [-p] [-f makefile] [flags] file ...'
+ exit 1
+fi
+
+if [ ! -w $MAKE ]; then
+ echo "mkdep: no writeable file \"$MAKE\""
+ exit 1
+fi
+
+TMP=/tmp/mkdep$$
+
+trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
+
+cp $MAKE ${MAKE}.bak
+
+sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP
+
+cat << _EOF_ >> $TMP
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+_EOF_
+
+# If your compiler doesn't have -M, add it. If you can't, the next two
+# lines will try and replace the "cc -M". The real problem is that this
+# hack can't deal with anything that requires a search path, and doesn't
+# even try for anything using bracket (<>) syntax.
+#
+# egrep '^#include[ ]*".*"' /dev/null $* |
+# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
+
+gcc -MM $* |
+sed "
+ s; \./; ;g
+ $SED" >> $TMP
+
+cat << _EOF_ >> $TMP
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+_EOF_
+
+# copy to preserve permissions
+cp $TMP $MAKE
+rm -f ${MAKE}.bak $TMP
+exit 0
+
+
diff --git a/texinfo/texinfo.tex b/texinfo/texinfo.tex
new file mode 100644
index 000000000..7d3a33c23
--- /dev/null
+++ b/texinfo/texinfo.tex
@@ -0,0 +1,5431 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+% $Id$
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://tug.org/tex/texinfo.tex
+% ftp://ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@ctan.org for a list).
+% The texinfo.tex in the texinfo distribution itself could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org.
+% Please include a precise test case in each bug report,
+% including a complete document with which we can reproduce the problem.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For simple
+% manuals, however, you can get away with:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+
+
+% Make it possible to create a .fmt file just by loading this file:
+% if the underlying format is not loaded, start by loading it now.
+% Added by gildea November 1993.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+
+% This automatically updates the version number based on RCS.
+\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
+\deftexinfoversion$Revision$
+\message{Loading texinfo package [Version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+ \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi
+\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+\hyphenation{white-space}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
+\def\loggingall{\tracingcommands2 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ \shipout\vbox{%
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \turnoffactive
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+ \let\next = #1%
+ \begingroup
+ \obeylines
+ \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse. Otherwise, we're done.
+\def\parseargx{%
+ % \obeyedspace is defined far below, after the definition of \sepspaces.
+ \ifx\obeyedspace\temp
+ \expandafter\parseargdiscardspace
+ \else
+ \expandafter\parseargline
+ \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ %
+ % First remove any @c comment, then any @comment.
+ % Result of each macro is put in \toks0.
+ \argremovec #1\c\relax %
+ \expandafter\argremovecomment \the\toks0 \comment\relax %
+ %
+ % Call the caller's macro, saved as \next in \parsearg.
+ \expandafter\next\expandafter{\the\toks0}%
+ }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us. The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% @end itemize @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'. Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands. (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.) But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+ \begingroup
+ \ignoreactivespaces
+ \edef\temp{#1}%
+ \global\toks0 = \expandafter{\temp}%
+ \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+ \obeyspaces
+ \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo is the same as @foo, for now.
+\newhelp\EMsimple{Press RETURN to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+ \removeactivespaces{#1}%
+ \edef\endthing{\the\toks0}%
+ %
+ \expandafter\ifx\csname E\endthing\endcsname\relax
+ \expandafter\ifx\csname \endthing\endcsname\relax
+ % There's no \foo, i.e., no ``environment'' foo.
+ \errhelp = \EMsimple
+ \errmessage{Undefined command `@end \endthing'}%
+ \else
+ \unmatchedenderror\endthing
+ \fi
+ \else
+ % Everything's ok; the right environment has been started.
+ \csname E\endthing\endcsname
+ \fi
+}
+
+% There is an environment #1, but it hasn't been started. Give an error.
+%
+\def\unmatchedenderror#1{%
+ \errhelp = \EMsimple
+ \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+ \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+ % Why was this kern here? It messes up equalizing space above and below
+ % environments. --karl, 6may93
+ %{\advance \baselineskip by -\singlespaceskip
+ %\kern \baselineskip}%
+ \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce actual \{ & \} command in an index.
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\@ = 0 \catcode`\\ = 12
+ @gdef@lbracecmd[\{]%
+ @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=3000 }
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+ \ifnum\catcode13=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ %
+ % The \vtop we start below produces a box with normal height and large
+ % depth; thus, TeX puts \baselineskip glue before it, and (when the
+ % next line of text is done) \lineskip glue after it. (See p.82 of
+ % the TeXbook.) Thus, space below is not quite equal to space
+ % above. But it's pretty close.
+ \def\Egroup{%
+ \egroup % End the \vtop.
+ \endgroup % End the \group.
+ }%
+ %
+ \vtop\bgroup
+ % We have to put a strut on the last line in case the @group is in
+ % the midst of an example, rather than completely enclosing it.
+ % Otherwise, the interline space between the last line of the group
+ % and the first line afterwards is too small. But we can't put the
+ % strut in \Egroup, since there it would be on a line by itself.
+ % Hence this just inserts a strut at the beginning of each line.
+ \everypar = {\strut}%
+ %
+ % Since we have a strut on every line, we don't need any of TeX's
+ % normal interline spacing.
+ \offinterlineskip
+ %
+ % OK, but now we have to do something about blank
+ % lines in the input in @example-like environments, which normally
+ % just turn into \lisppar, which will insert no space now that we've
+ % turned off the interline space. Simplest is to make them be an
+ % empty paragraph.
+ \ifx\par\lisppar
+ \edef\par{\leavevmode \par}%
+ %
+ % Reset ^^M's definition to new definition of \par.
+ \obeylines
+ \fi
+ %
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+ % Go into vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % Don't add any leading before our big empty box, but allow a page
+ % break, since the best break might be right here.
+ \allowbreak
+ \nointerlineskip
+ \vtop to #1\mil{\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+}
+
+% @br forces paragraph break
+
+\let\br = \par
+
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
+
+
+% @page forces the start of a new page
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
+
+\def\inmargin#1{%
+\strut\vadjust{\nobreak\kern-\strutdepth
+ \vtop to \strutdepth{\baselineskip\strutdepth\vss
+ \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+
+%\hbox{{\rm#1}}\hfil\break}}
+
+% @include file insert text of that file as input.
+% Allow normal characters that we make active in the argument (a file name).
+\def\include{\begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+ % Read the included file in a group so nested @include's work.
+ \def\thisfile{#1}%
+ \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent is defined for the Info formatting commands only.
+\let\paragraphindent=\comment
+
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+\let\chapter=\relax
+\let\unnumbered=\relax
+\let\top=\relax
+\let\unnumberedsec=\relax
+\let\unnumberedsection=\relax
+\let\unnumberedsubsec=\relax
+\let\unnumberedsubsection=\relax
+\let\unnumberedsubsubsec=\relax
+\let\unnumberedsubsubsection=\relax
+\let\section=\relax
+\let\subsec=\relax
+\let\subsubsec=\relax
+\let\subsection=\relax
+\let\subsubsection=\relax
+\let\appendix=\relax
+\let\appendixsec=\relax
+\let\appendixsection=\relax
+\let\appendixsubsec=\relax
+\let\appendixsubsection=\relax
+\let\appendixsubsubsec=\relax
+\let\appendixsubsubsection=\relax
+\let\contents=\relax
+\let\smallbook=\relax
+\let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
+ \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
+ \let\tensf = \nullfont
+ % Similarly for index fonts (mostly for their use in
+ % smallexample)
+ \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
+ \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
+ \let\indsf = \nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+%
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']v}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written. Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo). So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{fonts,}
+% Font-change commands.
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices and small examples (9pt).
+% We actually use the slanted font rather than the italic,
+% because texinfo normally uses the slanted fonts for that.
+% Do not make many font distinctions in general in the index, since they
+% aren't very useful.
+\setfont\ninett\ttshape{9}{1000}
+\setfont\ninettsl\ttslshape{10}{900}
+\setfont\indrm\rmshape{9}{1000}
+\setfont\indit\itshape{9}{1000}
+\setfont\indsl\slshape{9}{1000}
+\let\indtt=\ninett
+\let\indttsl=\ninettsl
+\let\indsf=\indrm
+\let\indbf=\indrm
+\setfont\indsc\scshape{10}{900}
+\font\indi=cmmi9
+\font\indsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+ \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+ \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example. By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \resetmathfonts}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\indexfonts{%
+ \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
+ \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
+ \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
+ \resetmathfonts \setleading{12pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+\let\cite=\smartslanted
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+ {\tt \rawbackslash \frenchspacing #1}%
+ \null
+}
+\let\ttfont=\t
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\smallrm\rmshape{8}{1000}
+\font\smallsy=cmsy9
+\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \frenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional second argument
+% specifying the text to display. First (mandatory) arg is the url.
+% Perhaps eventually put in a hypertex \special here.
+%
+\def\uref#1{\urefxxx #1,,\finish}
+\def\urefxxx#1,#2,#3\finish{%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \unhbox0\ (\code{#1})%
+ \else
+ \code{#1}%
+ \fi
+}
+
+% rms does not like the angle brackets --karl, 17may97.
+% So now @email is just like @uref.
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\let\email=\uref
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @contentsaftertitlepage or @shortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+ \let\subtitlerm=\tenrm
+ \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+ %
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ %
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ %
+ % Now you can print the title using @title.
+ \def\title{\parsearg\titlezzz}%
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Now you can put text using @subtitle.
+ \def\subtitle{\parsearg\subtitlezzz}%
+ \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+ %
+ % @author should come last, but may come many times.
+ \def\author{\parsearg\authorzzz}%
+ \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+ {\authorfont \leftline{##1}}}%
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \oldpage
+ \let\page = \oldpage
+ \hbox{}}%
+% \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
+
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+%
+}% unbind the catcode of @.
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% Produces Day Month Year style of output.
+\def\today{\number\day\space
+\ifcase\month\or
+January\or February\or March\or April\or May\or June\or
+July\or August\or September\or October\or November\or December\fi
+\space\number\year}
+
+% Use this if you want the Month Day, Year style of output.
+%\def\today{\ifcase\month\or
+%January\or February\or March\or April\or May\or June\or
+%July\or August\or September\or October\or November\or December\fi
+%\space\number\day, \number\year}
+
+% @settitle line... specifies the title of the document, for headings
+% It generates no output of its own
+
+\def\thistitle{No Title}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+ \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+ \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemfont{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. Unfortunately
+ % we can't prevent a possible page break at the following
+ % \baselineskip glue.
+ \nobreak
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+% Contains a kludge to get @end[description] to work.
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+% @table, @ftable, @vtable.
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1 \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1 \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1 \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+ \begingroup % ended by the @end itemize
+ \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+ \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ \begingroup % ended by the @end enumerate
+ %
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+% @multitable {Column 1 template} {Column 2 template} {Column 3
+% template}
+% Not:
+% @multitable {Column 1 template} {Column 2 template}
+% {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% 2/1/96, to allow fractions to be given with more than one digit.
+\def\pickupwholefraction#1 {\global\advance\colcount by1 %
+\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
+\setuptable}
+
+\newcount\colcount
+\def\setuptable#1{\def\firstarg{#1}%
+\ifx\firstarg\xendsetuptable\let\go\relax%
+\else
+ \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction % In this case arg of setuptable
+ % is the decimal point before the
+ % number given in percent of hsize.
+ % We don't need this so we don't use it.
+ \else
+ \global\advance\colcount by1
+ \setbox0=\hbox{#1 }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi%
+ \fi%
+\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
+\fi\go}
+
+% multitable syntax
+\def\tab{&\hskip1sp\relax} % 2/2/96
+ % tiny skip here makes sure this column space is
+ % maintained, even if it is never used.
+
+% @multitable ... @end multitable definitions:
+
+\def\multitable{\parsearg\dotable}
+\def\dotable#1{\bgroup
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\else
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}
+}
+
+\def\defcodeindex{\parsearg\newcodeindex}
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+% The \closeout helps reduce unnecessary open files; the limit on the
+% Acorn RISC OS is a mere 16 files.
+\def\synindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\doindex{#2}}%
+}
+
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+\def\syncodeindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\docodeindex{#2}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+\def\ { }%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+%\let\{ = \lbracecmd
+%\let\} = \rbracecmd
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
+\unsepspaces
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+ @gdef@realbackslash{\}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \fi
+ {%
+ \count255=\lastpenalty
+ {%
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ {%
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
+ \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index-string with all font commands turned off
+ % to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ %
+ % Now produce the complete index entry, with both the sort key and the
+ % original text, including any font commands.
+ \toks0 = {#2}%
+ \edef\temp{%
+ \write\csname#1indfile\endcsname{%
+ \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+ }%
+ %
+ % If third (subentry) arg is present, add it to the index string.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = {#3}%
+ \edef\temp{\temp{\the\toks0}}%
+ \fi
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
+ }%
+ }%
+ \penalty\count255
+ }%
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\def\printindex{\parsearg\doprintindex}
+\def\doprintindex#1{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \indexfonts \rm
+ \tolerance = 9500
+ \indexbreaks
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ (Index is nonexistent)
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ (Index is empty)
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin. It is used for index and table of contents
+% entries. The paragraph is indented by \leftskip.
+%
+\def\entry#1#2{\begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
+ % Start a ``paragraph'' for the index entry so the line breaking
+ % parameters we've set above will have an effect.
+ \noindent
+ %
+ % Insert the text of the index entry. TeX will do line-breaking on it.
+ #1%
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#2}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd\ \else%
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ #2% The page number ends the paragraph.
+ \fi%
+ \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {\global\setbox\partialpage = \vbox{%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case, we must prevent the second \partialpage from
+ % simply overwriting the first, causing us to lose the page.
+ % This will preserve it until a real output routine can ship it
+ % out. Generally, \partialpage will be empty when this runs and
+ % this will be a no-op.
+ \unvbox\partialpage
+ %
+ % Unvbox the main output page.
+ \unvbox255
+ \kern-\topskip \kern\baselineskip
+ }}%
+ \eject
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \advance\vsize by -\ht\partialpage
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+\def\pagesofar{%
+ % Re-output the contents of the output page -- any previous material,
+ % followed by the two boxes we just split, in box0 and box2.
+ \advance\vsize by \ht\partialpage
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+\def\enddoublecolumns{%
+ \output = {%
+ % Split the last of the double-column material. Leave on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize.
+ \pagegoal = \vsize
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+}
+\def\balancecolumns{%
+ % Called at the end of the double column material.
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Define chapters, sections, etc.
+
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+\def\appendixletter{\char\the\appendixno}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \chapterzzz{#2}
+\or
+ \seczzz{#2}
+\or
+ \numberedsubseczzz{#2}
+\or
+ \numberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \chapterzzz{#2}
+ \else
+ \numberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \appendixzzz{#2}
+\or
+ \appendixsectionzzz{#2}
+\or
+ \appendixsubseczzz{#2}
+\or
+ \appendixsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \appendixzzz{#2}
+ \else
+ \appendixsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \unnumberedzzz{#2}
+\or
+ \unnumberedseczzz{#2}
+\or
+ \unnumberedsubseczzz{#2}
+\or
+ \unnumberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \unnumberedzzz{#2}
+ \else
+ \unnumberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% @chapter, @appendix, @unnumbered.
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+% @top is like @unnumbered.
+\outer\def\top{\parsearg\unnumberedyyy}
+
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message. Therefore, if #1 contained @-commands, TeX
+% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself. We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% Sections.
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{%
+\plainsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsections.
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsubsections.
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ \def\chapnum{#2}%
+ \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+ \def\centerparametersmaybe{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+ }%
+ \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+ {%
+ \expandafter\advance\csname #1headingskip\endcsname by \parskip
+ \csname #1headingbreak\endcsname
+ }%
+ {%
+ % Switch to the right set of fonts.
+ \csname #1fonts\endcsname \rm
+ %
+ % Only insert the separating space if we have a section number.
+ \def\secnum{#2}%
+ \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ %
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 % zero if no section number
+ \unhbox0 #3}%
+ }%
+ \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc,}
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTableofContents}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortContents}%
+ %
+ \let\chapentry = \shortchapentry
+ \let\unnumbchapentry = \shortunnumberedentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\secentry ##1##2##3##4{}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+\setbox0 = \hbox{\shortcontrm \putwordAppendix }
+\newdimen\shortappendixwidth \shortappendixwidth = \wd0
+
+\def\shortchaplabel#1{%
+ % We typeset #1 in a box of constant width, regardless of the text of
+ % #1, so the chapter titles will come out aligned.
+ \setbox0 = \hbox{#1}%
+ \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+ %
+ % This space should be plenty, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ \advance\dimen0 by 1.1em
+ \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno{#2}}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here. (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+\def\tocentry#1#2{\begingroup
+ \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox \newbox\longdblarrowbox
+\newbox\pushcharbox \newbox\bullbox
+\newbox\equivbox \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+% depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output. Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is. This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt %we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+% side, and for 6pt waste from
+% each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \kern3pt
+ \begingroup
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+\def\Ecartouche{%
+ \endgroup
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \inENV % This group ends at the end of the body
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \singlespace
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ % @cartouche defines \nonarrowing to inhibit narrowing
+ % at next level down.
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \let\exdent=\nofillexdent
+ \let\nonarrowing=\relax
+ \fi
+}
+
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+
+% @lisp: indented, narrowed, typewriter font.
+\def\lisp{\begingroup
+ \nonfillstart
+ \let\Elisp = \nonfillfinish
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+
+% @example: Same as @lisp.
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllispx{\begingroup
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \indexfonts
+ \lisp
+}
+
+% @display: same as @lisp except keep current font.
+%
+\def\display{\begingroup
+ \nonfillstart
+ \let\Edisplay = \nonfillfinish
+ \gobble
+}
+
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \indexfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eformat = \nonfillfinish
+ \gobble
+}
+
+% @smallformat (when @smallbook): @format plus smaller fonts.
+%
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \indexfonts \rm
+ \format
+}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
+\def\flushright{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushright = \nonfillfinish
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+ \begingroup\inENV %This group ends at the end of the @quotation body
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \singlespace
+ \parindent=0pt
+ % We have retained a nonzero parskip for the environment, since we're
+ % doing normal filling. So to avoid extra space below the environment...
+ \def\Equotation{\parskip = 0pt \nonfillfinish}%
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \let\nonarrowing = \relax
+ \fi
+}
+
+
+\message{defuns,}
+% Define formatter for defuns
+% First, allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text. This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\def\ampnr{\&}
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\noindent
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+% such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+% @deftypemethod has an extra argument that nothing else does. Sigh.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody. It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+ \begingroup\inENV %
+ \medbreak %
+ % Define the end token that this defining construct specifies
+ % so that it will exit this group.
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument. Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name. That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any). That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+ #1{\removeemptybraces#2\relax}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+% the first is all of #2 before the space token,
+% the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs #1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+\hyphenchar\tensl=0
+#1%
+\hyphenchar\tensl=45
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Function}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type. #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification. #2 is the data type. #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+% at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Macro}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Special Form}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% This definition is run if you use @defunx
+% anywhere other than immediately after a @defun or @defunx.
+
+\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
+\def\defunx #1 {\errmessage{@defunx in invalid context}}
+\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
+\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
+\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
+
+% @defmethod, and so on
+
+% @defop CATEGORY CLASS OPERATION ARG...
+
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+
+\def\defopheader #1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype{} on #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @deftypemethod CLASS RETURN-TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype{} of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar == @defcv {Instance Variable}
+
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+
+\def\defivarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{Instance Variable of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% These definitions are run if you use @defmethodx, etc.,
+% anywhere other than immediately after a @defmethod, etc.
+
+\def\defopx #1 {\errmessage{@defopx in invalid context}}
+\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
+\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
+\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
+
+% Now @defvar
+
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{Variable}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{User Option}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type. #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
+\def\deftypevarheader #1#2{%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+
+% This definition is run if you use @defvarx
+% anywhere other than immediately after a @defvar or @defvarx.
+
+\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
+\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% This definition is run if you use @deftpx, etc
+% anywhere other than immediately after a @deftp, etc.
+
+\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{#1}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+\let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+ \cslet{macsave.\the\macname}{\the\macname}%
+ \else
+ \message{Warning: redefining \the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+ \errmessage{Macro \the\macname\ not defined.}%
+ \else
+ \cslet{#1}{macsave.#1}%
+ \expandafter\let \csname macsave.\the\macname\endcsname \undefined
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname##1{%
+ \csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname##1{%
+ \csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+
+\message{cross references,}
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\def\anchor#1{\setref{#1}{Ynothing}}
+
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}
+}}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printednodename{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual}%
+ \setbox0=\hbox{\printednodename}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printednodename{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printednodename{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Non-3.0.
+\else
+ \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+ \expandafter\ifx\csname X#1\endcsname\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \csname X#1\endcsname
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+\def\readauxfile{\begingroup
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % Make the characters 128-255 be printing characters
+ {%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
+ }%
+ % The aux file uses ' as the escape (for now).
+ % Turn off \ as an escape so we do not lose on
+ % entries which were dumped with control sequences in their names.
+ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % Reference to such entries still does not work the way one would wish,
+ % but at least they do not bomb out when the aux file is read in.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\%=\other
+ \catcode`\'=0
+ \catcode`\\=\other
+ %
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.aux
+ \global\havexrefstrue
+ \global\warnedobstrue
+ \fi
+ % Open the new aux file. TeX will close it automatically at exit.
+ \openout\auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ % Hang the footnote text off the number.
+ \hang
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+ \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\egroup}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://ftp.tug.org/tex/epsf.tex.}
+%
+% Only complain once about lack of epsf.tex.
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\medskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ \epsfbox{#1.eps}%
+ \fi
+}
+
+
+\message{paper sizes,}
+% And other related parameters.
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. This makes it come to about 9pt for the 8.5x11 format. We
+% call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = \hsize
+ \divide\emergencystretch by 45
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 0.6in
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% Say @foo, not \foo, in error messages.
+\escapechar=`\@
+
+% \catcode 17=0 % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active @catcode`@_=@active}
+
+% These look ok in all fonts, so just make them not special. The @rm below
+% makes sure that the current font starts out as the newly loaded cmr10
+@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+
+@textfonts
+@rm
+
+@c Local variables:
+@c page-delimiter: "^\\\\message"
+@c End: