diff -ur binutils-2.8/Makefile.in binutils-2.8.1/Makefile.in --- binutils-2.8/Makefile.in Wed Apr 30 13:06:20 1997 +++ binutils-2.8.1/Makefile.in Mon May 26 13:42:27 1997 @@ -517,11 +517,15 @@ # This is a list of the install targets for all of the modules which are # compiled using $(FLAGS_TO_PASS). +# We put install-opcodes before install-binutils because the installed +# binutils might be on PATH, and they might need the shared opcodes +# library. INSTALL_MODULES = \ install-apache \ install-autoconf \ install-bash \ install-bfd \ + install-opcodes \ install-binutils \ install-byacc \ install-cvs \ @@ -550,7 +554,6 @@ install-m4 \ install-make \ install-mmalloc \ - install-opcodes \ install-patch \ install-perl \ install-prms \ @@ -1436,7 +1439,7 @@ # Take out texinfo from a few places; make simple BISON=bison line. sed -e '/^all\.normal: /s/\all-texinfo //' \ -e '/^ install-texinfo /d' \ - -e '/^BISON = /,/^$$/d' \ + -e '/^BISON = `if/,/^$$/d' \ -e '/^# BISON:/s/.*/BISON = bison -y/' \ tmp mv -f tmp Makefile.in diff -ur binutils-2.8/bfd/ChangeLog binutils-2.8.1/bfd/ChangeLog --- binutils-2.8/bfd/ChangeLog Wed Apr 30 12:55:44 1997 +++ binutils-2.8.1/bfd/ChangeLog Mon May 26 13:33:56 1997 @@ -1,3 +1,36 @@ +Fri May 16 12:10:52 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't decrease the + alignment of a common symbol. If two symbols that look like + common symbols are found in two shared libraries, and the size is + different, use the larger size, and warn if --warn-common. If a + common symbol overrides a definition in a shared library, set the + size to the larger size, and warn if --warn-common. + +Thu May 15 16:40:20 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Force ELF symbol size + to common symbol size. Consistently treat uninitialized symbols + in shared objects as common symbols. + +Tue May 13 10:42:41 1997 Ian Lance Taylor + + * VERSION: Set to 2.8.1. + +Fri May 9 17:40:02 1997 Ian Lance Taylor + + * config.bfd: Change #if 0 around uses of host_aout_vec to #if + HAVE_host_aout_vec. + +Mon May 5 18:18:45 1997 Philip Blundell + + * config.bfd: cope with '*-*-linux-gnuaout' targets. + +Thu May 1 11:31:12 1997 Ian Lance Taylor + + * targmatch.sed: Add explicit \n characters to work around bug in + HP/UX 10.20 sed program. + Wed Apr 30 12:27:03 1997 Ian Lance Taylor * elf.c (copy_private_bfd_data): Cast csecs to avoid sign diff -ur binutils-2.8/bfd/VERSION binutils-2.8.1/bfd/VERSION --- binutils-2.8/bfd/VERSION Wed Apr 30 12:55:45 1997 +++ binutils-2.8.1/bfd/VERSION Mon May 26 13:33:56 1997 @@ -1 +1 @@ -2.8 +2.8.1 diff -ur binutils-2.8/bfd/config.bfd binutils-2.8.1/bfd/config.bfd --- binutils-2.8/bfd/config.bfd Wed Apr 30 12:55:55 1997 +++ binutils-2.8.1/bfd/config.bfd Mon May 26 13:34:00 1997 @@ -166,7 +166,7 @@ targ_defvec=bfd_elf32_i386_vec targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec" ;; - i[3456]86-*-linuxaout*) + i[3456]86-*-linux*aout*) targ_defvec=i386linux_vec targ_selvecs=bfd_elf32_i386_vec targ_underscore=yes @@ -272,7 +272,7 @@ targ_defvec=hp300hpux_vec targ_underscore=yes ;; - m68*-*-linuxaout*) + m68*-*-linux*aout*) targ_defvec=m68klinux_vec targ_selvecs=bfd_elf32_m68k_vec targ_underscore=yes @@ -467,7 +467,7 @@ targ_selvecs=sparcle_aout_vec targ_underscore=yes ;; - sparc-*-linuxaout*) + sparc-*-linux*aout*) targ_defvec=sparclinux_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" targ_underscore=yes @@ -513,14 +513,14 @@ targ_underscore=yes ;; -#if 0 +#if HAVE_host_aout_vec tahoe-*-*) targ_defvec=host_aout_vec targ_underscore=yes ;; #endif -#if 0 +#if HAVE_host_aout_vec vax-*-bsd* | vax-*-ultrix*) targ_defvec=host_aout_vec targ_underscore=yes diff -ur binutils-2.8/bfd/elflink.h binutils-2.8.1/bfd/elflink.h --- binutils-2.8/bfd/elflink.h Wed Apr 30 12:56:06 1997 +++ binutils-2.8.1/bfd/elflink.h Mon May 26 13:34:04 1997 @@ -695,6 +695,7 @@ boolean definition; boolean size_change_ok, type_change_ok; boolean new_weakdef; + unsigned int old_alignment; elf_swap_symbol_in (abfd, esym, &sym); @@ -782,6 +783,7 @@ size_change_ok = false; type_change_ok = get_elf_backend_data (abfd)->type_change_ok; + old_alignment = 0; if (info->hash->creator->flavour == bfd_target_elf_flavour) { Elf_Internal_Versym iver; @@ -860,6 +862,9 @@ || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + /* FIXME: There are too many cases here, and it's too + confusing. This code needs to be reorganized somehow. */ + /* It's OK to change the type if it used to be a weak definition, or if the current definition is weak (and hence might be ignored). */ @@ -875,6 +880,9 @@ || h->root.type == bfd_link_hash_undefined) size_change_ok = true; + if (h->root.type == bfd_link_hash_common) + old_alignment = h->root.u.c.p->alignment_power; + override = false; /* If we are looking at a dynamic object, and this is a @@ -896,6 +904,39 @@ && (bind == STB_WEAK || ELF_ST_TYPE (sym.st_info) == STT_FUNC))) { + /* In the special case of two symbols which look + like common symbols in a dynamic object, set the + size of the symbol to the larger of the two. */ + if ((sec->flags & SEC_ALLOC) != 0 + && (sec->flags & SEC_LOAD) == 0 + && sym.st_size > 0 + && bind != STB_WEAK + && ELF_ST_TYPE (sym.st_info) != STT_FUNC + && h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->root.u.def.section->owner->flags & DYNAMIC) != 0 + && (h->root.u.def.section->flags & SEC_ALLOC) != 0 + && (h->root.u.def.section->flags & SEC_LOAD) == 0 + && h->size > 0 + && h->type != STT_FUNC + && sym.st_size != h->size) + { + /* Note that we only warn if the size is + different. If the size is the same, then we + simply let the first shared library override + the second. */ + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, + h->root.u.def.section->owner, + bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, + sym.st_size))) + goto error_return; + if (sym.st_size > h->size) + h->size = sym.st_size; + } + override = true; sec = bfd_und_section_ptr; definition = false; @@ -913,34 +954,24 @@ && definition && h->root.type == bfd_link_hash_common && (sec->flags & SEC_ALLOC) != 0 - && (sec->flags & SEC_LOAD) == 0) + && (sec->flags & SEC_LOAD) == 0 + && sym.st_size > 0 + && bind != STB_WEAK + && ELF_ST_TYPE (sym.st_info) != STT_FUNC) { - if (! ((*info->callbacks->multiple_common) - (info, h->root.root.string, - h->root.u.c.p->section->owner, bfd_link_hash_common, - h->root.u.c.size, abfd, bfd_link_hash_common, - sym.st_size))) - goto error_return; - - /* If the symbol in the shared library is smaller than - the one we already have, then override it to stick - with the larger symbol. Set SIZE_CHANGE_OK because - we only want to warn if requested with --warn-common. */ - if (sym.st_size < h->size) - { - override = true; - sec = bfd_und_section_ptr; - definition = false; - size_change_ok = true; - } + override = true; + sec = bfd_com_section_ptr; + definition = false; + value = sym.st_size; + size_change_ok = true; } - /* Similarly, if we are not looking at a dynamic object, and - we have a definition, we want to override any definition - we may have from a dynamic object. Symbols from regular - files always take precedence over symbols from dynamic - objects, even if they are defined after the dynamic - object in the link. */ + /* If we are not looking at a dynamic object, and we have a + definition, we want to override any definition we may + have from a dynamic object. Symbols from regular files + always take precedence over symbols from dynamic objects, + even if they are defined after the dynamic object in the + link. */ if (! dynamic && (definition || (bfd_is_com_section (sec) @@ -968,6 +999,49 @@ h->verinfo.vertree = NULL; } + /* If we are not looking at a shared library and we have a + common symbol, and the symbol in the shared library is in + an uninitialized section, then treat the shared library + symbol as a common symbol. This will not always be + correct, but it should do little harm. Note that the + above condition already handled cases in which a common + symbol should simply override the definition in the + shared library. */ + if (! dynamic + && ! override + && bfd_is_com_section (sec) + && h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->root.u.def.section->owner->flags & DYNAMIC) != 0 + && (h->root.u.def.section->flags & SEC_ALLOC) != 0 + && (h->root.u.def.section->flags & SEC_LOAD) == 0 + && h->size > 0 + && h->type != STT_FUNC) + { + /* It would be best if we could set the hash table entry + to a common symbol, but we don't know what to use for + the section or the alignment. */ + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, + h->root.u.def.section->owner, bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, value))) + goto error_return; + + if (h->size > value) + value = h->size; + + /* FIXME: We no longer know the alignment required by + the symbol in the shared library, so we just wind up + using the one from the regular object. */ + + override = true; + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = h->root.u.def.section->owner; + size_change_ok = true; + type_change_ok = true; + h->verinfo.vertree = NULL; + } + if (ever != NULL && ! override && vernum > 1 @@ -1011,10 +1085,16 @@ new_weakdef = true; } - /* Get the alignment of a common symbol. */ + /* Set the alignment of a common symbol. */ if (sym.st_shndx == SHN_COMMON && h->root.type == bfd_link_hash_common) - h->root.u.c.p->alignment_power = bfd_log2 (sym.st_value); + { + unsigned int align; + + align = bfd_log2 (sym.st_value); + if (align > old_alignment) + h->root.u.c.p->alignment_power = align; + } if (info->hash->creator->flavour == bfd_target_elf_flavour) { @@ -1034,6 +1114,15 @@ h->size = sym.st_size; } + + /* If this is a common symbol, then we always want H->SIZE + to be the size of the common symbol. The code just above + won't fix the size if a common symbol becomes larger. We + don't warn about a size change here, because that is + covered by --warn-common. */ + if (h->root.type == bfd_link_hash_common) + h->size = h->root.u.c.size; + if (ELF_ST_TYPE (sym.st_info) != STT_NOTYPE && (definition || h->type == STT_NOTYPE)) { diff -ur binutils-2.8/bfd/targets.c binutils-2.8.1/bfd/targets.c --- binutils-2.8/bfd/targets.c Wed Apr 30 12:56:28 1997 +++ binutils-2.8.1/bfd/targets.c Mon May 26 13:34:12 1997 @@ -506,7 +506,6 @@ extern const bfd_target bfd_elf64_big_generic_vec; extern const bfd_target bfd_elf64_little_generic_vec; extern const bfd_target bfd_elf64_sparc_vec; -extern const bfd_target bsd_ecoffalpha_little_vec; extern const bfd_target demo_64_vec; extern const bfd_target ecoff_big_vec; extern const bfd_target ecoff_little_vec; @@ -662,9 +661,6 @@ #endif #if 0 &bfd_elf64_sparc_vec, -#endif -#ifdef BFD64 - &bsd_ecoffalpha_little_vec, #endif /* We don't include cisco_core_vec. Although it has a magic number, the magic number isn't at the beginning of the file, and thus diff -ur binutils-2.8/bfd/targmatch.sed binutils-2.8.1/bfd/targmatch.sed --- binutils-2.8/bfd/targmatch.sed Wed Apr 30 12:56:28 1997 +++ binutils-2.8.1/bfd/targmatch.sed Mon May 26 13:34:12 1997 @@ -20,9 +20,13 @@ d :lab3 G +s/\n/%EOL%/g s/\(defined (HAVE_\)\([^)]*\)\(.*\)/\1\2\3\ \&\2 },\ #endif/ +s/%EOL%/\ +/g p s/.*//g +s/\n//g h diff -ur binutils-2.8/binutils/ChangeLog binutils-2.8.1/binutils/ChangeLog --- binutils-2.8/binutils/ChangeLog Wed Apr 30 12:59:00 1997 +++ binutils-2.8.1/binutils/ChangeLog Mon May 26 13:35:24 1997 @@ -1,3 +1,13 @@ +Tue May 13 10:42:58 1997 Ian Lance Taylor + + * Makefile.in (VERSION): Set to 2.8.1. + +Mon May 12 13:14:22 1997 Ian Lance Taylor + + * configure.in: Don't clear OPCODES when --enable-commonbfdlib is + used on HP/UX. + * configure: Rebuild. + Fri Apr 25 14:22:08 1997 H.J. Lu * Makefile.in (maintainer-clean realclean): Change *.info* diff -ur binutils-2.8/binutils/Makefile.in binutils-2.8.1/binutils/Makefile.in --- binutils-2.8/binutils/Makefile.in Wed Apr 30 13:06:18 1997 +++ binutils-2.8.1/binutils/Makefile.in Mon May 26 13:42:26 1997 @@ -75,7 +75,7 @@ LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` # Distribution version -VERSION=2.8 +VERSION=2.8.1 # Distribution name DIST_NAME=binutils-${VERSION} diff -ur binutils-2.8/binutils/binutils.info binutils-2.8.1/binutils/binutils.info --- binutils-2.8/binutils/binutils.info Wed Apr 30 13:12:44 1997 +++ binutils-2.8.1/binutils/binutils.info Mon May 26 13:46:32 1997 @@ -26,31 +26,31 @@  Indirect: binutils.info-1: 969 -binutils.info-2: 49335 +binutils.info-2: 49337  Tag Table: (Indirect) Node: Top969 -Node: ar2006 -Node: ar cmdline4172 -Node: ar scripts10932 -Node: nm16613 -Node: objcopy23161 -Node: objdump32838 -Node: ranlib41125 -Node: size41859 -Node: strings44526 -Node: strip46351 -Node: c++filt49335 -Node: addr2line51896 -Node: nlmconv54293 -Node: Selecting The Target System56918 -Node: Target Selection57935 -Node: Architecture Selection60635 -Node: Linker Emulation Selection61867 -Node: Reporting Bugs62745 -Node: Bug Criteria63496 -Node: Bug Reporting64042 -Node: Index71031 +Node: ar2008 +Node: ar cmdline4174 +Node: ar scripts10934 +Node: nm16615 +Node: objcopy23163 +Node: objdump32840 +Node: ranlib41127 +Node: size41861 +Node: strings44528 +Node: strip46353 +Node: c++filt49337 +Node: addr2line51898 +Node: nlmconv54295 +Node: Selecting The Target System56920 +Node: Target Selection57937 +Node: Architecture Selection60637 +Node: Linker Emulation Selection61869 +Node: Reporting Bugs62747 +Node: Bug Criteria63498 +Node: Bug Reporting64044 +Node: Index71033  End Tag Table diff -ur binutils-2.8/binutils/binutils.info-1 binutils-2.8.1/binutils/binutils.info-1 --- binutils-2.8/binutils/binutils.info-1 Wed Apr 30 13:12:44 1997 +++ binutils-2.8.1/binutils/binutils.info-1 Mon May 26 13:46:32 1997 @@ -30,7 +30,7 @@ ************ This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.8): +binary utilities (collectively version 2.8.1): * Menu: diff -ur binutils-2.8/binutils/config.texi binutils-2.8.1/binutils/config.texi --- binutils-2.8/binutils/config.texi Wed Apr 30 13:12:43 1997 +++ binutils-2.8.1/binutils/config.texi Mon May 26 13:46:32 1997 @@ -1 +1 @@ -@set VERSION 2.8 +@set VERSION 2.8.1 diff -ur binutils-2.8/binutils/configure binutils-2.8.1/binutils/configure --- binutils-2.8/binutils/configure Wed Apr 30 12:59:07 1997 +++ binutils-2.8.1/binutils/configure Mon May 26 13:35:25 1997 @@ -1006,8 +1006,13 @@ if test "${commonbfdlib}" = "true"; then # when a shared libbfd is built with --enable-commonbfdlib, - # all of libopcodes is available in libbfd.so - OPCODES= + # all of libopcodes is available in libbfd.so. Unfortunately, on + # HP/UX, when using gcc -g, the linker does a static link, so we + # need to continue linking against opcodes on that platform. + case "${host}" in + *-*-hpux*) ;; + *) OPCODES= ;; + esac fi @@ -1024,7 +1029,7 @@ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1028: checking how to run the C preprocessor" >&5 +echo "configure:1033: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1039,13 +1044,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1056,13 +1061,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1088,17 +1093,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1092: checking for $ac_hdr" >&5 +echo "configure:1097: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1125,12 +1130,12 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1129: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1134: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1146,7 +1151,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1169,19 +1174,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1173: checking for working alloca.h" >&5 +echo "configure:1178: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1202,12 +1207,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1206: checking for alloca" >&5 +echo "configure:1211: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1262,12 +1267,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1266: checking whether alloca needs Cray hooks" >&5 +echo "configure:1271: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:1296: checking for $ac_func" >&5 +echo "configure:1301: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1347,7 +1352,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1351: checking stack direction for C alloca" >&5 +echo "configure:1356: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1355,7 +1360,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1398,12 +1403,12 @@ for ac_func in sbrk utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1402: checking for $ac_func" >&5 +echo "configure:1407: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1452,12 +1457,12 @@ if test "x$cross_compiling" = "xno"; then echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1456: checking for ANSI C header files" >&5 +echo "configure:1461: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1465,7 +1470,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1482,7 +1487,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1500,7 +1505,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1521,7 +1526,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1532,7 +1537,7 @@ exit (0); } EOF -if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1556,12 +1561,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1560: checking for pid_t" >&5 +echo "configure:1565: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1590,17 +1595,17 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:1594: checking for vfork.h" >&5 +echo "configure:1599: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1625,18 +1630,18 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:1629: checking for working vfork" >&5 +echo "configure:1634: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:1635: checking for vfork" >&5 +echo "configure:1640: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -1680,7 +1685,7 @@ else cat > conftest.$ac_ext < @@ -1775,7 +1780,7 @@ } } EOF -if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -1799,12 +1804,12 @@ else echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:1803: checking for vfork" >&5 +echo "configure:1808: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -1853,19 +1858,19 @@ fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:1857: checking for time_t in time.h" >&5 +echo "configure:1862: checking for time_t in time.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:1869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -1886,19 +1891,19 @@ fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:1890: checking for time_t in sys/types.h" >&5 +echo "configure:1895: checking for time_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -1921,12 +1926,12 @@ # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:1925: checking for utime.h" >&5 +echo "configure:1930: checking for utime.h" >&5 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_TIME_H @@ -1937,7 +1942,7 @@ struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:1941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -1958,12 +1963,12 @@ fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:1962: checking whether fprintf must be declared" >&5 +echo "configure:1967: checking whether fprintf must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1984,7 +1989,7 @@ char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:1988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -2006,12 +2011,12 @@ fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:2010: checking whether strstr must be declared" >&5 +echo "configure:2015: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2032,7 +2037,7 @@ char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:2036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -2054,12 +2059,12 @@ fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:2058: checking whether sbrk must be declared" >&5 +echo "configure:2063: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2080,7 +2085,7 @@ char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:2084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -2102,12 +2107,12 @@ fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:2106: checking whether getenv must be declared" >&5 +echo "configure:2111: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2128,7 +2133,7 @@ char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:2132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else diff -ur binutils-2.8/binutils/configure.in binutils-2.8.1/binutils/configure.in --- binutils-2.8/binutils/configure.in Wed Apr 30 12:59:07 1997 +++ binutils-2.8.1/binutils/configure.in Mon May 26 13:35:25 1997 @@ -98,8 +98,13 @@ if test "${commonbfdlib}" = "true"; then # when a shared libbfd is built with --enable-commonbfdlib, - # all of libopcodes is available in libbfd.so - OPCODES= + # all of libopcodes is available in libbfd.so. Unfortunately, on + # HP/UX, when using gcc -g, the linker does a static link, so we + # need to continue linking against opcodes on that platform. + case "${host}" in + *-*-hpux*) ;; + *) OPCODES= ;; + esac fi AC_SUBST(BFDLIB) diff -ur binutils-2.8/binutils/testsuite/ChangeLog binutils-2.8.1/binutils/testsuite/ChangeLog --- binutils-2.8/binutils/testsuite/ChangeLog Wed Apr 30 12:59:22 1997 +++ binutils-2.8.1/binutils/testsuite/ChangeLog Mon May 26 13:35:30 1997 @@ -1,3 +1,8 @@ +Wed May 21 12:02:41 1997 Manfred Hollstein + + * binutils-all/ar.exp (long_filenames): Use `cd ./tmpdir' to avoid + output from the shell if tmpdir is found via $CDPATH. + Mon Apr 14 12:36:41 1997 Ian Lance Taylor * binutils-all/ar.exp (long_filenames): Check for a file system diff -ur binutils-2.8/binutils/testsuite/binutils-all/ar.exp binutils-2.8.1/binutils/testsuite/binutils-all/ar.exp --- binutils-2.8/binutils/testsuite/binutils-all/ar.exp Wed Apr 30 12:59:19 1997 +++ binutils-2.8.1/binutils/testsuite/binutils-all/ar.exp Mon May 26 13:35:29 1997 @@ -84,8 +84,8 @@ return } - verbose -log "cd tmpdir; $AR x artest.a" - catch "exec /bin/sh -c \"cd tmpdir; $AR x artest.a\"" exec_output + verbose -log "cd ./tmpdir; $AR x artest.a" + catch "exec /bin/sh -c \"cd ./tmpdir; $AR x artest.a\"" exec_output set exec_output [prune_warnings $exec_output] if ![string match "" $exec_output] { verbose -log $exec_output diff -ur binutils-2.8/gas/ChangeLog binutils-2.8.1/gas/ChangeLog --- binutils-2.8/gas/ChangeLog Wed Apr 30 12:53:29 1997 +++ binutils-2.8.1/gas/ChangeLog Mon May 26 13:32:45 1997 @@ -1,3 +1,50 @@ +Mon May 26 13:24:25 1997 Ian Lance Taylor + + * doc/as.texinfo: Don't use @value in section names or index + entries; it confuses texinfo.tex. + +Tue May 13 10:42:20 1997 Ian Lance Taylor + + * Makefile.in (VERSION): Set to 2.8.1. + +Mon May 12 13:33:08 1997 H.J. Lu + + * config/tc-i386.c (pi): Check for RegMMX. + +Thu May 8 11:10:15 1997 Ian Lance Taylor + + * expr.c (expr): When subtracting values in the same frag, + subtract X_add_number rather than adding it. + +Wed May 7 15:39:48 1997 Ian Lance Taylor + + * config/obj-coff.c (write_object_file): Just pass NULL to + md_do_align, not the address of a char holding NOP_OPCODE. + +Tue May 6 12:18:09 1997 Ian Lance Taylor + + * config/tc-i386.c (md_section_align): If a.out and BFD, force + section size to be aligned. + +Mon May 5 17:16:55 1997 Ian Lance Taylor + + * cond.c: Include "macro.h". + (struct conditional_frame): Add macro_nest field. + (initialize_cframe): Initialize macro_nest. + (cond_finish_check): Add nest parameter. Change all callers. + (cond_exit_macro): New function. + * as.h (cond_finish_check): Update declaration. + (cond_exit_macro): Declare. + * input-scrub.c (macro_nest): Make globally visible. + (input_scrub_next_buffer): Call cond_finish_check. + * macro.h (macro_nest): Declare. + * read.c (s_mexit): Call cond_exit_macro. + + * config/tc-i386.h (RegMMX): Define. + * config/tc-i386.c (pi): Check for all register types. + (type_names): Add RegMMX. + (md_assemble): Handle RegMMX. + Wed Apr 30 12:47:00 1997 Manfred Hollstein * config/obj-coff.c (c_section_symbol): Clear the LOCAL bit #ifdef @@ -9,6 +56,11 @@ before_relaxing. Use it when testing ecoff_extern_size. (load_address, macro, md_estimate_size_before_relax): Fix all callers. + +Tue Apr 29 19:52:47 1997 Ian Lance Taylor + + * config/obj-coff.c (coff_header_append): Don't reset string_size + each time through the loop. Fri Apr 25 14:17:46 1997 H.J. Lu diff -ur binutils-2.8/gas/Makefile.in binutils-2.8.1/gas/Makefile.in --- binutils-2.8/gas/Makefile.in Wed Apr 30 13:06:18 1997 +++ binutils-2.8.1/gas/Makefile.in Mon May 26 13:42:26 1997 @@ -53,7 +53,7 @@ infodir = @infodir@ includedir = @includedir@ -VERSION=2.8 +VERSION=2.8.1 SHELL = /bin/sh diff -ur binutils-2.8/gas/as.c binutils-2.8.1/gas/as.c --- binutils-2.8/gas/as.c Wed Apr 30 12:53:30 1997 +++ binutils-2.8.1/gas/as.c Mon May 26 13:32:46 1997 @@ -697,7 +697,7 @@ perform_an_assembly_pass (argc, argv); /* Assemble it. */ - cond_finish_check (); + cond_finish_check (-1); #ifdef md_end md_end (); diff -ur binutils-2.8/gas/as.h binutils-2.8.1/gas/as.h --- binutils-2.8/gas/as.h Wed Apr 30 12:53:31 1997 +++ binutils-2.8.1/gas/as.h Mon May 26 13:32:46 1997 @@ -597,7 +597,8 @@ long exponent_bits)); int had_err PARAMS ((void)); int ignore_input PARAMS ((void)); -void cond_finish_check PARAMS ((void)); +void cond_finish_check PARAMS ((int)); +void cond_exit_macro PARAMS ((int)); int seen_at_least_1_file PARAMS ((void)); void app_pop PARAMS ((char *arg)); void as_howmuch PARAMS ((FILE * stream)); diff -ur binutils-2.8/gas/cond.c binutils-2.8.1/gas/cond.c --- binutils-2.8/gas/cond.c Wed Apr 30 12:53:31 1997 +++ binutils-2.8.1/gas/cond.c Mon May 26 13:32:46 1997 @@ -19,6 +19,7 @@ 02111-1307, USA. */ #include "as.h" +#include "macro.h" #include "obstack.h" @@ -48,6 +49,8 @@ int ignoring; /* Whether a conditional at a higher level is ignoring input. */ int dead_tree; + /* Macro nesting level at which this conditional was created. */ + int macro_nest; }; static void initialize_cframe PARAMS ((struct conditional_frame *cframe)); @@ -401,14 +404,22 @@ &cframe->if_file_line.line); cframe->previous_cframe = current_cframe; cframe->dead_tree = current_cframe != NULL && current_cframe->ignoring; + cframe->macro_nest = macro_nest; } +/* Give an error if a conditional is unterminated inside a macro or + the assembly as a whole. If NEST is non negative, we are being + called because of the end of a macro expansion. If NEST is + negative, we are being called at the of the input files. */ + void -cond_finish_check () +cond_finish_check (nest) + int nest; { - if (current_cframe != NULL) + if (current_cframe != NULL && current_cframe->macro_nest >= nest) { - as_bad ("end of file inside conditional"); + as_bad ("end of %s inside conditional", + nest >= 0 ? "macro" : "file"); as_bad_where (current_cframe->if_file_line.file, current_cframe->if_file_line.line, "here is the start of the unterminated conditional"); @@ -416,6 +427,24 @@ as_bad_where (current_cframe->else_file_line.file, current_cframe->else_file_line.line, "here is the \"else\" of the unterminated conditional"); + } +} + +/* This function is called when we exit out of a macro. We assume + that any conditionals which began within the macro are correctly + nested, and just pop them off the stack. */ + +void +cond_exit_macro (nest) + int nest; +{ + while (current_cframe != NULL && current_cframe->macro_nest >= nest) + { + struct conditional_frame *hold; + + hold = current_cframe; + current_cframe = current_cframe->previous_cframe; + obstack_free (&cond_obstack, hold); } } diff -ur binutils-2.8/gas/config/obj-coff.c binutils-2.8.1/gas/config/obj-coff.c --- binutils-2.8/gas/config/obj-coff.c Wed Apr 30 12:53:13 1997 +++ binutils-2.8.1/gas/config/obj-coff.c Mon May 26 13:32:36 1997 @@ -1909,6 +1909,9 @@ unsigned int i; char buffer[1000]; char buffero[1000]; +#ifdef COFF_LONG_SECTION_NAMES + unsigned long string_size = 4; +#endif bfd_seek (abfd, 0, 0); @@ -1931,10 +1934,6 @@ for (i = SEG_E0; i < SEG_LAST; i++) { -#ifdef COFF_LONG_SECTION_NAMES - unsigned long string_size = 4; -#endif - if (segment_info[i].scnhdr.s_name[0]) { unsigned int size; @@ -3145,10 +3144,8 @@ #define SUB_SEGMENT_ALIGN(SEG) 1 #endif #ifdef md_do_align - { - static char nop = NOP_OPCODE; - md_do_align (SUB_SEGMENT_ALIGN (now_seg), &nop, 1, 0, alignment_done); - } + md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0, + alignment_done); #endif frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE, 0); #ifdef md_do_align diff -ur binutils-2.8/gas/config/tc-i386.c binutils-2.8.1/gas/config/tc-i386.c --- binutils-2.8/gas/config/tc-i386.c Wed Apr 30 12:53:18 1997 +++ binutils-2.8.1/gas/config/tc-i386.c Mon May 26 13:32:39 1997 @@ -638,7 +638,8 @@ fprintf (stdout, " #%d: ", i + 1); pt (x->types[i]); fprintf (stdout, "\n"); - if (x->types[i] & Reg) + if (x->types[i] + & (Reg | SReg2 | SReg3 | Control | Debug | Test | RegMMX)) fprintf (stdout, "%s\n", x->regs[i]->reg_name); if (x->types[i] & Imm) pe (x->imms[i]); @@ -737,6 +738,7 @@ { FloatReg, "FReg" }, { FloatAcc, "FAcc" }, { JumpAbsolute, "Jump Absolute" }, + { RegMMX, "rMMX" }, { 0, "" } }; @@ -1415,14 +1417,23 @@ if (i.reg_operands == 2) { unsigned int source, dest; - source = (i.types[0] & (Reg | SReg2 | SReg3 | Control | Debug | Test)) ? 0 : 1; + source = ((i.types[0] + & (Reg + | SReg2 + | SReg3 + | Control + | Debug + | Test + | RegMMX)) + ? 0 : 1); dest = source + 1; i.rm.mode = 3; /* We must be careful to make sure that all - segment/control/test/debug registers go into the i.rm.reg - field (despite the whether they are source or destination - operands). */ - if (i.regs[dest]->reg_type & (SReg2 | SReg3 | Control | Debug | Test)) + segment/control/test/debug/MMX registers go into + the i.rm.reg field (despite the whether they are + source or destination operands). */ + if (i.regs[dest]->reg_type + & (SReg2 | SReg3 | Control | Debug | Test | RegMMX)) { i.rm.reg = i.regs[dest]->reg_num; i.rm.regmem = i.regs[source]->reg_num; @@ -1550,15 +1561,23 @@ } } - /* Fill in i.rm.reg or i.rm.regmem field with register operand - (if any) based on t->extension_opcode. Again, we must be - careful to make sure that segment/control/debug/test + /* Fill in i.rm.reg or i.rm.regmem field with register + operand (if any) based on + t->extension_opcode. Again, we must be careful to + make sure that segment/control/debug/test/MMX registers are coded into the i.rm.reg field. */ if (i.reg_operands) { unsigned int op = - (i.types[0] & (Reg | SReg2 | SReg3 | Control | Debug | Test)) ? 0 : - (i.types[1] & (Reg | SReg2 | SReg3 | Control | Debug | Test)) ? 1 : 2; + ((i.types[0] + & (Reg | SReg2 | SReg3 | Control | Debug + | Test | RegMMX)) + ? 0 + : ((i.types[1] + & (Reg | SReg2 | SReg3 | Control | Debug + | Test | RegMMX)) + ? 1 + : 2)); /* If there is an extension opcode to put here, the register number must be put into the regmem field. */ if (t->extension_opcode != None) @@ -2963,7 +2982,21 @@ segT segment; valueT size; { - return size; /* Byte alignment is fine */ +#ifdef OBJ_AOUT +#ifdef BFD_ASSEMBLER + /* For a.out, force the section size to be aligned. If we don't do + this, BFD will align it for us, but it will not write out the + final bytes of the section. This may be a bug in BFD, but it is + easier to fix it here since that is how the other a.out targets + work. */ + int align; + + align = bfd_get_section_alignment (stdoutput, segment); + size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); +#endif +#endif + + return size; } /* Exactly what point is a PC-relative offset relative TO? On the diff -ur binutils-2.8/gas/config/tc-i386.h binutils-2.8.1/gas/config/tc-i386.h --- binutils-2.8/gas/config/tc-i386.h Wed Apr 30 12:53:18 1997 +++ binutils-2.8.1/gas/config/tc-i386.h Mon May 26 13:32:39 1997 @@ -243,6 +243,7 @@ #define Abs16 0x10000000 #define Abs32 0x20000000 #define Abs (Abs8|Abs16|Abs32) +#define RegMMX 0x40000000 /* MMX register */ #define Byte (Reg8|Imm8|Imm8S) #define Word (Reg16|Imm16) diff -ur binutils-2.8/gas/doc/as.info binutils-2.8.1/gas/doc/as.info --- binutils-2.8/gas/doc/as.info Wed Apr 30 13:15:00 1997 +++ binutils-2.8.1/gas/doc/as.info Mon May 26 13:47:07 1997 @@ -26,261 +26,261 @@  Indirect: as.info-1: 874 -as.info-2: 50097 -as.info-3: 99928 -as.info-4: 148596 -as.info-5: 196183 -as.info-6: 246121 -as.info-7: 258809 +as.info-2: 50096 +as.info-3: 99949 +as.info-4: 148617 +as.info-5: 196204 +as.info-6: 246142 +as.info-7: 258830  Tag Table: (Indirect) Node: Top874 Node: Overview1533 -Node: Manual9662 -Node: GNU Assembler10601 -Node: Object Formats11776 -Node: Command Line12223 -Node: Input Files13305 -Node: Object15209 -Node: Errors16156 -Node: Invoking17353 -Node: a18942 -Node: D20276 -Node: f20496 -Node: I20999 -Node: K21538 -Node: L21837 -Node: M22663 -Node: o27051 -Node: R27498 -Node: statistics28514 -Node: v28897 -Node: W29157 -Node: Z29739 -Node: Syntax30254 -Node: Preprocessing30844 -Node: Whitespace32404 -Node: Comments32794 -Node: Symbol Intro34611 -Node: Statements35294 -Node: Constants37540 -Node: Characters38166 -Node: Strings38659 -Node: Chars40812 -Node: Numbers41553 -Node: Integers42084 -Node: Bignums42727 -Node: Flonums43070 -Node: Sections44708 -Node: Secs Background45071 -Node: Ld Sections50097 -Node: As Sections52483 -Node: Sub-Sections53374 -Node: bss56372 -Node: Symbols57317 -Node: Labels57964 -Node: Setting Symbols58690 -Node: Symbol Names59056 -Node: Dot62024 -Node: Symbol Attributes62466 -Node: Symbol Value63198 -Node: Symbol Type64234 -Node: a.out Symbols64613 -Node: Symbol Desc64863 -Node: Symbol Other65145 -Node: COFF Symbols65301 -Node: SOM Symbols65930 -Node: Expressions66363 -Node: Empty Exprs67111 -Node: Integer Exprs67453 -Node: Arguments67843 -Node: Operators68940 -Node: Prefix Ops69266 -Node: Infix Ops69585 -Node: Pseudo Ops71077 -Node: Abort74900 -Node: ABORT75301 -Node: Align75563 -Node: App-File77728 -Node: Ascii78265 -Node: Asciz78570 -Node: Balign78810 -Node: Byte80668 -Node: Comm80901 -Node: Data82260 -Node: Def82570 -Node: Desc82938 -Node: Dim83432 -Node: Double83823 -Node: Eject84154 -Node: Else84322 -Node: Endef84611 -Node: Endif84933 -Node: Equ85184 -Node: Equiv85487 -Node: Err85883 -Node: Extern86187 -Node: File86439 -Node: Fill87090 -Node: Float88047 -Node: Global88383 -Node: hword89126 -Node: Ident89447 -Node: If89747 -Node: Include90603 -Node: Int91143 -Node: Irp91512 -Node: Irpc92306 -Node: Lcomm93125 -Node: Lflags93866 -Node: Line94053 -Node: Linkonce95076 -Node: Ln96296 -Node: MRI96444 -Node: List96771 -Node: Long97374 -Node: Macro97544 -Node: Nolist99928 -Node: Octa100344 -Node: Org100670 -Node: P2align101945 -Node: Psize103861 -Node: Quad104534 -Node: Rept104974 -Node: Sbttl105380 -Node: Scl105738 -Node: Section106234 -Node: Set108583 -Node: Short109136 -Node: Single109450 -Node: Size109787 -Node: Skip110182 -Node: Space110495 -Node: Stab111377 -Node: String113373 -Node: Symver113792 -Node: Tag115377 -Node: Text115885 -Node: Title116197 -Node: Type116569 -Node: Val116945 -Node: Word117300 -Node: Deprecated119133 -Node: Machine Dependencies119367 -Node: AMD29K-Dependent120894 -Node: AMD29K Options121276 -Node: AMD29K Syntax121450 -Node: AMD29K-Macros121714 -Node: AMD29K-Chars121965 -Node: AMD29K-Regs122228 -Node: AMD29K Floating Point123492 -Node: AMD29K Directives123698 -Node: AMD29K Opcodes125106 -Node: D10V-Dependent125442 -Node: D10V-Opts125789 -Node: D10V-Syntax126178 -Node: D10V-Size126698 -Node: D10V-Subs127658 -Node: D10V-Chars128680 -Node: D10V-Regs130266 -Node: D10V-Addressing131290 -Node: D10V-Word131963 -Node: D10V-Float132464 -Node: D10V-Opcodes132766 -Node: H8/300-Dependent133150 -Node: H8/300 Options133554 -Node: H8/300 Syntax133735 -Node: H8/300-Chars134022 -Node: H8/300-Regs134306 -Node: H8/300-Addressing135210 -Node: H8/300 Floating Point136236 -Node: H8/300 Directives136552 -Node: H8/300 Opcodes137072 -Node: H8/500-Dependent145425 -Node: H8/500 Options145829 -Node: H8/500 Syntax146010 -Node: H8/500-Chars146297 -Node: H8/500-Regs146588 -Node: H8/500-Addressing147344 -Node: H8/500 Floating Point147961 -Node: H8/500 Directives148277 -Node: H8/500 Opcodes148596 -Node: HPPA-Dependent153709 -Node: HPPA Notes154131 -Node: HPPA Options154878 -Node: HPPA Syntax155062 -Node: HPPA Floating Point156321 -Node: HPPA Directives156516 -Node: HPPA Opcodes163107 -Node: i386-Dependent163355 -Node: i386-Options164024 -Node: i386-Syntax164168 -Node: i386-Opcodes166118 -Node: i386-Regs168237 -Node: i386-prefixes169378 -Node: i386-Memory171047 -Node: i386-jumps173321 -Node: i386-Float174391 -Node: i386-16bit176381 -Node: i386-Notes178773 -Node: i960-Dependent179614 -Node: Options-i960180006 -Node: Floating Point-i960183887 -Node: Directives-i960184144 -Node: Opcodes for i960186164 -Node: callj-i960186770 -Node: Compare-and-branch-i960187245 -Node: M68K-Dependent189134 -Node: M68K-Opts189588 -Node: M68K-Syntax194355 -Node: M68K-Moto-Syntax196183 -Node: M68K-Float198761 -Node: M68K-Directives199270 -Node: M68K-opcodes199865 -Node: M68K-Branch200077 -Node: M68K-Chars202892 -Node: MIPS-Dependent203290 -Node: MIPS Opts204100 -Node: MIPS Object206936 -Node: MIPS Stabs208491 -Node: MIPS ISA209202 -Node: MIPS insn210304 -Node: MIPS option stack210783 -Node: SH-Dependent211496 -Node: SH Options211879 -Node: SH Syntax212044 -Node: SH-Chars212303 -Node: SH-Regs212582 -Node: SH-Addressing213181 -Node: SH Floating Point214075 -Node: SH Directives214371 -Node: SH Opcodes214576 -Node: Sparc-Dependent218823 -Node: Sparc-Opts219196 -Node: Sparc-Aligned-Data220873 -Node: Sparc-Float221717 -Node: Sparc-Directives221907 -Node: Z8000-Dependent223125 -Node: Z8000 Options224085 -Node: Z8000 Syntax224260 -Node: Z8000-Chars224536 -Node: Z8000-Regs224754 -Node: Z8000-Addressing225526 -Node: Z8000 Directives226469 -Node: Z8000 Opcodes228067 -Node: Vax-Dependent238003 -Node: VAX-Opts238510 -Node: VAX-float240800 -Node: VAX-directives241421 -Node: VAX-opcodes242270 -Node: VAX-branch242648 -Node: VAX-operands245143 -Node: VAX-no245895 -Node: Reporting Bugs246121 -Node: Bug Criteria246844 -Node: Bug Reporting247604 -Node: Acknowledgements254181 -Node: Index258809 +Node: Manual9658 +Node: GNU Assembler10597 +Node: Object Formats11764 +Node: Command Line12211 +Node: Input Files13293 +Node: Object15197 +Node: Errors16144 +Node: Invoking17341 +Node: a18930 +Node: D20264 +Node: f20484 +Node: I20987 +Node: K21526 +Node: L21825 +Node: M22651 +Node: o27039 +Node: R27486 +Node: statistics28502 +Node: v28885 +Node: W29145 +Node: Z29727 +Node: Syntax30242 +Node: Preprocessing30832 +Node: Whitespace32392 +Node: Comments32782 +Node: Symbol Intro34599 +Node: Statements35282 +Node: Constants37528 +Node: Characters38154 +Node: Strings38647 +Node: Chars40800 +Node: Numbers41541 +Node: Integers42072 +Node: Bignums42715 +Node: Flonums43058 +Node: Sections44696 +Node: Secs Background45070 +Node: Ld Sections50096 +Node: As Sections52490 +Node: Sub-Sections53395 +Node: bss56393 +Node: Symbols57338 +Node: Labels57985 +Node: Setting Symbols58711 +Node: Symbol Names59077 +Node: Dot62045 +Node: Symbol Attributes62487 +Node: Symbol Value63219 +Node: Symbol Type64255 +Node: a.out Symbols64634 +Node: Symbol Desc64884 +Node: Symbol Other65166 +Node: COFF Symbols65322 +Node: SOM Symbols65951 +Node: Expressions66384 +Node: Empty Exprs67132 +Node: Integer Exprs67474 +Node: Arguments67864 +Node: Operators68961 +Node: Prefix Ops69287 +Node: Infix Ops69606 +Node: Pseudo Ops71098 +Node: Abort74921 +Node: ABORT75322 +Node: Align75584 +Node: App-File77749 +Node: Ascii78286 +Node: Asciz78591 +Node: Balign78831 +Node: Byte80689 +Node: Comm80922 +Node: Data82281 +Node: Def82591 +Node: Desc82959 +Node: Dim83453 +Node: Double83844 +Node: Eject84175 +Node: Else84343 +Node: Endef84632 +Node: Endif84954 +Node: Equ85205 +Node: Equiv85508 +Node: Err85904 +Node: Extern86208 +Node: File86460 +Node: Fill87111 +Node: Float88068 +Node: Global88404 +Node: hword89147 +Node: Ident89468 +Node: If89768 +Node: Include90624 +Node: Int91164 +Node: Irp91533 +Node: Irpc92327 +Node: Lcomm93146 +Node: Lflags93887 +Node: Line94074 +Node: Linkonce95097 +Node: Ln96317 +Node: MRI96465 +Node: List96792 +Node: Long97395 +Node: Macro97565 +Node: Nolist99949 +Node: Octa100365 +Node: Org100691 +Node: P2align101966 +Node: Psize103882 +Node: Quad104555 +Node: Rept104995 +Node: Sbttl105401 +Node: Scl105759 +Node: Section106255 +Node: Set108604 +Node: Short109157 +Node: Single109471 +Node: Size109808 +Node: Skip110203 +Node: Space110516 +Node: Stab111398 +Node: String113394 +Node: Symver113813 +Node: Tag115398 +Node: Text115906 +Node: Title116218 +Node: Type116590 +Node: Val116966 +Node: Word117321 +Node: Deprecated119154 +Node: Machine Dependencies119388 +Node: AMD29K-Dependent120915 +Node: AMD29K Options121297 +Node: AMD29K Syntax121471 +Node: AMD29K-Macros121735 +Node: AMD29K-Chars121986 +Node: AMD29K-Regs122249 +Node: AMD29K Floating Point123513 +Node: AMD29K Directives123719 +Node: AMD29K Opcodes125127 +Node: D10V-Dependent125463 +Node: D10V-Opts125810 +Node: D10V-Syntax126199 +Node: D10V-Size126719 +Node: D10V-Subs127679 +Node: D10V-Chars128701 +Node: D10V-Regs130287 +Node: D10V-Addressing131311 +Node: D10V-Word131984 +Node: D10V-Float132485 +Node: D10V-Opcodes132787 +Node: H8/300-Dependent133171 +Node: H8/300 Options133575 +Node: H8/300 Syntax133756 +Node: H8/300-Chars134043 +Node: H8/300-Regs134327 +Node: H8/300-Addressing135231 +Node: H8/300 Floating Point136257 +Node: H8/300 Directives136573 +Node: H8/300 Opcodes137093 +Node: H8/500-Dependent145446 +Node: H8/500 Options145850 +Node: H8/500 Syntax146031 +Node: H8/500-Chars146318 +Node: H8/500-Regs146609 +Node: H8/500-Addressing147365 +Node: H8/500 Floating Point147982 +Node: H8/500 Directives148298 +Node: H8/500 Opcodes148617 +Node: HPPA-Dependent153730 +Node: HPPA Notes154152 +Node: HPPA Options154899 +Node: HPPA Syntax155083 +Node: HPPA Floating Point156342 +Node: HPPA Directives156537 +Node: HPPA Opcodes163128 +Node: i386-Dependent163376 +Node: i386-Options164045 +Node: i386-Syntax164189 +Node: i386-Opcodes166139 +Node: i386-Regs168258 +Node: i386-prefixes169399 +Node: i386-Memory171068 +Node: i386-jumps173342 +Node: i386-Float174412 +Node: i386-16bit176402 +Node: i386-Notes178794 +Node: i960-Dependent179635 +Node: Options-i960180027 +Node: Floating Point-i960183908 +Node: Directives-i960184165 +Node: Opcodes for i960186185 +Node: callj-i960186791 +Node: Compare-and-branch-i960187266 +Node: M68K-Dependent189155 +Node: M68K-Opts189609 +Node: M68K-Syntax194376 +Node: M68K-Moto-Syntax196204 +Node: M68K-Float198782 +Node: M68K-Directives199291 +Node: M68K-opcodes199886 +Node: M68K-Branch200098 +Node: M68K-Chars202913 +Node: MIPS-Dependent203311 +Node: MIPS Opts204121 +Node: MIPS Object206957 +Node: MIPS Stabs208512 +Node: MIPS ISA209223 +Node: MIPS insn210325 +Node: MIPS option stack210804 +Node: SH-Dependent211517 +Node: SH Options211900 +Node: SH Syntax212065 +Node: SH-Chars212324 +Node: SH-Regs212603 +Node: SH-Addressing213202 +Node: SH Floating Point214096 +Node: SH Directives214392 +Node: SH Opcodes214597 +Node: Sparc-Dependent218844 +Node: Sparc-Opts219217 +Node: Sparc-Aligned-Data220894 +Node: Sparc-Float221738 +Node: Sparc-Directives221928 +Node: Z8000-Dependent223146 +Node: Z8000 Options224106 +Node: Z8000 Syntax224281 +Node: Z8000-Chars224557 +Node: Z8000-Regs224775 +Node: Z8000-Addressing225547 +Node: Z8000 Directives226490 +Node: Z8000 Opcodes228088 +Node: Vax-Dependent238024 +Node: VAX-Opts238531 +Node: VAX-float240821 +Node: VAX-directives241442 +Node: VAX-opcodes242291 +Node: VAX-branch242669 +Node: VAX-operands245164 +Node: VAX-no245916 +Node: Reporting Bugs246142 +Node: Bug Criteria246865 +Node: Bug Reporting247625 +Node: Acknowledgements254202 +Node: Index258830  End Tag Table diff -ur binutils-2.8/gas/doc/as.info-1 binutils-2.8.1/gas/doc/as.info-1 --- binutils-2.8/gas/doc/as.info-1 Wed Apr 30 13:14:59 1997 +++ binutils-2.8.1/gas/doc/as.info-1 Mon May 26 13:47:07 1997 @@ -291,7 +291,7 @@ * Menu: * Manual:: Structure of this Manual -* GNU Assembler:: as, the GNU Assembler +* GNU Assembler:: The GNU Assembler * Object Formats:: Object File Formats * Command Line:: Command Line * Input Files:: Input Files @@ -323,8 +323,8 @@  File: as.info, Node: GNU Assembler, Next: Object Formats, Prev: Manual, Up: Overview -as, the GNU Assembler -===================== +The GNU Assembler +================= GNU `as' is really a family of assemblers. If you use (or have used) the GNU assembler on one architecture, you should find a fairly @@ -1244,8 +1244,8 @@ * Menu: * Secs Background:: Background -* Ld Sections:: ld Sections -* As Sections:: as Internal Sections +* Ld Sections:: Linker Sections +* As Sections:: Assembler Internal Sections * Sub-Sections:: Sub-Sections * bss:: bss Section diff -ur binutils-2.8/gas/doc/as.info-2 binutils-2.8.1/gas/doc/as.info-2 --- binutils-2.8/gas/doc/as.info-2 Wed Apr 30 13:14:59 1997 +++ binutils-2.8.1/gas/doc/as.info-2 Mon May 26 13:47:07 1997 @@ -26,8 +26,8 @@  File: as.info, Node: Ld Sections, Next: As Sections, Prev: Secs Background, Up: Sections -ld Sections -=========== +Linker Sections +=============== `ld' deals with just four kinds of sections, summarized below. @@ -87,8 +87,8 @@  File: as.info, Node: As Sections, Next: Sub-Sections, Prev: Ld Sections, Up: Sections -as Internal Sections -==================== +Assembler Internal Sections +=========================== These sections are meant only for the internal use of `as'. They have no meaning at run-time. You do not really need to know about these diff -ur binutils-2.8/gas/doc/as.info-7 binutils-2.8.1/gas/doc/as.info-7 --- binutils-2.8/gas/doc/as.info-7 Wed Apr 30 13:14:59 1997 +++ binutils-2.8.1/gas/doc/as.info-7 Mon May 26 13:47:07 1997 @@ -66,8 +66,8 @@ * 29K support: AMD29K-Dependent. * @word modifier, D10V: D10V-Word. * $ in symbol names <1>: H8/500-Chars. -* $ in symbol names <2>: SH-Chars. -* $ in symbol names: D10V-Chars. +* $ in symbol names <2>: D10V-Chars. +* $ in symbol names: SH-Chars. * -+ option, VAX/VMS: VAX-Opts. * -A options, i960: Options-i960. * -b option, i960: Options-i960. @@ -81,7 +81,7 @@ * -no-relax option, i960: Options-i960. * -nocpp ignored (MIPS): MIPS Opts. * -S, ignored on VAX: VAX-Opts. -* -T, ignored on VAX: VAX-Opts. +* -t, ignored on VAX: VAX-Opts. * -V, redundant on VAX: VAX-Opts. * .insn: MIPS insn. * .param on HPPA: HPPA Directives. @@ -90,8 +90,6 @@ * .set push: MIPS option stack. * . (symbol): Dot. * : (label): Statements. -* as bugs, reporting: Bug Reporting. -* as version: v. * \" (doublequote character): Strings. * \DDD (octal character code): Strings. * \XD... (hex character code): Strings. @@ -102,8 +100,8 @@ * \r (carriage return character): Strings. * \t (tab): Strings. * a.out symbol attributes: a.out Symbols. -* abort directive: Abort. * ABORT directive: ABORT. +* abort directive: Abort. * align directive: Align. * align directive, SPARC: Sparc-Directives. * app-file directive: App-File. @@ -280,8 +278,10 @@ * arguments in expressions: Arguments. * arithmetic functions: Operators. * arithmetic operands: Arguments. +* assembler bugs, reporting: Bug Reporting. * assembler crash: Bug Criteria. * assembler internal logic error: As Sections. +* assembler version: v. * assembler, and linker: Secs Background. * assembly listings, enabling: a. * assigning values to symbols <1>: Setting Symbols. @@ -306,7 +306,7 @@ * bss section: Ld Sections. * bug criteria: Bug Criteria. * bug reports: Bug Reporting. -* bugs in as: Reporting Bugs. +* bugs in assembler: Reporting Bugs. * bus lock prefixes, i386: i386-prefixes. * bval: Z8000 Directives. * call instructions, i386: i386-Opcodes. @@ -397,16 +397,16 @@ * expressions, integer: Integer Exprs. * faster processing (-f): f. * fatal signal: Bug Criteria. -* file name, logical <1>: File. -* file name, logical: App-File. +* file name, logical <1>: App-File. +* file name, logical: File. * files, including: Include. * files, input: Input Files. * filling memory <1>: Skip. * filling memory: Space. * floating point numbers: Flonums. * floating point numbers (double): Double. -* floating point numbers (single) <1>: Float. -* floating point numbers (single): Single. +* floating point numbers (single) <1>: Single. +* floating point numbers (single): Float. * floating point, AMD 29K (IEEE): AMD29K Floating Point. * floating point, D10V: D10V-Float. * floating point, H8/300 (IEEE): H8/300 Floating Point. @@ -509,7 +509,7 @@ * integers, hexadecimal: Integers. * integers, octal: Integers. * integers, one byte: Byte. -* internal as sections: As Sections. +* internal assembler sections: As Sections. * invalid input: Bug Criteria. * invocation summary: Overview. * joining text and data sections: R. @@ -587,7 +587,7 @@ * manual, structure and purpose: Manual. * memory references, i386: i386-Memory. * merging text and data sections: R. -* messages from as: Errors. +* messages from assembler: Errors. * minus, permitted arguments: Infix Ops. * MIPS architecture options: MIPS Opts. * MIPS big-endian output: MIPS Opts. @@ -654,7 +654,7 @@ * options for i386 (none): i386-Options. * options for SPARC: Sparc-Opts. * options for VAX/VMS: VAX-Opts. -* options, all versions of as: Invoking. +* options, all versions of assembler: Invoking. * options, command line: Command Line. * options, D10V: D10V-Opts. * options, H8/300 (none): H8/300 Options. @@ -684,7 +684,7 @@ * pseudo-opcodes, M680x0: M68K-Branch. * pseudo-ops for branch, VAX: VAX-branch. * pseudo-ops, machine independent: Pseudo Ops. -* purpose of GNU as: GNU Assembler. +* purpose of GNU assembler: GNU Assembler. * real-mode code, i386: i386-16bit. * register names, AMD 29K: AMD29K-Regs. * register names, H8/300: H8/300-Regs. @@ -698,7 +698,7 @@ * relocation: Sections. * relocation example: Ld Sections. * repeat prefixes, i386: i386-prefixes. -* reporting bugs in as: Reporting Bugs. +* reporting bugs in assembler: Reporting Bugs. * return instructions, i386: i386-Syntax. * rsect: Z8000 Directives. * search path for .include: I. @@ -739,7 +739,7 @@ * SPARC support: Sparc-Dependent. * special characters, M680x0: M68K-Chars. * special purpose registers, AMD 29K: AMD29K-Regs. -* standard as sections: Secs Background. +* standard assembler sections: Secs Background. * standard input, as input file: Command Line. * statement on multiple lines: Statements. * statement separator character: Statements. @@ -819,7 +819,7 @@ * VAX support: Vax-Dependent. * Vax-11 C compatibility: VAX-Opts. * VAX/VMS options: VAX-Opts. -* version of as: v. +* version of assembler: v. * versions of symbols: Symver. * VMS (VAX) options: VAX-Opts. * warning for altered difference tables: K. diff -ur binutils-2.8/gas/doc/as.texinfo binutils-2.8.1/gas/doc/as.texinfo --- binutils-2.8/gas/doc/as.texinfo Wed Apr 30 12:53:27 1997 +++ binutils-2.8.1/gas/doc/as.texinfo Mon May 26 13:32:44 1997 @@ -510,7 +510,7 @@ @menu * Manual:: Structure of this Manual -* GNU Assembler:: @value{AS}, the GNU Assembler +* GNU Assembler:: The GNU Assembler * Object Formats:: Object File Formats * Command Line:: Command Line * Input Files:: Input Files @@ -591,7 +591,7 @@ @c directives). @node GNU Assembler -@section @value{AS}, the GNU Assembler +@section The GNU Assembler @sc{gnu} @code{as} is really a family of assemblers. @ifclear GENERIC @@ -604,7 +604,7 @@ including object file formats, most assembler directives (often called @dfn{pseudo-ops}) and assembler syntax.@refill -@cindex purpose of @sc{gnu} @code{@value{AS}} +@cindex purpose of @sc{gnu} assembler @code{@value{AS}} is primarily intended to assemble the output of the @sc{gnu} C compiler @code{@value{GCC}} for use by the linker @code{@value{LD}}. Nevertheless, we've tried to make @code{@value{AS}} @@ -779,7 +779,7 @@ @cindex error messsages @cindex warning messages -@cindex messages from @code{@value{AS}} +@cindex messages from assembler @code{@value{AS}} may write warnings and error messages to the standard error file (usually your terminal). This should not happen when a compiler runs @code{@value{AS}} automatically. Warnings report an assumption made so @@ -827,7 +827,7 @@ @node Invoking @chapter Command-Line Options -@cindex options, all versions of @code{@value{AS}} +@cindex options, all versions of assembler This chapter describes command-line options available in @emph{all} versions of the @sc{gnu} assembler; @pxref{Machine Dependencies}, for options specific @ifclear GENERIC @@ -1214,8 +1214,8 @@ @kindex -v @kindex -version -@cindex @code{@value{AS}} version -@cindex version of @code{@value{AS}} +@cindex assembler version +@cindex version of assembler You can find out what version of as is running by including the option @samp{-v} (which you can also spell as @samp{-version}) on the command line. @@ -1907,8 +1907,8 @@ @menu * Secs Background:: Background -* Ld Sections:: @value{LD} Sections -* As Sections:: @value{AS} Internal Sections +* Ld Sections:: Linker Sections +* As Sections:: Assembler Internal Sections * Sub-Sections:: Sub-Sections * bss:: bss Section @end menu @@ -1944,7 +1944,7 @@ ensure they end on a word (sixteen bit) boundary. @end ifset -@cindex standard @code{@value{AS}} sections +@cindex standard assembler sections An object file written by @code{@value{AS}} has at least three sections, any of which may be empty. These are named @dfn{text}, @dfn{data} and @dfn{bss} sections. @@ -2052,7 +2052,7 @@ use of @code{@value{AS}} and have no meaning except during assembly. @node Ld Sections -@section @value{LD} Sections +@section Linker Sections @code{@value{LD}} deals with just four kinds of sections, summarized below. @table @strong @@ -2157,9 +2157,9 @@ @c END TEXI2ROFF-KILL @node As Sections -@section @value{AS} Internal Sections +@section Assembler Internal Sections -@cindex internal @code{@value{AS}} sections +@cindex internal assembler sections @cindex sections in messages, internal These sections are meant only for the internal use of @code{@value{AS}}. They have no meaning at run-time. You do not really need to know about these @@ -4668,8 +4668,8 @@ @node Reporting Bugs @chapter Reporting Bugs -@cindex bugs in @code{@value{AS}} -@cindex reporting bugs in @code{@value{AS}} +@cindex bugs in assembler +@cindex reporting bugs in assembler Your bug reports play an essential role in making @code{@value{AS}} reliable. @@ -4718,7 +4718,7 @@ @node Bug Reporting @section How to report bugs @cindex bug reports -@cindex @code{@value{AS}} bugs, reporting +@cindex assembler bugs, reporting A number of companies and individuals offer support for @sc{gnu} products. If you obtained @code{@value{AS}} from a support organization, we recommend you diff -ur binutils-2.8/gas/expr.c binutils-2.8.1/gas/expr.c --- binutils-2.8/gas/expr.c Wed Apr 30 12:53:33 1997 +++ binutils-2.8.1/gas/expr.c Mon May 26 13:32:47 1997 @@ -1469,7 +1469,7 @@ && SEG_NORMAL (S_GET_SEGMENT (right.X_add_symbol))) { - resultP->X_add_number += right.X_add_number; + resultP->X_add_number -= right.X_add_number; resultP->X_add_number += (S_GET_VALUE (resultP->X_add_symbol) - S_GET_VALUE (right.X_add_symbol)); resultP->X_op = O_constant; diff -ur binutils-2.8/gas/input-scrub.c binutils-2.8.1/gas/input-scrub.c --- binutils-2.8/gas/input-scrub.c Wed Apr 30 12:53:35 1997 +++ binutils-2.8.1/gas/input-scrub.c Mon May 26 13:32:48 1997 @@ -74,7 +74,7 @@ static sb from_sb; /* The number of nested sb structures we have included. */ -static int macro_nest; +int macro_nest; /* We can have more than one source file open at once, though the info for all but the latest one are saved off in a struct input_save. These files remain @@ -293,6 +293,7 @@ if (sb_index >= from_sb.len) { sb_kill (&from_sb); + cond_finish_check (macro_nest); --macro_nest; partial_where = NULL; if (next_saved_file != NULL) diff -ur binutils-2.8/gas/macro.h binutils-2.8.1/gas/macro.h --- binutils-2.8/gas/macro.h Wed Apr 30 12:53:38 1997 +++ binutils-2.8.1/gas/macro.h Mon May 26 13:32:49 1997 @@ -32,6 +32,10 @@ extern int macro_defined; +/* The macro nesting level. */ + +extern int macro_nest; + extern int buffer_and_nest PARAMS ((const char *, const char *, sb *, int (*) PARAMS ((sb *)))); extern void macro_init diff -ur binutils-2.8/gas/read.c binutils-2.8.1/gas/read.c --- binutils-2.8/gas/read.c Wed Apr 30 12:53:39 1997 +++ binutils-2.8.1/gas/read.c Mon May 26 13:32:50 1997 @@ -2163,6 +2163,7 @@ s_mexit (ignore) int ignore; { + cond_exit_macro (macro_nest); buffer_limit = input_scrub_next_buffer (&input_line_pointer); } diff -ur binutils-2.8/gprof/ChangeLog binutils-2.8.1/gprof/ChangeLog --- binutils-2.8/gprof/ChangeLog Wed Apr 30 12:59:30 1997 +++ binutils-2.8.1/gprof/ChangeLog Mon May 26 13:35:32 1997 @@ -1,3 +1,7 @@ +Tue May 13 10:43:11 1997 Ian Lance Taylor + + * gprof.c (VERSION): Define as "2.8.1". + Thu Apr 3 18:55:05 1997 Ian Lance Taylor * gprof.c (VERSION): Define as "2.8". diff -ur binutils-2.8/gprof/gprof.c binutils-2.8.1/gprof/gprof.c --- binutils-2.8/gprof/gprof.c Wed Apr 30 12:59:36 1997 +++ binutils-2.8.1/gprof/gprof.c Mon May 26 13:35:34 1997 @@ -30,7 +30,7 @@ #include "source.h" #include "sym_ids.h" -#define VERSION "2.8" +#define VERSION "2.8.1" const char *whoami; const char *function_mapping_file; diff -ur binutils-2.8/include/opcode/ChangeLog binutils-2.8.1/include/opcode/ChangeLog --- binutils-2.8/include/opcode/ChangeLog Wed Apr 30 12:57:17 1997 +++ binutils-2.8.1/include/opcode/ChangeLog Mon May 26 13:34:39 1997 @@ -1,3 +1,18 @@ +Mon May 12 16:26:50 1997 H.J. Lu + + * i386.h (movd): only Reg32 is allowed. + + * i386.h: add fcomp and ud2. From Wayne Scott + . + +Mon May 5 17:16:21 1997 Ian Lance Taylor + + * i386.h: Add MMX instructions. + +Mon May 5 12:45:19 1997 H.J. Lu + + * i386.h: Remove W modifier from conditional move instructions. + Mon Apr 14 14:56:58 1997 Ian Lance Taylor * i386.h: Change the opcodes for fsubp, fsubrp, fdivp, and fdivrp diff -ur binutils-2.8/include/opcode/i386.h binutils-2.8.1/include/opcode/i386.h --- binutils-2.8/include/opcode/i386.h Wed Apr 30 12:57:19 1997 +++ binutils-2.8.1/include/opcode/i386.h Mon May 26 13:34:39 1997 @@ -535,6 +535,7 @@ /* comparison (with pop) */ {"fcomp", 1, 0xd8d8, _, ShortForm, { FloatReg, 0, 0} }, +{"fcomp", 0, 0xd8d9, _, NoModrm, {0, 0, 0} }, /* fcomp %st, %st(1) */ {"fcomps", 1, 0xd8, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem float */ {"ficompl", 1, 0xda, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem word */ {"fcompl", 1, 0xdc, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem double */ @@ -777,22 +778,24 @@ /* Pentium Pro extensions */ {"rdpmc", 0, 0x0f33, _, NoModrm, { 0, 0, 0} }, -{"cmovo", 2, 0x0f40, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovno", 2, 0x0f41, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovb", 2, 0x0f42, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovae", 2, 0x0f43, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmove", 2, 0x0f44, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovne", 2, 0x0f45, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovbe", 2, 0x0f46, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmova", 2, 0x0f47, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovs", 2, 0x0f48, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovns", 2, 0x0f49, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovp", 2, 0x0f4a, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovnp", 2, 0x0f4b, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovl", 2, 0x0f4c, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovge", 2, 0x0f4d, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovle", 2, 0x0f4e, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, -{"cmovg", 2, 0x0f4f, _, W|Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"ud2", 0, 0x0fff, _, NoModrm, {0, 0, 0} }, /* official undefined instr. */ + +{"cmovo", 2, 0x0f40, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovno", 2, 0x0f41, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovb", 2, 0x0f42, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovae", 2, 0x0f43, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmove", 2, 0x0f44, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovne", 2, 0x0f45, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovbe", 2, 0x0f46, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmova", 2, 0x0f47, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovs", 2, 0x0f48, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovns", 2, 0x0f49, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovp", 2, 0x0f4a, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovnp", 2, 0x0f4b, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovl", 2, 0x0f4c, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovge", 2, 0x0f4d, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovle", 2, 0x0f4e, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, +{"cmovg", 2, 0x0f4f, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} }, {"fcmovb", 2, 0xdac0, _, ShortForm, { FloatReg, FloatAcc, 0} }, {"fcmove", 2, 0xdac8, _, ShortForm, { FloatReg, FloatAcc, 0} }, @@ -808,6 +811,66 @@ {"fcomip", 2, 0xdff0, _, ShortForm, { FloatReg, FloatAcc, 0} }, {"fucomip",2, 0xdfe8, _, ShortForm, { FloatReg, FloatAcc, 0} }, +/* MMX instructions. */ + +{"emms", 0, 0x0f77, _, NoModrm, { 0, 0, 0 } }, +{"movd", 2, 0x0f6e, _, Modrm, { Reg32|WordMem, RegMMX, 0 } }, +{"movd", 2, 0x0f7e, _, Modrm, { RegMMX, Reg32|WordMem, 0 } }, +{"movq", 2, 0x0f6f, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"movq", 2, 0x0f7f, _, Modrm, { RegMMX, RegMMX|WordMem, 0 } }, +{"packssdw", 2, 0x0f6b, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"packsswb", 2, 0x0f63, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"packuswb", 2, 0x0f67, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddb", 2, 0x0ffc, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddw", 2, 0x0ffd, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddd", 2, 0x0ffe, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddsb", 2, 0x0fec, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddsw", 2, 0x0fed, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddusb", 2, 0x0fdc, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"paddusw", 2, 0x0fdd, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pand", 2, 0x0fda, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pandn", 2, 0x0fdf, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpeqb", 2, 0x0f74, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpeqw", 2, 0x0f75, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpeqd", 2, 0x0f76, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpgtb", 2, 0x0f64, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpgtw", 2, 0x0f65, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pcmpgtd", 2, 0x0f66, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pmaddwd", 2, 0x0ff5, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pmulhw", 2, 0x0fe5, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pmullw", 2, 0x0fd5, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"por", 2, 0x0feb, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psllw", 2, 0x0ff1, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psllw", 2, 0x0f71, 6, Modrm, { Imm8, RegMMX, 0 } }, +{"pslld", 2, 0x0ff2, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pslld", 2, 0x0f72, 6, Modrm, { Imm8, RegMMX, 0 } }, +{"psllq", 2, 0x0ff3, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psllq", 2, 0x0f73, 6, Modrm, { Imm8, RegMMX, 0 } }, +{"psraw", 2, 0x0fe1, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psraw", 2, 0x0f71, 4, Modrm, { Imm8, RegMMX, 0 } }, +{"psrad", 2, 0x0fe2, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psrad", 2, 0x0f72, 4, Modrm, { Imm8, RegMMX, 0 } }, +{"psrlw", 2, 0x0fd1, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psrlw", 2, 0x0f71, 2, Modrm, { Imm8, RegMMX, 0 } }, +{"psrld", 2, 0x0fd2, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psrld", 2, 0x0f72, 2, Modrm, { Imm8, RegMMX, 0 } }, +{"psrlq", 2, 0x0fd3, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psrlq", 2, 0x0f73, 2, Modrm, { Imm8, RegMMX, 0 } }, +{"psubb", 2, 0x0ff8, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubw", 2, 0x0ff9, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubd", 2, 0x0ffa, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubsb", 2, 0x0fe8, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubsw", 2, 0x0fe9, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubusb", 2, 0x0fd8, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"psubusw", 2, 0x0fd9, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpckhbw", 2, 0x0f68, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpckhwd", 2, 0x0f69, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpckhdq", 2, 0x0f6a, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpcklbw", 2, 0x0f60, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpcklwd", 2, 0x0f61, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"punpckldq", 2, 0x0f62, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, +{"pxor", 2, 0x0fef, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } }, + {"", 0, 0, 0, 0, { 0, 0, 0} } /* sentinel */ }; #undef _ @@ -847,7 +910,10 @@ {"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} + {"st(6)", FloatReg, 6}, {"st(7)", FloatReg, 7}, + {"mm0", RegMMX, 0}, {"mm1", RegMMX, 1}, {"mm2", RegMMX, 2}, + {"mm3", RegMMX, 3}, {"mm4", RegMMX, 4}, {"mm5", RegMMX, 5}, + {"mm6", RegMMX, 6}, {"mm7", RegMMX, 7} }; #define MAX_REG_NAME_SIZE 8 /* for parsing register names from input */ diff -ur binutils-2.8/ld/ChangeLog binutils-2.8.1/ld/ChangeLog --- binutils-2.8/ld/ChangeLog Wed Apr 30 12:57:45 1997 +++ binutils-2.8.1/ld/ChangeLog Mon May 26 13:34:49 1997 @@ -1,3 +1,31 @@ +Wed May 21 17:44:15 1997 Ian Lance Taylor + + * ldmain.c (main): Correct check of fclose return value when + handling --force-exe-suffix. + +Tue May 13 10:43:26 1997 Ian Lance Taylor + + * ldver.c: Set to "2.8.1". + +Mon May 12 11:11:06 1997 Andreas Schwab + + * scripttempl/elf.sc: Don't align the data segment on the next 8 + byte boundary, instead let the linker use whatever the individual + sections require. + +Tue May 6 13:21:19 1997 Ian Lance Taylor + + From Sean McNeil : + * emultempl/pe.em (sort_by_file_name): Sort by archive name + first. + (sort_sections): Sort all sections, not just sections in the same + archive. + +Mon May 5 18:19:55 1997 Philip Blundell + + * configure.tgt, configure.host: cope with '*-*-linux-gnuaout' + targets. + Wed Apr 30 12:23:21 1997 Manfred Hollstein * scripttempl/m88kbcs.sc (__.initp.end, _etext): Added whitespace @@ -16,7 +44,7 @@ Thu Apr 3 18:54:20 1997 Ian Lance Taylor - * ldver.c (ld_program_version): Set to "2.8"; + * ldver.c (ld_program_version): Set to "2.8". Wed Apr 2 11:55:27 1997 Ian Lance Taylor diff -ur binutils-2.8/ld/configure.host binutils-2.8.1/ld/configure.host --- binutils-2.8/ld/configure.host Wed Apr 30 12:57:46 1997 +++ binutils-2.8.1/ld/configure.host Mon May 26 13:34:49 1997 @@ -74,7 +74,7 @@ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /lib/crtn.o' ;; -i[3456]86-*-linuxaout* | i[3456]86-*-linuxoldld) +i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld) HOSTING_CRT0=/usr/lib/crt0.o ;; @@ -102,7 +102,7 @@ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o' ;; -m68*-*-linuxaout*) +m68*-*-linux*aout*) HOSTING_CRT0=/usr/lib/crt0.o ;; diff -ur binutils-2.8/ld/configure.tgt binutils-2.8.1/ld/configure.tgt --- binutils-2.8/ld/configure.tgt Wed Apr 30 12:57:47 1997 +++ binutils-2.8.1/ld/configure.tgt Mon May 26 13:34:49 1997 @@ -22,7 +22,7 @@ sparc*-*-coff) targ_emul=coff_sparc ;; sparc*-*-elf) targ_emul=elf32_sparc ;; sparc*-*-sysv4*) targ_emul=elf32_sparc ;; -sparc*-*-linuxaout*) targ_emul=sparclinux +sparc*-*-linux*aout*) targ_emul=sparclinux targ_extra_emuls="elf32_sparc sun4" tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'` tdir_sun4=sparc-sun-sunos4 @@ -62,7 +62,7 @@ i[3456]86-*-bsd386) targ_emul=i386bsd ;; i[3456]86-*-bsdi*) targ_emul=i386bsd ;; i[3456]86-*-aout) targ_emul=i386aout ;; -i[3456]86-*-linuxaout*) targ_emul=i386linux +i[3456]86-*-linux*aout*) targ_emul=i386linux targ_extra_emuls=elf_i386 tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;; @@ -110,7 +110,7 @@ m68*-*-coff) targ_emul=m68kcoff ;; m68*-*-elf) targ_emul=m68kelf ;; m68*-*-hpux*) targ_emul=hp3hpux ;; -m68k-*-linuxaout*) targ_emul=m68klinux +m68k-*-linux*aout*) targ_emul=m68klinux targ_extra_emuls=m68kelf tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` ;; diff -ur binutils-2.8/ld/emultempl/pe.em binutils-2.8.1/ld/emultempl/pe.em --- binutils-2.8/ld/emultempl/pe.em Wed Apr 30 12:58:17 1997 +++ binutils-2.8.1/ld/emultempl/pe.em Mon May 26 13:35:00 1997 @@ -431,6 +431,13 @@ { lang_statement_union_type **ra = a; lang_statement_union_type **rb = b; + int i; + + i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename, + (*rb)->input_section.ifile->the_bfd->my_archive->filename); + if (i != 0) + return i; + return strcmp ((*ra)->input_section.ifile->filename, (*rb)->input_section.ifile->filename); } @@ -514,12 +521,12 @@ if (s->wild_statement.section_name != NULL && strncmp (s->wild_statement.section_name, ".idata", 6) == 0) { - /* Sort any children in the same archive. Run through all - the children of this wild statement, when an - input_section in an archive is found, scan forward to - find all input_sections which are in the same archive. - Sort them by their filename and then re-thread the - pointer chain. */ + /* Sort the children. We want to sort any objects in + the same archive. In order to handle the case of + including a single archive multiple times, we sort + all the children by archive name and then by object + name. After sorting them, we re-thread the pointer + chain. */ while (*p) { @@ -533,9 +540,7 @@ int count; for (end = start, count = 0; - end && end->header.type == lang_input_section_enum - && (end->input_section.ifile->the_bfd->my_archive - == start->input_section.ifile->the_bfd->my_archive); + end && end->header.type == lang_input_section_enum; end = end->next) count++; diff -ur binutils-2.8/ld/ldmain.c binutils-2.8.1/ld/ldmain.c --- binutils-2.8/ld/ldmain.c Wed Apr 30 12:57:52 1997 +++ binutils-2.8.1/ld/ldmain.c Mon May 26 13:34:51 1997 @@ -396,7 +396,7 @@ } } fclose (src); - if (!fclose (dst)) + if (fclose (dst) == EOF) { einfo ("%P: Error closing file `%s'\n", dst_name); } diff -ur binutils-2.8/ld/ldver.c binutils-2.8.1/ld/ldver.c --- binutils-2.8/ld/ldver.c Wed Apr 30 12:57:53 1997 +++ binutils-2.8.1/ld/ldver.c Mon May 26 13:34:51 1997 @@ -26,7 +26,7 @@ #include "ldemul.h" #include "ldmain.h" -const char *ld_program_version = "2.8"; +const char *ld_program_version = "2.8.1"; void ldversion (noisy) diff -ur binutils-2.8/ld/scripttempl/elf.sc binutils-2.8.1/ld/scripttempl/elf.sc --- binutils-2.8/ld/scripttempl/elf.sc Wed Apr 30 12:58:20 1997 +++ binutils-2.8.1/ld/scripttempl/elf.sc Mon May 26 13:35:01 1997 @@ -107,7 +107,7 @@ /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ - ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};} + ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};} .data ${RELOCATING-0} : { diff -ur binutils-2.8/ld/testsuite/ChangeLog binutils-2.8.1/ld/testsuite/ChangeLog --- binutils-2.8/ld/testsuite/ChangeLog Wed Apr 30 12:58:27 1997 +++ binutils-2.8.1/ld/testsuite/ChangeLog Mon May 26 13:35:07 1997 @@ -1,3 +1,8 @@ +Mon May 12 11:17:55 1997 Ian Lance Taylor + + * config/default.exp: Use $base_dir rather than $objdir when + setting ld. From John David Anglin . + Wed Mar 26 13:56:10 1997 Ian Lance Taylor * ld-srec/srec.exp: Don't expect failures on mips*-*-elf*. diff -ur binutils-2.8/ld/testsuite/config/default.exp binutils-2.8.1/ld/testsuite/config/default.exp --- binutils-2.8/ld/testsuite/config/default.exp Wed Apr 30 12:58:27 1997 +++ binutils-2.8.1/ld/testsuite/config/default.exp Mon May 26 13:35:07 1997 @@ -19,7 +19,7 @@ # if ![info exists ld] then { - set ld [findfile $objdir/ld.new $objdir/ld.new [transform ld]] + set ld [findfile $base_dir/ld.new $base_dir/ld.new [transform ld]] } if ![info exists as] then { diff -ur binutils-2.8/opcodes/ChangeLog binutils-2.8.1/opcodes/ChangeLog --- binutils-2.8/opcodes/ChangeLog Wed Apr 30 12:56:36 1997 +++ binutils-2.8.1/opcodes/ChangeLog Mon May 26 13:34:15 1997 @@ -1,3 +1,17 @@ +Mon May 12 15:10:53 1997 Jim Wilson + + * m68k-opc.c (moveb): Change $d to %d. + +Mon May 5 14:28:41 1997 Ian Lance Taylor + + * i386-dis.c: (dis386_twobyte): Add MMX instructions. + (twobyte_has_modrm): Likewise. + (grps): Likewise. + (OP_MMX, OP_EM, OP_MS): New static functions. + + * i386-dis.c: Revert patch of April 4. The output now matches + what gcc generates. + Mon Apr 14 12:13:51 1997 Ian Lance Taylor From Thomas Graichen : diff -ur binutils-2.8/opcodes/i386-dis.c binutils-2.8.1/opcodes/i386-dis.c --- binutils-2.8/opcodes/i386-dis.c Wed Apr 30 12:56:44 1997 +++ binutils-2.8.1/opcodes/i386-dis.c Mon May 26 13:34:18 1997 @@ -144,6 +144,10 @@ #define fs OP_REG, fs_reg #define gs OP_REG, gs_reg +#define MX OP_MMX, 0 +#define EM OP_EM, v_mode +#define MS OP_MS, b_mode + typedef int (*op_rtn) PARAMS ((int bytemode, int aflag, int dflag)); static int OP_E PARAMS ((int, int, int)); @@ -167,6 +171,9 @@ #if 0 static int OP_ONE PARAMS ((int, int, int)); #endif +static int OP_MMX PARAMS ((int, int, int)); +static int OP_EM PARAMS ((int, int, int)); +static int OP_MS PARAMS ((int, int, int)); static void append_prefix PARAMS ((void)); static void set_op PARAMS ((int op)); @@ -235,6 +242,9 @@ #define GRP7 NULL, NULL, 14 #define GRP8 NULL, NULL, 15 #define GRP9 NULL, NULL, 16 +#define GRP10 NULL, NULL, 17 +#define GRP11 NULL, NULL, 18 +#define GRP12 NULL, NULL, 19 #define FLOATCODE 50 #define FLOAT NULL, NULL, FLOATCODE @@ -593,17 +603,36 @@ { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, /* 60 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "punpcklbw", MX, EM }, + { "punpcklwd", MX, EM }, + { "punpckldq", MX, EM }, + { "packsswb", MX, EM }, + { "pcmpgtb", MX, EM }, + { "pcmpgtw", MX, EM }, + { "pcmpgtd", MX, EM }, + { "packuswb", MX, EM }, /* 68 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "punpckhbw", MX, EM }, + { "punpckhwd", MX, EM }, + { "punpckhdq", MX, EM }, + { "packssdw", MX, EM }, + { "(bad)" }, { "(bad)" }, + { "movd", MX, Ev }, + { "movq", MX, EM }, /* 70 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "(bad)" }, + { GRP10 }, + { GRP11 }, + { GRP12 }, + { "pcmpeqb", MX, EM }, + { "pcmpeqw", MX, EM }, + { "pcmpeqd", MX, EM }, + { "emms" }, /* 78 */ { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "(bad)" }, { "(bad)" }, + { "movd", Ev, MX }, + { "movq", EM, MX }, /* 80 */ { "jo", Jv }, { "jno", Jv }, @@ -695,23 +724,56 @@ { "bswap", eSI }, { "bswap", eDI }, /* d0 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "(bad)" }, + { "psrlw", MX, EM }, + { "psrld", MX, EM }, + { "psrlq", MX, EM }, + { "(bad)" }, + { "pmullw", MX, EM }, + { "(bad)" }, { "(bad)" }, /* d8 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "psubusb", MX, EM }, + { "psubusw", MX, EM }, + { "pand", MX, EM }, + { "(bad)" }, + { "paddusb", MX, EM }, + { "paddusw", MX, EM }, + { "(bad)" }, + { "pand", MX, EM }, /* e0 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "(bad)" }, + { "psraw", MX, EM }, + { "psrad", MX, EM }, + { "(bad)" }, + { "(bad)" }, + { "pmulhw", MX, EM }, + { "(bad)" }, { "(bad)" }, /* e8 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "psubsb", MX, EM }, + { "psubsw", MX, EM }, + { "(bad)" }, + { "por", MX, EM }, + { "paddsb", MX, EM }, + { "paddsw", MX, EM }, + { "(bad)" }, + { "pxor", MX, EM }, /* f0 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "(bad)" }, + { "psllw", MX, EM }, + { "pslld", MX, EM }, + { "psllq", MX, EM }, + { "(bad)" }, + { "pmaddwd", MX, EM }, + { "(bad)" }, { "(bad)" }, /* f8 */ - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, - { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" }, + { "psubb", MX, EM }, + { "psubw", MX, EM }, + { "psubd", MX, EM }, + { "(bad)" }, + { "paddb", MX, EM }, + { "paddw", MX, EM }, + { "paddd", MX, EM }, + { "(bad)" } }; static const unsigned char onebyte_has_modrm[256] = { @@ -734,22 +796,22 @@ }; static const unsigned char twobyte_has_modrm[256] = { - 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, - 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */ + /* 10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */ + /* 20 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* 2f */ + /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */ + /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */ + /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */ + /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1, /* 6f */ + /* 70 */ 0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */ + /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */ + /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */ + /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */ + /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */ + /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */ + /* d0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,0,1, /* df */ + /* e0 */ 0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,1, /* ef */ + /* f0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0 /* ff */ }; static char obuf[100]; @@ -966,6 +1028,39 @@ { "(bad)" }, { "(bad)" }, { "(bad)" }, + }, + /* GRP10 */ + { + { "(bad)" }, + { "(bad)" }, + { "psrlw", MS, Ib }, + { "(bad)" }, + { "psraw", MS, Ib }, + { "(bad)" }, + { "psllw", MS, Ib }, + { "(bad)" }, + }, + /* GRP11 */ + { + { "(bad)" }, + { "(bad)" }, + { "psrld", MS, Ib }, + { "(bad)" }, + { "psrad", MS, Ib }, + { "(bad)" }, + { "pslld", MS, Ib }, + { "(bad)" }, + }, + /* GRP12 */ + { + { "(bad)" }, + { "(bad)" }, + { "psrlq", MS, Ib }, + { "(bad)" }, + { "(bad)" }, + { "(bad)" }, + { "psllq", MS, Ib }, + { "(bad)" }, } }; @@ -1402,10 +1497,10 @@ { "fmulp", STi, ST }, { "(bad)" }, { FGRPde_3 }, - { "fsubrp", STi, ST }, { "fsubp", STi, ST }, - { "fdivrp", STi, ST }, + { "fsubrp", STi, ST }, { "fdivp", STi, ST }, + { "fdivrp", STi, ST }, }, /* df */ { @@ -2117,4 +2212,42 @@ break; } return (0); +} + +static int +OP_MMX (bytemode, aflag, dflag) + int bytemode; + int aflag; + int dflag; +{ + sprintf (scratchbuf, "%%mm%d", reg); + oappend (scratchbuf); + return 0; +} + +static int +OP_EM (bytemode, aflag, dflag) + int bytemode; + int aflag; + int dflag; +{ + if (mod != 3) + return OP_E (bytemode, aflag, dflag); + + codep++; + sprintf (scratchbuf, "%%mm%d", rm); + oappend (scratchbuf); + return 0; +} + +static int +OP_MS (bytemode, aflag, dflag) + int bytemode; + int aflag; + int dflag; +{ + ++codep; + sprintf (scratchbuf, "%%mm%d", rm); + oappend (scratchbuf); + return 0; } diff -ur binutils-2.8/opcodes/m68k-opc.c binutils-2.8.1/opcodes/m68k-opc.c --- binutils-2.8/opcodes/m68k-opc.c Wed Apr 30 12:56:47 1997 +++ binutils-2.8.1/opcodes/m68k-opc.c Mon May 26 13:34:19 1997 @@ -1285,7 +1285,7 @@ /* The move opcode can generate the movea and moveq instructions. */ {"moveb", one(0010000), one(0170000), ";b$d", m68000up }, -{"moveb", one(0010000), one(0170000), "ms$d", mcf5200 }, +{"moveb", one(0010000), one(0170000), "ms%d", mcf5200 }, {"moveb", one(0010000), one(0170000), "nspd", mcf5200 }, {"moveb", one(0010000), one(0170000), "obmd", mcf5200 }, diff -ur binutils-2.8/texinfo/texinfo.tex binutils-2.8.1/texinfo/texinfo.tex --- binutils-2.8/texinfo/texinfo.tex Wed Apr 30 12:57:26 1997 +++ binutils-2.8.1/texinfo/texinfo.tex Mon May 26 13:34:41 1997 @@ -1,7 +1,8 @@ -%% TeX macros to handle texinfo files +%% TeX macros to handle Texinfo files. +%% $Id: texinfo.tex,v 2.201 1997/05/24 22:06:39 karl Exp $ % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, -% 94, 95, 1996 Free Software Foundation, Inc. +% 94, 95, 96, 97 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 @@ -35,7 +36,7 @@ % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 2.185 $ +\deftexinfoversion$Revision: 2.201 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number @@ -59,7 +60,6 @@ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t -\let\ptextilde=\~ % 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 @@ -72,7 +72,6 @@ \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } -\let\~ = \tie % And make it available as @~. \message{Basics,} @@ -104,8 +103,8 @@ \hyphenation{eshell} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset -\newdimen \normaloffset +\newdimen \bindingoffset +\newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file @@ -119,81 +118,95 @@ \showboxbreadth\maxdimen\showboxdepth\maxdimen }% -%---------------------Begin change----------------------- +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue % -%%%% For @cropmarks command. -% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\cornerlong \newdimen\cornerthick -\newdimen \topandbottommargin -\newdimen \outerhsize \newdimen \outervsize +\newdimen\topandbottommargin +\newdimen\outerhsize \newdimen\outervsize \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks \outerhsize=7in %\outervsize=9.5in % Alternative @smallbook page size is 9.25in \outervsize=9.25in \topandbottommargin=.75in -% -%---------------------End change----------------------- + +% 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. -\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} \def\onepageout#1{% - \hoffset=\normaloffset + \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}% + % {% - \escapechar = `\\ % use backslash in output files. - \indexdummies + % 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{% - {\let\hsize=\pagewidth \makeheadline}% + \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}% - {\let\hsize=\pagewidth \makefootline}% - }% - }% + \unvbox\footlinebox + % + \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 } -%%%% For @cropmarks command %%%% - -% Here is a modification of the main output routine for Near East Publications -% This provides right-angle cropmarks at all four corners. -% The contents of the page are centerlined into the cropmarks, -% and any desired binding offset is added as an \hskip on either -% site of the centerlined box. (P. A. MacKay, 12 November, 1986) -% -\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up -{\escapechar=`\\\relax % makes sure backslash is used in output files. - \shipout - \vbox to \outervsize{\hsize=\outerhsize - \vbox{\line{\ewtop\hfill\ewtop}} - \nointerlineskip - \line{\vbox{\moveleft\cornerthick\nstop} - \hfill - \vbox{\moveright\cornerthick\nstop}} - \vskip \topandbottommargin - \centerline{\ifodd\pageno\hskip\bindingoffset\fi - \vbox{ - {\let\hsize=\pagewidth \makeheadline} - \pagebody{#1} - {\let\hsize=\pagewidth \makefootline}} - \ifodd\pageno\else\hskip\bindingoffset\fi} - \vskip \topandbottommargin plus1fill minus1fill - \boxmaxdepth\cornerthick - \line{\vbox{\moveleft\cornerthick\nsbot} - \hfill - \vbox{\moveright\cornerthick\nsbot}} - \nointerlineskip - \vbox{\line{\ewbot\hfill\ewbot}} - }} - \advancepageno - \ifnum\outputpenalty>-20000 \else\dosupereject\fi} -% -% Do @cropmarks to get crop marks -\def\cropmarks{\let\onepageout=\croppageout } - \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} @@ -207,7 +220,6 @@ \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) @@ -850,7 +862,9 @@ % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % -\def\set{\begingroup\catcode` =10 \parsearg\setxxx} +\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}% @@ -871,10 +885,16 @@ % @value{foo} gets the text saved in variable foo. % -\def\value#1{\expandafter - \ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}} - \else \csname SET#1\endcsname \fi} +\def\value{\begingroup + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \valuexxx} +\def\valuexxx#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {\{No value for ``#1''\}}% + \else + \csname SET#1\endcsname + \fi +\endgroup} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. @@ -1251,8 +1271,6 @@ \def\ctrl #1{{\tt \rawbackslash \hat}#1} \let\file=\samp -\let\url=\samp % perhaps include a hypertex \special eventually -\def\email#1{$\langle${\tt #1}$\rangle$} % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1289,18 +1307,23 @@ { \catcode`\-=\active \catcode`\_=\active +\catcode`\|=\active \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} % The following is used by \doprintindex to insure that long function names % wrap around. It is necessary for - and _ to be active before the index is % read from the file, as \entry parses the arguments long before \code is % ever called. -- mycroft -\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} +% _ is always active; and it shouldn't be \let = to an _ that is a +% subscript character anyway. Then, @cindex @samp{_} (for example) +% fails. --karl +\global\def\indexbreaks{% + \catcode`\-=\active \let-\realdash +} } \def\realdash{-} -\def\realunder{_} \def\codedash{-\discretionary{}{}{}} -\def\codeunder{\normalunderscore\discretionary{}{}{}} +\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} \def\codex #1{\tclose{#1}\endgroup} %\let\exp=\tclose %Was temporary @@ -1314,11 +1337,17 @@ \else{\tclose{\ttsl\look}}\fi \else{\tclose{\ttsl\look}}\fi} +% @url, @email. Quotes do not seem necessary. +\let\url=\code % perhaps include a hypertex \special eventually +% rms does not like the angle brackets --karl, 17may97. +%\def\email#1{$\langle${\tt #1}$\rangle$} +\let\email=\code + % 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 @@ -1861,7 +1890,7 @@ \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{\in hmode at itemizeitem}\fi +\ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% @@ -1879,7 +1908,7 @@ % To make preamble: % -% Either define widths of columns in terms of percent of \hsize: +% Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % @@ -1897,13 +1926,13 @@ % the preamble, break the line within one argument and it % will parse correctly, i.e., % -% @multitable {Column 1 template} {Column 2 template} {Column 3 +% @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: -% @multitable {Column 1 template} {Column 2 template} +% @multitable {Column 1 template} {Column 2 template} % {Column 3 template} -% Each new table line starts with @item, each subsequent new column +% 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. @@ -1915,15 +1944,15 @@ % @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 +% @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 @@ -1937,7 +1966,7 @@ % 0pt means it depends on current normal line spacing. %%%% -% Dimensions +% Dimensions \newskip\multitableparskip \newskip\multitableparindent @@ -2007,18 +2036,18 @@ % To parse everything between @multitable and @item : \setuptable#1 \endsetuptable % Need to reset this to 0 after \setuptable. -\global\colcount=0\relax% +\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 + % \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 + % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % If user has set preamble in terms of percent of \hsize % we will use that dimension as the width of the column, and @@ -2030,19 +2059,31 @@ \ifsetpercent \else % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace + % we will advance \hsize by \multitablecolspace \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi -\noindent##\multistrut}\cr% + % 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 % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. + % 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. \global\everycr{\noalign{% -\filbreak%% keeps underfull box messages off when table breaks over pages. +% \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}} } @@ -2054,7 +2095,7 @@ %% 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. +%% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 @@ -2199,6 +2240,7 @@ \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}}% @@ -2296,7 +2338,7 @@ \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% - \let\folio=0 % We will expand all macros now EXCEPT \folio. + \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. % @@ -2370,27 +2412,16 @@ % Define the macros used in formatting output of the sorted index material. -% This is what you call to cause a particular index to get printed. -% Write -% @unnumbered Function Index -% @printindex fn - +% @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 - \def\indexbackslash{\rawbackslashxx}% - % 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. - \catcode`\\ = 0 - \catcode`\@ = 11 - \escapechar = `\\ - \begindoublecolumns % % See if the index file exists and is nonempty. \openin 1 \jobname.#1s @@ -2409,11 +2440,19 @@ \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 + \catcode`\@ = 11 + \escapechar = `\\ + \begindoublecolumns \input \jobname.#1s + \enddoublecolumns \fi \fi \closein 1 - \enddoublecolumns \endgroup} % These macros are used by the sorted index file itself. @@ -2515,24 +2554,39 @@ \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. - \output = {\global\setbox\partialpage - =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% + \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 % - % Now switch to the double-column output routine. - \output={\doublecolumnout}% + % 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 once. + % 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. + % 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) @@ -2553,100 +2607,103 @@ % (undoubled) page height minus any material left over from the % previous page. \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage - % box0 will be the left-hand column, box1 the right. + % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar - \unvbox255 \penalty\outputpenalty + \unvbox255 + \penalty\outputpenalty } \def\pagesofar{% - % The contents of the output page -- any previous material, + % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split. \unvbox\partialpage \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } \def\enddoublecolumns{% - \output={\balancecolumns}\eject % split what we have - \endgroup + \output = {\balancecolumns}\eject % split what we have + \endgroup % started in \begindoublecolumns + % % Back to normal single-column typesetting, but take account of the % fact that we just accumulated some stuff on the output page. - \pagegoal=\vsize + \pagegoal = \vsize } \def\balancecolumns{% - % Called on the last page of the double column material. - \setbox0=\vbox{\unvbox255}% + % Called at the end of the double column material. + \setbox0 = \vbox{\unvbox255}% \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 \splittopskip = \topskip % Loop until we get a decent breakpoint. - {\vbadness=10000 \loop \global\setbox3=\copy0 + {\vbadness=10000 \loop + \global\setbox3=\copy0 \global\setbox1=\vsplit3 to\dimen@ - \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}% + \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt + \repeat}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% \pagesofar } -\catcode `\@=\other +\catcode`\@ = \other \message{sectioning,} % Define chapters, sections, etc. -\newcount \chapno -\newcount \secno \secno=0 -\newcount \subsecno \subsecno=0 -\newcount \subsubsecno \subsubsecno=0 +\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 = `\@ +\newcount\appendixno \appendixno = `\@ \def\appendixletter{\char\the\appendixno} -\newwrite \contentsfile +\newwrite\contentsfile % This is called from \setfilename. -\def\opencontents{\openout \contentsfile = \jobname.toc} +\def\opencontents{\openout\contentsfile = \jobname.toc } % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise \def\thischapter{} \def\thissection{} -\def\seccheck#1{\if \pageno<0 % -\errmessage{@#1 not allowed after generating table of contents}\fi -% -} +\def\seccheck#1{\ifnum \pageno<0 + \errmessage{@#1 not allowed after generating table of contents}% +\fi} \def\chapternofonts{% -\let\rawbackslash=\relax% -\let\frenchspacing=\relax% -\def\result{\realbackslash result} -\def\equiv{\realbackslash equiv} -\def\expansion{\realbackslash expansion} -\def\print{\realbackslash print} -\def\TeX{\realbackslash TeX} -\def\dots{\realbackslash dots} -\def\copyright{\realbackslash copyright} -\def\tt{\realbackslash tt} -\def\bf{\realbackslash bf } -\def\w{\realbackslash w} -\def\less{\realbackslash less} -\def\gtr{\realbackslash gtr} -\def\hat{\realbackslash hat} -\def\char{\realbackslash char} -\def\tclose##1{\realbackslash tclose {##1}} -\def\code##1{\realbackslash code {##1}} -\def\samp##1{\realbackslash samp {##1}} -\def\r##1{\realbackslash r {##1}} -\def\b##1{\realbackslash b {##1}} -\def\key##1{\realbackslash key {##1}} -\def\file##1{\realbackslash file {##1}} -\def\kbd##1{\realbackslash kbd {##1}} -% These are redefined because @smartitalic wouldn't work inside xdef. -\def\i##1{\realbackslash i {##1}} -\def\cite##1{\realbackslash cite {##1}} -\def\var##1{\realbackslash var {##1}} -\def\emph##1{\realbackslash emph {##1}} -\def\dfn##1{\realbackslash dfn {##1}} + \let\rawbackslash=\relax + \let\frenchspacing=\relax + \def\result{\realbackslash result}% + \def\equiv{\realbackslash equiv}% + \def\expansion{\realbackslash expansion}% + \def\print{\realbackslash print}% + \def\TeX{\realbackslash TeX}% + \def\dots{\realbackslash dots}% + \def\copyright{\realbackslash copyright}% + \def\tt{\realbackslash tt}% + \def\bf{\realbackslash bf}% + \def\w{\realbackslash w}% + \def\less{\realbackslash less}% + \def\gtr{\realbackslash gtr}% + \def\hat{\realbackslash hat}% + \def\char{\realbackslash char}% + \def\tclose##1{\realbackslash tclose{##1}}% + \def\code##1{\realbackslash code{##1}}% + \def\samp##1{\realbackslash samp{##1}}% + \def\r##1{\realbackslash r{##1}}% + \def\b##1{\realbackslash b{##1}}% + \def\key##1{\realbackslash key{##1}}% + \def\file##1{\realbackslash file{##1}}% + \def\kbd##1{\realbackslash kbd{##1}}% + % These are redefined because @smartitalic wouldn't work inside xdef. + \def\i##1{\realbackslash i{##1}}% + \def\cite##1{\realbackslash cite{##1}}% + \def\var##1{\realbackslash var{##1}}% + \def\emph##1{\realbackslash emph{##1}}% + \def\dfn##1{\realbackslash dfn{##1}}% } \newcount\absseclevel % used to calculate proper heading level @@ -2733,7 +2790,8 @@ % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% {\chapternofonts% -\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \donoderef % @@ -2752,8 +2810,9 @@ \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% {\chapternofonts% -\edef\temp{{\realbackslash chapentry - {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash chapentry{\the\toks0}% + {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \appendixnoderef % @@ -2787,7 +2846,8 @@ \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% {\chapternofonts% -\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \unnumbnoderef % @@ -2802,8 +2862,9 @@ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% {\chapternofonts% +\toks0 = {#1}% \edef\temp{{\realbackslash secentry % -{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% +{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \donoderef % @@ -2817,8 +2878,9 @@ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% {\chapternofonts% +\toks0 = {#1}% \edef\temp{{\realbackslash secentry % -{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% +{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \appendixnoderef % @@ -2830,7 +2892,8 @@ \def\unnumberedseczzz #1{\seccheck{unnumberedsec}% \plainsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% -\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \unnumbnoderef % @@ -2843,8 +2906,9 @@ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% {\chapternofonts% +\toks0 = {#1}% \edef\temp{{\realbackslash subsecentry % -{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \donoderef % @@ -2857,8 +2921,9 @@ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% {\chapternofonts% +\toks0 = {#1}% \edef\temp{{\realbackslash subsecentry % -{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \appendixnoderef % @@ -2870,7 +2935,8 @@ \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% \plainsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \unnumbnoderef % @@ -2884,8 +2950,8 @@ \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% {\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry % - {#1} +\toks0 = {#1}% +\edef\temp{{\realbackslash subsubsecentry{\the\toks0} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} {\noexpand\folio}}}% \escapechar=`\\% @@ -2901,7 +2967,8 @@ \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% {\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry{#1}% +\toks0 = {#1}% +\edef\temp{{\realbackslash subsubsecentry{\the\toks0}% {\appendixletter} {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% \escapechar=`\\% @@ -2915,7 +2982,8 @@ \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% \plainsubsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% +\toks0 = {#1}% +\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% \escapechar=`\\% \write \contentsfile \temp % \unnumbnoderef % @@ -3096,7 +3164,7 @@ % 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{% @@ -3348,14 +3416,13 @@ \escapechar=`\\ % \let\,=\ptexcomma -\let\~=\ptextilde \let\{=\ptexlbrace \let\}=\ptexrbrace \let\.=\ptexdot \let\*=\ptexstar \let\dots=\ptexdots -\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} -\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} +\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% +\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\bullet=\ptexbullet \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext @@ -3618,16 +3685,17 @@ % 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 } +\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 } + % 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\}\let(=\oprm \let)=\clrm\ } % @@ -3635,8 +3703,11 @@ } % 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`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} -\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} +\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. @@ -3729,7 +3800,7 @@ % 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 % @@ -3763,17 +3834,16 @@ } % Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does, putting the result in \tptemp. -% -\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% +% 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{% - \removeemptybraces#2\relax - #1{\tptemp}{#3}% + #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % @@ -3814,7 +3884,7 @@ \hyphenchar\tensl=0 #1% \hyphenchar\tensl=45 -\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% +\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\penalty 10000\vskip -\parskip\penalty 10000% @@ -3915,6 +3985,7 @@ \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\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} % @defmethod, and so on @@ -3930,6 +4001,16 @@ \defunargs {#3}\endgroup % } +% @deftypemethod foo-class return-type foo-method args +% +\def\deftypemethod{% + \defmethparsebody\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{% + \deftypefnheaderx{Method on #1}{#2}#3 #4\relax +} + % @defmethod == @defop Method \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} @@ -4007,19 +4088,21 @@ \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} -% #1 is the data type. #2 is the name. +% #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{% -\doind {vr}{\code{#2}}% Make entry in variables index +\dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \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{\doind {vr}{\code{#3}}% +\def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 @@ -4142,7 +4225,7 @@ % Use \turnoffactive so that punctuation chars such as underscore % work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% +\def\dosetq #1#2{{\let\folio=0 \turnoffactive \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% \next}} @@ -4211,84 +4294,101 @@ #2% Output the suffix in any case. } -% Read the last existing aux file, if any. No error if none exists. - % This is the macro invoked by entries in the aux file. -\def\xrdef #1#2{ -{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} +\def\xrdef #1#2{{% + \catcode`\'=\other + \expandafter\gdef\csname X#1\endcsname{#2}% +}} -\def\readauxfile{% -\begingroup -\catcode `\^^@=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\^^C=\other -\catcode `\^^D=\other -\catcode `\^^E=\other -\catcode `\^^F=\other -\catcode `\^^G=\other -\catcode `\^^H=\other -\catcode `\ =\other -\catcode `\^^L=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode 26=\other -\catcode `\^^[=\other -\catcode `\^^\=\other -\catcode `\^^]=\other -\catcode `\^^^=\other -\catcode `\^^_=\other -\catcode `\@=\other -\catcode `\^=\other -\catcode `\~=\other -\catcode `\[=\other -\catcode `\]=\other -\catcode`\"=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode `\$=\other -\catcode `\#=\other -\catcode `\&=\other -% `\+ does not work, so use 43. -\catcode 43=\other -% 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 +% Read the last existing aux file, if any. No error if none exists. +\def\readauxfile{\begingroup + \catcode`\^^@=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\ =\other + \catcode`\^^L=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode`\=\other + \catcode26=\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 + % `\+ does not work, so use 43. + \catcode43=\other + % 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. -% 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`\^=7 % to make ^^e4 etc usable in xref tags -\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 + % 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} @@ -4329,7 +4429,11 @@ % 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. % -\long\gdef\footnotezzz#1{\insert\footins{% +% 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. @@ -4351,8 +4455,13 @@ % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut - #1\strut}% + \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 @@ -4584,7 +4693,6 @@ \def~{{\tt \char '176}} \chardef\hat=`\^ \catcode`\^=\active -\def\auxhat{\def^{'hat}} \def^{{\tt \hat}} \catcode`\_=\active