From 39d9eb47d84a25b9cb7981c54996547a5fd1d1f4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Feb 1999 18:50:07 +0000 Subject: [PATCH] First round of gnu/dist cleanup - remove: - files removed in binutils 2.8.1 or 2.9.1 - some testsuite stuff - VMS, MS-DOS, and MPW Macintosh build environmanet (most of which are quite old and out of maintenance) - generated GNU info files - non-NetBSD-target makefile fragments --- gnu/dist/bc/Test/BUG.bc | 40 - gnu/dist/bc/Test/TESTS.bc | 565 --- gnu/dist/bc/Test/array.b | 14 - gnu/dist/bc/Test/arrayp.b | 30 - gnu/dist/bc/Test/aryprm.b | 16 - gnu/dist/bc/Test/atan.b | 5 - gnu/dist/bc/Test/checklib.b | 109 - gnu/dist/bc/Test/div.b | 8 - gnu/dist/bc/Test/exp.b | 3 - gnu/dist/bc/Test/fact.b | 13 - gnu/dist/bc/Test/jn.b | 6 - gnu/dist/bc/Test/ln.b | 3 - gnu/dist/bc/Test/mul.b | 7 - gnu/dist/bc/Test/raise.b | 3 - gnu/dist/bc/Test/signum | 87 - gnu/dist/bc/Test/sine.b | 5 - gnu/dist/bc/Test/sqrt.b | 13 - gnu/dist/bc/Test/sqrt1.b | 13 - gnu/dist/bc/Test/sqrt2.b | 10 - gnu/dist/bc/Test/testfn.b | 47 - gnu/dist/bc/Test/timetest | 14 - gnu/dist/bc/doc/dc.info | 435 -- gnu/dist/bc/doc/texinfo.tex | 4506 ------------------- gnu/dist/bfd/configure.bat | 18 - gnu/dist/bfd/configure.com | 142 - gnu/dist/bfd/doc/bfd.info | 95 - gnu/dist/bfd/doc/bfd.info-1 | 1011 ----- gnu/dist/bfd/doc/bfd.info-2 | 1113 ----- gnu/dist/bfd/doc/bfd.info-3 | 1029 ----- gnu/dist/bfd/doc/bfd.info-4 | 1248 ------ gnu/dist/bfd/doc/bfd.info-5 | 663 --- gnu/dist/bfd/doc/bfd.info-6 | 1040 ----- gnu/dist/bfd/doc/makefile.vms | 5 - gnu/dist/bfd/makefile.dos | 49 - gnu/dist/bfd/makefile.vms | 57 - gnu/dist/bfd/mpw-config.in | 86 - gnu/dist/bfd/mpw-make.sed | 81 - gnu/dist/binutils/binutils.info | 57 - gnu/dist/binutils/binutils.info-1 | 1374 ------ gnu/dist/binutils/binutils.info-2 | 891 ---- gnu/dist/binutils/configure.bat | 63 - gnu/dist/binutils/configure.com | 78 - gnu/dist/binutils/mac-binutils.r | 42 - gnu/dist/binutils/makefile.vms | 93 - gnu/dist/binutils/mpw-config.in | 27 - gnu/dist/binutils/mpw-make.sed | 115 - gnu/dist/configure.bat | 17 - gnu/dist/etc/cfg-paper.info | 659 --- gnu/dist/etc/configure.info | 64 - gnu/dist/etc/configure.info-1 | 1174 ----- gnu/dist/etc/configure.info-2 | 566 --- gnu/dist/etc/standards.info | 82 - gnu/dist/etc/standards.info-1 | 1891 -------- gnu/dist/etc/standards.info-2 | 1216 ------ gnu/dist/etc/standards.info-3 | 679 --- gnu/dist/gas/README-vms | 248 -- gnu/dist/gas/conf.in | 127 - gnu/dist/gas/config-gas.com | 186 - gnu/dist/gas/config/arm-big.mt | 1 - gnu/dist/gas/config/arm-lit.mt | 1 - gnu/dist/gas/config/go32.cfg | 93 - gnu/dist/gas/config/i386coff.mt | 1 - gnu/dist/gas/config/m68kcoff.mt | 1 - gnu/dist/gas/config/m88kcoff.mt | 1 - gnu/dist/gas/config/mips-big.mt | 1 - gnu/dist/gas/config/mips-lit.mt | 1 - gnu/dist/gas/config/ppc-big.mt | 1 - gnu/dist/gas/config/ppc-lit.mt | 1 - gnu/dist/gas/config/ppc-sol.mt | 1 - gnu/dist/gas/config/sco5.mt | 1 - gnu/dist/gas/configure.bat | 57 - gnu/dist/gas/doc/as.info | 311 -- gnu/dist/gas/doc/as.info-1 | 1345 ------ gnu/dist/gas/doc/as.info-2 | 1368 ------ gnu/dist/gas/doc/as.info-3 | 1589 ------- gnu/dist/gas/doc/as.info-4 | 1273 ------ gnu/dist/gas/doc/as.info-5 | 1270 ------ gnu/dist/gas/doc/as.info-6 | 1051 ----- gnu/dist/gas/doc/as.info-7 | 941 ---- gnu/dist/gas/doc/gasp.info | 1086 ----- gnu/dist/gas/link.cmd | 10 - gnu/dist/gas/mac-as.r | 42 - gnu/dist/gas/make-gas.com | 153 - gnu/dist/gas/makefile.vms | 75 - gnu/dist/gas/mpw-config.in | 115 - gnu/dist/gas/mpw-make.sed | 100 - gnu/dist/gcc/config/msdos/configur.bat | 47 - gnu/dist/gcc/config/t-gnu | 13 - gnu/dist/gcc/config/t-linux | 16 - gnu/dist/gcc/config/t-linux-aout | 11 - gnu/dist/gcc/config/t-linux-gnulibc1 | 2 - gnu/dist/gcc/config/t-rtems | 6 - gnu/dist/gcc/config/t-svr4 | 8 - gnu/dist/gcc/config/winnt/config-nt.bat | 58 - gnu/dist/gcc/configure.bat | 21 - gnu/dist/gcc/cp/mpw-config.in | 11 - gnu/dist/gcc/cp/mpw-make.sed | 112 - gnu/dist/gcc/fixinc.dgux | 185 - gnu/dist/gcc/fixinc.irix | 190 - gnu/dist/gcc/fixinc.ptx | 257 -- gnu/dist/gcc/fixinc.sco | 427 -- gnu/dist/gcc/fixinc.svr4 | 1726 -------- gnu/dist/gcc/fixinc.winnt | 232 - gnu/dist/gcc/gthr-dce.h | 150 - gnu/dist/gcc/gthr-solaris.h | 177 - gnu/dist/gcc/gthr-vxworks.h | 132 - gnu/dist/gcc/make-l2.com | 149 - gnu/dist/gcc/patch-apollo-includes | 69 - gnu/dist/gcc/texinfo.tex | 5298 ----------------------- gnu/dist/gcc/vmsconfig.com | 500 --- gnu/dist/gdb/mpw-config.in | 82 - gnu/dist/gdb/mpw-make.sed | 167 - gnu/dist/gprof/alpha.h | 36 - gnu/dist/gprof/configure.bat | 18 - gnu/dist/gprof/dummy.c | 19 - gnu/dist/gprof/dummy.h | 55 - gnu/dist/gprof/gprof.info | 62 - gnu/dist/gprof/gprof.info-1 | 1109 ----- gnu/dist/gprof/gprof.info-2 | 761 ---- gnu/dist/gprof/i386.h | 38 - gnu/dist/gprof/ns532.c | 17 - gnu/dist/gprof/ns532.h | 51 - gnu/dist/gprof/sparc.h | 31 - gnu/dist/gprof/tahoe.h | 46 - gnu/dist/gprof/vax.h | 52 - gnu/dist/ld/configure.bat | 72 - gnu/dist/ld/ld.info | 75 - gnu/dist/ld/ld.info-1 | 1181 ----- gnu/dist/ld/ld.info-2 | 1189 ----- gnu/dist/ld/ld.info-3 | 753 ---- gnu/dist/ld/ld.info-4 | 432 -- gnu/dist/ld/mpw-config.in | 52 - gnu/dist/ld/mpw-elfmips.c | 1470 ------- gnu/dist/ld/mpw-eppcmac.c | 1224 ------ gnu/dist/ld/mpw-esh.c | 315 -- gnu/dist/ld/mpw-idtmips.c | 430 -- gnu/dist/ld/mpw-make.sed | 95 - gnu/dist/ld/scripttempl/elfmips.sc | 207 - gnu/dist/libiberty/configure.bat | 14 - gnu/dist/libiberty/mpw-config.in | 7 - gnu/dist/libiberty/mpw-make.sed | 51 - gnu/dist/libiberty/vmsbuild.com | 165 - gnu/dist/makeall.bat | 16 - gnu/dist/makefile.vms | 37 - gnu/dist/mpw-README | 376 -- gnu/dist/mpw-build.in | 204 - gnu/dist/mpw-config.in | 113 - gnu/dist/mpw-configure | 448 -- gnu/dist/mpw-install | 122 - gnu/dist/opcodes/configure.bat | 24 - gnu/dist/opcodes/mpw-config.in | 27 - gnu/dist/opcodes/mpw-make.sed | 25 - gnu/dist/readline/doc/history.info | 785 ---- gnu/dist/readline/doc/readline.info | 2765 ------------ gnu/dist/setup.com | 8 - 155 files changed, 58151 deletions(-) delete mode 100644 gnu/dist/bc/Test/BUG.bc delete mode 100644 gnu/dist/bc/Test/TESTS.bc delete mode 100644 gnu/dist/bc/Test/array.b delete mode 100644 gnu/dist/bc/Test/arrayp.b delete mode 100644 gnu/dist/bc/Test/aryprm.b delete mode 100644 gnu/dist/bc/Test/atan.b delete mode 100644 gnu/dist/bc/Test/checklib.b delete mode 100644 gnu/dist/bc/Test/div.b delete mode 100644 gnu/dist/bc/Test/exp.b delete mode 100644 gnu/dist/bc/Test/fact.b delete mode 100644 gnu/dist/bc/Test/jn.b delete mode 100644 gnu/dist/bc/Test/ln.b delete mode 100644 gnu/dist/bc/Test/mul.b delete mode 100644 gnu/dist/bc/Test/raise.b delete mode 100644 gnu/dist/bc/Test/signum delete mode 100644 gnu/dist/bc/Test/sine.b delete mode 100644 gnu/dist/bc/Test/sqrt.b delete mode 100644 gnu/dist/bc/Test/sqrt1.b delete mode 100644 gnu/dist/bc/Test/sqrt2.b delete mode 100644 gnu/dist/bc/Test/testfn.b delete mode 100644 gnu/dist/bc/Test/timetest delete mode 100644 gnu/dist/bc/doc/dc.info delete mode 100644 gnu/dist/bc/doc/texinfo.tex delete mode 100644 gnu/dist/bfd/configure.bat delete mode 100644 gnu/dist/bfd/configure.com delete mode 100644 gnu/dist/bfd/doc/bfd.info delete mode 100644 gnu/dist/bfd/doc/bfd.info-1 delete mode 100644 gnu/dist/bfd/doc/bfd.info-2 delete mode 100644 gnu/dist/bfd/doc/bfd.info-3 delete mode 100644 gnu/dist/bfd/doc/bfd.info-4 delete mode 100644 gnu/dist/bfd/doc/bfd.info-5 delete mode 100644 gnu/dist/bfd/doc/bfd.info-6 delete mode 100644 gnu/dist/bfd/doc/makefile.vms delete mode 100644 gnu/dist/bfd/makefile.dos delete mode 100644 gnu/dist/bfd/makefile.vms delete mode 100644 gnu/dist/bfd/mpw-config.in delete mode 100644 gnu/dist/bfd/mpw-make.sed delete mode 100644 gnu/dist/binutils/binutils.info delete mode 100644 gnu/dist/binutils/binutils.info-1 delete mode 100644 gnu/dist/binutils/binutils.info-2 delete mode 100644 gnu/dist/binutils/configure.bat delete mode 100644 gnu/dist/binutils/configure.com delete mode 100644 gnu/dist/binutils/mac-binutils.r delete mode 100644 gnu/dist/binutils/makefile.vms delete mode 100644 gnu/dist/binutils/mpw-config.in delete mode 100644 gnu/dist/binutils/mpw-make.sed delete mode 100644 gnu/dist/configure.bat delete mode 100644 gnu/dist/etc/cfg-paper.info delete mode 100644 gnu/dist/etc/configure.info delete mode 100644 gnu/dist/etc/configure.info-1 delete mode 100644 gnu/dist/etc/configure.info-2 delete mode 100644 gnu/dist/etc/standards.info delete mode 100644 gnu/dist/etc/standards.info-1 delete mode 100644 gnu/dist/etc/standards.info-2 delete mode 100644 gnu/dist/etc/standards.info-3 delete mode 100644 gnu/dist/gas/README-vms delete mode 100644 gnu/dist/gas/conf.in delete mode 100644 gnu/dist/gas/config-gas.com delete mode 100644 gnu/dist/gas/config/arm-big.mt delete mode 100644 gnu/dist/gas/config/arm-lit.mt delete mode 100644 gnu/dist/gas/config/go32.cfg delete mode 100644 gnu/dist/gas/config/i386coff.mt delete mode 100644 gnu/dist/gas/config/m68kcoff.mt delete mode 100644 gnu/dist/gas/config/m88kcoff.mt delete mode 100644 gnu/dist/gas/config/mips-big.mt delete mode 100644 gnu/dist/gas/config/mips-lit.mt delete mode 100644 gnu/dist/gas/config/ppc-big.mt delete mode 100644 gnu/dist/gas/config/ppc-lit.mt delete mode 100644 gnu/dist/gas/config/ppc-sol.mt delete mode 100644 gnu/dist/gas/config/sco5.mt delete mode 100644 gnu/dist/gas/configure.bat delete mode 100644 gnu/dist/gas/doc/as.info delete mode 100644 gnu/dist/gas/doc/as.info-1 delete mode 100644 gnu/dist/gas/doc/as.info-2 delete mode 100644 gnu/dist/gas/doc/as.info-3 delete mode 100644 gnu/dist/gas/doc/as.info-4 delete mode 100644 gnu/dist/gas/doc/as.info-5 delete mode 100644 gnu/dist/gas/doc/as.info-6 delete mode 100644 gnu/dist/gas/doc/as.info-7 delete mode 100644 gnu/dist/gas/doc/gasp.info delete mode 100644 gnu/dist/gas/link.cmd delete mode 100644 gnu/dist/gas/mac-as.r delete mode 100644 gnu/dist/gas/make-gas.com delete mode 100644 gnu/dist/gas/makefile.vms delete mode 100644 gnu/dist/gas/mpw-config.in delete mode 100644 gnu/dist/gas/mpw-make.sed delete mode 100644 gnu/dist/gcc/config/msdos/configur.bat delete mode 100644 gnu/dist/gcc/config/t-gnu delete mode 100644 gnu/dist/gcc/config/t-linux delete mode 100644 gnu/dist/gcc/config/t-linux-aout delete mode 100644 gnu/dist/gcc/config/t-linux-gnulibc1 delete mode 100644 gnu/dist/gcc/config/t-rtems delete mode 100644 gnu/dist/gcc/config/t-svr4 delete mode 100644 gnu/dist/gcc/config/winnt/config-nt.bat delete mode 100644 gnu/dist/gcc/configure.bat delete mode 100644 gnu/dist/gcc/cp/mpw-config.in delete mode 100644 gnu/dist/gcc/cp/mpw-make.sed delete mode 100644 gnu/dist/gcc/fixinc.dgux delete mode 100644 gnu/dist/gcc/fixinc.irix delete mode 100644 gnu/dist/gcc/fixinc.ptx delete mode 100644 gnu/dist/gcc/fixinc.sco delete mode 100644 gnu/dist/gcc/fixinc.svr4 delete mode 100644 gnu/dist/gcc/fixinc.winnt delete mode 100644 gnu/dist/gcc/gthr-dce.h delete mode 100644 gnu/dist/gcc/gthr-solaris.h delete mode 100644 gnu/dist/gcc/gthr-vxworks.h delete mode 100644 gnu/dist/gcc/make-l2.com delete mode 100644 gnu/dist/gcc/patch-apollo-includes delete mode 100644 gnu/dist/gcc/texinfo.tex delete mode 100644 gnu/dist/gcc/vmsconfig.com delete mode 100644 gnu/dist/gdb/mpw-config.in delete mode 100644 gnu/dist/gdb/mpw-make.sed delete mode 100644 gnu/dist/gprof/alpha.h delete mode 100644 gnu/dist/gprof/configure.bat delete mode 100644 gnu/dist/gprof/dummy.c delete mode 100644 gnu/dist/gprof/dummy.h delete mode 100644 gnu/dist/gprof/gprof.info delete mode 100644 gnu/dist/gprof/gprof.info-1 delete mode 100644 gnu/dist/gprof/gprof.info-2 delete mode 100644 gnu/dist/gprof/i386.h delete mode 100644 gnu/dist/gprof/ns532.c delete mode 100644 gnu/dist/gprof/ns532.h delete mode 100644 gnu/dist/gprof/sparc.h delete mode 100644 gnu/dist/gprof/tahoe.h delete mode 100644 gnu/dist/gprof/vax.h delete mode 100644 gnu/dist/ld/configure.bat delete mode 100644 gnu/dist/ld/ld.info delete mode 100644 gnu/dist/ld/ld.info-1 delete mode 100644 gnu/dist/ld/ld.info-2 delete mode 100644 gnu/dist/ld/ld.info-3 delete mode 100644 gnu/dist/ld/ld.info-4 delete mode 100644 gnu/dist/ld/mpw-config.in delete mode 100644 gnu/dist/ld/mpw-elfmips.c delete mode 100644 gnu/dist/ld/mpw-eppcmac.c delete mode 100644 gnu/dist/ld/mpw-esh.c delete mode 100644 gnu/dist/ld/mpw-idtmips.c delete mode 100644 gnu/dist/ld/mpw-make.sed delete mode 100644 gnu/dist/ld/scripttempl/elfmips.sc delete mode 100644 gnu/dist/libiberty/configure.bat delete mode 100644 gnu/dist/libiberty/mpw-config.in delete mode 100644 gnu/dist/libiberty/mpw-make.sed delete mode 100644 gnu/dist/libiberty/vmsbuild.com delete mode 100644 gnu/dist/makeall.bat delete mode 100644 gnu/dist/makefile.vms delete mode 100644 gnu/dist/mpw-README delete mode 100644 gnu/dist/mpw-build.in delete mode 100644 gnu/dist/mpw-config.in delete mode 100644 gnu/dist/mpw-configure delete mode 100644 gnu/dist/mpw-install delete mode 100644 gnu/dist/opcodes/configure.bat delete mode 100644 gnu/dist/opcodes/mpw-config.in delete mode 100644 gnu/dist/opcodes/mpw-make.sed delete mode 100644 gnu/dist/readline/doc/history.info delete mode 100644 gnu/dist/readline/doc/readline.info delete mode 100644 gnu/dist/setup.com diff --git a/gnu/dist/bc/Test/BUG.bc b/gnu/dist/bc/Test/BUG.bc deleted file mode 100644 index 254eefe68f59..000000000000 --- a/gnu/dist/bc/Test/BUG.bc +++ /dev/null @@ -1,40 +0,0 @@ -/* <--- bug.bc ---><--- bug.bc ---><--- bug.bc ---><--- bug.bc ---> */ - -/* - * See the file "signum" for a description and reference for this - * program. - * - * THIS BUG IS *NOT* IN GNU BC!!! - * - */ - -obase=16 -ibase=16 -x=1A8F5C99605AE52 /* dividend */ -y=BB0B404 /* divisor */ -q=245A07AD /* (correct) quotient */ -r=147EB9E /* (correct) remainder */ -"Base 16 -" -"x = "; x /* output numbers just to be sure... */ -"y = "; y -"quo = "; q -"rem = "; r -"x/y = "; x/y /* watch this result! */ -"x%y = "; x%y /* watch this result! */ -"y*q+r= "; y*q+r /* check quotient & remainder */ -/* - * Do the same thing in base 10: - */ -" -Base 10 -" -ibase=A -obase=10 -"x = "; x /* output numbers just to be sure... */ -"y = "; y -"q = "; q -"r = "; r -"x/y = "; x/y /* watch this result! */ -"x%y = "; x%y /* watch this result! */ -"y*q+r= "; y*q+r /* check quotient & remainder */ diff --git a/gnu/dist/bc/Test/TESTS.bc b/gnu/dist/bc/Test/TESTS.bc deleted file mode 100644 index ec42172a422b..000000000000 --- a/gnu/dist/bc/Test/TESTS.bc +++ /dev/null @@ -1,565 +0,0 @@ -From phil@cs.wwu.edu Mon Mar 20 23:13:22 1995 -Date: Mon, 20 Mar 1995 23:12:17 -0800 -From: Phil Nelson -To: phil@steelhead.cs.wwu.edu -Subject: [jhn@ironwood.cray.com: XPG4 bc(1) failures] - -From: jhn@ironwood.cray.com (James Nordby) -Subject: XPG4 bc(1) failures -To: phil@cs.wwu.edu -Date: Fri, 17 Mar 1995 12:14:13 -0600 (CST) -X-Mailer: ELM [version 2.4 PL24-CRI-b] -Mime-Version: 1.0 -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Length: 14277 - - -Phil, - -Here are the test results I'm getting from the XPG4 test suite, -with some explanation and fixes so far. Let me know what you -think... - -Thanks much, -Jim Nordby (jhn@cray.com) - - --------- bc 08:38:34 -------- - -Assertion #20 (A): bc reads text files -Expected exit code = 0; Received 139 -Standard output isn't the same as file 'bc_eso_20_1' -diff of "out.stdout" and "bc_eso_20_1": -*** out.stdout Fri Mar 17 08:39:22 1995 ---- bc_eso_20_1 Fri Mar 17 08:39:22 1995 -*************** -*** 0 **** ---- 1,31 ---- -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 11111111111111111111111111111111111111111111111111111111111111111111 -+ 1111111 -Assertion Result: FAIL - -I couldn't reproduce this problem; when I rebuilt your bc and -ran it, I got a different problem with printing out a large -number. The XPG4 tests expected lines to be 70 characters -long, INCLUDING the newline (this comes from the POSIX definition -of a line). To fix it, I changed util.c like so: - -*** util.c Thu Mar 16 10:47:36 1995 ---- util.c.old Thu Mar 16 10:50:10 1995 -*************** -*** 309,323 **** - else - { - out_col++; -- #ifdef _CRAY -- /* -- * XPG4 considers a line to include the ; -- * therefore we want 68 numerals, , -- */ -- if (out_col == 69) -- #else - if (out_col == 70) -- #endif - { - putchar ('\\'); - putchar ('\n'); ---- 309,315 ---- - - - - - - -Assertion #42 (A): check reserved words -Standard error isn't empty -Contents of out.stderr: -(standard_in) 6: syntax error -(standard_in) 15: syntax error -Standard output isn't the same as file 'bc_eso_42_1' -diff of "out.stdout" and "bc_eso_42_1": -*** out.stdout Fri Mar 17 08:39:43 1995 ---- bc_eso_42_1 Fri Mar 17 08:39:43 1995 -*************** -*** 1,2 **** ---- 1,3 ---- - 2 - 1 -+ 0 -Assertion Result: FAIL - -This one is debatable, based on the grammar in the POSIX manual. -Here's the input file: - -cat << \VSC-EOF > input -define a() { - auto b; - for ( b = 0; b < 10; b++ ) { - b; - if ( b == 1 ) - break; - } - return ( 5 ) ; -} -ibase = 10; -length ( obase ); -scale = 0; -sqrt(1); -while ( a() != 5 ) -VSC-EOF - -They want these constructs to be accepted: - - -if (b == 1) - whatever; -for (x = 0; x < 10; x++) - whatever; -while (x < 10) - whatever; - -rather than just - -if (b == 1) { - whatever -} -etc. - -The grammar as it's currently worded requires a '{' before hitting -a NEWLINE for these constructs. It's easy enough to change in bc.y -(see below), but if I do change it, it still barfs on the last -line of the file ( 'while (a() != 5)' ). Since the while lacks -a body, it gives a syntax error; they're expecting a '0' to be -returned. The grammar could be changed to support this, but is -it a good idea? - - -*** bc.y Thu Mar 16 10:47:20 1995 ---- bc.y.old Thu Mar 16 10:50:11 1995 -*************** -*** 142,150 **** - | error statement - { $$ = $2; } - ; -- allow_newlines : /* empty */ -- | NEWLINE allow_newlines -- ; - statement : Warranty - { warranty (""); } - | Limits ---- 142,147 ---- -*************** -*** 231,237 **** - sprintf (genstr, "pJ%1d:N%1d:", $4, $7); - generate (genstr); - } -! allow_newlines statement - { - sprintf (genstr, "J%1d:N%1d:", - continue_label, break_label); ---- 228,234 ---- - sprintf (genstr, "pJ%1d:N%1d:", $4, $7); - generate (genstr); - } -! statement - { - sprintf (genstr, "J%1d:N%1d:", - continue_label, break_label); -*************** -*** 246,252 **** - sprintf (genstr, "Z%1d:", if_label); - generate (genstr); - } -! allow_newlines statement opt_else - { - sprintf (genstr, "N%1d:", if_label); - generate (genstr); ---- 243,249 ---- - sprintf (genstr, "Z%1d:", if_label); - generate (genstr); - } -! statement opt_else - { - sprintf (genstr, "N%1d:", if_label); - generate (genstr); -*************** -*** 265,271 **** - sprintf (genstr, "Z%1d:", break_label); - generate (genstr); - } -! ')' allow_newlines statement - { - sprintf (genstr, "J%1d:N%1d:", $1, break_label); - generate (genstr); ---- 262,268 ---- - sprintf (genstr, "Z%1d:", break_label); - generate (genstr); - } -! ')' statement - { - sprintf (genstr, "J%1d:N%1d:", $1, break_label); - generate (genstr); - - - - -Assertion #49 (A): check strings -Expected exit code = 0; Received 1 -Standard error isn't empty -Contents of out.stderr: -File (NULL) is unavailable. -Standard output isn't the same as file 'bc_eso_49_1' -diff of "out.stdout" and "bc_eso_49_1": -cmd-1794 diff: Missing newline at end of file 'bc_eso_49_1'. -*** out.stdout Fri Mar 17 08:40:01 1995 ---- bc_eso_49_1 Fri Mar 17 08:40:01 1995 -*************** -*** 0 **** ---- 1 ---- -+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -*LINE CONTINUATION -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -*LINE CONTINUATION -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Assertion Result: FAIL - -This gist of this is that the standard expects numbers to -be truncated to 70 characters, but STRINGS should not. -My changes to fix this are: - - -*** execute.c Thu Mar 16 13:06:39 1995 ---- execute.c.old Thu Mar 16 10:50:09 1995 -*************** -*** 208,218 **** - case 'O' : /* Write a string to the output with processing. */ - while ((ch = byte(&pc)) != '"') - if (ch != '\\') -- #ifdef _CRAY -- putchar (ch); -- #else - out_char (ch); -- #endif - else - { - ch = byte(&pc); ---- 207,213 ---- -*************** -*** 219,234 **** - if (ch == '"') break; - switch (ch) - { -- #ifdef _CRAY -- case 'a': putchar (007); break; -- case 'b': putchar ('\b'); break; -- case 'f': putchar ('\f'); break; -- case 'n': putchar ('\n'); break; -- case 'q': putchar ('"'); break; -- case 'r': putchar ('\r'); break; -- case 't': putchar ('\t'); break; -- case '\\': putchar ('\\'); break; -- #else - case 'a': out_char (007); break; - case 'b': out_char ('\b'); break; - case 'f': out_char ('\f'); break; ---- 214,219 ---- -*************** -*** 237,243 **** - case 'r': out_char ('\r'); break; - case 't': out_char ('\t'); break; - case '\\': out_char ('\\'); break; -- #endif - default: break; - } - } ---- 222,227 ---- -*************** -*** 350,360 **** - break; - - case 'w' : /* Write a string to the output. */ -- #ifdef _CRAY -- while ((ch = byte(&pc)) != '"') putchar (ch); -- #else - while ((ch = byte(&pc)) != '"') out_char (ch); -- #endif - if (interactive) fflush (stdout); - break; - - - - -Assertion #77 (C): output longer than 70 characters -Standard output isn't the same as file 'bc_eso_77_1' -diff of "out.stdout" and "bc_eso_77_1": -*** out.stdout Fri Mar 17 08:41:13 1995 ---- bc_eso_77_1 Fri Mar 17 08:41:13 1995 -*************** -*** 1,2 **** -! 3.3333333333333333333333333333333333333333333333333333333333333333333 -! 33333333333333333333333333333333 ---- 1,2 ---- -! 3.333333333333333333333333333333333333333333333333333333333333333333 -! 333333333333333333333333333333333 -Assertion Result: FAIL - -Same as assertion #20 above... - - - - -Assertion #92 (A): check % -Standard output isn't the same as file 'bc_eso_92_1' -diff of "out.stdout" and "bc_eso_92_1": -*** out.stdout Fri Mar 17 08:41:33 1995 ---- bc_eso_92_1 Fri Mar 17 08:41:33 1995 -*************** -*** 4,8 **** - 4 - 15 - 1 -! 0 -! 0 ---- 4,8 ---- - 4 - 15 - 1 -! 6 -! 5 -Assertion Result: FAIL - -This one is a pain. The failing code looks like this: - -scale = 4 -scale ( 5.000000 % 2.0 ) -scale ( 5.00 % 2.0 ) - -They expect '6' and '5' for output, instead of '0', based on -the explanation of the modulus operator ("scale of the result -shall be 'max(scale + scale(b), scale(a)'"), even though the -result is a 0. I was able to fix this problem by the change -below: - -*** number.c Thu Mar 16 13:15:43 1995 ---- number.c.old Thu Mar 16 10:50:09 1995 -*************** -*** 614,623 **** - case 0: - /* They are equal! return zero! */ - diff = copy_num (_zero_); -- #ifdef _CRAY -- /* correct the scale here */ -- diff->n_scale = MAX (n1->n_scale, n2->n_scale); -- #endif - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - -but this causes another test failure that I haven't looked at. - - - - -Assertion #130 (A): functions are call by value -Standard output isn't the same as file 'bc_eso_130_1' -diff of "out.stdout" and "bc_eso_130_1": -*** out.stdout Fri Mar 17 08:42:24 1995 ---- bc_eso_130_1 Fri Mar 17 08:42:24 1995 -*************** -*** 4,10 **** - 5 - 4 - 0 -! 4 - 3 - 3 - 5 ---- 4,10 ---- - 5 - 4 - 0 -! 5 - 3 - 3 - 5 -Assertion Result: FAIL - -Assertion #131 (A): functions are call by value -Standard output isn't the same as file 'bc_eso_131_1' -diff of "out.stdout" and "bc_eso_131_1": -*** out.stdout Fri Mar 17 08:42:28 1995 ---- bc_eso_131_1 Fri Mar 17 08:42:28 1995 -*************** -*** 4,10 **** - 5 - 4 - 0 -! 4 - 3 - 3 - 5 ---- 4,10 ---- - 5 - 4 - 0 -! 5 - 3 - 3 - 5 -Assertion Result: FAIL - - -Both of these are the 'arrays are passed by value' problem. -One of the test cases is below: - -cat << \VSC-EOF > bc_in_130_1 -a[0] = 3 -a[0] -define b(a[]) { -a[0] -a[0] = 4 -a[0] -} -a[0] -a[0] = 5 -a[0] -b(a[]) -a[0] -VSC-EOF - -They expect the assignment of a[0] inside the b() function -to not affect a[0] outside of the function. - - - - - -Assertion #139 (A): check sin -Standard output isn't the same as file 'bc_eso_139_1' -diff of "out.stdout" and "bc_eso_139_1": -*** out.stdout Fri Mar 17 08:42:40 1995 ---- bc_eso_139_1 Fri Mar 17 08:42:39 1995 -*************** -*** 1,5 **** - 0 -! 20 - 1.68294196961579301330 - 20 - 1.6829419696 ---- 1,5 ---- - 0 -! 0 - 1.68294196961579301330 - 20 - 1.6829419696 -Assertion Result: FAIL - -Assertion #141 (A): check arctanngent -Standard output isn't the same as file 'bc_eso_141_1' -diff of "out.stdout" and "bc_eso_141_1": -*** out.stdout Fri Mar 17 08:42:44 1995 ---- bc_eso_141_1 Fri Mar 17 08:42:44 1995 -*************** -*** 1,5 **** - 0 -! 20 - 3.14159265358979323844 - 20 - 3.1415926532 ---- 1,5 ---- - 0 -! 0 - 3.14159265358979323844 - 20 - 3.1415926532 -Assertion Result: FAIL - -Assertion #142 (A): check log -Standard output isn't the same as file 'bc_eso_142_1' -diff of "out.stdout" and "bc_eso_142_1": -*** out.stdout Fri Mar 17 08:42:47 1995 ---- bc_eso_142_1 Fri Mar 17 08:42:47 1995 -*************** -*** 1,5 **** - 0 -! 20 - 2.30258509299404568401 - 20 - 2.3025850929 ---- 1,5 ---- - 0 -! 0 - 2.30258509299404568401 - 20 - 2.3025850929 -Assertion Result: FAIL - -Assertion #144 (A): check bessel -Standard output isn't the same as file 'bc_eso_144_1' -diff of "out.stdout" and "bc_eso_144_1": -*** out.stdout Fri Mar 17 08:42:51 1995 ---- bc_eso_144_1 Fri Mar 17 08:42:51 1995 -*************** -*** 1,5 **** - 0 -! 20 - .57672480775687338720 - 20 - .5767248077 ---- 1,5 ---- - 0 -! 0 - .57672480775687338720 - 20 - .5767248077 -Assertion Result: FAIL - -All of these are the same. I'll give you the test case -for 'sin'; what they're expecting is 0: - -scale(s(0)) - -bc outputs '20' (which is the scale at the time), but the -interpretation of the standard says that it should be '0', -since s(0) is 0, and the scale of 0 is 0. I think that -this interpretation disagrees with one of the previous -assertions (assertion #92). - -/* end of test results */ - - - --- -Phil Nelson -e-mail: phil@cs.wwu.edu -http://www.cs.wwu.edu/~phil - - diff --git a/gnu/dist/bc/Test/array.b b/gnu/dist/bc/Test/array.b deleted file mode 100644 index a0341ec7d748..000000000000 --- a/gnu/dist/bc/Test/array.b +++ /dev/null @@ -1,14 +0,0 @@ -"This tests arrays! -" -define p(x,y) { - auto i; - for (i=x; i= t) { - "Bad Scales. Try again. -"; return; - } - - for (i = x; i < y; i += d) { - scale = s; - u = f(i); - scale = t; - v = f(i); - scale = s; - w = v / 1; - b += 1; - if (u != w) { - c += 1; -" -Failed: -" - " index = "; i; - " val1 = "; u; - " val2 = "; v; -" -" - } - } - -" -Total tests: "; b; -" -Total failures: "; c; -" -Percent failed: "; scale = 2; c*100/b; - -} - -/* - b = begining scale value, - l = limit scale value, - i = increment scale value. - - if b is set to a non-zero value before this file is executed, - b, l and i are not reset. -*/ - -if (b == 0) { b = 10; l = 61; i = 10; } - -" -Checking e(x)" -define f(x) { - return (e(x)) -} -for (s=10; ss. - the result from scale t is divided by 1 at scale s and the - results are compared. If they are different, the function is - said to have failed. It will then print out the value of i - (called index) and the two original values val1 (scale s) and - val2 (scale t) */ - -define t (x,y,d,s,t) { - auto u, v, w, i, b, c; - - if (s >= t) { - "Bad Scales. Try again. -"; return; - } - - for (i = x; i < y; i += d) { - scale = s; - u = f(i); - scale = t; - v = f(i); - scale = s; - w = v / 1; - b += 1; - if (u != w) { - c += 1; -" -Failed: -" - " index = "; i; - " val1 = "; u; - " val2 = "; v; -" -" - } - } - -" -Total tests: "; b; -" -Total failures: "; c; -" -Percent failed: "; scale = 2; c*100/b; - -} diff --git a/gnu/dist/bc/Test/timetest b/gnu/dist/bc/Test/timetest deleted file mode 100644 index 792c591d1e3b..000000000000 --- a/gnu/dist/bc/Test/timetest +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# Time the functions. -# -BC=../bc/bc -SYSBC=/usr/bin/bc -for file in exp.b ln.b sine.b atan.b jn.b mul.b div.b raise.b sqrt.b -do -for prog in $BC $SYSBC -do -echo Timing $file with $prog -time $prog -l $file -done -done diff --git a/gnu/dist/bc/doc/dc.info b/gnu/dist/bc/doc/dc.info deleted file mode 100644 index a9ad1196422b..000000000000 --- a/gnu/dist/bc/doc/dc.info +++ /dev/null @@ -1,435 +0,0 @@ -This is Info file dc.info, produced by Makeinfo-1.64 from the input -file dc.texi. - - This file documents DC, an arbitrary precision calculator. - - Published by the Free Software Foundation, 675 Massachusetts Avenue, -Cambridge, MA 02139 USA - - Copyright (C) 1984, 1994, 1997, 1998 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Foundation. - - -File: dc.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) - -* Menu: - -* Introduction:: Introduction -* Invocation:: Invocation -* Printing Commands:: Printing Commands -* Arithmetic:: Arithmetic -* Stack Control:: Stack Control -* Registers:: Registers -* Parameters:: Parameters -* Strings:: Strings -* Status Inquiry:: Status Inquiry -* Miscellaneous:: Other commands -* Reporting bugs:: Reporting bugs - - -File: dc.info, Node: Introduction, Next: Invocation, Prev: Top, Up: Top - -Introduction -************ - - DC is a reverse-polish desk calculator which supports unlimited -precision arithmetic. It also allows you to define and call macros. -Normally DC reads from the standard input; if any command arguments are -given to it, they are filenames, and DC reads and executes the contents -of the files instead of reading from standard input. All normal output -is to standard output; all error messages are written to standard error. - - To exit, use `q'. `C-c' does not exit; it is used to abort macros -that are looping, etc. (Currently this is not true; `C-c' does exit.) - - A reverse-polish calculator stores numbers on a stack. Entering a -number pushes it on the stack. Arithmetic operations pop arguments off -the stack and push the results. - - To enter a number in DC, type the digits, with an optional decimal -point. Exponential notation is not supported. To enter a negative -number, begin the number with `_'. `-' cannot be used for this, as it -is a binary operator for subtraction instead. To enter two numbers in -succession, separate them with spaces or newlines. These have no -meaning as commands. - - -File: dc.info, Node: Invocation, Next: Printing Commands, Prev: Introduction, Up: Top - -Invocation -********** - - DC may be invoked with the following command-line options: -`-e EXPR' -`--expression=EXPR' - Evaluate EXPR as DC commands. - -`-f FILE' -`--file=FILE' - Read and evaluate DC commands from FILE. - -`-h' -`--help' - Print a usage message summarizing the command-line options, then - exit. - -`-V' -`--version' - Print the version information for this program, then exit. - - If any command-line parameters remain after processing the options, -these parameters are interpreted as additional FILEs whose contents are -read and evaluated. A file name of `-' refers to the standard input -stream. If no `-e' option was specified, and no files were specified, -then the standard input will be read for commands to evaluate. - - -File: dc.info, Node: Printing Commands, Next: Arithmetic, Prev: Invocation, Up: Top - -Printing Commands -***************** - -`p' - Prints the value on the top of the stack, without altering the - stack. A newline is printed after the value. - -`n' - Prints the value on the top of the stack, popping it off, and does - not print a newline after. (This command is a GNU extension.) - -`P' - Pops off the value on top of the stack. If it it a string, it is - simply printed without a trailing newline. Otherwise it is a - number, and the integer portion of its absolute value is printed - out as a "base (UCHAR_MAX+1)" byte stream. Assuming that - (UCHAR_MAX+1) is 256 (as it is on most machines with 8-bit bytes), - the sequence `KSK 0k1/ [_1*]sx d0>x [256~aPd0R' - Pops two values off the stack and compares them assuming they are - numbers, executing the contents of register R as a macro if the - original top-of-stack is greater. Thus, `1 2>a' will invoke - register `a''s contents and `2 1>a' will not. - -`!>R' - Similar but invokes the macro if the original top-of-stack is not - greater (is less than or equal to) what was the second-to-top. - -` commands take precidence, so if you - want to run a command starting with <, =, or > you will need to - add a space after the !. - -`#' - Will interpret the rest of the line as a comment. (This command - is a GNU extension.) - -`:R' - Will pop the top two values off of the stack. The old - second-to-top value will be stored in the array R, indexed by the - old top-of-stack value. - -`;R' - Pops the top-of-stack and uses it as an index into the array R. - The selected value is then pushed onto the stack. - - Note that each stacked instance of a register has its own array -associated with it. Thus `1 0:A 0SA 2 0:A LA 0;Ap' will print 1, -because the 2 was stored in an instance of 0:A that was later popped. - - -File: dc.info, Node: Reporting bugs, Prev: Miscellaneous, Up: Top - -Reporting bugs -************** - - Email bug reports to `bug-gnu-utils@prep.ai.mit.edu'. Be sure to -include the word "dc" somewhere in the "Subject:" field. - - - -Tag Table: -Node: Top975 -Node: Introduction1554 -Node: Invocation2771 -Node: Printing Commands3611 -Node: Arithmetic4789 -Node: Stack Control7701 -Node: Registers8114 -Node: Parameters9040 -Node: Strings10301 -Node: Status Inquiry13271 -Node: Miscellaneous13828 -Node: Reporting bugs14795 - -End Tag Table diff --git a/gnu/dist/bc/doc/texinfo.tex b/gnu/dist/bc/doc/texinfo.tex deleted file mode 100644 index a317d35410af..000000000000 --- a/gnu/dist/bc/doc/texinfo.tex +++ /dev/null @@ -1,4506 +0,0 @@ -%% TeX macros to handle texinfo files - -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, -% 94, 95, 1996 Free Software Foundation, Inc. - -%This texinfo.tex file is free software; you can redistribute it and/or -%modify it under the terms of the GNU General Public License as -%published by the Free Software Foundation; either version 2, or (at -%your option) any later version. - -%This texinfo.tex file is distributed in the hope that it will be -%useful, but WITHOUT ANY WARRANTY; without even the implied warranty -%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%General Public License for more details. - -%You should have received a copy of the GNU General Public License -%along with this texinfo.tex file; see the file COPYING. If not, write -%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -%Boston, MA 02111-1307, USA. - - -%In other words, you are welcome to use, share and improve this program. -%You are forbidden to forbid anyone else to use, share and improve -%what you give them. Help stamp out software-hoarding! - - -% Send bug reports to bug-texinfo@prep.ai.mit.edu. -% Please include a *precise* test case in each bug report. - - -% Make it possible to create a .fmt file just by loading this file: -% if the underlying format is not loaded, start by loading it now. -% Added by gildea November 1993. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi - -% This automatically updates the version number based on RCS. -\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.1.1.1 $ -\message{Loading texinfo package [Version \texinfoversion]:} - -% If in a .fmt file, print the version number -% and turn on active characters that we couldn't do earlier because -% they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}\message{} - \catcode`+=\active \catcode`\_=\active} - -% Save some parts of plain tex whose names we will redefine. - -\let\ptextilde=\~ -\let\ptexlbrace=\{ -\let\ptexrbrace=\} -\let\ptexdots=\dots -\let\ptexdot=\. -\let\ptexstar=\* -\let\ptexend=\end -\let\ptexbullet=\bullet -\let\ptexb=\b -\let\ptexc=\c -\let\ptexi=\i -\let\ptext=\t -\let\ptexl=\l -\let\ptexL=\L - -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} -\let\~ = \tie % And make it available as @~. - -\message{Basics,} -\chardef\other=12 - -% If this character appears in an error message or help string, it -% starts a new line in the output. -\newlinechar = `^^J - -% Set up fixed words for English. -\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% -\def\putwordInfo{Info}% -\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% -\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% -\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% -\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% -\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% -\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% -\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% -\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% -\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% - -% Ignore a token. -% -\def\gobble#1{} - -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} - -% Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset \bindingoffset=0pt -\newdimen \normaloffset \normaloffset=\hoffset -\newdimen\pagewidth \newdimen\pageheight -\pagewidth=\hsize \pageheight=\vsize - -% Sometimes it is convenient to have everything in the transcript file -% and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. -% -\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\def\loggingall{\tracingcommands2 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% - -%---------------------Begin change----------------------- -% -%%%% For @cropmarks command. -% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 -% -\newdimen\cornerlong \newdimen\cornerthick -\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----------------------- - -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions itself, but you have to call it yourself. -\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} -\def\onepageout#1{\hoffset=\normaloffset -\ifodd\pageno \advance\hoffset by \bindingoffset -\else \advance\hoffset by -\bindingoffset\fi -{\escapechar=`\\\relax % makes sure backslash is used in output files. -\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% -{\let\hsize=\pagewidth \makefootline}}}% -\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}} -{\catcode`\@ =11 -\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi -% marginal hacks, juha@viisa.uucp (Juha Takala) -\ifvoid\margin\else % marginal info is present - \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1 \unvbox#1 -\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi -\ifr@ggedbottom \kern-\dimen@ \vfil \fi} -} - -% -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - -% Parse an argument, then pass it to #1. The argument is the rest of -% the input line (except we remove a trailing comment). #1 should be a -% macro which expects an ordinary undelimited TeX argument. -% -\def\parsearg#1{% - \let\next = #1% - \begingroup - \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi -} - -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - -{\obeylines % - \gdef\parseargline#1^^M{% - \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% - }% -} - -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} - -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., -% @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup -} - -% Change the active space to expand to nothing. -% -\begingroup - \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup - - -\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} - -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment. Type Return to continue.} -\endgroup\fi} % This is not perfect, but it should reduce lossage - -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Type to continue.} - -\outer\def\begin{\parsearg\beginxxx} - -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} - -% @end foo executes the definition of \Efoo. -% -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi - \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname - \fi -} - -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% - \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% -} - -% Define the control sequence \E#1 to give an unmatched @end error. -% -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% -} - - -% Single-spacing is done by various environments (specifically, in -% \nonfillstart and \quotations). -\newskip\singlespaceskip \singlespaceskip = 12.5pt -\def\singlespace{% - % Why was this kern here? It messes up equalizing space above and below - % environments. --karl, 6may93 - %{\advance \baselineskip by -\singlespaceskip - %\kern \baselineskip}% - \setleading \singlespaceskip -} - -%% Simple single-character @ commands - -% @@ prints an @ -% Kludge this until the fonts are right (grr). -\def\@{{\tt \char '100}} - -% This is turned off because it was never documented -% and you can use @w{...} around a quote to suppress ligatures. -%% Define @` and @' to be the same as ` and ' -%% but suppressing ligatures. -%\def\`{{`}} -%\def\'{{'}} - -% Used to generate quoted braces. - -\def\mylbrace {{\tt \char '173}} -\def\myrbrace {{\tt \char '175}} -\let\{=\mylbrace -\let\}=\myrbrace - -% @: forces normal size whitespace following. -\def\:{\spacefactor=1000 } - -% @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} - -% @. is an end-of-sentence period. -\def\.{.\spacefactor=3000 } - -% @enddots{} is an end-of-sentence ellipsis. -\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} - -% @! is an end-of-sentence bang. -\gdef\!{!\spacefactor=3000 } - -% @? is an end-of-sentence query. -\gdef\?{?\spacefactor=3000 } - -% @w prevents a word break. Without the \leavevmode, @w at the -% beginning of a paragraph, when TeX is still in vertical mode, would -% produce a whole line of output instead of starting the paragraph. -\def\w#1{\leavevmode\hbox{#1}} - -% @group ... @end group forces ... to be all on one page, by enclosing -% it in a TeX vbox. We use \vtop instead of \vbox to construct the box -% to keep its height that of a normal line. According to the rules for -% \topskip (p.114 of the TeXbook), the glue inserted is -% max (\topskip - \ht (first item), 0). If that height is large, -% therefore, no glue is inserted, and the space between the headline and -% the text is small, which looks bad. -% -\def\group{\begingroup - \ifnum\catcode13=\active \else - \errhelp = \groupinvalidhelp - \errmessage{@group invalid in context where filling is enabled}% - \fi - % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - \endgroup % End the \group. - }% - % - \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % - % Do @comment since we are called inside an environment such as - % @example, where each end-of-line in the input causes an - % end-of-line in the output. We don't want the end-of-line after - % the `@group' to put extra space in the output. Since @group - % should appear on a line by itself (according to the Texinfo - % manual), we don't worry about eating any user text. - \comment -} -% -% TeX puts in an \escapechar (i.e., `@') at the beginning of the help -% message, so this ends up printing `@group can only ...'. -% -\newhelp\groupinvalidhelp{% -group can only be used in environments such as @example,^^J% -where each line of input produces a line of output.} - -% @need space-in-mils -% forces a page break if there is not space-in-mils remaining. - -\newdimen\mil \mil=0.001in - -\def\need{\parsearg\needx} - -% Old definition--didn't work. -%\def\needx #1{\par % -%% This method tries to make TeX break the page naturally -%% if the depth of the box does not fit. -%{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 -%\prevdepth=-1000pt -%}} - -\def\needx#1{% - % Go into vertical mode, so we don't make a big box in the middle of a - % paragraph. - \par - % - % Don't add any leading before our big empty box, but allow a page - % break, since the best break might be right here. - \allowbreak - \nointerlineskip - \vtop to #1\mil{\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak -} - -% @br forces paragraph break - -\let\br = \par - -% @dots{} output some dots - -\def\dots{$\ldots$} - -% @page forces the start of a new page - -\def\page{\par\vfill\supereject} - -% @exdent text.... -% outputs text on separate line in roman font, starting at standard page margin - -% This records the amount of indent in the innermost environment. -% That's how much \exdent should take out. -\newskip\exdentamount - -% This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} - -% This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} - -% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. - -\def\inmargin#1{% -\strut\vadjust{\nobreak\kern-\strutdepth - \vtop to \strutdepth{\baselineskip\strutdepth\vss - \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} -\newskip\inmarginspacing \inmarginspacing=1cm -\def\strutdepth{\dp\strutbox} - -%\hbox{{\rm#1}}\hfil\break}} - -% @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup - \catcode`\\=12 - \catcode`~=12 - \catcode`^=12 - \catcode`_=12 - \catcode`|=12 - \catcode`<=12 - \catcode`>=12 - \catcode`+=12 - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. - \def\thisfile{#1}% - \input\thisfile -\endgroup} - -\def\thisfile{} - -% @center line outputs that line, centered - -\def\center{\parsearg\centerzzz} -\def\centerzzz #1{{\advance\hsize by -\leftskip -\advance\hsize by -\rightskip -\centerline{#1}}} - -% @sp n outputs n lines of vertical space - -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\par \vskip #1\baselineskip} - -% @comment ...line which is ignored... -% @c is the same as @comment -% @ignore ... @end ignore is another way to write a comment - -\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% -\parsearg \commentxxx} - -\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } - -\let\c=\comment - -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% -\let\chapter=\relax -\let\unnumbered=\relax -\let\top=\relax -\let\unnumberedsec=\relax -\let\unnumberedsection=\relax -\let\unnumberedsubsec=\relax -\let\unnumberedsubsection=\relax -\let\unnumberedsubsubsec=\relax -\let\unnumberedsubsubsection=\relax -\let\section=\relax -\let\subsec=\relax -\let\subsubsec=\relax -\let\subsection=\relax -\let\subsubsection=\relax -\let\appendix=\relax -\let\appendixsec=\relax -\let\appendixsection=\relax -\let\appendixsubsec=\relax -\let\appendixsubsection=\relax -\let\appendixsubsubsec=\relax -\let\appendixsubsubsection=\relax -\let\contents=\relax -\let\smallbook=\relax -\let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -\def\ignoremorecommands{% - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\everyheading = \relax - \let\evenheading = \relax - \let\oddheading = \relax - \let\everyfooting = \relax - \let\evenfooting = \relax - \let\oddfooting = \relax - \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax - \let\message = \relax -} - -% Ignore @ignore ... @end ignore. -% -\def\ignore{\doignore{ignore}} - -% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} -\def\ifhtml{\doignore{ifhtml}} -\def\html{\doignore{html}} -\def\menu{\doignore{menu}} -\def\direntry{\doignore{direntry}} - -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. - -\def\dircategory{\comment} - -% Ignore text until a line `@end #1'. -% -\def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - \long\def\doignoretext##1\end #1{\enddoignore}% - % - % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 - % - % And now expand that command. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi -} - -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont - \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont - \let\tensf = \nullfont - % Similarly for index fonts (mostly for their use in - % smallexample) - \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont - \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont - \let\indsf = \nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}} -} - -% @set VAR sets the variable VAR to an empty value. -% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. -% -% Since we want to separate VAR from REST-OF-LINE (which might be -% empty), we can't just use \parsearg; we have to insert a space of our -% own to delimit the rest of the line, and then take it out again if we -% didn't need it. -% -\def\set{\parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} -\def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi -} -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} - -% @clear VAR clears (i.e., unsets) the variable VAR. -% -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} - -% @value{foo} gets the text saved in variable foo. -% -\def\value#1{\expandafter - \ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}} - \else \csname SET#1\endcsname \fi} - -% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined -% with @set. -% -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi -} -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} - -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been -% defined with @set, or has been undefined with @clear. -% -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex always succeeds; we read the text following, through @end -% iftex). But `@end iftex' should be valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\defineunmatchedend{iftex} - -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. -% -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} - -% @asis just yields its argument. Used with @table, for example. -% -\def\asis#1{#1} - -% @math means output in math mode. -% We don't use $'s directly in the definition of \math because control -% sequences like \math are expanded when the toc file is written. Then, -% we read the toc file back, the $'s will be normal characters (as they -% should be, according to the definition of Texinfo). So we must use a -% control sequence to switch into and out of math mode. -% -% This isn't quite enough for @math to work properly in indices, but it -% seems unlikely it will ever be needed there. -% -\let\implicitmath = $ -\def\math#1{\implicitmath #1\implicitmath} - -% @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} - -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -\def\donoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\setref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\unnumbnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\appendixnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\let\refill=\relax - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \readauxfile - \opencontents - \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. - \comment % Ignore the actual filename. -} - -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} - -\message{fonts,} - -% Font-change commands. - -% Texinfo supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. -\newfam\sffam -\def\sf{\fam=\sffam \tensf} -\let\li = \sf % Sometimes we call it \li, not \sf. - -% We don't need math for this one. -\def\ttsl{\tenttsl} - -%% Try out Computer Modern fonts at \magstephalf -\let\mainmagstep=\magstephalf - -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). -% #3 is the font's design size, #4 is a scale factor -\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} - -% Use cm as the default font prefix. -% To specify the font prefix, you must define \fontprefix -% before you read in texinfo.tex. -\ifx\fontprefix\undefined -\def\fontprefix{cm} -\fi -% Support font families that don't use the same naming scheme as CM. -\def\rmshape{r} -\def\rmbshape{bx} %where the normal face is bold -\def\bfshape{b} -\def\bxshape{bx} -\def\ttshape{tt} -\def\ttbshape{tt} -\def\ttslshape{sltt} -\def\itshape{ti} -\def\itbshape{bxti} -\def\slshape{sl} -\def\slbshape{bxsl} -\def\sfshape{ss} -\def\sfbshape{ss} -\def\scshape{csc} -\def\scbshape{csc} - -\ifx\bigger\relax -\let\mainmagstep=\magstep1 -\setfont\textrm\rmshape{12}{1000} -\setfont\texttt\ttshape{12}{1000} -\else -\setfont\textrm\rmshape{10}{\mainmagstep} -\setfont\texttt\ttshape{10}{\mainmagstep} -\fi -% Instead of cmb10, you many want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10. -\setfont\textbf\bfshape{10}{\mainmagstep} -\setfont\textit\itshape{10}{\mainmagstep} -\setfont\textsl\slshape{10}{\mainmagstep} -\setfont\textsf\sfshape{10}{\mainmagstep} -\setfont\textsc\scshape{10}{\mainmagstep} -\setfont\textttsl\ttslshape{10}{\mainmagstep} -\font\texti=cmmi10 scaled \mainmagstep -\font\textsy=cmsy10 scaled \mainmagstep - -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 -\setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} - -% Fonts for indices and small examples. -% We actually use the slanted font rather than the italic, -% because texinfo normally uses the slanted fonts for that. -% Do not make many font distinctions in general in the index, since they -% aren't very useful. -\setfont\ninett\ttshape{9}{1000} -\setfont\indrm\rmshape{9}{1000} -\setfont\indit\slshape{9}{1000} -\let\indsl=\indit -\let\indtt=\ninett -\let\indttsl=\ninett -\let\indsf=\indrm -\let\indbf=\indrm -\setfont\indsc\scshape{10}{900} -\font\indi=cmmi9 -\font\indsy=cmsy9 - -% Fonts for headings -\setfont\chaprm\rmbshape{12}{\magstep2} -\setfont\chapit\itbshape{10}{\magstep3} -\setfont\chapsl\slbshape{10}{\magstep3} -\setfont\chaptt\ttbshape{12}{\magstep2} -\setfont\chapttsl\ttslshape{10}{\magstep3} -\setfont\chapsf\sfbshape{12}{\magstep2} -\let\chapbf=\chaprm -\setfont\chapsc\scbshape{10}{\magstep3} -\font\chapi=cmmi12 scaled \magstep2 -\font\chapsy=cmsy10 scaled \magstep3 - -\setfont\secrm\rmbshape{12}{\magstep1} -\setfont\secit\itbshape{10}{\magstep2} -\setfont\secsl\slbshape{10}{\magstep2} -\setfont\sectt\ttbshape{12}{\magstep1} -\setfont\secttsl\ttslshape{10}{\magstep2} -\setfont\secsf\sfbshape{12}{\magstep1} -\let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep2} -\font\seci=cmmi12 scaled \magstep1 -\font\secsy=cmsy10 scaled \magstep2 - -% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. -% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. -% \setfont\ssecsl\slshape{10}{\magstep1} -% \setfont\ssectt\ttshape{10}{\magstep1} -% \setfont\ssecsf\sfshape{10}{\magstep1} - -%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than -%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. -%\setfont\ssectt\ttshape{10}{1315} -%\setfont\ssecsf\sfshape{10}{1315} - -%\let\ssecbf=\ssecrm - -\setfont\ssecrm\rmbshape{12}{\magstephalf} -\setfont\ssecit\itbshape{10}{1315} -\setfont\ssecsl\slbshape{10}{1315} -\setfont\ssectt\ttbshape{12}{\magstephalf} -\setfont\ssecttsl\ttslshape{10}{\magstep1} -\setfont\ssecsf\sfbshape{12}{\magstephalf} -\let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} -\font\sseci=cmmi12 scaled \magstephalf -\font\ssecsy=cmsy10 scaled \magstep1 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. - -% Fonts for title page: -\setfont\titlerm\rmbshape{12}{\magstep3} -\let\authorrm = \secrm - -% In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts, we -% don't bother to reset \scriptfont and \scriptscriptfont (which would -% also require loading a lot more fonts). -% -\def\resetmathfonts{% - \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy - \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf - \textfont\ttfam = \tentt \textfont\sffam = \tensf -} - - -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl - \resetmathfonts} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl - \resetmathfonts} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl - \resetmathfonts} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl - \resetmathfonts} -\def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl - \resetmathfonts} - -% Set up the default fonts, so we can use them for creating boxes. -% -\textfonts - -% Count depth in font-changes, for error checks -\newcount\fontdepth \fontdepth=0 - -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} -\setfont\shortcontsl\slshape{12}{1000} - -%% Add scribe-like font environments, plus @l for inline lisp (usually sans -%% serif) and @ii for TeX italic - -% \smartitalic{ARG} outputs arg in italics, followed by an italic correction -% unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} - -\let\i=\smartitalic -\let\var=\smartitalic -\let\dfn=\smartitalic -\let\emph=\smartitalic -\let\cite=\smartitalic - -\def\b#1{{\bf #1}} -\let\strong=\b - -% We can't just use \exhyphenpenalty, because that only has effect at -% the end of a paragraph. Restore normal hyphenation at the end of the -% group within which \nohyphenation is presumably called. -% -\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} -\def\restorehyphenation{\hyphenchar\font = `- } - -\def\t#1{% - {\tt \rawbackslash \frenchspacing #1}% - \null -} -\let\ttfont=\t -\def\samp #1{`\tclose{#1}'\null} -\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -\let\file=\samp - -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. -\def\tclose#1{% - {% - % Change normal interword space to be same as for the current font. - \spaceskip = \fontdimen2\font - % - % Switch to typewriter. - \tt - % - % But `\ ' produces the large typewriter interword space. - \def\ {{\spaceskip = 0pt{} }}% - % - % Turn off hyphenation. - \nohyphenation - % - \rawbackslash - \frenchspacing - #1% - }% - \null -} - -% We *must* turn on hyphenation at `-' and `_' in \code. -% Otherwise, it is too hard to avoid overfull hboxes -% in the Emacs manual, the Library manual, etc. - -% Unfortunately, TeX uses one parameter (\hyphenchar) to control -% both hyphenation at - and hyphenation within words. -% We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate an a dash. -% -- rms. -{ -\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} -} - -\def\realdash{-} -\def\realunder{_} -\def\codedash{-\discretionary{}{}{}} -\def\codeunder{\normalunderscore\discretionary{}{}{}} -\def\codex #1{\tclose{#1}\endgroup} - -%\let\exp=\tclose %Was temporary - -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. -% -\def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\ttsl\look}}\fi -\else{\tclose{\ttsl\look}}\fi} - -% Check if we are currently using a typewriter font. Since all the -% Computer Modern typewriter fonts have zero interword stretch (and -% shrink), and it is reasonable to expect all typewriter fonts to have -% this property, we can check that font parameter. -% -\def\ifmonospace{\ifdim\fontdimen3\font=0pt } - -% Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of -% @dmn{}pt. -% -\def\dmn#1{\thinspace #1} - -\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - -\def\l#1{{\li #1}\null} % - -\def\r#1{{\rm #1}} % roman font -% Use of \lowercase was suggested. -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font - -\message{page headings,} - -\newskip\titlepagetopglue \titlepagetopglue = 1.5in -\newskip\titlepagebottomglue \titlepagebottomglue = 2pc - -% First the title page. Must do @settitle before @titlepage. -\def\titlefont#1{{\titlerm #1}} - -\newif\ifseenauthor -\newif\iffinishedtitlepage - -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} - -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm -% I deinstalled the following change because \cmr12 is undefined. -% This change was not in the ChangeLog anyway. --rms. -% \let\subtitlerm=\cmr12 - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefont{##1}} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - \oldpage - \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} -} - -\def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - \HEADINGSon -} - -\def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue -} - -%%% Set up page headings and footings. - -\let\thispage=\folio - -\newtoks \evenheadline % Token sequence for heading line of even pages -\newtoks \oddheadline % Token sequence for heading line of odd pages -\newtoks \evenfootline % Token sequence for footing line of even pages -\newtoks \oddfootline % Token sequence for footing line of odd pages - -% Now make Tex use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} -\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline - \else \the\evenfootline \fi}\HEADINGShook} -\let\HEADINGShook=\relax - -% Commands to set those variables. -% For example, this is what @headings on does -% @evenheading @thistitle|@thispage|@thischapter -% @oddheading @thischapter|@thispage|@thistitle -% @evenfooting @thisfile|| -% @oddfooting ||@thisfile - -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} -\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} -\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -% -}% unbind the catcode of @. - -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. -% @headings singleafter turns on single-sided headings after this page. -% By default, they are off. - -\def\headings #1 {\csname HEADINGS#1\endcsname} - -\def\HEADINGSoff{ -\global\evenheadline={\hfil} \global\evenfootline={\hfil} -\global\oddheadline={\hfil} \global\oddfootline={\hfil}} -\HEADINGSoff -% When we turn headings on, set the page number to 1. -% For double-sided printing, put current file name in lower left corner, -% chapter name on inside top of right hand pages, document -% title on inside top of left hand pages, and page numbers on outside top -% edge of all pages. -\def\HEADINGSdouble{ -%\pagealignmacro -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} -% For single-sided printing, chapter title goes across top left of page, -% page number on top right. -\def\HEADINGSsingle{ -%\pagealignmacro -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} -\def\HEADINGSon{\HEADINGSdouble} - -\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} -\let\HEADINGSdoubleafter=\HEADINGSafter -\def\HEADINGSdoublex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} - -\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} -\def\HEADINGSsinglex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} - -% Subroutines used in generating headings -% Produces Day Month Year style of output. -\def\today{\number\day\space -\ifcase\month\or -January\or February\or March\or April\or May\or June\or -July\or August\or September\or October\or November\or December\fi -\space\number\year} - -% Use this if you want the Month Day, Year style of output. -%\def\today{\ifcase\month\or -%January\or February\or March\or April\or May\or June\or -%July\or August\or September\or October\or November\or December\fi -%\space\number\day, \number\year} - -% @settitle line... specifies the title of the document, for headings -% It generates no output of its own - -\def\thistitle{No Title} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} - -\message{tables,} - -% @tabs -- simple alignment - -% These don't work. For one thing, \+ is defined as outer. -% So these macros cannot even be defined. - -%\def\tabs{\parsearg\tabszzz} -%\def\tabszzz #1{\settabs\+#1\cr} -%\def\tabline{\parsearg\tablinezzz} -%\def\tablinezzz #1{\+#1\cr} -%\def\&{&} - -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). - -% default indentation of table text -\newdimen\tableindent \tableindent=.8in -% default indentation of @itemize and @enumerate text -\newdimen\itemindent \itemindent=.3in -% margin between end of table item and start of table text. -\newdimen\itemmargin \itemmargin=.1in - -% used internally for \itemindent minus \itemmargin -\newdimen\itemmax - -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with -% these defs. -% They also define \itemindex -% to index the item name in whatever manner is desired (perhaps none). - -\newif\ifitemxneedsnegativevskip - -\def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} - -\def\internalBitem{\smallbreak \parsearg\itemzzz} -\def\internalBitemx{\itemxpar \parsearg\itemzzz} - -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - -\def\itemzzz #1{\begingroup % - \advance\hsize by -\rightskip - \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% - \itemindex{#1}% - \nobreak % This prevents a break before @itemx. - % - % Be sure we are not still in the middle of a paragraph. - %{\parskip = 0in - %\par - %}% - % - % If the item text does not fit in the space we have, put it on a line - % by itself, and do not allow a page break either before or after that - % line. We do not start a paragraph here because then if the next - % command is, e.g., @kindex, the whatsit would get put into the - % horizontal list on a line by itself, resulting in extra blank space. - \ifdim \wd0>\itemmax - % - % Make this a paragraph so we get the \parskip glue and wrapping, - % but leave it ragged-right. - \begingroup - \advance\leftskip by-\tableindent - \advance\hsize by\tableindent - \advance\rightskip by0pt plus1fil - \leavevmode\unhbox0\par - \endgroup - % - % We're going to be starting a paragraph, but we don't want the - % \parskip glue -- logically it's part of the @item we just started. - \nobreak \vskip-\parskip - % - % Stop a page break at the \parskip glue coming up. Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue. - \nobreak - \endgroup - \itemxneedsnegativevskipfalse - \else - % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. Since that - % text will be indented by \tableindent, we make the item text be in - % a zero-width box. - \noindent - \rlap{\hskip -\tableindent\box0}\ignorespaces% - \endgroup% - \itemxneedsnegativevskiptrue% - \fi -} - -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -%% Contains a kludge to get @end[description] to work -\def\description{\tablez{\dontindex}{1}{}{}{}{}} - -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % -} - -% This is the counter used by @enumerate, which is really @itemize - -\newcount \itemno - -\def\itemize{\parsearg\itemizezzz} - -\def\itemizezzz #1{% - \begingroup % ended by the @end itemsize - \itemizey {#1}{\Eitemize} -} - -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} - -% Set sfcode to normal for the chars that usually have another value. -% These are `.?!:;,' -\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 - \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } - -% \splitoff TOKENS\endmark defines \first to be the first token in -% TOKENS, and \rest to be the remainder. -% -\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% - -% Allow an optional argument of an uppercase letter, lowercase letter, -% or number, to specify the first label in the enumerated list. No -% argument is the same as `1'. -% -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} -\def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % - % If we were given no argument, pretend we were given `1'. - \def\thearg{#1}% - \ifx\thearg\empty \def\thearg{1}\fi - % - % Detect if the argument is a single token. If so, it might be a - % letter. Otherwise, the only valid thing it can be is a number. - % (We will always have one token, because of the test we just made. - % This is a good thing, since \splitoff doesn't work given nothing at - % all -- the first parameter is undelimited.) - \expandafter\splitoff\thearg\endmark - \ifx\rest\empty - % Only one token in the argument. It could still be anything. - % A ``lowercase letter'' is one whose \lccode is nonzero. - % An ``uppercase letter'' is one whose \lccode is both nonzero, and - % not equal to itself. - % Otherwise, we assume it's a number. - % - % We need the \relax at the end of the \ifnum lines to stop TeX from - % continuing to look for a . - % - \ifnum\lccode\expandafter`\thearg=0\relax - \numericenumerate % a number (we hope) - \else - % It's a letter. - \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax - \lowercaseenumerate % lowercase letter - \else - \uppercaseenumerate % uppercase letter - \fi - \fi - \else - % Multiple tokens in the argument. We hope it's a number. - \numericenumerate - \fi -} - -% An @enumerate whose labels are integers. The starting integer is -% given in \thearg. -% -\def\numericenumerate{% - \itemno = \thearg - \startenumeration{\the\itemno}% -} - -% The starting (lowercase) letter is in \thearg. -\def\lowercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more lowercase letters in @enumerate; get a bigger - alphabet}% - \fi - \char\lccode\itemno - }% -} - -% The starting (uppercase) letter is in \thearg. -\def\uppercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more uppercase letters in @enumerate; get a bigger - alphabet} - \fi - \char\uccode\itemno - }% -} - -% Call itemizey, adding a period to the first argument and supplying the -% common last two arguments. Also subtract one from the initial value in -% \itemno, since @item increments \itemno. -% -\def\startenumeration#1{% - \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr -} - -% @alphaenumerate and @capsenumerate are abbreviations for giving an arg -% to @enumerate. -% -\def\alphaenumerate{\enumerate{a}} -\def\capsenumerate{\enumerate{A}} -\def\Ealphaenumerate{\Eenumerate} -\def\Ecapsenumerate{\Eenumerate} - -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{\in hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} - -% @multitable macros -% Amy Hendrickson, 8/18/94 -% -% @multitable ... @end multitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width -% can be specified either with sample text given in a template line, -% or in percent of \hsize, the current width of text on page. - -% Table can continue over pages but will only break between lines. - -% To make preamble: -% -% Either define widths of columns in terms of percent of \hsize: -% @multitable @columnfractions .25 .3 .45 -% @item ... -% -% Numbers following @columnfractions are the percent of the total -% current hsize to be used for each column. You may use as many -% columns as desired. - -% Or use a template: -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item ... -% using the widest term desired in each column. - - -% Each new table line starts with @item, each subsequent new column -% starts with @tab. Empty columns may be produced by supplying @tab's -% with nothing between them for as many times as empty columns are needed, -% ie, @tab@tab@tab will produce two empty columns. - -% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their -% own lines, but it will not hurt if they are. - -% Sample multitable: - -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff -% @tab Many paragraphs of text may be used in any column. -% -% They will wrap at the width determined by the template. -% @item@tab@tab This will be in third column. -% @end multitable - -% Default dimensions may be reset by user. -% @multitableparskip will set vertical space between paragraphs in table. -% @multitableparindent will set paragraph indent in table. -% @multitablecolmargin will set horizontal space to be left between columns. -% @multitablelineskip will set vertical space to be left between lines. - -%%%% -% Dimensions - -\newskip\multitableparskip -\newskip\multitableparindent -\newdimen\multitablecolspace -\newskip\multitablelinespace -\multitableparskip=0pt -\multitableparindent=6pt -\multitablecolspace=12pt -\multitablelinespace=12pt - -%%%% -% Macros used to set up halign preamble: -\let\endsetuptable\relax -\def\xendsetuptable{\endsetuptable} -\let\columnfractions\relax -\def\xcolumnfractions{\columnfractions} -\newif\ifsetpercent - -%% 2/1/96, to allow fractions to be given with more than one digit. -\def\pickupwholefraction#1 {\global\advance\colcount by1 % -\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% -\setuptable} - -\newcount\colcount -\def\setuptable#1{\def\firstarg{#1}% -\ifx\firstarg\xendsetuptable\let\go\relax% -\else - \ifx\firstarg\xcolumnfractions\global\setpercenttrue% - \else - \ifsetpercent - \let\go\pickupwholefraction % In this case arg of setuptable - % is the decimal point before the - % number given in percent of hsize. - % We don't need this so we don't use it. - \else - \global\advance\colcount by1 - \setbox0=\hbox{#1}% - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi% - \fi% -\ifx\go\pickupwholefraction\else\let\go\setuptable\fi% -\fi\go} - -%%%% -% multitable syntax -\def\tab{&\hskip1sp\relax} % 2/2/96 - % tiny skip here makes sure this column space is - % maintained, even if it is never used. - - -%%%% -% @multitable ... @end multitable definitions: - -\def\multitable#1\item{\bgroup -\let\item\cr -\tolerance=9500 -\hbadness=9500 -\parskip=\multitableparskip -\parindent=\multitableparindent -\overfullrule=0pt -\global\colcount=0\relax% -\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : -\def\one{#1}\expandafter\setuptable\one\endsetuptable - % Need to reset this to 0 after \setuptable. -\global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. -\halign\bgroup&\global\advance\colcount by 1\relax% -\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - % we will use that dimension as the width of the column, and - % the \leftskip will keep entries from bumping into each other. - % Table will start at left margin and final column will justify at - % right margin. -\ifnum\colcount=1 -\else - \ifsetpercent - \else - % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: -\leftskip=\multitablecolspace -\fi -\noindent##}\cr% - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. -\global\everycr{\noalign{\nointerlineskip\vskip\multitablelinespace -\filbreak%% keeps underfull box messages off when table breaks over pages. -\global\colcount=0\relax}}} - -\message{indexing,} -% Index generation facilities - -% Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within \newindex. -{\catcode`\@=11 -\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} - -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. -% The name of an index should be no more than 2 characters long -% for the sake of vms. - -\def\newindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#1}} -} - -% @defindex foo == \newindex{foo} - -\def\defindex{\parsearg\newindex} - -% Define @defcodeindex, like @defindex except put all entries in @code. - -\def\newcodeindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#1}} -} - -\def\defcodeindex{\parsearg\newcodeindex} - -% @synindex foo bar makes index foo feed into index bar. -% Do this instead of @defindex foo if you don't want it as a separate index. -\def\synindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#2}}% -} - -% @syncodeindex foo bar similar, but put all entries made for index foo -% inside @code. -\def\syncodeindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#2}}% -} - -% Define \doindex, the driver for all \fooindex macros. -% Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. - -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} - -% like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} - -\def\indexdummies{% -% Take care of the plain tex accent commands. -\def\"{\realbackslash "}% -\def\`{\realbackslash `}% -\def\'{\realbackslash '}% -\def\^{\realbackslash ^}% -\def\~{\realbackslash ~}% -\def\={\realbackslash =}% -\def\b{\realbackslash b}% -\def\c{\realbackslash c}% -\def\d{\realbackslash d}% -\def\u{\realbackslash u}% -\def\v{\realbackslash v}% -\def\H{\realbackslash H}% -% Take care of the plain tex special European modified letters. -\def\oe{\realbackslash oe}% -\def\ae{\realbackslash ae}% -\def\aa{\realbackslash aa}% -\def\OE{\realbackslash OE}% -\def\AE{\realbackslash AE}% -\def\AA{\realbackslash AA}% -\def\o{\realbackslash o}% -\def\O{\realbackslash O}% -\def\l{\realbackslash l}% -\def\L{\realbackslash L}% -\def\ss{\realbackslash ss}% -% Take care of texinfo commands likely to appear in an index entry. -\def\_{{\realbackslash _}}% -\def\w{\realbackslash w }% -\def\bf{\realbackslash bf }% -\def\rm{\realbackslash rm }% -\def\sl{\realbackslash sl }% -\def\sf{\realbackslash sf}% -\def\tt{\realbackslash tt}% -\def\gtr{\realbackslash gtr}% -\def\less{\realbackslash less}% -\def\hat{\realbackslash hat}% -\def\char{\realbackslash char}% -\def\TeX{\realbackslash TeX}% -\def\dots{\realbackslash dots }% -\def\copyright{\realbackslash copyright }% -\def\tclose##1{\realbackslash tclose {##1}}% -\def\code##1{\realbackslash code {##1}}% -\def\samp##1{\realbackslash samp {##1}}% -\def\t##1{\realbackslash r {##1}}% -\def\r##1{\realbackslash r {##1}}% -\def\i##1{\realbackslash i {##1}}% -\def\b##1{\realbackslash b {##1}}% -\def\cite##1{\realbackslash cite {##1}}% -\def\key##1{\realbackslash key {##1}}% -\def\file##1{\realbackslash file {##1}}% -\def\var##1{\realbackslash var {##1}}% -\def\kbd##1{\realbackslash kbd {##1}}% -\def\dfn##1{\realbackslash dfn {##1}}% -\def\emph##1{\realbackslash emph {##1}}% -\unsepspaces -} - -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} - -% \indexnofonts no-ops all font-change commands. -% This is used when outputting the strings to sort the index by. -\def\indexdummyfont#1{#1} -\def\indexdummytex{TeX} -\def\indexdummydots{...} - -\def\indexnofonts{% -% Just ignore accents. -\let\"=\indexdummyfont -\let\`=\indexdummyfont -\let\'=\indexdummyfont -\let\^=\indexdummyfont -\let\~=\indexdummyfont -\let\==\indexdummyfont -\let\b=\indexdummyfont -\let\c=\indexdummyfont -\let\d=\indexdummyfont -\let\u=\indexdummyfont -\let\v=\indexdummyfont -\let\H=\indexdummyfont -% Take care of the plain tex special European modified letters. -\def\oe{oe}% -\def\ae{ae}% -\def\aa{aa}% -\def\OE{OE}% -\def\AE{AE}% -\def\AA{AA}% -\def\o{o}% -\def\O{O}% -\def\l{l}% -\def\L{L}% -\def\ss{ss}% -\let\w=\indexdummyfont -\let\t=\indexdummyfont -\let\r=\indexdummyfont -\let\i=\indexdummyfont -\let\b=\indexdummyfont -\let\emph=\indexdummyfont -\let\strong=\indexdummyfont -\let\cite=\indexdummyfont -\let\sc=\indexdummyfont -%Don't no-op \tt, since it isn't a user-level command -% and is used in the definitions of the active chars like <, >, |... -%\let\tt=\indexdummyfont -\let\tclose=\indexdummyfont -\let\code=\indexdummyfont -\let\file=\indexdummyfont -\let\samp=\indexdummyfont -\let\kbd=\indexdummyfont -\let\key=\indexdummyfont -\let\var=\indexdummyfont -\let\TeX=\indexdummytex -\let\dots=\indexdummydots -} - -% To define \realbackslash, we must make \ not be an escape. -% We must first make another character (@) an escape -% so we do not become unable to do a definition. - -{\catcode`\@=0 \catcode`\\=\other -@gdef@realbackslash{\}} - -\let\indexbackslash=0 %overridden during \printindex. - -\let\SETmarginindex=\relax %initialize! -% workhorse for all \fooindexes -% #1 is name of index, #2 is stuff to put there -\def\doind #1#2{% -% Put the index entry in the margin if desired. -\ifx\SETmarginindex\relax\else% -\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% -\fi% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% 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 in the indx. -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}}}% -\temp }% -}\penalty\count10}} - -\def\dosubind #1#2#3{% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% -\def\rawbackslashxx{\indexbackslash}% -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2 #3}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}{#3}}}% -\temp }% -}\penalty\count10}} - -% The index entry written in the file actually looks like -% \entry {sortstring}{page}{topic} -% or -% \entry {sortstring}{page}{topic}{subtopic} -% The texindex program reads in these files and writes files -% containing these kinds of lines: -% \initial {c} -% before the first topic whose initial is c -% \entry {topic}{pagelist} -% for a topic that is used without subtopics -% \primary {topic} -% for the beginning of a topic that is used with subtopics -% \secondary {subtopic}{pagelist} -% for each subtopic. - -% Define the user-accessible indexing commands -% @findex, @vindex, @kindex, @cindex. - -\def\findex {\fnindex} -\def\kindex {\kyindex} -\def\cindex {\cpindex} -\def\vindex {\vrindex} -\def\tindex {\tpindex} -\def\pindex {\pgindex} - -\def\cindexsub {\begingroup\obeylines\cindexsub} -{\obeylines % -\gdef\cindexsub "#1" #2^^M{\endgroup % -\dosubind{cp}{#2}{#1}}} - -% Define the macros used in formatting output of the sorted index material. - -% This is what you call to cause a particular index to get printed. -% Write -% @unnumbered Function Index -% @printindex fn - -\def\printindex{\parsearg\doprintindex} - -\def\doprintindex#1{% - \tex - \dobreak \chapheadingskip {10000} - \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - \catcode`\$=\other - \catcode`\~=\other - \indexbreaks - % - % The following don't help, since the chars were translated - % when the raw index was written, and their fonts were discarded - % due to \indexnofonts. - %\catcode`\"=\active - %\catcode`\^=\active - %\catcode`\_=\active - %\catcode`\|=\active - %\catcode`\<=\active - %\catcode`\>=\active - % % - \def\indexbackslash{\rawbackslashxx} - \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt - \begindoublecolumns - % - % See if the index file exists and is nonempty. - \openin 1 \jobname.#1s - \ifeof 1 - % \enddoublecolumns gets confused if there is no text in the index, - % and it loses the chapter title and the aux file entries for the - % index. The easiest way to prevent this problem is to make sure - % there is some text. - (Index is nonexistent) - \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - % false. We have to make TeX try to read something from the file, so - % it can discover if there is anything in it. - \read 1 to \temp - \ifeof 1 - (Index is empty) - \else - \input \jobname.#1s - \fi - \fi - \closein 1 - \enddoublecolumns - \Etex -} - -% These macros are used by the sorted index file itself. -% Change them to control the appearance of the index. - -% Same as \bigskipamount except no shrink. -% \balancecolumns gets confused if there is any shrink. -\newskip\initialskipamount \initialskipamount 12pt plus4pt - -\def\initial #1{% -{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt -\ifdim\lastskip<\initialskipamount -\removelastskip \penalty-200 \vskip \initialskipamount\fi -\line{\secbf#1\hfill}\kern 2pt\penalty10000}} - -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. -% -\def\entry #1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent=2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% - % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. - % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ #2% The page number ends the paragraph. - \fi% - \par -\endgroup} - -% Like \dotfill except takes at least 1 em. -\def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} - -\def\primary #1{\line{#1\hfil}} - -\newskip\secondaryindent \secondaryindent=0.5cm - -\def\secondary #1#2{ -{\parfillskip=0in \parskip=0in -\hangindent =1in \hangafter=1 -\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par -}} - -%% Define two-column mode, which is used in indexes. -%% Adapted from the TeXbook, page 416. -\catcode `\@=11 - -\newbox\partialpage - -\newdimen\doublecolumnhsize - -\def\begindoublecolumns{\begingroup - % Grab any single-column material above us. - \output = {\global\setbox\partialpage - =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% - \eject - % - % Now switch to the double-column output routine. - \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. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - % below is chosen so that the gutter has the same value (well, +- < - % 1pt) as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - % can restore it in \pagesofar, after \hsize itself has (potentially) - % been clobbered. - % - \doublecolumnhsize = \hsize - \advance\doublecolumnhsize by -.04154\hsize - \divide\doublecolumnhsize by 2 - \hsize = \doublecolumnhsize - % - % Double the \vsize as well. (We don't need a separate register here, - % since nobody clobbers \vsize.) - \vsize = 2\vsize - \doublecolumnpagegoal -} - -\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} - -\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth - \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage - \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} - \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} - \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi -} -\def\doublecolumnpagegoal{% - \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ -} -\def\pagesofar{\unvbox\partialpage % - \hsize=\doublecolumnhsize % have to restore this since output routine - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} -\def\doublecolumnout{% - \setbox5=\copy255 - {\vbadness=10000 \doublecolumnsplit} - \ifvbox255 - \setbox0=\vtop to\dimen@{\unvbox0} - \setbox2=\vtop to\dimen@{\unvbox2} - \onepageout\pagesofar \unvbox255 \penalty\outputpenalty - \else - \setbox0=\vbox{\unvbox5} - \ifvbox0 - \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth - {\vbadness=10000 - \loop \global\setbox5=\copy0 - \setbox1=\vsplit5 to\dimen@ - \setbox3=\vsplit5 to\dimen@ - \ifvbox5 \global\advance\dimen@ by1pt \repeat - \setbox0=\vbox to\dimen@{\unvbox1} - \setbox2=\vbox to\dimen@{\unvbox3} - \global\setbox\partialpage=\vbox{\pagesofar} - \doublecolumnpagegoal - } - \fi - \fi -} - -\catcode `\@=\other -\message{sectioning,} -% Define chapters, sections, etc. - -\newcount \chapno -\newcount \secno \secno=0 -\newcount \subsecno \subsecno=0 -\newcount \subsubsecno \subsubsecno=0 - -% This counter is funny since it counts through charcodes of letters A, B, ... -\newcount \appendixno \appendixno = `\@ -\def\appendixletter{\char\the\appendixno} - -\newwrite \contentsfile -% This is called from \setfilename. -\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\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}} -} - -\newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count - -% @raisesections: treat @section as chapter, @subsection as section, etc. -\def\raisesections{\global\advance\secbase by -1} -\let\up=\raisesections % original BFox name - -% @lowersections: treat @chapter as section, @section as subsection, etc. -\def\lowersections{\global\advance\secbase by 1} -\let\down=\lowersections % original BFox name - -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} - \else - \numberedsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} - \else - \appendixsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} - \else - \unnumberedsubsubseczzz{#2} - \fi -\fi -} - - -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{\seccheck{chapter}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% -\chapmacro {#1}{\the\chapno}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -% We don't substitute the actual chapter name into \thischapter -% because we don't want its macros evaluated now. -\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec -}} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{\seccheck{appendix}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 \message{Appendix \appendixletter}% -\chapmacro {#1}{\putwordAppendix{} \appendixletter}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry - {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\global\let\section = \appendixsec -\global\let\subsection = \appendixsubsec -\global\let\subsubsection = \appendixsubsubsec -}} - -\outer\def\top{\parsearg\unnumberedyyy} -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{\seccheck{unnumbered}% -\secno=0 \subsecno=0 \subsubsecno=0 -% -% This used to be simply \message{#1}, but TeX fully expands the -% argument to \message. Therefore, if #1 contained @-commands, TeX -% expanded them. For example, in `@unnumbered The @cite{Book}', TeX -% expanded @cite (which turns out to cause errors because \cite is meant -% to be executed, not expanded). -% -% Anyway, we don't want the fully-expanded definition of @cite to appear -% as a result of the \message, we just want `@cite' itself. We use -% \the to achieve this: TeX expands \the only once, -% simply yielding the contents of the . -\toks0 = {#1}\message{(\the\toks0)}% -% -\unnumbchapmacro {#1}% -\gdef\thischapter{#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\global\let\section = \unnumberedsec -\global\let\subsection = \unnumberedsubsec -\global\let\subsubsection = \unnumberedsubsubsec -}} - -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{\seccheck{section}% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{\seccheck{appendixsection}% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{\seccheck{subsection}% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry % - {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry{#1}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - -% These macros control what the section commands do, according -% to what kind of chapter we are in (ordinary, appendix, or unnumbered). -% Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec - -% Define @majorheading, @heading and @subheading - -% NOTE on use of \vbox for chapter headings, section headings, and -% such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - - -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% -{\advance\chapheadingskip by 10pt \chapbreak }% -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -\def\heading{\parsearg\secheadingi} - -\def\subheading{\parsearg\subsecheadingi} - -\def\subsubheading{\parsearg\subsubsecheadingi} - -% These macros generate a chapter, section, etc. heading only -% (including whitespace, linebreaking, etc. around it), -% given all the information in convenient, parsed form. - -%%% Args are the skip and penalty (usually negative) -\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} - -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - -%%% Define plain chapter starts, and page on/off switching for it -% Parameter controlling skip before chapter headings (if needed) - -\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt - -\def\chapbreak{\dobreak \chapheadingskip {-4000}} -\def\chappager{\par\vfill\supereject} -\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} - -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} - -\def\CHAPPAGoff{ -\global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} - -\def\CHAPPAGon{ -\global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager -\global\def\HEADINGSon{\HEADINGSsingle}} - -\def\CHAPPAGodd{ -\global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage -\global\def\HEADINGSon{\HEADINGSdouble}} - -\CHAPPAGon - -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain} - -\def\chfplain #1#2{% - \pchapsepmacro - {% - \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #2\enspace #1}% - }% - \bigskip - \penalty5000 -} - -\def\unnchfplain #1{% -\pchapsepmacro % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} -\CHAPFplain % The default - -\def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} - -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} - -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen} - -% Parameter controlling skip before section headings. - -\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} - -\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} - -% @paragraphindent is defined for the Info formatting commands only. -\let\paragraphindent=\comment - -% Section fonts are the base font at magstep2, which produces -% a size a bit more than 14 points in the default situation. - -\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} -\def\plainsecheading #1{\secheadingi {#1}} -\def\secheadingi #1{{\advance \secheadingskip by \parskip % -\secheadingbreak}% -{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - -% Subsection fonts are the base font at magstep1, -% which produces a size of 12 points. - -\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} -\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - -\def\subsubsecfonts{\subsecfonts} % Maybe this should change: - % Perhaps make sssec fonts scaled - % magstep half -\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} -\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} - - -\message{toc printing,} - -% Finish up the main text and prepare to read what we've written -% to \contentsfile. - -\newskip\contentsrightmargin \contentsrightmargin=1in -\def\startcontents#1{% - \pagealignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. - \fi - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. -} - - -% Normal (long) toc. -\outer\def\contents{% - \startcontents{\putwordTableofContents}% - \input \jobname.toc - \endgroup - \vfill \eject -} - -% And just the chapters. -\outer\def\summarycontents{% - \startcontents{\putwordShortContents}% - % - \let\chapentry = \shortchapentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc - \endgroup - \vfill \eject -} -\let\shortcontents = \summarycontents - -% These macros generate individual entries in the table of contents. -% The first argument is the chapter or section name. -% The last argument is the page number. -% The arguments in between are the chapter number, section number, ... - -% Chapter-level things, for both the long and short contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} - -% See comments in \dochapentry re vbox and related settings -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% -} - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. -\setbox0 = \hbox{\shortcontrm \putwordAppendix } -\newdimen\shortappendixwidth \shortappendixwidth = \wd0 - -\def\shortchaplabel#1{% - % We typeset #1 in a box of constant width, regardless of the text of - % #1, so the chapter titles will come out aligned. - \setbox0 = \hbox{#1}% - \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi - % - % This space should be plenty, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in in \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% -} - -\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} - -% Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} - -% Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} - -% And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - - -% This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc - -% Now for the actual typesetting. In all these, #1 is the text and #2 is the -% page number. -% -% If the toc has to be broken over pages, we would want to be at chapters -% if at all possible; hence the \penalty. -\def\dochapentry#1#2{% - \penalty-300 \vskip\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno{#2}}% - \endgroup - \nobreak\vskip .25\baselineskip -} - -\def\dosecentry#1#2{\begingroup - \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsecentry#1#2{\begingroup - \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsubsecentry#1#2{\begingroup - \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -% -% \turnoffactive is for the sake of @" used for umlauts. -\def\tocentry#1#2{\begingroup - \hyphenpenalty = 10000 - \entry{\turnoffactive #1}{\turnoffactive #2}% -\endgroup} - -% Space between chapter (or whatever) number and the title. -\def\labelspace{\hskip1em \relax} - -\def\dopageno#1{{\rm #1}} -\def\doshortpageno#1{{\rm #1}} - -\def\chapentryfonts{\secfonts \rm} -\def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts - - -\message{environments,} - -% Since these characters are used in examples, it should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% Furthermore, these definitions must come after we define our fonts. -\newbox\dblarrowbox \newbox\longdblarrowbox -\newbox\pushcharbox \newbox\bullbox -\newbox\equivbox \newbox\errorbox - -\let\ptexequiv = \equiv - -%{\tentt -%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} -%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} -%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} -%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} -% Adapted from the manmac format (p.420 of TeXbook) -%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex -% depth .1ex\hfil} -%} - -\def\point{$\star$} - -\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - -\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - -% Adapted from the TeXbook's \boxit. -{\tentt \global\dimen0 = 3em}% Width of the box. -\dimen2 = .55pt % Thickness of rules -% The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} - -\global\setbox\errorbox=\hbox to \dimen0{\hfil - \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. - \advance\hsize by -2\dimen2 % Rules. - \vbox{ - \hrule height\dimen2 - \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. - \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. - \kern3pt\vrule width\dimen2}% Space to right. - \hrule height\dimen2} - \hfil} - -% The @error{} command. -\def\error{\leavevmode\lower.7ex\copy\errorbox} - -% @tex ... @end tex escapes into raw Tex temporarily. -% One exception: @ is still an escape character, so that @end tex works. -% But \@ or @@ will get a plain tex @ character. - -\def\tex{\begingroup -\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 -\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 -\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie -\catcode `\%=14 -\catcode 43=12 -\catcode`\"=12 -\catcode`\==12 -\catcode`\|=12 -\catcode`\<=12 -\catcode`\>=12 -\escapechar=`\\ -% -\let\~=\ptextilde -\let\{=\ptexlbrace -\let\}=\ptexrbrace -\let\.=\ptexdot -\let\*=\ptexstar -\let\dots=\ptexdots -\def\@{@}% -\let\bullet=\ptexbullet -\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl -\let\L=\ptexL -% -\let\Etex=\endgroup} - -% Define @lisp ... @endlisp. -% @lisp does a \begingroup so it can rebind things, -% including the definition of @endlisp (which normally is erroneous). - -% Amount to narrow the margins by for @lisp. -\newskip\lispnarrowing \lispnarrowing=0.4in - -% This is the definition that ^^M gets inside @lisp, @example, and other -% such environments. \null is better than a space, since it doesn't -% have any width. -\def\lisppar{\null\endgraf} - -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - -% This space is always present above and below environments. -\newskip\envskipamount \envskipamount = 0pt - -% Make spacing and below environment symmetrical. We use \parskip here -% to help in doing that, since in @example-like environments \parskip -% is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip -% -\def\aboveenvbreak{{\advance\envskipamount by \parskip -\endgraf \ifdim\lastskip<\envskipamount -\removelastskip \penalty-50 \vskip\envskipamount \fi}} - -\let\afterenvbreak = \aboveenvbreak - -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. -\let\nonarrowing=\relax - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \cartouche: draw rectangle w/rounded corners around argument -\font\circle=lcircle10 -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip -\circthick=\fontdimen8\circle -% -\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth -\def\ctr{{\hskip 6pt\circle\char'010}} -\def\cbl{{\circle\char'012\hskip -6pt}} -\def\cbr{{\hskip 6pt\circle\char'011}} -\def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} -\def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} -% -\newskip\lskip\newskip\rskip - -\long\def\cartouche{% -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip -\def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} - - -% This macro is called at the beginning of all the @example variants, -% inside a group. -\def\nonfillstart{% - \aboveenvbreak - \inENV % This group ends at the end of the body - \hfuzz = 12pt % Don't be fussy - \sepspaces % Make spaces be word-separators rather than space tokens. - \singlespace - \let\par = \lisppar % don't ignore blank lines - \obeylines % each line of input is a line of output - \parskip = 0pt - \parindent = 0pt - \emergencystretch = 0pt % don't try to avoid overfull boxes - % @cartouche defines \nonarrowing to inhibit narrowing - % at next level down. - \ifx\nonarrowing\relax - \advance \leftskip by \lispnarrowing - \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax - \fi -} - -% To ending an @example-like environment, we first end the paragraph -% (via \afterenvbreak's vertical glue), and then the group. That way we -% keep the zero \parskip that the environments set -- \parskip glue -% will be inserted at the beginning of the next paragraph in the -% document, after the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup}% - -% This macro is -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \rawbackslash % have \ input char produce \ char from current font - \gobble -} - -% Define the \E... control sequence only if we are inside the -% environment, so the error checking in \end will work. -% -% We must call \lisp last in the definition, since it reads the -% return following the @example (or whatever) command. -% -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} -\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% @smallexample and @smalllisp. This is not used unless the @smallbook -% command is given. Originally contributed by Pavel@xerox. -% -\def\smalllispx{\begingroup - \nonfillstart - \let\Esmalllisp = \nonfillfinish - \let\Esmallexample = \nonfillfinish - % - % Smaller interline space and fonts for small examples. - \setleading{10pt}% - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - \gobble -} - -% This is @display; same as @lisp except use roman font. -% -\def\display{\begingroup - \nonfillstart - \let\Edisplay = \nonfillfinish - \gobble -} - -% This is @format; same as @display except don't narrow margins. -% -\def\format{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eformat = \nonfillfinish - \gobble -} - -% @flushleft (same as @format) and @flushright. -% -\def\flushleft{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushleft = \nonfillfinish - \gobble -} -\def\flushright{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushright = \nonfillfinish - \advance\leftskip by 0pt plus 1fill - \gobble} - -% @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. -% -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body - {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \singlespace - \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% - % - % @cartouche defines \nonarrowing to inhibit narrowing at next level down. - \ifx\nonarrowing\relax - \advance\leftskip by \lispnarrowing - \advance\rightskip by \lispnarrowing - \exdentamount = \lispnarrowing - \let\nonarrowing = \relax - \fi -} - -\message{defuns,} -% Define formatter for defuns -% First, allow user to change definition object font (\df) internally -\def\setdeffont #1 {\csname DEF#1\endcsname} - -\newskip\defbodyindent \defbodyindent=.4in -\newskip\defargsindent \defargsindent=50pt -\newskip\deftypemargin \deftypemargin=12pt -\newskip\deflastargmargin \deflastargmargin=18pt - -\newcount\parencount -% define \functionparens, which makes ( and ) and & do special things. -% \functionparens affects the group it is contained in. -\def\activeparens{% -\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active -\catcode`\[=\active \catcode`\]=\active} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % -\global\advance\parencount by 1 } -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. -% also in that case restore the outer-level definition of (. -\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi -\global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} -\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} - -% First, defname, which formats the header line itself. -% #1 should be the function name. -% #2 should be the type of definition, such as "Function". - -\def\defname #1#2{% -% Get the values of \leftskip and \rightskip as they were -% outside the @def... -\dimen2=\leftskip -\advance\dimen2 by -\defbodyindent -\dimen3=\rightskip -\advance\dimen3 by -\defbodyindent -\noindent % -\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% -\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line -\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 % -% Now output arg 2 ("Function" or some such) -% ending at \deftypemargin from the right margin, -% but stuck inside a box of width 0 so it does not interfere with linebreaking -{% Adjust \hsize to exclude the ambient margins, -% so that \rightline will obey them. -\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 -\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% -% Make all lines underfull and no complaints: -\tolerance=10000 \hbadness=10000 -\advance\leftskip by -\defbodyindent -\exdentamount=\defbodyindent -{\df #1}\enskip % Generate function name -} - -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - -\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} - -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% - \parindent=0in - \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines -} - -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{#3{#4}}% -} - -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody -% -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. -% -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{\parsetpheaderline{#3{#4}}}\empty -} - -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does, putting the result in \tptemp. -% -\def\removeemptybraces\empty#1\relax{\def\tptemp{#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}% -}% - -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} - -% Split up #2 at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. - -{\obeylines -\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% -\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% -\ifx\relax #3% -#1{#2}{}\else #1{#2}{#3#4}\fi}} - -% So much for the things common to all kinds of definitions. - -% Define @defun. - -% First, define the processing that is wanted for arguments of \defun -% Use this to expand the args and terminate the paragraph they make up - -\def\defunargs #1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -\hyphenchar\tensl=0 -#1% -\hyphenchar\tensl=45 -\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -% Do complete processing of one @defun or @defunx line already parsed. - -% @deffn Command forward-char nchars - -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} - -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defun == @deffn Function - -\def\defun{\defparsebody\Edefun\defunx\defunheader} - -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Function}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefun int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} - -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% -\deftypefunargs {#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} - -% \defheaderxcond#1\relax$$$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} - -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$$$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defmac == @deffn Macro - -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} - -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Macro}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} - -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Special Form}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% This definition is run if you use @defunx -% anywhere other than immediately after a @defun or @defunx. - -\def\deffnx #1 {\errmessage{@deffnx in invalid context}} -\def\defunx #1 {\errmessage{@defunx in invalid context}} -\def\defmacx #1 {\errmessage{@defmacx in invalid context}} -\def\defspecx #1 {\errmessage{@defspecx in invalid context}} -\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} - -% @defmethod, and so on - -% @defop {Funny Method} foo-class frobnicate argument - -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} - -\def\defopheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype{} on #1}% -\defunargs {#3}\endgroup % -} - -% @defmethod == @defop Method - -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} - -\def\defmethodheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% entry in function index -\begingroup\defname {#2}{Method on #1}% -\defunargs {#3}\endgroup % -} - -% @defcv {Class Option} foo-class foo-flag - -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} - -\def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype{} of #1}% -\defvarargs {#3}\endgroup % -} - -% @defivar == @defcv {Instance Variable} - -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} - -\def\defivarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{Instance Variable of #1}% -\defvarargs {#3}\endgroup % -} - -% These definitions are run if you use @defmethodx, etc., -% anywhere other than immediately after a @defmethod, etc. - -\def\defopx #1 {\errmessage{@defopx in invalid context}} -\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} -\def\defcvx #1 {\errmessage{@defcvx in invalid context}} -\def\defivarx #1 {\errmessage{@defivarx in invalid context}} - -% Now @defvar - -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000} - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{Variable}% -\defvarargs {#2}\endgroup % -} - -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{User Option}% -\defvarargs {#2}\endgroup % -} - -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name. -\def\deftypevarheader #1#2{% -\doind {vr}{\code{#2}}% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 -\endgroup} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% -\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 -\endgroup} - -% This definition is run if you use @defvarx -% anywhere other than immediately after a @defvar or @defvarx. - -\def\defvrx #1 {\errmessage{@defvrx in invalid context}} -\def\defvarx #1 {\errmessage{@defvarx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% This definition is run if you use @deftpx, etc -% anywhere other than immediately after a @deftp, etc. - -\def\deftpx #1 {\errmessage{@deftpx in invalid context}} - -\message{cross reference,} -% Define cross-reference macros -\newwrite \auxfile - -\newif\ifhavexrefs % True if xref values are known. -\newif\ifwarnedxrefs % True if we warned once that they aren't known. - -% \setref{foo} defines a cross-reference point named foo. - -\def\setref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ysectionnumberandtype}} - -\def\unnumbsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ynothing}} - -\def\appendixsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Yappendixletterandtype}} - -% \xref, \pxref, and \ref generate cross-references to specified points. -% For \xrefX, #1 is the node name, #2 the name of the Info -% cross-reference, #3 the printed node name, #4 the name of the Info -% file, #5 the name of the printed manual. All but the node name can be -% omitted. -% -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} -\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup - \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax - % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% - \else - % Use the actual chapter/section title appear inside - % the square brackets. Use the real section title if we have it. - \ifdim \wd1>0pt% - % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% - \else - \ifhavexrefs - % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% - \else - % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% - \fi% - \fi - \fi - \fi - % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% - \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive \refx{#1-snt}{}}% - \space [\printednodename],\space - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \fi -\endgroup} - -% \dosetq is the interface for calls from other macros - -% Use \turnoffactive so that punctuation chars such as underscore -% work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% -\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% -\next}} - -% \internalsetq {foo}{page} expands into -% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} -% When the aux file is read, ' is the escape character - -\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq - -\def\Ypagenumber{\folio} - -\def\Ytitle{\thissection} - -\def\Ynothing{} - -\def\Ysectionnumberandtype{% -\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % -\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\def\Yappendixletterandtype{% -\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% -\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\gdef\xreftie{'tie} - -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Non-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi - -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. - -\def\refx#1#2{% - \expandafter\ifx\csname X#1\endcsname\relax - % If not defined, say something at least. - $\langle$un\-de\-fined$\rangle$% - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% - \fi - \fi - \else - % It's defined, so just use it. - \csname X#1\endcsname - \fi - #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\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 - }% -}% -% 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 -\endgroup} - - -% Footnotes. - -\newcount \footnoteno - -% The trailing space in the following definition for supereject is -% vital for proper filling; pages come out unaligned when you do a -% pagealignmacro call if that space before the closing brace is -% removed. -\def\supereject{\par\penalty -20000\footnoteno =0 } - -% @footnotestyle is meaningful for info output only.. -\let\footnotestyle=\comment - -\let\ptexfootnote=\footnote - -{\catcode `\@=11 -% -% Auto-number footnotes. Otherwise like plain. -\gdef\footnote{% - \global\advance\footnoteno by \@ne - \edef\thisfootno{$^{\the\footnoteno}$}% - % - % In case the footnote comes at the end of a sentence, preserve the - % extra spacing after we do the footnote number. - \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi - % - % Remove inadvertent blank space before typesetting the footnote number. - \unskip - \thisfootno\@sf - \footnotezzz -}% - -% Don't bother with the trickery in plain.tex to not require the -% footnote text as a parameter. Our footnotes don't need to be so general. -% -\long\gdef\footnotezzz#1{\insert\footins{% - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - % So reset some parameters. - \interlinepenalty\interfootnotelinepenalty - \splittopskip\ht\strutbox % top baseline for broken footnotes - \splitmaxdepth\dp\strutbox - \floatingpenalty\@MM - \leftskip\z@skip - \rightskip\z@skip - \spaceskip\z@skip - \xspaceskip\z@skip - \parindent\defaultparindent - % - % Hang the footnote text off the number. - \hang - \textindent{\thisfootno}% - % - % Don't crash into the line above the footnote text. Since this - % expands into a box, it must come within the paragraph, lest it - % provide a place where TeX can split the footnote. - \footstrut - #1\strut}% -} - -}%end \catcode `\@=11 - -% Set the baselineskip to #1, and the lineskip and strut size -% correspondingly. There is no deep meaning behind these magic numbers -% used as factors; they just match (closely enough) what Knuth defined. -% -\def\lineskipfactor{.08333} -\def\strutheightpercent{.70833} -\def\strutdepthpercent {.29167} -% -\def\setleading#1{% - \normalbaselineskip = #1\relax - \normallineskip = \lineskipfactor\normalbaselineskip - \normalbaselines - \setbox\strutbox =\hbox{% - \vrule width0pt height\strutheightpercent\baselineskip - depth \strutdepthpercent \baselineskip - }% -} - -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt} - - -% End of control word definitions. - -\message{and turning on texinfo input format.} - -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - -% Set some numeric style parameters, for 8.5 x 11 format. - -%\hsize = 6.5in -\newdimen\defaultparindent \defaultparindent = 15pt -\parindent = \defaultparindent -\parskip 18pt plus 1pt -\setleading{15pt} -\advance\topskip by 1.2cm - -% Prevent underfull vbox error messages. -\vbadness=10000 - -% Following George Bush, just get rid of widows and orphans. -\widowpenalty=10000 -\clubpenalty=10000 - -% Use TeX 3.0's \emergencystretch to help line breaking, but if we're -% using an old version of TeX, don't do anything. We want the amount of -% stretch added to depend on the line length, hence the dependence on -% \hsize. This makes it come to about 9pt for the 8.5x11 format. -% -\ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% -\else - \emergencystretch = \hsize - \divide\emergencystretch by 45 -\fi - -% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) -\def\smallbook{ - -% These values for secheadingskip and subsecheadingskip are -% experiments. RJC 7 Aug 1992 -\global\secheadingskip = 17pt plus 6pt minus 3pt -\global\subsecheadingskip = 14pt plus 6pt minus 3pt - -\global\lispnarrowing = 0.3in -\setleading{12pt} -\advance\topskip by -1cm -\global\parskip 3pt plus 1pt -\global\hsize = 5in -\global\vsize=7.5in -\global\tolerance=700 -\global\hfuzz=1pt -\global\contentsrightmargin=0pt -\global\deftypemargin=0pt -\global\defbodyindent=.5cm - -\global\pagewidth=\hsize -\global\pageheight=\vsize - -\global\let\smalllisp=\smalllispx -\global\let\smallexample=\smalllispx -\global\def\Esmallexample{\Esmalllisp} -} - -% Use @afourpaper to print on European A4 paper. -\def\afourpaper{ -\global\tolerance=700 -\global\hfuzz=1pt -\setleading{12pt} -\global\parskip 15pt plus 1pt - -\global\vsize= 53\baselineskip -\advance\vsize by \topskip -%\global\hsize= 5.85in % A4 wide 10pt -\global\hsize= 6.5in -\global\outerhsize=\hsize -\global\advance\outerhsize by 0.5in -\global\outervsize=\vsize -\global\advance\outervsize by 0.6in - -\global\pagewidth=\hsize -\global\pageheight=\vsize -} - -% Allow control of the text dimensions. Parameters in order: textheight; -% textwidth; voffset; hoffset; binding offset; topskip. -% All require a dimension; -% header is additional; added length extends the bottom of the page. - -\def\changepagesizes#1#2#3#4#5#6{ - \global\vsize= #1 - \global\topskip= #6 - \advance\vsize by \topskip - \global\voffset= #3 - \global\hsize= #2 - \global\outerhsize=\hsize - \global\advance\outerhsize by 0.5in - \global\outervsize=\vsize - \global\advance\outervsize by 0.6in - \global\pagewidth=\hsize - \global\pageheight=\vsize - \global\normaloffset= #4 - \global\bindingoffset= #5} - -% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin -% 29mm, hence bottom margin 28mm, nominal side margin 3cm. -\def\afourlatex - {\global\tolerance=700 - \global\hfuzz=1pt - \setleading{12pt} - \global\parskip 15pt plus 1pt - \advance\baselineskip by 1.6pt - \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} - } - -% Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{\afourpaper -\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} - -% Define macros to output various characters with catcode for normal text. -\catcode`\"=\other -\catcode`\~=\other -\catcode`\^=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode`\+=\other -\def\normaldoublequote{"} -\def\normaltilde{~} -\def\normalcaret{^} -\def\normalunderscore{_} -\def\normalverticalbar{|} -\def\normalless{<} -\def\normalgreater{>} -\def\normalplus{+} - -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, -% where something hairier probably needs to be done. -% -% #1 is what to print if we are indeed using \tt; #2 is what to print -% otherwise. Since all the Computer Modern typewriter fonts have zero -% interword stretch (and shrink), and it is reasonable to expect all -% typewriter fonts to have this, we can check that font parameter. -% -\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} - -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). -% Most of these we simply print from the \tt font, but for some, we can -% use math or other variants that look better in normal text. - -\catcode`\"=\active -\def\activedoublequote{{\tt \char '042}} -\let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt \char '176}} -\chardef\hat=`\^ -\catcode`\^=\active -\def\auxhat{\def^{'hat}} -\def^{{\tt \hat}} - -\catcode`\_=\active -\def_{\ifusingtt\normalunderscore\_} -% Subroutine for the previous macro. -\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} - -\catcode`\|=\active -\def|{{\tt \char '174}} -\chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} -\chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -%\catcode 27=\active -%\def^^[{$\diamondsuit$} - -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active - -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - -\catcode`\@=0 - -% \rawbackslashxx output one backslash character in current font -\global\chardef\rawbackslashxx=`\\ -%{\catcode`\\=\other -%@gdef@rawbackslashxx{\}} - -% \rawbackslash redefines \ as input to do \rawbackslashxx. -{\catcode`\\=\active -@gdef@rawbackslash{@let\=@rawbackslashxx }} - -% \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} - -% Say @foo, not \foo, in error messages. -\escapechar=`\@ - -% \catcode 17=0 % Define control-q -\catcode`\\=\active - -% Used sometimes to turn off (effectively) the active characters -% even after parsing them. -@def@turnoffactive{@let"=@normaldoublequote -@let\=@realbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -@def@normalturnoffactive{@let"=@normaldoublequote -@let\=@normalbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive - -% If a .fmt file is being used, we don't want the `\input texinfo' to show up. -% That is what \eatinput is for; after that, the `\' should revert to printing -% a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput - -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\{ in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also back turn on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% -@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi - @catcode`+=@active @catcode`@_=@active} - -%% These look ok in all fonts, so just make them not special. The @rm below -%% makes sure that the current font starts out as the newly loaded cmr10 -@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other - -@textfonts -@rm - -@c Local variables: -@c page-delimiter: "^\\\\message" -@c End: diff --git a/gnu/dist/bfd/configure.bat b/gnu/dist/bfd/configure.bat deleted file mode 100644 index 78fe79e91123..000000000000 --- a/gnu/dist/bfd/configure.bat +++ /dev/null @@ -1,18 +0,0 @@ -@echo off -if "%1" == "h8/300" goto h8300 - -echo Configuring bfd for go32 -update hosts\go32.h sysdep.h -update Makefile.dos Makefile -echo s/@WORDSIZE@/32/g>config.sed -sed -e s/^/s\/@VERSION@\// -e s/$/\/g/g version >>config.sed -sed -f config.sed < bfd-in2.h > bfd.h2 -update bfd.h2 bfd.h -goto exit - -:h8300 -echo Configuring bfd for H8/300 -update hosts\h-go32.h sysdep.h -update Makefile.dos Makefile - -:exit diff --git a/gnu/dist/bfd/configure.com b/gnu/dist/bfd/configure.com deleted file mode 100644 index 597e725fb1fd..000000000000 --- a/gnu/dist/bfd/configure.com +++ /dev/null @@ -1,142 +0,0 @@ -$! -$! This file configures the bfd library for use with openVMS/Alpha -$! We do not use the configure script, since we do not have /bin/sh -$! to execute it. -$! -$! Written by Klaus K"ampf (kkaempf@progis.de) -$! -$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$arch = f$element(arch_indx,"|","|VAX|Alpha|") -$if arch .eqs. "VAX" -$then -$ write sys$output "Target VAX not supported." -$ exit 2 -$endif -$! -$! copy bfd-in2.h to bfd.h, replacing @ macros -$! -$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - - []bfd-in2.h /output=[]bfd.h -$DECK -! -! Copy file, changing lines with macros (@@) -! -! - vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN"); - rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile)); - match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - vers := CURRENT_LINE-")"; - ELSE; - vers := "2.8.1"; - ENDIF; - - file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); - rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); - - match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT(vers); - ENDIF; - match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT('64'); - ENDIF; - match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT('0'); - ENDIF; - match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT('__DECC'); - SPLIT_LINE; - COPY_TEXT('#include '); - ENDIF; - match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT('int64'); - ENDIF; - match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang); - IF match_pos <> 0 THEN; - POSITION(BEGINNING_OF(match_pos)); - ERASE(match_pos); - COPY_TEXT('uint64'); - ENDIF; - WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); - QUIT -$ EOD -$ write sys$output "Generated `bfd.h' from `bfd-in2.h'." -$! -$! -$! create targmatch.h -$! -$ open/write tfile []targmatch.h -$ write tfile "{ " + """alpha-*-*vms*""" + "," -$ write tfile "#if defined (SELECT_VECS)" -$ write tfile "SELECT_VECS" -$ write tfile "#else" -$ write tfile "UNSUPPORTED_TARGET" -$ write tfile "#endif" -$ write tfile "}," -$ close tfile -$ write sys$output "Generated `targmatch.h'" -$! -$! -$! create config.h -$! -$ create []config.h -/* config.h-vms. Generated by hand by Klaus Kämpf, kkaempf@didymus.rmi.de. */ -/* config.in. Generated automatically from configure.in by autoheader. */ -/* Whether malloc must be declared even if is included. */ -/* #undef NEED_DECLARATION_MALLOC */ -/* Whether free must be declared even if is included. */ -/* #undef NEED_DECLARATION_FREE */ -/* Define if you have a working `mmap' system call. */ -/* #define HAVE_MMAP 1 */ -/* Do we need to use the b modifier when opening binary files? */ -/* #undef USE_BINARY_FOPEN */ -/* Name of host specific header file to include in trad-core.c. */ -/* #undef TRAD_HEADER */ -/* Define only if is available *and* it defines prstatus_t. */ -/* #undef HAVE_SYS_PROCFS_H */ -/* Do we really want to use mmap if it's available? */ -/* #undef USE_MMAP */ -/* Define if you have the fcntl function. */ -#define HAVE_FCNTL 1 -/* Define if you have the getpagesize function. */ -#define HAVE_GETPAGESIZE 1 -/* Define if you have the madvise function. */ -#define HAVE_MADVISE 1 -/* Define if you have the mprotect function. */ -#define HAVE_MPROTECT 1 -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 -/* Define if you have the header file. */ -#define HAVE_STDDEF_H 1 -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 -/* Define if you have the header file. */ -#define HAVE_STRINGS_H 1 -/* Define if you have the header file. */ -#define HAVE_SYS_FILE_H 1 -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 -$! -$ write sys$output "Generated `config.h'" - diff --git a/gnu/dist/bfd/doc/bfd.info b/gnu/dist/bfd/doc/bfd.info deleted file mode 100644 index 46b1a2e0d2a3..000000000000 --- a/gnu/dist/bfd/doc/bfd.info +++ /dev/null @@ -1,95 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -Indirect: -bfd.info-1: 942 -bfd.info-2: 37582 -bfd.info-3: 78554 -bfd.info-4: 113353 -bfd.info-5: 162239 -bfd.info-6: 188304 - -Tag Table: -(Indirect) -Node: Top942 -Node: Overview1207 -Node: History2257 -Node: How It Works3198 -Node: What BFD Version 2 Can Do4739 -Node: BFD information loss6053 -Node: Canonical format8576 -Node: BFD front end12937 -Node: Memory Usage31680 -Node: Initialization32903 -Node: Sections33280 -Node: Section Input33758 -Node: Section Output35114 -Node: typedef asection37582 -Node: section prototypes51158 -Node: Symbols56978 -Node: Reading Symbols58568 -Node: Writing Symbols59742 -Node: Mini Symbols61432 -Node: typedef asymbol62397 -Node: symbol handling functions67361 -Node: Archives71416 -Node: Formats75034 -Node: Relocations77835 -Node: typedef arelent78554 -Node: howto manager93396 -Node: Core Files110371 -Node: Targets111392 -Node: bfd_target113353 -Node: Architectures131107 -Node: Opening and Closing142532 -Node: Internal146127 -Node: File Caching151309 -Node: Linker Functions154087 -Node: Creating a Linker Hash Table155753 -Node: Adding Symbols to the Hash Table157480 -Node: Differing file formats158370 -Node: Adding symbols from an object file160103 -Node: Adding symbols from an archive162239 -Node: Performing the Final Link164638 -Node: Information provided by the linker165869 -Node: Relocating the section contents167005 -Node: Writing the symbol table168742 -Node: Hash Tables171336 -Node: Creating and Freeing a Hash Table172527 -Node: Looking Up or Entering a String173683 -Node: Traversing a Hash Table174925 -Node: Deriving a New Hash Table Type175703 -Node: Define the Derived Structures176758 -Node: Write the Derived Creation Routine177824 -Node: Write Other Derived Routines180523 -Node: BFD back ends181823 -Node: What to Put Where182042 -Node: aout182180 -Node: coff188304 -Node: elf214335 -Node: Index215168 - -End Tag Table diff --git a/gnu/dist/bfd/doc/bfd.info-1 b/gnu/dist/bfd/doc/bfd.info-1 deleted file mode 100644 index bc6e949cdaf2..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-1 +++ /dev/null @@ -1,1011 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - - This file documents the binary file descriptor library libbfd. - -* Menu: - -* Overview:: Overview of BFD -* BFD front end:: BFD front end -* BFD back ends:: BFD back ends -* Index:: Index - - -File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top - -Introduction -************ - - BFD is a package which allows applications to use the same routines -to operate on object files whatever the object file format. A new -object file format can be supported simply by creating a new BFD back -end and adding it to the library. - - BFD is split into two parts: the front end, and the back ends (one -for each object file format). - * The front end of BFD provides the interface to the user. It manages - memory and various canonical data structures. The front end also - decides which back end to use and when to call back end routines. - - * The back ends provide BFD its view of the real world. Each back - end provides a set of calls which the BFD front end can use to - maintain its canonical form. The back ends also may keep around - information for their own use, for greater efficiency. - -* Menu: - -* History:: History -* How It Works:: How It Works -* What BFD Version 2 Can Do:: What BFD Version 2 Can Do - - -File: bfd.info, Node: History, Next: How It Works, Prev: Overview, Up: Overview - -History -======= - - One spur behind BFD was the desire, on the part of the GNU 960 team -at Intel Oregon, for interoperability of applications on their COFF and -b.out file formats. Cygnus was providing GNU support for the team, and -was contracted to provide the required functionality. - - The name came from a conversation David Wallace was having with -Richard Stallman about the library: RMS said that it would be quite -hard--David said "BFD". Stallman was right, but the name stuck. - - At the same time, Ready Systems wanted much the same thing, but for -different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k -coff. - - BFD was first implemented by members of Cygnus Support; Steve -Chamberlain (`sac@cygnus.com'), John Gilmore (`gnu@cygnus.com'), K. -Richard Pixley (`rich@cygnus.com') and David Henkel-Wallace -(`gumby@cygnus.com'). - - -File: bfd.info, Node: How It Works, Next: What BFD Version 2 Can Do, Prev: History, Up: Overview - -How To Use BFD -============== - - To use the library, include `bfd.h' and link with `libbfd.a'. - - BFD provides a common interface to the parts of an object file for a -calling application. - - When an application sucessfully opens a target file (object, -archive, or whatever), a pointer to an internal structure is returned. -This pointer points to a structure called `bfd', described in `bfd.h'. -Our convention is to call this pointer a BFD, and instances of it -within code `abfd'. All operations on the target object file are -applied as methods to the BFD. The mapping is defined within `bfd.h' -in a set of macros, all beginning with `bfd_' to reduce namespace -pollution. - - For example, this sequence does what you would probably expect: -return the number of sections in an object file attached to a BFD -`abfd'. - - #include "bfd.h" - - unsigned int number_of_sections(abfd) - bfd *abfd; - { - return bfd_count_sections(abfd); - } - - The abstraction used within BFD is that an object file has: - - * a header, - - * a number of sections containing raw data (*note Sections::.), - - * a set of relocations (*note Relocations::.), and - - * some symbol information (*note Symbols::.). - -Also, BFDs opened for archives have the additional attribute of an index -and contain subordinate BFDs. This approach is fine for a.out and coff, -but loses efficiency when applied to formats such as S-records and -IEEE-695. - - -File: bfd.info, Node: What BFD Version 2 Can Do, Prev: How It Works, Up: Overview - -What BFD Version 2 Can Do -========================= - - When an object file is opened, BFD subroutines automatically -determine the format of the input object file. They then build a -descriptor in memory with pointers to routines that will be used to -access elements of the object file's data structures. - - As different information from the the object files is required, BFD -reads from different sections of the file and processes them. For -example, a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting between -the object file's representation of symbols and an internal canonical -format. When the linker asks for the symbol table of an object file, it -calls through a memory pointer to the routine from the relevant BFD -back end which reads and converts the table into a canonical form. The -linker then operates upon the canonical form. When the link is finished -and the linker writes the output file's symbol table, another BFD back -end routine is called to take the newly created symbol table and -convert it into the chosen output format. - -* Menu: - -* BFD information loss:: Information Loss -* Canonical format:: The BFD canonical object-file format - - -File: bfd.info, Node: BFD information loss, Next: Canonical format, Up: What BFD Version 2 Can Do - -Information Loss ----------------- - - *Information can be lost during output.* The output formats -supported by BFD do not provide identical facilities, and information -which can be described in one form has nowhere to go in another format. -One example of this is alignment information in `b.out'. There is -nowhere in an `a.out' format file to store alignment information on the -contained data, so when a file is linked from `b.out' and an `a.out' -image is produced, alignment information will not propagate to the -output file. (The linker will still use the alignment information -internally, so the link is performed correctly). - - Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections -(e.g., `a.out') or has sections without names (e.g., the Oasys format), -the link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker -command language. - - *Information can be lost during canonicalization.* The BFD internal -canonical form of the external formats is not exhaustive; there are -structures in input formats for which there is no direct representation -internally. This means that the BFD back ends cannot maintain all -possible data richness through the transformation between external to -internal and back to external formats. - - This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD canonical -form has structures which are opaque to the BFD core, and exported only -to the back ends. When a file is read in one format, the canonical form -is generated for BFD and the application. At the same time, the back -end saves away any information which may otherwise be lost. If the data -is then written back in the same format, the back end routine will be -able to use the canonical form provided by the BFD core as well as the -information it prepared earlier. Since there is a great deal of -commonality between back ends, there is no information lost when -linking or copying big endian COFF to little endian COFF, or `a.out' to -`b.out'. When a mixture of formats is linked, the information is only -lost from the files whose format differs from the destination. - - -File: bfd.info, Node: Canonical format, Prev: BFD information loss, Up: What BFD Version 2 Can Do - -The BFD canonical object-file format ------------------------------------- - - The greatest potential for loss of information occurs when there is -the least overlap between the information provided by the source -format, that stored by the canonical format, and that needed by the -destination format. A brief description of the canonical form may help -you understand which kinds of data you can count on preserving across -conversions. - -*files* - Information stored on a per-file basis includes target machine - architecture, particular implementation format type, a demand - pageable bit, and a write protected bit. Information like Unix - magic numbers is not stored here--only the magic numbers' meaning, - so a `ZMAGIC' file would have both the demand pageable bit and the - write protected text bit set. The byte order of the target is - stored on a per-file basis, so that big- and little-endian object - files may be used with one another. - -*sections* - Each section in the input file contains the name of the section, - the section's original address in the object file, size and - alignment information, various flags, and pointers into other BFD - data structures. - -*symbols* - Each symbol contains a pointer to the information for the object - file which originally defined it, its name, its value, and various - flag bits. When a BFD back end reads in a symbol table, it - relocates all symbols to make them relative to the base of the - section where they were defined. Doing this ensures that each - symbol points to its containing section. Each symbol also has a - varying amount of hidden private data for the BFD back end. Since - the symbol points to the original file, the private data format - for that symbol is accessible. `ld' can operate on a collection - of symbols of wildly different formats without problems. - - Normal global and simple local symbols are maintained on output, - so an output file (no matter its format) will retain symbols - pointing to functions and to global, static, and common variables. - Some symbol information is not worth retaining; in `a.out', type - information is stored in the symbol table as long symbol names. - This information would be useless to most COFF debuggers; the - linker has command line switches to allow users to throw it away. - - There is one word of type information within the symbol, so if the - format supports symbol type information within symbols (for - example, COFF, IEEE, Oasys) and the type is simple enough to fit - within one word (nearly everything but aggregates), the - information will be preserved. - -*relocation level* - Each canonical BFD relocation record contains a pointer to the - symbol to relocate to, the offset of the data to relocate, the - section the data is in, and a pointer to a relocation type - descriptor. Relocation is performed by passing messages through - the relocation type descriptor and the symbol pointer. Therefore, - relocations can be performed on output data using a relocation - method that is only available in one of the input formats. For - instance, Oasys provides a byte relocation format. A relocation - record requesting this relocation type would point indirectly to a - routine to perform this, so the relocation may be performed on a - byte being written to a 68k COFF file, even though 68k COFF has no - such relocation type. - -*line numbers* - Object formats can contain, for debugging purposes, some form of - mapping between symbols, source line numbers, and addresses in the - output file. These addresses have to be relocated along with the - symbol information. Each symbol with an associated list of line - number records points to the first record of the list. The head - of a line number list consists of a pointer to the symbol, which - allows finding out the address of the function whose line number - is being described. The rest of the list is made up of pairs: - offsets into the section and line numbers. Any format which can - simply derive this information can pass it successfully between - formats (COFF, IEEE and Oasys). - - -File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top - -BFD front end -************* - -`typedef bfd' -============= - - A BFD has type `bfd'; objects of this type are the cornerstone of -any application using BFD. Using BFD consists of making references -though the BFD and to data in the BFD. - - Here is the structure that defines the type `bfd'. It contains the -major data about the file and pointers to the rest of the data. - - - struct _bfd - { - /* The filename the application opened the BFD with. */ - CONST char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* To avoid dragging too many header files into every file that - includes ``bfd.h'', IOSTREAM has been declared as a "char - *", and MTIME as a "long". Their correct types, to which they - are cast when used, are "FILE *" and "time_t". The iostream - is the result of an fopen on the filename. However, if the - BFD_IN_MEMORY flag is set, then iostream is actually a pointer - to a bfd_in_memory struct. */ - PTR iostream; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - - boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - - boolean target_defaulted; - - /* The caching routines use these to maintain a - least-recently-used list of BFDs */ - - struct _bfd *lru_prev, *lru_next; - - /* When a file is closed by the caching routines, BFD retains - state information on the file here: */ - - file_ptr where; - - /* and here: (``once'' means at least once) */ - - boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time: */ - - boolean mtime_set; - - /* File modified time, if mtime_set is true: */ - - long mtime; - - /* Reserved for an unimplemented file locking extension.*/ - - int ifd; - - /* The format which belongs to the BFD. (object, core, etc.) */ - - bfd_format format; - - /* The direction the BFD was opened with*/ - - enum bfd_direction {no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3} direction; - - /* Format_specific flags*/ - - flagword flags; - - /* Currently my_archive is tested before adding origin to - anything. I believe that this can become always an add of - origin, with origin set to 0 for non archive files. */ - - file_ptr origin; - - /* Remember when output has begun, to stop strange things - from happening. */ - boolean output_has_begun; - - /* Pointer to linked list of sections*/ - struct sec *sections; - - /* The number of sections */ - unsigned int section_count; - - /* Stuff only useful for object files: - The start address. */ - bfd_vma start_address; - - /* Used for input and output*/ - unsigned int symcount; - - /* Symbol table for output BFD (with symcount entries) */ - struct symbol_cache_entry **outsymbols; - - /* Pointer to structure which contains architecture information*/ - const struct bfd_arch_info *arch_info; - - /* Stuff only useful for archives:*/ - PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; - - /* A chain of BFD structures involved in a link. */ - struct _bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; - - /* Used by the back end to hold private data. */ - - union - { - struct aout_data_struct *aout_data; - struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; - struct coff_tdata *coff_obj_data; - struct pe_tdata *pe_obj_data; - struct xcoff_tdata *xcoff_obj_data; - struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; - struct srec_data_struct *srec_data; - struct ihex_data_struct *ihex_data; - struct tekhex_data_struct *tekhex_data; - struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; - struct sun_core_struct *sun_core_data; - struct trad_core_struct *trad_core_data; - struct som_data_struct *som_data; - struct hpux_core_struct *hpux_core_data; - struct hppabsd_core_struct *hppabsd_core_data; - struct sgi_core_struct *sgi_core_data; - struct lynx_core_struct *lynx_core_data; - struct osf_core_struct *osf_core_data; - struct cisco_core_struct *cisco_core_data; - struct versados_data_struct *versados_data; - struct netbsd_core_struct *netbsd_core_data; - PTR any; - } tdata; - - /* Used by the application to hold private data*/ - PTR usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use PTR to avoid requiring the inclusion of - objalloc.h. */ - PTR memory; - }; - -Error reporting -=============== - - Most BFD functions return nonzero on success (check their individual -documentation for precise semantics). On an error, they call -`bfd_set_error' to set an error condition that callers can check by -calling `bfd_get_error'. If that returns `bfd_error_system_call', then -check `errno'. - - The easiest way to report a BFD error to the user is to use -`bfd_perror'. - -Type `bfd_error_type' ---------------------- - - The values returned by `bfd_get_error' are defined by the enumerated -type `bfd_error_type'. - - - typedef enum bfd_error - { - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_file_not_recognized, - bfd_error_file_ambiguously_recognized, - bfd_error_no_contents, - bfd_error_nonrepresentable_section, - bfd_error_no_debug_section, - bfd_error_bad_value, - bfd_error_file_truncated, - bfd_error_file_too_big, - bfd_error_invalid_error_code - } bfd_error_type; - -`bfd_get_error' -............... - - *Synopsis* - bfd_error_type bfd_get_error (void); - *Description* -Return the current BFD error condition. - -`bfd_set_error' -............... - - *Synopsis* - void bfd_set_error (bfd_error_type error_tag); - *Description* -Set the BFD error condition to be ERROR_TAG. - -`bfd_errmsg' -............ - - *Synopsis* - CONST char *bfd_errmsg (bfd_error_type error_tag); - *Description* -Return a string describing the error ERROR_TAG, or the system error if -ERROR_TAG is `bfd_error_system_call'. - -`bfd_perror' -............ - - *Synopsis* - void bfd_perror (CONST char *message); - *Description* -Print to the standard error stream a string describing the last BFD -error that occurred, or the last system error if the last BFD error was -a system call failure. If MESSAGE is non-NULL and non-empty, the error -string printed is preceded by MESSAGE, a colon, and a space. It is -followed by a newline. - -BFD error handler ------------------ - - Some BFD functions want to print messages describing the problem. -They call a BFD error handler function. This function may be overriden -by the program. - - The BFD error handler acts like printf. - - - typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); - -`bfd_set_error_handler' -....................... - - *Synopsis* - bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); - *Description* -Set the BFD error handler function. Returns the previous function. - -`bfd_set_error_program_name' -............................ - - *Synopsis* - void bfd_set_error_program_name (const char *); - *Description* -Set the program name to use when printing a BFD error. This is printed -before the error message followed by a colon and space. The string -must not be changed after it is passed to this function. - -`bfd_get_error_handler' -....................... - - *Synopsis* - bfd_error_handler_type bfd_get_error_handler (void); - *Description* -Return the BFD error handler function. - -Symbols -======= - -`bfd_get_reloc_upper_bound' -........................... - - *Synopsis* - long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect); - *Description* -Return the number of bytes required to store the relocation information -associated with section SECT attached to bfd ABFD. If an error occurs, -return -1. - -`bfd_canonicalize_reloc' -........................ - - *Synopsis* - long bfd_canonicalize_reloc - (bfd *abfd, - asection *sec, - arelent **loc, - asymbol **syms); - *Description* -Call the back end associated with the open BFD ABFD and translate the -external form of the relocation information attached to SEC into the -internal canonical form. Place the table into memory at LOC, which has -been preallocated, usually by a call to `bfd_get_reloc_upper_bound'. -Returns the number of relocs, or -1 on error. - - The SYMS table is also needed for horrible internal magic reasons. - -`bfd_set_reloc' -............... - - *Synopsis* - void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count) - *Description* -Set the relocation pointer and count within section SEC to the values -REL and COUNT. The argument ABFD is ignored. - -`bfd_set_file_flags' -.................... - - *Synopsis* - boolean bfd_set_file_flags(bfd *abfd, flagword flags); - *Description* -Set the flag word in the BFD ABFD to the value FLAGS. - - Possible errors are: - * `bfd_error_wrong_format' - The target bfd was not of object format. - - * `bfd_error_invalid_operation' - The target bfd was open for - reading. - - * `bfd_error_invalid_operation' - The flag word contained a bit - which was not applicable to the type of file. E.g., an attempt - was made to set the `D_PAGED' bit on a BFD format which does not - support demand paging. - -`bfd_set_start_address' -....................... - - *Synopsis* - boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); - *Description* -Make VMA the entry point of output BFD ABFD. - - *Returns* -Returns `true' on success, `false' otherwise. - -`bfd_get_mtime' -............... - - *Synopsis* - long bfd_get_mtime(bfd *abfd); - *Description* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -`bfd_get_size' -.............. - - *Synopsis* - long bfd_get_size(bfd *abfd); - *Description* -Return the file size (as read from file system) for the file associated -with BFD ABFD. - - The initial motivation for, and use of, this routine is not so we -can get the exact size of the object the BFD applies to, since that -might not be generally possible (archive members for example). It -would be ideal if someone could eventually modify it so that such -results were guaranteed. - - Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" As as -example of where we might do this, some object formats use string -tables for which the first `sizeof(long)' bytes of the table contain -the size of the table itself, including the size bytes. If an -application tries to read what it thinks is one of these string tables, -without some way to validate the size, and for some reason the size is -wrong (byte swapping error, wrong location for the string table, etc.), -the only clue is likely to be a read error when it tries to read the -table, or a "virtual memory exhausted" error when it tries to allocate -15 bazillon bytes of space for the 15 bazillon byte table it is about -to read. This function at least allows us to answer the quesion, "is -the size reasonable?". - -`bfd_get_gp_size' -................. - - *Synopsis* - int bfd_get_gp_size(bfd *abfd); - *Description* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the `-G' argument -to the compiler, assembler or linker. - -`bfd_set_gp_size' -................. - - *Synopsis* - void bfd_set_gp_size(bfd *abfd, int i); - *Description* -Set the maximum size of objects to be optimized using the GP register -under ECOFF or MIPS ELF. This is typically set by the `-G' argument to -the compiler, assembler or linker. - -`bfd_scan_vma' -.............. - - *Synopsis* - bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base); - *Description* -Convert, like `strtoul', a numerical expression STRING into a `bfd_vma' -integer, and return that integer. (Though without as many bells and -whistles as `strtoul'.) The expression is assumed to be unsigned -(i.e., positive). If given a BASE, it is used as the base for -conversion. A base of 0 causes the function to interpret the string in -hex if a leading "0x" or "0X" is found, otherwise in octal if a leading -zero is found, otherwise in decimal. - - Overflow is not detected. - -`bfd_copy_private_bfd_data' -........................... - - *Synopsis* - boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); - *Description* -Copy private BFD information from the BFD IBFD to the the BFD OBFD. -Return `true' on success, `false' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) - -`bfd_merge_private_bfd_data' -............................ - - *Synopsis* - boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); - *Description* -Merge private BFD information from the BFD IBFD to the the output file -BFD OBFD when linking. Return `true' on success, `false' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - #define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) - -`bfd_set_private_flags' -....................... - - *Synopsis* - boolean bfd_set_private_flags(bfd *abfd, flagword flags); - *Description* -Set private BFD flag information in the BFD ABFD. Return `true' on -success, `false' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, \ - (abfd, flags)) - -`stuff' -....... - - *Description* -Stuff which should be documented: - #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - - #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - - /* Do these three do anything useful at all, for any back end? */ - #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - - #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - - #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - - - #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - - #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) - - #define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) - - #define bfd_relax_section(abfd, section, link_info, again) \ - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) - - #define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - - #define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - - #define bfd_final_link(abfd, info) \ - BFD_SEND (abfd, _bfd_final_link, (abfd, info)) - - #define bfd_free_cached_info(abfd) \ - BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) - - #define bfd_get_dynamic_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) - - #define bfd_print_private_bfd_data(abfd, file)\ - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) - - #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) - - #define bfd_get_dynamic_reloc_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) - - #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) - - extern bfd_byte *bfd_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, - struct bfd_link_order *, bfd_byte *, - boolean, asymbol **)); - -* Menu: - -* Memory Usage:: -* Initialization:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architectures:: -* Opening and Closing:: -* Internal:: -* File Caching:: -* Linker Functions:: -* Hash Tables:: - - -File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: BFD front end, Up: BFD front end - -Memory usage -============ - - BFD keeps all of its internal structures in obstacks. There is one -obstack per open BFD file, into which the current state is stored. When -a BFD is closed, the obstack is deleted, and so everything which has -been allocated by BFD for the closing file is thrown away. - - BFD does not free anything created by an application, but pointers -into `bfd' structures become invalid on a `bfd_close'; for example, -after a `bfd_close' the vector passed to `bfd_canonicalize_symtab' is -still around, since it has been allocated by the application, but the -data that it pointed to are lost. - - The general rule is to not close a BFD until all operations dependent -upon data from the BFD have been completed, or all the data from within -the file has been copied. To help with the management of memory, there -is a function (`bfd_alloc_size') which returns the number of bytes in -obstacks associated with the supplied BFD. This could be used to select -the greediest open BFD, close it to reclaim the memory, perform some -operation and reopen the BFD again, to get a fresh copy of the data -structures. - - -File: bfd.info, Node: Initialization, Next: Sections, Prev: Memory Usage, Up: BFD front end - -Initialization -============== - - These are the functions that handle initializing a BFD. - -`bfd_init' -.......... - - *Synopsis* - void bfd_init(void); - *Description* -This routine must be called before any other BFD function to initialize -magical internal data structures. - - -File: bfd.info, Node: Sections, Next: Symbols, Prev: Initialization, Up: BFD front end - -Sections -======== - - The raw data contained within a BFD is maintained through the -section abstraction. A single BFD may have any number of sections. It -keeps hold of them by pointing to the first; each one points to the -next in the list. - - Sections are supported in BFD in `section.c'. - -* Menu: - -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: - - -File: bfd.info, Node: Section Input, Next: Section Output, Prev: Sections, Up: Sections - -Section input -------------- - - When a BFD is opened for reading, the section structures are created -and attached to the BFD. - - Each section has a name which describes the section in the outside -world--for example, `a.out' would contain at least three sections, -called `.text', `.data' and `.bss'. - - Names need not be unique; for example a COFF file may have several -sections named `.data'. - - Sometimes a BFD will contain more than the "natural" number of -sections. A back end may attach other sections containing constructor -data, or an application may add a section (using `bfd_make_section') to -the sections attached to an already open BFD. For example, the linker -creates an extra section `COMMON' for each input file's BFD to hold -information about common storage. - - The raw data is not necessarily read in when the section descriptor -is created. Some targets may leave the data in place until a -`bfd_get_section_contents' call is made. Other back ends may read in -all the data at once. For example, an S-record file has to be read -once to determine the size of the data. An IEEE-695 file doesn't -contain raw data in sections, but data and relocation expressions -intermixed, so the data area has to be parsed to get out the data and -relocations. - - -File: bfd.info, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections - -Section output --------------- - - To write a new object style BFD, the various sections to be written -have to be created. They are attached to the BFD in the same way as -input sections; data is written to the sections using -`bfd_set_section_contents'. - - Any program that creates or combines sections (e.g., the assembler -and linker) must use the `asection' fields `output_section' and -`output_offset' to indicate the file sections to which each section -must be written. (If the section is being created from scratch, -`output_section' should probably point to the section itself and -`output_offset' should probably be zero.) - - The data to be written comes from input sections attached (via -`output_section' pointers) to the output sections. The output section -structure can be considered a filter for the input section: the output -section determines the vma of the output data and the name, but the -input section determines the offset into the output section of the data -to be written. - - E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma 0x100) and -"B" at offset 0x20 (i.e., at vma 0x120) the `asection' structures would -look like: - - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| - -Link orders ------------ - - The data within a section is stored in a "link_order". These are -much like the fixups in `gas'. The link_order abstraction allows a -section to grow and shrink within itself. - - A link_order knows how big it is, and which is the next link_order -and where the raw data for it is; it also points to a list of -relocations which apply to it. - - The link_order is used by the linker to perform relaxing on final -code. The compiler creates code which is as big as necessary to make -it work without relaxing, and the user can select whether to relax. -Sometimes relaxing takes a lot of time. The linker runs around the -relocations to see if any are attached to data which can be shrunk, if -so it does it on a link_order by link_order basis. - diff --git a/gnu/dist/bfd/doc/bfd.info-2 b/gnu/dist/bfd/doc/bfd.info-2 deleted file mode 100644 index 999507e8aba6..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-2 +++ /dev/null @@ -1,1113 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections - -typedef asection ----------------- - - Here is the section structure: - - - typedef struct sec - { - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - - CONST char *name; - - /* Which section is it; 0..nth. */ - - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - - struct sec *next; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - - flagword flags; - - #define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information - only. */ - #define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ - #define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ - #define SEC_RELOC 0x004 - - #if 0 /* Obsolete ? */ - #define SEC_BALIGN 0x008 - #endif - - /* A signal to the OS that the section contains read only - data. */ - #define SEC_READONLY 0x010 - - /* The section contains code only. */ - #define SEC_CODE 0x020 - - /* The section contains data only. */ - #define SEC_DATA 0x040 - - /* The section will reside in ROM. */ - #define SEC_ROM 0x080 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by `g++'. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., `__CTOR_LIST__'), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called `__CTOR_LIST__' and relocate the data - contained within - exactly the operations it would peform on - standard data. */ - #define SEC_CONSTRUCTOR 0x100 - - /* The section is a constuctor, and should be placed at the - end of the text, data, or bss section(?). */ - #define SEC_CONSTRUCTOR_TEXT 0x1100 - #define SEC_CONSTRUCTOR_DATA 0x2100 - #define SEC_CONSTRUCTOR_BSS 0x3100 - - /* The section has contents - a data section could be - `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be - `SEC_HAS_CONTENTS' */ - #define SEC_HAS_CONTENTS 0x200 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ - #define SEC_NEVER_LOAD 0x400 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ - #define SEC_COFF_SHARED_LIBRARY 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ - #define SEC_IS_COMMON 0x8000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ - #define SEC_DEBUGGING 0x10000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by - bfd_get_section_contents, and the data is retrieved from - memory if appropriate. */ - #define SEC_IN_MEMORY 0x20000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ - #define SEC_EXCLUDE 0x40000 - - /* The contents of this section are to be sorted by the - based on the address specified in the associated symbol - table. */ - #define SEC_SORT_ENTRIES 0x80000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ - #define SEC_LINK_ONCE 0x100000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ - #define SEC_LINK_DUPLICATES 0x600000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ - #define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ - #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ - #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ - #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ - #define SEC_LINKER_CREATED 0x800000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in `a.out', where - the default address for `.data' is dependent on the specific - target and various flags). */ - - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - - bfd_vma lma; - - /* The size of the section in bytes, as it will be output. - contains a value even if the section has no contents (e.g., the - size of `.bss'). This will be filled in after relocation */ - - bfd_size_type _cooked_size; - - /* The original size on disk of the section, in bytes. Normally this - value is the same as the size, but if some relaxing has - been done, then this value will be bigger. */ - - bfd_size_type _raw_size; - - /* If this section is going to be output, then this value is the - offset into the output section of the first byte in the input - section. E.g., if this was going to start at the 100th byte in - the output section, this value would be 100. */ - - bfd_vma output_offset; - - /* The output section through which to map on output. */ - - struct sec *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above */ - - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data */ - - file_ptr filepos; - - /* File position of relocation info */ - - file_ptr rel_filepos; - - /* File position of line data */ - - file_ptr line_filepos; - - /* Pointer to data for applications */ - - PTR userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information */ - - alent *lineno; - - /* Number of line number records */ - - unsigned int lineno_count; - - /* When a section is being output, this value changes as more - linenumbers are written out */ - - file_ptr moving_line_filepos; - - /* What the section number is in the target world */ - - int target_index; - - PTR used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - - bfd *owner; - - /* A symbol which points at this section only */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; - - struct bfd_link_order *link_order_head; - struct bfd_link_order *link_order_tail; - } asection ; - - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ - #define BFD_ABS_SECTION_NAME "*ABS*" - #define BFD_UND_SECTION_NAME "*UND*" - #define BFD_COM_SECTION_NAME "*COM*" - #define BFD_IND_SECTION_NAME "*IND*" - - /* the absolute section */ - extern const asection bfd_abs_section; - #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) - #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section */ - extern const asection bfd_und_section; - #define bfd_und_section_ptr ((asection *) &bfd_und_section) - #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section */ - extern const asection bfd_com_section; - #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section */ - extern const asection bfd_ind_section; - #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) - #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - - extern const struct symbol_cache_entry * const bfd_abs_symbol; - extern const struct symbol_cache_entry * const bfd_com_symbol; - extern const struct symbol_cache_entry * const bfd_und_symbol; - extern const struct symbol_cache_entry * const bfd_ind_symbol; - #define bfd_get_section_size_before_reloc(section) \ - (section->reloc_done ? (abort(),1): (section)->_raw_size) - #define bfd_get_section_size_after_reloc(section) \ - ((section->reloc_done) ? (section)->_cooked_size: (abort(),1)) - - -File: bfd.info, Node: section prototypes, Prev: typedef asection, Up: Sections - -Section prototypes ------------------- - - These are the functions exported by the section handling part of BFD. - -`bfd_get_section_by_name' -......................... - - *Synopsis* - asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); - *Description* -Run through ABFD and return the one of the `asection's whose name -matches NAME, otherwise `NULL'. *Note Sections::, for more information. - - This should only be used in special cases; the normal way to process -all sections of a given name is to use `bfd_map_over_sections' and -`strcmp' on the name (or better yet, base it on the section flags or -something else) for each section. - -`bfd_make_section_old_way' -.......................... - - *Synopsis* - asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for the BFD ABFD. An attempt to create a section with -a name which is already in use returns its pointer without changing the -section chain. - - It has the funny name since this is the way it used to be before it -was rewritten.... - - Possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - this BFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -`bfd_make_section_anyway' -......................... - - *Synopsis* - asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for ABFD. Create a new section even if there is -already a section with that name. - - Return `NULL' and set `bfd_error' on error; possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - ABFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -`bfd_make_section' -.................. - - *Synopsis* - asection *bfd_make_section(bfd *, CONST char *name); - *Description* -Like `bfd_make_section_anyway', but return `NULL' (without calling -bfd_set_error ()) without changing the section chain if there is -already a section named NAME. If there is an error, return `NULL' and -set `bfd_error'. - -`bfd_set_section_flags' -....................... - - *Synopsis* - boolean bfd_set_section_flags(bfd *abfd, asection *sec, flagword flags); - *Description* -Set the attributes of the section SEC in the BFD ABFD to the value -FLAGS. Return `true' on success, `false' on error. Possible error -returns are: - - * `bfd_error_invalid_operation' - The section cannot have one or - more of the attributes requested. For example, a .bss section in - `a.out' may not have the `SEC_HAS_CONTENTS' field set. - -`bfd_map_over_sections' -....................... - - *Synopsis* - void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, - asection *sect, - PTR obj), - PTR obj); - *Description* -Call the provided function FUNC for each section attached to the BFD -ABFD, passing OBJ as an argument. The function will be called as if by - - func(abfd, the_section, obj); - - This is the prefered method for iterating over sections; an -alternative would be to use a loop: - - section *p; - for (p = abfd->sections; p != NULL; p = p->next) - func(abfd, p, ...) - -`bfd_set_section_size' -...................... - - *Synopsis* - boolean bfd_set_section_size(bfd *abfd, asection *sec, bfd_size_type val); - *Description* -Set SEC to the size VAL. If the operation is ok, then `true' is -returned, else `false'. - - Possible error returns: - * `bfd_error_invalid_operation' - Writing has started to the BFD, so - setting the size is invalid. - -`bfd_set_section_contents' -.......................... - - *Synopsis* - boolean bfd_set_section_contents - (bfd *abfd, - asection *section, - PTR data, - file_ptr offset, - bfd_size_type count); - *Description* -Sets the contents of the section SECTION in BFD ABFD to the data -starting in memory at DATA. The data is written to the output section -starting at offset OFFSET for COUNT bytes. - - Normally `true' is returned, else `false'. Possible error returns -are: - * `bfd_error_no_contents' - The output section does not have the - `SEC_HAS_CONTENTS' attribute, so nothing can be written to it. - - * and some more too This routine is front end to the back end -function `_bfd_set_section_contents'. - -`bfd_get_section_contents' -.......................... - - *Synopsis* - boolean bfd_get_section_contents - (bfd *abfd, asection *section, PTR location, - file_ptr offset, bfd_size_type count); - *Description* -Read data from SECTION in BFD ABFD into memory starting at LOCATION. -The data is read at an offset of OFFSET from the start of the input -section, and is read for COUNT bytes. - - If the contents of a constructor with the `SEC_CONSTRUCTOR' flag set -are requested or if the section does not have the `SEC_HAS_CONTENTS' -flag set, then the LOCATION is filled with zeroes. If no errors occur, -`true' is returned, else `false'. - -`bfd_copy_private_section_data' -............................... - - *Synopsis* - boolean bfd_copy_private_section_data(bfd *ibfd, asection *isec, bfd *obfd, asection *osec); - *Description* -Copy private section information from ISEC in the BFD IBFD to the -section OSEC in the BFD OBFD. Return `true' on success, `false' on -error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) - - -File: bfd.info, Node: Symbols, Next: Archives, Prev: Sections, Up: BFD front end - -Symbols -======= - - BFD tries to maintain as much symbol information as it can when it -moves information from file to file. BFD passes information to -applications though the `asymbol' structure. When the application -requests the symbol table, BFD reads the table in the native form and -translates parts of it into the internal format. To maintain more than -the information passed to applications, some targets keep some -information "behind the scenes" in a structure only the particular back -end knows about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when a BFD is -read in. On output, the coff back end can reconstruct the output symbol -table so that no information is lost, even information unique to coff -which BFD doesn't know or understand. If a coff symbol table were read, -but were written through an a.out back end, all the coff specific -information would be lost. The symbol table of a BFD is not necessarily -read in until a canonicalize request is made. Then the BFD back end -fills in a table provided by the application with pointers to the -canonical information. To output symbols, the application provides BFD -with a table of pointers to pointers to `asymbol's. This allows -applications like the linker to output a symbol as it was read, since -the "behind the scenes" information will be still available. - -* Menu: - -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: - - -File: bfd.info, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols - -Reading symbols ---------------- - - There are two stages to reading a symbol table from a BFD: -allocating storage, and the actual reading process. This is an excerpt -from an application which reads the symbol table: - - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) { - return ; - } - symbol_table = (asymbol **) xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) { - process_symbol (symbol_table[i]); - } - - All storage for the symbols themselves is in an objalloc connected -to the BFD; it is freed when the BFD is closed. - - -File: bfd.info, Node: Writing Symbols, Next: Mini Symbols, Prev: Reading Symbols, Up: Symbols - -Writing symbols ---------------- - - Writing of a symbol table is automatic when a BFD open for writing -is closed. The application attaches a vector of pointers to pointers to -symbols to the BFD being written, and fills in the symbol count. The -close and cleanup code reads through the table provided and performs -all the necessary operations. The BFD output code must always be -provided with an "owned" symbol: one which has come from another BFD, -or one which has been created using `bfd_make_empty_symbol'. Here is an -example showing the creation of a symbol table with only one element: - - #include "bfd.h" - main() - { - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw("foo","a.out-sunos-big"); - bfd_set_format(abfd, bfd_object); - new = bfd_make_empty_symbol(abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way(abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = (asymbol *)0; - - bfd_set_symtab(abfd, ptrs, 1); - bfd_close(abfd); - } - - ./makesym - nm foo - 00012345 A dummy_symbol - - Many formats cannot represent arbitary symbol information; for -instance, the `a.out' object format does not allow an arbitary number -of sections. A symbol pointing to a section which is not one of -`.text', `.data' or `.bss' cannot be described. - - -File: bfd.info, Node: Mini Symbols, Next: typedef asymbol, Prev: Writing Symbols, Up: Symbols - -Mini Symbols ------------- - - Mini symbols provide read-only access to the symbol table. They use -less memory space, but require more time to access. They can be useful -for tools like nm or objdump, which may have to handle symbol tables of -extremely large executables. - - The `bfd_read_minisymbols' function will read the symbols into -memory in an internal form. It will return a `void *' pointer to a -block of memory, a symbol count, and the size of each symbol. The -pointer is allocated using `malloc', and should be freed by the caller -when it is no longer needed. - - The function `bfd_minisymbol_to_symbol' will take a pointer to a -minisymbol, and a pointer to a structure returned by -`bfd_make_empty_symbol', and return a `asymbol' structure. The return -value may or may not be the same as the value from -`bfd_make_empty_symbol' which was passed in. - - -File: bfd.info, Node: typedef asymbol, Next: symbol handling functions, Prev: Mini Symbols, Up: Symbols - -typedef asymbol ---------------- - - An `asymbol' has the form: - - - typedef struct symbol_cache_entry - { - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_{abs,com,und}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - - struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - CONST char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol: */ - - #define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; `static' in `C'. The value - is the offset into the section of the data. */ - #define BSF_LOCAL 0x01 - - /* The symbol has global scope; initialized data in `C'. The - value is the offset into the section of the data. */ - #define BSF_GLOBAL 0x02 - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ - #define BSF_EXPORT BSF_GLOBAL /* no real difference */ - - /* A normal C symbol would be one of: - `BSF_LOCAL', `BSF_FORT_COMM', `BSF_UNDEFINED' or - `BSF_GLOBAL' */ - - /* The symbol is a debugging record. The value has an arbitary - meaning. */ - #define BSF_DEBUGGING 0x08 - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ - #define BSF_FUNCTION 0x10 - - /* Used by the linker. */ - #define BSF_KEEP 0x20 - #define BSF_KEEP_G 0x40 - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ - #define BSF_WEAK 0x80 - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ - #define BSF_SECTION_SYM 0x100 - - /* The symbol used to be a common symbol, but now it is - allocated. */ - #define BSF_OLD_COMMON 0x200 - - /* The default value for common data. */ - #define BFD_FORT_COMM_DEFAULT_VALUE 0 - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a `ISFCN' symbol - which is also `C_EXT' symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ - - #define BSF_NOT_AT_END 0x400 - - /* Signal that the symbol is the label of constructor section. */ - #define BSF_CONSTRUCTOR 0x800 - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ - #define BSF_WARNING 0x1000 - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ - #define BSF_INDIRECT 0x2000 - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ - #define BSF_FILE 0x4000 - - /* Symbol is from dynamic linking information. */ - #define BSF_DYNAMIC 0x8000 - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ - #define BSF_OBJECT 0x10000 - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct sec *section; - - /* Back end special data. */ - union - { - PTR p; - bfd_vma i; - } udata; - - } asymbol; - - -File: bfd.info, Node: symbol handling functions, Prev: typedef asymbol, Up: Symbols - -Symbol handling functions -------------------------- - -`bfd_get_symtab_upper_bound' -............................ - - *Description* -Return the number of bytes required to store a vector of pointers to -`asymbols' for all the symbols in the BFD ABFD, including a terminal -NULL pointer. If there are no symbols in the BFD, then return 0. If an -error occurs, return -1. - #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -`bfd_is_local_label' -.................... - - *Synopsis* - boolean bfd_is_local_label(bfd *abfd, asymbol *sym); - *Description* -Return true if the given symbol SYM in the BFD ABFD is a compiler -generated local label, else return false. - -`bfd_is_local_label_name' -......................... - - *Synopsis* - boolean bfd_is_local_label_name(bfd *abfd, const char *name); - *Description* -Return true if a symbol with the name NAME in the BFD ABFD is a -compiler generated local label, else return false. This just checks -whether the name has the form of a local label. - #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -`bfd_canonicalize_symtab' -......................... - - *Description* -Read the symbols from the BFD ABFD, and fills in the vector LOCATION -with pointers to the symbols and a trailing NULL. Return the actual -number of symbol pointers, not including the NULL. - #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab,\ - (abfd, location)) - -`bfd_set_symtab' -................ - - *Synopsis* - boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); - *Description* -Arrange that when the output BFD ABFD is closed, the table LOCATION of -COUNT pointers to symbols will be written. - -`bfd_print_symbol_vandf' -........................ - - *Synopsis* - void bfd_print_symbol_vandf(PTR file, asymbol *symbol); - *Description* -Print the value and flags of the SYMBOL supplied to the stream FILE. - -`bfd_make_empty_symbol' -....................... - - *Description* -Create a new `asymbol' structure for the BFD ABFD and return a pointer -to it. - - This routine is necessary because each back end has private -information surrounding the `asymbol'. Building your own `asymbol' and -pointing to it will not create the private information, and will cause -problems later on. - #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -`bfd_make_debug_symbol' -....................... - - *Description* -Create a new `asymbol' structure for the BFD ABFD, to be used as a -debugging symbol. Further details of its use have yet to be worked out. - #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -`bfd_decode_symclass' -..................... - - *Description* -Return a character corresponding to the symbol class of SYMBOL, or '?' -for an unknown class. - - *Synopsis* - int bfd_decode_symclass(asymbol *symbol); - -`bfd_symbol_info' -................. - - *Description* -Fill in the basic info about symbol that nm needs. Additional info may -be added by the back-ends after calling this function. - - *Synopsis* - void bfd_symbol_info(asymbol *symbol, symbol_info *ret); - -`bfd_copy_private_symbol_data' -.............................. - - *Synopsis* - boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); - *Description* -Copy private symbol information from ISYM in the BFD IBFD to the symbol -OSYM in the BFD OBFD. Return `true' on success, `false' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - - -File: bfd.info, Node: Archives, Next: Formats, Prev: Symbols, Up: BFD front end - -Archives -======== - - *Description* -An archive (or library) is just another BFD. It has a symbol table, -although there's not much a user program will do with it. - - The big difference between an archive BFD and an ordinary BFD is -that the archive doesn't have sections. Instead it has a chain of BFDs -that are considered its contents. These BFDs can be manipulated like -any other. The BFDs contained in an archive opened for reading will -all be opened for reading. You may put either input or output BFDs -into an archive opened for output; they will be handled correctly when -the archive is closed. - - Use `bfd_openr_next_archived_file' to step through the contents of -an archive opened for input. You don't have to read the entire archive -if you don't want to! Read it until you find what you want. - - Archive contents of output BFDs are chained through the `next' -pointer in a BFD. The first one is findable through the `archive_head' -slot of the archive. Set it with `bfd_set_archive_head' (q.v.). A -given BFD may be in only one open output archive at a time. - - As expected, the BFD archive code is more general than the archive -code of any given environment. BFD archives may contain files of -different formats (e.g., a.out and coff) and even different -architectures. You may even place archives recursively into archives! - - This can cause unexpected confusion, since some archive formats are -more expressive than others. For instance, Intel COFF archives can -preserve long filenames; SunOS a.out archives cannot. If you move a -file from the first to the second format and back again, the filename -may be truncated. Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they preserve -directory names in filenames, etc. When interoperating with native -tools, be sure your files are homogeneous. - - Beware: most of these formats do not react well to the presence of -spaces in filenames. We do the best we can, but can't always handle -this case due to restrictions in the format of archives. Many Unix -utilities are braindead in regards to spaces and such in filenames -anyway, so this shouldn't be much of a restriction. - - Archives are supported in BFD in `archive.c'. - -`bfd_get_next_mapent' -..................... - - *Synopsis* - symindex bfd_get_next_mapent(bfd *abfd, symindex previous, carsym **sym); - *Description* -Step through archive ABFD's symbol table (if it has one). Successively -update SYM with the next symbol's information, returning that symbol's -(internal) index into the symbol table. - - Supply `BFD_NO_MORE_SYMBOLS' as the PREVIOUS entry to get the first -one; returns `BFD_NO_MORE_SYMBOLS' when you've already got the last one. - - A `carsym' is a canonical archive symbol. The only user-visible -element is its name, a null-terminated string. - -`bfd_set_archive_head' -...................... - - *Synopsis* - boolean bfd_set_archive_head(bfd *output, bfd *new_head); - *Description* -Set the head of the chain of BFDs contained in the archive OUTPUT to -NEW_HEAD. - -`bfd_openr_next_archived_file' -.............................. - - *Synopsis* - bfd *bfd_openr_next_archived_file(bfd *archive, bfd *previous); - *Description* -Provided a BFD, ARCHIVE, containing an archive and NULL, open an input -BFD on the first contained element and returns that. Subsequent calls -should pass the archive and the previous return value to return a -created BFD to the next contained element. NULL is returned when there -are no more. - - -File: bfd.info, Node: Formats, Next: Relocations, Prev: Archives, Up: BFD front end - -File formats -============ - - A format is a BFD concept of high level file contents type. The -formats supported by BFD are: - - * `bfd_object' The BFD may contain data, symbols, relocations and -debug info. - - * `bfd_archive' The BFD contains other BFDs and an optional index. - - * `bfd_core' The BFD contains the result of an executable core dump. - -`bfd_check_format' -.................. - - *Synopsis* - boolean bfd_check_format(bfd *abfd, bfd_format format); - *Description* -Verify if the file attached to the BFD ABFD is compatible with the -format FORMAT (i.e., one of `bfd_object', `bfd_archive' or `bfd_core'). - - If the BFD has been set to a specific target before the call, only -the named target and format combination is checked. If the target has -not been set, or has been set to `default', then all the known target -backends is interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize the -file, or an error results. - - The function returns `true' on success, otherwise `false' with one -of the following error codes: - - * `bfd_error_invalid_operation' - if `format' is not one of - `bfd_object', `bfd_archive' or `bfd_core'. - - * `bfd_error_system_call' - if an error occured during a read - even - some file mismatches can cause bfd_error_system_calls. - - * `file_not_recognised' - none of the backends recognised the file - format. - - * `bfd_error_file_ambiguously_recognized' - more than one backend - recognised the file format. - -`bfd_check_format_matches' -.......................... - - *Synopsis* - boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); - *Description* -Like `bfd_check_format', except when it returns false with `bfd_errno' -set to `bfd_error_file_ambiguously_recognized'. In that case, if -MATCHING is not NULL, it will be filled in with a NULL-terminated list -of the names of the formats that matched, allocated with `malloc'. -Then the user may choose a format and try again. - - When done with the list that MATCHING points to, the caller should -free it. - -`bfd_set_format' -................ - - *Synopsis* - boolean bfd_set_format(bfd *abfd, bfd_format format); - *Description* -This function sets the file format of the BFD ABFD to the format -FORMAT. If the target set in the BFD does not support the format -requested, the format is invalid, or the BFD is not open for writing, -then an error occurs. - -`bfd_format_string' -................... - - *Synopsis* - CONST char *bfd_format_string(bfd_format format); - *Description* -Return a pointer to a const string `invalid', `object', `archive', -`core', or `unknown', depending upon the value of FORMAT. - - -File: bfd.info, Node: Relocations, Next: Core Files, Prev: Formats, Up: BFD front end - -Relocations -=========== - - BFD maintains relocations in much the same way it maintains symbols: -they are left alone until required, then read in en-mass and translated -into an internal form. A common routine `bfd_perform_relocation' acts -upon the canonical form to do the fixup. - - Relocations are maintained on a per section basis, while symbols are -maintained on a per BFD basis. - - All that a back end has to do to fit the BFD interface is to create -a `struct reloc_cache_entry' for each relocation in a particular -section, and fill in the right bits of the structures. - -* Menu: - -* typedef arelent:: -* howto manager:: - diff --git a/gnu/dist/bfd/doc/bfd.info-3 b/gnu/dist/bfd/doc/bfd.info-3 deleted file mode 100644 index 89520a4abf44..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-3 +++ /dev/null @@ -1,1029 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations - -typedef arelent ---------------- - - This is the structure of a relocation entry: - - - typedef enum bfd_reloc_status - { - /* No errors detected */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - } - bfd_reloc_status_type; - - - typedef struct reloc_cache_entry - { - /* A pointer into the canonical table of pointers */ - struct symbol_cache_entry **sym_ptr_ptr; - - /* offset in section */ - bfd_size_type address; - - /* addend for relocation value */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation */ - reloc_howto_type *howto; - - } arelent; - *Description* -Here is a description of each of the fields within an `arelent': - - * `sym_ptr_ptr' The symbol table pointer points to a pointer to the -symbol associated with the relocation request. It is the pointer into -the table returned by the back end's `get_symtab' action. *Note -Symbols::. The symbol is referenced through a pointer to a pointer so -that tools like the linker can fix up all the symbols of the same name -by modifying only one pointer. The relocation routine looks in the -symbol and uses the base of the section the symbol is attached to and -the value of the symbol as the initial relocation offset. If the symbol -pointer is zero, then the section provided is looked up. - - * `address' The `address' field gives the offset in bytes from the -base of the section data which owns the relocation record to the first -byte of relocatable information. The actual data relocated will be -relative to this point; for example, a relocation type which modifies -the bottom two bytes of a four byte word would not touch the first byte -pointed to in a big endian world. - - * `addend' The `addend' is a value provided by the back end to be -added (!) to the relocation offset. Its interpretation is dependent -upon the howto. For example, on the 68k the code: - - char foo[]; - main() - { - return foo[0x12345678]; - } - - Could be compiled into: - - linkw fp,#-4 - moveb @#12345678,d0 - extbl d0 - unlk fp - rts - - This could create a reloc pointing to `foo', but leave the offset in -the data, something like: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000006 32 _foo - - 00000000 4e56 fffc ; linkw fp,#-4 - 00000004 1039 1234 5678 ; moveb @#12345678,d0 - 0000000a 49c0 ; extbl d0 - 0000000c 4e5e ; unlk fp - 0000000e 4e75 ; rts - - Using coff and an 88k, some instructions don't have enough space in -them to represent the full address range, and pointers have to be -loaded in two parts. So you'd get something like: - - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 - - This should create two relocs, both pointing to `_foo', and with -0x12340000 in their addend field. The data would consist of: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000002 HVRT16 _foo+0x12340000 - 00000006 LVRT16 _foo+0x12340000 - - 00000000 5da05678 ; or.u r13,r0,0x5678 - 00000004 1c4d5678 ; ld.b r2,r13,0x5678 - 00000008 f400c001 ; jmp r1 - - The relocation routine digs out the value from the data, adds it to -the addend to get the original offset, and then adds the value of -`_foo'. Note that all 32 bits have to be kept around somewhere, to cope -with carry from bit 15 to bit 16. - - One further example is the sparc and the a.out format. The sparc has -a similar problem to the 88k, in that some instructions don't have room -for an entire offset, but on the sparc the parts are created in odd -sized lumps. The designers of the a.out format chose to not use the -data within the section for storing part of the offset; all the offset -is kept within the reloc. Anything in the data should be ignored. - - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore - - Both relocs contain a pointer to `foo', and the offsets contain junk. - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000004 HI22 _foo+0x12345678 - 00000008 LO10 _foo+0x12345678 - - 00000000 9de3bf90 ; save %sp,-112,%sp - 00000004 05000000 ; sethi %hi(_foo+0),%g2 - 00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 - 0000000c 81c7e008 ; ret - 00000010 81e80000 ; restore - - * `howto' The `howto' field can be imagined as a relocation -instruction. It is a pointer to a structure which contains information -on what to do with all of the other information in the reloc record and -data section. A back end would normally have a relocation instruction -set and turn relocations into pointers to the correct structure on -input - but it would be possible to create each howto field on demand. - -`enum complain_overflow' -........................ - - Indicates what sort of overflow checking should be done when -performing a relocation. - - - enum complain_overflow - { - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the bitfield overflows, whether it is considered - as signed or unsigned. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned - }; - -`reloc_howto_type' -.................. - - The `reloc_howto_type' is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - struct symbol_cache_entry; /* Forward declaration */ - - struct reloc_howto_struct - { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* Notes that the relocation is relative to the location in the - data section of the addend. The relocation function will - subtract from the relocation value the address of the location - being relocated. */ - boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accomodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - PARAMS ((bfd *abfd, - arelent *reloc_entry, - struct symbol_cache_entry *symbol, - PTR data, - asection *input_section, - bfd *output_bfd, - char **error_message)); - - /* The textual name of the relocation type. */ - char *name; - - /* When performing a partial link, some formats must modify the - relocations rather than the data - this flag signals this.*/ - boolean partial_inplace; - - /* The src_mask selects which parts of the read in data - are to be used in the relocation sum. E.g., if this was an 8 bit - bit of data which we read and relocated, this would be - 0x000000ff. When we have relocs which have an addend, such as - sun4 extended relocs, the value in the offset part of a - relocating field is garbage so we never use it. In this case - the mask would be 0x00000000. */ - bfd_vma src_mask; - - /* The dst_mask selects which parts of the instruction are replaced - into the instruction. In most cases src_mask == dst_mask, - except in the above special case, where dst_mask would be - 0x000000ff, and src_mask would be 0x00000000. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact.*/ - boolean pcrel_offset; - - }; - -`The HOWTO Macro' -................. - - *Description* -The HOWTO define is horrible and will go away. - #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC} - - *Description* -And will be replaced with the totally magic way. But for the moment, we -are compatible, so do it this way. - #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) - - *Description* -Helper routine to turn a symbol into a relocation value. - #define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != (asymbol *)NULL) { \ - if (bfd_is_com_section (symbol->section)) { \ - relocation = 0; \ - } \ - else { \ - relocation = symbol->value; \ - } \ - } \ - } - -`bfd_get_reloc_size' -.................... - - *Synopsis* - unsigned int bfd_get_reloc_size (reloc_howto_type *); - *Description* -For a reloc_howto_type that operates on a fixed number of bytes, this -returns the number of bytes operated on. - -`arelent_chain' -............... - - *Description* -How relocs are tied together in an `asection': - typedef struct relent_chain { - arelent relent; - struct relent_chain *next; - } arelent_chain; - -`bfd_check_overflow' -.................... - - *Synopsis* - bfd_reloc_status_type - bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - bfd_vma relocation); - *Description* -Perform overflow checking on RELOCATION which has BITSIZE significant -bits and will be shifted right by RIGHTSHIFT bits. The result is -either of `bfd_reloc_ok' or `bfd_reloc_overflow'. - -`bfd_perform_relocation' -........................ - - *Synopsis* - bfd_reloc_status_type - bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - PTR data, - asection *input_section, - bfd *output_bfd, - char **error_message); - *Description* -If OUTPUT_BFD is supplied to this function, the generated image will be -relocatable; the relocations are copied to the output file after they -have been changed to reflect the new state of the world. There are two -ways of reflecting the results of partial linkage in an output file: by -modifying the output data in place, and by modifying the relocation -record. Some native formats (e.g., basic a.out and basic coff) have no -way of specifying an addend in the relocation type, so the addend has -to go in the output data. This is no big deal since in these formats -the output data slot will always be big enough for the addend. Complex -reloc types with addends were invented to solve just this problem. The -ERROR_MESSAGE argument is set to an error message if this return -`bfd_reloc_dangerous'. - -`bfd_install_relocation' -........................ - - *Synopsis* - bfd_reloc_status_type - bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - PTR data, bfd_vma data_start, - asection *input_section, - char **error_message); - *Description* -This looks remarkably like `bfd_perform_relocation', except it does not -expect that the section contents have been filled in. I.e., it's -suitable for use when creating, rather than applying a relocation. - - For now, this function should be considered reserved for the -assembler. - - -File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations - -The howto manager -================= - - When an application wants to create a relocation, but doesn't know -what the target machine might call it, it can find out by using this -bit of code. - -`bfd_reloc_code_type' -..................... - - *Description* -The insides of a reloc code. The idea is that, eventually, there will -be one enumerator for every type of relocation we ever do. Pass one of -these values to `bfd_reloc_type_lookup', and it'll return a howto -pointer. - - This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set of -attributes. - - Here are the possible values for `enum bfd_reloc_code_real': - - - : BFD_RELOC_64 - - : BFD_RELOC_32 - - : BFD_RELOC_26 - - : BFD_RELOC_24 - - : BFD_RELOC_16 - - : BFD_RELOC_14 - - : BFD_RELOC_8 - Basic absolute relocations of N bits. - - - : BFD_RELOC_64_PCREL - - : BFD_RELOC_32_PCREL - - : BFD_RELOC_24_PCREL - - : BFD_RELOC_16_PCREL - - : BFD_RELOC_12_PCREL - - : BFD_RELOC_8_PCREL - PC-relative relocations. Sometimes these are relative to the - address of the relocation itself; sometimes they are relative to - the start of the section containing the relocation. It depends on - the specific target. - - The 24-bit relocation is used in some Intel 960 configurations. - - - : BFD_RELOC_32_GOT_PCREL - - : BFD_RELOC_16_GOT_PCREL - - : BFD_RELOC_8_GOT_PCREL - - : BFD_RELOC_32_GOTOFF - - : BFD_RELOC_16_GOTOFF - - : BFD_RELOC_LO16_GOTOFF - - : BFD_RELOC_HI16_GOTOFF - - : BFD_RELOC_HI16_S_GOTOFF - - : BFD_RELOC_8_GOTOFF - - : BFD_RELOC_32_PLT_PCREL - - : BFD_RELOC_24_PLT_PCREL - - : BFD_RELOC_16_PLT_PCREL - - : BFD_RELOC_8_PLT_PCREL - - : BFD_RELOC_32_PLTOFF - - : BFD_RELOC_16_PLTOFF - - : BFD_RELOC_LO16_PLTOFF - - : BFD_RELOC_HI16_PLTOFF - - : BFD_RELOC_HI16_S_PLTOFF - - : BFD_RELOC_8_PLTOFF - For ELF. - - - : BFD_RELOC_68K_GLOB_DAT - - : BFD_RELOC_68K_JMP_SLOT - - : BFD_RELOC_68K_RELATIVE - Relocations used by 68K ELF. - - - : BFD_RELOC_32_BASEREL - - : BFD_RELOC_16_BASEREL - - : BFD_RELOC_LO16_BASEREL - - : BFD_RELOC_HI16_BASEREL - - : BFD_RELOC_HI16_S_BASEREL - - : BFD_RELOC_8_BASEREL - - : BFD_RELOC_RVA - Linkage-table relative. - - - : BFD_RELOC_8_FFnn - Absolute 8-bit relocation, but used to form an address like 0xFFnn. - - - : BFD_RELOC_32_PCREL_S2 - - : BFD_RELOC_16_PCREL_S2 - - : BFD_RELOC_23_PCREL_S2 - These PC-relative relocations are stored as word displacements - - i.e., byte displacements shifted right two bits. The 30-bit word - displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the - SPARC. (SPARC tools generally refer to this as <>.) The - signed 16-bit displacement is used on the MIPS, and the 23-bit - displacement is used on the Alpha. - - - : BFD_RELOC_HI22 - - : BFD_RELOC_LO10 - High 22 bits and low 10 bits of 32-bit value, placed into lower - bits of the target word. These are used on the SPARC. - - - : BFD_RELOC_GPREL16 - - : BFD_RELOC_GPREL32 - For systems that allocate a Global Pointer register, these are - displacements off that register. These relocation types are - handled specially, because the value the register will have is - decided relatively late. - - - : BFD_RELOC_I960_CALLJ - Reloc types used for i960/b.out. - - - : BFD_RELOC_NONE - - : BFD_RELOC_SPARC_WDISP22 - - : BFD_RELOC_SPARC22 - - : BFD_RELOC_SPARC13 - - : BFD_RELOC_SPARC_GOT10 - - : BFD_RELOC_SPARC_GOT13 - - : BFD_RELOC_SPARC_GOT22 - - : BFD_RELOC_SPARC_PC10 - - : BFD_RELOC_SPARC_PC22 - - : BFD_RELOC_SPARC_WPLT30 - - : BFD_RELOC_SPARC_COPY - - : BFD_RELOC_SPARC_GLOB_DAT - - : BFD_RELOC_SPARC_JMP_SLOT - - : BFD_RELOC_SPARC_RELATIVE - - : BFD_RELOC_SPARC_UA32 - SPARC ELF relocations. There is probably some overlap with other - relocation types already defined. - - - : BFD_RELOC_SPARC_BASE13 - - : BFD_RELOC_SPARC_BASE22 - I think these are specific to SPARC a.out (e.g., Sun 4). - - - : BFD_RELOC_SPARC_64 - - : BFD_RELOC_SPARC_10 - - : BFD_RELOC_SPARC_11 - - : BFD_RELOC_SPARC_OLO10 - - : BFD_RELOC_SPARC_HH22 - - : BFD_RELOC_SPARC_HM10 - - : BFD_RELOC_SPARC_LM22 - - : BFD_RELOC_SPARC_PC_HH22 - - : BFD_RELOC_SPARC_PC_HM10 - - : BFD_RELOC_SPARC_PC_LM22 - - : BFD_RELOC_SPARC_WDISP16 - - : BFD_RELOC_SPARC_WDISP19 - - : BFD_RELOC_SPARC_7 - - : BFD_RELOC_SPARC_6 - - : BFD_RELOC_SPARC_5 - - : BFD_RELOC_SPARC_DISP64 - - : BFD_RELOC_SPARC_PLT64 - - : BFD_RELOC_SPARC_HIX22 - - : BFD_RELOC_SPARC_LOX10 - - : BFD_RELOC_SPARC_H44 - - : BFD_RELOC_SPARC_M44 - - : BFD_RELOC_SPARC_L44 - - : BFD_RELOC_SPARC_REGISTER - SPARC64 relocations - - - : BFD_RELOC_ALPHA_GPDISP_HI16 - Alpha ECOFF and ELF relocations. Some of these treat the symbol or - "addend" in some special way. For GPDISP_HI16 ("gpdisp") - relocations, the symbol is ignored when writing; when reading, it - will be the absolute section symbol. The addend is the - displacement in bytes of the "lda" instruction from the "ldah" - instruction (which is at the address of this reloc). - - - : BFD_RELOC_ALPHA_GPDISP_LO16 - For GPDISP_LO16 ("ignore") relocations, the symbol is handled as - with GPDISP_HI16 relocs. The addend is ignored when writing the - relocations out, and is filled in with the file's GP value on - reading, for convenience. - - - : BFD_RELOC_ALPHA_GPDISP - The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 - relocation except that there is no accompanying GPDISP_LO16 - relocation. - - - : BFD_RELOC_ALPHA_LITERAL - - : BFD_RELOC_ALPHA_ELF_LITERAL - - : BFD_RELOC_ALPHA_LITUSE - The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; - the assembler turns it into a LDQ instruction to load the address - of the symbol, and then fills in a register in the real - instruction. - - The LITERAL reloc, at the LDQ instruction, refers to the .lita - section symbol. The addend is ignored when writing, but is filled - in with the file's GP value on reading, for convenience, as with - the GPDISP_LO16 reloc. - - The ELF_LITERAL reloc is somewhere between 16_GOTOFF and - GPDISP_LO16. It should refer to the symbol to be referenced, as - with 16_GOTOFF, but it generates output not based on the position - within the .got section, but relative to the GP value chosen for - the file during the final link stage. - - The LITUSE reloc, on the instruction using the loaded address, - gives information to the linker that it might be able to use to - optimize away some literal section references. The symbol is - ignored (read as the absolute section symbol), and the "addend" - indicates the type of instruction using the register: 1 - "memory" - fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target - of branch) - - The GNU linker currently doesn't do any of this optimizing. - - - : BFD_RELOC_ALPHA_HINT - The HINT relocation indicates a value that should be filled into - the "hint" field of a jmp/jsr/ret instruction, for possible branch- - prediction logic which may be provided on some processors. - - - : BFD_RELOC_ALPHA_LINKAGE - The LINKAGE relocation outputs a linkage pair in the object file, - which is filled by the linker. - - - : BFD_RELOC_ALPHA_CODEADDR - The CODEADDR relocation outputs a STO_CA in the object file, which - is filled by the linker. - - - : BFD_RELOC_MIPS_JMP - Bits 27..2 of the relocation address shifted right 2 bits; simple - reloc otherwise. - - - : BFD_RELOC_MIPS16_JMP - The MIPS16 jump instruction. - - - : BFD_RELOC_MIPS16_GPREL - MIPS16 GP relative reloc. - - - : BFD_RELOC_HI16 - High 16 bits of 32-bit value; simple reloc. - - - : BFD_RELOC_HI16_S - High 16 bits of 32-bit value but the low 16 bits will be sign - extended and added to form the final result. If the low 16 bits - form a negative number, we need to add one to the high value to - compensate for the borrow when the low bits are added. - - - : BFD_RELOC_LO16 - Low 16 bits. - - - : BFD_RELOC_PCREL_HI16_S - Like BFD_RELOC_HI16_S, but PC relative. - - - : BFD_RELOC_PCREL_LO16 - Like BFD_RELOC_LO16, but PC relative. - - - : BFD_RELOC_MIPS_GPREL - Relocation relative to the global pointer. - - - : BFD_RELOC_MIPS_LITERAL - Relocation against a MIPS literal section. - - - : BFD_RELOC_MIPS_GOT16 - - : BFD_RELOC_MIPS_CALL16 - - : BFD_RELOC_MIPS_GPREL32 - - : BFD_RELOC_MIPS_GOT_HI16 - - : BFD_RELOC_MIPS_GOT_LO16 - - : BFD_RELOC_MIPS_CALL_HI16 - - : BFD_RELOC_MIPS_CALL_LO16 - MIPS ELF relocations. - - - : BFD_RELOC_386_GOT32 - - : BFD_RELOC_386_PLT32 - - : BFD_RELOC_386_COPY - - : BFD_RELOC_386_GLOB_DAT - - : BFD_RELOC_386_JUMP_SLOT - - : BFD_RELOC_386_RELATIVE - - : BFD_RELOC_386_GOTOFF - - : BFD_RELOC_386_GOTPC - i386/elf relocations - - - : BFD_RELOC_NS32K_IMM_8 - - : BFD_RELOC_NS32K_IMM_16 - - : BFD_RELOC_NS32K_IMM_32 - - : BFD_RELOC_NS32K_IMM_8_PCREL - - : BFD_RELOC_NS32K_IMM_16_PCREL - - : BFD_RELOC_NS32K_IMM_32_PCREL - - : BFD_RELOC_NS32K_DISP_8 - - : BFD_RELOC_NS32K_DISP_16 - - : BFD_RELOC_NS32K_DISP_32 - - : BFD_RELOC_NS32K_DISP_8_PCREL - - : BFD_RELOC_NS32K_DISP_16_PCREL - - : BFD_RELOC_NS32K_DISP_32_PCREL - ns32k relocations - - - : BFD_RELOC_PPC_B26 - - : BFD_RELOC_PPC_BA26 - - : BFD_RELOC_PPC_TOC16 - - : BFD_RELOC_PPC_B16 - - : BFD_RELOC_PPC_B16_BRTAKEN - - : BFD_RELOC_PPC_B16_BRNTAKEN - - : BFD_RELOC_PPC_BA16 - - : BFD_RELOC_PPC_BA16_BRTAKEN - - : BFD_RELOC_PPC_BA16_BRNTAKEN - - : BFD_RELOC_PPC_COPY - - : BFD_RELOC_PPC_GLOB_DAT - - : BFD_RELOC_PPC_JMP_SLOT - - : BFD_RELOC_PPC_RELATIVE - - : BFD_RELOC_PPC_LOCAL24PC - - : BFD_RELOC_PPC_EMB_NADDR32 - - : BFD_RELOC_PPC_EMB_NADDR16 - - : BFD_RELOC_PPC_EMB_NADDR16_LO - - : BFD_RELOC_PPC_EMB_NADDR16_HI - - : BFD_RELOC_PPC_EMB_NADDR16_HA - - : BFD_RELOC_PPC_EMB_SDAI16 - - : BFD_RELOC_PPC_EMB_SDA2I16 - - : BFD_RELOC_PPC_EMB_SDA2REL - - : BFD_RELOC_PPC_EMB_SDA21 - - : BFD_RELOC_PPC_EMB_MRKREF - - : BFD_RELOC_PPC_EMB_RELSEC16 - - : BFD_RELOC_PPC_EMB_RELST_LO - - : BFD_RELOC_PPC_EMB_RELST_HI - - : BFD_RELOC_PPC_EMB_RELST_HA - - : BFD_RELOC_PPC_EMB_BIT_FLD - - : BFD_RELOC_PPC_EMB_RELSDA - Power(rs6000) and PowerPC relocations. - - - : BFD_RELOC_CTOR - The type of reloc used to build a contructor table - at the moment - probably a 32 bit wide absolute relocation, but the target can - choose. It generally does map to one of the other relocation - types. - - - : BFD_RELOC_ARM_PCREL_BRANCH - ARM 26 bit pc-relative branch. The lowest two bits must be zero - and are not stored in the instruction. - - - : BFD_RELOC_ARM_IMMEDIATE - - : BFD_RELOC_ARM_OFFSET_IMM - - : BFD_RELOC_ARM_SHIFT_IMM - - : BFD_RELOC_ARM_SWI - - : BFD_RELOC_ARM_MULTI - - : BFD_RELOC_ARM_CP_OFF_IMM - - : BFD_RELOC_ARM_ADR_IMM - - : BFD_RELOC_ARM_LDR_IMM - - : BFD_RELOC_ARM_LITERAL - - : BFD_RELOC_ARM_IN_POOL - - : BFD_RELOC_ARM_OFFSET_IMM8 - - : BFD_RELOC_ARM_HWLITERAL - - : BFD_RELOC_ARM_THUMB_ADD - - : BFD_RELOC_ARM_THUMB_IMM - - : BFD_RELOC_ARM_THUMB_SHIFT - - : BFD_RELOC_ARM_THUMB_OFFSET - These relocs are only used within the ARM assembler. They are not - (at present) written to any object files. - - - : BFD_RELOC_SH_PCDISP8BY2 - - : BFD_RELOC_SH_PCDISP12BY2 - - : BFD_RELOC_SH_IMM4 - - : BFD_RELOC_SH_IMM4BY2 - - : BFD_RELOC_SH_IMM4BY4 - - : BFD_RELOC_SH_IMM8 - - : BFD_RELOC_SH_IMM8BY2 - - : BFD_RELOC_SH_IMM8BY4 - - : BFD_RELOC_SH_PCRELIMM8BY2 - - : BFD_RELOC_SH_PCRELIMM8BY4 - - : BFD_RELOC_SH_SWITCH16 - - : BFD_RELOC_SH_SWITCH32 - - : BFD_RELOC_SH_USES - - : BFD_RELOC_SH_COUNT - - : BFD_RELOC_SH_ALIGN - - : BFD_RELOC_SH_CODE - - : BFD_RELOC_SH_DATA - - : BFD_RELOC_SH_LABEL - Hitachi SH relocs. Not all of these appear in object files. - - - : BFD_RELOC_THUMB_PCREL_BRANCH9 - - : BFD_RELOC_THUMB_PCREL_BRANCH12 - - : BFD_RELOC_THUMB_PCREL_BRANCH23 - Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must - be zero and is not stored in the instruction. - - - : BFD_RELOC_ARC_B22_PCREL - Argonaut RISC Core (ARC) relocs. ARC 22 bit pc-relative branch. - The lowest two bits must be zero and are not stored in the - instruction. The high 20 bits are installed in bits 26 through 7 - of the instruction. - - - : BFD_RELOC_ARC_B26 - ARC 26 bit absolute branch. The lowest two bits must be zero and - are not stored in the instruction. The high 24 bits are installed - in bits 23 through 0. - - - : BFD_RELOC_D10V_10_PCREL_R - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. - - - : BFD_RELOC_D10V_10_PCREL_L - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. This is the same as the previous reloc - except it is in the left container, i.e., shifted left 15 bits. - - - : BFD_RELOC_D10V_18 - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - - : BFD_RELOC_D10V_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - - : BFD_RELOC_M32R_24 - Mitsubishi M32R relocs. This is a 24 bit absolute address. - - - : BFD_RELOC_M32R_10_PCREL - This is a 10-bit pc-relative reloc with the right 2 bits assumed - to be 0. - - - : BFD_RELOC_M32R_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - - : BFD_RELOC_M32R_26_PCREL - This is a 26-bit reloc with the right 2 bits assumed to be 0. - - - : BFD_RELOC_M32R_HI16_ULO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as unsigned. - - - : BFD_RELOC_M32R_HI16_SLO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as signed. - - - : BFD_RELOC_M32R_LO16 - This is a 16-bit reloc containing the lower 16 bits of an address. - - - : BFD_RELOC_M32R_SDA16 - This is a 16-bit reloc containing the small data area offset for - use in add3, load, and store instructions. - - - : BFD_RELOC_V850_9_PCREL - This is a 9-bit reloc - - - : BFD_RELOC_V850_22_PCREL - This is a 22-bit reloc - - - : BFD_RELOC_V850_SDA_16_16_OFFSET - This is a 16 bit offset from the short data area pointer. - - - : BFD_RELOC_V850_SDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - short data area pointer. - - - : BFD_RELOC_V850_ZDA_16_16_OFFSET - This is a 16 bit offset from the zero data area pointer. - - - : BFD_RELOC_V850_ZDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - zero data area pointer. - - - : BFD_RELOC_V850_TDA_6_8_OFFSET - This is an 8 bit offset (of which only 6 bits are used) from the - tiny data area pointer. - - - : BFD_RELOC_V850_TDA_7_8_OFFSET - This is an 8bit offset (of which only 7 bits are used) from the - tiny data area pointer. - - - : BFD_RELOC_V850_TDA_7_7_OFFSET - This is a 7 bit offset from the tiny data area pointer. - - - : BFD_RELOC_V850_TDA_16_16_OFFSET - This is a 16 bit offset from the tiny data area pointer. - - - : BFD_RELOC_MN10300_32_PCREL - This is a 32bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - - : BFD_RELOC_MN10300_16_PCREL - This is a 16bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - - : BFD_RELOC_TIC30_LDP - This is a 8bit DP reloc for the tms320c30, where the most - significant 8 bits of a 24 bit word are placed into the least - significant 8 bits of the opcode. - - - typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; - -`bfd_reloc_type_lookup' -....................... - - *Synopsis* - reloc_howto_type * - bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); - *Description* -Return a pointer to a howto structure which, when invoked, will perform -the relocation CODE on data from the architecture noted. - -`bfd_default_reloc_type_lookup' -............................... - - *Synopsis* - reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); - *Description* -Provides a default relocation lookup routine for any architecture. - -`bfd_get_reloc_code_name' -......................... - - *Synopsis* - const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); - *Description* -Provides a printable name for the supplied relocation code. Useful -mainly for printing error messages. - -`bfd_generic_relax_section' -........................... - - *Synopsis* - boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - boolean *); - *Description* -Provides default handling for relaxing for back ends which don't do -relaxing - i.e., does nothing. - -`bfd_generic_get_relocated_section_contents' -............................................ - - *Synopsis* - bfd_byte * - bfd_generic_get_relocated_section_contents (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - boolean relocateable, - asymbol **symbols); - *Description* -Provides default handling of relocation effort for back ends which -can't be bothered to do it efficiently. - - -File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end - -Core files -========== - - *Description* -These are functions pertaining to core files. - -`bfd_core_file_failing_command' -............................... - - *Synopsis* - CONST char *bfd_core_file_failing_command(bfd *abfd); - *Description* -Return a read-only string explaining which program was running when it -failed and produced the core file ABFD. - -`bfd_core_file_failing_signal' -.............................. - - *Synopsis* - int bfd_core_file_failing_signal(bfd *abfd); - *Description* -Returns the signal number which caused the core dump which generated -the file the BFD ABFD is attached to. - -`core_file_matches_executable_p' -................................ - - *Synopsis* - boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - *Description* -Return `true' if the core file attached to CORE_BFD was generated by a -run of the executable file attached to EXEC_BFD, `false' otherwise. - - -File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end - -Targets -======= - - *Description* -Each port of BFD to a different machine requries the creation of a -target back end. All the back end provides to the root part of BFD is a -structure containing pointers to functions which perform certain low -level operations on files. BFD translates the applications's requests -through a pointer into calls to the back end routines. - - When a file is opened with `bfd_openr', its format and target are -unknown. BFD uses various mechanisms to determine how to interpret the -file. The operations performed are: - - * Create a BFD by calling the internal routine `_bfd_new_bfd', then - call `bfd_find_target' with the target string supplied to - `bfd_openr' and the new BFD pointer. - - * If a null target string was provided to `bfd_find_target', look up - the environment variable `GNUTARGET' and use that as the target - string. - - * If the target string is still `NULL', or the target string is - `default', then use the first item in the target vector as the - target type, and set `target_defaulted' in the BFD to cause - `bfd_check_format' to loop through all the targets. *Note - bfd_target::. *Note Formats::. - - * Otherwise, inspect the elements in the target vector one by one, - until a match on target name is found. When found, use it. - - * Otherwise return the error `bfd_error_invalid_target' to - `bfd_openr'. - - * `bfd_openr' attempts to open the file using `bfd_open_file', and - returns the BFD. Once the BFD has been opened and the target -selected, the file format may be determined. This is done by calling -`bfd_check_format' on the BFD with a suggested format. If -`target_defaulted' has been set, each possible target type is tried to -see if it recognizes the specified format. `bfd_check_format' returns -`true' when the caller guesses right. - -* Menu: - -* bfd_target:: - diff --git a/gnu/dist/bfd/doc/bfd.info-4 b/gnu/dist/bfd/doc/bfd.info-4 deleted file mode 100644 index 02e3607a88f8..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-4 +++ /dev/null @@ -1,1248 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets - -bfd_target ----------- - - *Description* -This structure contains everything that BFD knows about a target. It -includes things like its byte order, name, and which routines to call -to do various operations. - - Every BFD points to a target structure with its `xvec' member. - - The macros below are used to dispatch to functions through the -`bfd_target' vector. They are used in a number of macros further down -in `bfd.h', and are also used when calling various routines by hand -inside the BFD implementation. The ARGLIST argument must be -parenthesized; it contains all the arguments to the called function. - - They make the documentation (more) unpleasant to read, so if someone -wants to fix this and not break the above, please do. - #define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND - #define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - For operations which index on the BFD format: - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND_FMT - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - This is the structure which defines the type of BFD this is. The -`xvec' member of the struct `bfd' itself points here. Each module that -implements access to a different target under BFD, defines one of these. - - FIXME, these names should be rationalised with the names of the -entry points which call them. Too bad we can't have one macro to define -them both! - enum bfd_flavour { - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_evax_flavour - }; - - enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; - - /* Forward declaration. */ - typedef struct bfd_link_info _bfd_link_info; - - typedef struct bfd_target - { - Identifies the kind of target, e.g., SunOS4, Ultrix, etc. - char *name; - The "flavour" of a back end is a general indication about the -contents of a file. - enum bfd_flavour flavour; - The order of bytes within the data area of a file. - enum bfd_endian byteorder; - The order of bytes within the header parts of a file. - enum bfd_endian header_byteorder; - A mask of all the flags which an executable may have set - from the -set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. - flagword object_flags; - A mask of all the flags which a section may have set - from the set -`SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. - flagword section_flags; - The character normally found at the front of a symbol (if any), -perhaps `_'. - char symbol_leading_char; - The pad character for file names within an archive header. - char ar_pad_char; - The maximum number of characters in an archive header. - unsigned short ar_max_namelen; - Entries for byte swapping for data. These are different from the -other entry points, since they don't take a BFD asthe first argument. -Certain other handlers could do the same. - bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); - Byte swapping for the headers - bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); - Format dependent routines: these are vectors of entry points within -the target vector structure, one for each format to check. - - Check the format of a file being read. Return a `bfd_target *' or -zero. - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); - Set the format of a file being written. - boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); - Write cached information into a file being written, at `bfd_close'. - boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); - The general target vector. - - /* Generic entry points. */ - #define BFD_JUMP_TABLE_GENERIC(NAME)\ - CAT(NAME,_close_and_cleanup),\ - CAT(NAME,_bfd_free_cached_info),\ - CAT(NAME,_new_section_hook),\ - CAT(NAME,_get_section_contents),\ - CAT(NAME,_get_section_contents_in_window) - - /* Called when the BFD is being closed to do any necessary cleanup. */ - boolean (*_close_and_cleanup) PARAMS ((bfd *)); - /* Ask the BFD to free all cached information. */ - boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - /* Called when a new section is created. */ - boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_bfd_get_section_contents_in_window) - PARAMS ((bfd *, sec_ptr, bfd_window *, - file_ptr, bfd_size_type)); - - /* Entry points to copy private data. */ - #define BFD_JUMP_TABLE_COPY(NAME)\ - CAT(NAME,_bfd_copy_private_bfd_data),\ - CAT(NAME,_bfd_merge_private_bfd_data),\ - CAT(NAME,_bfd_copy_private_section_data),\ - CAT(NAME,_bfd_copy_private_symbol_data),\ - CAT(NAME,_bfd_set_private_flags),\ - CAT(NAME,_bfd_print_private_bfd_data)\ - /* Called to copy BFD general private data from one object file - to another. */ - boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to copy BFD private section data from one object file - to another. */ - boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, - bfd *, sec_ptr)); - /* Called to copy BFD private symbol data from one symbol - to another. */ - boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, - bfd *, asymbol *)); - /* Called to set private backend flags */ - boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); - - /* Called to print private BFD data */ - boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); - - /* Core file entry points. */ - #define BFD_JUMP_TABLE_CORE(NAME)\ - CAT(NAME,_core_file_failing_command),\ - CAT(NAME,_core_file_failing_signal),\ - CAT(NAME,_core_file_matches_executable_p) - char * (*_core_file_failing_command) PARAMS ((bfd *)); - int (*_core_file_failing_signal) PARAMS ((bfd *)); - boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - - /* Archive entry points. */ - #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ - CAT(NAME,_slurp_armap),\ - CAT(NAME,_slurp_extended_name_table),\ - CAT(NAME,_construct_extended_name_table),\ - CAT(NAME,_truncate_arname),\ - CAT(NAME,_write_armap),\ - CAT(NAME,_read_ar_hdr),\ - CAT(NAME,_openr_next_archived_file),\ - CAT(NAME,_get_elt_at_index),\ - CAT(NAME,_generic_stat_arch_elt),\ - CAT(NAME,_update_armap_timestamp) - boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); - boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); - boolean (*_bfd_construct_extended_name_table) - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); - void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); - boolean (*write_armap) PARAMS ((bfd *arch, - unsigned int elength, - struct orl *map, - unsigned int orl_count, - int stridx)); - PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); - #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); - int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); - boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); - - /* Entry points used for symbols. */ - #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ - CAT(NAME,_get_symtab_upper_bound),\ - CAT(NAME,_get_symtab),\ - CAT(NAME,_make_empty_symbol),\ - CAT(NAME,_print_symbol),\ - CAT(NAME,_get_symbol_info),\ - CAT(NAME,_bfd_is_local_label_name),\ - CAT(NAME,_get_lineno),\ - CAT(NAME,_find_nearest_line),\ - CAT(NAME,_bfd_make_debug_symbol),\ - CAT(NAME,_read_minisymbols),\ - CAT(NAME,_minisymbol_to_symbol) - long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); - long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, - struct symbol_cache_entry **)); - struct symbol_cache_entry * - (*_bfd_make_empty_symbol) PARAMS ((bfd *)); - void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, - struct symbol_cache_entry *, - bfd_print_symbol_type)); - #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) PARAMS ((bfd *, - struct symbol_cache_entry *, - symbol_info *)); - #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) - boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); - - alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); - boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, - struct sec *section, struct symbol_cache_entry **symbols, - bfd_vma offset, CONST char **file, CONST char **func, - unsigned int *line)); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) PARAMS (( - bfd *abfd, - void *ptr, - unsigned long size)); - #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, - unsigned int *)); - #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, - asymbol *)); - - /* Routines for relocs. */ - #define BFD_JUMP_TABLE_RELOCS(NAME)\ - CAT(NAME,_get_reloc_upper_bound),\ - CAT(NAME,_canonicalize_reloc),\ - CAT(NAME,_bfd_reloc_type_lookup) - long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); - long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, - struct symbol_cache_entry **)); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) PARAMS ((bfd *abfd, - bfd_reloc_code_real_type code)); - - /* Routines used when writing an object file. */ - #define BFD_JUMP_TABLE_WRITE(NAME)\ - CAT(NAME,_set_arch_mach),\ - CAT(NAME,_set_section_contents) - boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); - boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - - /* Routines used by the linker. */ - #define BFD_JUMP_TABLE_LINK(NAME)\ - CAT(NAME,_sizeof_headers),\ - CAT(NAME,_bfd_get_relocated_section_contents),\ - CAT(NAME,_bfd_relax_section),\ - CAT(NAME,_bfd_link_hash_table_create),\ - CAT(NAME,_bfd_link_add_symbols),\ - CAT(NAME,_bfd_final_link),\ - CAT(NAME,_bfd_link_split_section) - int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); - bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, - struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *data, boolean relocateable, - struct symbol_cache_entry **)); - - boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, - struct bfd_link_info *, boolean *again)); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); - - /* Add symbols from this object file into the hash table. */ - boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - - /* Should this section be split up into smaller pieces during linking. */ - boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); - - /* Routines to handle dynamic symbols and relocs. */ - #define BFD_JUMP_TABLE_DYNAMIC(NAME)\ - CAT(NAME,_get_dynamic_symtab_upper_bound),\ - CAT(NAME,_canonicalize_dynamic_symtab),\ - CAT(NAME,_get_dynamic_reloc_upper_bound),\ - CAT(NAME,_canonicalize_dynamic_reloc) - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - PARAMS ((bfd *, struct symbol_cache_entry **)); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); - Data for use by back-end routines, which isn't generic enough to -belong in this structure. - PTR backend_data; - } bfd_target; - -`bfd_set_default_target' -........................ - - *Synopsis* - boolean bfd_set_default_target (const char *name); - *Description* -Set the default target vector to use when recognizing a BFD. This -takes the name of the target, which may be a BFD target name or a -configuration triplet. - -`bfd_find_target' -................. - - *Synopsis* - const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd); - *Description* -Return a pointer to the transfer vector for the object target named -TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the -environment variable `GNUTARGET'; if that is null or not defined, then -choose the first entry in the target list. Passing in the string -"default" or setting the environment variable to "default" will cause -the first entry in the target list to be returned, and -"target_defaulted" will be set in the BFD. This causes -`bfd_check_format' to loop over all the targets to find the one that -matches the file being read. - -`bfd_target_list' -................. - - *Synopsis* - const char **bfd_target_list(void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD targets. Do not modify the names. - - -File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end - -Architectures -============= - - BFD keeps one atom in a BFD describing the architecture of the data -attached to the BFD: a pointer to a `bfd_arch_info_type'. - - Pointers to structures can be requested independently of a BFD so -that an architecture's information can be interrogated without access -to an open BFD. - - The architecture information is provided by each architecture -package. The set of default architectures is selected by the macro -`SELECT_ARCHITECTURES'. This is normally set up in the -`config/TARGET.mt' file of your choice. If the name is not defined, -then all the architectures supported are included. - - When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to insert as -many items into the list of architectures as it wants to; generally -this would be one for each machine and one for the default case (an -item with a machine field of 0). - - BFD's idea of an architecture is implemented in `archures.c'. - -bfd_architecture ----------------- - - *Description* -This enum gives the object file's CPU architecture, in a global -sense--i.e., what processor family does it belong to? Another field -indicates which processor within the family is in use. The machine -gives a number which distinguishes different versions of the -architecture, containing, for example, 2 and 3 for Intel i960 KA and -i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. - enum bfd_architecture - { - bfd_arch_unknown, /* File arch not known */ - bfd_arch_obscure, /* Arch known, not one of these */ - bfd_arch_m68k, /* Motorola 68xxx */ - #define bfd_mach_m68000 1 - #define bfd_mach_m68008 2 - #define bfd_mach_m68010 3 - #define bfd_mach_m68020 4 - #define bfd_mach_m68030 5 - #define bfd_mach_m68040 6 - #define bfd_mach_m68060 7 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - - #define bfd_mach_i960_core 1 - #define bfd_mach_i960_ka_sa 2 - #define bfd_mach_i960_kb_sb 3 - #define bfd_mach_i960_mc 4 - #define bfd_mach_i960_xa 5 - #define bfd_mach_i960_ca 6 - #define bfd_mach_i960_jx 7 - #define bfd_mach_i960_hx 8 - - bfd_arch_a29k, /* AMD 29000 */ - bfd_arch_sparc, /* SPARC */ - #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ - #define bfd_mach_sparc_sparclet 2 - #define bfd_mach_sparc_sparclite 3 - #define bfd_mach_sparc_v8plus 4 - #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ - #define bfd_mach_sparc_v9 6 - #define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */ - /* Nonzero if MACH has the v9 instruction set. */ - #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) - bfd_arch_mips, /* MIPS Rxxxx */ - #define bfd_mach_mips3000 3000 - #define bfd_mach_mips3900 3900 - #define bfd_mach_mips4000 4000 - #define bfd_mach_mips4010 4010 - #define bfd_mach_mips4100 4100 - #define bfd_mach_mips4300 4300 - #define bfd_mach_mips4400 4400 - #define bfd_mach_mips4600 4600 - #define bfd_mach_mips4650 4650 - #define bfd_mach_mips5000 5000 - #define bfd_mach_mips6000 6000 - #define bfd_mach_mips8000 8000 - #define bfd_mach_mips10000 10000 - #define bfd_mach_mips16 16 - bfd_arch_i386, /* Intel 386 */ - #define bfd_mach_i386_i386 0 - #define bfd_mach_i386_i8086 1 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_alliant, /* Alliant */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ - #define bfd_mach_h8300 1 - #define bfd_mach_h8300h 2 - #define bfd_mach_h8300s 3 - bfd_arch_powerpc, /* PowerPC */ - bfd_arch_rs6000, /* IBM RS/6000 */ - bfd_arch_hppa, /* HP PA RISC */ - bfd_arch_d10v, /* Mitsubishi D10V */ - bfd_arch_z8k, /* Zilog Z8000 */ - #define bfd_mach_z8001 1 - #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ - #define bfd_mach_sh 0 - #define bfd_mach_sh3 0x30 - #define bfd_mach_sh3e 0x3e - #define bfd_mach_sh4 0x40 - bfd_arch_alpha, /* Dec Alpha */ - bfd_arch_arm, /* Advanced Risc Machines ARM */ - #define bfd_mach_arm_2 1 - #define bfd_mach_arm_2a 2 - #define bfd_mach_arm_3 3 - #define bfd_mach_arm_3M 4 - #define bfd_mach_arm_4 5 - #define bfd_mach_arm_4T 6 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_v850, /* NEC V850 */ - #define bfd_mach_v850 0 - bfd_arch_arc, /* Argonaut RISC Core */ - #define bfd_mach_arc_base 0 - bfd_arch_m32r, /* Mitsubishi M32R/D */ - #define bfd_mach_m32r 0 /* backwards compatibility */ - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ - bfd_arch_last - }; - -bfd_arch_info -------------- - - *Description* -This structure contains information on architectures for use within BFD. - - typedef struct bfd_arch_info - { - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* true if this is the default machine for the architecture */ - boolean the_default; - const struct bfd_arch_info * (*compatible) - PARAMS ((const struct bfd_arch_info *a, - const struct bfd_arch_info *b)); - - boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); - - const struct bfd_arch_info *next; - } bfd_arch_info_type; - -`bfd_printable_name' -.................... - - *Synopsis* - const char *bfd_printable_name(bfd *abfd); - *Description* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -`bfd_scan_arch' -............... - - *Synopsis* - const bfd_arch_info_type *bfd_scan_arch(const char *string); - *Description* -Figure out if BFD supports any cpu which could be described with the -name STRING. Return a pointer to an `arch_info' structure if a machine -is found, otherwise NULL. - -`bfd_arch_list' -............... - - *Synopsis* - const char **bfd_arch_list(void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD architectures. Do not modify the names. - -`bfd_arch_get_compatible' -......................... - - *Synopsis* - const bfd_arch_info_type *bfd_arch_get_compatible( - const bfd *abfd, - const bfd *bbfd); - *Description* -Determine whether two BFDs' architectures and machine types are -compatible. Calculates the lowest common denominator between the two -architectures and machine types implied by the BFDs and returns a -pointer to an `arch_info' structure describing the compatible machine. - -`bfd_default_arch_struct' -......................... - - *Description* -The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which -has been initialized to a fairly generic state. A BFD starts life by -pointing to this structure, until the correct back end has determined -the real architecture of the file. - extern const bfd_arch_info_type bfd_default_arch_struct; - -`bfd_set_arch_info' -................... - - *Synopsis* - void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg); - *Description* -Set the architecture info of ABFD to ARG. - -`bfd_default_set_arch_mach' -........................... - - *Synopsis* - boolean bfd_default_set_arch_mach(bfd *abfd, - enum bfd_architecture arch, - unsigned long mach); - *Description* -Set the architecture and machine type in BFD ABFD to ARCH and MACH. -Find the correct pointer to a structure and insert it into the -`arch_info' pointer. - -`bfd_get_arch' -.............. - - *Synopsis* - enum bfd_architecture bfd_get_arch(bfd *abfd); - *Description* -Return the enumerated type which describes the BFD ABFD's architecture. - -`bfd_get_mach' -.............. - - *Synopsis* - unsigned long bfd_get_mach(bfd *abfd); - *Description* -Return the long type which describes the BFD ABFD's machine. - -`bfd_arch_bits_per_byte' -........................ - - *Synopsis* - unsigned int bfd_arch_bits_per_byte(bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's bytes. - -`bfd_arch_bits_per_address' -........................... - - *Synopsis* - unsigned int bfd_arch_bits_per_address(bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's -addresses. - -`bfd_default_compatible' -........................ - - *Synopsis* - const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, - const bfd_arch_info_type *b); - *Description* -The default function for testing for compatibility. - -`bfd_default_scan' -.................. - - *Synopsis* - boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); - *Description* -The default function for working out whether this is an architecture -hit and a machine hit. - -`bfd_get_arch_info' -................... - - *Synopsis* - const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd); - *Description* -Return the architecture info struct in ABFD. - -`bfd_lookup_arch' -................. - - *Synopsis* - const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture - arch, - unsigned long machine); - *Description* -Look for the architecure info structure which matches the arguments -ARCH and MACHINE. A machine of 0 matches the machine/architecture -structure which marks itself as the default. - -`bfd_printable_arch_mach' -......................... - - *Synopsis* - const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); - *Description* -Return a printable string representing the architecture and machine -type. - - This routine is depreciated. - - -File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end - -Opening and closing BFDs -======================== - -`bfd_openr' -........... - - *Synopsis* - bfd *bfd_openr(CONST char *filename, CONST char *target); - *Description* -Open the file FILENAME (using `fopen') with the target TARGET. Return -a pointer to the created BFD. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - If `NULL' is returned then an error has occured. Possible errors -are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' -error. - -`bfd_fdopenr' -............. - - *Synopsis* - bfd *bfd_fdopenr(CONST char *filename, CONST char *target, int fd); - *Description* -`bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It -opens a BFD on a file already described by the FD supplied. - - When the file is later `bfd_close'd, the file descriptor will be -closed. - - If the caller desires that this file descriptor be cached by BFD -(opened as needed, closed as needed to free descriptors for other -opens), with the supplied FD used as an initial file descriptor (but -subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the -returned BFD. The default is to assume no cacheing; the file -descriptor will remain open until `bfd_close', and will not be affected -by BFD operations on other files. - - Possible errors are `bfd_error_no_memory', -`bfd_error_invalid_target' and `bfd_error_system_call'. - -`bfd_openstreamr' -................. - - *Synopsis* - bfd *bfd_openstreamr(const char *, const char *, PTR); - *Description* -Open a BFD for read access on an existing stdio stream. When the BFD -is passed to `bfd_close', the stream will be closed. - -`bfd_openw' -........... - - *Synopsis* - bfd *bfd_openw(CONST char *filename, CONST char *target); - *Description* -Create a BFD, associated with file FILENAME, using the file format -TARGET, and return a pointer to it. - - Possible errors are `bfd_error_system_call', `bfd_error_no_memory', -`bfd_error_invalid_target'. - -`bfd_close' -........... - - *Synopsis* - boolean bfd_close(bfd *abfd); - *Description* -Close a BFD. If the BFD was open for writing, then pending operations -are completed and the file written out and closed. If the created file -is executable, then `chmod' is called to mark it as such. - - All memory attached to the BFD is released. - - The file descriptor associated with the BFD is closed (even if it -was passed in to BFD by `bfd_fdopenr'). - - *Returns* -`true' is returned if all is ok, otherwise `false'. - -`bfd_close_all_done' -.................... - - *Synopsis* - boolean bfd_close_all_done(bfd *); - *Description* -Close a BFD. Differs from `bfd_close' since it does not complete any -pending operations. This routine would be used if the application had -just used BFD for swapping and didn't want to use any of the writing -code. - - If the created file is executable, then `chmod' is called to mark it -as such. - - All memory attached to the BFD is released. - - *Returns* -`true' is returned if all is ok, otherwise `false'. - -`bfd_create' -............ - - *Synopsis* - bfd *bfd_create(CONST char *filename, bfd *templ); - *Description* -Create a new BFD in the manner of `bfd_openw', but without opening a -file. The new BFD takes the target from the target used by TEMPLATE. The -format is always set to `bfd_object'. - -`bfd_alloc' -........... - - *Synopsis* - PTR bfd_alloc (bfd *abfd, size_t wanted); - *Description* -Allocate a block of WANTED bytes of memory attached to `abfd' and -return a pointer to it. - - -File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end - -Internal functions -================== - - *Description* -These routines are used within BFD. They are not intended for export, -but are documented here for completeness. - -`bfd_write_bigendian_4byte_int' -............................... - - *Synopsis* - void bfd_write_bigendian_4byte_int(bfd *abfd, int i); - *Description* -Write a 4 byte integer I to the output BFD ABFD, in big endian order -regardless of what else is going on. This is useful in archives. - -`bfd_put_size' -.............. - -`bfd_get_size' -.............. - - *Description* -These macros as used for reading and writing raw data in sections; each -access (except for bytes) is vectored through the target format of the -BFD and mangled accordingly. The mangling performs any necessary endian -translations and removes alignment restrictions. Note that types -accepted and returned by these macros are identical so they can be -swapped around in macros--for example, `libaout.h' defines `GET_WORD' -to either `bfd_get_32' or `bfd_get_64'. - - In the put routines, VAL must be a `bfd_vma'. If we are on a system -without prototypes, the caller is responsible for making sure that is -true, with a cast if necessary. We don't cast them in the macro -definitions because that would prevent `lint' or `gcc -Wall' from -detecting sins such as passing a pointer. To detect calling these with -less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit -`bfd_vma''s. - - /* Byte swapping macros for user section data. */ - - #define bfd_put_8(abfd, val, ptr) \ - (*((unsigned char *)(ptr)) = (unsigned char)(val)) - #define bfd_put_signed_8 \ - bfd_put_8 - #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *)(ptr)) - #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) - - #define bfd_put_16(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) - #define bfd_put_signed_16 \ - bfd_put_16 - #define bfd_get_16(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx16, (ptr)) - #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - - #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx32, ((val),(ptr))) - #define bfd_put_signed_32 \ - bfd_put_32 - #define bfd_get_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx32, (ptr)) - #define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_32, (ptr)) - - #define bfd_put_64(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx64, ((val), (ptr))) - #define bfd_put_signed_64 \ - bfd_put_64 - #define bfd_get_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx64, (ptr)) - #define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) - -`bfd_h_put_size' -................ - - *Description* -These macros have the same function as their `bfd_get_x' bretheren, -except that they are used for removing information for the header -records of object files. Believe it or not, some object files keep -their header records in big endian order and their data in little -endian order. - - /* Byte swapping macros for file header data. */ - - #define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) - #define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - - #define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_h_putx16,(val,ptr)) - #define bfd_h_put_signed_16 \ - bfd_h_put_16 - #define bfd_h_get_16(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx16,(ptr)) - #define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr)) - - #define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_h_putx32,(val,ptr)) - #define bfd_h_put_signed_32 \ - bfd_h_put_32 - #define bfd_h_get_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx32,(ptr)) - #define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr)) - - #define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_h_putx64,(val, ptr)) - #define bfd_h_put_signed_64 \ - bfd_h_put_64 - #define bfd_h_get_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx64,(ptr)) - #define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) - -`bfd_log2' -.......... - - *Synopsis* - unsigned int bfd_log2(bfd_vma x); - *Description* -Return the log base 2 of the value supplied, rounded up. E.g., an X of -1025 returns 11. - - -File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end - -File caching -============ - - The file caching mechanism is embedded within BFD and allows the -application to open as many BFDs as it wants without regard to the -underlying operating system's file descriptor limit (often as low as 20 -open files). The module in `cache.c' maintains a least recently used -list of `BFD_CACHE_MAX_OPEN' files, and exports the name -`bfd_cache_lookup', which runs around and makes sure that the required -BFD is open. If not, then it chooses a file to close, closes it and -opens the one wanted, returning its file handle. - -`BFD_CACHE_MAX_OPEN macro' -.......................... - - *Description* -The maximum number of files which the cache will keep open at one time. - #define BFD_CACHE_MAX_OPEN 10 - -`bfd_last_cache' -................ - - *Synopsis* - extern bfd *bfd_last_cache; - *Description* -Zero, or a pointer to the topmost BFD on the chain. This is used by -the `bfd_cache_lookup' macro in `libbfd.h' to determine when it can -avoid a function call. - -`bfd_cache_lookup' -.................. - - *Description* -Check to see if the required BFD is the same as the last one looked up. -If so, then it can use the stream in the BFD with impunity, since it -can't have changed since the last lookup; otherwise, it has to perform -the complicated lookup function. - #define bfd_cache_lookup(x) \ - ((x)==bfd_last_cache? \ - (FILE*)(bfd_last_cache->iostream): \ - bfd_cache_lookup_worker(x)) - -`bfd_cache_init' -................ - - *Synopsis* - boolean bfd_cache_init (bfd *abfd); - *Description* -Add a newly opened BFD to the cache. - -`bfd_cache_close' -................. - - *Synopsis* - boolean bfd_cache_close (bfd *abfd); - *Description* -Remove the BFD ABFD from the cache. If the attached file is open, then -close it too. - - *Returns* -`false' is returned if closing the file fails, `true' is returned if -all is well. - -`bfd_open_file' -............... - - *Synopsis* - FILE* bfd_open_file(bfd *abfd); - *Description* -Call the OS to open a file for ABFD. Return the `FILE *' (possibly -`NULL') that results from this operation. Set up the BFD so that -future accesses know the file is open. If the `FILE *' returned is -`NULL', then it won't have been put in the cache, so it won't have to -be removed from it. - -`bfd_cache_lookup_worker' -......................... - - *Synopsis* - FILE *bfd_cache_lookup_worker(bfd *abfd); - *Description* -Called when the macro `bfd_cache_lookup' fails to find a quick answer. -Find a file descriptor for ABFD. If necessary, it open it. If there -are already more than `BFD_CACHE_MAX_OPEN' files open, it tries to -close one first, to avoid running out of file descriptors. - - -File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end - -Linker Functions -================ - - The linker uses three special entry points in the BFD target vector. -It is not necessary to write special routines for these entry points -when creating a new BFD back end, since generic versions are provided. -However, writing them can speed up linking and make it use -significantly less runtime memory. - - The first routine creates a hash table used by the other routines. -The second routine adds the symbols from an object file to the hash -table. The third routine takes all the object files and links them -together to create the output file. These routines are designed so -that the linker proper does not need to know anything about the symbols -in the object files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle the -details of symbols and relocs. - - The second routine and third routines are passed a pointer to a -`struct bfd_link_info' structure (defined in `bfdlink.h') which holds -information relevant to the link, including the linker hash table -(which was created by the first routine) and a set of callback -functions to the linker proper. - - The generic linker routines are in `linker.c', and use the header -file `genlink.h'. As of this writing, the only back ends which have -implemented versions of these routines are a.out (in `aoutx.h') and -ECOFF (in `ecoff.c'). The a.out routines are used as examples -throughout this section. - -* Menu: - -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: - - -File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions - -Creating a linker hash table ----------------------------- - - The linker routines must create a hash table, which must be derived -from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash -Tables:: for information on how to create a derived hash table. This -entry point is called using the target vector of the linker output file. - - The `_bfd_link_hash_table_create' entry point must allocate and -initialize an instance of the desired hash table. If the back end does -not require any additional information to be stored with the entries in -the hash table, the entry point may simply create a `struct -bfd_link_hash_table'. Most likely, however, some additional -information will be needed. - - For example, with each entry in the hash table the a.out linker -keeps the index the symbol has in the final output file (this index -number is used so that when doing a relocateable link the symbol index -used in the output file can be quickly filled in when copying over a -reloc). The a.out linker code defines the required structures and -functions for a hash table derived from `struct bfd_link_hash_table'. -The a.out linker hash table is created by the function -`NAME(aout,link_hash_table_create)'; it simply allocates space for the -hash table, initializes it, and returns a pointer to it. - - When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until you have -finished. You should simply create a new hash table which defines no -additional fields, and then simply add fields as they become necessary. - - -File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions - -Adding symbols to the hash table --------------------------------- - - The linker proper will call the `_bfd_link_add_symbols' entry point -for each object file or archive which is to be linked (typically these -are the files named on the command line, but some may also come from -the linker script). The entry point is responsible for examining the -file. For an object file, BFD must add any relevant symbol information -to the hash table. For an archive, BFD must determine which elements -of the archive should be used and adding them to the link. - - The a.out version of this entry point is -`NAME(aout,link_add_symbols)'. - -* Menu: - -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: - - -File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table - -Differing file formats -...................... - - Normally all the files involved in a link will be of the same -format, but it is also possible to link together different format -object files, and the back end must support that. The -`_bfd_link_add_symbols' entry point is called via the target vector of -the file to be added. This has an important consequence: the function -may not assume that the hash table is the type created by the -corresponding `_bfd_link_hash_table_create' vector. All the -`_bfd_link_add_symbols' function can assume about the hash table is -that it is derived from `struct bfd_link_hash_table'. - - Sometimes the `_bfd_link_add_symbols' function must store some -information in the hash table entry to be used by the `_bfd_final_link' -function. In such a case the `creator' field of the hash table must be -checked to make sure that the hash table was created by an object file -of the same format. - - The `_bfd_final_link' routine must be prepared to handle a hash -entry without any extra information added by the -`_bfd_link_add_symbols' function. A hash entry without extra -information will also occur when the linker script directs the linker -to create a symbol. Note that, regardless of how a hash table entry is -added, all the fields will be initialized to some sort of null value by -the hash table entry initialization function. - - See `ecoff_link_add_externals' for an example of how to check the -`creator' field before saving information (in this case, the ECOFF -external symbol debugging information) in a hash table entry. - - -File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table - -Adding symbols from an object file -.................................. - - When the `_bfd_link_add_symbols' routine is passed an object file, -it must add all externally visible symbols in that object file to the -hash table. The actual work of adding the symbol to the hash table is -normally handled by the function `_bfd_generic_link_add_one_symbol'. -The `_bfd_link_add_symbols' routine is responsible for reading all the -symbols from the object file and passing the correct information to -`_bfd_generic_link_add_one_symbol'. - - The `_bfd_link_add_symbols' routine should not use -`bfd_canonicalize_symtab' to read the symbols. The point of providing -this routine is to avoid the overhead of converting the symbols into -generic `asymbol' structures. - - `_bfd_generic_link_add_one_symbol' handles the details of combining -common symbols, warning about multiple definitions, and so forth. It -takes arguments which describe the symbol to add, notably symbol flags, -a section, and an offset. The symbol flags include such things as -`BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object -file, or something like `bfd_und_section_ptr' for an undefined symbol -or `bfd_com_section_ptr' for a common symbol. - - If the `_bfd_final_link' routine is also going to need to read the -symbol information, the `_bfd_link_add_symbols' routine should save it -somewhere attached to the object file BFD. However, the information -should only be saved if the `keep_memory' field of the `info' argument -is true, so that the `-no-keep-memory' linker switch is effective. - - The a.out function which adds symbols from an object file is -`aout_link_add_object_symbols', and most of the interesting work is in -`aout_link_add_symbols'. The latter saves pointers to the hash tables -entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol -number, so that the `_bfd_final_link' routine does not have to call the -hash table lookup routine to locate the entry. - diff --git a/gnu/dist/bfd/doc/bfd.info-5 b/gnu/dist/bfd/doc/bfd.info-5 deleted file mode 100644 index 79458a259478..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-5 +++ /dev/null @@ -1,663 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table - -Adding symbols from an archive -.............................. - - When the `_bfd_link_add_symbols' routine is passed an archive, it -must look through the symbols defined by the archive and decide which -elements of the archive should be included in the link. For each such -element it must call the `add_archive_element' linker callback, and it -must add the symbols from the object file to the linker hash table. - - In most cases the work of looking through the symbols in the archive -should be done by the `_bfd_generic_link_add_archive_symbols' function. -This function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which elements -should be included. `_bfd_generic_link_add_archive_symbols' is passed -a function to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the symbols to -the linker hash table. - - The function passed to `_bfd_generic_link_add_archive_symbols' must -read the symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to be -included, the `add_archive_element' linker callback routine must be -called with the element as an argument, and the elements symbols must -be added to the linker hash table just as though the element had itself -been passed to the `_bfd_link_add_symbols' function. - - When the a.out `_bfd_link_add_symbols' function receives an archive, -it calls `_bfd_generic_link_add_archive_symbols' passing -`aout_link_check_archive_element' as the function argument. -`aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. -If the latter decides to add the element (an element is only added if -it provides a real, non-common, definition for a previously undefined -or common symbol) it calls the `add_archive_element' callback and then -`aout_link_check_archive_element' calls `aout_link_add_symbols' to -actually add the symbols to the linker hash table. - - The ECOFF back end is unusual in that it does not normally call -`_bfd_generic_link_add_archive_symbols', because ECOFF archives already -contain a hash table of symbols. The ECOFF back end searches the -archive itself to avoid the overhead of creating a new hash table. - - -File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions - -Performing the final link -------------------------- - - When all the input files have been processed, the linker calls the -`_bfd_final_link' entry point of the output BFD. This routine is -responsible for producing the final output file, which has several -aspects. It must relocate the contents of the input sections and copy -the data into the output sections. It must build an output symbol -table including any local symbols from the input files and the global -symbols from the hash table. When producing relocateable output, it -must modify the input relocs and write them into the output file. -There may also be object format dependent work to be done. - - The linker will also call the `write_object_contents' entry point -when the BFD is closed. The two entry points must work together in -order to produce the correct output file. - - The details of how this works are inevitably dependent upon the -specific object file format. The a.out `_bfd_final_link' routine is -`NAME(aout,final_link)'. - -* Menu: - -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: - - -File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link - -Information provided by the linker -.................................. - - Before the linker calls the `_bfd_final_link' entry point, it sets -up some data structures for the function to use. - - The `input_bfds' field of the `bfd_link_info' structure will point -to a list of all the input files included in the link. These files are -linked through the `link_next' field of the `bfd' structure. - - Each section in the output file will have a list of `link_order' -structures attached to the `link_order_head' field (the `link_order' -structure is defined in `bfdlink.h'). These structures describe how to -create the contents of the output section in terms of the contents of -various input sections, fill constants, and, eventually, other types of -information. They also describe relocs that must be created by the BFD -backend, but do not correspond to any input file; this is used to -support -Ur, which builds constructors while generating a relocateable -object file. - - -File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link - -Relocating the section contents -............................... - - The `_bfd_final_link' function should look through the `link_order' -structures attached to each section of the output file. Each -`link_order' structure should either be handled specially, or it should -be passed to the function `_bfd_default_link_order' which will do the -right thing (`_bfd_default_link_order' is defined in `linker.c'). - - For efficiency, a `link_order' of type `bfd_indirect_link_order' -whose associated section belongs to a BFD of the same format as the -output BFD must be handled specially. This type of `link_order' -describes part of an output section in terms of a section belonging to -one of the input files. The `_bfd_final_link' function should read the -contents of the section and any associated relocs, apply the relocs to -the section contents, and write out the modified section contents. If -performing a relocateable link, the relocs themselves must also be -modified and written out. - - The functions `_bfd_relocate_contents' and -`_bfd_final_link_relocate' provide some general support for performing -the actual relocations, notably overflow checking. Their arguments -include information about the symbol the relocation is against and a -`reloc_howto_type' argument which describes the relocation to perform. -These functions are defined in `reloc.c'. - - The a.out function which handles reading, relocating, and writing -section contents is `aout_link_input_section'. The actual relocation -is done in `aout_link_input_section_std' and -`aout_link_input_section_ext'. - - -File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link - -Writing the symbol table -........................ - - The `_bfd_final_link' function must gather all the symbols in the -input files and write them out. It must also write out all the symbols -in the global hash table. This must be controlled by the `strip' and -`discard' fields of the `bfd_link_info' structure. - - The local symbols of the input files will not have been entered into -the linker hash table. The `_bfd_final_link' routine must consider -each input file and include the symbols in the output file. It may be -convenient to do this when looking through the `link_order' structures, -or it may be done by stepping through the `input_bfds' list. - - The `_bfd_final_link' routine must also traverse the global hash -table to gather all the externally visible symbols. It is possible -that most of the externally visible symbols may be written out when -considering the symbols of each input file, but it is still necessary -to traverse the hash table since the linker script may have defined -some symbols that are not in any of the input files. - - The `strip' field of the `bfd_link_info' structure controls which -symbols are written out. The possible values are listed in -`bfdlink.h'. If the value is `strip_some', then the `keep_hash' field -of the `bfd_link_info' structure is a hash table of symbols to keep; -each symbol should be looked up in this hash table, and only symbols -which are present should be included in the output file. - - If the `strip' field of the `bfd_link_info' structure permits local -symbols to be written out, the `discard' field is used to further -controls which local symbols are included in the output file. If the -value is `discard_l', then all local symbols which begin with a certain -prefix are discarded; this is controlled by the -`bfd_is_local_label_name' entry point. - - The a.out backend handles symbols by calling -`aout_link_write_symbols' on each input BFD and then traversing the -global hash table with the function `aout_link_write_other_symbol'. It -builds a string table while writing out the symbols, which is written -to the output file at the end of `NAME(aout,final_link)'. - -`bfd_link_split_section' -........................ - - *Synopsis* - boolean bfd_link_split_section(bfd *abfd, asection *sec); - *Description* -Return nonzero if SEC should be split during a reloceatable or final -link. - #define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - - -File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end - -Hash Tables -=========== - - BFD provides a simple set of hash table functions. Routines are -provided to initialize a hash table, to free a hash table, to look up a -string in a hash table and optionally create an entry for it, and to -traverse a hash table. There is currently no routine to delete an -string from a hash table. - - The basic hash table does not permit any data to be stored with a -string. However, a hash table is designed to present a base class from -which other types of hash tables may be derived. These derived types -may store additional information with the string. Hash tables were -implemented in this way, rather than simply providing a data pointer in -a hash table entry, because they were designed for use by the linker -back ends. The linker may create thousands of hash table entries, and -the overhead of allocating private data and storing and following -pointers becomes noticeable. - - The basic hash table code is in `hash.c'. - -* Menu: - -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: - - -File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables - -Creating and freeing a hash table ---------------------------------- - - To create a hash table, create an instance of a `struct -bfd_hash_table' (defined in `bfd.h') and call `bfd_hash_table_init' (if -you know approximately how many entries you will need, the function -`bfd_hash_table_init_n', which takes a SIZE argument, may be used). -`bfd_hash_table_init' returns `false' if some sort of error occurs. - - The function `bfd_hash_table_init' take as an argument a function to -use to create new entries. For a basic hash table, use the function -`bfd_hash_newfunc'. *Note Deriving a New Hash Table Type:: for why you -would want to use a different value for this argument. - - `bfd_hash_table_init' will create an objalloc which will be used to -allocate new entries. You may allocate memory on this objalloc using -`bfd_hash_allocate'. - - Use `bfd_hash_table_free' to free up all the memory that has been -allocated for a hash table. This will not free up the `struct -bfd_hash_table' itself, which you must provide. - - -File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables - -Looking up or entering a string -------------------------------- - - The function `bfd_hash_lookup' is used both to look up a string in -the hash table and to create a new entry. - - If the CREATE argument is `false', `bfd_hash_lookup' will look up a -string. If the string is found, it will returns a pointer to a `struct -bfd_hash_entry'. If the string is not found in the table -`bfd_hash_lookup' will return `NULL'. You should not modify any of the -fields in the returns `struct bfd_hash_entry'. - - If the CREATE argument is `true', the string will be entered into -the hash table if it is not already there. Either way a pointer to a -`struct bfd_hash_entry' will be returned, either to the existing -structure or to a newly created one. In this case, a `NULL' return -means that an error occurred. - - If the CREATE argument is `true', and a new entry is created, the -COPY argument is used to decide whether to copy the string onto the -hash table objalloc or not. If COPY is passed as `false', you must be -careful not to deallocate or modify the string as long as the hash table -exists. - - -File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables - -Traversing a hash table ------------------------ - - The function `bfd_hash_traverse' may be used to traverse a hash -table, calling a function on each element. The traversal is done in a -random order. - - `bfd_hash_traverse' takes as arguments a function and a generic -`void *' pointer. The function is called with a hash table entry (a -`struct bfd_hash_entry *') and the generic pointer passed to -`bfd_hash_traverse'. The function must return a `boolean' value, which -indicates whether to continue traversing the hash table. If the -function returns `false', `bfd_hash_traverse' will stop the traversal -and return immediately. - - -File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables - -Deriving a new hash table type ------------------------------- - - Many uses of hash tables want to store additional information which -each entry in the hash table. Some also find it convenient to store -additional information with the hash table itself. This may be done -using a derived hash table. - - Since C is not an object oriented language, creating a derived hash -table requires sticking together some boilerplate routines with a few -differences specific to the type of hash table you want to create. - - An example of a derived hash table is the linker hash table. The -structures for this are defined in `bfdlink.h'. The functions are in -`linker.c'. - - You may also derive a hash table from an already derived hash table. -For example, the a.out linker backend code uses a hash table derived -from the linker hash table. - -* Menu: - -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: - - -File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type - -Define the derived structures -............................. - - You must define a structure for an entry in the hash table, and a -structure for the hash table itself. - - The first field in the structure for an entry in the hash table must -be of the type used for an entry in the hash table you are deriving -from. If you are deriving from a basic hash table this is `struct -bfd_hash_entry', which is defined in `bfd.h'. The first field in the -structure for the hash table itself must be of the type of the hash -table you are deriving from itself. If you are deriving from a basic -hash table, this is `struct bfd_hash_table'. - - For example, the linker hash table defines `struct -bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of -type `struct bfd_hash_entry'. Similarly, the first field in `struct -bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. - - -File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type - -Write the derived creation routine -.................................. - - You must write a routine which will create and initialize an entry -in the hash table. This routine is passed as the function argument to -`bfd_hash_table_init'. - - In order to permit other hash tables to be derived from the hash -table you are creating, this routine must be written in a standard way. - - The first argument to the creation routine is a pointer to a hash -table entry. This may be `NULL', in which case the routine should -allocate the right amount of space. Otherwise the space has already -been allocated by a hash table type derived from this one. - - After allocating space, the creation routine must call the creation -routine of the hash table type it is derived from, passing in a pointer -to the space it just allocated. This will initialize any fields used -by the base hash table. - - Finally the creation routine must initialize any local fields for -the new hash table type. - - Here is a boilerplate example of a creation routine. FUNCTION_NAME -is the name of the routine. ENTRY_TYPE is the type of an entry in the -hash table you are creating. BASE_NEWFUNC is the name of the creation -routine of the hash table type your hash table is derived from. - - struct bfd_hash_entry * - FUNCTION_NAME (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; - { - struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == (ENTRY_TYPE *) NULL) - { - ret = ((ENTRY_TYPE *) - bfd_hash_allocate (table, sizeof (ENTRY_TYPE))); - if (ret == (ENTRY_TYPE *) NULL) - return NULL; - } - - /* Call the allocation method of the base class. */ - ret = ((ENTRY_TYPE *) - BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; - } - *Description* -The creation routine for the linker hash table, which is in `linker.c', -looks just like this example. FUNCTION_NAME is -`_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. -BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic -hash table. - - `_bfd_link_hash_newfunc' also initializes the local fields in a -linker hash table entry: `type', `written' and `next'. - - -File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type - -Write other derived routines -............................ - - You will want to write other routines for your new hash table, as -well. - - You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from and -initializes any other local fields. For the linker hash table, this is -`_bfd_link_hash_table_init' in `linker.c'. - - You will want a lookup routine which calls the lookup routine of the -hash table you are deriving from and casts the result. The linker hash -table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an -additional argument which it uses to decide how to return the looked up -value). - - You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses `bfd_link_hash_traverse' -in `linker.c'. - - These routines may simply be defined as macros. For example, the -a.out backend linker hash table, which is derived from the linker hash -table, uses macros for the lookup and traversal routines. These are -`aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. - - -File: bfd.info, Node: BFD back ends, Next: Index, Prev: BFD front end, Up: Top - -BFD back ends -************* - -* Menu: - -* What to Put Where:: -* aout :: a.out backends -* coff :: coff backends -* elf :: elf backends - - -File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends - - All of BFD lives in one directory. - - -File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends - -a.out backends -============== - - *Description* -BFD supports a number of different flavours of a.out format, though the -major differences are only the sizes of the structures on disk, and the -shape of the relocation information. - - The support is split into a basic support file `aoutx.h' and other -files which derive functions from the base. One derivation file is -`aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions -support for sun3, sun4, 386 and 29k a.out files, to create a target -jump vector for a specific target. - - This information is further split out into more specific files for -each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for -the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out -format. - - The base file `aoutx.h' defines general mechanisms for reading and -writing records to and from disk and various other methods which BFD -requires. It is included by `aout32.c' and `aout64.c' to form the names -`aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. - - As an example, this is what goes on to make the back end for a sun4, -from `aout32.c': - - #define ARCH_SIZE 32 - #include "aoutx.h" - - Which exports names: - - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... - - from `sunos.c': - - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" - - requires all the names from `aout32.c', and produces the jump vector - - sunos_big_vec - - The file `host-aout.c' is a special case. It is for a large set of -hosts that use "more or less standard" a.out files, and for which -cross-debugging is not interesting. It uses the standard 32-bit a.out -support routines, but determines the file offsets and addresses of the -text, data, and BSS sections, the machine architecture and machine -type, and the entry point address, in a host-dependent manner. Once -these values have been determined, generic code is used to handle the -object file. - - When porting it to run on a new system, you must supply: - - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR - - in the file `../include/sys/h-XXX.h' (for your host). These values, -plus the structures and macros defined in `a.out.h' on your host -system, will produce a BFD target that will access ordinary a.out files -on your host. To configure a new machine to use `host-aout.c', specify: - - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o - - in the `config/XXX.mt' file, and modify `configure.in' to use the -`XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration -is selected. - -Relocations ------------ - - *Description* -The file `aoutx.h' provides for both the *standard* and *extended* -forms of a.out relocation records. - - The standard records contain only an address, a symbol index, and a -type field. The extended records (used on 29ks and sparcs) also have a -full integer for an addend. - -Internal entry points ---------------------- - - *Description* -`aoutx.h' exports several routines for accessing the contents of an -a.out file, which are gathered and exported in turn by various format -specific files (eg sunos.c). - -`aout_SIZE_swap_exec_header_in' -............................... - - *Synopsis* - void aout_SIZE_swap_exec_header_in, - (bfd *abfd, - struct external_exec *raw_bytes, - struct internal_exec *execp); - *Description* -Swap the information in an executable header RAW_BYTES taken from a raw -byte stream memory image into the internal exec header structure EXECP. - -`aout_SIZE_swap_exec_header_out' -................................ - - *Synopsis* - void aout_SIZE_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); - *Description* -Swap the information in an internal exec header structure EXECP into -the buffer RAW_BYTES ready for writing to disk. - -`aout_SIZE_some_aout_object_p' -.............................. - - *Synopsis* - const bfd_target *aout_SIZE_some_aout_object_p - (bfd *abfd, - const bfd_target *(*callback_to_real_object_p)()); - *Description* -Some a.out variant thinks that the file open in ABFD checking is an -a.out file. Do some more checking, and set up for access if it really -is. Call back to the calling environment's "finish up" function just -before returning, to handle any last-minute setup. - -`aout_SIZE_mkobject' -.................... - - *Synopsis* - boolean aout_SIZE_mkobject, (bfd *abfd); - *Description* -Initialize BFD ABFD for use with a.out files. - -`aout_SIZE_machine_type' -........................ - - *Synopsis* - enum machine_type aout_SIZE_machine_type - (enum bfd_architecture arch, - unsigned long machine)); - *Description* -Keep track of machine architecture and machine type for a.out's. Return -the `machine_type' for a particular architecture and machine, or -`M_UNKNOWN' if that exact architecture and machine can't be represented -in a.out format. - - If the architecture is understood, machine type 0 (default) is -always understood. - -`aout_SIZE_set_arch_mach' -......................... - - *Synopsis* - boolean aout_SIZE_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine)); - *Description* -Set the architecture and the machine of the BFD ABFD to the values ARCH -and MACHINE. Verify that ABFD's format can support the architecture -required. - -`aout_SIZE_new_section_hook' -............................ - - *Synopsis* - boolean aout_SIZE_new_section_hook, - (bfd *abfd, - asection *newsect)); - *Description* -Called by the BFD in response to a `bfd_make_section' request. - diff --git a/gnu/dist/bfd/doc/bfd.info-6 b/gnu/dist/bfd/doc/bfd.info-6 deleted file mode 100644 index 936605a98cc6..000000000000 --- a/gnu/dist/bfd/doc/bfd.info-6 +++ /dev/null @@ -1,1040 +0,0 @@ -This is Info file bfd.info, produced by Makeinfo version 1.68 from the -input file bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends - -coff backends -============= - - BFD supports a number of different flavours of coff format. The -major differences between formats are the sizes and alignments of -fields in structures on disk, and the occasional extra field. - - Coff in all its varieties is implemented with a few common files and -a number of implementation specific files. For example, The 88k bcs -coff format is implemented in the file `coff-m88k.c'. This file -`#include's `coff/m88k.h' which defines the external structure of the -coff format for the 88k, and `coff/internal.h' which defines the -internal structure. `coff-m88k.c' also defines the relocations used by -the 88k format *Note Relocations::. - - The Intel i960 processor version of coff is implemented in -`coff-i960.c'. This file has the same structure as `coff-m88k.c', -except that it includes `coff/i960.h' rather than `coff-m88k.h'. - -Porting to a new version of coff --------------------------------- - - The recommended method is to select from the existing -implementations the version of coff which is most like the one you want -to use. For example, we'll say that i386 coff is the one you select, -and that your coff flavour is called foo. Copy `i386coff.c' to -`foocoff.c', copy `../include/coff/i386.h' to `../include/coff/foo.h', -and add the lines to `targets.c' and `Makefile.in' so that your new -back end is used. Alter the shapes of the structures in -`../include/coff/foo.h' so that they match what you need. You will -probably also have to add `#ifdef's to the code in `coff/internal.h' and -`coffcode.h' if your version of coff is too wild. - - You can verify that your new BFD backend works quite simply by -building `objdump' from the `binutils' directory, and making sure that -its version of what's going on and your host system's idea (assuming it -has the pretty standard coff dump utility, usually called `att-dump' or -just `dump') are the same. Then clean up your code, and send what -you've done to Cygnus. Then your stuff will be in the next release, and -you won't have to keep integrating it. - -How the coff backend works --------------------------- - -File layout -........... - - The Coff backend is split into generic routines that are applicable -to any Coff target and routines that are specific to a particular -target. The target-specific routines are further split into ones which -are basically the same for all Coff targets except that they use the -external symbol format or use different values for certain constants. - - The generic routines are in `coffgen.c'. These routines work for -any Coff target. They use some hooks into the target specific code; -the hooks are in a `bfd_coff_backend_data' structure, one of which -exists for each target. - - The essentially similar target-specific routines are in -`coffcode.h'. This header file includes executable C code. The -various Coff targets first include the appropriate Coff header file, -make any special defines that are needed, and then include `coffcode.h'. - - Some of the Coff targets then also have additional routines in the -target source file itself. - - For example, `coff-i960.c' includes `coff/internal.h' and -`coff/i960.h'. It then defines a few constants, such as `I960', and -includes `coffcode.h'. Since the i960 has complex relocation types, -`coff-i960.c' also includes some code to manipulate the i960 relocs. -This code is not in `coffcode.h' because it would not be used by any -other target. - -Bit twiddling -............. - - Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also an -internal description of the coff layout, in `coff/internal.h'. A major -function of the coff backend is swapping the bytes and twiddling the -bits to translate the external form of the structures into the normal -internal form. This is all performed in the `bfd_swap'_thing_direction -routines. Some elements are different sizes between different versions -of coff; it is the duty of the coff version specific include file to -override the definitions of various packing routines in `coffcode.h'. -E.g., the size of line number entry in coff is sometimes 16 bits, and -sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' -will select the correct one. No doubt, some day someone will find a -version of coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more `#defines'. -Three of the bit twiddling routines are exported to `gdb'; -`coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_linno_in'. `GDB' -reads the symbol table on its own, but uses BFD to fix things up. More -of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', -`coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', -`coff_swap_filehdr_out', `coff_swap_aouthdr_out', -`coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol -table and reloc drudgery itself, thereby saving the internal BFD -overhead, but uses BFD to swap things on the way out, making cross -ports much safer. Doing so also allows BFD (and thus the linker) to -use the same header files as `gas', which makes one avenue to disaster -disappear. - -Symbol reading -.............. - - The simple canonical form for symbols used by BFD is not rich enough -to keep all the information available in a coff symbol table. The back -end gets around this problem by keeping the original symbol table -around, "behind the scenes". - - When a symbol table is requested (through a call to -`bfd_canonicalize_symtab'), a request gets through to -`coff_get_normalized_symtab'. This reads the symbol table from the coff -file and swaps all the structures inside into the internal form. It -also fixes up all the pointers in the table (represented in the file by -offsets from the first symbol in the table) into physical pointers to -elements in the new internal table. This involves some work since the -meanings of fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment may be -the size in bytes of a structure at the next. Another pass is made -over the table. All symbols which mark file names (`C_FILE' symbols) -are modified so that the internal string points to the value in the -auxent (the real filename) rather than the normal text associated with -the symbol (`".file"'). - - At this time the symbol names are moved around. Coff stores all -symbols less than nine characters long physically within the symbol -table; longer strings are kept at the end of the file in the string -table. This pass moves all strings into memory and replaces them with -pointers to the strings. - - The symbol table is massaged once again, this time to create the -canonical table used by the BFD application. Each symbol is inspected -in turn, and a decision made (using the `sclass' field) about the -various flags to set in the `asymbol'. *Note Symbols::. The generated -canonical table shares strings with the hidden internal symbol table. - - Any linenumbers are read from the coff file too, and attached to the -symbols which own the functions the linenumbers belong to. - -Symbol writing -.............. - - Writing a symbol to a coff file which didn't come from a coff file -will lose any debugging information. The `asymbol' structure remembers -the BFD from which the symbol was taken, and on output the back end -makes sure that the same destination target as source target is present. - - When the symbols have come from a coff file then all the debugging -information is preserved. - - Symbol tables are provided for writing to the back end in a vector -of pointers to pointers. This allows applications like the linker to -accumulate and output large symbol tables without having to do too much -byte copying. - - This function runs through the provided symbol table and patches -each symbol marked as a file place holder (`C_FILE') to point to the -next file place holder in the list. It also marks each `offset' field -in the list with the offset from the first symbol of the current symbol. - - Another function of this procedure is to turn the canonical value -form of BFD into the form used by coff. Internally, BFD expects symbol -values to be offsets from a section base; so a symbol physically at -0x120, but in a section starting at 0x100, would have the value 0x20. -Coff expects symbols to contain their final value, so symbols have -their values changed at this point to reflect their sum with their -owning section. This transformation uses the `output_section' field of -the `asymbol''s `asection' *Note Sections::. - - * `coff_mangle_symbols' This routine runs though the provided symbol -table and uses the offsets generated by the previous pass and the -pointers generated when the symbol table was read in to create the -structured hierachy required by coff. It changes each pointer to a -symbol into the index into the symbol table of the asymbol. - - * `coff_write_symbols' This routine runs through the symbol table -and patches up the symbols from their internal form into the coff way, -calls the bit twiddlers, and writes out the table to the file. - -`coff_symbol_type' -.................. - - *Description* -The hidden information for an `asymbol' is described in a -`combined_entry_type': - - - typedef struct coff_ptr_struct - { - - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by - coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - - union { - union internal_auxent auxent; - struct internal_syment syment; - } u; - } combined_entry_type; - - - /* Each canonical asymbol really looks like this: */ - - typedef struct coff_symbol_struct - { - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - boolean done_lineno; - } coff_symbol_type; - -`bfd_coff_backend_data' -....................... - - Special entry points for gdb to swap in coff symbol table parts: - typedef struct - { - void (*_bfd_coff_swap_aux_in) PARAMS (( - bfd *abfd, - PTR ext, - int type, - int class, - int indaux, - int numaux, - PTR in)); - - void (*_bfd_coff_swap_sym_in) PARAMS (( - bfd *abfd , - PTR ext, - PTR in)); - - void (*_bfd_coff_swap_lineno_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - Special entry points for gas to swap out coff parts: - unsigned int (*_bfd_coff_swap_aux_out) PARAMS (( - bfd *abfd, - PTR in, - int type, - int class, - int indaux, - int numaux, - PTR ext)); - - unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( - bfd *abfd, - PTR in, - PTR ext)); - - unsigned int (*_bfd_coff_swap_lineno_out) PARAMS (( - bfd *abfd, - PTR in, - PTR ext)); - - unsigned int (*_bfd_coff_swap_reloc_out) PARAMS (( - bfd *abfd, - PTR src, - PTR dst)); - - unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - - unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - - unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS (( - bfd *abfd, - PTR in, - PTR out)); - Special entry points for generic COFF routines to call target -dependent COFF routines: - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - boolean _bfd_coff_long_filenames; - boolean _bfd_coff_long_section_names; - unsigned int _bfd_coff_default_section_alignment_power; - void (*_bfd_coff_swap_filehdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_aouthdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_scnhdr_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - void (*_bfd_coff_swap_reloc_in) PARAMS (( - bfd *abfd, - PTR ext, - PTR in)); - boolean (*_bfd_coff_bad_format_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr)); - boolean (*_bfd_coff_set_arch_mach_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr)); - PTR (*_bfd_coff_mkobject_hook) PARAMS (( - bfd *abfd, - PTR internal_filehdr, - PTR internal_aouthdr)); - flagword (*_bfd_styp_to_sec_flags_hook) PARAMS (( - bfd *abfd, - PTR internal_scnhdr, - const char *name)); - void (*_bfd_set_alignment_hook) PARAMS (( - bfd *abfd, - asection *sec, - PTR internal_scnhdr)); - boolean (*_bfd_coff_slurp_symbol_table) PARAMS (( - bfd *abfd)); - boolean (*_bfd_coff_symname_in_debug) PARAMS (( - bfd *abfd, - struct internal_syment *sym)); - boolean (*_bfd_coff_pointerize_aux_hook) PARAMS (( - bfd *abfd, - combined_entry_type *table_base, - combined_entry_type *symbol, - unsigned int indaux, - combined_entry_type *aux)); - boolean (*_bfd_coff_print_aux) PARAMS (( - bfd *abfd, - FILE *file, - combined_entry_type *table_base, - combined_entry_type *symbol, - combined_entry_type *aux, - unsigned int indaux)); - void (*_bfd_coff_reloc16_extra_cases) PARAMS (( - bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - arelent *reloc, - bfd_byte *data, - unsigned int *src_ptr, - unsigned int *dst_ptr)); - int (*_bfd_coff_reloc16_estimate) PARAMS (( - bfd *abfd, - asection *input_section, - arelent *r, - unsigned int shrink, - struct bfd_link_info *link_info)); - boolean (*_bfd_coff_sym_is_global) PARAMS (( - bfd *abfd, - struct internal_syment *)); - boolean (*_bfd_coff_compute_section_file_positions) PARAMS (( - bfd *abfd)); - boolean (*_bfd_coff_start_final_link) PARAMS (( - bfd *output_bfd, - struct bfd_link_info *info)); - boolean (*_bfd_coff_relocate_section) PARAMS (( - bfd *output_bfd, - struct bfd_link_info *info, - bfd *input_bfd, - asection *input_section, - bfd_byte *contents, - struct internal_reloc *relocs, - struct internal_syment *syms, - asection **sections)); - reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS (( - bfd *abfd, - asection *sec, - struct internal_reloc *rel, - struct coff_link_hash_entry *h, - struct internal_syment *sym, - bfd_vma *addendp)); - boolean (*_bfd_coff_adjust_symndx) PARAMS (( - bfd *obfd, - struct bfd_link_info *info, - bfd *ibfd, - asection *sec, - struct internal_reloc *reloc, - boolean *adjustedp)); - boolean (*_bfd_coff_link_add_one_symbol) PARAMS (( - struct bfd_link_info *info, - bfd *abfd, - const char *name, - flagword flags, - asection *section, - bfd_vma value, - const char *string, - boolean copy, - boolean collect, - struct bfd_link_hash_entry **hashp)); - - boolean (*_bfd_coff_link_output_has_begun) PARAMS (( - bfd * abfd )); - boolean (*_bfd_coff_final_link_postscript) PARAMS (( - bfd * abfd, - struct coff_final_link_info * pfinfo)); - - } bfd_coff_backend_data; - - #define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - - #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - - #define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - - #define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - - #define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - - #define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - - #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - - #define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - - #define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - - #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) - #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) - #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) - #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) - #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) - #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) - #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) - #define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames) - #define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) - #define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) - #define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - - #define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - - #define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - - #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) - #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) - - #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name)) - - #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - - #define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - - #define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - - #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - - #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - - #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - - #define bfd_coff_sym_is_global(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_sym_is_global)\ - (abfd, sym)) - - #define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - - #define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) - #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) - #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) - #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) - #define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - - #define bfd_coff_link_output_has_begun(a) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a)) - #define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) - -Writing relocations -................... - - To write relocations, the back end steps though the canonical -relocation table and create an `internal_reloc'. The symbol index to -use is removed from the `offset' field in the symbol table supplied. -The address comes directly from the sum of the section base address and -the relocation offset; the type is dug directly from the howto field. -Then the `internal_reloc' is swapped into the shape of an -`external_reloc' and written out to disk. - -Reading linenumbers -................... - - Creating the linenumber table is done by reading in the entire coff -linenumber table, and creating another table for internal use. - - A coff linenumber table is structured so that each function is -marked as having a line number of 0. Each line within the function is -an offset from the first line in the function. The base of the line -number information for the table is stored in the symbol associated -with the function. - - The information is copied from the external to the internal table, -and each symbol which marks a function is marked by pointing its... - - How does this work ? - -Reading relocations -................... - - Coff relocations are easily transformed into the internal BFD form -(`arelent'). - - Reading a coff relocation table is done in the following stages: - - * Read the entire coff relocation table into memory. - - * Process each relocation in turn; first swap it from the external - to the internal form. - - * Turn the symbol referenced in the relocation's symbol index into a - pointer into the canonical symbol table. This table is the same - as the one returned by a call to `bfd_canonicalize_symtab'. The - back end will call that routine and save the result if a - canonicalization hasn't been done. - - * The reloc index is turned into a pointer to a howto structure, in - a back end specific way. For instance, the 386 and 960 use the - `r_type' to directly produce an index into a howto table vector; - the 88k subtracts a number from the `r_type' field and creates an - addend field. - - -File: bfd.info, Node: elf, Prev: coff, Up: BFD back ends - -ELF backends -============ - - BFD support for ELF formats is being worked on. Currently, the best -supported back ends are for sparc and i386 (running svr4 or Solaris 2). - - Documentation of the internals of the support code still needs to be -written. The code is changing quickly enough that we haven't bothered -yet. - -`bfd_elf_find_section' -...................... - - *Synopsis* - struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); - *Description* -Helper functions for GDB to locate the string tables. Since BFD hides -string tables from callers, GDB needs to use an internal hook to find -them. Sun's .stabstr, in particular, isn't even pointed to by the -.stab section, so ordinary mechanisms wouldn't work to find it, even if -we had some. - - -File: bfd.info, Node: Index, Prev: BFD back ends, Up: Top - -Index -***** - -* Menu: - -* _bfd_final_link_relocate: Relocating the section contents. -* _bfd_generic_link_add_archive_symbols: Adding symbols from an archive. -* _bfd_generic_link_add_one_symbol: Adding symbols from an object file. -* _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table. -* _bfd_link_final_link in target vector: Performing the Final Link. -* _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table. -* _bfd_relocate_contents: Relocating the section contents. -* aout_SIZE_machine_type: aout. -* aout_SIZE_mkobject: aout. -* aout_SIZE_new_section_hook: aout. -* aout_SIZE_set_arch_mach: aout. -* aout_SIZE_some_aout_object_p: aout. -* aout_SIZE_swap_exec_header_in: aout. -* aout_SIZE_swap_exec_header_out: aout. -* arelent_chain: typedef arelent. -* BFD: Overview. -* BFD canonical format: Canonical format. -* bfd_alloc: Opening and Closing. -* bfd_arch_bits_per_address: Architectures. -* bfd_arch_bits_per_byte: Architectures. -* bfd_arch_get_compatible: Architectures. -* bfd_arch_list: Architectures. -* bfd_cache_close: File Caching. -* bfd_cache_init: File Caching. -* bfd_cache_lookup: File Caching. -* bfd_cache_lookup_worker: File Caching. -* BFD_CACHE_MAX_OPEN macro: File Caching. -* bfd_canonicalize_reloc: BFD front end. -* bfd_canonicalize_symtab: symbol handling functions. -* bfd_check_format: Formats. -* bfd_check_format_matches: Formats. -* bfd_check_overflow: typedef arelent. -* bfd_close: Opening and Closing. -* bfd_close_all_done: Opening and Closing. -* bfd_coff_backend_data: coff. -* bfd_copy_private_bfd_data: BFD front end. -* bfd_copy_private_section_data: section prototypes. -* bfd_copy_private_symbol_data: symbol handling functions. -* bfd_core_file_failing_command: Core Files. -* bfd_core_file_failing_signal: Core Files. -* bfd_create: Opening and Closing. -* bfd_decode_symclass: symbol handling functions. -* bfd_default_arch_struct: Architectures. -* bfd_default_compatible: Architectures. -* bfd_default_reloc_type_lookup: howto manager. -* bfd_default_scan: Architectures. -* bfd_default_set_arch_mach: Architectures. -* bfd_elf_find_section: elf. -* bfd_errmsg: BFD front end. -* bfd_fdopenr: Opening and Closing. -* bfd_find_target: bfd_target. -* bfd_format_string: Formats. -* bfd_generic_get_relocated_section_contents: howto manager. -* bfd_generic_relax_section: howto manager. -* bfd_get_arch: Architectures. -* bfd_get_arch_info: Architectures. -* bfd_get_error: BFD front end. -* bfd_get_error_handler: BFD front end. -* bfd_get_gp_size: BFD front end. -* bfd_get_mach: Architectures. -* bfd_get_mtime: BFD front end. -* bfd_get_next_mapent: Archives. -* bfd_get_reloc_code_name: howto manager. -* bfd_get_reloc_size: typedef arelent. -* bfd_get_reloc_upper_bound: BFD front end. -* bfd_get_section_by_name: section prototypes. -* bfd_get_section_contents: section prototypes. -* bfd_get_size <1>: BFD front end. -* bfd_get_size: Internal. -* bfd_get_symtab_upper_bound: symbol handling functions. -* bfd_h_put_size: Internal. -* bfd_hash_allocate: Creating and Freeing a Hash Table. -* bfd_hash_lookup: Looking Up or Entering a String. -* bfd_hash_newfunc: Creating and Freeing a Hash Table. -* bfd_hash_table_free: Creating and Freeing a Hash Table. -* bfd_hash_table_init: Creating and Freeing a Hash Table. -* bfd_hash_table_init_n: Creating and Freeing a Hash Table. -* bfd_hash_traverse: Traversing a Hash Table. -* bfd_init: Initialization. -* bfd_install_relocation: typedef arelent. -* bfd_is_local_label: symbol handling functions. -* bfd_is_local_label_name: symbol handling functions. -* bfd_last_cache: File Caching. -* bfd_link_split_section: Writing the symbol table. -* bfd_log2: Internal. -* bfd_lookup_arch: Architectures. -* bfd_make_debug_symbol: symbol handling functions. -* bfd_make_empty_symbol: symbol handling functions. -* bfd_make_section: section prototypes. -* bfd_make_section_anyway: section prototypes. -* bfd_make_section_old_way: section prototypes. -* bfd_map_over_sections: section prototypes. -* bfd_merge_private_bfd_data: BFD front end. -* bfd_open_file: File Caching. -* bfd_openr: Opening and Closing. -* bfd_openr_next_archived_file: Archives. -* bfd_openstreamr: Opening and Closing. -* bfd_openw: Opening and Closing. -* bfd_perform_relocation: typedef arelent. -* bfd_perror: BFD front end. -* bfd_print_symbol_vandf: symbol handling functions. -* bfd_printable_arch_mach: Architectures. -* bfd_printable_name: Architectures. -* bfd_put_size: Internal. -* BFD_RELOC_12_PCREL: howto manager. -* BFD_RELOC_14: howto manager. -* BFD_RELOC_16: howto manager. -* BFD_RELOC_16_BASEREL: howto manager. -* BFD_RELOC_16_GOT_PCREL: howto manager. -* BFD_RELOC_16_GOTOFF: howto manager. -* BFD_RELOC_16_PCREL: howto manager. -* BFD_RELOC_16_PCREL_S2: howto manager. -* BFD_RELOC_16_PLT_PCREL: howto manager. -* BFD_RELOC_16_PLTOFF: howto manager. -* BFD_RELOC_23_PCREL_S2: howto manager. -* BFD_RELOC_24: howto manager. -* BFD_RELOC_24_PCREL: howto manager. -* BFD_RELOC_24_PLT_PCREL: howto manager. -* BFD_RELOC_26: howto manager. -* BFD_RELOC_32: howto manager. -* BFD_RELOC_32_BASEREL: howto manager. -* BFD_RELOC_32_GOT_PCREL: howto manager. -* BFD_RELOC_32_GOTOFF: howto manager. -* BFD_RELOC_32_PCREL: howto manager. -* BFD_RELOC_32_PCREL_S2: howto manager. -* BFD_RELOC_32_PLT_PCREL: howto manager. -* BFD_RELOC_32_PLTOFF: howto manager. -* BFD_RELOC_386_COPY: howto manager. -* BFD_RELOC_386_GLOB_DAT: howto manager. -* BFD_RELOC_386_GOT32: howto manager. -* BFD_RELOC_386_GOTOFF: howto manager. -* BFD_RELOC_386_GOTPC: howto manager. -* BFD_RELOC_386_JUMP_SLOT: howto manager. -* BFD_RELOC_386_PLT32: howto manager. -* BFD_RELOC_386_RELATIVE: howto manager. -* BFD_RELOC_64: howto manager. -* BFD_RELOC_64_PCREL: howto manager. -* BFD_RELOC_68K_GLOB_DAT: howto manager. -* BFD_RELOC_68K_JMP_SLOT: howto manager. -* BFD_RELOC_68K_RELATIVE: howto manager. -* BFD_RELOC_8: howto manager. -* BFD_RELOC_8_BASEREL: howto manager. -* BFD_RELOC_8_FFnn: howto manager. -* BFD_RELOC_8_GOT_PCREL: howto manager. -* BFD_RELOC_8_GOTOFF: howto manager. -* BFD_RELOC_8_PCREL: howto manager. -* BFD_RELOC_8_PLT_PCREL: howto manager. -* BFD_RELOC_8_PLTOFF: howto manager. -* BFD_RELOC_ALPHA_CODEADDR: howto manager. -* BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. -* BFD_RELOC_ALPHA_GPDISP: howto manager. -* BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. -* BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. -* BFD_RELOC_ALPHA_HINT: howto manager. -* BFD_RELOC_ALPHA_LINKAGE: howto manager. -* BFD_RELOC_ALPHA_LITERAL: howto manager. -* BFD_RELOC_ALPHA_LITUSE: howto manager. -* BFD_RELOC_ARC_B22_PCREL: howto manager. -* BFD_RELOC_ARC_B26: howto manager. -* BFD_RELOC_ARM_ADR_IMM: howto manager. -* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. -* BFD_RELOC_ARM_HWLITERAL: howto manager. -* BFD_RELOC_ARM_IMMEDIATE: howto manager. -* BFD_RELOC_ARM_IN_POOL: howto manager. -* BFD_RELOC_ARM_LDR_IMM: howto manager. -* BFD_RELOC_ARM_LITERAL: howto manager. -* BFD_RELOC_ARM_MULTI: howto manager. -* BFD_RELOC_ARM_OFFSET_IMM: howto manager. -* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. -* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. -* BFD_RELOC_ARM_SHIFT_IMM: howto manager. -* BFD_RELOC_ARM_SWI: howto manager. -* BFD_RELOC_ARM_THUMB_ADD: howto manager. -* BFD_RELOC_ARM_THUMB_IMM: howto manager. -* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. -* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. -* bfd_reloc_code_type: howto manager. -* BFD_RELOC_CTOR: howto manager. -* BFD_RELOC_D10V_10_PCREL_L: howto manager. -* BFD_RELOC_D10V_10_PCREL_R: howto manager. -* BFD_RELOC_D10V_18: howto manager. -* BFD_RELOC_D10V_18_PCREL: howto manager. -* BFD_RELOC_GPREL16: howto manager. -* BFD_RELOC_GPREL32: howto manager. -* BFD_RELOC_HI16: howto manager. -* BFD_RELOC_HI16_BASEREL: howto manager. -* BFD_RELOC_HI16_GOTOFF: howto manager. -* BFD_RELOC_HI16_PLTOFF: howto manager. -* BFD_RELOC_HI16_S: howto manager. -* BFD_RELOC_HI16_S_BASEREL: howto manager. -* BFD_RELOC_HI16_S_GOTOFF: howto manager. -* BFD_RELOC_HI16_S_PLTOFF: howto manager. -* BFD_RELOC_HI22: howto manager. -* BFD_RELOC_I960_CALLJ: howto manager. -* BFD_RELOC_LO10: howto manager. -* BFD_RELOC_LO16: howto manager. -* BFD_RELOC_LO16_BASEREL: howto manager. -* BFD_RELOC_LO16_GOTOFF: howto manager. -* BFD_RELOC_LO16_PLTOFF: howto manager. -* BFD_RELOC_M32R_10_PCREL: howto manager. -* BFD_RELOC_M32R_18_PCREL: howto manager. -* BFD_RELOC_M32R_24: howto manager. -* BFD_RELOC_M32R_26_PCREL: howto manager. -* BFD_RELOC_M32R_HI16_SLO: howto manager. -* BFD_RELOC_M32R_HI16_ULO: howto manager. -* BFD_RELOC_M32R_LO16: howto manager. -* BFD_RELOC_M32R_SDA16: howto manager. -* BFD_RELOC_MIPS16_GPREL: howto manager. -* BFD_RELOC_MIPS16_JMP: howto manager. -* BFD_RELOC_MIPS_CALL16: howto manager. -* BFD_RELOC_MIPS_CALL_HI16: howto manager. -* BFD_RELOC_MIPS_CALL_LO16: howto manager. -* BFD_RELOC_MIPS_GOT16: howto manager. -* BFD_RELOC_MIPS_GOT_HI16: howto manager. -* BFD_RELOC_MIPS_GOT_LO16: howto manager. -* BFD_RELOC_MIPS_GPREL: howto manager. -* BFD_RELOC_MIPS_GPREL32: howto manager. -* BFD_RELOC_MIPS_JMP: howto manager. -* BFD_RELOC_MIPS_LITERAL: howto manager. -* BFD_RELOC_MN10300_16_PCREL: howto manager. -* BFD_RELOC_MN10300_32_PCREL: howto manager. -* BFD_RELOC_NONE: howto manager. -* BFD_RELOC_NS32K_DISP_16: howto manager. -* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. -* BFD_RELOC_NS32K_DISP_32: howto manager. -* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. -* BFD_RELOC_NS32K_DISP_8: howto manager. -* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. -* BFD_RELOC_NS32K_IMM_16: howto manager. -* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. -* BFD_RELOC_NS32K_IMM_32: howto manager. -* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. -* BFD_RELOC_NS32K_IMM_8: howto manager. -* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. -* BFD_RELOC_PCREL_HI16_S: howto manager. -* BFD_RELOC_PCREL_LO16: howto manager. -* BFD_RELOC_PPC_B16: howto manager. -* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. -* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. -* BFD_RELOC_PPC_B26: howto manager. -* BFD_RELOC_PPC_BA16: howto manager. -* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. -* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. -* BFD_RELOC_PPC_BA26: howto manager. -* BFD_RELOC_PPC_COPY: howto manager. -* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. -* BFD_RELOC_PPC_EMB_MRKREF: howto manager. -* BFD_RELOC_PPC_EMB_NADDR16: howto manager. -* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. -* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. -* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. -* BFD_RELOC_PPC_EMB_NADDR32: howto manager. -* BFD_RELOC_PPC_EMB_RELSDA: howto manager. -* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. -* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. -* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. -* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. -* BFD_RELOC_PPC_EMB_SDA21: howto manager. -* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. -* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. -* BFD_RELOC_PPC_EMB_SDAI16: howto manager. -* BFD_RELOC_PPC_GLOB_DAT: howto manager. -* BFD_RELOC_PPC_JMP_SLOT: howto manager. -* BFD_RELOC_PPC_LOCAL24PC: howto manager. -* BFD_RELOC_PPC_RELATIVE: howto manager. -* BFD_RELOC_PPC_TOC16: howto manager. -* BFD_RELOC_RVA: howto manager. -* BFD_RELOC_SH_ALIGN: howto manager. -* BFD_RELOC_SH_CODE: howto manager. -* BFD_RELOC_SH_COUNT: howto manager. -* BFD_RELOC_SH_DATA: howto manager. -* BFD_RELOC_SH_IMM4: howto manager. -* BFD_RELOC_SH_IMM4BY2: howto manager. -* BFD_RELOC_SH_IMM4BY4: howto manager. -* BFD_RELOC_SH_IMM8: howto manager. -* BFD_RELOC_SH_IMM8BY2: howto manager. -* BFD_RELOC_SH_IMM8BY4: howto manager. -* BFD_RELOC_SH_LABEL: howto manager. -* BFD_RELOC_SH_PCDISP12BY2: howto manager. -* BFD_RELOC_SH_PCDISP8BY2: howto manager. -* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. -* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. -* BFD_RELOC_SH_SWITCH16: howto manager. -* BFD_RELOC_SH_SWITCH32: howto manager. -* BFD_RELOC_SH_USES: howto manager. -* BFD_RELOC_SPARC13: howto manager. -* BFD_RELOC_SPARC22: howto manager. -* BFD_RELOC_SPARC_10: howto manager. -* BFD_RELOC_SPARC_11: howto manager. -* BFD_RELOC_SPARC_5: howto manager. -* BFD_RELOC_SPARC_6: howto manager. -* BFD_RELOC_SPARC_64: howto manager. -* BFD_RELOC_SPARC_7: howto manager. -* BFD_RELOC_SPARC_BASE13: howto manager. -* BFD_RELOC_SPARC_BASE22: howto manager. -* BFD_RELOC_SPARC_COPY: howto manager. -* BFD_RELOC_SPARC_DISP64: howto manager. -* BFD_RELOC_SPARC_GLOB_DAT: howto manager. -* BFD_RELOC_SPARC_GOT10: howto manager. -* BFD_RELOC_SPARC_GOT13: howto manager. -* BFD_RELOC_SPARC_GOT22: howto manager. -* BFD_RELOC_SPARC_H44: howto manager. -* BFD_RELOC_SPARC_HH22: howto manager. -* BFD_RELOC_SPARC_HIX22: howto manager. -* BFD_RELOC_SPARC_HM10: howto manager. -* BFD_RELOC_SPARC_JMP_SLOT: howto manager. -* BFD_RELOC_SPARC_L44: howto manager. -* BFD_RELOC_SPARC_LM22: howto manager. -* BFD_RELOC_SPARC_LOX10: howto manager. -* BFD_RELOC_SPARC_M44: howto manager. -* BFD_RELOC_SPARC_OLO10: howto manager. -* BFD_RELOC_SPARC_PC10: howto manager. -* BFD_RELOC_SPARC_PC22: howto manager. -* BFD_RELOC_SPARC_PC_HH22: howto manager. -* BFD_RELOC_SPARC_PC_HM10: howto manager. -* BFD_RELOC_SPARC_PC_LM22: howto manager. -* BFD_RELOC_SPARC_PLT64: howto manager. -* BFD_RELOC_SPARC_REGISTER: howto manager. -* BFD_RELOC_SPARC_RELATIVE: howto manager. -* BFD_RELOC_SPARC_UA32: howto manager. -* BFD_RELOC_SPARC_WDISP16: howto manager. -* BFD_RELOC_SPARC_WDISP19: howto manager. -* BFD_RELOC_SPARC_WDISP22: howto manager. -* BFD_RELOC_SPARC_WPLT30: howto manager. -* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. -* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. -* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. -* BFD_RELOC_TIC30_LDP: howto manager. -* bfd_reloc_type_lookup: howto manager. -* BFD_RELOC_V850_22_PCREL: howto manager. -* BFD_RELOC_V850_9_PCREL: howto manager. -* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. -* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. -* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. -* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. -* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. -* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. -* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. -* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. -* bfd_scan_arch: Architectures. -* bfd_scan_vma: BFD front end. -* bfd_set_arch_info: Architectures. -* bfd_set_archive_head: Archives. -* bfd_set_default_target: bfd_target. -* bfd_set_error: BFD front end. -* bfd_set_error_handler: BFD front end. -* bfd_set_error_program_name: BFD front end. -* bfd_set_file_flags: BFD front end. -* bfd_set_format: Formats. -* bfd_set_gp_size: BFD front end. -* bfd_set_private_flags: BFD front end. -* bfd_set_reloc: BFD front end. -* bfd_set_section_contents: section prototypes. -* bfd_set_section_flags: section prototypes. -* bfd_set_section_size: section prototypes. -* bfd_set_start_address: BFD front end. -* bfd_set_symtab: symbol handling functions. -* bfd_symbol_info: symbol handling functions. -* bfd_target_list: bfd_target. -* bfd_write_bigendian_4byte_int: Internal. -* coff_symbol_type: coff. -* core_file_matches_executable_p: Core Files. -* Hash tables: Hash Tables. -* internal object-file format: Canonical format. -* Linker: Linker Functions. -* stuff: BFD front end. -* target vector (_bfd_final_link): Performing the Final Link. -* target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. -* target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table. -* The HOWTO Macro: typedef arelent. -* what is it?: Overview. - - diff --git a/gnu/dist/bfd/doc/makefile.vms b/gnu/dist/bfd/doc/makefile.vms deleted file mode 100644 index a0857c0caafc..000000000000 --- a/gnu/dist/bfd/doc/makefile.vms +++ /dev/null @@ -1,5 +0,0 @@ -CFLAGS = /noopt/include=([],[-],[-.-.include]) -LDFLAGS = /nomap -LDLIBS = ,sys$$library:vaxcrtl.olb/lib - -all: chew.exe diff --git a/gnu/dist/bfd/makefile.dos b/gnu/dist/bfd/makefile.dos deleted file mode 100644 index 8a22c6af201f..000000000000 --- a/gnu/dist/bfd/makefile.dos +++ /dev/null @@ -1,49 +0,0 @@ -CFLAGS=-O2 - -.c.o : - gcc $(CFLAGS) -I. -I../include -c $< - -all : libbfd.a - -targets.o : targets.c - gcc $(CFLAGS) -I. -I../include -DSELECT_VECS=&go32coff_vec,&i386aout_vec -DDEFAULT_VECTOR=go32coff_vec -c $*.c - -archures.o : archures.c - gcc $(CFLAGS) -I. -I../include -DSELECT_ARCHITECTURES=bfd_i386_arch -c $*.c - -OBJS = \ - libbfd.o \ - opncls.o \ - bfd.o \ - archive.o \ - targets.o \ - cache.o \ - archures.o \ - corefile.o \ - section.o \ - format.o \ - syms.o \ - reloc.o \ - init.o \ - coffgen.o \ - srec.o \ - hash.o \ - linker.o \ - ecoff.o \ - ecofflink.o \ - elf.o \ - aout32.o \ - stab-sym.o \ - i386aout.o \ - cpu-i386.o \ - coff-go32.o \ - cofflink.o \ - elf32.o \ - binary.o \ - tekhex.o \ - $E - -libbfd.a : $(OBJS) - -rm libbfd.a - ar rvs libbfd.a $(OBJS) - ranlib libbfd.a diff --git a/gnu/dist/bfd/makefile.vms b/gnu/dist/bfd/makefile.vms deleted file mode 100644 index bc70bcd2f85e..000000000000 --- a/gnu/dist/bfd/makefile.vms +++ /dev/null @@ -1,57 +0,0 @@ -# -# Makefile for bfd library under openVMS/Alpha -# -# For use with gnu-make for vms -# -# Created by Klaus K"ampf, kkaempf@progis.de -# -# - -OBJS=archive.obj,archures.obj,bfd.obj,cache.obj,coffgen.obj,corefile.obj,format.obj,\ - init.obj,libbfd.obj,opncls.obj,reloc.obj,section.obj,syms.obj,targets.obj,\ - hash.obj,linker.obj,elf.obj,srec.obj,binary.obj,tekhex.obj,ihex.obj,stab-syms.obj,\ - evax-alpha.obj,evax-emh.obj,evax-egsd.obj,evax-etir.obj,evax-misc.obj,\ - cpu-alpha.obj - -ifeq ($(CC),gcc) -DEFS=/define=(SELECT_VECS="&evax_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch",\ -"HAVE_evax_alpha_vec=1") -CFLAGS=/include=([],[-.include])$(DEFS) -else -DEFS=/define=(DEFAULT_VECTOR="evax_alpha_vec",SELECT_VECS="&evax_alpha_vec",\ -SELECT_ARCHITECTURES="&bfd_alpha_arch","unlink=remove","const=",\ -"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ -"_bfd_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec") -CFLAGS=/noopt/debug/include=([],[-.include])$(DEFS)/warnings=disable=(missingreturn,implicitfunc) -endif - - -libbfd.olb: sysdep.h bfd.h $(OBJS) - purge - lib/create libbfd $(OBJS) - -sysdep.h: [.hosts]alphavms.h config.h - $(CP) $< $@ - -bfd.h: bfd-in2.h - $$ @configure - -targmatch.h: bfd.h -config.h: bfd.h - -evax-alpha.c: evax.h -evax-emh.c: evax.h -evax-egsd.c: evax.h -evax-etir.c: evax.h -evax-misc.c: evax.h -targets.c: targmatch.h - - -clean: - $$ purge - $(RM) libbfd.olb; - $(RM) sysdep.h; - $(RM) bfd.h; - $(RM) targmatch.h; - $(RM) config.h; - $(RM) *.obj; diff --git a/gnu/dist/bfd/mpw-config.in b/gnu/dist/bfd/mpw-config.in deleted file mode 100644 index 31addeebdcfb..000000000000 --- a/gnu/dist/bfd/mpw-config.in +++ /dev/null @@ -1,86 +0,0 @@ -# Configuration fragment for BFD. - -# This is almost always correct. - -Set selarchs "&bfd_{target_cpu}_arch" -Set defvec "" -Set selvecs "" -Set havevecs "" - -If "{target_canonical}" =~ /m68k-apple-macos/ - Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o' - Set defvec m68kcoff_vec - Set selvecs '&m68kcoff_vec' - Set havevecs '-d HAVE_m68kcoff_vec' - -Else If "{target_canonical}" =~ /powerpc-apple-macos/ - Set BFD_BACKENDS '"{o}"coff-pmac.c.o "{o}"xcofflink.c.o' - Set defvec pmac_xcoff_vec - Set selvecs '&pmac_xcoff_vec' - Set havevecs '-d HAVE_pmac_xcoff_vec' - Set selarchs "&bfd_powerpc_arch" - -Else If "{target_canonical}" =~ /i386-\Option-x-go32/ - Set BFD_BACKENDS '"{o}"coff-i386.c.o' - Set defvec i386coff_vec - Set selvecs '&i386coff_vec' - Set havevecs '-d HAVE_i386coff_vec' - -Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/ - Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o "{o}"elf32.c.o "{o}"elf32-mips.c.o "{o}"elflink.c.o' - Set defvec ecoff_big_vec - Set selvecs '&ecoff_big_vec,&ecoff_little_vec,&bfd_elf32_bigmips_vec' - Set havevecs '-d HAVE_ecoff_big_vec -d HAVE_ecoff_little_vec -d HAVE_bfd_elf32_bigmips_vec' - -Else If "{target_canonical}" =~ /sh-\Option-x-hms/ - Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o' - Set defvec shcoff_vec - Set selvecs '&shcoff_vec,&shlcoff_vec' - Set havevecs '-d HAVE_shcoff_vec -d HAVE_shlcoff_vec' -End If - -Set ta `echo {selarchs} | sed -e 's/&bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'` - -Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs} {havevecs}" - -Echo '# From mpw-config.in' > "{o}"mk.tmp -Echo 'WORDSIZE = 32' >> "{o}"mk.tmp -Echo 'BFD_MACHINES = ' {ta} >> "{o}"mk.tmp -Echo 'BFD_BACKENDS = ' {BFD_BACKENDS} >> "{o}"mk.tmp -Echo 'TDEFAULTS = ' {tdefaults} >> "{o}"mk.tmp -Echo 'HDEPFILES = ' >> "{o}"mk.tmp -Echo 'TDEPFILES = ' >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new -Echo '#include "mpw.h"' >> "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h - -# We can only handle 32-bit targets right now. - -sed -e 's/@WORDSIZE@/32/' \Option-d - -e 's/@wordsize@/32/' \Option-d - -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" \Option-d - -e 's/@BFD_HOST_64_BIT_DEFINED@/0/' \Option-d - -e 's/@BFD_HOST_64_BIT@//' \Option-d - -e 's/@BFD_HOST_U_64_BIT@//' \Option-d - -e 's/@BFD_HOST_64BIT_LONG@/0/' \Option-d - "{srcdir}"bfd-in2.h >"{o}"bfd.h-new - -MoveIfChange "{o}"bfd.h-new "{o}"bfd.h - -sed -e 's/NN/32/g' "{srcdir}"elfxx-target.h >"{o}"elf32-target.h-new -MoveIfChange "{o}"elf32-target.h-new "{o}"elf32-target.h - -# Pre-expand some macros in coffswap.h, so MPW C doesn't choke. - -sed -e 's/^ PUT_AOUTHDR_TSIZE (/ bfd_h_put_32 (/' \Option-d - -e 's/^ PUT_AOUTHDR_DSIZE (/ bfd_h_put_32 (/' \Option-d - -e 's/^ PUT_AOUTHDR_BSIZE (/ bfd_h_put_32 (/' \Option-d - -e 's/^ PUT_AOUTHDR_ENTRY (/ bfd_h_put_32 (/' \Option-d - -e 's/^ PUT_AOUTHDR_TEXT_START (/ bfd_h_put_32 (/' \Option-d - -e 's/^ PUT_AOUTHDR_DATA_START (/ bfd_h_put_32 (/' \Option-d - "{srcdir}"coffswap.h >"{o}"coffswap.h-new - -MoveIfChange "{o}"coffswap.h-new "{o}"coffswap.h diff --git a/gnu/dist/bfd/mpw-make.sed b/gnu/dist/bfd/mpw-make.sed deleted file mode 100644 index b2463c72b7f5..000000000000 --- a/gnu/dist/bfd/mpw-make.sed +++ /dev/null @@ -1,81 +0,0 @@ -# Sed commands to finish translating the Unix BFD Makefile into MPW syntax. - -# Whack out unused host and target define bits. -/HDEFINES/s/@HDEFINES@// -/TDEFINES/s/@TDEFINES@// - -# Fix pathnames to include directories. -/^INCDIR = /s/^INCDIR = .*$/INCDIR = "{topsrcdir}"include/ -/^CSEARCH = /s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/ - -# Comment out setting of vars, configure script will add these itself. -/^WORDSIZE =/s/^/#/ -# /^ALL_BACKENDS/s/^/#/ -/^BFD_BACKENDS/s/^/#/ -/^BFD_MACHINES/s/^/#/ -/^TDEFAULTS/s/^/#/ - -# Remove extra, useless, "all". -/^all \\Option-f _oldest/,/^$/d - -# Remove the Makefile rebuild rule. -/^Makefile /,/--recheck/d - -# Don't do any recursive subdir stuff. -/ subdir_do/s/{MAKE}/null-command/ - -/BFD_H/s/^{BFD_H}/#{BFD_H}/ - -# Add explicit srcdir paths to special files. -/config.bfd/s/ config.bfd/ "{s}"config.bfd/g -/targmatch.sed/s/ targmatch.sed/ "{s}"targmatch.sed/g - -# Point at include files that are always in the objdir. -/bfd/s/"{s}"bfd\.h/"{o}"bfd.h/g -/config/s/"{s}"config\.h/"{o}"config.h/g -/targmatch/s/"{s}"targmatch\.h/"{o}"targmatch.h/g -/targmatch/s/^targmatch\.h/"{o}"targmatch.h/ -/elf32-target/s/"{s}"elf32-target\.h/"{o}"elf32-target.h/g -/elf32-target/s/^elf32-target\.h/"{o}"elf32-target.h/ -/elf64-target/s/"{s}"elf64-target\.h/"{o}"elf64-target.h/g -/elf64-target/s/^elf64-target\.h/"{o}"elf64-target.h/ - -/"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g - -/dep/s/\.dep/__dep/g - -# Removing duplicates is cool but presently unnecessary, -# so whack this out. -/^ofiles \\Option-f/,/^$/d -/ofiles/s/{OFILES} ofiles/{OFILES}/ -/echo ofiles = /d -/cat ofiles/s/`cat ofiles`/{OFILES}/ - -# No corefile support. -/COREFILE/s/@COREFILE@// -/COREFLAG/s/@COREFLAG@// - -# No PIC foolery in this environment. -/@ALLLIBS@/s/@ALLLIBS@/{TARGETLIB}/ -/@PICLIST@/s/@PICLIST@// -/@PICFLAG@/s/@PICFLAG@// -/^{OFILES} \\Option-f stamp-picdir/,/^$/d - -# Remove the pic trickery from the default build rule. -/^\.c\.o \\Option-f /,/End If/c\ -.c.o \\Option-f .c - -# MPW Make doesn't know about $<. -/"{o}"targets.c.o \\Option-f "{s}"targets.c Makefile/,/^$/c\ -"{o}"targets.c.o \\Option-f "{s}"targets.c Makefile\ - {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"targets.c -o "{o}"targets.c.o - -/"{o}"archures.c.o \\Option-f "{s}"archures.c Makefile/,/^$/c\ -"{o}"archures.c.o \\Option-f "{s}"archures.c Makefile\ - {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"archures.c -o "{o}"archures.c.o - -# Remove the .h rebuilding rules, we don't currently have a doc subdir, -# or a way to build the prototype-hacking tool that's in it. -/^"{srcdir}"bfd-in2.h \\Option-f /,/^$/d -/^"{srcdir}"libbfd.h \\Option-f /,/^$/d -/^"{srcdir}"libcoff.h \\Option-f /,/^$/d diff --git a/gnu/dist/binutils/binutils.info b/gnu/dist/binutils/binutils.info deleted file mode 100644 index 823cdd29fd95..000000000000 --- a/gnu/dist/binutils/binutils.info +++ /dev/null @@ -1,57 +0,0 @@ -This is Info file binutils.info, produced by Makeinfo version 1.68 from -the input file binutils.texi. - -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities "ar", "objcopy", - "objdump", "nm", "nlmconv", "size", - "strings", "strip", and "ranlib". -END-INFO-DIR-ENTRY - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -Indirect: -binutils.info-1: 979 -binutils.info-2: 50570 - -Tag Table: -(Indirect) -Node: Top979 -Node: ar2061 -Node: ar cmdline4227 -Node: ar scripts11462 -Node: nm17143 -Node: objcopy23691 -Node: objdump34033 -Node: ranlib42320 -Node: size43054 -Node: strings45780 -Node: strip47605 -Node: c++filt50570 -Node: addr2line53131 -Node: nlmconv55528 -Node: windres58133 -Node: Selecting The Target System62605 -Node: Target Selection63622 -Node: Architecture Selection66322 -Node: Linker Emulation Selection67554 -Node: Reporting Bugs68432 -Node: Bug Criteria69183 -Node: Bug Reporting69729 -Node: Index76710 - -End Tag Table diff --git a/gnu/dist/binutils/binutils.info-1 b/gnu/dist/binutils/binutils.info-1 deleted file mode 100644 index 92fe7b8421c5..000000000000 --- a/gnu/dist/binutils/binutils.info-1 +++ /dev/null @@ -1,1374 +0,0 @@ -This is Info file binutils.info, produced by Makeinfo version 1.68 from -the input file binutils.texi. - -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities "ar", "objcopy", - "objdump", "nm", "nlmconv", "size", - "strings", "strip", and "ranlib". -END-INFO-DIR-ENTRY - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: binutils.info, Node: Top, Next: ar, Up: (dir) - -Introduction -************ - - This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.9.1): - -* Menu: - -* ar:: Create, modify, and extract from archives -* nm:: List symbols from object files -* objcopy:: Copy and translate object files -* objdump:: Display information from object files -* ranlib:: Generate index to archive contents -* size:: List section sizes and total size -* strings:: List printable strings from files -* strip:: Discard symbols -* c++filt:: Filter to demangle encoded C++ symbols -* addr2line:: Convert addresses to file and line -* nlmconv:: Converts object code into an NLM -* windres:: Manipulate Windows resources -* Selecting The Target System:: How these utilities determine the target. -* Reporting Bugs:: Reporting Bugs -* Index:: Index - - -File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top - -ar -** - - ar [-]P[MOD [RELPOS]] ARCHIVE [MEMBER...] - ar -M [ '), and continues executing even after errors. If you -redirect standard input to a script file, no prompts are issued, and -`ar' abandons execution (with a nonzero exit code) on any error. - - The `ar' command language is *not* designed to be equivalent to the -command-line options; in fact, it provides somewhat less control over -archives. The only purpose of the command language is to ease the -transition to GNU `ar' for developers who already have scripts written -for the MRI "librarian" program. - - The syntax for the `ar' command language is straightforward: - * commands are recognized in upper or lower case; for example, `LIST' - is the same as `list'. In the following descriptions, commands are - shown in upper case for clarity. - - * a single command may appear on each line; it is the first word on - the line. - - * empty lines are allowed, and have no effect. - - * comments are allowed; text after either of the characters `*' or - `;' is ignored. - - * Whenever you use a list of names as part of the argument to an `ar' - command, you can separate the individual names with either commas - or blanks. Commas are shown in the explanations below, for - clarity. - - * `+' is used as a line continuation character; if `+' appears at - the end of a line, the text on the following line is considered - part of the current command. - - Here are the commands you can use in `ar' scripts, or when using -`ar' interactively. Three of them have special significance: - - `OPEN' or `CREATE' specify a "current archive", which is a temporary -file required for most of the other commands. - - `SAVE' commits the changes so far specified by the script. Prior to -`SAVE', commands affect only the temporary copy of the current archive. - -`ADDLIB ARCHIVE' -`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' - Add all the contents of ARCHIVE (or, if specified, each named - MODULE from ARCHIVE) to the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`ADDMOD MEMBER, MEMBER, ... MEMBER' - Add each named MEMBER as a module in the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`CLEAR' - Discard the contents of the current archive, cancelling the effect - of any operations since the last `SAVE'. May be executed (with no - effect) even if no current archive is specified. - -`CREATE ARCHIVE' - Creates an archive, and makes it the current archive (required for - many other commands). The new archive is created with a temporary - name; it is not actually saved as ARCHIVE until you use `SAVE'. - You can overwrite existing archives; similarly, the contents of any - existing file named ARCHIVE will not be destroyed until `SAVE'. - -`DELETE MODULE, MODULE, ... MODULE' - Delete each listed MODULE from the current archive; equivalent to - `ar -d ARCHIVE MODULE ... MODULE'. - - Requires prior use of `OPEN' or `CREATE'. - -`DIRECTORY ARCHIVE (MODULE, ... MODULE)' -`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' - List each named MODULE present in ARCHIVE. The separate command - `VERBOSE' specifies the form of the output: when verbose output is - off, output is like that of `ar -t ARCHIVE MODULE...'. When - verbose output is on, the listing is like `ar -tv ARCHIVE - MODULE...'. - - Output normally goes to the standard output stream; however, if you - specify OUTPUTFILE as a final argument, `ar' directs the output to - that file. - -`END' - Exit from `ar', with a `0' exit code to indicate successful - completion. This command does not save the output file; if you - have changed the current archive since the last `SAVE' command, - those changes are lost. - -`EXTRACT MODULE, MODULE, ... MODULE' - Extract each named MODULE from the current archive, writing them - into the current directory as separate files. Equivalent to `ar -x - ARCHIVE MODULE...'. - - Requires prior use of `OPEN' or `CREATE'. - -`LIST' - Display full contents of the current archive, in "verbose" style - regardless of the state of `VERBOSE'. The effect is like `ar tv - ARCHIVE'). (This single command is a GNU `ld' enhancement, rather - than present for MRI compatibility.) - - Requires prior use of `OPEN' or `CREATE'. - -`OPEN ARCHIVE' - Opens an existing archive for use as the current archive (required - for many other commands). Any changes as the result of subsequent - commands will not actually affect ARCHIVE until you next use - `SAVE'. - -`REPLACE MODULE, MODULE, ... MODULE' - In the current archive, replace each existing MODULE (named in the - `REPLACE' arguments) from files in the current working directory. - To execute this command without errors, both the file, and the - module in the current archive, must exist. - - Requires prior use of `OPEN' or `CREATE'. - -`VERBOSE' - Toggle an internal flag governing the output from `DIRECTORY'. - When the flag is on, `DIRECTORY' output matches output from `ar - -tv '.... - -`SAVE' - Commit your changes to the current archive, and actually save it - as a file with the name specified in the last `CREATE' or `OPEN' - command. - - Requires prior use of `OPEN' or `CREATE'. - - -File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top - -nm -** - - nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle ] [ -D | --dynamic ] - [ -s | --print-armap ] [ -A | -o | --print-file-name ] - [ -n | -v | --numeric-sort ] [ -p | --no-sort ] - [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] - [ -t RADIX | --radix=RADIX ] [ -P | --portability ] - [ --target=BFDNAME ] [ -f FORMAT | --format=FORMAT ] - [ --defined-only ] [-l | --line-numbers ] - [ --no-demangle ] [ -V | --version ] [ --help ] [ OBJFILE... ] - - GNU `nm' lists the symbols from object files OBJFILE.... If no -object files are listed as arguments, `nm' assumes `a.out'. - - For each symbol, `nm' shows: - - * The symbol value, in the radix selected by options (see below), or - hexadecimal by default. - - * The symbol type. At least the following types are used; others - are, as well, depending on the object file format. If lowercase, - the symbol is local; if uppercase, the symbol is global (external). - - `A' - The symbol's value is absolute, and will not be changed by - further linking. - - `B' - The symbol is in the uninitialized data section (known as - BSS). - - `C' - The symbol is common. Common symbols are uninitialized data. - When linking, multiple common symbols may appear with the - same name. If the symbol is defined anywhere, the common - symbols are treated as undefined references. For more - details on common symbols, see the discussion of -warn-common - in *Note Linker options: (ld.info)Options. - - `D' - The symbol is in the initialized data section. - - `G' - The symbol is in an initialized data section for small - objects. Some object file formats permit more efficient - access to small data objects, such as a global int variable - as opposed to a large global array. - - `I' - The symbol is an indirect reference to another symbol. This - is a GNU extension to the a.out object file format which is - rarely used. - - `N' - The symbol is a debugging symbol. - - `R' - The symbol is in a read only data section. - - `S' - The symbol is in an uninitialized data section for small - objects. - - `T' - The symbol is in the text (code) section. - - `U' - The symbol is undefined. - - `W' - The symbol is weak. When a weak defined symbol is linked - with a normal defined symbol, the normal defined symbol is - used with no error. When a weak undefined symbol is linked - and the symbol is not defined, the value of the weak symbol - becomes zero with no error. - - `-' - The symbol is a stabs symbol in an a.out object file. In - this case, the next values printed are the stabs other field, - the stabs desc field, and the stab type. Stabs symbols are - used to hold debugging information; for more information, see - *Note Stabs: (stabs.info)Top. - - `?' - The symbol type is unknown, or object file format specific. - - * The symbol name. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-A' -`-o' -`--print-file-name' - Precede each symbol by the name of the input file (or archive - element) in which it was found, rather than identifying the input - file once only, before all of its symbols. - -`-a' -`--debug-syms' - Display all symbols, even debugger-only symbols; normally these - are not listed. - -`-B' - The same as `--format=bsd' (for compatibility with the MIPS `nm'). - -`-C' -`--demangle' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. - -`--no-demangle' - Do not demangle low-level symbol names. This is the default. - -`-D' -`--dynamic' - Display the dynamic symbols rather than the normal symbols. This - is only meaningful for dynamic objects, such as certain types of - shared libraries. - -`-f FORMAT' -`--format=FORMAT' - Use the output format FORMAT, which can be `bsd', `sysv', or - `posix'. The default is `bsd'. Only the first character of - FORMAT is significant; it can be either upper or lower case. - -`-g' -`--extern-only' - Display only external symbols. - -`-l' -`--line-numbers' - For each symbol, use debugging information to try to find a - filename and line number. For a defined symbol, look for the line - number of the address of the symbol. For an undefined symbol, - look for the line number of a relocation entry which refers to the - symbol. If line number information can be found, print it after - the other symbol information. - -`-n' -`-v' -`--numeric-sort' - Sort symbols numerically by their addresses, rather than - alphabetically by their names. - -`-p' -`--no-sort' - Do not bother to sort the symbols in any order; print them in the - order encountered. - -`-P' -`--portability' - Use the POSIX.2 standard output format instead of the default - format. Equivalent to `-f posix'. - -`-s' -`--print-armap' - When listing symbols from archive members, include the index: a - mapping (stored in the archive by `ar' or `ranlib') of which - modules contain definitions for which names. - -`-r' -`--reverse-sort' - Reverse the order of the sort (whether numeric or alphabetic); let - the last come first. - -`--size-sort' - Sort symbols by size. The size is computed as the difference - between the value of the symbol and the value of the symbol with - the next higher value. The size of the symbol is printed, rather - than the value. - -`-t RADIX' -`--radix=RADIX' - Use RADIX as the radix for printing the symbol values. It must be - `d' for decimal, `o' for octal, or `x' for hexadecimal. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-u' -`--undefined-only' - Display only undefined symbols (those external to each object - file). - -`--defined-only' - Display only defined symbols for each object file. - -`-V' -`--version' - Show the version number of `nm' and exit. - -`--help' - Show a summary of the options to `nm' and exit. - - -File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top - -objcopy -******* - - objcopy [ -F BFDNAME | --target=BFDNAME ] - [ -I BFDNAME | --input-target=BFDNAME ] - [ -O BFDNAME | --output-target=BFDNAME ] - [ -S | --strip-all ] [ -g | --strip-debug ] - [ -K SYMBOLNAME | --keep-symbol=SYMBOLNAME ] - [ -N SYMBOLNAME | --strip-symbol=SYMBOLNAME ] - [ -L SYMBOLNAME | --localize-symbol=SYMBOLNAME ] - [ -W SYMBOLNAME | --weaken-symbol=SYMBOLNAME ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -b BYTE | --byte=BYTE ] - [ -i INTERLEAVE | --interleave=INTERLEAVE ] - [ -R SECTIONNAME | --remove-section=SECTIONNAME ] - [ -p | --preserve-dates ] [ --debugging ] - [ --gap-fill=VAL ] [ --pad-to=ADDRESS ] - [ --set-start=VAL ] [ --adjust-start=INCR ] - [ --adjust-vma=INCR ] - [ --adjust-section-vma=SECTION{=,+,-}VAL ] - [ --adjust-warnings ] [ --no-adjust-warnings ] - [ --set-section-flags=SECTION=FLAGS ] - [ --add-section=SECTIONNAME=FILENAME ] - [ --change-leading-char ] [ --remove-leading-char ] - [ --weaken ] - [ -v | --verbose ] [ -V | --version ] [ --help ] - INFILE [OUTFILE] - - The GNU `objcopy' utility copies the contents of an object file to -another. `objcopy' uses the GNU BFD Library to read and write the -object files. It can write the destination object file in a format -different from that of the source object file. The exact behavior of -`objcopy' is controlled by command-line options. - - `objcopy' creates temporary files to do its translations and deletes -them afterward. `objcopy' uses BFD to do all its translation work; it -has access to all the formats described in BFD and thus is able to -recognize most formats without being told explicitly. *Note BFD: -(ld.info)BFD. - - `objcopy' can be used to generate S-records by using an output -target of `srec' (e.g., use `-O srec'). - - `objcopy' can be used to generate a raw binary file by using an -output target of `binary' (e.g., use `-O binary'). When `objcopy' -generates a raw binary file, it will essentially produce a memory dump -of the contents of the input object file. All symbols and relocation -information will be discarded. The memory dump will start at the load -address of the lowest section copied into the output file. - - When generating an S-record or a raw binary file, it may be helpful -to use `-S' to remove sections containing debugging information. In -some cases `-R' will be useful to remove sections which contain -information which is not needed by the binary file. - -`INFILE' -`OUTFILE' - The source and output files, respectively. If you do not specify - OUTFILE, `objcopy' creates a temporary file and destructively - renames the result with the name of INFILE. - -`-I BFDNAME' -`--input-target=BFDNAME' - Consider the source file's object format to be BFDNAME, rather than - attempting to deduce it. *Note Target Selection::, for more - information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Write the output file using the object format BFDNAME. *Note - Target Selection::, for more information. - -`-F BFDNAME' -`--target=BFDNAME' - Use BFDNAME as the object format for both the input and the output - file; i.e., simply transfer data from source to destination with no - translation. *Note Target Selection::, for more information. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-S' -`--strip-all' - Do not copy relocation and symbol information from the source file. - -`-g' -`--strip-debug' - Do not copy debugging symbols from the source file. - -`--strip-unneeded' - Strip all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - Copy only symbol SYMBOLNAME from the source file. This option may - be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file. This option - may be given more than once. - -`-L SYMBOLNAME' -`--localize-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME local to the file, so that it is not - visible externally. This option may be given more than once. - -`-W SYMBOLNAME' -`--weaken-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME weak. This option may be given more than - once. - -`-x' -`--discard-all' - Do not copy non-global symbols from the source file. - -`-X' -`--discard-locals' - Do not copy compiler-generated local symbols. (These usually - start with `L' or `.'.) - -`-b BYTE' -`--byte=BYTE' - Keep only every BYTEth byte of the input file (header data is not - affected). BYTE can be in the range from 0 to INTERLEAVE-1, where - INTERLEAVE is given by the `-i' or `--interleave' option, or the - default of 4. This option is useful for creating files to program - ROM. It is typically used with an `srec' output target. - -`-i INTERLEAVE' -`--interleave=INTERLEAVE' - Only copy one out of every INTERLEAVE bytes. Select which byte to - copy with the -B or `--byte' option. The default is 4. `objcopy' - ignores this option if you do not specify either `-b' or `--byte'. - -`-p' -`--preserve-dates' - Set the access and modification dates of the output file to be the - same as those of the input file. - -`--debugging' - Convert debugging information, if possible. This is not the - default because only certain debugging formats are supported, and - the conversion process can be time consuming. - -`--gap-fill VAL' - Fill gaps between sections with VAL. This operation applies to - the *load address* (LMA) of the sections. It is done by increasing - the size of the section with the lower address, and filling in the - extra space created with VAL. - -`--pad-to ADDRESS' - Pad the output file up to the load address ADDRESS. This is done - by increasing the size of the last section. The extra space is - filled in with the value specified by `--gap-fill' (default zero). - -`--set-start VAL' - Set the address of the new file to VAL. Not all object file - formats support setting the start address. - -`--adjust-start INCR' - Adjust the start address by adding INCR. Not all object file - formats support setting the start address. - -`--adjust-vma INCR' - Adjust the address of all sections, as well as the start address, - by adding INCR. Some object file formats do not permit section - addresses to be changed arbitrarily. Note that this does not - relocate the sections; if the program expects sections to be - loaded at a certain address, and this option is used to change the - sections such that they are loaded at a different address, the - program may fail. - -`--adjust-section-vma SECTION{=,+,-}VAL' - Set or adjust the address of the named SECTION. If `=' is used, - the section address is set to VAL. Otherwise, VAL is added to or - subtracted from the section address. See the comments under - `--adjust-vma', above. If SECTION does not exist in the input - file, a warning will be issued, unless `--no-adjust-warnings' is - used. - -`--adjust-warnings' - If `--adjust-section-vma' is used, and the named section does not - exist, issue a warning. This is the default. - -`--no-adjust-warnings' - Do not issue a warning if `--adjust-section-vma' is used, even if - the named section does not exist. - -`--set-section-flags SECTION=FLAGS' - Set the flags for the named section. The FLAGS argument is a - comma separated string of flag names. The recognized names are - `alloc', `contents', `load', `readonly', `code', `data', and - `rom'. You can set the `contents' flag for a section which does - not have contents, but it is not meaningful to clear the - `contents' flag of a section which does have contents-just remove - the section instead. Not all flags are meaningful for all object - file formats. - -`--add-section SECTIONNAME=FILENAME' - Add a new section named SECTIONNAME while copying the file. The - contents of the new section are taken from the file FILENAME. The - size of the section will be the size of the file. This option only - works on file formats which can support sections with arbitrary - names. - -`--change-leading-char' - Some object file formats use special characters at the start of - symbols. The most common such character is underscore, which - compilers often add before every symbol. This option tells - `objcopy' to change the leading character of every symbol when it - converts between object file formats. If the object file formats - use the same leading character, this option has no effect. - Otherwise, it will add a character, or remove a character, or - change a character, as appropriate. - -`--remove-leading-char' - If the first character of a global symbol is a special symbol - leading character used by the object file format, remove the - character. The most common symbol leading character is - underscore. This option will remove a leading underscore from all - global symbols. This can be useful if you want to link together - objects of different file formats with different conventions for - symbol names. This is different from `--change-leading-char' - because it always changes the symbol name when appropriate, - regardless of the object file format of the output file. - -`--weaken' - Change all global symbols in the file to be weak. This can be - useful when building an object which will be linked against other - objects using the `-R' option to the linker. This option is only - effective when using an object file format which supports weak - symbols. - -`-V' -`--version' - Show the version number of `objcopy'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `objcopy -V' lists all members of the archive. - -`--help' - Show a summary of the options to `objcopy'. - - -File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top - -objdump -******* - - objdump [ -a | --archive-headers ] - [ -b BFDNAME | --target=BFDNAME ] [ --debugging ] - [ -C | --demangle ] [ -d | --disassemble ] - [ -D | --disassemble-all ] [ --disassemble-zeroes ] - [ -EB | -EL | --endian={big | little } ] - [ -f | --file-headers ] - [ -h | --section-headers | --headers ] [ -i | --info ] - [ -j SECTION | --section=SECTION ] - [ -l | --line-numbers ] [ -S | --source ] - [ -m MACHINE | --architecture=MACHINE ] - [ -r | --reloc ] [ -R | --dynamic-reloc ] - [ -s | --full-contents ] [ --stabs ] - [ -t | --syms ] [ -T | --dynamic-syms ] [ -x | --all-headers ] - [ -w | --wide ] [ --start-address=ADDRESS ] - [ --stop-address=ADDRESS ] - [ --prefix-addresses] [ --[no-]show-raw-insn ] - [ --adjust-vma=OFFSET ] - [ --version ] [ --help ] - OBJFILE... - - `objdump' displays information about one or more object files. The -options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. - - OBJFILE... are the object files to be examined. When you specify -archives, `objdump' shows information on each of the member object -files. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides `-l' must be given. - -`-a' -`--archive-header' - If any of the OBJFILE files are archives, display the archive - header information (in a format similar to `ls -l'). Besides the - information you could list with `ar tv', `objdump -a' shows the - object file format of each archive member. - -`--adjust-vma=OFFSET' - When dumping information, first add OFFSET to all the section - addresses. This is useful if the section addresses do not - correspond to the symbol table, which can happen when putting - sections at particular addresses when using a format which can not - represent section addresses, such as a.out. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. This option may not be necessary; OBJDUMP can - automatically recognize many formats. - - For example, - objdump -b oasys -m vax -h fu.o - - displays summary information from the section headers (`-h') of - `fu.o', which is explicitly identified (`-m') as a VAX object file - in the format produced by Oasys compilers. You can list the - formats available with the `-i' option. *Note Target Selection::, - for more information. - -`-C' -`--demangle' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. - -`--debugging' - Display debugging information. This attempts to parse debugging - information stored in the file and print it out using a C like - syntax. Only certain types of debugging information have been - implemented. - -`-d' -`--disassemble' - Display the assembler mnemonics for the machine instructions from - OBJFILE. This option only disassembles those sections which are - expected to contain instructions. - -`-D' -`--disassemble-all' - Like `-d', but disassemble the contents of all sections, not just - those expected to contain instructions. - -`--prefix-addresses' - When disassembling, print the complete address on each line. This - is the older disassembly format. - -`--disassemble-zeroes' - Normally the disassembly output will skip blocks of zeroes. This - option directs the disassembler to disassemble those blocks, just - like any other data. - -`-EB' -`-EL' -`--endian={big|little}' - Specify the endianness of the object files. This only affects - disassembly. This can be useful when disassembling a file format - which does not describe endianness information, such as S-records. - -`-f' -`--file-header' - Display summary information from the overall header of each of the - OBJFILE files. - -`-h' -`--section-header' -`--header' - Display summary information from the section headers of the object - file. - - File segments may be relocated to nonstandard addresses, for - example by using the `-Ttext', `-Tdata', or `-Tbss' options to - `ld'. However, some object file formats, such as a.out, do not - store the starting address of the file segments. In those - situations, although `ld' relocates the sections correctly, using - `objdump -h' to list the file section headers cannot show the - correct addresses. Instead, it shows the usual addresses, which - are implicit for the target. - -`--help' - Print a summary of the options to `objdump' and exit. - -`-i' -`--info' - Display a list showing all architectures and object formats - available for specification with `-b' or `-m'. - -`-j NAME' -`--section=NAME' - Display information only for section NAME. - -`-l' -`--line-numbers' - Label the display (using debugging information) with the filename - and source line numbers corresponding to the object code or relocs - shown. Only useful with `-d', `-D', or `-r'. - -`-m MACHINE' -`--architecture=MACHINE' - Specify the architecture to use when disassembling object files. - This can be useful when disasembling object files which do not - describe architecture information, such as S-records. You can - list the available architectures with the `-i' option. - -`-r' -`--reloc' - Print the relocation entries of the file. If used with `-d' or - `-D', the relocations are printed interspersed with the - disassembly. - -`-R' -`--dynamic-reloc' - Print the dynamic relocation entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. - -`-s' -`--full-contents' - Display the full contents of any sections requested. - -`-S' -`--source' - Display source code intermixed with disassembly, if possible. - Implies `-d'. - -`--show-raw-insn' - When disassembling instructions, print the instruction in hex as - well as in symbolic form. This is the default except when - `--prefix-addresses' is used. - -`--no-show-raw-insn' - When disassembling instructions, do not print the instruction - bytes. This is the default when `--prefix-addresses' is used. - -`--stabs' - Display the full contents of any sections requested. Display the - contents of the .stab and .stab.index and .stab.excl sections from - an ELF file. This is only useful on systems (such as Solaris 2.0) - in which `.stab' debugging symbol-table entries are carried in an - ELF section. In most other file formats, debugging symbol-table - entries are interleaved with linkage symbols, and are visible in - the `--syms' output. For more information on stabs symbols, see - *Note Stabs: (stabs.info)Top. - -`--start-address=ADDRESS' - Start displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`--stop-address=ADDRESS' - Stop displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`-t' -`--syms' - Print the symbol table entries of the file. This is similar to - the information provided by the `nm' program. - -`-T' -`--dynamic-syms' - Print the dynamic symbol table entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. This is similar to the information provided by the `nm' - program when given the `-D' (`--dynamic') option. - -`--version' - Print the version number of `objdump' and exit. - -`-x' -`--all-header' - Display all available header information, including the symbol - table and relocation entries. Using `-x' is equivalent to - specifying all of `-a -f -h -r -t'. - -`-w' -`--wide' - Format some lines for output devices that have more than 80 - columns. - - -File: binutils.info, Node: ranlib, Next: size, Prev: objdump, Up: Top - -ranlib -****** - - ranlib [-vV] ARCHIVE - - `ranlib' generates an index to the contents of an archive and stores -it in the archive. The index lists each symbol defined by a member of -an archive that is a relocatable object file. - - You may use `nm -s' or `nm --print-armap' to list this index. - - An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. - - The GNU `ranlib' program is another form of GNU `ar'; running -`ranlib' is completely equivalent to executing `ar -s'. *Note ar::. - -`-v' -`-V' - Show the version number of `ranlib'. - - -File: binutils.info, Node: size, Next: strings, Prev: ranlib, Up: Top - -size -**** - - size [ -A | -B | --format=COMPATIBILITY ] - [ --help ] [ -d | -o | -x | --radix=NUMBER ] - [ --target=BFDNAME ] [ -V | --version ] - [ OBJFILE... ] - - The GNU `size' utility lists the section sizes--and the total -size--for each of the object or archive files OBJFILE in its argument -list. By default, one line of output is generated for each object file -or each module in an archive. - - OBJFILE... are the object files to be examined. If none are -specified, the file `a.out' will be used. - - The command line options have the following meanings: - -`-A' -`-B' -`--format=COMPATIBILITY' - Using one of these options, you can choose whether the output from - GNU `size' resembles output from System V `size' (using `-A', or - `--format=sysv'), or Berkeley `size' (using `-B', or - `--format=berkeley'). The default is the one-line format similar - to Berkeley's. - - Here is an example of the Berkeley (default) format of output from - `size': - size --format=Berkeley ranlib size - text data bss dec hex filename - 294880 81920 11592 388392 5ed28 ranlib - 294880 81920 11888 388688 5ee50 size - - This is the same data, but displayed closer to System V - conventions: - - size --format=SysV ranlib size - ranlib : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11592 385024 - Total 388392 - - - size : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11888 385024 - Total 388688 - -`--help' - Show a summary of acceptable arguments and options. - -`-d' -`-o' -`-x' -`--radix=NUMBER' - Using one of these options, you can control whether the size of - each section is given in decimal (`-d', or `--radix=10'); octal - (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). - In `--radix=NUMBER', only the three values (8, 10, 16) are - supported. The total size is always given in two radices; decimal - and hexadecimal for `-d' or `-x' output, or octal and hexadecimal - if you're using `-o'. - -`--target=BFDNAME' - Specify that the object-code format for OBJFILE is BFDNAME. This - option may not be necessary; `size' can automatically recognize - many formats. *Note Target Selection::, for more information. - -`-V' -`--version' - Display the version number of `size'. - - -File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top - -strings -******* - - strings [-afov] [-MIN-LEN] [-n MIN-LEN] [-t RADIX] [-] - [--all] [--print-file-name] [--bytes=MIN-LEN] - [--radix=RADIX] [--target=BFDNAME] - [--help] [--version] FILE... - - For each FILE given, GNU `strings' prints the printable character -sequences that are at least 4 characters long (or the number given with -the options below) and are followed by an unprintable character. By -default, it only prints the strings from the initialized and loaded -sections of object files; for other types of files, it prints the -strings from the whole file. - - `strings' is mainly useful for determining the contents of non-text -files. - -`-a' -`--all' -`-' - Do not scan only the initialized and loaded sections of object - files; scan the whole files. - -`-f' -`--print-file-name' - Print the name of the file before each string. - -`--help' - Print a summary of the program usage on the standard output and - exit. - -`-MIN-LEN' -`-n MIN-LEN' -`--bytes=MIN-LEN' - Print sequences of characters that are at least MIN-LEN characters - long, instead of the default 4. - -`-o' - Like `-t o'. Some other versions of `strings' have `-o' act like - `-t d' instead. Since we can not be compatible with both ways, we - simply chose one. - -`-t RADIX' -`--radix=RADIX' - Print the offset within the file before each string. The single - character argument specifies the radix of the offset--`o' for - octal, `x' for hexadecimal, or `d' for decimal. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-v' -`--version' - Print the program version number on the standard output and exit. - - -File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top - -strip -***** - - strip [ -F BFDNAME | --target=BFDNAME ] - [ -I BFDNAME | --input-target=BFDNAME ] - [ -O BFDNAME | --output-target=BFDNAME ] - [ -s | --strip-all ] [ -S | -g | --strip-debug ] - [ -K SYMBOLNAME | --keep-symbol=SYMBOLNAME ] - [ -N SYMBOLNAME | --strip-symbol=SYMBOLNAME ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -R SECTIONNAME | --remove-section=SECTIONNAME ] - [ -o FILE ] [ -p | --preserve-dates ] - [ -v | --verbose ] [ -V | --version ] [ --help ] - OBJFILE... - - GNU `strip' discards all symbols from object files OBJFILE. The -list of object files may include archives. At least one object file -must be given. - - `strip' modifies the files named in its argument, rather than -writing modified copies under different names. - -`-F BFDNAME' -`--target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME, and rewrite it in the same format. *Note Target - Selection::, for more information. - -`--help' - Show a summary of the options to `strip' and exit. - -`-I BFDNAME' -`--input-target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME. *Note Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Replace OBJFILE with a file in the output format BFDNAME. *Note - Target Selection::, for more information. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-s' -`--strip-all' - Remove all symbols. - -`-g' -`-S' -`--strip-debug' - Remove debugging symbols only. - -`--strip-unneeded' - Remove all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - Keep only symbol SYMBOLNAME from the source file. This option may - be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Remove symbol SYMBOLNAME from the source file. This option may be - given more than once, and may be combined with strip options other - than `-K'. - -`-o FILE' - Put the stripped output in FILE, rather than replacing the - existing file. When this argument is used, only one OBJFILE - argument may be specified. - -`-p' -`--preserve-dates' - Preserve the access and modification dates of the file. - -`-x' -`--discard-all' - Remove non-global symbols. - -`-X' -`--discard-locals' - Remove compiler-generated local symbols. (These usually start - with `L' or `.'.) - -`-V' -`--version' - Show the version number for `strip'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `strip -v' lists all members of the archive. - diff --git a/gnu/dist/binutils/binutils.info-2 b/gnu/dist/binutils/binutils.info-2 deleted file mode 100644 index e1a9ec443f5e..000000000000 --- a/gnu/dist/binutils/binutils.info-2 +++ /dev/null @@ -1,891 +0,0 @@ -This is Info file binutils.info, produced by Makeinfo version 1.68 from -the input file binutils.texi. - -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities "ar", "objcopy", - "objdump", "nm", "nlmconv", "size", - "strings", "strip", and "ranlib". -END-INFO-DIR-ENTRY - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top - -c++filt -******* - - c++filt [ -_ | --strip-underscores ] - [ -n | --no-strip-underscores ] - [ -s FORMAT | --format=FORMAT ] - [ --help ] [ --version ] [ SYMBOL... ] - - The C++ language provides function overloading, which means that you -can write many functions with the same name (providing each takes -parameters of different types). All C++ function names are encoded -into a low-level assembly label (this process is known as "mangling"). -The `c++filt' program does the inverse mapping: it decodes -("demangles") low-level names into user-level names so that the linker -can keep these overloaded functions from clashing. - - Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential label. If the -label decodes into a C++ name, the C++ name replaces the low-level name -in the output. - - You can use `c++filt' to decipher individual symbols: - - c++filt SYMBOL - - If no SYMBOL arguments are given, `c++filt' reads symbol names from -the standard input and writes the demangled names to the standard -output. All results are printed on the standard output. - -`-_' -`--strip-underscores' - On some systems, both the C and C++ compilers put an underscore in - front of every name. For example, the C name `foo' gets the - low-level name `_foo'. This option removes the initial - underscore. Whether `c++filt' removes the underscore by default - is target dependent. - -`-n' -`--no-strip-underscores' - Do not remove the initial underscore. - -`-s FORMAT' -`--format=FORMAT' - GNU `nm' can decode three different methods of mangling, used by - different C++ compilers. The argument to this option selects which - method it uses: - - `gnu' - the one used by the GNU compiler (the default method) - - `lucid' - the one used by the Lucid compiler - - `arm' - the one specified by the C++ Annotated Reference Manual - -`--help' - Print a summary of the options to `c++filt' and exit. - -`--version' - Print the version number of `c++filt' and exit. - - *Warning:* `c++filt' is a new utility, and the details of its user - interface are subject to change in future releases. In particular, - a command-line option may be required in the the future to decode - a name passed as an argument on the command line; in other words, - - c++filt SYMBOL - - may in a future release become - - c++filt OPTION SYMBOL - - -File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top - -addr2line -********* - - addr2line [ -b BFDNAME | --target=BFDNAME ] - [ -C | --demangle ] - [ -e FILENAME | --exe=FILENAME ] - [ -f | --functions ] [ -s | --basename ] - [ -H | --help ] [ -V | --version ] - [ addr addr ... ] - - `addr2line' translates program addresses into file names and line -numbers. Given an address and an executable, it uses the debugging -information in the executable to figure out which file name and line -number are associated with a given address. - - The executable to use is specified with the `-e' option. The -default is `a.out'. - - `addr2line' has two modes of operation. - - In the first, hexadecimal addresses are specified on the command -line, and `addr2line' displays the file name and line number for each -address. - - In the second, `addr2line' reads hexadecimal addresses from standard -input, and prints the file name and line number for each address on -standard output. In this mode, `addr2line' may be used in a pipe to -convert dynamically chosen addresses. - - The format of the output is `FILENAME:LINENO'. The file name and -line number for each address is printed on a separate line. If the -`-f' option is used, then each `FILENAME:LINENO' line is preceded by a -`FUNCTIONNAME' line which is the name of the function containing the -address. - - If the file name or function name can not be determined, `addr2line' -will print two question marks in their place. If the line number can -not be determined, `addr2line' will print 0. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. - -`-C' -`--demangle' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. - -`-e FILENAME' -`--exe=FILENAME' - Specify the name of the executable for which addresses should be - translated. The default file is `a.out'. - -`-f' -`--functions' - Display function names as well as file and line number information. - -`-s' -`--basenames' - Display only the base of each file name. - - -File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top - -nlmconv -******* - - `nlmconv' converts a relocatable object file into a NetWare Loadable -Module. - - *Warning:* `nlmconv' is not always built as part of the binary - utilities, since it is only useful for NLM targets. - - nlmconv [ -I BFDNAME | --input-target=BFDNAME ] - [ -O BFDNAME | --output-target=BFDNAME ] - [ -T HEADERFILE | --header-file=HEADERFILE ] - [ -d | --debug] [ -l LINKER | --linker=LINKER ] - [ -h | --help ] [ -V | --version ] - INFILE OUTFILE - - `nlmconv' converts the relocatable `i386' object file INFILE into -the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for -NLM header information. For instructions on writing the NLM command -file language used in header files, see the `linkers' section, -`NLMLINK' in particular, of the `NLM Development and Tools Overview', -which is part of the NLM Software Developer's Kit ("NLM SDK"), -available from Novell, Inc. `nlmconv' uses the GNU Binary File -Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for -more information. - - `nlmconv' can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, `nlmconv' calls the linker for you. - -`-I BFDNAME' -`--input-target=BFDNAME' - Object format of the input file. `nlmconv' can usually determine - the format of a given file (so no default is necessary). *Note - Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Object format of the output file. `nlmconv' infers the output - format based on the input format, e.g. for a `i386' input file the - output format is `nlm32-i386'. *Note Target Selection::, for more - information. - -`-T HEADERFILE' -`--header-file=HEADERFILE' - Reads HEADERFILE for NLM header information. For instructions on - writing the NLM command file language used in header files, see - see the `linkers' section, of the `NLM Development and Tools - Overview', which is part of the NLM Software Developer's Kit, - available from Novell, Inc. - -`-d' -`--debug' - Displays (on standard error) the linker command line used by - `nlmconv'. - -`-l LINKER' -`--linker=LINKER' - Use LINKER for any linking. LINKER can be an abosolute or a - relative pathname. - -`-h' -`--help' - Prints a usage summary. - -`-V' -`--version' - Prints the version number for `nlmconv'. - - -File: binutils.info, Node: windres, Next: Selecting The Target System, Prev: nlmconv, Up: Top - -windres -******* - - `windres' may be used to manipulate Windows resources. - - *Warning:* `windres' is not always built as part of the binary - utilities, since it is only useful for Windows targets. - - windres [options] [input-file] [output-file] - - `windres' reads resources from an input file and copies them into an -output file. Either file may be in one of three formats: - -`rc' - A text format read by the Resource Compiler. - -`res' - A binary format generated by the Resource Compiler. - -`coff' - A COFF object or executable. - - The exact description of these different formats is available in -documentation from Microsoft. - - When `windres' converts from the `rc' format to the `res' format, it -is acting like the Windows Resource Compiler. When `windres' converts -from the `res' format to the `coff' format, it is acting like the -Windows `CVTRES' program. - - When `windres' generates an `rc' file, the output is similar but not -identical to the format expected for the input. When an input `rc' -file refers to an external filename, an output `rc' file will instead -include the file contents. - - If the input or output format is not specified, `windres' will guess -based on the file name, or, for the input file, the file contents. A -file with an extension of `.rc' will be treated as an `rc' file, a file -with an extension of `.res' will be treated as a `res' file, and a file -with an extension of `.o' or `.exe' will be treated as a `coff' file. - - If no output file is specified, `windres' will print the resources -in `rc' format to standard output. - - The normal use is for you to write an `rc' file, use `windres' to -convert it to a COFF object file, and then link the COFF file into your -application. This will make the resources described in the `rc' file -available to Windows. - -`-i FILENAME' -`--input FILENAME' - The name of the input file. If this option is not used, then - `windres' will use the first non-option argument as the input file - name. If there are no non-option arguments, then `windres' will - read from standard input. `windres' can not read a COFF file from - standard input. - -`-o FILENAME' -`--output FILENAME' - The name of the output file. If this option is not used, then - `windres' will use the first non-option argument, after any used - for the input file name, as the output file name. If there is no - non-option argument, then `windres' will write to standard output. - `windres' can not write a COFF file to standard output. - -`-I FORMAT' -`--input-format FORMAT' - The input format to read. FORMAT may be `res', `rc', or `coff'. - If no input format is specified, `windres' will guess, as - described above. - -`-O FORMAT' -`--output-format FORMAT' - The output format to generate. FORMAT may be `res', `rc', or - `coff'. If no output format is specified, `windres' will guess, - as described above. - -`-F TARGET' -`--target TARGET' - Specify the BFD format to use for a COFF file as input or output. - This is a BFD target name; you can use the `--help' option to see - a list of supported targets. Normally `windres' will use the - default format, which is the first one listed by the `--help' - option. *Note Target Selection::. - -`--preprocessor PROGRAM' - When `windres' reads an `rc' file, it runs it through the C - preprocessor first. This option may be used to specify the - preprocessor to use, including any leading arguments. The default - preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'. - -`--include-dir DIRECTORY' - Specify an include directory to use when reading an `rc' file. - `windres' will pass this to the preprocessor as an `-I' option. - `windres' will also search this directory when looking for files - named in the `rc' file. - -`--define SYM[=VAL]' - Specify a `-D' option to pass to the preprocessor when reading an - `rc' file. - -`--language VAL' - Specify the default language to use when reading an `rc' file. - VAL should be a hexadecimal language code. The low eight bits are - the language, and the high eight bits are the sublanguage. - -`--help' - Prints a usage summary. - -`--version' - Prints the version number for `windres'. - -`--yydebug' - If `windres' is compiled with `YYDEBUG' defined as `1', this will - turn on parser debugging. - - -File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: windres, Up: Top - -Selecting the target system -*************************** - - You can specify three aspects of the target system to the GNU binary -file utilities, each in several ways: - - * the target - - * the architecture - - * the linker emulation (which applies to the linker only) - - In the following summaries, the lists of ways to specify values are -in order of decreasing precedence. The ways listed first override those -listed later. - - The commands to list valid values only list the values for which the -programs you are running were configured. If they were configured with -`--enable-targets=all', the commands list most of the available values, -but a few are left out; not all targets can be configured in at once -because some of them can only be configured "native" (on hosts with the -same type as the target system). - -* Menu: - -* Target Selection:: -* Architecture Selection:: -* Linker Emulation Selection:: - - -File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System - -Target Selection -================ - - A "target" is an object file format. A given target may be -supported for multiple architectures (*note Architecture Selection::.). -A target selection may also have variations for different operating -systems or architectures. - - The command to list valid target values is `objdump -i' (the first -column of output contains the relevant information). - - Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', -`a.out-sunos-big'. - - You can also specify a target using a configuration triplet. This is -the same sort of name that is passed to configure to specify a target. -When you use a configuration triplet as an argument, it must be fully -canonicalized. You can see the canonical version of a triplet by -running the shell script `config.sub' which is included with the -sources. - - Some sample configuration triplets are: `m68k-hp-bsd', -`mips-dec-ultrix', `sparc-sun-sunos'. - -`objdump' Target ----------------- - - Ways to specify: - - 1. command line option: `-b' or `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Input Target ----------------------------------- - - Ways to specify: - - 1. command line options: `-I' or `--input-target', or `-F' or - `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Output Target ------------------------------------ - - Ways to specify: - - 1. command line options: `-O' or `--output-target', or `-F' or - `--target' - - 2. the input target (see "`objcopy' and `strip' Input Target" above) - - 3. environment variable `GNUTARGET' - - 4. deduced from the input file - -`nm', `size', and `strings' Target ----------------------------------- - - Ways to specify: - - 1. command line option: `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -Linker Input Target -------------------- - - Ways to specify: - - 1. command line option: `-b' or `--format' (*note Options: - (ld.info)Options.) - - 2. script command `TARGET' (*note Option Commands: (ld.info)Option - Commands.) - - 3. environment variable `GNUTARGET' (*note Environment: - (ld.info)Environment.) - - 4. the default target of the selected linker emulation (*note Linker - Emulation Selection::.) - -Linker Output Target --------------------- - - Ways to specify: - - 1. command line option: `-oformat' (*note Options: (ld.info)Options.) - - 2. script command `OUTPUT_FORMAT' (*note Option Commands: - (ld.info)Option Commands.) - - 3. the linker input target (see "Linker Input Target" above) - - -File: binutils.info, Node: Architecture Selection, Next: Linker Emulation Selection, Prev: Target Selection, Up: Selecting The Target System - -Architecture selection -====================== - - An "architecture" is a type of CPU on which an object file is to -run. Its name may contain a colon, separating the name of the -processor family from the name of the particular CPU. - - The command to list valid architecture values is `objdump -i' (the -second column contains the relevant information). - - Sample values: `m68k:68020', `mips:3000', `sparc'. - -`objdump' Architecture ----------------------- - - Ways to specify: - - 1. command line option: `-m' or `--architecture' - - 2. deduced from the input file - -`objcopy', `nm', `size', `strings' Architecture ------------------------------------------------ - - Ways to specify: - - 1. deduced from the input file - -Linker Input Architecture -------------------------- - - Ways to specify: - - 1. deduced from the input file - -Linker Output Architecture --------------------------- - - Ways to specify: - - 1. script command `OUTPUT_ARCH' (*note Option Commands: - (ld.info)Option Commands.) - - 2. the default architecture from the linker output target (*note - Target Selection::.) - - -File: binutils.info, Node: Linker Emulation Selection, Prev: Architecture Selection, Up: Selecting The Target System - -Linker emulation selection -========================== - - A linker "emulation" is a "personality" of the linker, which gives -the linker default values for the other aspects of the target system. -In particular, it consists of - - * the linker script - - * the target - - * several "hook" functions that are run at certain stages of the - linking process to do special things that some targets require - - The command to list valid linker emulation values is `ld -V'. - - Sample values: `hp300bsd', `mipslit', `sun4'. - - Ways to specify: - - 1. command line option: `-m' (*note Options: (ld.info)Options.) - - 2. environment variable `LDEMULATION' - - 3. compiled-in `DEFAULT_EMULATION' from `Makefile', which comes from - `EMUL' in `config/TARGET.mt' - - -File: binutils.info, Node: Reporting Bugs, Next: Index, Prev: Selecting The Target System, Up: Top - -Reporting Bugs -************** - - Your bug reports play an essential role in making the binary -utilities reliable. - - Reporting a bug may help you by bringing a solution to your problem, -or it may not. But in any case the principal function of a bug report -is to help the entire community by making the next version of the binary -utilities work better. Bug reports are your contribution to their -maintenance. - - In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -* Menu: - -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs - - -File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -Have you found a bug? -===================== - - If you are not sure whether you have found a bug, here are some -guidelines: - - * If a binary utility gets a fatal signal, for any input whatever, - that is a bug. Reliable utilities never crash. - - * If a binary utility produces an error message for valid input, - that is a bug. - - * If you are an experienced user of binary utilities, your - suggestions for improvement are welcome in any case. - - -File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -How to report bugs -================== - - A number of companies and individuals offer support for GNU -products. If you obtained the binary utilities from a support -organization, we recommend you contact that organization first. - - You can find contact information for many support companies and -individuals in the file `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for the -binary utilities to `bug-gnu-utils@gnu.org'. - - The fundamental principle of reporting bugs usefully is this: -*report all the facts*. If you are not sure whether to state a fact or -leave it out, state it! - - Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a file you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug is -a stray memory reference which happens to fetch from the location where -that pathname is stored in memory; perhaps, if the pathname were -different, the contents of that location would fool the utility into -doing the right thing despite the bug. Play it safe and give a -specific, complete example. That is the easiest thing for you to do, -and the most helpful. - - Keep in mind that the purpose of a bug report is to enable us to fix -the bug if it is new to us. Therefore, always write your bug reports -on the assumption that the bug has not been reported previously. - - Sometimes people give a few sketchy facts and ask, "Does this ring a -bell?" Those bug reports are useless, and we urge everyone to *refuse -to respond to them* except to chide the sender to report bugs properly. - - To enable us to fix the bug, you should include all these things: - - * The version of the utility. Each utility announces it if you - start it with the `--version' argument. - - Without this, we will not know whether there is any point in - looking for the bug in the current version of the binary utilities. - - * Any patches you may have applied to the source, including any - patches made to the `BFD' library. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile the - utilities--e.g. "`gcc-2.7'". - - * The command arguments you gave the utility to observe the bug. To - guarantee you will not omit something important, list them all. A - copy of the Makefile (or the output from make) is sufficient. - - If we were to try to guess the arguments, we would probably guess - wrong and then we might not encounter the bug. - - * A complete input file, or set of input files, that will reproduce - the bug. If the utility is reading an object file or files, then - it is generally most helpful to send the actual object files, - uuencoded if necessary to get them through the mail system. - Making them available for anonymous FTP is not as good, but may be - the only reasonable choice for large object files. - - If the source files were produced exclusively using GNU programs - (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to - send the source files rather than the object files. In this case, - be sure to say exactly what version of `gcc', or whatever, was - used to produce the object files. Also say how `gcc', or - whatever, was configured. - - * A description of what behavior you observe that you believe is - incorrect. For example, "It gets a fatal signal." - - Of course, if the bug is that the utility gets a fatal signal, - then we will certainly notice it. But if the bug is incorrect - output, we might not notice unless it is glaringly wrong. You - might as well not give us a chance to make a mistake. - - Even if the problem you experience is a fatal signal, you should - still say so explicitly. Suppose something strange is going on, - such as, your copy of the utility is out of synch, or you have - encountered a bug in the C library on your system. (This has - happened!) Your copy might crash and ours would not. If you told - us to expect a crash, then when ours fails to crash, we would know - that the bug was not happening for us. If you had not told us to - expect a crash, then we would not be able to draw any conclusion - from our observations. - - * If you wish to suggest changes to the source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you even - discuss something in the `ld' source, refer to it by context, not - by line number. - - The line numbers in our development sources will not match those - in your sources. Your line numbers would convey no useful - information to us. - - Here are some things that are not necessary: - - * A description of the envelope of the bug. - - Often people who encounter a bug spend a lot of time investigating - which changes to the input file will make the bug go away and which - changes will not affect it. - - This is often time consuming and not very useful, because the way - we will find the bug is by running a single example under the - debugger with breakpoints, not by pure deduction from a series of - examples. We recommend that you save your time for something else. - - Of course, if you can find a simpler example to report *instead* - of the original one, that is a convenience for us. Errors in the - output will be easier to spot, running under the debugger will take - less time, and so on. - - However, simplification is not vital; if you do not want to do - this, report the bug anyway and send us the entire test case you - used. - - * A patch for the bug. - - A patch for the bug does help us if it is a good one. But do not - omit the necessary information, such as the test case, on the - assumption that a patch is all we need. We might see problems - with your patch and decide to fix the problem another way, or we - might not understand it at all. - - Sometimes with programs as complicated as the binary utilities it - is very hard to construct an example that will make the program - follow a certain path through the code. If you do not send us the - example, we will not be able to construct one, so we will not be - able to verify that the bug is fixed. - - And if we cannot understand what bug you are trying to fix, or why - your patch should be an improvement, we will not install it. A - test case will help us to understand. - - * A guess about what the bug is or what it depends on. - - Such guesses are usually wrong. Even we cannot guess right about - such things without first using the debugger to find the facts. - - -File: binutils.info, Node: Index, Prev: Reporting Bugs, Up: Top - -Index -***** - -* Menu: - -* .stab: objdump. -* addr2line: addr2line. -* address to file name and line number: addr2line. -* all header information, object file: objdump. -* ar: ar. -* ar compatibility: ar. -* architecture: objdump. -* architectures available: objdump. -* archive contents: ranlib. -* archive headers: objdump. -* archives: ar. -* bug criteria: Bug Criteria. -* bug reports: Bug Reporting. -* bugs: Reporting Bugs. -* bugs, reporting: Bug Reporting. -* c++filt: c++filt. -* collections of files: ar. -* compatibility, ar: ar. -* contents of archive: ar cmdline. -* crash: Bug Criteria. -* creating archives: ar cmdline. -* dates in archive: ar cmdline. -* debug symbols: objdump. -* debugging symbols: nm. -* deleting from archive: ar cmdline. -* demangling C++ symbols: c++filt. -* demangling in nm: nm. -* demangling in objdump <1>: objdump. -* demangling in objdump: addr2line. -* disassembling object code: objdump. -* disassembly architecture: objdump. -* disassembly endianness: objdump. -* disassembly, with source: objdump. -* discarding symbols: strip. -* dynamic relocation entries, in object file: objdump. -* dynamic symbol table entries, printing: objdump. -* dynamic symbols: nm. -* ELF object file format: objdump. -* endianness: objdump. -* error on valid input: Bug Criteria. -* external symbols: nm. -* extract from archive: ar cmdline. -* fatal signal: Bug Criteria. -* file name: nm. -* header information, all: objdump. -* input file name: nm. -* libraries: ar. -* listings strings: strings. -* machine instructions: objdump. -* moving in archive: ar cmdline. -* MRI compatibility, ar: ar scripts. -* name duplication in archive: ar cmdline. -* name length: ar. -* nm: nm. -* nm compatibility: nm. -* nm format: nm. -* not writing archive index: ar cmdline. -* objdump: objdump. -* object code format <1>: objdump. -* object code format <2>: addr2line. -* object code format <3>: nm. -* object code format <4>: size. -* object code format: strings. -* object file header: objdump. -* object file information: objdump. -* object file sections: objdump. -* object formats available: objdump. -* operations on archive: ar cmdline. -* printing from archive: ar cmdline. -* printing strings: strings. -* quick append to archive: ar cmdline. -* radix for section sizes: size. -* ranlib: ranlib. -* relative placement in archive: ar cmdline. -* relocation entries, in object file: objdump. -* removing symbols: strip. -* repeated names in archive: ar cmdline. -* replacement in archive: ar cmdline. -* reporting bugs: Reporting Bugs. -* scripts, ar: ar scripts. -* section addresses in objdump: objdump. -* section headers: objdump. -* section information: objdump. -* section sizes: size. -* sections, full contents: objdump. -* size: size. -* size display format: size. -* size number format: size. -* sorting symbols: nm. -* source disassembly: objdump. -* source file name: nm. -* source filenames for object files: objdump. -* stab: objdump. -* start-address: objdump. -* stop-address: objdump. -* strings: strings. -* strings, printing: strings. -* strip: strip. -* symbol index <1>: ar. -* symbol index: ranlib. -* symbol index, listing: nm. -* symbol line numbers: nm. -* symbol table entries, printing: objdump. -* symbols: nm. -* symbols, discarding: strip. -* undefined symbols: nm. -* Unix compatibility, ar: ar cmdline. -* updating an archive: ar cmdline. -* version: Top. -* VMA in objdump: objdump. -* wide output, printing: objdump. -* writing archive index: ar cmdline. - - diff --git a/gnu/dist/binutils/configure.bat b/gnu/dist/binutils/configure.bat deleted file mode 100644 index f7d70f1150bc..000000000000 --- a/gnu/dist/binutils/configure.bat +++ /dev/null @@ -1,63 +0,0 @@ -@echo off -if "%1" == "h8/300" goto h8300 - -echo Configuring binutils for go32 -update ../bfd/hosts/go32.h sysdep.h -goto common - -:h8300 -echo Configuring binutils for H8/300 -update ..\bfd\hosts\h-go32.h sysdep.h - -:common - -echo # Makefile generated by "configure.bat"> Makefile - -if exist config.sed del config.sed - -sed -n "/^VERSION=/ p" Makefile.in | sed -e "s/^/s^/" -e "s/=/^\"/" -e "s/$/\"^/" > config.sed -sed -f config.sed version.c > version2.c - -if exist config.sed del config.sed - -echo "s/version\./version2\./g ">> config.sed -echo "s/-DVERSION=[^ ]* // ">> config.sed - -echo "s/^ \$(srcdir)\/move-if-change/ update/ ">> config.sed -echo "/^###$/ i\ ">> config.sed -echo "CC = gcc ">> config.sed -echo "s/:\([^ ]\)/: \1/g ">> config.sed -echo "s/^ \ *\.\// go32 / ">> config.sed -echo "s/`echo \$(srcdir)\///g ">> config.sed -echo "s/ | sed 's,\^\\\.\/,,'`//g ">> config.sed -echo "s/^ cd \$(srcdir)[ ]*;// ">> config.sed - -echo "/^arparse\.c/ i\ ">> config.sed -echo "arparse.o: arparse.c\ ">> config.sed -echo " $(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) arparse.c ">> config.sed -echo "/\$(BISON)/ c\ ">> config.sed -echo " bison $(BISONFLAGS) -o $@ arparse.y ">> config.sed -echo "/y\.tab\./ d ">> config.sed - -echo "/^arlex.c/ { ">> config.sed -echo " i\ ">> config.sed -echo "arlex.o: arlex.c ">> config.sed -echo " i\ ">> config.sed -echo " $(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) arlex.c ">> config.sed -echo "} ">> config.sed -echo "/\$(LEX)/ c\ ">> config.sed -echo " flex $(LEX_OPTIONS) arlex.l ">> config.sed -echo "s/lex\.yy\./lexyy./g ">> config.sed - -echo "s/'"/\\"/g ">> config.sed -echo "s/"'/\\"/g ">> config.sed - -echo "s/c++filt/cxxfilt/g ">> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile -del config.sed -del config2.sed - -echo int prepends_underscore = 1; > underscore.c - diff --git a/gnu/dist/binutils/configure.com b/gnu/dist/binutils/configure.com deleted file mode 100644 index 5127318914ff..000000000000 --- a/gnu/dist/binutils/configure.com +++ /dev/null @@ -1,78 +0,0 @@ -$! -$! This file configures binutils for use with openVMS/Alpha -$! We do not use the configure script, since we do not have /bin/sh -$! to execute it. -$! -$! Written by Klaus K"ampf (kkaempf@progis.de) -$! -$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$arch = f$element(arch_indx,"|","|VAX|Alpha|") -$if arch .eqs. "VAX" -$then -$ write sys$output "Target VAX not supported." -$ exit 2 -$endif -$! -$! -$! Generate config.h -$! -$ create []config.h -/* config.h. Generated automatically by configure. */ -/* config.in. Generated automatically from configure.in by autoheader. */ -/* Is the type time_t defined in ? */ -#define HAVE_TIME_T_IN_TIME_H 1 -/* Is the type time_t defined in ? */ -#define HAVE_TIME_T_IN_TYPES_H 1 -/* Does define struct utimbuf? */ -#define HAVE_GOOD_UTIME_H 1 -/* Whether fprintf must be declared even if is included. */ -#define NEED_DECLARATION_FPRINTF 1 -/* Whether sbrk must be declared even if is included. */ -#undef NEED_DECLARATION_SBRK -/* Do we need to use the b modifier when opening binary files? */ -/* #undef USE_BINARY_FOPEN */ -/* Define if you have the sbrk function. */ -/* #undef HAVE_SBRK 1 */ -/* Define if you have the utimes function. */ -#define HAVE_UTIMES 1 -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 -/* Define if you have the header file. */ -#define HAVE_STRINGS_H 1 -/* Define if you have the header file. */ -#define HAVE_SYS_FILE_H 1 -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 -$ write sys$output "Generated `config.h'" -$! -$! -$! Edit VERSION in makefile.vms -$! -$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - - []makefile.vms /output=[]makefile.vms -$DECK -! -! Get VERSION from Makefile.in -! - mfile := CREATE_BUFFER("mfile", "Makefile.in"); - rang := CREATE_RANGE(BEGINNING_OF(mfile), END_OF(mfile)); - v_pos := SEARCH_QUIETLY('VERSION=', FORWARD, EXACT, rang); - POSITION(BEGINNING_OF(v_pos)); - vers := CURRENT_LINE; - IF match_pos <> 0 THEN; - file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); - rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); - match_pos := SEARCH_QUIETLY('VERSION=', FORWARD, EXACT, rang); - POSITION(BEGINNING_OF(match_pos)); - ERASE_LINE; - COPY_TEXT(vers); - SPLIT_LINE; - ENDIF; - WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); - QUIT -$ EOD -$ write sys$output "Patched `makefile.vms'" diff --git a/gnu/dist/binutils/mac-binutils.r b/gnu/dist/binutils/mac-binutils.r deleted file mode 100644 index 7b1a3035e281..000000000000 --- a/gnu/dist/binutils/mac-binutils.r +++ /dev/null @@ -1,42 +0,0 @@ -/* Resources for GNU binutils. */ - -#include "SysTypes.r" - -/* Version resources. */ - -resource 'vers' (1) { - 0, - 0, - 0, - 0, - verUs, - VERSION_STRING, - VERSION_STRING " (C) 1986-95 FSF, Inc." -}; - -resource 'vers' (2, purgeable) { - 0, - 0, - 0, - 0, - verUs, - VERSION_STRING, - "binutils " VERSION_STRING " for MPW" -}; - -#ifdef WANT_CFRG - -#include "CodeFragmentTypes.r" - -resource 'cfrg' (0) { - { - kPowerPC, - kFullLib, - kNoVersionNum, kNoVersionNum, - 0,0, - kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork, - PROG_NAME - } -}; - -#endif /* WANT_CFRG */ diff --git a/gnu/dist/binutils/makefile.vms b/gnu/dist/binutils/makefile.vms deleted file mode 100644 index 5e9b2df76294..000000000000 --- a/gnu/dist/binutils/makefile.vms +++ /dev/null @@ -1,93 +0,0 @@ -# -# Makefile for binutils under openVMS/Alpha -# -# For use with gnu-make for vms -# -# Created by Klaus K"ampf, kkaempf@progis.de -# -# - -# Distribution version, filled in by configure.com -VERSION= - -TARGET=""evax-alpha"" - -ifeq ($(CC),gcc) -CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS) -DEFS=/define=("TARGET=$(TARGET)") -LIBS=,GNU:[000000]libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU:[000000]crt0.obj -else -CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)/warnings=disable=(missingreturn,implicitfunc) -DEFS=/define=("TARGET=$(TARGET)",\ -"const=","unlink=remove",\ -"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ -"_bfd_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec") -LIBS=,sys$$library:vaxcrtl.olb/lib -endif - -BFDLIB = [-.bfd]libbfd.olb/lib -BFDLIB_DEP = [-.bfd]libbfd.olb -LIBIBERTY_DEP = [-.libiberty]libiberty.olb -LIBIBERTY = [-.libiberty]libiberty.olb/lib -OPCODES_DEP = [-.opcodes]libopcodes.olb -OPCODES = [-.opcodes]libopcodes.olb/lib - -DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj - -WRITE_DEBUG_OBJS = $(DEBUG_OBJS),wrstabs.obj - -BULIBS = []bucomm.obj,version.obj,filemode.obj - -ADDL_DEPS = $(BULIBS),$(BFDLIB_DEP),$(LIBIBERTY_DEP) -ADDL_LIBS = $(BULIBS),$(BFDLIB),$(LIBIBERTY) - -SIZEOBJS = $(ADDL_DEPS),size.obj - -STRINGSOBJS = $(ADDL_DEPS),strings.obj - -NMOBJS = $(ADDL_DEPS),nm.obj - -OBJDUMPOBJS = $(ADDL_DEPS),objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(OPCODES_DEP) - -all: config.h size.exe strings.exe objdump.exe nm.exe - -size.exe: $(SIZEOBJS) - link/exe=$@ size.obj,$(ADDL_LIBS)$(LIBS) - -strings.exe: $(STRINGSOBJS) - link/exe=$@ strings.obj,$(ADDL_LIBS)$(LIBS) - -nm.exe: $(NMOBJS) - link/exe=$@ nm.obj,$(ADDL_LIBS)$(LIBS) - -objdump.exe: $(OBJDUMPOBJS) - link/exe=$@ objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(BFDLIB),$(OPCODES),$(ADDL_LIBS)$(LIBS) - - -version.obj: version.c - $(CC) $(CFLAGS)/define=(VERSION="""$(VERSION)""") $< - -config.h: - $$ @configure - $(MAKE) -f makefile.vms - -[-.bfd]libbfd.olb: - $(CD) [-.bfd] - $(MAKE) -f makefile.vms - $(CD) [-.binutils] - -[-.libiberty]libiberty.olb: - $(CD) [-.libiberty] - $(MAKE) -f makefile.vms - $(CD) [-.binutils] - -[-.opcodes]libopcodes.olb: - $(CD) [-.opcodes] - $(MAKE) -f makefile.vms - $(CD) [-.binutils] - -clean: - $$ purge - $(RM) *.obj; - $(RM) *.exe; - $(RM) config.h; diff --git a/gnu/dist/binutils/mpw-config.in b/gnu/dist/binutils/mpw-config.in deleted file mode 100644 index 21a067ddd6bc..000000000000 --- a/gnu/dist/binutils/mpw-config.in +++ /dev/null @@ -1,27 +0,0 @@ -# Configuration fragment for binutils. - -Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'` - -# (should canonicalize arch name) */ - -Set archname ARCH_{target_arch} - -Set underscore 0 - -If "{target_canonical}" =~ /sh-hitachi-hms/ - Set underscore 1 -End If - -Echo '# From mpw-config.in' > "{o}"mk.tmp -Echo "ARCHDEFS = -d" {archname} >> "{o}"mk.tmp -Echo "UNDERSCORE = " {underscore} >> "{o}"mk.tmp -Echo "BUILD_NLMCONV = " >> "{o}"mk.tmp -Echo "BUILD_SRCONV = " >> "{o}"mk.tmp -Echo "SYSINFO_PROG = " >> "{o}"mk.tmp -Echo "BUILD_DLLTOOL = " >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new -Echo '#include "mpw.h"' >> "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h diff --git a/gnu/dist/binutils/mpw-make.sed b/gnu/dist/binutils/mpw-make.sed deleted file mode 100644 index 03abffe18f8a..000000000000 --- a/gnu/dist/binutils/mpw-make.sed +++ /dev/null @@ -1,115 +0,0 @@ -# Sed commands to finish translating the binutils Unix makefile into MPW syntax. - -# Add a rule. -/^#### .*/a\ -\ -"{o}"underscore.c.o \\Option-f "{o}"underscore.c\ - -# Comment out any alias settings. -/^host_alias =/s/^/#/ -/^target_alias =/s/^/#/ - -# Whack out unused host define bits. -/HDEFINES/s/@HDEFINES@// - -# Don't build specialized tools. -/BUILD_NLMCONV/s/@BUILD_NLMCONV@// -/BUILD_SRCONV/s/@BUILD_SRCONV@// -/BUILD_DLLTOOL/s/@BUILD_DLLTOOL@// - -/UNDERSCORE/s/@UNDERSCORE@/{UNDERSCORE}/ - -# Don't need this. -/@HLDFLAGS@/s/@HLDFLAGS@// - -# Point at the libraries directly. -/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/ -/@OPCODES@/s/@OPCODES@/::opcodes:libopcodes.o/ - -# Whack out target makefile fragment. -/target_makefile_fragment/s/target_makefile_fragment@// - -# Fix and add to the include paths. -/^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/ -/BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": / -/INCDIR/s/-i {INCDIR} /-i "{INCDIR}": / - -# Use byacc instead of bison (for now anyway). -/BISON/s/^BISON =.*$/BISON = byacc/ -#/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = / - -# Embed the version in symbolic doublequotes that will expand to -# the right thing for each compiler. -/VERSION/s/'"{VERSION}"'/{dq}{VERSION}{dq}/ - -# '+' is a special char to MPW, don't use it ever. -/c++filt/s/c++filt/cplusfilt/ - -# All of the binutils use the same Rez file, change names to refer to it. -/^{[A-Z]*_PROG}/s/$/ "{s}"mac-binutils.r/ -/{[A-Z]*_PROG}\.r/s/{[A-Z]*_PROG}\.r/mac-binutils.r/ - -# There are auto-generated references to BFD .h files that are not -# in the objdir (like bfd.h) but are in the source dir. -/::bfd:lib/s/::bfd:lib\([a-z]*\)\.h/{BFDDIR}:lib\1.h/g - -# Fix the locations of generated files. -/config/s/"{s}"config\.h/"{o}"config.h/g -/config/s/^config\.h/"{o}"config\.h/ -/underscore/s/"{s}"underscore\.c/"{o}"underscore.c/g -/underscore/s/^underscore\.c/"{o}"underscore\.c/ - -# Fix paths to generated source files. -/lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g -/lex.yy.c/s/^lex\.yy\.c/"{o}"lex.yy.c/ -/arlex.c/s/"{s}"arlex\.c/"{o}"arlex.c/g -/arlex.c/s/^arlex\.c/"{o}"arlex.c/ -/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g -/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/ -/arparse.c/s/"{s}"arparse\.c/"{o}"arparse.c/g -/arparse.c/s/^arparse\.c/"{o}"arparse.c/ -/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g -/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/ -/arparse.h/s/"{s}"arparse\.h/"{o}"arparse.h/g -/arparse.h/s/^arparse\.h/"{o}"arparse.h/ - -/"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g - -# The generated lexer may include an ifdef for older Mac compilers that -# needs to work with newer compilers also. -/lex.yy.c/s/Rename -y \([^ ]*\) \([^ ]*\)$/sed -e 's,ifdef macintosh,if defined(macintosh) || defined(__MWERKS__),' \1 > \2/ - -# Fix an over-eagerness. -/echo.*WARNING.*This file/s/'.*'/' '/ - -# Add a "stamps" target. -$a\ -stamps \\Option-f stamp-under\ - -/^install \\Option-f /,/^$/c\ -install \\Option-f all install-only\ -\ -install-only \\Option-f\ - NewFolderRecursive "{bindir}"\ - # Need to copy all the tools\ - For prog in {PROGS}\ - Set progname `echo {prog} | sed -e 's/.new//'`\ - Duplicate -y :{prog} "{bindir}"{progname}\ - End For\ - - -/true/s/ ; @true$// - -# dot files are trouble, remove them and their actions. -/^\.dep/,/^$/d - -# Remove un-useful targets. -/^Makefile \\Option-f/,/^$/d -/^"{o}"config.h \\Option-f/,/^$/d -/^config.status \\Option-f/,/^$/d - -# Don't try to make the demangler's man page, it's useless. -/^{DEMANGLER_PROG}\.1 \\Option-f/,/^$/d -# Don't depend on it either. -/{DEMANGLER_PROG}/s/ {DEMANGLER_PROG}\.1// - diff --git a/gnu/dist/configure.bat b/gnu/dist/configure.bat deleted file mode 100644 index d76a37ecd9d4..000000000000 --- a/gnu/dist/configure.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off - -chdir libiberty -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\bfd -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\opcodes -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\gprof -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\binutils -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\gas -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\ld -call configure %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir .. diff --git a/gnu/dist/etc/cfg-paper.info b/gnu/dist/etc/cfg-paper.info deleted file mode 100644 index d0ccb0283885..000000000000 --- a/gnu/dist/etc/cfg-paper.info +++ /dev/null @@ -1,659 +0,0 @@ -This is Info file cfg-paper.info, produced by Makeinfo-1.64 from the -input file ./cfg-paper.texi. - - This document attempts to describe the general concepts behind -configuration of the GNU Development Tools. It also discusses common -usage. - - Copyright (C) 1991, 1992, 1994 Cygnus Support Permission is granted -to make and distribute verbatim copies of this manual provided the -copyright notice and this permission notice are preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by Cygnus Support. - -START-INFO-DIR-ENTRY -* configuration: (cfg-paper). Some theory on configuring source. -END-INFO-DIR-ENTRY - - -File: cfg-paper.info, Node: Top, Next: Some Basic Terms, Prev: (dir), Up: (dir) - - This document attempts to describe the general concepts behind -configuration of the GNU Development Tools. It also discusses common -usage. - -* Menu: - -* Some Basic Terms:: Some Basic Terms -* Specifics.:: Specifics -* Building Development Environments:: Building Development Environments -* A Walk Through:: A Walk Through -* Final Notes:: Final Notes -* Index:: Index - - -- The Detailed Node Listing -- - -Some Basic Terms - -* Host Environments:: Host Environments -* Configuration Time Options:: Configuration Time Options - -A Walk Through - -* Native Development Environments:: Native Development Environments -* Emulation Environments:: Emulation Environments -* Simple Cross Environments:: Simple Cross Environments -* Crossing Into Targets:: Crossing Into Targets -* Canadian Cross:: Canadian Cross - -Final Notes - -* Hacking Configurations:: Hacking Configurations - - -File: cfg-paper.info, Node: Some Basic Terms, Next: Specifics., Prev: Top, Up: Top - -Some Basic Terms -**************** - - There are a lot of terms that are frequently used when discussing -development tools. Most of the common terms have been used for many -different concepts such that their meanings have become ambiguous to the -point of being confusing. Typically, we only guess at their meanings -from context and we frequently guess wrong. - - This document uses very few terms by comparison. The intent is to -make the concepts as clear as possible in order to convey the usage and -intent of these tools. - - *Programs* run on *machines*. Programs are very nearly always -written in *source*. Programs are *built* from source. *Compilation* -is a process that is frequently, but not always, used when building -programs. - -* Menu: - -* Host Environments:: Host Environments -* Configuration Time Options:: Configuration Time Options - - -File: cfg-paper.info, Node: Host Environments, Next: Configuration Time Options, Prev: Some Basic Terms, Up: Some Basic Terms - -Host Environments -================= - - In this document, the word *host* refers to the environment in which -the source in question will be compiled. *host* and *host name* have -nothing to do with the proper name of your host, like *ucbvax*, -*prep.ai.mit.edu* or *att.com*. Instead they refer to things like -*sun4* and *dec3100*. - - Forget for a moment that this particular directory of source is the -source for a development environment. Instead, pretend that it is the -source for a simpler, more mundane, application, say, a desk calculator. - - Source that can be compiled in more than one environment, generally -needs to be set up for each environment explicitly. Here we refer to -that process as configuration. That is, we configure the source for a -host. - - For example, if we wanted to configure our mythical desk calculator -to compile on a SparcStation, we might configure for host sun4. With -our configuration system: - - cd desk-calculator ; ./configure sun4 - -does the trick. `configure' is a shell script that sets up Makefiles, -subdirectories, and symbolic links appropriate for compiling the source -on a sun4. - - The *host* environment does not necessarily refer to the machine on -which the tools are built. It is possible to provide a sun3 development -environment on a sun4. If we wanted to use a cross compiler on the sun4 -to build a program intended to be run on a sun3, we would configure the -source for sun3. - - cd desk-calculator ; ./configure sun3 - -The fact that we are actually building the program on a sun4 makes no -difference if the sun3 cross compiler presents an environment that looks -like a sun3 from the point of view of the desk calculator source code. -Specifically, the environment is a sun3 environment if the header files, -predefined symbols, and libraries appear as they do on a sun3. - - Nor does the host environment refer to the the machine on which the -program to be built will run. It is possible to provide a sun3 -emulation environment on a sun4 such that programs built in a sun3 -development environment actually run on the sun4. This technique is -often used within individual programs to remedy deficiencies in the host -operating system. For example, some operating systems do not provide -the `bcopy' function and so it is emulated using the `memcpy' funtion. - - Host environment simply refers to the environment in which the -program will be built from the source. - - -File: cfg-paper.info, Node: Configuration Time Options, Prev: Host Environments, Up: Some Basic Terms - -Configuration Time Options -========================== - - Many programs have compile time options. That is, features of the -program that are either compiled into the program or not based on a -choice made by the person who builds the program. We refer to these as -*configuration options*. For example, our desk calculator might be -capable of being compiled into a program that either uses infix notation -or postfix as a configuration option. For a sun3, to choose infix you -might use: - - ./configure sun3 --enable-notation=infix - -while for a sun4 with postfix you might use: - - ./configure sun4 --enable-notation=postfix - - If we wanted to build both at the same time, the intermediate pieces -used in the build process must be kept separate. - - mkdir ../objdir.sun4 - (cd ../objdir.sun4 ; ../configure sun4 --enable-notation=postfix --srcdir=../src) - mkdir ../objdir.sun3 - (cd ../objdir.sun3 ; ../configure sun3 --enable-notation=infix --srcdir=../src) - -will create subdirectories for the intermediate pieces of the sun4 and -sun3 configurations. This is necessary as previous systems were only -capable of one configuration at a time. Otherwise, a second -configuration would write over the first. We've chosen to retain this -behaviour so the obj directories and the `--srcdir' configuration -option are necessary to get the new behaviour. The order of the -arguments doesn't matter. There should be exactly one argument without -a leading `-' and that argument will be assumed to be the host name. - - From here on the examples will assume that you want to build the -tools *in place* and won't show the `--srcdir' option, but remember -that it is available. - - In order to actually install the program, the configuration system -needs to know where you would like the program installed. The default -location is `/usr/local'. We refer to this location as `$(prefix)'. -All user visible programs will be installed in ``$(prefix)'/bin'. All -other programs and files will be installed in a subdirectory of -``$(prefix)'/lib'. - - You can only change `$(prefix)' as a configuration time option. - - ./configure sun4 --enable-notation=postfix --prefix=/local - -Will configure the source such that: - - make install - -will put its programs in `/local/bin' and `/local/lib/gcc'. If you -change `$(prefix)' after building the source, you will need to: - - make clean - -before the change will be propogated properly. This is because some -tools need to know the locations of other tools. - - With these concepts in mind, we can drop the desk calculator example -and move on to the application that resides in these directories, -namely, the source to a development environment. - - -File: cfg-paper.info, Node: Specifics., Next: Building Development Environments, Prev: Some Basic Terms, Up: Top - -Specifics -********* - - The GNU Development Tools can be built on a wide variety of hosts. -So, of course, they must be configured. Like the last example, - - ./configure sun4 --prefix=/local - ./configure sun3 --prefix=/local - -will configure the source to be built in subdirectories, in order to -keep the intermediate pieces separate, and to be installed in `/local'. - - When built with suitable development environments, these will be -native tools. We'll explain the term *native* later. - - -File: cfg-paper.info, Node: Building Development Environments, Next: A Walk Through, Prev: Specifics., Up: Top - -Building Development Environments -********************************* - - The GNU development tools can not only be built in a number of host -development environments, they can also be configured to create a -number of different development environments on each of those hosts. -We refer to a specific development environment created as a *target*. -That is, the word *target* refers to the development environment -produced by compiling this source and installing the resulting programs. - - For the GNU development tools, the default target is the same as the -host. That is, the development environment produced is intended to be -compatible with the environment used to build the tools. - - In the example above, we created two configurations, one for sun4 and -one for sun3. The first configuration is expecting to be built in a -sun4 development environment, to create a sun4 development environment. -It doesn't necessarily need to be built on a sun4 if a sun4 development -environment is available elsewhere. Likewise, if the available sun4 -development environment produces executables intended for something -other than sun4, then the development environment built from this sun4 -configuration will run on something other than a sun4. From the point -of view of the configuration system and the GNU development tools -source, this doesn't matter. What matters is that they will be built in -a sun4 environment. - - Similarly, the second configuration given above is expecting to be -built in a sun3 development environment, to create a sun3 development -environment. - - The development environment produced is a configuration time option, -just like `$(prefix)'. - - ./configure sun4 --prefix=/local --target=sun3 - ./configure sun3 --prefix=/local --target=sun4 - - In this example, like before, we create two configurations. The -first is intended to be built in a sun4 environment, in subdirectories, -to be installed in `/local'. The second is intended to be built in a -sun3 environment, in subdirectories, to be installed in `/local'. - - Unlike the previous example, the first configuration will produce a -sun3 development environment, perhaps even suitable for building the -second configuration. Likewise, the second configuration will produce -a sun4 development environment, perhaps even suitable for building the -first configuration. - - The development environment used to build these configurations will -determine the machines on which the resulting development environments -can be used. - - -File: cfg-paper.info, Node: A Walk Through, Next: Final Notes, Prev: Building Development Environments, Up: Top - -A Walk Through -************** - -* Menu: - -* Native Development Environments:: Native Development Environments -* Emulation Environments:: Emulation Environments -* Simple Cross Environments:: Simple Cross Environments -* Crossing Into Targets:: Crossing Into Targets -* Canadian Cross:: Canadian Cross - - -File: cfg-paper.info, Node: Native Development Environments, Next: Emulation Environments, Prev: A Walk Through, Up: A Walk Through - -Native Development Environments -=============================== - - Let us assume for a moment that you have a sun4 and that with your -sun4 you received a development environment. This development -environment is intended to be run on your sun4 to build programs that -can be run on your sun4. You could, for instance, run this development -environment on your sun4 to build our example desk calculator program. -You could then run the desk calculator program on your sun4. - - The resulting desk calculator program is referred to as a *native* -program. The development environment itself is composed of native -programs that, when run, build other native programs. Any other program -is referred to as *foreign*. Programs intended for other machines are -foreign programs. - - This type of development environment, which is by far the most -common, is refered to as *native*. That is, a native development -environment runs on some machine to build programs for that same -machine. The process of using a native development environment to -build native programs is called a *native* build. - - ./configure sun4 - -will configure this source such that when built in a sun4 development -environment, with a development environment that builds programs -intended to be run on sun4 machines, the programs built will be native -programs and the resulting development environment will be a native -development environment. - - The development system that came with your sun4 is one such -environment. Using it to build the GNU Development Tools is a very -common activity and the resulting development environment is quite -popular. - - make all - -will build the tools as configured and will assume that you want to use -the native development environment that came with your machine. - - Using a development environment to build a development environment is -called *bootstrapping*. The release of the GNU Development Tools is -capable of bootstrapping itself. This is a very powerful feature that -we'll return to later. For now, let's pretend that you used the native -development environment that came with your sun4 to bootstrap the -release and let's call the new development environment *stage1*. - - Why bother? Well, most people find that the GNU development -environment builds programs that run faster and take up less space than -the native development environments that came with their machines. Some -people didn't get development environments with their machines and some -people just like using the GNU tools better than using other tools. - - While you're at it, if the GNU tools produce better programs, maybe -you should use them to build the GNU tools. So let's pretend that you -do. Let's call the new development environment *stage2*. - - So far you've built a development environment, stage1, and you've -used stage1 to build a new, faster and smaller development environment, -stage2, but you haven't run any of the programs that the GNU tools have -built. You really don't yet know if these tools work. Do you have any -programs built with the GNU tools? Yes, you do. stage2. What does -that program do? It builds programs. Ok, do you have any source handy -to build into a program? Yes, you do. The GNU tools themselves. In -fact, if you use stage2 to build the GNU tools again the resulting -programs should be identical to stage2. Let's pretend that you do and -call the new development environment *stage3*. - - You've just completed what's called a *three stage boot*. You now -have a small, fast, somewhat tested, development environment. - - make bootstrap - -will do a three stage boot across all tools and will compare stage2 to -stage3 and complain if they are not identical. - - Once built, - - make install - -will install the development environment in the default location, or in -`$(prefix)' if you specified an alternate when you configured. - - Any development environment that is not a native development -environment is refered to as a *cross* development environment. There -are many different types of cross development environments but most -fall into one of three basic categories. - - -File: cfg-paper.info, Node: Emulation Environments, Next: Simple Cross Environments, Prev: Native Development Environments, Up: A Walk Through - -Emulation Environments -====================== - - The first category of cross development environment is called -*emulation*. There are two primary types of emulation, but both types -result in programs that run on the native host. - - The first type is *software emulation*. This form of cross -development environment involves a native program that when run on the -native host, is capable of interpreting, and in most aspects running, a -program intended for some other machine. This technique is typically -used when the other machine is either too expensive, too slow, too fast, -or not available, perhaps because it hasn't yet been built. The native, -interpreting program is called a *software emulator*. - - The GNU Development Tools do not currently include any software -emulators. Some do exist and the GNU Development Tools can be -configured to create simple cross development environments for with -these emulators. More on this later. - - The second type of emulation is when source intended for some other -development environment is built into a program intended for the native -host. The concepts of operating system universes and hosted operating -systems are two such development environments. - - -File: cfg-paper.info, Node: Simple Cross Environments, Next: Crossing Into Targets, Prev: Emulation Environments, Up: A Walk Through - -Simple Cross Environments -========================= - - ./configure sun4 --target=a29k - -will configure the tools such that when compiled in a sun4 development -environment the resulting development environment can be used to create -programs intended for an a29k. Again, this does not necessarily mean -that the new development environment can be run on a sun4. That would -depend on the development environment used to build these tools. - - Earlier you saw how to configure the tools to build a native -development environment, that is, a development environment that runs -on your sun4 and builds programs for your sun4. Let's pretend that you -use stage3 to build this simple cross configuration and let's call the -new development environment gcc-a29k. Remember that this is a native -build. Gcc-a29k is a collection of native programs intended to run on -your sun4. That's what stage3 builds, programs for your sun4. -Gcc-a29k represents an a29k development environment that builds -programs intended to run on an a29k. But, remember, gcc-a29k runs on -your sun4. Programs built with gcc-a29k will run on your sun4 only -with the help of an appropriate software emulator. - - Building gcc-a29k is also a bootstrap but of a slightly different -sort. We call gcc-a29k a *simple cross* environment and using gcc-a29k -to build a program intended for a29k is called *crossing to* a29k. -Simple cross environments are the second category of cross development -environments. - - -File: cfg-paper.info, Node: Crossing Into Targets, Next: Canadian Cross, Prev: Simple Cross Environments, Up: A Walk Through - -Crossing Into Targets -===================== - - ./configure a29k --target=a29k - -will configure the tools such that when compiled in an a29k development -environment, the resulting development environment can be used to create -programs intended for an a29k. Again, this does not necessarily mean -that the new development environment can be run on an a29k. That would -depend on the development environment used to build these tools. - - If you've been following along this walk through, then you've already -built an a29k environment, namely gcc-a29k. Let's pretend you use -gcc-a29k to build the current configuration. - - Gcc-a29k builds programs intended for the a29k so the new development -environment will be intended for use on an a29k. That is, this new gcc -consists of programs that are foreign to your sun4. They cannot be run -on your sun4. - - The process of building this configuration is a another bootstrap. -This bootstrap is also a cross to a29k. Because this type of build is -both a bootstrap and a cross to a29k, it is sometimes referred to as a -*cross into* a29k. This new development environment isn't really a -cross development environment at all. It is intended to run on an a29k -to produce programs for an a29k. You'll remember that this makes it, by -definition, an a29k native compiler. *Crossing into* has been -introduced here not because it is a type of cross development -environment, but because it is frequently mistaken as one. The process -is *a cross* but the resulting development environment is a native -development environment. - - You could not have built this configuration with stage3, because -stage3 doesn't provide an a29k environment. Instead it provides a sun4 -environment. - - If you happen to have an a29k lying around, you could now use this -fresh development environment on the a29k to three-stage these tools -all over again. This process would look just like it did when we built -the native sun4 development environment because we would be building -another native development environment, this one on a29k. - - -File: cfg-paper.info, Node: Canadian Cross, Prev: Crossing Into Targets, Up: A Walk Through - -Canadian Cross -============== - - So far you've seen that our development environment source must be -configured for a specific host and for a specific target. You've also -seen that the resulting development environment depends on the -development environment used in the build process. - - When all four match identically, that is, the configured host, the -configured target, the environment presented by the development -environment used in the build, and the machine on which the resulting -development environment is intended to run, then the new development -environment will be a native development environment. - - When all four match except the configured host, then we can assume -that the development environment used in the build is some form of -library emulation. - - When all four match except for the configured target, then the -resulting development environment will be a simple cross development -environment. - - When all four match except for the host on which the development -environment used in the build runs, the build process is a *cross into* -and the resulting development environment will be native to some other -machine. - - Most of the other permutations do exist in some form, but only one -more is interesting to the current discussion. - - ./configure a29k --target=sun3 - -will configure the tools such that when compiled in an a29k development -environment, the resulting development environment can be used to create -programs intended for a sun3. Again, this does not necessarily mean -that the new development environment can be run on an a29k. That would -depend on the development environment used to build these tools. - - If you are still following along, then you have two a29k development -environments, the native development environment that runs on a29k, and -the simple cross that runs on your sun4. If you use the a29k native -development environment on the a29k, you will be doing the same thing we -did a while back, namely building a simple cross from a29k to sun3. -Let's pretend that instead, you use gcc-a29k, the simple cross -development environment that runs on sun4 but produces programs for -a29k. - - The resulting development environment will run on a29k because that's -what gcc-a29k builds, a29k programs. This development environment will -produce programs for a sun3 because that is how it was configured. This -means that the resulting development environment is a simple cross. - - There really isn't a common name for this process because very few -development environments are capable of being configured this -extensively. For the sake of discussion, let's call this process a -*Canadian cross*. It's a three party cross, Canada has a three party -system, hence Canadian Cross. - - -File: cfg-paper.info, Node: Final Notes, Next: Index, Prev: A Walk Through, Up: Top - -Final Notes -*********** - - By *configures*, I mean that links, Makefile, .gdbinit, and -config.status are built. Configuration is always done from the source -directory. - -`./configure NAME' - configures this directory, perhaps recursively, for a single - host+target pair where the host and target are both NAME. If a - previous configuration existed, it will be overwritten. - -`./configure HOSTNAME --target=TARGETNAME' - configures this directory, perhaps recursively, for a single - host+target pair where the host is HOSTNAME and target is - TARGETNAME. If a previous configuration existed, it will be - overwritten. - -* Menu: - -* Hacking Configurations:: Hacking Configurations - - -File: cfg-paper.info, Node: Hacking Configurations, Prev: Final Notes, Up: Final Notes - -Hacking Configurations -====================== - - The configure scripts essentially do three things, create -subdirectories if appropriate, build a `Makefile', and create links to -files, all based on and tailored to, a specific host+target pair. The -scripts also create a `.gdbinit' if appropriate but this is not -tailored. - - The Makefile is created by prepending some variable definitions to a -Makefile template called `Makefile.in' and then inserting host and -target specific Makefile fragments. The variables are set based on the -chosen host+target pair and build style, that is, if you use `--srcdir' -or not. The host and target specific Makefile may or may not exist. - - * Makefiles can be edited directly, but those changes will - eventually be lost. Changes intended to be permanent for a - specific host should be made to the host specific Makefile - fragment. This should be in `./config/mh-HOST' if it exists. - Changes intended to be permanent for a specific target should be - made to the target specific Makefile fragment. This should be in - `./config/mt-TARGET' if it exists. Changes intended to be - permanent for the directory should be made in `Makefile.in'. To - propogate changes to any of these, either use `make Makefile' or - `./config.status' or re-configure. - - -File: cfg-paper.info, Node: Index, Prev: Final Notes, Up: Top - -Index -***** - -* Menu: - -* Bootstrapping: Native Development Environments. -* Building: Some Basic Terms. -* Canadian Cross: Canadian Cross. -* Compilation: Some Basic Terms. -* Cross: Native Development Environments. -* Crossing into: Crossing Into Targets. -* Crossing to: Simple Cross Environments. -* Emulation: Emulation Environments. -* Foreign: Native Development Environments. -* host: Host Environments. -* Machines: Some Basic Terms. -* Native: Native Development Environments. -* Programs: Some Basic Terms. -* Simple cross: Simple Cross Environments. -* Software emulation: Emulation Environments. -* Software emulator: Emulation Environments. -* Source: Some Basic Terms. -* Stage1: Native Development Environments. -* Stage2: Native Development Environments. -* Stage3: Native Development Environments. -* Target: Building Development Environments. -* Three party cross: Canadian Cross. -* Three stage boot: Native Development Environments. - - - -Tag Table: -Node: Top1055 -Node: Some Basic Terms2009 -Node: Host Environments2951 -Node: Configuration Time Options5513 -Node: Specifics.8316 -Node: Building Development Environments8934 -Node: A Walk Through11554 -Node: Native Development Environments11972 -Node: Emulation Environments16221 -Node: Simple Cross Environments17579 -Node: Crossing Into Targets19188 -Node: Canadian Cross21381 -Node: Final Notes24208 -Node: Hacking Configurations25003 -Node: Index26418 - -End Tag Table diff --git a/gnu/dist/etc/configure.info b/gnu/dist/etc/configure.info deleted file mode 100644 index c3a11c46c08d..000000000000 --- a/gnu/dist/etc/configure.info +++ /dev/null @@ -1,64 +0,0 @@ -This is Info file configure.info, produced by Makeinfo-1.64 from the -input file ./configure.texi. - -START-INFO-DIR-ENTRY -* configure: (configure). Cygnus configure. -END-INFO-DIR-ENTRY - - This document describes the Cygnus Support version of `configure'. - - Copyright (C) 1991, 1992, 1993 Cygnus Support Permission is granted -to make and distribute verbatim copies of this manual provided the -copyright notice and this permission notice are preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by Cygnus Support. - - -Indirect: -configure.info-1: 968 -configure.info-2: 50426 - -Tag Table: -(Indirect) -Node: Top968 -Node: What configure does1449 -Node: Invoking configure4769 -Node: Using configure11824 -Node: What configure really does13089 -Node: Build variables18366 -Node: Build directories20568 -Node: Makefile generation23970 -Node: config.guess25501 -Node: config.status26391 -Node: configure.in26948 -Node: configure variables28618 -Node: Minimal36784 -Node: Declarations37594 -Node: per-host38068 -Node: per-target38805 -Node: post-target39628 -Node: Example40211 -Node: Install locations40918 -Node: prefix41719 -Node: exec_prefix42612 -Node: Install details44417 -Node: Host49354 -Node: Target49990 -Node: Makefile fragments50426 -Node: Makefile extensions52042 -Node: Porting55769 -Node: Programs56221 -Node: Hosts and targets61075 -Node: Sites62738 -Node: Variables Index63438 -Node: Concept Index66610 - -End Tag Table diff --git a/gnu/dist/etc/configure.info-1 b/gnu/dist/etc/configure.info-1 deleted file mode 100644 index 542bf4717720..000000000000 --- a/gnu/dist/etc/configure.info-1 +++ /dev/null @@ -1,1174 +0,0 @@ -This is Info file configure.info, produced by Makeinfo-1.64 from the -input file ./configure.texi. - -START-INFO-DIR-ENTRY -* configure: (configure). Cygnus configure. -END-INFO-DIR-ENTRY - - This document describes the Cygnus Support version of `configure'. - - Copyright (C) 1991, 1992, 1993 Cygnus Support Permission is granted -to make and distribute verbatim copies of this manual provided the -copyright notice and this permission notice are preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by Cygnus Support. - - -File: configure.info, Node: Top, Next: What configure does, Up: (dir) - -Cygnus configure -**************** - - This file documents the configuration system used and distributed by -Cygnus Support. - -* Menu: - -* What configure does:: What configure does -* Invoking configure:: Invoking configure--basic usage -* Using configure:: More than you ever wanted to know -* Porting:: How to use configure with new programs -* Variables Index:: -* Concept Index:: - - -File: configure.info, Node: What configure does, Next: Invoking configure, Prev: Top, Up: Top - -What `configure' does -********************* - - This manual documents Cygnus `configure', a program which helps to -automate much of the setup activity associated with building large -suites of programs, such the Cygnus Support Developer's Kit. This -manual is therefore geared toward readers who are likely to face the -problem of configuring software in source form before compiling and -installing it. We assume you are an experienced programmer or system -administrator. For further background on this topic, see *Note -Apologia Configure: (cfg-paper)Some Basic Terms, by K. Richard Pixley. - - When `configure' runs, it does the following things: - -** creates build directories* - When you run `configure' with the `--srcdir' option, it uses the - current directory as the "build directory", creating under it a - directory tree that parallels the directory structure of the - source directory. If you don't specify a `srcdir', `configure' - first assumes that the source code you wish to configure is in - your current directory; if it finds no `configure.in' input file - there, it searches in the directory `configure' itself lies in. - (For details, see *Note Build directories: Build directories.) - -** generates `Makefile'* - A `Makefile' template from the source directory, usually called - `Makefile.in', is copied to an output file in the build directory - which is most often named `Makefile'. `configure' places - definitions for a number of standard `Makefile' macros at the - beginning of the output file. If `--prefix=DIR' or - `--exec_prefix=DIR' are specified on the `configure' command line, - corresponding `Makefile' variables are set accordingly. If host, - target, or site-specific `Makefile' fragments exist, these are - inserted into the output file. (For details, see *Note `Makefile' - generation: Makefile generation.) - -** generates `.gdbinit'* - If the source directory contains a `.gdbinit' file and the build - directory is not the same as the source directory, a `.gdbinit' - file is created in the build directory. This `.gdbinit' file - contains commands which allow the source directory to be read when - debugging with the GNU debugger, `gdb'. (*Note Command Files: - (gdb)Command Files.) - -** makes symbolic links* - Most build directories require that some symbolic links with - generic names are built pointing to specific files in the source - directory. If the system where `configure' runs cannot support - symbolic links, hard links are used instead. (For details, see - *Note The `configure.in' input file: configure.in.) - -** generates `config.status'* - `configure' creates a shell script named `config.status' in the - build directory. This shell script, when run from the build - directory (usually from within a `Makefile'), will reconfigure the - build directory (but not its subdirectories). This is most often - used to have a `Makefile' update itself automatically if a new - source directory is available. - -** calls itself recursively* - If the source directory has subdirectories that should also be - configured, `configure' is called for each. - - -File: configure.info, Node: Invoking configure, Next: Using configure, Prev: What configure does, Up: Top - -Invoking `configure' -******************** - - Cygnus `configure' is a shell script which resides in a source tree. -The usual way to invoke `configure' is from the shell, as follows: - - eg$ ./configure HOSTTYPE - -This prepares the source in the current directory (`.') to be compiled -for a HOSTTYPE environment. It assumes that you wish to build programs -and files in the default "build directory" (also the current directory, -`.'). If you do not specify a value for HOSTTYPE, Cygnus `configure' -will attempt to discover this information by itself (*note Determining -system information: config.guess.). For information on HOSTTYPE -environments, *Note Host: Host. - - All GNU software is packaged with one or more `configure' script(s) -(*note How Configuration Should Work: (standards)Configuration.). By -using `configure' you prepare the source for your specific environment -by selecting and using `Makefile' fragments and fragments of shell -scripts, which are prepared in advance and stored with the source. - - `configure''s command-line options also allow you to specify other -aspects of the source configuration: - - configure HOSTTYPE [--target=TARGET] [--srcdir=DIR] [--rm] - [--site=SITE] [--prefix=DIR] [--exec-prefix=DIR] - [--program-prefix=STRING] [--tmpdir=DIR] - [--with-PACKAGE[=YES/NO]] [--without-PACKAGE] - [--enable-FEATURE[=YES/NO]] [--disable-FEATURE] - [--norecursion] [--nfp] [-s] [-v] [-V | --version] [--help] - -`--target=TARGET' - Requests that the sources be configured to target the TARGET - machine. If no target is specified explicitly, the target is - assumed to be the same as the host (i.e., a "native" - configuration). *Note Host: Host, and *Note Target: Target, for - discussions of each. - -`--srcdir=DIR' - Direct each generated `Makefile' to use the sources located in - directory DIR. Use this option whenever you wish the object code - to reside in a different place from the source code. The "build - directory" is always assumed to be the directory you call - `configure' from. See *Note Build directories: Build directories, - for an example. If the source directory is not specified, - `configure' assumes that the source is in your current directory. - If `configure' finds no `configure.in' there, it searches in the - same directory that the `configure' script itself lies in. - Pathnames specified (Values for DIR) can be either absolute - relative to the *build* directory. - -`--rm' - *Remove* the configuration specified by HOSTTYPE and the other - command-line options, rather than create it. - - *Note:* We recommend that you use `make distclean' rather than - use this option; see *Note Invoking `make': (make)Invoking - make, for details on `make distclean'. - -`--site=SITE' - Generate the `Makefile' using site-specific `Makefile' fragments - for SITE. *Note Adding information about local conventions: - Makefile fragments. - -`--prefix=DIR' - Configure the source to install programs and files under directory - DIR. - - This option sets the variable `prefix'. Each generated `Makefile' - will have its `prefix' variables set to this value. (*Note What - `configure' really does: What configure really does.) - -`--exec-prefix=DIR' - Configure the source to install "host dependent" files in DIR. - - This option sets the variable `exec_prefix'. Each generated - `Makefile' will have its `exec_prefix' variables set to this value. - (*Note What `configure' really does: What configure really does.) - -`--program-prefix=STRING' - Configure the source to install certain programs using STRING as a - prefix. This applies to programs which might be used for - cross-compilation, such as the compiler and the binary utilities, - and also to programs which have the same names as common Unix - programs, such as `make'. - - This option sets the variable `program_prefix'. Each generated - `Makefile' will have its `program_prefix' variables set to this - value. (*Note What `configure' really does: What configure really - does.) - -`--tmpdir=TMPDIR' - Use the directory TMPDIR for `configure''s temporary files. The - default is the value of the environment variable `TMPDIR', or - `/tmp' if the environment variable is not set. - -`--with-PACKAGE[=YES/NO]' -`--without-PACKAGE' - Indicate that PACKAGE is present, or not present, depending on - YES/NO. If YES/NO is nonexistent, its value is assumed to be - `yes'. `--without-PACKAGE' is equivalent to `--with-PACKAGE=no'. - - For example, if you wish to configure the program `gcc' for a Sun - SPARCstation running SunOS 4.x, and you want `gcc' to use the GNU - linker `ld', you can configure `gcc' using - - eg$ configure --with-gnu-ld sun4 - - *Note What `configure' really does: What configure really does, for - details. See the installation or release notes for your - particular package for details on which other PACKAGE options are - recognized. - -`--enable-FEATURE[=YES/NO]' -`--disable-FEATURE' - Include FEATURE, or not, depending on YES/NO. If YES/NO is - nonexistent, its value is assumed to be `yes'. - `--disable-FEATURE' is equivalent to `--enable-FEATURE=no'. - - *Note What `configure' really does: What configure really does, for - details. See the installation or release notes for your - particular package for details on which other FEATURE options are - recognized. - -`--norecursion' - Configure only this directory; ignore any subdirectories. This is - used by the executable shell script `config.status' to reconfigure - only the current directory; it is most often used - non-interactively, when `make' is invoked. (*Note - `config.status': config.status.) - -`--nfp' - Assume that the intended HOSTTYPE has no floating point unit. - -`-s' - Suppress status output. This option is used internally by - `configure' when calling itself recursively in subdirectories. You - can override this option with the `--verbose' option. - -`-v' -`--verbose' - Print status lines for each directory configured. Normally, only - the status lines for the initial working directory are printed. - -`--version' -`-V' - Print the `configure' version number. - -`--help' - Print a short summary of how to invoke `configure'. - - *Note:* You may introduce options with a single dash, `-', rather -than two dashes, `--'. However, you may not be able to truncate long -option names when using a single dash. When using two dashes, options -may be abbreviated as long as each option can be uniquely identified. -For example, - eg$ configure --s=/u/me/src HOSTTYPE - -is ambiguous, as `--s' could refer to either `--site' or `--srcdir'. -However, - eg$ configure --src=/u/me/src HOSTTYPE - -is a valid abbreviation. - - -File: configure.info, Node: Using configure, Next: Porting, Prev: Invoking configure, Up: Top - -Using `configure' -***************** - - `configure' prepares source directories for building programs in -them. "Configuring" is the process of preparing software to compile -correctly on a given "host", for a given "target". - - `configure' subsequently writes a configured `Makefile' from a -pre-built template; `configure' uses variables that have been set in the -configuring process to determine the values of some variables in the -`Makefile'. Because of this we will refer to both `configure' -variables and `Makefile' variables. This convention allows us to -determine where the variable should be set initially, in either -`configure.in' or `Makefile.in'. - -* Menu: - -* What configure really does:: What configure really does -* configure.in:: The configure.in input file -* Install locations:: Where to install things once they are built -* Host:: Telling configure what will source will be built -* Target:: Telling configure what the source will target -* Makefile fragments:: Adding information about local conventions -* Makefile extensions:: Extensions to the GNU coding standards - - -File: configure.info, Node: What configure really does, Next: configure.in, Up: Using configure - -What `configure' really does -============================ - - Cygnus `configure' is a shell script that sets up an environment in -which your programs will compile correctly for your machine and -operating system, and will install in proper places. `configure' -accomplishes this task by doing the following: - - * it generates a `Makefile' from a custom template called - `Makefile.in' in each relevant source directory; - - * it customizes the build process to your specifications; you set - certain variables for `configure', either on the command line or - in the file `configure.in', which subsequently sets variables in - each generated `Makefile' to be used by `make' when actually - building the software; - - * it creates "build directories", places for your code to be compiled - in before being installed; - - * it generates a `.gdbinit' in the build directory, if needed, to - communicate to `gdb' where to find the program's source code; - - * it generates a shell script called `config.status' which is used - most often by the `Makefile' to reconfigure itself; - - * it recurses in subdirectories, setting up entire trees so that - they build correctly; if `configure' finds another `configure' - script further down in a given source tree, it knows to use this - script and not recur. - - For the sake of safety (i.e., in order to prevent broken -installations), the GNU coding standards call for software to be -"configured" in such a way that an end user trying to build a given -package will be able to do so by affecting a finite number of -variables. All GNU software comes with an executable `configure' shell -script which sets up an environment within a build directory which will -correctly compile your new package for your host (or, alternatively, -whatever host you specify to `configure'). For further background on -this topic, see *Note Apologia Configure: (cfg-paper)Some Basic Terms, -by K. Richard Pixley. - - Use `configure' to set for the build process: - - * correct values for certain variables; - - * which type of host you wish to configure a given package for - (*note Host: Host.); - - * where you want to install this package (by using `prefix', - `exec-prefix' and `program-prefix'; *note Full descriptions of all - installation directories: Install details.); - - * optionally, which type of machine you wish to "target" this - package's output to (*note Target: Target.); - - * which other GNU packages are already installed and available to - this particular build (by using the `--with-PACKAGE' option; *note - Invoking `configure': Invoking configure.); - - * where to place temporary files (by using the `--tmpdir=DIR' - option; *note Invoking `configure': Invoking configure.); - - * whether to recur in subdirectories (changeable through the - `--norecursion' option; *note Invoking `configure': Invoking - configure.). - - `configure' uses a few other files to complete its tasks. These are -discussed in detail where noted. - -`configure.in' - Input file for `configure'. Shell script fragments reside here. - *Note The `configure.in' input file: configure.in. - -`Makefile.in' - Template which `configure' uses to build a file called `Makefile' - in the "build directory". *Note `Makefile' generation: Makefile - generation. - -`config.sub' - Shell script used by `configure' to expand referents to the - HOSTTYPE argument into a single specification of the form - CPU-VENDOR-OS. For instance, on the command line you can specify - - eg$ ./configure sun4 - - to configure for a Sun SPARCstation running SunOS 4.x. `configure' - consults `config.sub' to find that the three-part specification - for this is - - sparc-sun-sunos4.1.1 - - which notes the CPU as `sparc', the MANUFACTURER as `sun' (Sun - Microsystems), and the OS (operating system) as `sunos4.1.1', the - SunOS 4.1.1 release. *Note Variables available to `configure': - configure variables. - -`config.guess' - If you do not put the HOSTTYPE argument on the command line, - `configure' uses the `config.guess' shell script to make an - analysis of your machine (it assumes that you wish to configure - your software for the type of machine on which you are running). - The output of `config.guess' is a three-part identifier as - described above. - -`config.status' - The final step in configuring a directory is to create a shell - script, `config.status'. The main purpose of this file is to - allow the `Makefile' for the current directory to rebuild itself, - if necessary. *Note `config.status': config.status. - -`config/*' - `configure' uses three types of `Makefile' "fragments", which - reside in the directory `SRCDIR/config/'. *Note Adding - information about local conventions: Makefile fragments. - -* Menu: - -* Build variables:: Variable-spaghetti made simple -* Build directories:: Build directories described well -* Makefile generation:: To build a Makefile -* config.guess:: Be vewwy quiet, I'm hunting system information -* config.status:: To rebuild a Makefile - - -File: configure.info, Node: Build variables, Next: Build directories, Up: What configure really does - -Build variables ---------------- - - There are several variables in the build process which you can -control through build programs such as `make'. These include machine -definitions, local conventions, installation locations, locations for -temporary files, etc. This data is accessible through certain -variables which are configurable in the build process; we refer to them -as "build variables". - - For lists of build variables which you can affect by using -`configure', see *Note Variables available to `configure.in': configure -variables, and *Note Full descriptions of all installation directories: -Install details. - - Generally, build variables, which are used by the `Makefile' to -determine various aspects of the build and installation processes, are -changeable with command-line options to `configure'. In most large -suites of programs, like the Cygnus Support Developer's Kit, the -individual programs reside in several subdirectories of a single source -code "tree". All of these subdirectories need to be configured with -information relative to the "build directory", which is not known until -`configure' is run. Unless specified otherwise, `configure' -recursively configures every subdirectory in the source tree. - - Build variables are passed from `configure' directly into the -`Makefile', and use the same names (except that dashes are transformed -into underbars; for example, when you specify the option -`--exec-prefix' on the command line, the `Makefile' variable -`exec_prefix' is set). In other words, if you specify - - eg$ ./configure --prefix=/usr/gnu/local ... HOSTTYPE - -on the command line, `configure' sets an variable called `prefix' to -`/usr/gnu/local', and passes this into the `Makefile' in the same -manner. After this command, each `Makefile' generated by `configure' -will contain a line that reads: - - prefix = /usr/gnu/local - - For a list of the `Makefile' variables `configure' can change, and -instructions on how to change them, see *Note Variables available to -`configure.in': configure variables, and *Note Invoking `configure': -Invoking configure. - - -File: configure.info, Node: Build directories, Next: Makefile generation, Prev: Build variables, Up: What configure really does - -Build directories ------------------ - - By default, `configure' builds a `Makefile' and symbolic links in the -same directory as the source files. This default works for many cases, -but it has limitations. For instance, using this approach, you can -only build object code for one host at a time. - - We refer to each directory where `configure' builds a `Makefile' as -a "build directory". - - The build directory for any given build is always the directory from -which you call `configure', or `.' relative to your prompt. The default -"source directory", the place `configure' looks to find source code, is -also `.'. For instance, if we have a directory `/gnu-stuff/src/' that -is the top branch of a tree of GNU source code we wish to configure, -then the program we will use to configure this code is -`/gnu-stuff/src/configure', as follows. (Assume for the sake of -argument that our machine is a sun4.) - - eg$ cd /gnu-stuff/src - eg$ ./configure sun4 - Created "Makefile" in /gnu-stuff/src - eg$ - - We just configured the code in `/gnu-stuff/src' to run on a Sun -SPARCstation using SunOS 4.x by creating a `Makefile' in -`/gnu-stuff/src'. By default, we also specified that when this code is -built, the object code should reside in the same directory, -`/gnu-stuff/src'. - - However, if we wanted to build this code for more than one host, we -would be in trouble, because the new configuration would write over the -old one, destroying it in the process. What we can do is to make a new -"build directory" and configure from there. Running `configure' from -the new directory will place a correct `Makefile' and a `config.status' -in this new file. That is all `configure' does; we must run `make' to -generate any object code. - - The new `Makefile' in `/gnu-stuff/sun4-obj', created from the -template file `/gnu-stuff/src/Makefile.in', contains all the information -needed to build the program. - - eg$ mkdir /gnu-stuff/sun4-obj - eg$ cd /gnu-stuff/sun4-obj - eg$ ../src/configure --srcdir=../src sun4 - Created "Makefile" in /gnu-stuff/sun4-obj - eg$ ls - Makefile config.status - eg$ make all info install install-info clean - COMPILATION MESSAGES... - eg$ mkdir /gnu-stuff/solaris2 - eg$ cd /gnu-stuff/solaris2 - eg$ ../src/configure --srcdir=../src sol2 - Created "Makefile" in /gnu-stuff/solaris2 - eg$ ls - Makefile config.status - eg$ make all info install install-info clean - COMPILATION MESSAGES... - - We can repeat this for other configurations of the same software -simply by making a new build directory and reconfiguring from inside -it. If you do not specify the HOSTTYPE argument, `configure' will -attempt to figure out what kind of machine and operating system you -happen to be using. *Note Determining system information: -config.guess. Of course, this may not always be the configuration you -wish to build. - - *Caution:* If you build more than one configuration for a single -program, remember that you must also specify a different `--prefix' for -each configuration at configure-time. Otherwise, both configurations -will be installed in the same default location (`/usr/local'); the -configuration to be installed last would overwrite previously installed -configurations. - - -File: configure.info, Node: Makefile generation, Next: config.guess, Prev: Build directories, Up: What configure really does - -`Makefile' generation ---------------------- - - Cygnus `configure' creates a file called `Makefile' in the build -directory which can be used with `make' to automatically build a given -program or package. `configure' also builds a `Makefile' for each -relevant subdirectory for a given program or package (irrelevant -subdirectories would be those which contain no code which needs -configuring, and which therefore have no `configure' input file -`configure.in' and no `Makefile' template `Makefile.in'). *Note `make' -Invocation: (make)Running, for details on using `make' to compile your -source code. - - Each `Makefile' contains variables which have been configured for a -specific build. These build variables are determined when `configure' -is run. All build variables have defaults. By default, `configure' -generates a `Makefile' which specifies: - - * a "native" build, which is to occur - - * in the current directory, and which will be installed - - * in the default installation directory (`/usr/local') when the code - is compiled with `make'. - -Variables are changeable through command-line options to `configure' -(*note Invoking `configure': Invoking configure.). - - If you are porting a new program and intend to use `configure', see -*Note Porting with `configure': Porting, as well as *Note Writing -Makefiles: (make)Makefiles, and *Note Makefile Conventions: -(standards)Makefiles. - - -File: configure.info, Node: config.guess, Next: config.status, Prev: Makefile generation, Up: What configure really does - -Determining system information ------------------------------- - - The shell script `config.guess' is called when you do not specify a -HOSTTYPE on the command line to `configure'. `config.guess' acquires -available system information from your local machine through the shell -command `uname'. It compares this information to a database and -attempts to determine a usable three-part system identifier (known as a -"triple") to use as your HOSTTYPE. *Note What `configure' really does: -What configure really does, to see how this information is used. - - *Note:* If you do not specify a HOSTTYPE on the command line, -`configure' will attempt to configure your software to run on the -machine you happen to be using. This may not be the configuration you -desire. - - -File: configure.info, Node: config.status, Prev: config.guess, Up: What configure really does - -`config.status' ---------------- - - The final step in configuring a directory is to create an executable -shell script, `config.status'. The main purpose of this file is to -allow the `Makefile' for the current directory to rebuild itself, if -necessary. It is usually run from within the `Makefile'. *Note -Extensions to the GNU coding standards: Makefile extensions. - - `config.status' also contains a record of the `configure' session -which created it. - - -File: configure.info, Node: configure.in, Next: Install locations, Prev: What configure really does, Up: Using configure - -The `configure.in' input file -============================= - - A `configure.in' file for Cygnus `configure' consists of a -"per-invocation" section, followed by a "per-host" section, followed by -a "per-target" section, optionally followed by a "post-target" section. -Each section is a shell script fragment, which is executed by the -`configure' shell script at an appropriate time. Values are passed -among `configure' and the shell fragments through a set of shell -variables. When each section is being interpreted by the shell, the -shell's current directory is the build directory, and any files created -by the section (or referred to by the section) will be relative to the -build directory. To reference files in other places (such as the -source directory), prepend a shell variable such as `$(srcdir)/' to the -desired file name. - - The beginning of the `configure.in' file begins the "per-invocation" -section. - - A line beginning with `# per-host:' begins the "per-host" section. - - A line beginning with `# per-target:' begins the "per-target" -section. - - If it exists, the "post-target" section begins with `# post-target:'. - -* Menu: - -* configure variables:: Variables available to configure.in -* Minimal:: A minimal configure.in -* Declarations:: For each invocation -* per-host:: Host-specific instructions -* per-target:: Target-specific instructions -* post-target:: Instructions to be executed after target info -* Example:: An example configure.in - - -File: configure.info, Node: configure variables, Next: Minimal, Up: configure.in - -Variables available to `configure.in' -------------------------------------- - - The following variables pass information between the standard parts -of `configure' and the shell-script fragments in `configure.in': - -`srctrigger' - Contains the name of a source file that is expected to live in the - source directory. You must usually set this in the - "per-invocation" section of `configure.in'. `configure' tests to - see that this file exists. If the file does not exist, - `configure' prints an error message. This is used as a sanity - check that `configure.in' matches the source directory. - -`srcname' - Contains the name of the source collection contained in the source - directory. You must usually set this in the "per-invocation" - section of `configure.in'. If the file named in `srctrigger' does - not exist, `configure' uses the value of `srcname' when it prints - the error message. - -`configdirs' - Contains the names of any subdirectories in which `configure' - should recurse. You must usually set this in the "per-invocation" - section of `configure.in'. If `Makefile.in' contains a line - starting with `SUBDIRS =', then it will be replaced with an - assignment to `SUBDIRS' using the value of `configdirs' (if - `subdirs' is empty). This can be used to determine which - directories to configure and build depending on the host and - target configurations. Use `configdirs' (instead of the `subdirs' - variable described below) if you want to be able to partition the - subdirectories, or use independent `Makefile' fragments. Each - subdirectory can be independent, and independently reconfigured. - -`subdirs' - Contains the names of any subdirectories where `configure' should - create a `Makefile' (in addition to the current directory), - *without* recursively running `configure'. Use `subdirs' (instead - of the `configdirs' variable described above) if you want to - configure all of the directories as a unit. Since there is a - single invocation of `configure' that configures many directories, - all the directories can use the same `Makefile' fragments, and the - same `configure.in'. - -`host' - Contains the full configuration name for the host (generated by - the script `config.sub' from the name that you entered). This is - a three-part name (commonly referred to as a "triple") of the form - CPU-VENDOR-OS. - - There are separate variables `host_cpu', `host_vendor', and - `host_os' that you can use to test each of the three parts; this - variable is useful, however, for error messages, and for testing - combinations of the three components. - -`host_cpu' - Contains the first element of the canonical triple representing - the host as returned by `config.sub'. This is occasionally used to - distinguish between minor variations of a particular vendor's - operating system and sometimes to determine variations in binary - format between the host and the target. - -`host_vendor' - Contains the second element of the canonical triple representing - the host as returned by `config.sub'. This is usually used to - distinguish among the numerous variations of *common* operating - systems. - -`host_os' - Contains the the third element of the canonical triple - representing the host as returned by `config.sub'. - -`target' - Contains the full configuration name (generated by the script - `config.sub' from the name that you entered) for the target. Like - the host, this is a three-part name of the form CPU-VENDOR-OS. - - There are separate variables `target_cpu', `target_vendor', and - `target_os' that you can use to test each of the three parts; this - variable is useful, however, for error messages, and for testing - combinations of the three components. - -`target_cpu' - Contains the first element of the canonical triple representing - the target as returned by `config.sub'. This variable is used - heavily by programs which are involved in building other programs, - like the compiler, assembler, linker, etc. Most programs will not - need the `target' variables at all, but this one could conceivably - be used to build a program, for instance, that operated on binary - data files whose byte order or alignment differ from the system - where the program is running. - -`target_vendor' - Contains the second element of the canonical triple representing - the target as returned by `config.sub'. This is usually used to - distinguish among the numerous variations of *common* operating - systems or object file formats. It is sometimes used to switch - between different flavors of user interfaces. - -`target_os' - Contains the the third element of the canonical triple - representing the target as returned by `config.sub'. This - variable is used by development tools to distinguish between - subtle variations in object file formats that some vendors use - across operating system releases. It might also be use to decide - which libraries to build or what user interface the tool should - provide. - -`floating_point' - Set to `no' if you invoked `configure' with the `--nfp' - command-line option, otherwise it is empty. This is a request to - target machines with "no floating point" unit, even if the targets - ordinarily have floating point units available. - -`gas' - Set to `true' if you invoked `configure' with the `--with-gnu-as' - command line option, otherwise it is empty. This is a request to - assume that the specified HOSTTYPE machine has GNU `as' available - even if it ordinarily does not. - -`srcdir' - Set to the name of the directory containing the source for this - program. This will be different from `.' if you have specified the - `--srcdir=DIR' option. `srcdir' can indicate either an absolute - path or a path relative to the build directory. - -`package_makefile_frag' - If set in `configure.in', this variable should be the name a file - relative to `srcdir' to be included in the resulting `Makefile'. - If the named file does not exist, `configure' will print a warning - message. This variable is not set by `configure'. - -`host_makefile_frag' - If set in `configure.in', this variable should be the name a file - relative to `srcdir' to be included in the resulting `Makefile'. - If the named file does not exist, `configure' will print a warning - message. This variable is not set by `configure'. - -`target_makefile_frag' - If set in `configure.in', this variable should be the name of a - file, relative to `srcdir', to be included in the resulting - `Makefile'. If the named file does not exist, `configure' will - print a warning message. This variable is not set by `configure'. - -`site_makefile_frag' - Set to a file name representing to the default `Makefile' fragment - for this host. It may be set in `configure.in' to override this - default. Normally `site_makefile_frag' is empty, but will have a - value if you specify `--site=SITE' on the command line. - -`Makefile' - Set to the name of the generated `Makefile'. Normally this value - is precisely `Makefile', but some programs may want something else. - -`removing' - Normally empty but will be set to some non-null value if you - specified `--rm' on the command line. That is, if `removing' is - not empty, then `configure' is *removing* a configuration rather - than creating one. - -`files' - If this variable is not empty following the "per-target" section, - then each word in its value will be the target of a symbolic link - named in the corresponding word from the `links' variable. - -`links' - If the `files' variable is not empty following the "per-target" - section, then `configure' creates symbolic links with the first - word of `links' pointing to the first word of `files', the second - word of `links' pointing to the second word of `files', and so on. - - -File: configure.info, Node: Minimal, Next: Declarations, Prev: configure variables, Up: configure.in - -A minimal `configure.in' ------------------------- - - A minimal `configure.in' consists of four lines. - - srctrigger=foo.c - srcname="source for the foo program" - # per-host: - # per-target: - - The `# per-host:' and `# per-target:' lines divide the file into the -three required sections. The `srctrigger' line names a file. -`configure' checks to see that this file exists in the source directory -before configuring. If the `srctrigger' file does not exist, -`configure' uses the value of `srcname' to print an error message about -not finding the source. - - This particular example uses no links, and only the default host, -target, and site-specific `Makefile' fragments if they exist. - - -File: configure.info, Node: Declarations, Next: per-host, Prev: Minimal, Up: configure.in - -For each invocation -------------------- - - `configure' invokes the entire shell script fragment from the start -of `configure.in' up to a line beginning with `# per-host:' immediately -after parsing command line arguments. The variables `srctrigger' and -`srcname' *must* be set here. - - You might also want to set the variables `configdirs' and -`package_makefile_frag' here. - - -File: configure.info, Node: per-host, Next: per-target, Prev: Declarations, Up: configure.in - -Host-specific instructions --------------------------- - - The "per-host" section of `configure.in' starts with the line that -begins with `# per-host:' and ends before a line beginning with -`# per-target:'. `configure' invokes the commands in the "per-host" -section when determining host-specific information. - - This section usually contains a big `case' statement using the -variable `host' to determine appropriate values for -`host_makefile_frag' and `files', although `files' is not usually set -here. Usually, it is set at the end of the "per-target" section after -determining the names of the target specific configuration files. - - -File: configure.info, Node: per-target, Next: post-target, Prev: per-host, Up: configure.in - -Target-specific instructions ----------------------------- - - The "per-target" section of `configure.in' starts with the line that -begins with `# per-target:' and ends before the line that begins with -`# post-target:', if there is such a line. Otherwise the "per-target" -section extends to the end of the file. `configure' invokes the -commands in the "per-target" section when determining target-specific -information, and before building any files, directories, or links. - - This section usually contains a big `case' statement using the -variable `target' to determine appropriate values for -`target_makefile_frag' and `files'. The last lines in the "per-target" -section normally set the variables `files' and `links'. - - -File: configure.info, Node: post-target, Next: Example, Prev: per-target, Up: configure.in - -Instructions to be executed after target info ---------------------------------------------- - - The "post-target" section is optional. If it exists, the -`post-target' section starts with a line beginning with -`# Post-target:' and extends to the end of the file. If it exists, -`configure' invokes this section once for each target after building -all files, directories, or links. - - This section is seldom needed, but you can use it to edit the -`Makefile' generated by `configure'. - - -File: configure.info, Node: Example, Prev: post-target, Up: configure.in - -An example `configure.in' -------------------------- - - Here is a small example of a `configure.in' file. - - # This file is a collection of shell script fragments - # used to tailor a template configure script as - # appropriate for this directory. For more information, - # see configure.texi. - - configdirs= - srctrigger=warshall.c - srcname="bison" - - # per-host: - case "${host}" in - m88k-motorola-*) - host_makefile_frag=config/mh-delta88 - ;; - esac - - # per-target: - files="bison_in.hairy" - links="bison.hairy" - - # post-target: - - -File: configure.info, Node: Install locations, Next: Host, Prev: configure.in, Up: Using configure - -Install locations -================= - - Using the default configuration, `make install' creates a single -tree of files, some of which are programs. The location of this tree -is determined by the value of the variable `prefix'. The default value -of `prefix' is `/usr/local'. This is often correct for native tools -installed on only one host. - -* Menu: - -* prefix:: Changing the default install directory -* exec_prefix:: How to separate host independent files - from host dependent files when - installing for multiple hosts -* Install details:: Full descriptions of all installation subdirectories - - -File: configure.info, Node: prefix, Next: exec_prefix, Up: Install locations - -Changing the default install directory --------------------------------------- - - In the default configuration, all files are installed in -subdirectories of `/usr/local'. The location is determined by the -value of the `configure' variable `prefix'; in turn, this determines the -value of the `Makefile' variable of the same name (`prefix'). - - You can also set the value of the `Makefile' variable `prefix' -explicitly each time you invoke `make' if you are so inclined. However, -because many programs have this location compiled in, you must specify -the `prefix' value consistently on each invocation of `make', or you -will end up with a broken installation. - - To make this easier, the value of the `configure' variable `prefix' -can be set on the command line to `configure' using the option -`--prefix='. - - -File: configure.info, Node: exec_prefix, Next: Install details, Prev: prefix, Up: Install locations - -Installing for multiple hosts ------------------------------ - - By default, host dependent files are installed in subdirectories of -`$(exec_prefix)'. The location is determined by the value of the -`configure' variable `exec_prefix', which determines the value of the -`Makefile' variable `exec_prefix'. This makes it easier to install for -a single host, and simplifies changing the default location for the -install tree. The default doesn't allow for multiple hosts to -effectively share host independent files, however. - - To configure so that multiple hosts can share common files, use -something like: - - configure HOST1 -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host1 - make all info install install-info clean - - configure HOST2 -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host2 - make all info install install-info - - The first line configures the source for HOST1 to place host-specific -programs in subdirectories of `/usr/gnu/H-HOST1'. - - The second line builds and installs all programs for HOST1, -including both host-independent and host-specific files, as well as -removing the host-specific object files from of the build directory. - - The third line reconfigures the source for HOST2 to place host -specific programs in subdirectories of `/usr/gnu/H-HOST2'. - - The fourth line builds and installs all programs for HOST2. Host -specific files are installed in new directories, but the host -independent files are installed *on top of* the host independent files -installed for HOST1. This results in a single copy of the host -independent files, suitable for use by both hosts. - - *Note Extensions to the GNU coding standards: Makefile extensions, -for more information. - - -File: configure.info, Node: Install details, Prev: exec_prefix, Up: Install locations - -Full descriptions of all installation subdirectories ----------------------------------------------------- - - During any install, a number of standard directories are created. -Their names are determined by `Makefile' variables. Some of the -defaults for `Makefile' variables can be changed at configuration time -using command line options to `configure'. For more information on the -standard directories or the `Makefile' variables, please refer to *Note -Makefile Conventions: (standards)Makefiles. See also *Note Extensions -to the GNU coding standards: Makefile extensions. - - Note that `configure' does not create the directory indicated by the -variable `srcdir' at any time. `$(srcdir)' is not an installation -directory. - - You can override all `Makefile' variables on the command line to -`make'. (*Note Overriding Variables: (make)Overriding.) If you do so, -you will need to specify the value precisely the same way for each -invocation of `make', or you risk ending up with a broken installation. -This is because many programs have the locations of other programs or -files compiled into them. If you find yourself overriding any of the -variables frequently, you should consider site dependent `Makefile' -fragments. See also *Note Adding site info: Sites. - - During `make install', a number of standard directories are created -and populated. The following `Makefile' variables define them. Those -whose defaults are set by corresponding `configure' variables are marked -"`Makefile' and `configure'". - -`prefix (`Makefile' and `configure')' - The root of the installation tree. You can set its `Makefile' - default with the `--prefix=' command line option to `configure' - (*note Invoking `configure': Invoking configure.). The default - value for `prefix' is `/usr/local'. - -`bindir' - A directory for binary programs that users can run. The default - value for `bindir' depends on `prefix'; `bindir' is normally - changed only indirectly through `prefix'. The default value for - `bindir' is `$(prefix)/bin'. - -`exec_prefix (`Makefile' and `configure')' - A directory for host dependent files. You can specify the - `Makefile' default value by using the `--exec_prefix=' option to - `configure'. (*Note Invoking `configure': Invoking configure.) - The default value for `exec_prefix' is `$(prefix)'. - -`libdir' - A directory for libraries and support programs. The default value - for `libdir' depends on `prefix'; `libdir' is normally changed only - indirectly through `prefix'. The default value for `libdir' is - `$(prefix)/lib'. - -`mandir' - A directory for `man' format documentation ("man pages"). The - default value for `mandir' depends on `prefix'; `mandir' is - normally changed only indirectly through `prefix'. The default - value for `mandir' is `$(prefix)/man'. - -`manNdir' - These are eight variables named `man1dir', `man2dir', etc. They - name the specific directories for each man page section. For - example, `man1dir' by default holds the filename `$(mandir)/man1'; - this directory contains `emacs.1' (the man page for GNU Emacs). - Similarly, `man5dir' contains the value `$(mandir)/man5', - indicating the directory which holds `rcsfile.5' (the man page - describing the `rcs' data file format). The default value for any - of the `manNdir' variables depends indirectly on `prefix', and is - normally changed only through `prefix'. The default value for - `manNdir' is `$(mandir)/manN'. - -`manNext' - *Not supported by Cygnus `configure'*. The `GNU Coding Standards' - do not call for `man1ext', `man2ext', so the intended use for - `manext' is apparently not parallel to `mandir'. Its use is not - clear. (See also *Note Extensions to the GNU coding standards: - Makefile extensions.) - -`infodir' - A directory for `info' format documentation. The default value for - `infodir' depends indirectly on `prefix'; `infodir' is normally - changed only through `prefix'. The default value for `infodir' is - `$(prefix)/info'. - -`docdir' - A directory for any documentation that is in a format other than - those used by `info' or `man'. The default value for `docdir' - depends indirectly on `prefix'; `docdir' is normally changed only - through `prefix'. The default value for `docdir' is - `$(datadir)/doc'. *This variable is an extension to the GNU - coding standards*. (See also *Note Extensions to the GNU coding - standards: Makefile extensions.) - -`includedir' - A directory for the header files accompanying the libraries - installed in `libdir'. The default value for `includedir' depends - on `prefix'; `includedir' is normally changed only indirectly - through `prefix'. The default value for `includedir' is - `$(prefix)/include'. - - -File: configure.info, Node: Host, Next: Target, Prev: Install locations, Up: Using configure - -Host -==== - - The arguments to `configure' are "hosttypes". By "hosttype" we mean -the "environment" in which the source will be compiled. This need not -necessarily be the same as the physical machine involved, although it -usually is. - - For example, if some obscure machine had the GNU `POSIX' emulation -libraries available, it would be possible to configure most GNU source -for a `POSIX' system and build it on the obscure host. - - For more on this topic, see *Note On Configuring Development Tools: -(cfg-paper)Host Environments. - - -File: configure.info, Node: Target, Next: Makefile fragments, Prev: Host, Up: Using configure - -Target -====== - - For building native development tools, or most of the other GNU -tools, you need not worry about the target. The "target" of a -configuration defaults to the same as the "host". - - For building cross development tools, please see *Note On -Configuring Development Tools: (cfg-paper)Building Development -Environments. - diff --git a/gnu/dist/etc/configure.info-2 b/gnu/dist/etc/configure.info-2 deleted file mode 100644 index bc5d6fb04850..000000000000 --- a/gnu/dist/etc/configure.info-2 +++ /dev/null @@ -1,566 +0,0 @@ -This is Info file configure.info, produced by Makeinfo-1.64 from the -input file ./configure.texi. - -START-INFO-DIR-ENTRY -* configure: (configure). Cygnus configure. -END-INFO-DIR-ENTRY - - This document describes the Cygnus Support version of `configure'. - - Copyright (C) 1991, 1992, 1993 Cygnus Support Permission is granted -to make and distribute verbatim copies of this manual provided the -copyright notice and this permission notice are preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by Cygnus Support. - - -File: configure.info, Node: Makefile fragments, Next: Makefile extensions, Prev: Target, Up: Using configure - -Adding information about local conventions -========================================== - - If you find that a tool does not get configured to your liking, or if -`configure''s conventions differ from your local conventions, you should -probably consider "site-specific `Makefile' fragments". See also *Note -Adding site info: Sites. - - These are probably not the right choice for options that can be set -from the `configure' command line or for differences that are host or -target dependent. - - Cygnus `configure' uses three types of `Makefile' fragments. In a -generated `Makefile' they appear in the order: "target fragment", "host -fragment", and "site fragment". This allows host fragments to override -target fragments, and site fragments to override both. - - Host-specific `Makefile' fragments conventionally reside in the -`./config/' subdirectory with names of the form `mh-HOSTTYPE'. They -are used for hosts that require odd options to the standard compiler and -for compile time options based on the host configuration. - - Target-specific `Makefile' fragments conventionally reside in the -`./config/' subdirectory with names of the form `mt-TARGET'. They are -used for target dependent compile time options. - - Site specific `Makefile' fragments conventionally reside in the -`./config/' subdirectory with names of the form `ms-SITE'. They are -used to override host- and target-independent compile time options. -Note that you can also override these options on the `make' invocation -line. - - -File: configure.info, Node: Makefile extensions, Prev: Makefile fragments, Up: Using configure - -Extensions to the GNU coding standards -====================================== - - The following additions to the GNU coding standards are required for -Cygnus `configure' to work properly. - - * The `Makefile' must contain exactly one line starting with `####'. - This line should follow any default macro definitions but precede - any rules. Host, target, and site-specific `Makefile' fragments - will be inserted immediately after this line. If the line is - missing, the fragments will not be inserted. - - * Cygnus adds the following targets to each `Makefile'. Their - existence is not required for Cygnus `configure', but they are - documented here for completeness. - - `info' - Build all info files from texinfo source. - - `install-info' - Install all info files. - - `clean-info' - Remove all info files and any intermediate files that can be - generated from texinfo source. - - `Makefile' - Calls `./config.status' to rebuild the `Makefile' in this - directory. - - * The following `Makefile' targets have revised semantics: - - `install' - Should *not* depend on the target `all'. If the program is - not already built, `make install' should fail. This allows - you to install programs even when `make' would otherwise - determine them to be out of date. This can happen, for - example, when the result of a `make all' is transported via - tape to another machine for installation. - - `clean' - Should remove any file that can be regenerated by the - `Makefile', excepting only the `Makefile' itself, and any - links created by `configure'. That is, `make all clean' - should return all directories to their original condition. - If this is not done, then the command sequence - - configure HOST1 ; make all install clean ; - configure HOST2 ; make all install - - will fail because of intermediate files intended for HOST1. - - * Cygnus adds the following macros to all `Makefile.in' files, but - you are not required to use them to run Cygnus `configure'. - - `docdir' - The directory in which to install any documentation that is - not either a `man' page or an `info' file. For `man' pages, - see `mandir'; for `info', see `infodir'. - - `includedir' - The directory in which to install any header files that - should be made available to users. This is distinct from the - `gcc' include directory, which is intended for `gcc' only. - Files in `includedir' may be used by `cc' as well. - - * The following macros have revised semantics. Most of them describe - installation directories; see also *Note Full description of all - installation subdirectories: Install details. - - `datadir' - is used for host independent data files. - - `mandir' - The default path for `mandir' depends on `prefix'. - - `infodir' - The default path for `infodir' depends on `prefix'. - - `BISON' - is assumed to have a `yacc' calling convention. To use GNU - `bison', use `BISON=bison -y'. - - * Each Cygnus `Makefile' also conforms to one additional restriction: - - When libraries are installed, the line containing the call to - `INSTALL_DATA' should always be followed by a line containing a - call to `RANLIB' on the installed library. This is to accommodate - systems that use `ranlib'. Systems that do not use `ranlib' can - set `RANLIB' to "`echo'" in a host specific `Makefile' fragment. - - -File: configure.info, Node: Porting, Next: Variables Index, Prev: Using configure, Up: Top - -Porting with `configure' -************************ - - This section explains how to add programs, host and target -configuration names, and site-specific information to Cygnus -`configure'. - -* Menu: - -* Programs:: Adding configure to new programs -* Hosts and targets:: Adding hosts and targets -* Sites:: Adding site info - - -File: configure.info, Node: Programs, Next: Hosts and targets, Up: Porting - -Adding `configure' to new programs -================================== - - If you are writing a new program, you probably shouldn't worry about -porting or configuration issues until it is running reasonably on some -host. Then refer back to this section. - - If your program currently has a `configure' script that meets the GNU -standards (*note How Configuration Should Work: -(standards)Configuration., please do not add Cygnus `configure'. It -should be possible to add this program without change to a Cygnus -`configure' style source tree. - - If the program is not target dependent, please consider using -`autoconf' instead of Cygnus `configure'. `autoconf' is available from -the Free Software Foundation; it is a program which generates an -executable shell script called `configure' by automatically finding -information on the system to be configured on and embedding this -information in the shell script. `configure' scripts generated by -`autoconf' require no arguments, and accept the same options as Cygnus -`configure'. For detailed instructions on using `autoconf', see *Note -How to organize and produce Autoconf scripts: (autoconf)Making -configure Scripts. - - To add Cygnus `configure' to an existing program, do the following: - -*Make sure the `Makefile' conforms to the GNU standard - The coding standard for writing a GNU `Makefile' is described in - *Note Makefile Conventions: (standards)Makefiles. For technical - information on writing a `Makefile', see *Note Writing Makefiles: - (make)Makefiles. - -*Add Cygnus extensions to the `Makefile' - These are described in *Note Extensions to the GNU coding - standards: Makefile extensions. - -*Collect package specific definitions in a single file - Many packages are best configured using a common `Makefile' - fragment which is included by all of the makefiles in the - different directories of the package. In order to accomplish - this, set the variable `package_makefile_fragment' to the name of - the file. It will be inserted into the final `Makefile' before - the target-specific fragment. - -*Move host support from `Makefile' to fragments - This usually involves finding sections of the `Makefile' that say - things like "uncomment these lines for host HOSTTYPE" and moving - them to a new file called `./config/mh-HOSTTYPE'. For more - information, see *Note Adding hosts and targets: Hosts and targets. - -*Choose defaults - If the program has compile-time options that determine the way the - program should behave, choose reasonable defaults and make these - `Makefile' variables. Be sure the variables are assigned their - default values before the `####' line so that site-specific - `Makefile' fragments can override them (*note Extensions to the - GNU coding standards: Makefile extensions.). - -*Locate configuration files - If there is configuration information in header files or source - files, separate it in such a way that the files have generic - names. Then move the specific instances of those files into the - `./config/' subdirectory. - -*Separate host and target information - Some programs already have this information separated. If yours - does not, you will need to separate these two kinds of - configuration information. "Host specific" information is the - information needed to compile the program. "Target specific" - information is information on the format of data files that the - program will read or write. This information should live in - separate files in the `./config/' subdirectory with names that - reflect the configuration for which they are intended. - - At this point you might skip this step and simply move on. If you - do, you should end up with a program that can be configured only - to build "native" tools, that is, tools for which the host system - is also the target system. Later, you could attempt to build a - cross tool and separate out the target-specific information by - figuring out what went wrong. This is often simpler than combing - through all of the source code. - -*Write `configure.in' - Usually this involves writing shell script fragments to map from - canonical configuration names into the names of the configuration - files. These files will then be linked at configure time from the - specific instances of those files in `./config' to files in the - build directory with more generic names. (See also *Note Build - directories: Build directories.) The format of `configure.in' is - described in *Note The `configure.in' input file: configure.in. - -*Rename `Makefile' to `Makefile.in' - At this point you should have a program that can be configured using -Cygnus `configure'. - - -File: configure.info, Node: Hosts and targets, Next: Sites, Prev: Programs, Up: Porting - -Adding hosts and targets -======================== - - To add a host or target to a program that already uses Cygnus -`configure', do the following. - - * Make sure the new configuration name is represented in - `config.sub'. If not, add it. For more details, see the comments - in the shell script `config.sub'. - - * If you are adding a host configuration, look in `configure.in', in - the "per-host" section. Make sure that your configuration name is - represented in the mapping from host configuration names to - configuration files. If not, add it. Also see *Note The - `configure.in' input file: configure.in. - - * If you are adding a target configuration, look in `configure.in', - in the "per-target" section. Make sure that your configuration - name is represented in the mapping from target configuration names - to configuration files. If not, add it. Also see *Note The - `configure.in' input file: configure.in. - - * Look in `configure.in' for the variables `files', `links', - `host_makefile_frag', and `target_makefile_frag'. The values - assigned to these variables are the names of the configuration - files, (relative to `srcdir') that the program uses. Make sure - that copies of the files exist for your host. If not, create - them. See also *Note Variables available to `configure.in': - configure variables. - - This should be enough to `configure' for a new host or target -configuration name. Getting the program to compile and run properly -represents the hardest work of any port. - - -File: configure.info, Node: Sites, Prev: Hosts and targets, Up: Porting - -Adding site info -================ - - If some of the `Makefile' defaults are not right for your site, you -can build site-specific `Makefile' fragments. To do this, do the -following. - - * Choose a name for your site. It must currently be less than - eleven characters. - - * If the program source does not have a `./config/' subdirectory, - create it. - - * Create a file called `./config/ms-SITE' where SITE is the name of - your site. In it, set whatever `Makefile' variables you need to - override to match your site's conventions. - - * Configure the program with: - - configure ... --site=SITE - - -File: configure.info, Node: Variables Index, Next: Concept Index, Prev: Porting, Up: Top - -Variable Index -************** - -* Menu: - -* bindir: Install details. -* configdirs: configure variables. -* disable-FEATURE: Invoking configure. -* docdir: Install details. -* enable-FEATURE: Invoking configure. -* exec-prefix: Invoking configure. -* exec_prefix <1>: exec_prefix. -* exec_prefix: Install details. -* files: configure variables. -* floating_point: configure variables. -* gas: configure variables. -* host: configure variables. -* host_cpu: configure variables. -* host_makefile_frag: configure variables. -* host_os: configure variables. -* host_vendor: configure variables. -* includedir: Install details. -* infodir: Install details. -* libdir: Install details. -* links: configure variables. -* Makefile: configure variables. -* manNdir: Install details. -* manNext: Install details. -* mandir: Install details. -* nfp: Invoking configure. -* norecursion: Invoking configure. -* package_makefile_frag: configure variables. -* prefix <1>: prefix. -* prefix <2>: Install details. -* prefix: Invoking configure. -* program-prefix: Invoking configure. -* removing: configure variables. -* rm: Invoking configure. -* site: Invoking configure. -* site_makefile_frag: configure variables. -* srcdir <1>: configure variables. -* srcdir <2>: What configure does. -* srcdir: Invoking configure. -* srcname: configure variables. -* srctrigger: configure variables. -* subdirs: configure variables. -* target <1>: Invoking configure. -* target: configure variables. -* target_cpu: configure variables. -* target_makefile_frag: configure variables. -* target_os: configure variables. -* target_vendor: configure variables. -* tmpdir: Invoking configure. -* verbose: Invoking configure. -* with-PACKAGE: Invoking configure. -* without-PACKAGE: Invoking configure. - - -File: configure.info, Node: Concept Index, Prev: Variables Index, Up: Top - -Concept Index -************* - -* Menu: - -* -disable-FEATURE: Invoking configure. -* -enable-FEATURE: Invoking configure. -* -exec-prefix: Invoking configure. -* -help: Invoking configure. -* -nfp: Invoking configure. -* -norecursion: Invoking configure. -* -prefix: Invoking configure. -* -program-prefix: Invoking configure. -* -rm: Invoking configure. -* -site: Invoking configure. -* -srcdir: Invoking configure. -* -target: Invoking configure. -* -tmpdir: Invoking configure. -* -verbose: Invoking configure. -* -version: Invoking configure. -* -with-PACKAGE: Invoking configure. -* -without-PACKAGE: Invoking configure. -* -s: Invoking configure. -* -v: Invoking configure. -* .gdbinit: What configure does. -* autoconf: Programs. -* bindir: Install details. -* config.guess: config.guess. -* config.guess definition: What configure really does. -* config.status <1>: config.status. -* config.status: What configure does. -* config.status definition: What configure really does. -* config.sub definition: What configure really does. -* config/ subdirectory: What configure really does. -* configdirs: configure variables. -* configure.in: configure.in. -* configure.in definition: What configure really does. -* configure back end: What configure really does. -* configure details: What configure really does. -* disable-FEATURE option: Invoking configure. -* docdir: Install details. -* enable-FEATURE option: Invoking configure. -* exec-prefix option: Invoking configure. -* exec_prefix: Install details. -* floating_point: configure variables. -* help option: Invoking configure. -* host: configure variables. -* includedir: Install details. -* infodir: Install details. -* libdir: Install details. -* Makefile.in definition: What configure really does. -* Makefile extensions: Makefile extensions. -* Makefile fragments: Makefile fragments. -* Makefile generation <1>: Makefile generation. -* Makefile generation: What configure does. -* manNdir: Install details. -* manNext: Install details. -* mandir: Install details. -* nfp option <1>: Invoking configure. -* nfp option: configure variables. -* norecursion option: Invoking configure. -* prefix: Install details. -* prefix option <1>: Invoking configure. -* prefix option: prefix. -* program-prefix option: Invoking configure. -* rm option <1>: Invoking configure. -* rm option: configure variables. -* site option: Invoking configure. -* srcdir <1>: configure variables. -* srcdir: What configure does. -* srcdir option: Invoking configure. -* srcname: configure variables. -* srctrigger: configure variables. -* subdirs: configure variables. -* s option: Invoking configure. -* target: configure variables. -* target option: Invoking configure. -* tmpdir option: Invoking configure. -* verbose option: Invoking configure. -* v option: Invoking configure. -* with-PACKAGE option: Invoking configure. -* with-gnu-as option: configure variables. -* without-PACKAGE option: Invoking configure. -* configure.in interface: configure variables. -* host shell-script fragment: per-host. -* per-host section <1>: per-host. -* per-host section: configure.in. -* per-invocation section <1>: configure.in. -* per-invocation section: Declarations. -* per-target section <1>: configure.in. -* per-target section: per-target. -* post-target section <1>: configure.in. -* post-target section: post-target. -* Abbreviating option names: Invoking configure. -* Adding configure to new programs: Programs. -* Adding hosts and targets: Hosts and targets. -* Adding local info: Makefile fragments. -* Adding site info <1>: Sites. -* Adding site info: Makefile fragments. -* Behind the scenes: What configure really does. -* BISON: Makefile extensions. -* Build directories <1>: What configure does. -* Build directories: Build directories. -* Build variables: Build variables. -* Building for multiple hosts: Build directories. -* Building for multiple targets: Build directories. -* Canonical "triple": configure variables. -* Changing the install directory: prefix. -* clean: Makefile extensions. -* clean-info: Makefile extensions. -* Coding standards extensions: Makefile extensions. -* configure variables: configure variables. -* Configuring for multiple hosts: exec_prefix. -* Cygnus extensions: Makefile extensions. -* Cygnus Support Developer's Kit <1>: What configure does. -* Cygnus Support Developer's Kit: Build variables. -* datadir: Makefile extensions. -* Declarations section: Declarations. -* Default configuration: Makefile generation. -* Detailed usage: Using configure. -* docdir: Makefile extensions. -* Example configure.in: Example. -* Example session <1>: Build directories. -* Example session <2>: exec_prefix. -* Example session <3>: Build variables. -* Example session <4>: Makefile extensions. -* Example session <5>: What configure really does. -* Example session <6>: Sites. -* Example session: Invoking configure. -* For each invocation: Declarations. -* Host: Host. -* Host-specific instructions: per-host. -* Hosts and targets: Hosts and targets. -* includedir: Makefile extensions. -* info: Makefile extensions. -* infodir: Makefile extensions. -* install: Makefile extensions. -* Install details: Install details. -* Install locations: Install locations. -* install-info: Makefile extensions. -* Installation subdirectories: Install details. -* Installing host-independent files: exec_prefix. -* Introduction: What configure does. -* Invoking configure: Invoking configure. -* Local conventions: Makefile fragments. -* Makefile: Makefile extensions. -* mandir: Makefile extensions. -* Minimal configure.in example: Minimal. -* Object directories: Build directories. -* Other files: What configure really does. -* Overview: What configure does. -* Porting with configure: Porting. -* Post-target shell-script fragment: post-target. -* Recursion: What configure does. -* Sample configure.in: Example. -* Sharing host-independent files: exec_prefix. -* Sites: Sites. -* Subdirectories: Install details. -* Symbolic links <1>: What configure does. -* Symbolic links: configure variables. -* Target: Target. -* target shell-script fragment: per-target. -* Target-specific instructions: per-target. -* The exec_prefix directory: exec_prefix. -* Truncating option names: Invoking configure. -* Usage: Invoking configure. -* Usage: detailed: Using configure. -* Using configure: Using configure. -* Variables: Build variables. -* Verbose Output: Invoking configure. -* version: Invoking configure. -* What configure does: What configure does. -* What configure really does: What configure really does. -* Where to install: Install locations. - - diff --git a/gnu/dist/etc/standards.info b/gnu/dist/etc/standards.info deleted file mode 100644 index 774ca0160393..000000000000 --- a/gnu/dist/etc/standards.info +++ /dev/null @@ -1,82 +0,0 @@ -This is Info file standards.info, produced by Makeinfo-1.64 from the -input file ./standards.texi. - -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY - - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -Indirect: -standards.info-1: 968 -standards.info-2: 48339 -standards.info-3: 97867 - -Tag Table: -(Indirect) -Node: Top968 -Node: Preface1512 -Node: Intellectual Property2554 -Node: Reading Non-Free Code2929 -Node: Contributions4661 -Node: Design Advice6259 -Node: Compatibility6776 -Node: Using Extensions8420 -Node: ANSI C9922 -Node: Source Language11158 -Node: Program Behavior12292 -Node: Semantics13001 -Node: Libraries16755 -Node: Errors17990 -Node: User Interfaces19213 -Node: Option Table25935 -Node: Memory Usage40039 -Node: Writing C41033 -Node: Formatting41872 -Node: Comments45144 -Node: Syntactic Conventions48339 -Node: Names51277 -Node: System Portability53013 -Node: CPU Portability54789 -Node: System Functions56950 -Node: Internationalization62054 -Node: Mmap65199 -Node: Documentation65904 -Node: GNU Manuals66462 -Node: Manual Structure Details70349 -Node: NEWS File71679 -Node: Change Logs72360 -Node: Change Log Concepts73077 -Node: Style of Change Logs74845 -Node: Simple Changes76399 -Node: Conditional Changes77590 -Node: Man Pages78967 -Node: Reading other Manuals80586 -Node: Managing Releases81370 -Node: Configuration82106 -Node: Makefile Conventions89046 -Node: Makefile Basics89726 -Node: Utilities in Makefiles92895 -Node: Command Variables95031 -Node: Directory Variables97867 -Node: Standard Targets108436 -Node: Install Command Categories118937 -Node: Releases123510 - -End Tag Table diff --git a/gnu/dist/etc/standards.info-1 b/gnu/dist/etc/standards.info-1 deleted file mode 100644 index 96c381784684..000000000000 --- a/gnu/dist/etc/standards.info-1 +++ /dev/null @@ -1,1891 +0,0 @@ -This is Info file standards.info, produced by Makeinfo-1.64 from the -input file ./standards.texi. - -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY - - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) - -Version -******* - - Last updated 16 January 1997. - -* Menu: - -* Preface:: About the GNU Coding Standards -* Intellectual Property:: Keeping Free Software Free -* Design Advice:: General Program Design -* Program Behavior:: Program Behavior for All Programs -* Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs -* Managing Releases:: The Release Process - - -File: standards.info, Node: Preface, Next: Intellectual Property, Prev: Top, Up: Top - -About the GNU Coding Standards -****************************** - - The GNU Coding Standards were written by Richard Stallman and other -GNU Project volunteers. Their purpose is to make the GNU system clean, -consistent, and easy to install. This document can also be read as a -guide to writing portable, robust and reliable programs. It focuses on -programs written in C, but many of the rules and principles are useful -even if you write in another programming language. The rules often -state reasons for writing in a certain way. - - Corrections or suggestions regarding this document should be sent to -`gnu@prep.ai.mit.edu'. If you make a suggestion, please include a -suggested new wording for it; our time is limited. We prefer a context -diff to the `standards.texi' or `make-stds.texi' files, but if you -don't have those files, please mail your suggestion anyway. - - This release of the GNU Coding Standards was last updated 16 January -1997. - - -File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top - -Keeping Free Software Free -************************** - - This node discusses how you can make sure that GNU software remains -unencumbered. - -* Menu: - -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions - - -File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Intellectual Property - -Referring to Proprietary Programs -================================= - - Don't in any circumstances refer to Unix source code for or during -your work on GNU! (Or to any other proprietary programs.) - - If you have a vague recollection of the internals of a Unix program, -this does not absolutely mean you can't write an imitation of it, but -do try to organize the imitation internally along different lines, -because this is likely to make the details of the Unix version -irrelevant and dissimilar to your results. - - For example, Unix utilities were generally optimized to minimize -memory use; if you go for speed instead, your program will be very -different. You could keep the entire input file in core and scan it -there instead of using stdio. Use a smarter algorithm discovered more -recently than the Unix program. Eliminate use of temporary files. Do -it in one pass instead of two (we did this in the assembler). - - Or, on the contrary, emphasize simplicity instead of speed. For some -applications, the speed of today's computers makes simpler algorithms -adequate. - - Or go for generality. For example, Unix programs often have static -tables or fixed-size strings, which make for arbitrary limits; use -dynamic allocation instead. Make sure your program handles NULs and -other funny characters in the input files. Add a programming language -for extensibility and write part of the program in that language. - - Or turn some parts of the program into independently usable -libraries. Or use a simple garbage collector instead of tracking -precisely when to free memory, or use a new GNU facility such as -obstacks. - - -File: standards.info, Node: Contributions, Prev: Reading Non-Free Code, Up: Intellectual Property - -Accepting Contributions -======================= - - If someone else sends you a piece of code to add to the program you -are working on, we need legal papers to use it--the same sort of legal -papers we will need to get from you. *Each* significant contributor to -a program must sign some sort of legal papers in order for us to have -clear title to the program. The main author alone is not enough. - - So, before adding in any contributions from other people, tell us so -we can arrange to get the papers. Then wait until we tell you that we -have received the signed papers, before you actually use the -contribution. - - This applies both before you release the program and afterward. If -you receive diffs to fix a bug, and they make significant changes, we -need legal papers for it. - - You don't need papers for changes of a few lines here or there, since -they are not significant for copyright purposes. Also, you don't need -papers if all you get from the suggestion is some ideas, not actual code -which you use. For example, if you write a different solution to the -problem, you don't need to get papers. - - We know this is frustrating; it's frustrating for us as well. But if -you don't wait, you are going out on a limb--for example, what if the -contributor's employer won't sign a disclaimer? You might have to take -that code out again! - - The very worst thing is if you forget to tell us about the other -contributor. We could be very embarrassed in court some day as a -result. - - -File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Intellectual Property, Up: Top - -General Program Design -********************** - - This node discusses some of the issues you should take into account -when designing your program. - -* Menu: - -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features -* ANSI C:: Using ANSI C features -* Source Language:: Using languages other than C - - -File: standards.info, Node: Compatibility, Next: Using Extensions, Up: Design Advice - -Compatibility with Other Implementations -======================================== - - With occasional exceptions, utility programs and libraries for GNU -should be upward compatible with those in Berkeley Unix, and upward -compatible with ANSI C if ANSI C specifies their behavior, and upward -compatible with POSIX if POSIX specifies their behavior. - - When these standards conflict, it is useful to offer compatibility -modes for each of them. - - ANSI C and POSIX prohibit many kinds of extensions. Feel free to -make the extensions anyway, and include a `--ansi', `--posix', or -`--compatible' option to turn them off. However, if the extension has -a significant chance of breaking any real programs or scripts, then it -is not really upward compatible. Try to redesign its interface. - - Many GNU programs suppress extensions that conflict with POSIX if the -environment variable `POSIXLY_CORRECT' is defined (even if it is -defined with a null value). Please make your program recognize this -variable if appropriate. - - When a feature is used only by users (not by programs or command -files), and it is done poorly in Unix, feel free to replace it -completely with something totally different and better. (For example, -`vi' is replaced with Emacs.) But it is nice to offer a compatible -feature as well. (There is a free `vi' clone, so we offer it.) - - Additional useful features not in Berkeley Unix are welcome. -Additional programs with no counterpart in Unix may be useful, but our -first priority is usually to duplicate what Unix already has. - - -File: standards.info, Node: Using Extensions, Next: ANSI C, Prev: Compatibility, Up: Design Advice - -Using Non-standard Features -=========================== - - Many GNU facilities that already exist support a number of convenient -extensions over the comparable Unix facilities. Whether to use these -extensions in implementing your program is a difficult question. - - On the one hand, using the extensions can make a cleaner program. -On the other hand, people will not be able to build the program unless -the other GNU tools are available. This might cause the program to -work on fewer kinds of machines. - - With some extensions, it might be easy to provide both alternatives. -For example, you can define functions with a "keyword" `INLINE' and -define that as a macro to expand into either `inline' or nothing, -depending on the compiler. - - In general, perhaps it is best not to use the extensions if you can -straightforwardly do without them, but to use the extensions if they -are a big improvement. - - An exception to this rule are the large, established programs (such -as Emacs) which run on a great variety of systems. Such programs would -be broken by use of GNU extensions. - - Another exception is for programs that are used as part of -compilation: anything that must be compiled with other compilers in -order to bootstrap the GNU compilation facilities. If these require -the GNU compiler, then no one can compile them without having them -installed already. That would be no good. - - -File: standards.info, Node: ANSI C, Next: Source Language, Prev: Using Extensions, Up: Design Advice - -ANSI C and pre-ANSI C -===================== - - Do not ever use the "trigraph" feature of ANSI C. - - ANSI C is widespread enough now that it is ok to write new programs -that use ANSI C features (and therefore will not work in non-ANSI -compilers). And if a program is already written in ANSI C, there's no -need to convert it to support non-ANSI compilers. - - However, it is easy to support non-ANSI compilers in most programs, -so you might still consider doing so when you write a program. Instead -of writing function definitions in ANSI prototype form, - - int - foo (int x, int y) - ... - -write the definition in pre-ANSI style like this, - - int - foo (x, y) - int x, y; - ... - -and use a separate declaration to specify the argument prototype: - - int foo (int, int); - - You need such a declaration anyway, in a header file, to get the -benefit of ANSI C prototypes in all the files where the function is -called. And once you have it, you lose nothing by writing the function -definition in the pre-ANSI style. - - If you don't know non-ANSI C, there's no need to learn it; just -write in ANSI C. - - -File: standards.info, Node: Source Language, Prev: ANSI C, Up: Design Advice - -Using Languages Other Than C -============================ - - Using a language other than C is like using a non-standard feature: -it will cause trouble for users. Even if GCC supports the other -language, users may find it inconvenient to have to install the -compiler for that other language in order to build your program. So -please write in C. - - There are three exceptions for this rule: - - * It is okay to use a special language if the same program contains - an interpreter for that language. - - For example, if your program links with GUILE, it is ok to write - part of the program in Scheme or another language supported by - GUILE. - - * It is okay to use another language in a tool specifically intended - for use with that language. - - This is okay because the only people who want to build the tool - will be those who have installed the other language anyway. - - * If an application is not of extremely widespread interest, then - perhaps it's not important if the application is inconvenient to - install. - - -File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top - -Program Behavior for All Programs -********************************* - - This node describes how to write robust software. It also describes -general standards for error messages, the command line interface, and -how libraries should behave. - -* Menu: - -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards for command line interfaces -* Option Table:: Table of long options. -* Memory Usage:: When and how to care about memory needs - - -File: standards.info, Node: Semantics, Next: Libraries, Up: Program Behavior - -Writing Robust Programs -======================= - - Avoid arbitrary limits on the length or number of *any* data -structure, including file names, lines, files, and symbols, by -allocating all data structures dynamically. In most Unix utilities, -"long lines are silently truncated". This is not acceptable in a GNU -utility. - - Utilities reading files should not drop NUL characters, or any other -nonprinting characters *including those with codes above 0177*. The -only sensible exceptions would be utilities specifically intended for -interface to certain types of printers that can't handle those -characters. - - Check every system call for an error return, unless you know you -wish to ignore errors. Include the system error text (from `perror' or -equivalent) in *every* error message resulting from a failing system -call, as well as the name of the file if any and the name of the -utility. Just "cannot open foo.c" or "stat failed" is not sufficient. - - Check every call to `malloc' or `realloc' to see if it returned -zero. Check `realloc' even if you are making the block smaller; in a -system that rounds block sizes to a power of 2, `realloc' may get a -different block if you ask for less space. - - In Unix, `realloc' can destroy the storage block if it returns zero. -GNU `realloc' does not have this bug: if it fails, the original block -is unchanged. Feel free to assume the bug is fixed. If you wish to -run your program on Unix, and wish to avoid lossage in this case, you -can use the GNU `malloc'. - - You must expect `free' to alter the contents of the block that was -freed. Anything you want to fetch from the block, you must fetch before -calling `free'. - - If `malloc' fails in a noninteractive program, make that a fatal -error. In an interactive program (one that reads commands from the -user), it is better to abort the command and return to the command -reader loop. This allows the user to kill other processes to free up -virtual memory, and then try the command again. - - Use `getopt_long' to decode arguments, unless the argument syntax -makes this unreasonable. - - When static storage is to be written in during program execution, use -explicit C code to initialize it. Reserve C initialized declarations -for data that will not be changed. - - Try to avoid low-level interfaces to obscure Unix data structures -(such as file directories, utmp, or the layout of kernel memory), since -these are less likely to work compatibly. If you need to find all the -files in a directory, use `readdir' or some other high-level interface. -These will be supported compatibly by GNU. - - By default, the GNU system will provide the signal handling -functions of BSD and of POSIX. So GNU software should be written to use -these. - - In error checks that detect "impossible" conditions, just abort. -There is usually no point in printing any message. These checks -indicate the existence of bugs. Whoever wants to fix the bugs will have -to read the source code and run a debugger. So explain the problem with -comments in the source. The relevant data will be in variables, which -are easy to examine with the debugger, so there is no point moving them -elsewhere. - - Do not use a count of errors as the exit status for a program. -*That does not work*, because exit status values are limited to 8 bits -(0 through 255). A single run of the program might have 256 errors; if -you try to return 256 as the exit status, the parent process will see 0 -as the status, and it will appear that the program succeeded. - - If you make temporary files, check the `TMPDIR' environment -variable; if that variable is defined, use the specified directory -instead of `/tmp'. - - -File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior - -Library Behavior -================ - - Try to make library functions reentrant. If they need to do dynamic -storage allocation, at least try to avoid any nonreentrancy aside from -that of `malloc' itself. - - Here are certain name conventions for libraries, to avoid name -conflicts. - - Choose a name prefix for the library, more than two characters long. -All external function and variable names should start with this prefix. -In addition, there should only be one of these in any given library -member. This usually means putting each one in a separate source file. - - An exception can be made when two external symbols are always used -together, so that no reasonable program could use one without the -other; then they can both go in the same file. - - External symbols that are not documented entry points for the user -should have names beginning with `_'. They should also contain the -chosen name prefix for the library, to prevent collisions with other -libraries. These can go in the same files with user entry points if -you like. - - Static functions and variables can be used as you like and need not -fit any naming convention. - - -File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior - -Formatting Error Messages -========================= - - Error messages from compilers should look like this: - - SOURCE-FILE-NAME:LINENO: MESSAGE - - Error messages from other noninteractive programs should look like -this: - - PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE - -when there is an appropriate source file, or like this: - - PROGRAM: MESSAGE - -when there is no relevant source file. - - In an interactive program (one that is reading commands from a -terminal), it is better not to include the program name in an error -message. The place to indicate which program is running is in the -prompt or with the screen layout. (When the same program runs with -input from a source other than a terminal, it is not interactive and -would do best to print error messages using the noninteractive style.) - - The string MESSAGE should not begin with a capital letter when it -follows a program name and/or file name. Also, it should not end with -a period. - - Error messages from interactive programs, and other messages such as -usage messages, should start with a capital letter. But they should not -end with a period. - - -File: standards.info, Node: User Interfaces, Next: Option Table, Prev: Errors, Up: Program Behavior - -Standards for Command Line Interfaces -===================================== - - Please don't make the behavior of a utility depend on the name used -to invoke it. It is useful sometimes to make a link to a utility with -a different name, and that should not change what it does. - - Instead, use a run time option or a compilation switch or both to -select among the alternate behaviors. - - Likewise, please don't make the behavior of the program depend on the -type of output device it is used with. Device independence is an -important principle of the system's design; do not compromise it merely -to save someone from typing an option now and then. - - If you think one behavior is most useful when the output is to a -terminal, and another is most useful when the output is a file or a -pipe, then it is usually best to make the default behavior the one that -is useful with output to a terminal, and have an option for the other -behavior. - - Compatibility requires certain programs to depend on the type of -output device. It would be disastrous if `ls' or `sh' did not do so in -the way all users expect. In some of these cases, we supplement the -program with a preferred alternate version that does not depend on the -output device type. For example, we provide a `dir' program much like -`ls' except that its default output format is always multi-column -format. - - It is a good idea to follow the POSIX guidelines for the -command-line options of a program. The easiest way to do this is to use -`getopt' to parse them. Note that the GNU version of `getopt' will -normally permit options anywhere among the arguments unless the special -argument `--' is used. This is not what POSIX specifies; it is a GNU -extension. - - Please define long-named options that are equivalent to the -single-letter Unix-style options. We hope to make GNU more user -friendly this way. This is easy to do with the GNU function -`getopt_long'. - - One of the advantages of long-named options is that they can be -consistent from program to program. For example, users should be able -to expect the "verbose" option of any GNU program which has one, to be -spelled precisely `--verbose'. To achieve this uniformity, look at the -table of common long-option names when you choose the option names for -your program (*note Option Table::.). - - It is usually a good idea for file names given as ordinary arguments -to be input files only; any output files would be specified using -options (preferably `-o' or `--output'). Even if you allow an output -file name as an ordinary argument for compatibility, try to provide an -option as another way to specify it. This will lead to more consistency -among GNU utilities, and fewer idiosyncracies for users to remember. - - All programs should support two standard options: `--version' and -`--help'. - -`--version' - This option should direct the program to information about its - name, version, origin and legal status, all on standard output, - and then exit successfully. Other options and arguments should be - ignored once this is seen, and the program should not perform its - normal function. - - The first line is meant to be easy for a program to parse; the - version number proper starts after the last space. In addition, - it contains the canonical name for this program, in this format: - - GNU Emacs 19.30 - - The program's name should be a constant string; *don't* compute it - from `argv[0]'. The idea is to state the standard or canonical - name for the program, not its file name. There are other ways to - find out the precise file name where a command is found in `PATH'. - - If the program is a subsidiary part of a larger package, mention - the package name in parentheses, like this: - - emacsserver (GNU Emacs) 19.30 - - If the package has a version number which is different from this - program's version number, you can mention the package version - number just before the close-parenthesis. - - If you *need* to mention the version numbers of libraries which - are distributed separately from the package which contains this - program, you can do so by printing an additional line of version - info for each library you want to mention. Use the same format - for these lines as for the first line. - - Please don't mention all the libraries that the program uses "just - for completeness"--that would produce a lot of unhelpful clutter. - Please mention library version numbers only if you find in - practice that they are very important to you in debugging. - - The following line, after the version number line or lines, should - be a copyright notice. If more than one copyright notice is - called for, put each on a separate line. - - Next should follow a brief statement that the program is free - software, and that users are free to copy and change it on certain - conditions. If the program is covered by the GNU GPL, say so - here. Also mention that there is no warranty, to the extent - permitted by law. - - It is ok to finish the output with a list of the major authors of - the program, as a way of giving credit. - - Here's an example of output that follows these rules: - - GNU Emacs 19.34.5 - Copyright (C) 1996 Free Software Foundation, Inc. - GNU Emacs comes with NO WARRANTY, to the extent permitted by law. - You may redistribute copies of GNU Emacs - under the terms of the GNU General Public License. - For more information about these matters, see the files named COPYING. - - You should adapt this to your program, of course, filling in the - proper year, copyright holder, name of program, and the references - to distribution terms, and changing the rest of the wording as - necessary. - - This copyright notice only needs to mention the most recent year in - which changes were made--there's no need to list the years for - previous versions' changes. You don't have to mention the name of - the program in these notices, if that is inconvenient, since it - appeared in the first line. - -`--help' - This option should output brief documentation for how to invoke the - program, on standard output, then exit successfully. Other - options and arguments should be ignored once this is seen, and the - program should not perform its normal function. - - Near the end of the `--help' option's output there should be a line - that says where to mail bug reports. It should have this format: - - Report bugs to MAILING-ADDRESS. - - -File: standards.info, Node: Option Table, Next: Memory Usage, Prev: User Interfaces, Up: Program Behavior - -Table of Long Options -===================== - - Here is a table of long options used by GNU programs. It is surely -incomplete, but we aim to list all the options that a new program might -want to be compatible with. If you use names not already in the table, -please send `gnu@prep.ai.mit.edu' a list of them, with their meanings, -so we can update the table. - -`after-date' - `-N' in `tar'. - -`all' - `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. - -`all-text' - `-a' in `diff'. - -`almost-all' - `-A' in `ls'. - -`append' - `-a' in `etags', `tee', `time'; `-r' in `tar'. - -`archive' - `-a' in `cp'. - -`archive-name' - `-n' in `shar'. - -`arglength' - `-l' in `m4'. - -`ascii' - `-a' in `diff'. - -`assign' - `-v' in `gawk'. - -`assume-new' - `-W' in Make. - -`assume-old' - `-o' in Make. - -`auto-check' - `-a' in `recode'. - -`auto-pager' - `-a' in `wdiff'. - -`auto-reference' - `-A' in `ptx'. - -`avoid-wraps' - `-n' in `wdiff'. - -`backward-search' - `-B' in `ctags'. - -`basename' - `-f' in `shar'. - -`batch' - Used in GDB. - -`baud' - Used in GDB. - -`before' - `-b' in `tac'. - -`binary' - `-b' in `cpio' and `diff'. - -`bits-per-code' - `-b' in `shar'. - -`block-size' - Used in `cpio' and `tar'. - -`blocks' - `-b' in `head' and `tail'. - -`break-file' - `-b' in `ptx'. - -`brief' - Used in various programs to make output shorter. - -`bytes' - `-c' in `head', `split', and `tail'. - -`c++' - `-C' in `etags'. - -`catenate' - `-A' in `tar'. - -`cd' - Used in various programs to specify the directory to use. - -`changes' - `-c' in `chgrp' and `chown'. - -`classify' - `-F' in `ls'. - -`colons' - `-c' in `recode'. - -`command' - `-c' in `su'; `-x' in GDB. - -`compare' - `-d' in `tar'. - -`compat' - Used in `gawk'. - -`compress' - `-Z' in `tar' and `shar'. - -`concatenate' - `-A' in `tar'. - -`confirmation' - `-w' in `tar'. - -`context' - Used in `diff'. - -`copyleft' - `-W copyleft' in `gawk'. - -`copyright' - `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'. - -`core' - Used in GDB. - -`count' - `-q' in `who'. - -`count-links' - `-l' in `du'. - -`create' - Used in `tar' and `cpio'. - -`cut-mark' - `-c' in `shar'. - -`cxref' - `-x' in `ctags'. - -`date' - `-d' in `touch'. - -`debug' - `-d' in Make and `m4'; `-t' in Bison. - -`define' - `-D' in `m4'. - -`defines' - `-d' in Bison and `ctags'. - -`delete' - `-D' in `tar'. - -`dereference' - `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. - -`dereference-args' - `-D' in `du'. - -`diacritics' - `-d' in `recode'. - -`dictionary-order' - `-d' in `look'. - -`diff' - `-d' in `tar'. - -`digits' - `-n' in `csplit'. - -`directory' - Specify the directory to use, in various programs. In `ls', it - means to show directories themselves rather than their contents. - In `rm' and `ln', it means to not treat links to directories - specially. - -`discard-all' - `-x' in `strip'. - -`discard-locals' - `-X' in `strip'. - -`dry-run' - `-n' in Make. - -`ed' - `-e' in `diff'. - -`elide-empty-files' - `-z' in `csplit'. - -`end-delete' - `-x' in `wdiff'. - -`end-insert' - `-z' in `wdiff'. - -`entire-new-file' - `-N' in `diff'. - -`environment-overrides' - `-e' in Make. - -`eof' - `-e' in `xargs'. - -`epoch' - Used in GDB. - -`error-limit' - Used in `makeinfo'. - -`error-output' - `-o' in `m4'. - -`escape' - `-b' in `ls'. - -`exclude-from' - `-X' in `tar'. - -`exec' - Used in GDB. - -`exit' - `-x' in `xargs'. - -`exit-0' - `-e' in `unshar'. - -`expand-tabs' - `-t' in `diff'. - -`expression' - `-e' in `sed'. - -`extern-only' - `-g' in `nm'. - -`extract' - `-i' in `cpio'; `-x' in `tar'. - -`faces' - `-f' in `finger'. - -`fast' - `-f' in `su'. - -`fatal-warnings' - `-E' in `m4'. - -`file' - `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r' - in `touch'. - -`field-separator' - `-F' in `gawk'. - -`file-prefix' - `-b' in Bison. - -`file-type' - `-F' in `ls'. - -`files-from' - `-T' in `tar'. - -`fill-column' - Used in `makeinfo'. - -`flag-truncation' - `-F' in `ptx'. - -`fixed-output-files' - `-y' in Bison. - -`follow' - `-f' in `tail'. - -`footnote-style' - Used in `makeinfo'. - -`force' - `-f' in `cp', `ln', `mv', and `rm'. - -`force-prefix' - `-F' in `shar'. - -`format' - Used in `ls', `time', and `ptx'. - -`freeze-state' - `-F' in `m4'. - -`fullname' - Used in GDB. - -`gap-size' - `-g' in `ptx'. - -`get' - `-x' in `tar'. - -`graphic' - `-i' in `ul'. - -`graphics' - `-g' in `recode'. - -`group' - `-g' in `install'. - -`gzip' - `-z' in `tar' and `shar'. - -`hashsize' - `-H' in `m4'. - -`header' - `-h' in `objdump' and `recode' - -`heading' - `-H' in `who'. - -`help' - Used to ask for brief usage information. - -`here-delimiter' - `-d' in `shar'. - -`hide-control-chars' - `-q' in `ls'. - -`idle' - `-u' in `who'. - -`ifdef' - `-D' in `diff'. - -`ignore' - `-I' in `ls'; `-x' in `recode'. - -`ignore-all-space' - `-w' in `diff'. - -`ignore-backups' - `-B' in `ls'. - -`ignore-blank-lines' - `-B' in `diff'. - -`ignore-case' - `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'. - -`ignore-errors' - `-i' in Make. - -`ignore-file' - `-i' in `ptx'. - -`ignore-indentation' - `-I' in `etags'. - -`ignore-init-file' - `-f' in Oleo. - -`ignore-interrupts' - `-i' in `tee'. - -`ignore-matching-lines' - `-I' in `diff'. - -`ignore-space-change' - `-b' in `diff'. - -`ignore-zeros' - `-i' in `tar'. - -`include' - `-i' in `etags'; `-I' in `m4'. - -`include-dir' - `-I' in Make. - -`incremental' - `-G' in `tar'. - -`info' - `-i', `-l', and `-m' in Finger. - -`initial' - `-i' in `expand'. - -`initial-tab' - `-T' in `diff'. - -`inode' - `-i' in `ls'. - -`interactive' - `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; - `-w' in `tar'. - -`intermix-type' - `-p' in `shar'. - -`jobs' - `-j' in Make. - -`just-print' - `-n' in Make. - -`keep-going' - `-k' in Make. - -`keep-files' - `-k' in `csplit'. - -`kilobytes' - `-k' in `du' and `ls'. - -`language' - `-l' in `etags'. - -`less-mode' - `-l' in `wdiff'. - -`level-for-gzip' - `-g' in `shar'. - -`line-bytes' - `-C' in `split'. - -`lines' - Used in `split', `head', and `tail'. - -`link' - `-l' in `cpio'. - -`lint' -`lint-old' - Used in `gawk'. - -`list' - `-t' in `cpio'; `-l' in `recode'. - -`list' - `-t' in `tar'. - -`literal' - `-N' in `ls'. - -`load-average' - `-l' in Make. - -`login' - Used in `su'. - -`machine' - No listing of which programs already use this; someone should - check to see if any actually do and tell `gnu@prep.ai.mit.edu'. - -`macro-name' - `-M' in `ptx'. - -`mail' - `-m' in `hello' and `uname'. - -`make-directories' - `-d' in `cpio'. - -`makefile' - `-f' in Make. - -`mapped' - Used in GDB. - -`max-args' - `-n' in `xargs'. - -`max-chars' - `-n' in `xargs'. - -`max-lines' - `-l' in `xargs'. - -`max-load' - `-l' in Make. - -`max-procs' - `-P' in `xargs'. - -`mesg' - `-T' in `who'. - -`message' - `-T' in `who'. - -`minimal' - `-d' in `diff'. - -`mixed-uuencode' - `-M' in `shar'. - -`mode' - `-m' in `install', `mkdir', and `mkfifo'. - -`modification-time' - `-m' in `tar'. - -`multi-volume' - `-M' in `tar'. - -`name-prefix' - `-a' in Bison. - -`nesting-limit' - `-L' in `m4'. - -`net-headers' - `-a' in `shar'. - -`new-file' - `-W' in Make. - -`no-builtin-rules' - `-r' in Make. - -`no-character-count' - `-w' in `shar'. - -`no-check-existing' - `-x' in `shar'. - -`no-common' - `-3' in `wdiff'. - -`no-create' - `-c' in `touch'. - -`no-defines' - `-D' in `etags'. - -`no-deleted' - `-1' in `wdiff'. - -`no-dereference' - `-d' in `cp'. - -`no-inserted' - `-2' in `wdiff'. - -`no-keep-going' - `-S' in Make. - -`no-lines' - `-l' in Bison. - -`no-piping' - `-P' in `shar'. - -`no-prof' - `-e' in `gprof'. - -`no-regex' - `-R' in `etags'. - -`no-sort' - `-p' in `nm'. - -`no-split' - Used in `makeinfo'. - -`no-static' - `-a' in `gprof'. - -`no-time' - `-E' in `gprof'. - -`no-timestamp' - `-m' in `shar'. - -`no-validate' - Used in `makeinfo'. - -`no-wait' - Used in `emacsclient'. - -`no-warn' - Used in various programs to inhibit warnings. - -`node' - `-n' in `info'. - -`nodename' - `-n' in `uname'. - -`nonmatching' - `-f' in `cpio'. - -`nstuff' - `-n' in `objdump'. - -`null' - `-0' in `xargs'. - -`number' - `-n' in `cat'. - -`number-nonblank' - `-b' in `cat'. - -`numeric-sort' - `-n' in `nm'. - -`numeric-uid-gid' - `-n' in `cpio' and `ls'. - -`nx' - Used in GDB. - -`old-archive' - `-o' in `tar'. - -`old-file' - `-o' in Make. - -`one-file-system' - `-l' in `tar', `cp', and `du'. - -`only-file' - `-o' in `ptx'. - -`only-prof' - `-f' in `gprof'. - -`only-time' - `-F' in `gprof'. - -`output' - In various programs, specify the output file name. - -`output-prefix' - `-o' in `shar'. - -`override' - `-o' in `rm'. - -`overwrite' - `-c' in `unshar'. - -`owner' - `-o' in `install'. - -`paginate' - `-l' in `diff'. - -`paragraph-indent' - Used in `makeinfo'. - -`parents' - `-p' in `mkdir' and `rmdir'. - -`pass-all' - `-p' in `ul'. - -`pass-through' - `-p' in `cpio'. - -`port' - `-P' in `finger'. - -`portability' - `-c' in `cpio' and `tar'. - -`posix' - Used in `gawk'. - -`prefix-builtins' - `-P' in `m4'. - -`prefix' - `-f' in `csplit'. - -`preserve' - Used in `tar' and `cp'. - -`preserve-environment' - `-p' in `su'. - -`preserve-modification-time' - `-m' in `cpio'. - -`preserve-order' - `-s' in `tar'. - -`preserve-permissions' - `-p' in `tar'. - -`print' - `-l' in `diff'. - -`print-chars' - `-L' in `cmp'. - -`print-data-base' - `-p' in Make. - -`print-directory' - `-w' in Make. - -`print-file-name' - `-o' in `nm'. - -`print-symdefs' - `-s' in `nm'. - -`printer' - `-p' in `wdiff'. - -`prompt' - `-p' in `ed'. - -`query-user' - `-X' in `shar'. - -`question' - `-q' in Make. - -`quiet' - Used in many programs to inhibit the usual output. *Note:* every - program accepting `--quiet' should accept `--silent' as a synonym. - -`quiet-unshar' - `-Q' in `shar' - -`quote-name' - `-Q' in `ls'. - -`rcs' - `-n' in `diff'. - -`re-interval' - Used in `gawk'. - -`read-full-blocks' - `-B' in `tar'. - -`readnow' - Used in GDB. - -`recon' - `-n' in Make. - -`record-number' - `-R' in `tar'. - -`recursive' - Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. - -`reference-limit' - Used in `makeinfo'. - -`references' - `-r' in `ptx'. - -`regex' - `-r' in `tac' and `etags'. - -`release' - `-r' in `uname'. - -`reload-state' - `-R' in `m4'. - -`relocation' - `-r' in `objdump'. - -`rename' - `-r' in `cpio'. - -`replace' - `-i' in `xargs'. - -`report-identical-files' - `-s' in `diff'. - -`reset-access-time' - `-a' in `cpio'. - -`reverse' - `-r' in `ls' and `nm'. - -`reversed-ed' - `-f' in `diff'. - -`right-side-defs' - `-R' in `ptx'. - -`same-order' - `-s' in `tar'. - -`same-permissions' - `-p' in `tar'. - -`save' - `-g' in `stty'. - -`se' - Used in GDB. - -`sentence-regexp' - `-S' in `ptx'. - -`separate-dirs' - `-S' in `du'. - -`separator' - `-s' in `tac'. - -`sequence' - Used by `recode' to chose files or pipes for sequencing passes. - -`shell' - `-s' in `su'. - -`show-all' - `-A' in `cat'. - -`show-c-function' - `-p' in `diff'. - -`show-ends' - `-E' in `cat'. - -`show-function-line' - `-F' in `diff'. - -`show-tabs' - `-T' in `cat'. - -`silent' - Used in many programs to inhibit the usual output. *Note:* every - program accepting `--silent' should accept `--quiet' as a synonym. - -`size' - `-s' in `ls'. - -`sort' - Used in `ls'. - -`source' - `-W source' in `gawk'. - -`sparse' - `-S' in `tar'. - -`speed-large-files' - `-H' in `diff'. - -`split-at' - `-E' in `unshar'. - -`split-size-limit' - `-L' in `shar'. - -`squeeze-blank' - `-s' in `cat'. - -`start-delete' - `-w' in `wdiff'. - -`start-insert' - `-y' in `wdiff'. - -`starting-file' - Used in `tar' and `diff' to specify which file within a directory - to start processing with. - -`statistics' - `-s' in `wdiff'. - -`stdin-file-list' - `-S' in `shar'. - -`stop' - `-S' in Make. - -`strict' - `-s' in `recode'. - -`strip' - `-s' in `install'. - -`strip-all' - `-s' in `strip'. - -`strip-debug' - `-S' in `strip'. - -`submitter' - `-s' in `shar'. - -`suffix' - `-S' in `cp', `ln', `mv'. - -`suffix-format' - `-b' in `csplit'. - -`sum' - `-s' in `gprof'. - -`summarize' - `-s' in `du'. - -`symbolic' - `-s' in `ln'. - -`symbols' - Used in GDB and `objdump'. - -`synclines' - `-s' in `m4'. - -`sysname' - `-s' in `uname'. - -`tabs' - `-t' in `expand' and `unexpand'. - -`tabsize' - `-T' in `ls'. - -`terminal' - `-T' in `tput' and `ul'. `-t' in `wdiff'. - -`text' - `-a' in `diff'. - -`text-files' - `-T' in `shar'. - -`time' - Used in `ls' and `touch'. - -`to-stdout' - `-O' in `tar'. - -`total' - `-c' in `du'. - -`touch' - `-t' in Make, `ranlib', and `recode'. - -`trace' - `-t' in `m4'. - -`traditional' - `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4', - and `ptx'. - -`tty' - Used in GDB. - -`typedefs' - `-t' in `ctags'. - -`typedefs-and-c++' - `-T' in `ctags'. - -`typeset-mode' - `-t' in `ptx'. - -`uncompress' - `-z' in `tar'. - -`unconditional' - `-u' in `cpio'. - -`undefine' - `-U' in `m4'. - -`undefined-only' - `-u' in `nm'. - -`update' - `-u' in `cp', `ctags', `mv', `tar'. - -`usage' - Used in `gawk'; same as `--help'. - -`uuencode' - `-B' in `shar'. - -`vanilla-operation' - `-V' in `shar'. - -`verbose' - Print more information about progress. Many programs support this. - -`verify' - `-W' in `tar'. - -`version' - Print the version number. - -`version-control' - `-V' in `cp', `ln', `mv'. - -`vgrind' - `-v' in `ctags'. - -`volume' - `-V' in `tar'. - -`what-if' - `-W' in Make. - -`whole-size-limit' - `-l' in `shar'. - -`width' - `-w' in `ls' and `ptx'. - -`word-regexp' - `-W' in `ptx'. - -`writable' - `-T' in `who'. - -`zeros' - `-z' in `gprof'. - - -File: standards.info, Node: Memory Usage, Prev: Option Table, Up: Program Behavior - -Memory Usage -============ - - If it typically uses just a few meg of memory, don't bother making -any effort to reduce memory usage. For example, if it is impractical -for other reasons to operate on files more than a few meg long, it is -reasonable to read entire input files into core to operate on them. - - However, for programs such as `cat' or `tail', that can usefully -operate on very large files, it is important to avoid using a technique -that would artificially limit the size of files it can handle. If a -program works by lines and could be applied to arbitrary user-supplied -input files, it should keep only a line in memory, because this is not -very hard and users will want to be able to operate on input files that -are bigger than will fit in core all at once. - - If your program creates complicated data structures, just make them -in core and give a fatal error if `malloc' returns zero. - - -File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top - -Making The Best Use of C -************************ - - This node provides advice on how best to use the C language when -writing GNU software. - -* Menu: - -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* System Portability:: Portability between different operating systems -* CPU Portability:: Supporting the range of CPU types -* System Functions:: Portability and "standard" library functions -* Internationalization:: Techniques for internationalization -* Mmap:: How you can safely use `mmap'. - - -File: standards.info, Node: Formatting, Next: Comments, Up: Writing C - -Formatting Your Source Code -=========================== - - It is important to put the open-brace that starts the body of a C -function in column zero, and avoid putting any other open-brace or -open-parenthesis or open-bracket in column zero. Several tools look -for open-braces in column zero to find the beginnings of C functions. -These tools will not work on code not formatted that way. - - It is also important for function definitions to start the name of -the function in column zero. This helps people to search for function -definitions, and may also help certain tools recognize them. Thus, the -proper format is this: - - static char * - concat (s1, s2) /* Name starts in column zero here */ - char *s1, *s2; - { /* Open brace in column zero here */ - ... - } - -or, if you want to use ANSI C, format the definition like this: - - static char * - concat (char *s1, char *s2) - { - ... - } - - In ANSI C, if the arguments don't fit nicely on one line, split it -like this: - - int - lots_of_args (int an_integer, long a_long, short a_short, - double a_double, float a_float) - ... - - For the body of the function, we prefer code formatted like this: - - if (x < foo (y, z)) - haha = bar[4] + 5; - else - { - while (z) - { - haha += foo (z, z); - z--; - } - return ++x + bar (); - } - - We find it easier to read a program when it has spaces before the -open-parentheses and after the commas. Especially after the commas. - - When you split an expression into multiple lines, split it before an -operator, not after one. Here is the right way: - - if (foo_this_is_long && bar > win (x, y, z) - && remaining_condition) - - Try to avoid having two operators of different precedence at the same -level of indentation. For example, don't write this: - - mode = (inmode[j] == VOIDmode - || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) - ? outmode[j] : inmode[j]); - - Instead, use extra parentheses so that the indentation shows the -nesting: - - mode = ((inmode[j] == VOIDmode - || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) - ? outmode[j] : inmode[j]); - - Insert extra parentheses so that Emacs will indent the code properly. -For example, the following indentation looks nice if you do it by hand, -but Emacs would mess it up: - - v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; - - But adding a set of parentheses solves the problem: - - v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); - - Format do-while statements like this: - - do - { - a = foo (a); - } - while (a > 0); - - Please use formfeed characters (control-L) to divide the program into -pages at logical places (but not within a function). It does not matter -just how long the pages are, since they do not have to fit on a printed -page. The formfeeds should appear alone on lines by themselves. - - -File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C - -Commenting Your Work -==================== - - Every program should start with a comment saying briefly what it is -for. Example: `fmt - filter for simple filling of text'. - - Please write the comments in a GNU program in English, because -English is the one language that nearly all programmers in all -countries can read. If you do not write English well, please write -comments in English as well as you can, then ask other people to help -rewrite them. If you can't write comments in English, please find -someone to work with you and translate your comments into English. - - Please put a comment on each function saying what the function does, -what sorts of arguments it gets, and what the possible values of -arguments mean and are used for. It is not necessary to duplicate in -words the meaning of the C argument declarations, if a C type is being -used in its customary fashion. If there is anything nonstandard about -its use (such as an argument of type `char *' which is really the -address of the second character of a string, not the first), or any -possible values that would not work the way one would expect (such as, -that strings containing newlines are not guaranteed to work), be sure -to say so. - - Also explain the significance of the return value, if there is one. - - Please put two spaces after the end of a sentence in your comments, -so that the Emacs sentence commands will work. Also, please write -complete sentences and capitalize the first word. If a lower-case -identifier comes at the beginning of a sentence, don't capitalize it! -Changing the spelling makes it a different identifier. If you don't -like starting a sentence with a lower case letter, write the sentence -differently (e.g., "The identifier lower-case is ..."). - - The comment on a function is much clearer if you use the argument -names to speak about the argument values. The variable name itself -should be lower case, but write it in upper case when you are speaking -about the value rather than the variable itself. Thus, "the inode -number NODE_NUM" rather than "an inode". - - There is usually no purpose in restating the name of the function in -the comment before it, because the reader can see that for himself. -There might be an exception when the comment is so long that the -function itself would be off the bottom of the screen. - - There should be a comment on each static variable as well, like this: - - /* Nonzero means truncate lines in the display; - zero means continue them. */ - int truncate_lines; - - Every `#endif' should have a comment, except in the case of short -conditionals (just a few lines) that are not nested. The comment should -state the condition of the conditional that is ending, *including its -sense*. `#else' should have a comment describing the condition *and -sense* of the code that follows. For example: - - #ifdef foo - ... - #else /* not foo */ - ... - #endif /* not foo */ - -but, by contrast, write the comments this way for a `#ifndef': - - #ifndef foo - ... - #else /* foo */ - ... - #endif /* foo */ - diff --git a/gnu/dist/etc/standards.info-2 b/gnu/dist/etc/standards.info-2 deleted file mode 100644 index d0b864bfab76..000000000000 --- a/gnu/dist/etc/standards.info-2 +++ /dev/null @@ -1,1216 +0,0 @@ -This is Info file standards.info, produced by Makeinfo-1.64 from the -input file ./standards.texi. - -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY - - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C - -Clean Use of C Constructs -========================= - - Please explicitly declare all arguments to functions. Don't omit -them just because they are `int's. - - Declarations of external functions and functions to appear later in -the source file should all go in one place near the beginning of the -file (somewhere before the first function definition in the file), or -else should go in a header file. Don't put `extern' declarations inside -functions. - - It used to be common practice to use the same local variables (with -names like `tem') over and over for different values within one -function. Instead of doing this, it is better declare a separate local -variable for each distinct purpose, and give it a name which is -meaningful. This not only makes programs easier to understand, it also -facilitates optimization by good compilers. You can also move the -declaration of each local variable into the smallest scope that includes -all its uses. This makes the program even cleaner. - - Don't use local variables or parameters that shadow global -identifiers. - - Don't declare multiple variables in one declaration that spans lines. -Start a new declaration on each line, instead. For example, instead of -this: - - int foo, - bar; - -write either this: - - int foo, bar; - -or this: - - int foo; - int bar; - -(If they are global variables, each should have a comment preceding it -anyway.) - - When you have an `if'-`else' statement nested in another `if' -statement, always put braces around the `if'-`else'. Thus, never write -like this: - - if (foo) - if (bar) - win (); - else - lose (); - -always like this: - - if (foo) - { - if (bar) - win (); - else - lose (); - } - - If you have an `if' statement nested inside of an `else' statement, -either write `else if' on one line, like this, - - if (foo) - ... - else if (bar) - ... - -with its `then'-part indented like the preceding `then'-part, or write -the nested `if' within braces like this: - - if (foo) - ... - else - { - if (bar) - ... - } - - Don't declare both a structure tag and variables or typedefs in the -same declaration. Instead, declare the structure tag separately and -then use it to declare the variables or typedefs. - - Try to avoid assignments inside `if'-conditions. For example, don't -write this: - - if ((foo = (char *) malloc (sizeof *foo)) == 0) - fatal ("virtual memory exhausted"); - -instead, write this: - - foo = (char *) malloc (sizeof *foo); - if (foo == 0) - fatal ("virtual memory exhausted"); - - Don't make the program ugly to placate `lint'. Please don't insert -any casts to `void'. Zero without a cast is perfectly fine as a null -pointer constant, except when calling a varargs function. - - -File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C - -Naming Variables and Functions -============================== - - The names of global variables and functions in a program serve as -comments of a sort. So don't choose terse names--instead, look for -names that give useful information about the meaning of the variable or -function. In a GNU program, names should be English, like other -comments. - - Local variable names can be shorter, because they are used only -within one context, where (presumably) comments explain their purpose. - - Please use underscores to separate words in a name, so that the Emacs -word commands can be useful within them. Stick to lower case; reserve -upper case for macros and `enum' constants, and for name-prefixes that -follow a uniform convention. - - For example, you should use names like `ignore_space_change_flag'; -don't use names like `iCantReadThis'. - - Variables that indicate whether command-line options have been -specified should be named after the meaning of the option, not after -the option-letter. A comment should state both the exact meaning of -the option and its letter. For example, - - /* Ignore changes in horizontal whitespace (-b). */ - int ignore_space_change_flag; - - When you want to define names with constant integer values, use -`enum' rather than `#define'. GDB knows about enumeration constants. - - Use file names of 14 characters or less, to avoid creating gratuitous -problems on older System V systems. You can use the program `doschk' -to test for this. `doschk' also tests for potential name conflicts if -the files were loaded onto an MS-DOS file system--something you may or -may not care about. - - -File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C - -Portability between System Types -================================ - - In the Unix world, "portability" refers to porting to different Unix -versions. For a GNU program, this kind of portability is desirable, but -not paramount. - - The primary purpose of GNU software is to run on top of the GNU -kernel, compiled with the GNU C compiler, on various types of CPU. The -amount and kinds of variation among GNU systems on different CPUs will -be comparable to the variation among Linux-based GNU systems or among -BSD systems today. So the kinds of portability that are absolutely -necessary are quite limited. - - But many users do run GNU software on non-GNU Unix or Unix-like -systems. So supporting a variety of Unix-like systems is desirable, -although not paramount. - - The easiest way to achieve portability to most Unix-like systems is -to use Autoconf. It's unlikely that your program needs to know more -information about the host platform than Autoconf can provide, simply -because most of the programs that need such knowledge have already been -written. - - Avoid using the format of semi-internal data bases (e.g., -directories) when there is a higher-level alternative (`readdir'). - - As for systems that are not like Unix, such as MSDOS, Windows, the -Macintosh, VMS, and MVS, supporting them is usually so much work that it -is better if you don't. - - The planned GNU kernel is not finished yet, but you can tell which -facilities it will provide by looking at the GNU C Library Manual. The -GNU kernel is based on Mach, so the features of Mach will also be -available. However, if you use Mach features, you'll probably have -trouble debugging your program today. - - -File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C - -Portability between CPUs -======================== - - Even GNU systems will differ because of differences among CPU -types--for example, difference in byte ordering and alignment -requirements. It is absolutely essential to handle these differences. -However, don't make any effort to cater to the possibility that an -`int' will be less than 32 bits. We don't support 16-bit machines in -GNU. - - Don't assume that the address of an `int' object is also the address -of its least-significant byte. This is false on big-endian machines. -Thus, don't make the following mistake: - - int c; - ... - while ((c = getchar()) != EOF) - write(file_descriptor, &c, 1); - - When calling functions, you need not worry about the difference -between pointers of various types, or between pointers and integers. -On most machines, there's no difference anyway. As for the few -machines where there is a difference, all of them support ANSI C, so -you can use prototypes (conditionalized to be active only in ANSI C) to -make the code work on those systems. - - In certain cases, it is ok to pass integer and pointer arguments -indiscriminately to the same function, and use no prototype on any -system. For example, many GNU programs have error-reporting functions -that pass their arguments along to `printf' and friends: - - error (s, a1, a2, a3) - char *s; - int a1, a2, a3; - { - fprintf (stderr, "error: "); - fprintf (stderr, s, a1, a2, a3); - } - -In practice, this works on all machines, and it is much simpler than any -"correct" alternative. Be sure *not* to use a prototype for such -functions. - - However, avoid casting pointers to integers unless you really need -to. These assumptions really reduce portability, and in most programs -they are easy to avoid. In the cases where casting pointers to -integers is essential--such as, a Lisp interpreter which stores type -information as well as an address in one word--it is ok to do so, but -you'll have to make explicit provisions to handle different word sizes. - - -File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C - -Calling System Functions -======================== - - C implementations differ substantially. ANSI C reduces but does not -eliminate the incompatibilities; meanwhile, many users wish to compile -GNU software with pre-ANSI compilers. This chapter gives -recommendations for how to use the more or less standard C library -functions to avoid unnecessary loss of portability. - - * Don't use the value of `sprintf'. It returns the number of - characters written on some systems, but not on all systems. - - * `main' should be declared to return type `int'. It should - terminate either by calling `exit' or by returning the integer - status code; make sure it cannot ever return an undefined value. - - * Don't declare system functions explicitly. - - Almost any declaration for a system function is wrong on some - system. To minimize conflicts, leave it to the system header - files to declare system functions. If the headers don't declare a - function, let it remain undeclared. - - While it may seem unclean to use a function without declaring it, - in practice this works fine for most system library functions on - the systems where this really happens; thus, the disadvantage is - only theoretical. By contrast, actual declarations have - frequently caused actual conflicts. - - * If you must declare a system function, don't specify the argument - types. Use an old-style declaration, not an ANSI prototype. The - more you specify about the function, the more likely a conflict. - - * In particular, don't unconditionally declare `malloc' or `realloc'. - - Most GNU programs use those functions just once, in functions - conventionally named `xmalloc' and `xrealloc'. These functions - call `malloc' and `realloc', respectively, and check the results. - - Because `xmalloc' and `xrealloc' are defined in your program, you - can declare them in other files without any risk of type conflict. - - On most systems, `int' is the same length as a pointer; thus, the - calls to `malloc' and `realloc' work fine. For the few - exceptional systems (mostly 64-bit machines), you can use - *conditionalized* declarations of `malloc' and `realloc'--or put - these declarations in configuration files specific to those - systems. - - * The string functions require special treatment. Some Unix systems - have a header file `string.h'; others have `strings.h'. Neither - file name is portable. There are two things you can do: use - Autoconf to figure out which file to include, or don't include - either file. - - * If you don't include either strings file, you can't get - declarations for the string functions from the header file in the - usual way. - - That causes less of a problem than you might think. The newer ANSI - string functions should be avoided anyway because many systems - still don't support them. The string functions you can use are - these: - - strcpy strncpy strcat strncat - strlen strcmp strncmp - strchr strrchr - - The copy and concatenate functions work fine without a declaration - as long as you don't use their values. Using their values without - a declaration fails on systems where the width of a pointer - differs from the width of `int', and perhaps in other cases. It - is trivial to avoid using their values, so do that. - - The compare functions and `strlen' work fine without a declaration - on most systems, possibly all the ones that GNU software runs on. - You may find it necessary to declare them *conditionally* on a few - systems. - - The search functions must be declared to return `char *'. Luckily, - there is no variation in the data type they return. But there is - variation in their names. Some systems give these functions the - names `index' and `rindex'; other systems use the names `strchr' - and `strrchr'. Some systems support both pairs of names, but - neither pair works on all systems. - - You should pick a single pair of names and use it throughout your - program. (Nowadays, it is better to choose `strchr' and `strrchr' - for new programs, since those are the standard ANSI names.) - Declare both of those names as functions returning `char *'. On - systems which don't support those names, define them as macros in - terms of the other pair. For example, here is what to put at the - beginning of your file (or in a header) if you want to use the - names `strchr' and `strrchr' throughout: - - #ifndef HAVE_STRCHR - #define strchr index - #endif - #ifndef HAVE_STRRCHR - #define strrchr rindex - #endif - - char *strchr (); - char *strrchr (); - - Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros -defined in systems where the corresponding functions exist. One way to -get them properly defined is to use Autoconf. - - -File: standards.info, Node: Internationalization, Next: Mmap, Prev: System Functions, Up: Writing C - -Internationalization -==================== - - GNU has a library called GNU gettext that makes it easy to translate -the messages in a program into various languages. You should use this -library in every program. Use English for the messages as they appear -in the program, and let gettext provide the way to translate them into -other languages. - - Using GNU gettext involves putting a call to the `gettext' macro -around each string that might need translation--like this: - - printf (gettext ("Processing file `%s'...")); - -This permits GNU gettext to replace the string `"Processing file -`%s'..."' with a translated version. - - Once a program uses gettext, please make a point of writing calls to -`gettext' when you add new strings that call for translation. - - Using GNU gettext in a package involves specifying a "text domain -name" for the package. The text domain name is used to separate the -translations for this package from the translations for other packages. -Normally, the text domain name should be the same as the name of the -package--for example, `fileutils' for the GNU file utilities. - - To enable gettext to work well, avoid writing code that makes -assumptions about the structure of words or sentences. When you want -the precise text of a sentence to vary depending on the data, use two or -more alternative string constants each containing a complete sentences, -rather than inserting conditionalized words or phrases into a single -sentence framework. - - Here is an example of what not to do: - - printf ("%d file%s processed", nfiles, - nfiles != 1 ? "s" : ""); - -The problem with that example is that it assumes that plurals are made -by adding `s'. If you apply gettext to the format string, like this, - - printf (gettext ("%d file%s processed"), nfiles, - nfiles != 1 ? "s" : ""); - -the message can use different words, but it will still be forced to use -`s' for the plural. Here is a better way: - - printf ((nfiles != 1 ? "%d files processed" - : "%d file processed"), - nfiles); - -This way, you can apply gettext to each of the two strings -independently: - - printf ((nfiles != 1 ? gettext ("%d files processed") - : gettext ("%d file processed")), - nfiles); - -This can any method of forming the plural of the word for "file", and -also handles languages that require agreement in the word for -"processed". - - A similar problem appears at the level of sentence structure with -this code: - - printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); - -Adding `gettext' calls to this code cannot give correct results for all -languages, because negation in some languages requires adding words at -more than one place in the sentence. By contrast, adding `gettext' -calls does the job straightfowardly if the code starts out like this: - - printf (f->tried_implicit - ? "# Implicit rule search has been done.\n", - : "# Implicit rule search has not been done.\n"); - - -File: standards.info, Node: Mmap, Prev: Internationalization, Up: Writing C - -Mmap -==== - - Don't assume that `mmap' either works on all files or fails for all -files. It may work on some files and fail on others. - - The proper way to use `mmap' is to try it on the specific file for -which you want to use it--and if `mmap' doesn't work, fall back on -doing the job in another way using `read' and `write'. - - The reason this precaution is needed is that the GNU kernel (the -HURD) provides a user-extensible file system, in which there can be many -different kinds of "ordinary files." Many of them support `mmap', but -some do not. It is important to make programs handle all these kinds -of files. - - -File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top - -Documenting Programs -******************** - -* Menu: - -* GNU Manuals:: Writing proper manuals. -* Manual Structure Details:: Specific structure conventions. -* NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes -* Man Pages:: Man pages are secondary. -* Reading other Manuals:: How far you can go in learning - from other manuals. - - -File: standards.info, Node: GNU Manuals, Next: Manual Structure Details, Up: Documentation - -GNU Manuals -=========== - - The preferred way to document part of the GNU system is to write a -manual in the Texinfo formatting language. See the Texinfo manual, -either the hardcopy, or the on-line version available through `info' or -the Emacs Info subsystem (`C-h i'). - - Programmers often find it most natural to structure the documentation -following the structure of the implementation, which they know. But -this structure is not necessarily good for explaining how to use the -program; it may be irrelevant and confusing for a user. - - At every level, from the sentences in a paragraph to the grouping of -topics into separate manuals, the right way to structure documentation -is according to the concepts and questions that a user will have in mind -when reading it. Sometimes this structure of ideas matches the -structure of the implementation of the software being documented--but -often they are different. Often the most important part of learning to -write good documentation is learning to notice when you are structuring -the documentation like the implementation, and think about better -alternatives. - - For example, each program in the GNU system probably ought to be -documented in one manual; but this does not mean each program should -have its own manual. That would be following the structure of the -implementation, rather than the structure that helps the user -understand. - - Instead, each manual should cover a coherent *topic*. For example, -instead of a manual for `diff' and a manual for `diff3', we have one -manual for "comparison of files" which covers both of those programs, -as well as `cmp'. By documenting these programs together, we can make -the whole subject clearer. - - The manual which discusses a program should document all of the -program's command-line options and all of its commands. It should give -examples of their use. But don't organize the manual as a list of -features. Instead, organize it logically, by subtopics. Address the -questions that a user will ask when thinking about the job that the -program does. - - In general, a GNU manual should serve both as tutorial and reference. -It should be set up for convenient access to each topic through Info, -and for reading straight through (appendixes aside). A GNU manual -should give a good introduction to a beginner reading through from the -start, and should also provide all the details that hackers want. - - That is not as hard as it first sounds. Arrange each chapter as a -logical breakdown of its topic, but order the sections, and write their -text, so that reading the chapter straight through makes sense. Do -likewise when structuring the book into chapters, and when structuring a -section into paragraphs. The watchword is, *at each point, address the -most fundamental and important issue raised by the preceding text.* - - If necessary, add extra chapters at the beginning of the manual which -are purely tutorial and cover the basics of the subject. These provide -the framework for a beginner to understand the rest of the manual. The -Bison manual provides a good example of how to do this. - - Don't use Unix man pages as a model for how to write GNU -documentation; most of them are terse, badly structured, and give -inadequate explanation of the underlying concepts. (There are, of -course exceptions.) Also Unix man pages use a particular format which -is different from what we use in GNU manuals. - - Please do not use the term "pathname" that is used in Unix -documentation; use "file name" (two words) instead. We use the term -"path" only for search paths, which are lists of file names. - - Please do not use the term "illegal" to refer to erroneous input to a -computer program. Please use "invalid" for this, and reserve the term -"illegal" for violations of law. - - -File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation - -Manual Structure Details -======================== - - The title page of the manual should state the version of the -programs or packages documented in the manual. The Top node of the -manual should also contain this information. If the manual is changing -more frequently than or independent of the program, also state a version -number for the manual in both of these places. - - Each program documented in the manual should should have a node named -`PROGRAM Invocation' or `Invoking PROGRAM'. This node (together with -its subnodes, if any) should describe the program's command line -arguments and how to run it (the sort of information people would look -in a man page for). Start with an `@example' containing a template for -all the options and arguments that the program uses. - - Alternatively, put a menu item in some menu whose item name fits one -of the above patterns. This identifies the node which that item points -to as the node for this purpose, regardless of the node's actual name. - - There will be automatic features for specifying a program name and -quickly reading just this part of its manual. - - If one manual describes several programs, it should have such a node -for each program described. - - -File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Manual Structure Details, Up: Documentation - -The NEWS File -============= - - In addition to its manual, the package should have a file named -`NEWS' which contains a list of user-visible changes worth mentioning. -In each new release, add items to the front of the file and identify -the version they pertain to. Don't discard old items; leave them in -the file after the newer items. This way, a user upgrading from any -previous version can see what is new. - - If the `NEWS' file gets very long, move some of the older items into -a file named `ONEWS' and put a note at the end referring the user to -that file. - - -File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation - -Change Logs -=========== - - Keep a change log to describe all the changes made to program source -files. The purpose of this is so that people investigating bugs in the -future will know about the changes that might have introduced the bug. -Often a new bug can be found by looking at what was recently changed. -More importantly, change logs can help you eliminate conceptual -inconsistencies between different parts of a program, by giving you a -history of how the conflicting concepts arose and who they came from. - -* Menu: - -* Change Log Concepts:: -* Style of Change Logs:: -* Simple Changes:: -* Conditional Changes:: - - -File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs - -Change Log Concepts -------------------- - - You can think of the change log as a conceptual "undo list" which -explains how earlier versions were different from the current version. -People can see the current version; they don't need the change log to -tell them what is in it. What they want from a change log is a clear -explanation of how the earlier version differed. - - The change log file is normally called `ChangeLog' and covers an -entire directory. Each directory can have its own change log, or a -directory can use the change log of its parent directory-it's up to you. - - Another alternative is to record change log information with a -version control system such as RCS or CVS. This can be converted -automatically to a `ChangeLog' file. - - There's no need to describe the full purpose of the changes or how -they work together. If you think that a change calls for explanation, -you're probably right. Please do explain it--but please put the -explanation in comments in the code, where people will see it whenever -they see the code. For example, "New function" is enough for the -change log when you add a function, because there should be a comment -before the function definition to explain what it does. - - However, sometimes it is useful to write one line to describe the -overall purpose of a batch of changes. - - The easiest way to add an entry to `ChangeLog' is with the Emacs -command `M-x add-change-log-entry'. An entry should have an asterisk, -the name of the changed file, and then in parentheses the name of the -changed functions, variables or whatever, followed by a colon. Then -describe the changes you made to that function or variable. - - -File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs - -Style of Change Logs --------------------- - - Here are some examples of change log entries: - - * register.el (insert-register): Return nil. - (jump-to-register): Likewise. - - * sort.el (sort-subr): Return nil. - - * tex-mode.el (tex-bibtex-file, tex-file, tex-region): - Restart the tex shell if process is gone or stopped. - (tex-shell-running): New function. - - * expr.c (store_one_arg): Round size up for move_block_to_reg. - (expand_call): Round up when emitting USE insns. - * stmt.c (assign_parms): Round size up for move_block_from_reg. - - It's important to name the changed function or variable in full. -Don't abbreviate function or variable names, and don't combine them. -Subsequent maintainers will often search for a function name to find all -the change log entries that pertain to it; if you abbreviate the name, -they won't find it when they search. - - For example, some people are tempted to abbreviate groups of function -names by writing `* register.el ({insert,jump-to}-register)'; this is -not a good idea, since searching for `jump-to-register' or -`insert-register' would not find that entry. - - Separate unrelated change log entries with blank lines. When two -entries represent parts of the same change, so that they work together, -then don't put blank lines between them. Then you can omit the file -name and the asterisk when successive entries are in the same file. - - -File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs - -Simple Changes --------------- - - Certain simple kinds of changes don't need much detail in the change -log. - - When you change the calling sequence of a function in a simple -fashion, and you change all the callers of the function, there is no -need to make individual entries for all the callers that you changed. -Just write in the entry for the function being called, "All callers -changed." - - * keyboard.c (Fcommand_execute): New arg SPECIAL. - All callers changed. - - When you change just comments or doc strings, it is enough to write -an entry for the file, without mentioning the functions. Just "Doc -fixes" is enough for the change log. - - There's no need to make change log entries for documentation files. -This is because documentation is not susceptible to bugs that are hard -to fix. Documentation does not consist of parts that must interact in a -precisely engineered fashion. To correct an error, you need not know -the history of the erroneous passage; it is enough to compare what the -documentation says with the way the program actually works. - - -File: standards.info, Node: Conditional Changes, Prev: Simple Changes, Up: Change Logs - -Conditional Changes -------------------- - - C programs often contain compile-time `#if' conditionals. Many -changes are conditional; sometimes you add a new definition which is -entirely contained in a conditional. It is very useful to indicate in -the change log the conditions for which the change applies. - - Our convention for indicating conditional changes is to use square -brackets around the name of the condition. - - Here is a simple example, describing a change which is conditional -but does not have a function or entity name associated with it: - - * xterm.c [SOLARIS2]: Include string.h. - - Here is an entry describing a new definition which is entirely -conditional. This new definition for the macro `FRAME_WINDOW_P' is -used only when `HAVE_X_WINDOWS' is defined: - - * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. - - Here is an entry for a change within the function `init_display', -whose definition as a whole is unconditional, but the changes themselves -are contained in a `#ifdef HAVE_LIBNCURSES' conditional: - - * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. - - Here is an entry for a change that takes affect only when a certain -macro is *not* defined: - - (gethostname) [!HAVE_SOCKETS]: Replace with winsock version. - - -File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation - -Man Pages -========= - - In the GNU project, man pages are secondary. It is not necessary or -expected for every GNU program to have a man page, but some of them do. -It's your choice whether to include a man page in your program. - - When you make this decision, consider that supporting a man page -requires continual effort each time the program is changed. The time -you spend on the man page is time taken away from more useful work. - - For a simple program which changes little, updating the man page may -be a small job. Then there is little reason not to include a man page, -if you have one. - - For a large program that changes a great deal, updating a man page -may be a substantial burden. If a user offers to donate a man page, -you may find this gift costly to accept. It may be better to refuse -the man page unless the same person agrees to take full responsibility -for maintaining it--so that you can wash your hands of it entirely. If -this volunteer later ceases to do the job, then don't feel obliged to -pick it up yourself; it may be better to withdraw the man page from the -distribution until someone else agrees to update it. - - When a program changes only a little, you may feel that the -discrepancies are small enough that the man page remains useful without -updating. If so, put a prominent note near the beginning of the man -page explaining that you don't maintain it and that the Texinfo manual -is more authoritative. The note should say how to access the Texinfo -documentation. - - -File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation - -Reading other Manuals -===================== - - There may be non-free books or documentation files that describe the -program you are documenting. - - It is ok to use these documents for reference, just as the author of -a new algebra textbook can read other books on algebra. A large portion -of any non-fiction book consists of facts, in this case facts about how -a certain program works, and these facts are necessarily the same for -everyone who writes about the subject. But be careful not to copy your -outline structure, wording, tables or examples from preexisting non-free -documentation. Copying from free documentation may be ok; please check -with the FSF about the individual case. - - -File: standards.info, Node: Managing Releases, Prev: Documentation, Up: Top - -The Release Process -******************* - - Making a release is more than just bundling up your source files in a -tar file and putting it up for FTP. You should set up your software so -that it can be configured to run on a variety of systems. Your Makefile -should conform to the GNU standards described below, and your directory -layout should also conform to the standards discussed below. Doing so -makes it easy to include your package into the larger framework of all -GNU software. - -* Menu: - -* Configuration:: How Configuration Should Work -* Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases - - -File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases - -How Configuration Should Work -============================= - - Each GNU distribution should come with a shell script named -`configure'. This script is given arguments which describe the kind of -machine and system you want to compile the program for. - - The `configure' script must record the configuration options so that -they affect compilation. - - One way to do this is to make a link from a standard name such as -`config.h' to the proper configuration file for the chosen system. If -you use this technique, the distribution should *not* contain a file -named `config.h'. This is so that people won't be able to build the -program without configuring it first. - - Another thing that `configure' can do is to edit the Makefile. If -you do this, the distribution should *not* contain a file named -`Makefile'. Instead, it should include a file `Makefile.in' which -contains the input used for editing. Once again, this is so that people -won't be able to build the program without configuring it first. - - If `configure' does write the `Makefile', then `Makefile' should -have a target named `Makefile' which causes `configure' to be rerun, -setting up the same configuration that was set up last time. The files -that `configure' reads should be listed as dependencies of `Makefile'. - - All the files which are output from the `configure' script should -have comments at the beginning explaining that they were generated -automatically using `configure'. This is so that users won't think of -trying to edit them by hand. - - The `configure' script should write a file named `config.status' -which describes which configuration options were specified when the -program was last configured. This file should be a shell script which, -if run, will recreate the same configuration. - - The `configure' script should accept an option of the form -`--srcdir=DIRNAME' to specify the directory where sources are found (if -it is not the current directory). This makes it possible to build the -program in a separate directory, so that the actual source directory is -not modified. - - If the user does not specify `--srcdir', then `configure' should -check both `.' and `..' to see if it can find the sources. If it finds -the sources in one of these places, it should use them from there. -Otherwise, it should report that it cannot find the sources, and should -exit with nonzero status. - - Usually the easy way to support `--srcdir' is by editing a -definition of `VPATH' into the Makefile. Some rules may need to refer -explicitly to the specified source directory. To make this possible, -`configure' can add to the Makefile a variable named `srcdir' whose -value is precisely the specified directory. - - The `configure' script should also take an argument which specifies -the type of system to build the program for. This argument should look -like this: - - CPU-COMPANY-SYSTEM - - For example, a Sun 3 might be `m68k-sun-sunos4.1'. - - The `configure' script needs to be able to decode all plausible -alternatives for how to describe a machine. Thus, `sun3-sunos4.1' -would be a valid alias. For many programs, `vax-dec-ultrix' would be -an alias for `vax-dec-bsd', simply because the differences between -Ultrix and BSD are rarely noticeable, but a few programs might need to -distinguish them. - - There is a shell script called `config.sub' that you can use as a -subroutine to validate system types and canonicalize aliases. - - Other options are permitted to specify in more detail the software -or hardware present on the machine, and include or exclude optional -parts of the package: - -`--enable-FEATURE[=PARAMETER]' - Configure the package to build and install an optional user-level - facility called FEATURE. This allows users to choose which - optional features to include. Giving an optional PARAMETER of - `no' should omit FEATURE, if it is built by default. - - No `--enable' option should *ever* cause one feature to replace - another. No `--enable' option should ever substitute one useful - behavior for another useful behavior. The only proper use for - `--enable' is for questions of whether to build part of the program - or exclude it. - -`--with-PACKAGE' - The package PACKAGE will be installed, so configure this package - to work with PACKAGE. - - Possible values of PACKAGE include `x', `x-toolkit', `gnu-as' (or - `gas'), `gnu-ld', `gnu-libc', and `gdb'. - - Do not use a `--with' option to specify the file name to use to - find certain files. That is outside the scope of what `--with' - options are for. - -`--nfp' - The target machine has no floating point processor. - -`--gas' - The target machine assembler is GAS, the GNU assembler. This is - obsolete; users should use `--with-gnu-as' instead. - -`--x' - The target machine has the X Window System installed. This is - obsolete; users should use `--with-x' instead. - - All `configure' scripts should accept all of these "detail" options, -whether or not they make any difference to the particular package at -hand. In particular, they should accept any option that starts with -`--with-' or `--enable-'. This is so users will be able to configure -an entire GNU source tree at once with a single set of options. - - You will note that the categories `--with-' and `--enable-' are -narrow: they *do not* provide a place for any sort of option you might -think of. That is deliberate. We want to limit the possible -configuration options in GNU software. We do not want GNU programs to -have idiosyncratic configuration options. - - Packages that perform part of the compilation process may support -cross-compilation. In such a case, the host and target machines for -the program may be different. The `configure' script should normally -treat the specified type of system as both the host and the target, -thus producing a program which works for the same type of machine that -it runs on. - - The way to build a cross-compiler, cross-assembler, or what have -you, is to specify the option `--host=HOSTTYPE' when running -`configure'. This specifies the host system without changing the type -of target system. The syntax for HOSTTYPE is the same as described -above. - - Bootstrapping a cross-compiler requires compiling it on a machine -other than the host it will run on. Compilation packages accept a -configuration option `--build=HOSTTYPE' for specifying the -configuration on which you will compile them, in case that is different -from the host. - - Programs for which cross-operation is not meaningful need not accept -the `--host' option, because configuring an entire operating system for -cross-operation is not a meaningful thing. - - Some programs have ways of configuring themselves automatically. If -your program is set up to do this, your `configure' script can simply -ignore most of its arguments. - - -File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases - -Makefile Conventions -==================== - - This node describes conventions for writing the Makefiles for GNU -programs. - -* Menu: - -* Makefile Basics:: General Conventions for Makefiles -* Utilities in Makefiles:: Utilities in Makefiles -* Command Variables:: Variables for Specifying Commands -* Directory Variables:: Variables for Installation Directories -* Standard Targets:: Standard Targets for Users -* Install Command Categories:: Three categories of commands in the `install' - rule: normal, pre-install and post-install. - - -File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions - -General Conventions for Makefiles ---------------------------------- - - Every Makefile should contain this line: - - SHELL = /bin/sh - -to avoid trouble on systems where the `SHELL' variable might be -inherited from the environment. (This is never a problem with GNU -`make'.) - - Different `make' programs have incompatible suffix lists and -implicit rules, and this sometimes creates confusion or misbehavior. So -it is a good idea to set the suffix list explicitly using only the -suffixes you need in the particular Makefile, like this: - - .SUFFIXES: - .SUFFIXES: .c .o - -The first line clears out the suffix list, the second introduces all -suffixes which may be subject to implicit rules in this Makefile. - - Don't assume that `.' is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses `./' if the program is built as -part of the make or `$(srcdir)/' if the file is an unchanging part of -the source code. Without one of these prefixes, the current search -path is used. - - The distinction between `./' (the "build directory") and -`$(srcdir)/' (the "source directory") is important because users can -build in a separate directory using the `--srcdir' option to -`configure'. A rule of the form: - - foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 - -will fail when the build directory is not the source directory, because -`foo.man' and `sedscript' are in the the source directory. - - When using GNU `make', relying on `VPATH' to find the source file -will work in the case where there is a single dependency file, since -the `make' automatic variable `$<' will represent the source file -wherever it is. (Many versions of `make' set `$<' only in implicit -rules.) A Makefile target like - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o - -should instead be written as - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ - -in order to allow `VPATH' to work correctly. When the target has -multiple dependencies, using an explicit `$(srcdir)' is the easiest way -to make the rule work well. For example, the target above for `foo.1' -is best written as: - - foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ - - GNU distributions usually contain some files which are not source -files--for example, Info files, and the output from Autoconf, Automake, -Bison or Flex. Since these files normally appear in the source -directory, they should always appear in the source directory, not in the -build directory. So Makefile rules to update them should put the -updated files in the source directory. - - However, if a file does not appear in the distribution, then the -Makefile should not put it in the source directory, because building a -program in ordinary circumstances should not modify the source directory -in any way. - - Try to make the build and installation targets, at least (and all -their subtargets) work correctly with a parallel `make'. - - -File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions - -Utilities in Makefiles ----------------------- - - Write the Makefile commands (and any shell scripts, such as -`configure') to run in `sh', not in `csh'. Don't use any special -features of `ksh' or `bash'. - - The `configure' script and the Makefile rules for building and -installation should not use any utilities directly except these: - - cat cmp cp diff echo egrep expr false grep install-info - ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true - - The compression program `gzip' can be used in the `dist' rule. - - Stick to the generally supported options for these programs. For -example, don't use `mkdir -p', convenient as it may be, because most -systems don't support it. - - It is a good idea to avoid creating symbolic links in makefiles, -since a few systems don't support them. - - The Makefile rules for building and installation can also use -compilers and related programs, but should do so via `make' variables -so that the user can substitute alternatives. Here are some of the -programs we mean: - - ar bison cc flex install ld ldconfig lex - make makeinfo ranlib texi2dvi yacc - - Use the following `make' variables to run those programs: - - $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) - $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) - - When you use `ranlib' or `ldconfig', you should make sure nothing -bad happens if the system does not have the program in question. -Arrange to ignore an error from that command, and print a message before -the command to tell the user that failure of this command does not mean -a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) - - If you use symbolic links, you should implement a fallback for -systems that don't have symbolic links. - - Additional utilities that can be used via Make variables are: - - chgrp chmod chown mknod - - It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities -exist. - - -File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions - -Variables for Specifying Commands ---------------------------------- - - Makefiles should provide variables for overriding certain commands, -options, and so on. - - In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named `BISON' whose default -value is set with `BISON = bison', and refer to it with `$(BISON)' -whenever you need to use Bison. - - File management utilities such as `ln', `rm', `mv', and so on, need -not be referred to through variables in this way, since users don't -need to replace them with other programs. - - Each program-name variable should come with an options variable that -is used to supply options to the program. Append `FLAGS' to the -program-name variable name to get the options variable name--for -example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this -rule, but we keep it because it is standard.) Use `CPPFLAGS' in any -compilation command that runs the preprocessor, and use `LDFLAGS' in -any compilation command that does linking as well as in any direct use -of `ld'. - - If there are C compiler options that *must* be used for proper -compilation of certain files, do not include them in `CFLAGS'. Users -expect to be able to specify `CFLAGS' freely themselves. Instead, -arrange to pass the necessary options to the C compiler independently -of `CFLAGS', by writing them explicitly in the compilation commands or -by defining an implicit rule, like this: - - CFLAGS = -g - ALL_CFLAGS = -I. $(CFLAGS) - .c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< - - Do include the `-g' option in `CFLAGS', because that is not -*required* for proper compilation. You can consider it a default that -is only recommended. If the package is set up so that it is compiled -with GCC by default, then you might as well include `-O' in the default -value of `CFLAGS' as well. - - Put `CFLAGS' last in the compilation command, after other variables -containing compiler options, so the user can use `CFLAGS' to override -the others. - - Every Makefile should define the variable `INSTALL', which is the -basic command for installing a file into the system. - - Every Makefile should also define the variables `INSTALL_PROGRAM' -and `INSTALL_DATA'. (The default for each of these should be -`$(INSTALL)'.) Then it should use those variables as the commands for -actual installation, for executables and nonexecutables respectively. -Use these variables as follows: - - $(INSTALL_PROGRAM) foo $(bindir)/foo - $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a - -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - diff --git a/gnu/dist/etc/standards.info-3 b/gnu/dist/etc/standards.info-3 deleted file mode 100644 index 056b25bba2ba..000000000000 --- a/gnu/dist/etc/standards.info-3 +++ /dev/null @@ -1,679 +0,0 @@ -This is Info file standards.info, produced by Makeinfo-1.64 from the -input file ./standards.texi. - -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY - - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions - -Variables for Installation Directories --------------------------------------- - - Installation directories should always be named by variables, so it -is easy to install in a nonstandard place. The standard names for these -variables are described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and -other modern operating systems. - - These two variables set the root for the installation. All the other -installation directories should be subdirectories of one of these two, -and nothing should be directly installed into these two directories. - -`prefix' - A prefix used in constructing the default values of the variables - listed below. The default value of `prefix' should be - `/usr/local'. When building the complete GNU system, the prefix - will be empty and `/usr' will be a symbolic link to `/'. (If you - are using Autoconf, write it as `@prefix@'.) - -`exec_prefix' - A prefix used in constructing the default values of some of the - variables listed below. The default value of `exec_prefix' should - be `$(prefix)'. (If you are using Autoconf, write it as - `@exec_prefix@'.) - - Generally, `$(exec_prefix)' is used for directories that contain - machine-specific files (such as executables and subroutine - libraries), while `$(prefix)' is used directly for other - directories. - - Executable programs are installed in one of the following -directories. - -`bindir' - The directory for installing executable programs that users can - run. This should normally be `/usr/local/bin', but write it as - `$(exec_prefix)/bin'. (If you are using Autoconf, write it as - `@bindir@'.) - -`sbindir' - The directory for installing executable programs that can be run - from the shell, but are only generally useful to system - administrators. This should normally be `/usr/local/sbin', but - write it as `$(exec_prefix)/sbin'. (If you are using Autoconf, - write it as `@sbindir@'.) - -`libexecdir' - The directory for installing executable programs to be run by other - programs rather than by users. This directory should normally be - `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. - (If you are using Autoconf, write it as `@libexecdir@'.) - - Data files used by the program during its execution are divided into -categories in two ways. - - * Some files are normally modified by programs; others are never - normally modified (though users may edit some of these). - - * Some files are architecture-independent and can be shared by all - machines at a site; some are architecture-dependent and can be - shared only by machines of the same kind and operating system; - others may never be shared between two machines. - - This makes for six different possibilities. However, we want to -discourage the use of architecture-dependent files, aside from object -files and libraries. It is much cleaner to make other data files -architecture-independent, and it is generally not hard. - - Therefore, here are the variables Makefiles should use to specify -directories: - -`datadir' - The directory for installing read-only architecture independent - data files. This should normally be `/usr/local/share', but write - it as `$(prefix)/share'. (If you are using Autoconf, write it as - `@datadir@'.) As a special exception, see `$(infodir)' and - `$(includedir)' below. - -`sysconfdir' - The directory for installing read-only data files that pertain to a - single machine-that is to say, files for configuring a host. - Mailer and network configuration files, `/etc/passwd', and so - forth belong here. All the files in this directory should be - ordinary ASCII text files. This directory should normally be - `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are - using Autoconf, write it as `@sysconfdir@'.) - - Do not install executables in this directory (they probably belong - in `$(libexecdir)' or `$(sbindir)'). Also do not install files - that are modified in the normal course of their use (programs - whose purpose is to change the configuration of the system - excluded). Those probably belong in `$(localstatedir)'. - -`sharedstatedir' - The directory for installing architecture-independent data files - which the programs modify while they run. This should normally be - `/usr/local/com', but write it as `$(prefix)/com'. (If you are - using Autoconf, write it as `@sharedstatedir@'.) - -`localstatedir' - The directory for installing data files which the programs modify - while they run, and that pertain to one specific machine. Users - should never need to modify files in this directory to configure - the package's operation; put such configuration information in - separate files that go in `$(datadir)' or `$(sysconfdir)'. - `$(localstatedir)' should normally be `/usr/local/var', but write - it as `$(prefix)/var'. (If you are using Autoconf, write it as - `@localstatedir@'.) - -`libdir' - The directory for object files and libraries of object code. Do - not install executables here, they probably ought to go in - `$(libexecdir)' instead. The value of `libdir' should normally be - `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you - are using Autoconf, write it as `@libdir@'.) - -`infodir' - The directory for installing the Info files for this package. By - default, it should be `/usr/local/info', but it should be written - as `$(prefix)/info'. (If you are using Autoconf, write it as - `@infodir@'.) - -`lispdir' - The directory for installing any Emacs Lisp files in this package. - By default, it should be `/usr/local/share/emacs/site-lisp', but - it should be written as `$(prefix)/share/emacs/site-lisp'. - - If you are using Autoconf, write the default as `@lispdir@'. In - order to make `@lispdir@' work, you need the following lines in - your `configure.in' file: - - lispdir='${datadir}/emacs/site-lisp' - AC_SUBST(lispdir) - -`includedir' - The directory for installing header files to be included by user - programs with the C `#include' preprocessor directive. This - should normally be `/usr/local/include', but write it as - `$(prefix)/include'. (If you are using Autoconf, write it as - `@includedir@'.) - - Most compilers other than GCC do not look for header files in - `/usr/local/include'. So installing the header files this way is - only useful with GCC. Sometimes this is not a problem because some - libraries are only really intended to work with GCC. But some - libraries are intended to work with other compilers. They should - install their header files in two places, one specified by - `includedir' and one specified by `oldincludedir'. - -`oldincludedir' - The directory for installing `#include' header files for use with - compilers other than GCC. This should normally be `/usr/include'. - (If you are using Autoconf, you can write it as `@oldincludedir@'.) - - The Makefile commands should check whether the value of - `oldincludedir' is empty. If it is, they should not try to use - it; they should cancel the second installation of the header files. - - A package should not replace an existing header in this directory - unless the header came from the same package. Thus, if your Foo - package provides a header file `foo.h', then it should install the - header file in the `oldincludedir' directory if either (1) there - is no `foo.h' there or (2) the `foo.h' that exists came from the - Foo package. - - To tell whether `foo.h' came from the Foo package, put a magic - string in the file--part of a comment--and `grep' for that string. - - Unix-style man pages are installed in one of the following: - -`mandir' - The top-level directory for installing the man pages (if any) for - this package. It will normally be `/usr/local/man', but you should - write it as `$(prefix)/man'. (If you are using Autoconf, write it - as `@mandir@'.) - -`man1dir' - The directory for installing section 1 man pages. Write it as - `$(mandir)/man1'. - -`man2dir' - The directory for installing section 2 man pages. Write it as - `$(mandir)/man2' - -`...' - *Don't make the primary documentation for any GNU software be a - man page. Write a manual in Texinfo instead. Man pages are just - for the sake of people running GNU software on Unix, which is a - secondary application only.* - -`manext' - The file name extension for the installed man page. This should - contain a period followed by the appropriate digit; it should - normally be `.1'. - -`man1ext' - The file name extension for installed section 1 man pages. - -`man2ext' - The file name extension for installed section 2 man pages. - -`...' - Use these names instead of `manext' if the package needs to - install man pages in more than one section of the manual. - - And finally, you should set the following variable: - -`srcdir' - The directory for the sources being compiled. The value of this - variable is normally inserted by the `configure' shell script. - (If you are using Autconf, use `srcdir = @srcdir@'.) - - For example: - - # Common prefix for installation directories. - # NOTE: This directory must exist when you start the install. - prefix = /usr/local - exec_prefix = $(prefix) - # Where to put the executable for the command `gcc'. - bindir = $(exec_prefix)/bin - # Where to put the directories used by the compiler. - libexecdir = $(exec_prefix)/libexec - # Where to put the Info files. - infodir = $(prefix)/info - - If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the `install' rule to create these subdirectories. - - Do not expect the user to include the subdirectory name in the value -of any of the variables listed above. The idea of having a uniform set -of variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - - -File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions - -Standard Targets for Users --------------------------- - - All GNU programs should have the following targets in their -Makefiles: - -`all' - Compile the entire program. This should be the default target. - This target need not rebuild any documentation files; Info files - should normally be included in the distribution, and DVI files - should be made only when explicitly asked for. - - By default, the Make rules should compile and link with `-g', so - that executable programs have debugging symbols. Users who don't - mind being helpless can strip the executables later if they wish. - -`install' - Compile the program and copy the executables, libraries, and so on - to the file names where they should reside for actual use. If - there is a simple test to verify that a program is properly - installed, this target should run that test. - - Do not strip executables when installing them. Devil-may-care - users can use the `install-strip' target to do that. - - If possible, write the `install' target rule so that it does not - modify anything in the directory where the program was built, - provided `make all' has just been done. This is convenient for - building the program under one user name and installing it under - another. - - The commands should create all the directories in which files are - to be installed, if they don't already exist. This includes the - directories specified as the values of the variables `prefix' and - `exec_prefix', as well as all subdirectories that are needed. One - way to do this is by means of an `installdirs' target as described - below. - - Use `-' before any command for installing a man page, so that - `make' will ignore any errors. This is in case there are systems - that don't have the Unix man page documentation system installed. - - The way to install Info files is to copy them into `$(infodir)' - with `$(INSTALL_DATA)' (*note Command Variables::.), and then run - the `install-info' program if it is present. `install-info' is a - program that edits the Info `dir' file to add or update the menu - entry for the given Info file; it is part of the Texinfo package. - Here is a sample rule to install an Info file: - - $(infodir)/foo.info: foo.info - $(POST_INSTALL) - # There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $@; \ - # Run install-info only if it exists. - # Use `if' instead of just prepending `-' to the - # line so we notice real errors from install-info. - # We use `$(SHELL) -c' because some shells do not - # fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --dir-file=$(infodir)/dir \ - $(infodir)/foo.info; \ - else true; fi - - When writing the `install' target, you must classify all the - commands into three categories: normal ones, "pre-installation" - commands and "post-installation" commands. *Note Install Command - Categories::. - -`uninstall' - Delete all the installed files--the copies that the `install' - target creates. - - This rule should not modify the directories where compilation is - done, only the directories where files are installed. - - The uninstallation commands are divided into three categories, - just like the installation commands. *Note Install Command - Categories::. - -`install-strip' - Like `install', but strip the executable files while installing - them. In many cases, the definition of this target can be very - simple: - - install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ - install - - Normally we do not recommend stripping an executable unless you - are sure the program has no bugs. However, it can be reasonable - to install a stripped executable for actual execution while saving - the unstripped executable elsewhere in case there is a bug. - -`clean' - Delete all files from the current directory that are normally - created by building the program. Don't delete the files that - record the configuration. Also preserve files that could be made - by building, but normally aren't because the distribution comes - with them. - - Delete `.dvi' files here if they are not part of the distribution. - -`distclean' - Delete all files from the current directory that are created by - configuring or building the program. If you have unpacked the - source and built the program without creating any other files, - `make distclean' should leave only the files that were in the - distribution. - -`mostlyclean' - Like `clean', but may refrain from deleting a few files that people - normally don't want to recompile. For example, the `mostlyclean' - target for GCC does not delete `libgcc.a', because recompiling it - is rarely necessary and takes a lot of time. - -`maintainer-clean' - Delete almost everything from the current directory that can be - reconstructed with this Makefile. This typically includes - everything deleted by `distclean', plus more: C source files - produced by Bison, tags tables, Info files, and so on. - - The reason we say "almost everything" is that running the command - `make maintainer-clean' should not delete `configure' even if - `configure' can be remade using a rule in the Makefile. More - generally, `make maintainer-clean' should not delete anything that - needs to exist in order to run `configure' and then begin to build - the program. This is the only exception; `maintainer-clean' should - delete everything else that can be rebuilt. - - The `maintainer-clean' target is intended to be used by a - maintainer of the package, not by ordinary users. You may need - special tools to reconstruct some of the files that `make - maintainer-clean' deletes. Since these files are normally - included in the distribution, we don't take care to make them easy - to reconstruct. If you find you need to unpack the full - distribution again, don't blame us. - - To help make users aware of this, the commands for the special - `maintainer-clean' target should start with these two: - - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - -`TAGS' - Update a tags table for this program. - -`info' - Generate any Info files needed. The best way to write the rules - is as follows: - - info: foo.info - - foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi - - You must define the variable `MAKEINFO' in the Makefile. It should - run the `makeinfo' program, which is part of the Texinfo - distribution. - - Normally a GNU distribution comes with Info files, and that means - the Info files are present in the source directory. Therefore, - the Make rule for an info file should update it in the source - directory. When users build the package, ordinarily Make will not - update the Info files because they will already be up to date. - -`dvi' - Generate DVI files for all Texinfo documentation. For example: - - dvi: foo.dvi - - foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi - - You must define the variable `TEXI2DVI' in the Makefile. It should - run the program `texi2dvi', which is part of the Texinfo - distribution.(1) Alternatively, write just the dependencies, and - allow GNU `make' to provide the command. - -`dist' - Create a distribution tar file for this program. The tar file - should be set up so that the file names in the tar file start with - a subdirectory name which is the name of the package it is a - distribution for. This name can include the version number. - - For example, the distribution tar file of GCC version 1.40 unpacks - into a subdirectory named `gcc-1.40'. - - The easiest way to do this is to create a subdirectory - appropriately named, use `ln' or `cp' to install the proper files - in it, and then `tar' that subdirectory. - - Compress the tar file file with `gzip'. For example, the actual - distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'. - - The `dist' target should explicitly depend on all non-source files - that are in the distribution, to make sure they are up to date in - the distribution. *Note Making Releases: Releases. - -`check' - Perform self-tests (if any). The user must build the program - before running the tests, but need not install the program; you - should write the self-tests so that they work when the program is - built but not installed. - - The following targets are suggested as conventional names, for -programs in which they are useful. - -`installcheck' - Perform installation tests (if any). The user must build and - install the program before running the tests. You should not - assume that `$(bindir)' is in the search path. - -`installdirs' - It's useful to add a target named `installdirs' to create the - directories where files are installed, and their parent - directories. There is a script called `mkinstalldirs' which is - convenient for this; you can find it in the Texinfo package. You - can use a rule like this: - - # Make sure all installation directories (e.g. $(bindir)) - # actually exist by making them if necessary. - installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) - - This rule should not modify the directories where compilation is - done. It should do nothing but create installation directories. - - ---------- Footnotes ---------- - - (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is -not distributed with Texinfo. - - -File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions - -Install Command Categories --------------------------- - - When writing the `install' target, you must classify all the -commands into three categories: normal ones, "pre-installation" -commands and "post-installation" commands. - - Normal commands move files into their proper places, and set their -modes. They may not alter any files except the ones that come entirely -from the package they belong to. - - Pre-installation and post-installation commands may alter other -files; in particular, they can edit global configuration files or data -bases. - - Pre-installation commands are typically executed before the normal -commands, and post-installation commands are typically run after the -normal commands. - - The most common use for a post-installation command is to run -`install-info'. This cannot be done with a normal command, since it -alters a file (the Info directory) which does not come entirely and -solely from the package being installed. It is a post-installation -command because it needs to be done after the normal command which -installs the package's Info files. - - Most programs don't need any pre-installation commands, but we have -the feature just in case it is needed. - - To classify the commands in the `install' rule into these three -categories, insert "category lines" among them. A category line -specifies the category for the commands that follow. - - A category line consists of a tab and a reference to a special Make -variable, plus an optional comment at the end. There are three -variables you can use, one for each category; the variable name -specifies the category. Category lines are no-ops in ordinary execution -because these three Make variables are normally undefined (and you -*should not* define them in the makefile). - - Here are the three possible category lines, each with a comment that -explains what it means: - - $(PRE_INSTALL) # Pre-install commands follow. - $(POST_INSTALL) # Post-install commands follow. - $(NORMAL_INSTALL) # Normal commands follow. - - If you don't use a category line at the beginning of the `install' -rule, all the commands are classified as normal until the first category -line. If you don't use any category lines, all the commands are -classified as normal. - - These are the category lines for `uninstall': - - $(PRE_UNINSTALL) # Pre-uninstall commands follow. - $(POST_UNINSTALL) # Post-uninstall commands follow. - $(NORMAL_UNINSTALL) # Normal commands follow. - - Typically, a pre-uninstall command would be used for deleting entries -from the Info directory. - - If the `install' or `uninstall' target has any dependencies which -act as subroutines of installation, then you should start *each* -dependency's commands with a category line, and start the main target's -commands with a category line also. This way, you can ensure that each -command is placed in the right category regardless of which of the -dependencies actually run. - - Pre-installation and post-installation commands should not run any -programs except for these: - - [ basename bash cat chgrp chmod chown cmp cp dd diff echo - egrep expand expr false fgrep find getopt grep gunzip gzip - hostname install install-info kill ldconfig ln ls md5sum - mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee - test touch true uname xargs yes - - The reason for distinguishing the commands in this way is for the -sake of making binary packages. Typically a binary package contains -all the executables and other files that need to be installed, and has -its own method of installing them--so it does not need to run the normal -installation commands. But installing the binary package does need to -execute the pre-installation and post-installation commands. - - Programs to build binary packages work by extracting the -pre-installation and post-installation commands. Here is one way of -extracting the pre-installation commands: - - make -n install -o all \ - PRE_INSTALL=pre-install \ - POST_INSTALL=post-install \ - NORMAL_INSTALL=normal-install \ - | gawk -f pre-install.awk - -where the file `pre-install.awk' could contain this: - - $0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0} - on {print $0} - $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} - - The resulting file of pre-installation commands is executed as a -shell script as part of installing the binary package. - - -File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases - -Making Releases -=============== - - Package the distribution of Foo version 69.96 in a gzipped tar file -named `foo-69.96.tar.gz'. It should unpack into a subdirectory named -`foo-69.96'. - - Building and installing the program should never modify any of the -files contained in the distribution. This means that all the files -that form part of the program in any way must be classified into "source -files" and "non-source files". Source files are written by humans and -never changed automatically; non-source files are produced from source -files by programs under the control of the Makefile. - - Naturally, all the source files must be in the distribution. It is -okay to include non-source files in the distribution, provided they are -up-to-date and machine-independent, so that building the distribution -normally will never modify them. We commonly include non-source files -produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid -unnecessary dependencies between our distributions, so that users can -install whichever packages they want to install. - - Non-source files that might actually be modified by building and -installing the program should *never* be included in the distribution. -So if you do distribute non-source files, always make sure they are up -to date when you make a new distribution. - - Make sure that the directory into which the distribution unpacks (as -well as any subdirectories) are all world-writable (octal mode 777). -This is so that old versions of `tar' which preserve the ownership and -permissions of the files from the tar archive will be able to extract -all the files even if the user is unprivileged. - - Make sure that all the files in the distribution are world-readable. - - Make sure that no file name in the distribution is more than 14 -characters long. Likewise, no file created by building the program -should have a name longer than 14 characters. The reason for this is -that some systems adhere to a foolish interpretation of the POSIX -standard, and refuse to open a longer name, rather than truncating as -they did in the past. - - Don't include any symbolic links in the distribution itself. If the -tar file contains symbolic links, then people cannot even unpack it on -systems that don't support symbolic links. Also, don't use multiple -names for one file in different directories, because certain file -systems cannot handle this and that prevents unpacking the distribution. - - Try to make sure that all the file names will be unique on MS-DOS. A -name on MS-DOS consists of up to 8 characters, optionally followed by a -period and up to three characters. MS-DOS will truncate extra -characters both before and after the period. Thus, `foobarhacker.c' -and `foobarhacker.o' are not ambiguous; they are truncated to -`foobarha.c' and `foobarha.o', which are distinct. - - Include in your distribution a copy of the `texinfo.tex' you used to -test print any `*.texinfo' or `*.texi' files. - - Likewise, if your program uses small GNU software packages like -regex, getopt, obstack, or termcap, include them in the distribution -file. Leaving them out would make the distribution file a little -smaller at the expense of possible inconvenience to a user who doesn't -know what other files to get. - - diff --git a/gnu/dist/gas/README-vms b/gnu/dist/gas/README-vms deleted file mode 100644 index 796c603b4f34..000000000000 --- a/gnu/dist/gas/README-vms +++ /dev/null @@ -1,248 +0,0 @@ - This document explains a couple of things that are specific to VMS. -There are currently two "chapters", the first deals with cross-assembly -issues, and the second deals with the VMS debugger and GNU-CC. - - -*********************************************************************** -****************** Notes for Cross Assembly with VMS ****************** -*********************************************************************** - - If you wish to build gas on a non-VMS system to cross-assemble, -you should use: - -configure ${hosttype} -target=vms - -and then follow the usual procedure. The object files generated on -Unix will be correct from a binary point of view, but the real trick is -getting them to the VMS machine. The format of the object file is -a variable-length record, but each record contains binary data. gas -writes the records in the same format that VMS would expect, -namely a two-byte count followed by that number of bytes. - - If you try to copy the file to a VMS system using ftp, the ftp -protocol will screw up the file by looking for nulls (record terminator for -unix) and it will insert it's own record terminators at that point. This -will obviously corrupt the file. - - If you try to transfer the file with ftp in binary mode, the -file itself will not be corrupt, but VMS will think that the file contains -fixed-length records of 512 bytes. You can use the public-domain FILE -utility to change this with a command like: - -$FILE foo.o/type=variable - -If you do not have this utility available, the following program can be -used to perform this task: - - #include - - #define RME$C_SETRFM 1 - - struct FAB * fab; - - main(int argc, char * argv[]){ - int i, status; - fab = (struct FAB*) malloc(sizeof(struct FAB)); - *fab = cc$rms_fab; /* initialize FAB*/ - fab->fab$b_fac = FAB$M_PUT; - fab->fab$l_fop |= FAB$M_ESC; - fab->fab$l_ctx = RME$C_SETRFM; - fab->fab$w_ifi = 0; - for(i=1;ifab$l_fna = argv[i]; - fab->fab$b_fns = strlen(argv[i]); - status = sys$open(fab,0,0); - if((status & 7) != 1) lib$signal(status); - fab->fab$b_rfm = FAB$C_VAR; - status = sys$modify(fab,0,0); - if((status & 7) != 1) lib$signal(status); - status = sys$close(fab,0,0); - if((status & 7) != 1) lib$signal(status); - }; - } - - If you have NFS running on the VMS system, what you need to do -depends upon which NFS software you are running on the VMS system. There -are a number of different TCP/IP packages for VMS available, and only very -limited testing has been performed. In the tests that has been done so -far, the contents of the file will always be correct when transferring the -file via NFS, but the record attributes may or may not be correct. - - One proprietary TCP/IP/NFS package for VMS is known to -automatically fix the record attributes of the object file if you NFS mount -a unix disk from the VMS system, and if the file has a ".obj" extension on -the unix system. Other TCP/IP packages might do this for you as well, but -they have not been checked. - -No matter what method you use to get the file to the VMS system, it is -always a good idea to check to make sure that it is the correct type by -doing a "$dir/full" on the object file. The desired record attributes will -be "None". Undesirable record attributes will be "Stream-LF" or anything -else. - -Once you get the files on the VMS system, you can check their integrity -with the "$anal/obj" command. (Naturally at some point you should rename -the .o files to .obj). As far as the debugger is concerned, the records -will be correct, but the debugger will not be able to find the source files, -since it only has the file name, and not the full directory specification. -You must give the debugger some help by telling it which directories to -search for the individual files - once you have done this you should be -able to proceed normally. - - It is a good idea to use names for your files which will be valid -under VMS, since otherwise you will have no way of getting the debugger to -find the source file when deugging. - -The reason for this is that the object file normally contins specific -information that the debugger can use to positively identify a file, and if -you are assembling on a unix system this information simply does not exist -in a meaningful way. You must help the debugger by using the "SET FILE=" -command to tell the debugger where to look for source files. The debugger -records will be correct, except that the debugger will not be initially -able to find the source files. You can use the "SET FILE" command to tell -the debugger where to look for the source files. - -I have only tested this with a SVr4 i486 machine, and everything seems to -work OK, with the limited testing that I have done. Other machines may -or may not work. You should read the chapters on cross-compilers in the gcc -manual before fooling with this. Since gas does not need to do any floating -point arithmetic, the floating point constants that are generated here should -be correct - the only concern is with constant folding in the main compiler. -The range and precision of floats and doubles are similar on the 486 (with -a builtin 80387) and the VAX, although there is a factor of 2 to 4 -difference in the range. The double, as implemented on the 486, is quite -similar to the G_FLOAT on the VAX. - -*********************************************************************** -****************** Notes for using GNU CC with the VMS debugger******** -*********************************************************************** - - - 1) You should be aware that GNU-C, as with any other decent compiler, -will do things when optimization is turned on that you may not expect. -Sometimes intermediate results are not written to variables, if they are only -used in one place, and sometimes variables that are not used at all will not be -written to the symbol table. Also, parameters to inline functions are often -inaccessible. You can see the assembly code equivalent by using KP7 in the -debugger, and from this you can tell if in fact a variable should have the -value that you expect. You can find out if a variable lives withing a register -by doing a 'show symbol/addr'. - - 2) Overly complex data types, such as: - -int (*(*(*(*(*(* sarr6)[1])[1])[2])[3])[4])[5]; - -will not be debugged properly, since the debugging record overflows an internal -debugger buffer. gcc-as will convert these to *void as far as the debugger -symbol table is concerned, which will avoid any problems, and the assembler -will give you a message informing you that this has happened. - - 3) You must, of course, compile and link with /debug. If you link -without debug, you still get traceback table in the executable, but there is no -symbol table for variables. - - 4) Included in the patches to VMS.C are fixes to two bugs that are -unrelated to the changes that I have made. One of these made it impossible to -debug small programs sometimes, and the other caused the debugger to become -confused about which routine it was in, and give this incorrect info in -tracebacks. - - 5) If you are using the GNU-C++ compiler, you should modify the -compiler driver file GNU_CC:[000000]GCC.COM (or GXX.COM). If you have a -seperate GXX.COM, then you need to change one line in GXX.COM to: -$ if f$locate("D",p2) .ne. P2_Length then Debug = " ""-G0""" - Notice zero---> ^ -If you are using a GCC.COM that does both C and C++, add the following lines to -GCC.COM: - -$! -$! Use old style debugging records for VMS -$! -$ if (Debug.nes."" ).and. Plus then Debug = " ""-G0""" - -after the variables Plus and Debug are set. The reason for this, is that C++ -compiler by default generates debugging records that are more complex, -with many new syntactical elements that allow for the new features of the -language. The -G0 switch tells the C++ compiler to use the old style debugging -records. Until the debugger understands C++ there is not any point to try and -use the expanded syntax. - - 6) When you have nested scopes, i.e.: -main(){ - int i; - {int i; - {int i; -};};} -and you say "EXAM i" the debugger needs to figure out which variable you -actually want to reference. I have arranged things to define a block to the -debugger when you use brackets to enter a new scope, so in the example above, -the variables would be described as: -TEST\main\i -TEST\main\$0\i -TEST\main\$0\$0\i -At each level, the block name is a number with a dollar sign prefix, the -numbers start with 0 and count upward. When you say EXAM i, the debugger looks -at the current PC, and decides which block it is currently in. It works from -the innermost level outward until it finds a block that has the variable "i" -defined. You can always specify the scope explicitly. - - 7) With C++, there can be a lot of inline functions, and it would be -rather restrictive to force the user to debug the program by converting all of -the inline functions to normal functions. What I have done is to essentially -"add" (with the debugger) source lines from the include files that contain the -inline functions. Thus when you step into an inline function it appears as if -you have called the function, and you can examine variables and so forth. -There are several *very* important differences, however. First of all, since -there is no function call involved, you cannot step over the inline function -call - you always step into it. Secondly, since the same source lines are used -in many locations, there is a seperate copy of the source for *each* usage. -Without this, breakpoints do not work, since we must have a 1-to-1 mapping -between source lines and PC. - Since you cannot step over inline function calls, it can be a real pain -if you are not really interested in what is going on for that function call. -What I have done is to use the "-D" switch for the assembler to toggle the -following behavior. With the "-D" switch, all inline functions are included in -the object file, and you can debug everything. Without the "-D" switch -(default case with VMS implementation), inline functions are included *only* if -they did not come from system header files (i.e. from GNU_CC_INCLUDE: or -GNU_GXX_INCLUDE:). Thus, without the switch the user only debugs his/her own -inline functions, and not the system ones. (This is especially useful if you do -a lot of stream I/O in C++). This probably will not provide enough granularity -for many users, but for now this is still somewhat experimental, and I would -like to reflect upon it and get some feedback before I go any further. -Possible solutions include an interactive prompting, a logical name, or a new -command line option in gcc.c (which is then passed through somehow to the guts -of the assembler). - The inline functions from header files appear after the source code -for the source file. This has the advantage that the source file itself is -numbered with the same line numbers that you get with an editor. In addition, -the entire header file is not included, since the assembler makes a list of -the min and max source lines that are used, and only includes those lines from -the first to the last actually used. (It is easy to change it to include the -whole file). - - 8) When you are debugging C++ objects, the object "this" is refered to -as "$this". Actually, the compiler writes it as ".this", but the period is -not good for the debugger, so I have a routine to convert it to a $. (It -actually converts all periods to $, but only for variables, since this was -intended to allow us to access "this". - - 9) If you use the asm("...") keyword for global symbols, you will not -be able to see that symbol with the debugger. The reason is that there are two -records for the symbol stored in the data structures of the assembler. One -contains the info such as psect number and offset, and the other one contains -the information having to do with the data type of the variable. In order to -debug as symbol, you need to be able to coorelate these records, and the only -way to do this is by name. The record with the storage attributes will take -the name used in the asm directive, and the record that specifies the data type -has the actual variable name, and thus when you use the asm directive to change -a variable name, the symbol becomes invisible. - - 10) Older versions of the compiler ( GNU-C 1.37.92 and earlier) place -global constants in the text psect. This is unfortunate, since to the linker -this appears to be an entry point. I sent a patch to the compiler to RMS, -which will generate a .const section for these variables, and patched the -assembler to put these variables into a psect just like that for normal -variables, except that they are marked NOWRT. static constants are still -placed in the text psect, since there is no need for any external access. diff --git a/gnu/dist/gas/conf.in b/gnu/dist/gas/conf.in deleted file mode 100644 index d56807cd88d5..000000000000 --- a/gnu/dist/gas/conf.in +++ /dev/null @@ -1,127 +0,0 @@ -/* conf.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Should gas use high-level BFD interfaces? */ -#undef BFD_ASSEMBLER - -/* Some assert/preprocessor combinations are incapable of handling - certain kinds of constructs in the argument of assert. For example, - quoted strings (if requoting isn't done right) or newlines. */ -#undef BROKEN_ASSERT - -/* If we aren't doing cross-assembling, some operations can be optimized, - since byte orders and value sizes don't need to be adjusted. */ -#undef CROSS_COMPILE - -/* Some gas code wants to know these parameters. */ -#undef TARGET_ALIAS -#undef TARGET_CPU -#undef TARGET_CANONICAL -#undef TARGET_OS -#undef TARGET_VENDOR - -/* Sometimes the system header files don't declare strstr. */ -#undef NEED_DECLARATION_STRSTR - -/* Sometimes the system header files don't declare malloc and realloc. */ -#undef NEED_DECLARATION_MALLOC - -/* Sometimes the system header files don't declare free. */ -#undef NEED_DECLARATION_FREE - -/* Sometimes the system header files don't declare sbrk. */ -#undef NEED_DECLARATION_SBRK - -/* Sometimes errno.h doesn't declare errno itself. */ -#undef NEED_DECLARATION_ERRNO - -#undef MANY_SEGMENTS - -/* Needed only for sparc configuration. */ -#undef SPARC_V9 -#undef SPARC_ARCH64 - -/* Defined if using CGEN. */ -#undef USING_CGEN - -/* Needed only for some configurations that can produce multiple output - formats. */ -#undef DEFAULT_EMULATION -#undef EMULATIONS -#undef USE_EMULATIONS -#undef OBJ_MAYBE_AOUT -#undef OBJ_MAYBE_BOUT -#undef OBJ_MAYBE_COFF -#undef OBJ_MAYBE_ECOFF -#undef OBJ_MAYBE_ELF -#undef OBJ_MAYBE_GENERIC -#undef OBJ_MAYBE_HP300 -#undef OBJ_MAYBE_IEEE -#undef OBJ_MAYBE_SOM -#undef OBJ_MAYBE_VMS - -/* Used for some of the COFF configurations, when the COFF code needs - to select something based on the CPU type before it knows it... */ -#undef I386COFF -#undef M68KCOFF -#undef M88KCOFF - -/* Define if you have the remove function. */ -#undef HAVE_REMOVE - -/* Define if you have the sbrk function. */ -#undef HAVE_SBRK - -/* Define if you have the unlink function. */ -#undef HAVE_UNLINK - -/* Define if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_VARARGS_H diff --git a/gnu/dist/gas/config-gas.com b/gnu/dist/gas/config-gas.com deleted file mode 100644 index cf5248af5da9..000000000000 --- a/gnu/dist/gas/config-gas.com +++ /dev/null @@ -1,186 +0,0 @@ -$!config-gas.com -$! This file sets things up to build gas on a VMS system to generate object -$! files for a VMS system. We do not use the configure script, since we -$! do not have /bin/sh to execute it. -$! -$! -$ gas_host="vms" -$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$ arch = f$element(arch_indx,"|","|VAX|Alpha|") -$ if arch.eqs."VAX" -$ then -$ cpu_type="vax" -$ obj_format="vms" -$ atof="vax" -$ else -$ cpu_type="alpha" -$ obj_format="evax" -$ atof="ieee" -$ endif -$ emulation="generic" -$! -$ DELETE = "delete/noConfirm" -$ ECHO = "write sys$output" -$! -$! Target specific information -$ call make "targ-cpu.h" "[.config]tc-''cpu_type'.h" -$ call make "targ-env.h" "[.config]te-''emulation'.h" -$! -$! Code to handle the object file format. -$ call make "obj-format.h" "[.config]obj-''obj_format'.h" -$! -$! (not currently used for vax or alpha) -$ call make "itbl-cpu.h" "[.config]itbl-''cpu_type'.h" -$! -$! -$! Create the file version.opt, which helps identify the executable. -$! -$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$search CONFIGURE.IN "AM_INIT_AUTOMAKE"/Exact/Output=config-gas-tmp.tmp -$open ifile$ config-gas-tmp.tmp -$read ifile$ line -$close ifile$ -$DELETE config-gas-tmp.tmp;* -$! Discard "AM_INIT_AUTOMAKE(gas, " and ")" parts. -$ijk=f$locate(",",line)+2 -$line=f$extract(ijk,f$length(line)-ijk,line) -$ijk=f$locate(")",line) -$line=f$extract(0,ijk,line) -$! -$ if f$search("version.opt").nes."" then DELETE version.opt;* -$copy _NL: version.opt -$open/Append ifile$ version.opt -$write ifile$ "identification="+""""+line+"""" -$close ifile$ -$! -$! Now write config.h. -$! -$ if f$search("config.h").nes."" then DELETE config.h;* -$copy _NL: config.h -$open/Append ifile$ config.h -$write ifile$ "/* config.h. Generated by config-gas.com. */ -$write ifile$ "#ifndef VERSION" -$write ifile$ "#define VERSION """,line,"""" -$write ifile$ "#endif" -$write ifile$ "/*--*/" -$if arch .eqs. "VAX" -$then -$append [.config]vms-conf.h ifile$: -$else -$ append [.config]vms-a-conf.h ifile$: -$endif -$close ifile$ -$ECHO "Created config.h." -$! -$! Check for, and possibly make, header file . -$! -$ if f$search("tmp-chk-h.*").nes."" then DELETE tmp-chk-h.*;* -$!can't use simple `#include HDR' with `gcc /Define="HDR="' -$!because the 2.6.[0-3] preprocessor handles it wrong (VMS-specific gcc bug) -$ create tmp-chk-h.c -int tmp_chk_h; /* guarantee non-empty output */ -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_UNIXIO_H -#include -#endif -#ifdef HAVE_UNIXLIB_H -#include -#endif -$ on warning then continue -$ CHECK = "call tmp_chk_h" -$ CHECK "HAVE_STDIO_H" -$ if .not.$status -$ then type sys$input: - -? could not compile . - - If you're compiling with DEC C or VAX C, create config.status as an - empty file and start gnu make again. - - If you're compiling with GNU C, there is some setup problem and - gas configuration cannot proceed. - -$ DELETE tmp-chk-h.c;* -$ exit %x002C -$ endif -$! -$ CHECK "HAVE_UNISTD_H" -$ if .not.$status -$ then -$ if f$trnlnm("HFILE$").nes."" then close/noLog hfile$ -$ CHECK "HAVE_UNIXIO_H" -$ got_unixio = ($status .and. 1) -$ CHECK "HAVE_UNIXLIB_H" -$ got_unixlib = ($status .and. 1) -$ create []unistd.h !with rudimentary contents -/* substitute for building gas */ -#ifndef UNISTD_H -#define UNISTD_H - -$ open/Append hfile$ []unistd.h -$ if got_unixio -$ then write hfile$ "#include " -$ else append sys$input: hfile$: -/* some of the routines normally prototyped in */ -extern int creat(), open(), close(), read(), write(); -extern int access(), dup(), dup2(), fstat(), stat(); -extern long lseek(); -$ endif -$ write hfile$ "" -$ if got_unixlib -$ then write hfile$ "#include " -$ else append sys$input: hfile$: -/* some of the routines normally prototyped in */ -extern char *sbrk(), *getcwd(), *cuserid(); -extern int brk(), chdir(), chmod(), chown(), mkdir(); -extern unsigned getuid(), umask(); -$ endif -$ append sys$input: hfile$: - -#endif /*UNISTD_H*/ -$ close hfile$ -$ ECHO "Created ""[]unistd.h""." -$ endif !gcc '#include ' failed -$ DELETE tmp-chk-h.c;* -$ -$tmp_chk_h: subroutine -$ set noOn -$ hname = f$edit("<" + (p1 - "HAVE_" - "_H") + ".h>","LOWERCASE") -$ write sys$output "Checking for ''hname'." -$ if f$search("tmp-chk-h.obj").nes."" then DELETE tmp-chk-h.obj;* -$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc -$ define/noLog sys$output _NL: ! driver's use of multiple image activation -$ gcc /Include=([],[-.include]) /Define=("''p1'") tmp-chk-h.c -$!can't just check $status; gcc 2.6.[0-3] preprocessor doesn't set it correctly -$ ok = (($status.and.1).and.(f$search("tmp-chk-h.obj").nes."")) .or. %x10000000 -$ deassign sys$error !restore, more or less -$ deassign sys$output -$ if ok then DELETE tmp-chk-h.obj;* -$ exit ok -$ endsubroutine !tmp_chk_h -$ -$! -$! Done -$! -$ if f$search("config.status") .nes. "" then DELETE config.status;* -$ open/write cfile []config.status -$ write cfile "Links are now set up for use with a "+arch+" running VMS." -$ close cfile -$ type []config.status -$exit -$! -$! -$make: subroutine -$ if f$search(p1).nes."" then DELETE 'p1';* -$ create 'p1' -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ open/Append ifile$ 'p1' -$ write ifile$ "#include ""''f$string(p2 - "[.config]")'""" -$ close ifile$ -$ ECHO "Created ''p1' for ''p2'." -$endsubroutine !make diff --git a/gnu/dist/gas/config/arm-big.mt b/gnu/dist/gas/config/arm-big.mt deleted file mode 100644 index da08852edaa0..000000000000 --- a/gnu/dist/gas/config/arm-big.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=1 diff --git a/gnu/dist/gas/config/arm-lit.mt b/gnu/dist/gas/config/arm-lit.mt deleted file mode 100644 index b5f7dea984dd..000000000000 --- a/gnu/dist/gas/config/arm-lit.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=0 diff --git a/gnu/dist/gas/config/go32.cfg b/gnu/dist/gas/config/go32.cfg deleted file mode 100644 index 4059395da8e1..000000000000 --- a/gnu/dist/gas/config/go32.cfg +++ /dev/null @@ -1,93 +0,0 @@ -/* config.h for go32 */ - -#define I386COFF 1 - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Should gas use high-level BFD interfaces? */ -#undef BFD_ASSEMBLER - -/* If we aren't doing cross-assembling, some operations can be optimized, - since byte orders and value sizes don't need to be adjusted. */ -#undef CROSS_COMPILE - -/* Some gas code wants to know these parameters. */ -#define TARGET_ALIAS "i386" -#define TARGET_CPU "i386" -#define TARGET_CANONICAL "i386-i386" -#define TARGET_OS "djgpp" -#define TARGET_VENDOR "djgpp" - -/* Some operating systems, for example DOS, require the use of "wb" mode when - opening a binary file for writing. If only "w" is used, the file will not - be correct. However, some other systems reject such a mode. This indicates - which ../include/fopen-*.h header file we want to include, so that we can - get macros that'll do the right thing for this system. */ -#define WANT_FOPEN_BIN 1 - -/* Sometimes the system header files don't declare malloc and realloc. */ -#undef NEED_DECLARATION_MALLOC - -/* Sometimes the system header files don't declare free. */ -#undef NEED_DECLARATION_FREE - -/* Sometimes errno.h doesn't declare errno itself. */ -#undef NEED_DECLARATION_ERRNO - -#define MANY_SEGMENTS 1 - -/* Needed only for sparc configuration */ -#undef sparcv9 - -/* Define if you have the remove function. */ -#define HAVE_REMOVE 1 - -/* Define if you have the unlink function. */ -#define HAVE_UNLINK 1 - -/* Define if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the header file. */ -#undef HAVE_VARARGS_H diff --git a/gnu/dist/gas/config/i386coff.mt b/gnu/dist/gas/config/i386coff.mt deleted file mode 100644 index efda83365181..000000000000 --- a/gnu/dist/gas/config/i386coff.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DI386COFF diff --git a/gnu/dist/gas/config/m68kcoff.mt b/gnu/dist/gas/config/m68kcoff.mt deleted file mode 100644 index 0d07eb178d15..000000000000 --- a/gnu/dist/gas/config/m68kcoff.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DM68KCOFF diff --git a/gnu/dist/gas/config/m88kcoff.mt b/gnu/dist/gas/config/m88kcoff.mt deleted file mode 100644 index 474f6a01ebe7..000000000000 --- a/gnu/dist/gas/config/m88kcoff.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DM88KCOFF diff --git a/gnu/dist/gas/config/mips-big.mt b/gnu/dist/gas/config/mips-big.mt deleted file mode 100644 index da08852edaa0..000000000000 --- a/gnu/dist/gas/config/mips-big.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=1 diff --git a/gnu/dist/gas/config/mips-lit.mt b/gnu/dist/gas/config/mips-lit.mt deleted file mode 100644 index b5f7dea984dd..000000000000 --- a/gnu/dist/gas/config/mips-lit.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=0 diff --git a/gnu/dist/gas/config/ppc-big.mt b/gnu/dist/gas/config/ppc-big.mt deleted file mode 100644 index da08852edaa0..000000000000 --- a/gnu/dist/gas/config/ppc-big.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=1 diff --git a/gnu/dist/gas/config/ppc-lit.mt b/gnu/dist/gas/config/ppc-lit.mt deleted file mode 100644 index b5f7dea984dd..000000000000 --- a/gnu/dist/gas/config/ppc-lit.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=0 diff --git a/gnu/dist/gas/config/ppc-sol.mt b/gnu/dist/gas/config/ppc-sol.mt deleted file mode 100644 index ec452efa08ee..000000000000 --- a/gnu/dist/gas/config/ppc-sol.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DTARGET_BYTES_BIG_ENDIAN=0 -DTARGET_SOLARIS_COMMENT diff --git a/gnu/dist/gas/config/sco5.mt b/gnu/dist/gas/config/sco5.mt deleted file mode 100644 index 8879320c4e1e..000000000000 --- a/gnu/dist/gas/config/sco5.mt +++ /dev/null @@ -1 +0,0 @@ -TDEFINES=-DSCO_ELF diff --git a/gnu/dist/gas/configure.bat b/gnu/dist/gas/configure.bat deleted file mode 100644 index 1fd269fd6711..000000000000 --- a/gnu/dist/gas/configure.bat +++ /dev/null @@ -1,57 +0,0 @@ -@echo off -if "%1" == "h8/300" goto h8300 - -echo Configuring gas for go32 -update config/tc-i386.c targ-cpu.c -update config/tc-i386.h targ-cpu.h -update config/te-go32.h targ-env.h -update config/obj-coff.h obj-format.h -update config/obj-coff.c obj-format.c -update config/atof-ieee.c atof-targ.c -goto common - -:h8300 -echo Configuring gas for H8/300 -copy config\ho-go32.h host.h -copy config\tc-h8300.c targ-cpu.c -copy config\tc-h8300.h targ-cpu.h -copy config\te-generic.h targ-env.h -copy config\objcoffbfd.h obj-format.h -copy config\objcoffbfd.c obj-format.c -copy config\atof-ieee.c atof-targ.c - -:common - -echo # Makefile generated by "configure.bat"> Makefile.2 -echo all.dos : as.new gasp.new>> Makefile.2 - -if exist config.sed del config.sed - -echo "s/@srcdir@/./g ">> config.sed -echo "s/@target_alias@/go32/ ">> config.sed -echo "s/@prefix@// ">> config.sed -echo "s/@CC@/gcc/g ">> config.sed -echo "s/@OPCODES_LIB@/..\/opcodes\/libopcodes.a/g ">> config.sed -echo "s/@BFDLIB@/..\/bfd\/libbfd.a/g ">> config.sed -echo "s/@ALL_OBJ_DEPS@/..\/bfd\/bfd.h/g ">> config.sed - -echo "/^all[ ]*:/ a\ ">> config.sed -echo "dummy: ">> config.sed - -echo "s/\/usr[^ ]*.h//g ">> config.sed - -echo "/^config.h[ ]*:/ d ">> config.sed -echo "s/^Makefile/not-Makefile/ ">> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile.2 -update Makefile.2 Makefile -del Makefile.2 -del config.sed -del config2.sed - -echo #ifndef GAS_VERSION> config.new -sed -n "/^VERSION=/p" Makefile.in | sed -e "s/VERSION=/#define GAS_VERSION \"/" -e "s/$/\"/">> config.new -type config\go32.cfg >> config.new -echo #endif>> config.new -update config.new config.h diff --git a/gnu/dist/gas/doc/as.info b/gnu/dist/gas/doc/as.info deleted file mode 100644 index 7b02bd00508c..000000000000 --- a/gnu/dist/gas/doc/as.info +++ /dev/null @@ -1,311 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -Indirect: -as.info-1: 884 -as.info-2: 48330 -as.info-3: 97421 -as.info-4: 147389 -as.info-5: 197063 -as.info-6: 239578 -as.info-7: 278841 - -Tag Table: -(Indirect) -Node: Top884 -Node: Overview1543 -Node: Manual11603 -Node: GNU Assembler12542 -Node: Object Formats13709 -Node: Command Line14156 -Node: Input Files15238 -Node: Object17144 -Node: Errors18091 -Node: Invoking19289 -Node: a20989 -Node: D22323 -Node: f22543 -Node: I23046 -Node: K23585 -Node: L23884 -Node: M24735 -Node: MD29124 -Node: o29543 -Node: R29991 -Node: statistics31007 -Node: traditional-format31407 -Node: v31873 -Node: W32141 -Node: Z32723 -Node: Syntax33238 -Node: Preprocessing33828 -Node: Whitespace35388 -Node: Comments35778 -Node: Symbol Intro37765 -Node: Statements38448 -Node: Constants40694 -Node: Characters41320 -Node: Strings41813 -Node: Chars43966 -Node: Numbers44707 -Node: Integers45238 -Node: Bignums45881 -Node: Flonums46224 -Node: Sections47956 -Node: Secs Background48330 -Node: Ld Sections53356 -Node: As Sections55750 -Node: Sub-Sections56655 -Node: bss59654 -Node: Symbols60599 -Node: Labels61246 -Node: Setting Symbols61972 -Node: Symbol Names62338 -Node: Dot65300 -Node: Symbol Attributes65742 -Node: Symbol Value66474 -Node: Symbol Type67510 -Node: a.out Symbols67889 -Node: Symbol Desc68139 -Node: Symbol Other68421 -Node: COFF Symbols68577 -Node: SOM Symbols69206 -Node: Expressions69639 -Node: Empty Exprs70387 -Node: Integer Exprs70729 -Node: Arguments71119 -Node: Operators72216 -Node: Prefix Ops72542 -Node: Infix Ops72861 -Node: Pseudo Ops74353 -Node: Abort78267 -Node: ABORT78668 -Node: Align78930 -Node: App-File81095 -Node: Ascii81632 -Node: Asciz81937 -Node: Balign82177 -Node: Byte84035 -Node: Comm84268 -Node: Data85627 -Node: Def85937 -Node: Desc86305 -Node: Dim86800 -Node: Double87191 -Node: Eject87522 -Node: Else87690 -Node: Endef87979 -Node: Endif88301 -Node: Equ88552 -Node: Equiv88855 -Node: Err89251 -Node: Extern89555 -Node: File89807 -Node: Fill90458 -Node: Float91415 -Node: Global91751 -Node: hword92494 -Node: Ident92815 -Node: If93115 -Node: Include93971 -Node: Int94511 -Node: Irp94880 -Node: Irpc95674 -Node: Lcomm96493 -Node: Lflags97234 -Node: Line97421 -Node: Linkonce98444 -Node: Ln99664 -Node: MRI99812 -Node: List100139 -Node: Long100742 -Node: Macro100912 -Node: Nolist103296 -Node: Octa103712 -Node: Org104038 -Node: P2align105313 -Node: Psize107229 -Node: Quad107902 -Node: Rept108342 -Node: Sbttl108748 -Node: Scl109106 -Node: Section109602 -Node: Set111951 -Node: Short112504 -Node: Single112818 -Node: Size113155 -Node: Sleb128113550 -Node: Skip113865 -Node: Space114180 -Node: Stab115065 -Node: String117061 -Node: Symver117480 -Node: Tag119065 -Node: Text119573 -Node: Title119885 -Node: Type120257 -Node: Val120633 -Node: Uleb128120991 -Node: Word121306 -Node: Deprecated123143 -Node: Machine Dependencies123379 -Node: ARC-Dependent125075 -Node: ARC-Opts125389 -Node: ARC-Float126123 -Node: ARC-Directives126421 -Node: AMD29K-Dependent126814 -Node: AMD29K Options127195 -Node: AMD29K Syntax127369 -Node: AMD29K-Macros127633 -Node: AMD29K-Chars127884 -Node: AMD29K-Regs128147 -Node: AMD29K Floating Point129411 -Node: AMD29K Directives129617 -Node: AMD29K Opcodes131025 -Node: ARM-Dependent131361 -Node: ARM Options131735 -Node: ARM Syntax133475 -Node: ARM-Chars133695 -Node: ARM-Regs133894 -Node: ARM Floating Point134066 -Node: ARM Directives134256 -Node: ARM Opcodes135175 -Node: D10V-Dependent135511 -Node: D10V-Opts135855 -Node: D10V-Syntax136488 -Node: D10V-Size137008 -Node: D10V-Subs137968 -Node: D10V-Chars138990 -Node: D10V-Regs140576 -Node: D10V-Addressing141607 -Node: D10V-Word142280 -Node: D10V-Float142781 -Node: D10V-Opcodes143083 -Node: H8/300-Dependent143467 -Node: H8/300 Options143871 -Node: H8/300 Syntax144052 -Node: H8/300-Chars144339 -Node: H8/300-Regs144623 -Node: H8/300-Addressing145527 -Node: H8/300 Floating Point146553 -Node: H8/300 Directives146869 -Node: H8/300 Opcodes147389 -Node: H8/500-Dependent155742 -Node: H8/500 Options156146 -Node: H8/500 Syntax156327 -Node: H8/500-Chars156614 -Node: H8/500-Regs156905 -Node: H8/500-Addressing157661 -Node: H8/500 Floating Point158278 -Node: H8/500 Directives158594 -Node: H8/500 Opcodes158913 -Node: HPPA-Dependent164026 -Node: HPPA Notes164448 -Node: HPPA Options165195 -Node: HPPA Syntax165379 -Node: HPPA Floating Point166638 -Node: HPPA Directives166833 -Node: HPPA Opcodes173424 -Node: i386-Dependent173672 -Node: i386-Options174341 -Node: i386-Syntax174485 -Node: i386-Opcodes176435 -Node: i386-Regs178554 -Node: i386-prefixes179695 -Node: i386-Memory181364 -Node: i386-jumps183638 -Node: i386-Float184708 -Node: i386-16bit186199 -Node: i386-Notes188591 -Node: i960-Dependent189432 -Node: Options-i960189824 -Node: Floating Point-i960193705 -Node: Directives-i960193962 -Node: Opcodes for i960195982 -Node: callj-i960196588 -Node: Compare-and-branch-i960197063 -Node: M68K-Dependent198952 -Node: M68K-Opts199406 -Node: M68K-Syntax204354 -Node: M68K-Moto-Syntax206182 -Node: M68K-Float208760 -Node: M68K-Directives209269 -Node: M68K-opcodes209864 -Node: M68K-Branch210076 -Node: M68K-Chars212891 -Node: MIPS-Dependent213289 -Node: MIPS Opts214169 -Node: MIPS Object217005 -Node: MIPS Stabs218560 -Node: MIPS ISA219271 -Node: MIPS autoextend220379 -Node: MIPS insn221090 -Node: MIPS option stack221576 -Node: SH-Dependent222289 -Node: SH Options222672 -Node: SH Syntax222837 -Node: SH-Chars223096 -Node: SH-Regs223375 -Node: SH-Addressing223974 -Node: SH Floating Point224868 -Node: SH Directives225164 -Node: SH Opcodes225520 -Node: Sparc-Dependent229767 -Node: Sparc-Opts230139 -Node: Sparc-Aligned-Data232385 -Node: Sparc-Float233229 -Node: Sparc-Directives233419 -Node: Z8000-Dependent234637 -Node: Z8000 Options235596 -Node: Z8000 Syntax235771 -Node: Z8000-Chars236047 -Node: Z8000-Regs236265 -Node: Z8000-Addressing237037 -Node: Z8000 Directives237980 -Node: Z8000 Opcodes239578 -Node: Vax-Dependent249514 -Node: VAX-Opts250021 -Node: VAX-float252311 -Node: VAX-directives252932 -Node: VAX-opcodes253781 -Node: VAX-branch254159 -Node: VAX-operands256655 -Node: VAX-no257407 -Node: V850-Dependent257633 -Node: V850 Options258019 -Node: V850 Syntax259049 -Node: V850-Chars259275 -Node: V850-Regs259425 -Node: V850 Floating Point260800 -Node: V850 Directives260995 -Node: V850 Opcodes261669 -Node: Reporting Bugs266162 -Node: Bug Criteria266885 -Node: Bug Reporting267645 -Node: Acknowledgements274214 -Node: Index278841 - -End Tag Table diff --git a/gnu/dist/gas/doc/as.info-1 b/gnu/dist/gas/doc/as.info-1 deleted file mode 100644 index 342196c1110a..000000000000 --- a/gnu/dist/gas/doc/as.info-1 +++ /dev/null @@ -1,1345 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Top, Next: Overview, Up: (dir) - -Using as -******** - - This file is a user guide to the GNU assembler `as'. - -* Menu: - -* Overview:: Overview -* Invoking:: Command-Line Options -* Syntax:: Syntax -* Sections:: Sections and Relocation -* Symbols:: Symbols -* Expressions:: Expressions -* Pseudo Ops:: Assembler Directives -* Machine Dependencies:: Machine Dependent Features -* Reporting Bugs:: Reporting Bugs -* Acknowledgements:: Who Did What -* Index:: Index - - -File: as.info, Node: Overview, Next: Invoking, Prev: Top, Up: Top - -Overview -******** - - Here is a brief summary of how to invoke `as'. For details, *note -Comand-Line Options: Invoking.. - - as [ -a[cdhlns][=file] ] [ -D ] [ --defsym SYM=VAL ] - [ -f ] [ --gstabs ] [ --help ] [ -I DIR ] [ -J ] [ -K ] [ -L ] - [ --keep-locals ] [ -o OBJFILE ] [ -R ] [ --statistics ] [ -v ] - [ -version ] [ --version ] [ -W ] [ -w ] [ -x ] [ -Z ] - [ -mbig-endian | -mlittle-endian ] - [ -m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m[i]] ] - [ -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t ] - [ -mthumb | -mall ] - [ -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu ] - [ -EB | -EL ] - [ -mapcs-32 | -mapcs-26 ] - [ -O ] - [ -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite - -Av8plus | -Av8plusa | -Av9 | -Av9a ] - [ -xarch=v8plus | -xarch=v8plusa ] [ -bump ] [ -32 | -64 ] - [ -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC ] - [ -b ] [ -no-relax ] - [ -l ] [ -m68000 | -m68010 | -m68020 | ... ] - [ -nocpp ] [ -EL ] [ -EB ] [ -G NUM ] [ -mcpu=CPU ] - [ -mips1 ] [ -mips2 ] [ -mips3 ] [ -m4650 ] [ -no-m4650 ] - [ --trap ] [ --break ] - [ --emulation=NAME ] - [ -- | FILES ... ] - -`-a[cdhlmns]' - Turn on listings, in any of a variety of ways: - - `-ac' - omit false conditionals - - `-ad' - omit debugging directives - - `-ah' - include high-level source - - `-al' - include assembly - - `-am' - include macro expansions - - `-an' - omit forms processing - - `-as' - include symbols - - `=file' - set the name of the listing file - - You may combine these options; for example, use `-aln' for assembly - listing without forms processing. The `=file' option, if used, - must be the last one. By itself, `-a' defaults to `-ahls'. - -`-D' - Ignored. This option is accepted for script compatibility with - calls to other assemblers. - -`--defsym SYM=VALUE' - Define the symbol SYM to be VALUE before assembling the input file. - VALUE must be an integer constant. As in C, a leading `0x' - indicates a hexadecimal value, and a leading `0' indicates an - octal value. - -`-f' - "fast"--skip whitespace and comment preprocessing (assume source is - compiler output). - -`--gstabs' - Generate stabs debugging information for each assembler line. This - may help debugging assembler code, if the debugger can handle it. - -`--help' - Print a summary of the command line options and exit. - -`-I DIR' - Add directory DIR to the search list for `.include' directives. - -`-J' - Don't warn about signed overflow. - -`-K' - Issue warnings when difference tables altered for long - displacements. - -`-L' -`--keep-locals' - Keep (in the symbol table) local symbols. On traditional a.out - systems these start with `L', but different systems have different - local label prefixes. - -`-o OBJFILE' - Name the object-file output from `as' OBJFILE. - -`-R' - Fold the data section into the text section. - -`--statistics' - Print the maximum space (in bytes) and total time (in seconds) - used by assembly. - -`--strip-local-absolute' - Remove local absolute symbols from the outgoing symbol table. - -`-v' -`-version' - Print the `as' version. - -`--version' - Print the `as' version and exit. - -`-W' - Suppress warning messages. - -`-w' - Ignored. - -`-x' - Ignored. - -`-Z' - Generate an object file even after errors. - -`-- | FILES ...' - Standard input, or source files to assemble. - - The following options are available when as is configured for an ARC -processor. - -`-mbig-endian' - Generate "big endian" format output. - -`-mlittle-endian' - Generate "little endian" format output. - - The following options are available when as is configured for the ARM -processor family. - -`-m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m] | -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t' - Specify which variant of the ARM architecture is the target. - -`-mthumb | -mall' - Enable or disable Thumb only instruction decoding. - -`-mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu' - Select which Floating Point architcture is the target. - -`-mapcs-32 | -mapcs-26' - Select which procedure calling convention is in use. - -`-EB | -EL' - Select either big-endian (-EB) or little-endian (-EL) output. - - The following options are available when as is configured for a D10V -processor. -`-O' - Optimize output by parallelizing instructions. - - The following options are available when as is configured for the -Intel 80960 processor. - -`-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC' - Specify which variant of the 960 architecture is the target. - -`-b' - Add code to collect statistics about branches taken. - -`-no-relax' - Do not alter compare-and-branch instructions for long - displacements; error if necessary. - - The following options are available when as is configured for the -Motorola 68000 series. - -`-l' - Shorten references to undefined symbols, to one word instead of - two. - -`-m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060' -`| -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -mcpu32 | -m5200' - Specify what processor in the 68000 family is the target. The - default is normally the 68020, but this can be changed at - configuration time. - -`-m68881 | -m68882 | -mno-68881 | -mno-68882' - The target machine does (or does not) have a floating-point - coprocessor. The default is to assume a coprocessor for 68020, - 68030, and cpu32. Although the basic 68000 is not compatible with - the 68881, a combination of the two can be specified, since it's - possible to do emulation of the coprocessor instructions with the - main processor. - -`-m68851 | -mno-68851' - The target machine does (or does not) have a memory-management - unit coprocessor. The default is to assume an MMU for 68020 and - up. - - The following options are available when `as' is configured for the -SPARC architecture: - -`-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite' -`-Av8plus | -Av8plusa | -Av9 | -Av9a' - Explicitly select a variant of the SPARC architecture. - - `-Av8plus' and `-Av8plusa' select a 32 bit environment. `-Av9' - and `-Av9a' select a 64 bit environment. - - `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with - UltraSPARC extensions. - -`-xarch=v8plus | -xarch=v8plusa' - For compatibility with the Solaris v9 assembler. These options are - equivalent to -Av8plus and -Av8plusa, respectively. - -`-bump' - Warn when the assembler switches to another architecture. - - The following options are available when as is configured for a MIPS -processor. - -`-G NUM' - This option sets the largest size of an object that can be - referenced implicitly with the `gp' register. It is only accepted - for targets that use ECOFF format, such as a DECstation running - Ultrix. The default value is 8. - -`-EB' - Generate "big endian" format output. - -`-EL' - Generate "little endian" format output. - -`-mips1' -`-mips2' -`-mips3' - Generate code for a particular MIPS Instruction Set Architecture - level. `-mips1' corresponds to the R2000 and R3000 processors, - `-mips2' to the R6000 processor, and `-mips3' to the R4000 - processor. - -`-m4650' -`-no-m4650' - Generate code for the MIPS R4650 chip. This tells the assembler - to accept the `mad' and `madu' instruction, and to not schedule - `nop' instructions around accesses to the `HI' and `LO' registers. - `-no-m4650' turns off this option. - -`-mcpu=CPU' - Generate code for a particular MIPS cpu. This has little effect - on the assembler, but it is passed by `gcc'. - -`--emulation=NAME' - This option causes `as' to emulate `as' configured for some other - target, in all respects, including output format (choosing between - ELF and ECOFF only), handling of pseudo-opcodes which may generate - debugging information or store symbol table information, and - default endianness. The available configuration names are: - `mipsecoff', `mipself', `mipslecoff', `mipsbecoff', `mipslelf', - `mipsbelf'. The first two do not alter the default endianness - from that of the primary target for which the assembler was - configured; the others change the default to little- or big-endian - as indicated by the `b' or `l' in the name. Using `-EB' or `-EL' - will override the endianness selection in any case. - - This option is currently supported only when the primary target - `as' is configured for is a MIPS ELF or ECOFF target. - Furthermore, the primary target or others specified with - `--enable-targets=...' at configuration time must include support - for the other format, if both are to be available. For example, - the Irix 5 configuration includes support for both. - - Eventually, this option will support more configurations, with more - fine-grained control over the assembler's behavior, and will be - supported for more processors. - -`-nocpp' - `as' ignores this option. It is accepted for compatibility with - the native tools. - -`--trap' -`--no-trap' -`--break' -`--no-break' - Control how to deal with multiplication overflow and division by - zero. `--trap' or `--no-break' (which are synonyms) take a trap - exception (and only work for Instruction Set Architecture level 2 - and higher); `--break' or `--no-trap' (also synonyms, and the - default) take a break exception. - -* Menu: - -* Manual:: Structure of this Manual -* GNU Assembler:: The GNU Assembler -* Object Formats:: Object File Formats -* Command Line:: Command Line -* Input Files:: Input Files -* Object:: Output (Object) File -* Errors:: Error and Warning Messages - - -File: as.info, Node: Manual, Next: GNU Assembler, Up: Overview - -Structure of this Manual -======================== - - This manual is intended to describe what you need to know to use GNU -`as'. We cover the syntax expected in source files, including notation -for symbols, constants, and expressions; the directives that `as' -understands; and of course how to invoke `as'. - - This manual also describes some of the machine-dependent features of -various flavors of the assembler. - - On the other hand, this manual is *not* intended as an introduction -to programming in assembly language--let alone programming in general! -In a similar vein, we make no attempt to introduce the machine -architecture; we do *not* describe the instruction set, standard -mnemonics, registers or addressing modes that are standard to a -particular architecture. You may want to consult the manufacturer's -machine architecture manual for this information. - - -File: as.info, Node: GNU Assembler, Next: Object Formats, Prev: Manual, Up: Overview - -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 -similar environment when you use it on another architecture. Each -version has much in common with the others, including object file -formats, most assembler directives (often called "pseudo-ops") and -assembler syntax. - - `as' is primarily intended to assemble the output of the GNU C -compiler `gcc' for use by the linker `ld'. Nevertheless, we've tried -to make `as' assemble correctly everything that other assemblers for -the same machine would assemble. Any exceptions are documented -explicitly (*note Machine Dependencies::.). This doesn't mean `as' -always uses the same syntax as another assembler for the same -architecture; for example, we know of several incompatible versions of -680x0 assembly language syntax. - - Unlike older assemblers, `as' is designed to assemble a source -program in one pass of the source file. This has a subtle impact on the -`.org' directive (*note `.org': Org.). - - -File: as.info, Node: Object Formats, Next: Command Line, Prev: GNU Assembler, Up: Overview - -Object File Formats -=================== - - The GNU assembler can be configured to produce several alternative -object file formats. For the most part, this does not affect how you -write assembly language programs; but directives for debugging symbols -are typically different in different file formats. *Note Symbol -Attributes: Symbol Attributes. - - -File: as.info, Node: Command Line, Next: Input Files, Prev: Object Formats, Up: Overview - -Command Line -============ - - After the program name `as', the command line may contain options -and file names. Options may appear in any order, and may be before, -after, or between file names. The order of file names is significant. - - `--' (two hyphens) by itself names the standard input file -explicitly, as one of the files for `as' to assemble. - - Except for `--' any command line argument that begins with a hyphen -(`-') is an option. Each option changes the behavior of `as'. No -option changes the way another option works. An option is a `-' -followed by one or more letters; the case of the letter is important. -All options are optional. - - Some options expect exactly one file name to follow them. The file -name may either immediately follow the option's letter (compatible with -older assemblers) or it may be the next command argument (GNU -standard). These two command lines are equivalent: - - as -o my-object-file.o mumble.s - as -omy-object-file.o mumble.s - - -File: as.info, Node: Input Files, Next: Object, Prev: Command Line, Up: Overview - -Input Files -=========== - - We use the phrase "source program", abbreviated "source", to -describe the program input to one run of `as'. The program may be in -one or more files; how the source is partitioned into files doesn't -change the meaning of the source. - - The source program is a concatenation of the text in all the files, -in the order specified. - - Each time you run `as' it assembles exactly one source program. The -source program is made up of one or more files. (The standard input is -also a file.) - - You give `as' a command line that has zero or more input file names. -The input files are read (from left file name to right). A command -line argument (in any position) that has no special meaning is taken to -be an input file name. - - If you give `as' no file names it attempts to read one input file -from the `as' standard input, which is normally your terminal. You may -have to type to tell `as' there is no more program to assemble. - - Use `--' if you need to explicitly name the standard input file in -your command line. - - If the source is empty, `as' produces a small, empty object file. - -Filenames and Line-numbers --------------------------- - - There are two ways of locating a line in the input file (or files) -and either may be used in reporting error messages. One way refers to -a line number in a physical file; the other refers to a line number in a -"logical" file. *Note Error and Warning Messages: Errors. - - "Physical files" are those files named in the command line given to -`as'. - - "Logical files" are simply names declared explicitly by assembler -directives; they bear no relation to physical files. Logical file names -help error messages reflect the original source file, when `as' source -is itself synthesized from other files. *Note `.app-file': App-File. - - -File: as.info, Node: Object, Next: Errors, Prev: Input Files, Up: Overview - -Output (Object) File -==================== - - Every time you run `as' it produces an output file, which is your -assembly language program translated into numbers. This file is the -object file. Its default name is `a.out', or `b.out' when `as' is -configured for the Intel 80960. You can give it another name by using -the `-o' option. Conventionally, object file names end with `.o'. The -default name is used for historical reasons: older assemblers were -capable of assembling self-contained programs directly into a runnable -program. (For some formats, this isn't currently possible, but it can -be done for the `a.out' format.) - - The object file is meant for input to the linker `ld'. It contains -assembled program code, information to help `ld' integrate the -assembled program into a runnable file, and (optionally) symbolic -information for the debugger. - - -File: as.info, Node: Errors, Prev: Object, Up: Overview - -Error and Warning Messages -========================== - - `as' may write warnings and error messages to the standard error -file (usually your terminal). This should not happen when a compiler -runs `as' automatically. Warnings report an assumption made so that -`as' could keep assembling a flawed program; errors report a grave -problem that stops the assembly. - - Warning messages have the format - - file_name:NNN:Warning Message Text - -(where NNN is a line number). If a logical file name has been given -(*note `.app-file': App-File.) it is used for the filename, otherwise -the name of the current input file is used. If a logical line number -was given (*note `.line': Line.) then it is used to calculate the -number printed, otherwise the actual line in the current source file is -printed. The message text is intended to be self explanatory (in the -grand Unix tradition). - - Error messages have the format - file_name:NNN:FATAL:Error Message Text - The file name and line number are derived as for warning messages. -The actual message text may be rather less explanatory because many of -them aren't supposed to happen. - - -File: as.info, Node: Invoking, Next: Syntax, Prev: Overview, Up: Top - -Command-Line Options -******************** - - This chapter describes command-line options available in *all* -versions of the GNU assembler; *note Machine Dependencies::., for -options specific to particular machine architectures. - - If you are invoking `as' via the GNU C compiler (version 2), you can -use the `-Wa' option to pass arguments through to the assembler. The -assembler arguments must be separated from each other (and the `-Wa') -by commas. For example: - - gcc -c -g -O -Wa,-alh,-L file.c - -emits a listing to standard output with high-level and assembly source. - - Usually you do not need to use this `-Wa' mechanism, since many -compiler command-line options are automatically passed to the assembler -by the compiler. (You can call the GNU compiler driver with the `-v' -option to see precisely what options it passes to each compilation -pass, including the assembler.) - -* Menu: - -* a:: -a[cdhlns] enable listings -* D:: -D for compatibility -* f:: -f to work faster -* I:: -I for .include search path - -* K:: -K for difference tables - -* L:: -L to retain local labels -* M:: -M or -mri to assemble in MRI compatibility mode -* MD:: -MD for dependency tracking -* o:: -o to name the object file -* R:: -R to join data and text sections -* statistics:: -statistics to see statistics about assembly -* traditional-format:: -traditional-format for compatible output -* v:: -v to announce version -* W:: -W to suppress warnings -* Z:: -Z to make object file even after errors - - -File: as.info, Node: a, Next: D, Up: Invoking - -Enable Listings: `-a[cdhlns]' -============================= - - These options enable listing output from the assembler. By itself, -`-a' requests high-level, assembly, and symbols listing. You can use -other letters to select specific options for the list: `-ah' requests a -high-level language listing, `-al' requests an output-program assembly -listing, and `-as' requests a symbol table listing. High-level -listings require that a compiler debugging option like `-g' be used, -and that assembly listings (`-al') be requested also. - - Use the `-ac' option to omit false conditionals from a listing. Any -lines which are not assembled because of a false `.if' (or `.ifdef', or -any other conditional), or a true `.if' followed by an `.else', will be -omitted from the listing. - - Use the `-ad' option to omit debugging directives from the listing. - - Once you have specified one of these options, you can further control -listing output and its appearance using the directives `.list', -`.nolist', `.psize', `.eject', `.title', and `.sbttl'. The `-an' -option turns off all forms processing. If you do not request listing -output with one of the `-a' options, the listing-control directives -have no effect. - - The letters after `-a' may be combined into one option, *e.g.*, -`-aln'. - - -File: as.info, Node: D, Next: f, Prev: a, Up: Invoking - -`-D' -==== - - This option has no effect whatsoever, but it is accepted to make it -more likely that scripts written for other assemblers also work with -`as'. - - -File: as.info, Node: f, Next: I, Prev: D, Up: Invoking - -Work Faster: `-f' -================= - - `-f' should only be used when assembling programs written by a -(trusted) compiler. `-f' stops the assembler from doing whitespace and -comment preprocessing on the input file(s) before assembling them. -*Note Preprocessing: Preprocessing. - - *Warning:* if you use `-f' when the files actually need to be - preprocessed (if they contain comments, for example), `as' does - not work correctly. - - -File: as.info, Node: I, Next: K, Prev: f, Up: Invoking - -`.include' search path: `-I' PATH -================================= - - Use this option to add a PATH to the list of directories `as' -searches for files specified in `.include' directives (*note -`.include': Include.). You may use `-I' as many times as necessary to -include a variety of paths. The current working directory is always -searched first; after that, `as' searches any `-I' directories in the -same order as they were specified (left to right) on the command line. - - -File: as.info, Node: K, Next: L, Prev: I, Up: Invoking - -Difference Tables: `-K' -======================= - - `as' sometimes alters the code emitted for directives of the form -`.word SYM1-SYM2'; *note `.word': Word.. You can use the `-K' option -if you want a warning issued when this is done. - - -File: as.info, Node: L, Next: M, Prev: K, Up: Invoking - -Include Local Labels: `-L' -========================== - - Labels beginning with `L' (upper case only) are called "local -labels". *Note Symbol Names::. Normally you do not see such labels when -debugging, because they are intended for the use of programs (like -compilers) that compose assembler programs, not for your notice. -Normally both `as' and `ld' discard such labels, so you do not normally -debug with them. - - This option tells `as' to retain those `L...' symbols in the object -file. Usually if you do this you also tell the linker `ld' to preserve -symbols whose names begin with `L'. - - By default, a local label is any label beginning with `L', but each -target is allowed to redefine the local label prefix. On the HPPA -local labels begin with `L$'. `;' for the ARM family; - - -File: as.info, Node: M, Next: MD, Prev: L, Up: Invoking - -Assemble in MRI Compatibility Mode: `-M' -======================================== - - The `-M' or `--mri' option selects MRI compatibility mode. This -changes the syntax and pseudo-op handling of `as' to make it compatible -with the `ASM68K' or the `ASM960' (depending upon the configured -target) assembler from Microtec Research. The exact nature of the MRI -syntax will not be documented here; see the MRI manuals for more -information. Note in particular that the handling of macros and macro -arguments is somewhat different. The purpose of this option is to -permit assembling existing MRI assembler code using `as'. - - The MRI compatibility is not complete. Certain operations of the -MRI assembler depend upon its object file format, and can not be -supported using other object file formats. Supporting these would -require enhancing each object file format individually. These are: - - * global symbols in common section - - The m68k MRI assembler supports common sections which are merged - by the linker. Other object file formats do not support this. - `as' handles common sections by treating them as a single common - symbol. It permits local symbols to be defined within a common - section, but it can not support global symbols, since it has no - way to describe them. - - * complex relocations - - The MRI assemblers support relocations against a negated section - address, and relocations which combine the start addresses of two - or more sections. These are not support by other object file - formats. - - * `END' pseudo-op specifying start address - - The MRI `END' pseudo-op permits the specification of a start - address. This is not supported by other object file formats. The - start address may instead be specified using the `-e' option to - the linker, or in a linker script. - - * `IDNT', `.ident' and `NAME' pseudo-ops - - The MRI `IDNT', `.ident' and `NAME' pseudo-ops assign a module - name to the output file. This is not supported by other object - file formats. - - * `ORG' pseudo-op - - The m68k MRI `ORG' pseudo-op begins an absolute section at a given - address. This differs from the usual `as' `.org' pseudo-op, which - changes the location within the current section. Absolute - sections are not supported by other object file formats. The - address of a section may be assigned within a linker script. - - There are some other features of the MRI assembler which are not -supported by `as', typically either because they are difficult or -because they seem of little consequence. Some of these may be -supported in future releases. - - * EBCDIC strings - - EBCDIC strings are not supported. - - * packed binary coded decimal - - Packed binary coded decimal is not supported. This means that the - `DC.P' and `DCB.P' pseudo-ops are not supported. - - * `FEQU' pseudo-op - - The m68k `FEQU' pseudo-op is not supported. - - * `NOOBJ' pseudo-op - - The m68k `NOOBJ' pseudo-op is not supported. - - * `OPT' branch control options - - The m68k `OPT' branch control options--`B', `BRS', `BRB', `BRL', - and `BRW'--are ignored. `as' automatically relaxes all branches, - whether forward or backward, to an appropriate size, so these - options serve no purpose. - - * `OPT' list control options - - The following m68k `OPT' list control options are ignored: `C', - `CEX', `CL', `CRE', `E', `G', `I', `M', `MEX', `MC', `MD', `X'. - - * other `OPT' options - - The following m68k `OPT' options are ignored: `NEST', `O', `OLD', - `OP', `P', `PCO', `PCR', `PCS', `R'. - - * `OPT' `D' option is default - - The m68k `OPT' `D' option is the default, unlike the MRI assembler. - `OPT NOD' may be used to turn it off. - - * `XREF' pseudo-op. - - The m68k `XREF' pseudo-op is ignored. - - * `.debug' pseudo-op - - The i960 `.debug' pseudo-op is not supported. - - * `.extended' pseudo-op - - The i960 `.extended' pseudo-op is not supported. - - * `.list' pseudo-op. - - The various options of the i960 `.list' pseudo-op are not - supported. - - * `.optimize' pseudo-op - - The i960 `.optimize' pseudo-op is not supported. - - * `.output' pseudo-op - - The i960 `.output' pseudo-op is not supported. - - * `.setreal' pseudo-op - - The i960 `.setreal' pseudo-op is not supported. - - -File: as.info, Node: MD, Next: o, Prev: M, Up: Invoking - -Dependency tracking: `--MD' -=========================== - - `as' can generate a dependency file for the file it creates. This -file consists of a single rule suitable for `make' describing the -dependencies of the main source file. - - The rule is written to the file named in its argument. - - This feature is used in the automatic updating of makefiles. - - -File: as.info, Node: o, Next: R, Prev: MD, Up: Invoking - -Name the Object File: `-o' -========================== - - There is always one object file output when you run `as'. By -default it has the name `a.out' (or `b.out', for Intel 960 targets -only). You use this option (which takes exactly one filename) to give -the object file a different name. - - Whatever the object file is called, `as' overwrites any existing -file of the same name. - - -File: as.info, Node: R, Next: statistics, Prev: o, Up: Invoking - -Join Data and Text Sections: `-R' -================================= - - `-R' tells `as' to write the object file as if all data-section data -lives in the text section. This is only done at the very last moment: -your binary data are the same, but data section parts are relocated -differently. The data section part of your object file is zero bytes -long because all its bytes are appended to the text section. (*Note -Sections and Relocation: Sections.) - - When you specify `-R' it would be possible to generate shorter -address displacements (because we do not have to cross between text and -data section). We refrain from doing this simply for compatibility with -older versions of `as'. In future, `-R' may work this way. - - When `as' is configured for COFF output, this option is only useful -if you use sections named `.text' and `.data'. - - `-R' is not supported for any of the HPPA targets. Using `-R' -generates a warning from `as'. - - -File: as.info, Node: statistics, Next: traditional-format, Prev: R, Up: Invoking - -Display Assembly Statistics: `--statistics' -=========================================== - - Use `--statistics' to display two statistics about the resources -used by `as': the maximum amount of space allocated during the assembly -(in bytes), and the total execution time taken for the assembly (in CPU -seconds). - - -File: as.info, Node: traditional-format, Next: v, Prev: statistics, Up: Invoking - -Compatible output: `--traditional-format' -========================================= - - For some targets, the output of `as' is different in some ways from -the output of some existing assembler. This switch requests `as' to -use the traditional format instead. - - For example, it disables the exception frame optimizations which -`as' normally does by default on `gcc' output. - - -File: as.info, Node: v, Next: W, Prev: traditional-format, Up: Invoking - -Announce Version: `-v' -====================== - - You can find out what version of as is running by including the -option `-v' (which you can also spell as `-version') on the command -line. - - -File: as.info, Node: W, Next: Z, Prev: v, Up: Invoking - -Suppress Warnings: `-W' -======================= - - `as' should never give a warning or error message when assembling -compiler output. But programs written by people often cause `as' to -give a warning that a particular assumption was made. All such -warnings are directed to the standard error file. If you use this -option, no warnings are issued. This option only affects the warning -messages: it does not change any particular of how `as' assembles your -file. Errors, which stop the assembly, are still reported. - - -File: as.info, Node: Z, Prev: W, Up: Invoking - -Generate Object File in Spite of Errors: `-Z' -============================================= - - After an error message, `as' normally produces no output. If for -some reason you are interested in object file output even after `as' -gives an error message on your program, use the `-Z' option. If there -are any errors, `as' continues anyways, and writes an object file after -a final warning message of the form `N errors, M warnings, generating -bad object file.' - - -File: as.info, Node: Syntax, Next: Sections, Prev: Invoking, Up: Top - -Syntax -****** - - This chapter describes the machine-independent syntax allowed in a -source file. `as' syntax is similar to what many other assemblers use; -it is inspired by the BSD 4.2 assembler, except that `as' does not -assemble Vax bit-fields. - -* Menu: - -* Preprocessing:: Preprocessing -* Whitespace:: Whitespace -* Comments:: Comments -* Symbol Intro:: Symbols -* Statements:: Statements -* Constants:: Constants - - -File: as.info, Node: Preprocessing, Next: Whitespace, Up: Syntax - -Preprocessing -============= - - The `as' internal preprocessor: - * adjusts and removes extra whitespace. It leaves one space or tab - before the keywords on a line, and turns any other whitespace on - the line into a single space. - - * removes all comments, replacing them with a single space, or an - appropriate number of newlines. - - * converts character constants into the appropriate numeric values. - - It does not do macro processing, include file handling, or anything -else you may get from your C compiler's preprocessor. You can do -include file processing with the `.include' directive (*note -`.include': Include.). You can use the GNU C compiler driver to get -other "CPP" style preprocessing, by giving the input file a `.S' -suffix. *Note Options Controlling the Kind of Output: -(gcc.info)Overall Options. - - Excess whitespace, comments, and character constants cannot be used -in the portions of the input text that are not preprocessed. - - If the first line of an input file is `#NO_APP' or if you use the -`-f' option, whitespace and comments are not removed from the input -file. Within an input file, you can ask for whitespace and comment -removal in specific portions of the by putting a line that says `#APP' -before the text that may contain whitespace or comments, and putting a -line that says `#NO_APP' after this text. This feature is mainly -intend to support `asm' statements in compilers whose output is -otherwise free of comments and whitespace. - - -File: as.info, Node: Whitespace, Next: Comments, Prev: Preprocessing, Up: Syntax - -Whitespace -========== - - "Whitespace" is one or more blanks or tabs, in any order. -Whitespace is used to separate symbols, and to make programs neater for -people to read. Unless within character constants (*note Character -Constants: Characters.), any whitespace means the same as exactly one -space. - - -File: as.info, Node: Comments, Next: Symbol Intro, Prev: Whitespace, Up: Syntax - -Comments -======== - - There are two ways of rendering comments to `as'. In both cases the -comment is equivalent to one space. - - Anything from `/*' through the next `*/' is a comment. This means -you may not nest these comments. - - /* - The only way to include a newline ('\n') in a comment - is to use this sort of comment. - */ - - /* This sort of comment does not nest. */ - - Anything from the "line comment" character to the next newline is -considered a comment and is ignored. The line comment character is `;' -for the AMD 29K family; `;' on the ARC; `;' for the H8/300 family; `!' -for the H8/500 family; `;' for the HPPA; `#' on the i960; `!' for the -Hitachi SH; `!' on the SPARC; `#' on the m32r; `|' on the 680x0; `#' on -the Vax; `!' for the Z8000; `#' on the V850; see *Note Machine -Dependencies::. - - On some machines there are two different line comment characters. -One character only begins a comment if it is the first non-whitespace -character on a line, while the other always begins a comment. - - The V850 assembler also supports a double dash as starting a comment -that extends to the end of the line. - - `--'; - - To be compatible with past assemblers, lines that begin with `#' -have a special interpretation. Following the `#' should be an absolute -expression (*note Expressions::.): the logical line number of the *next* -line. Then a string (*note Strings: Strings.) is allowed: if present -it is a new logical file name. The rest of the line, if any, should be -whitespace. - - If the first non-whitespace characters on the line are not numeric, -the line is ignored. (Just like a comment.) - - # This is an ordinary comment. - # 42-6 "new_file_name" # New logical file name - # This is logical line # 36. - This feature is deprecated, and may disappear from future versions -of `as'. - - -File: as.info, Node: Symbol Intro, Next: Statements, Prev: Comments, Up: Syntax - -Symbols -======= - - A "symbol" is one or more characters chosen from the set of all -letters (both upper and lower case), digits and the three characters -`_.$'. On most machines, you can also use `$' in symbol names; -exceptions are noted in *Note Machine Dependencies::. No symbol may -begin with a digit. Case is significant. There is no length limit: -all characters are significant. Symbols are delimited by characters -not in that set, or by the beginning of a file (since the source -program must end with a newline, the end of a file is not a possible -symbol delimiter). *Note Symbols::. - - -File: as.info, Node: Statements, Next: Constants, Prev: Symbol Intro, Up: Syntax - -Statements -========== - - A "statement" ends at a newline character (`\n') or line separator -character. (The line separator is usually `;', unless this conflicts -with the comment character; *note Machine Dependencies::..) The -newline or separator character is considered part of the preceding -statement. Newlines and separators within character constants are an -exception: they do not end statements. - - It is an error to end any statement with end-of-file: the last -character of any input file should be a newline. - - You may write a statement on more than one line if you put a -backslash (`\') immediately in front of any newlines within the -statement. When `as' reads a backslashed newline both characters are -ignored. You can even put backslashed newlines in the middle of symbol -names without changing the meaning of your source program. - - An empty statement is allowed, and may include whitespace. It is -ignored. - - A statement begins with zero or more labels, optionally followed by a -key symbol which determines what kind of statement it is. The key -symbol determines the syntax of the rest of the statement. If the -symbol begins with a dot `.' then the statement is an assembler -directive: typically valid for any computer. If the symbol begins with -a letter the statement is an assembly language "instruction": it -assembles into a machine language instruction. Different versions of -`as' for different computers recognize different instructions. In -fact, the same symbol may represent a different instruction in a -different computer's assembly language. - - A label is a symbol immediately followed by a colon (`:'). -Whitespace before a label or after a colon is permitted, but you may not -have whitespace between a label's symbol and its colon. *Note Labels::. - - For HPPA targets, labels need not be immediately followed by a -colon, but the definition of a label must begin in column zero. This -also implies that only one label may be defined on each line. - - label: .directive followed by something - another_label: # This is an empty statement. - instruction operand_1, operand_2, ... - - -File: as.info, Node: Constants, Prev: Statements, Up: Syntax - -Constants -========= - - A constant is a number, written so that its value is known by -inspection, without knowing any context. Like this: - .byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value. - .ascii "Ring the bell\7" # A string constant. - .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum. - .float 0f-314159265358979323846264338327\ - 95028841971.693993751E-40 # - pi, a flonum. - -* Menu: - -* Characters:: Character Constants -* Numbers:: Number Constants - - -File: as.info, Node: Characters, Next: Numbers, Up: Constants - -Character Constants -------------------- - - There are two kinds of character constants. A "character" stands -for one character in one byte and its value may be used in numeric -expressions. String constants (properly called string *literals*) are -potentially many bytes and their values may not be used in arithmetic -expressions. - -* Menu: - -* Strings:: Strings -* Chars:: Characters - - -File: as.info, Node: Strings, Next: Chars, Up: Characters - -Strings -....... - - A "string" is written between double-quotes. It may contain -double-quotes or null characters. The way to get special characters -into a string is to "escape" these characters: precede them with a -backslash `\' character. For example `\\' represents one backslash: -the first `\' is an escape which tells `as' to interpret the second -character literally as a backslash (which prevents `as' from -recognizing the second `\' as an escape character). The complete list -of escapes follows. - -`\b' - Mnemonic for backspace; for ASCII this is octal code 010. - -`\f' - Mnemonic for FormFeed; for ASCII this is octal code 014. - -`\n' - Mnemonic for newline; for ASCII this is octal code 012. - -`\r' - Mnemonic for carriage-Return; for ASCII this is octal code 015. - -`\t' - Mnemonic for horizontal Tab; for ASCII this is octal code 011. - -`\ DIGIT DIGIT DIGIT' - An octal character code. The numeric code is 3 octal digits. For - compatibility with other Unix systems, 8 and 9 are accepted as - digits: for example, `\008' has the value 010, and `\009' the - value 011. - -`\`x' HEX-DIGITS...' - A hex character code. All trailing hex digits are combined. - Either upper or lower case `x' works. - -`\\' - Represents one `\' character. - -`\"' - Represents one `"' character. Needed in strings to represent this - character, because an unescaped `"' would end the string. - -`\ ANYTHING-ELSE' - Any other character when escaped by `\' gives a warning, but - assembles as if the `\' was not present. The idea is that if you - used an escape sequence you clearly didn't want the literal - interpretation of the following character. However `as' has no - other interpretation, so `as' knows it is giving you the wrong - code and warns you of the fact. - - Which characters are escapable, and what those escapes represent, -varies widely among assemblers. The current set is what we think the -BSD 4.2 assembler recognizes, and is a subset of what most C compilers -recognize. If you are in doubt, do not use an escape sequence. - - -File: as.info, Node: Chars, Prev: Strings, Up: Characters - -Characters -.......... - - A single character may be written as a single quote immediately -followed by that character. The same escapes apply to characters as to -strings. So if you want to write the character backslash, you must -write `'\\' where the first `\' escapes the second `\'. As you can -see, the quote is an acute accent, not a grave accent. A newline -immediately following an acute accent is taken as a literal character -and does not count as the end of a statement. The value of a character -constant in a numeric expression is the machine's byte-wide code for -that character. `as' assumes your character code is ASCII: `'A' means -65, `'B' means 66, and so on. - - -File: as.info, Node: Numbers, Prev: Characters, Up: Constants - -Number Constants ----------------- - - `as' distinguishes three kinds of numbers according to how they are -stored in the target machine. *Integers* are numbers that would fit -into an `int' in the C language. *Bignums* are integers, but they are -stored in more than 32 bits. *Flonums* are floating point numbers, -described below. - -* Menu: - -* Integers:: Integers -* Bignums:: Bignums -* Flonums:: Flonums - - -File: as.info, Node: Integers, Next: Bignums, Up: Numbers - -Integers -........ - - A binary integer is `0b' or `0B' followed by zero or more of the -binary digits `01'. - - An octal integer is `0' followed by zero or more of the octal digits -(`01234567'). - - A decimal integer starts with a non-zero digit followed by zero or -more digits (`0123456789'). - - A hexadecimal integer is `0x' or `0X' followed by one or more -hexadecimal digits chosen from `0123456789abcdefABCDEF'. - - Integers have the usual values. To denote a negative integer, use -the prefix operator `-' discussed under expressions (*note Prefix -Operators: Prefix Ops.). - - -File: as.info, Node: Bignums, Next: Flonums, Prev: Integers, Up: Numbers - -Bignums -....... - - A "bignum" has the same syntax and semantics as an integer except -that the number (or its negative) takes more than 32 bits to represent -in binary. The distinction is made because in some places integers are -permitted while bignums are not. - - -File: as.info, Node: Flonums, Prev: Bignums, Up: Numbers - -Flonums -....... - - A "flonum" represents a floating point number. The translation is -indirect: a decimal floating point number from the text is converted by -`as' to a generic binary floating point number of more than sufficient -precision. This generic floating point number is converted to a -particular computer's floating point format (or formats) by a portion -of `as' specialized to that computer. - - A flonum is written by writing (in order) - * The digit `0'. (`0' is optional on the HPPA.) - - * A letter, to tell `as' the rest of the number is a flonum. `e' is - recommended. Case is not important. - - On the H8/300, H8/500, Hitachi SH, and AMD 29K architectures, the - letter must be one of the letters `DFPRSX' (in upper or lower - case). - - On the ARC, the letter must be one of the letters `DFRS' (in upper - or lower case). - - On the Intel 960 architecture, the letter must be one of the - letters `DFT' (in upper or lower case). - - On the HPPA architecture, the letter must be `E' (upper case only). - - * An optional sign: either `+' or `-'. - - * An optional "integer part": zero or more decimal digits. - - * An optional "fractional part": `.' followed by zero or more - decimal digits. - - * An optional exponent, consisting of: - - * An `E' or `e'. - - * Optional sign: either `+' or `-'. - - * One or more decimal digits. - - At least one of the integer part or the fractional part must be -present. The floating point number has the usual base-10 value. - - `as' does all processing using integers. Flonums are computed -independently of any floating point hardware in the computer running -`as'. - - -File: as.info, Node: Sections, Next: Symbols, Prev: Syntax, Up: Top - -Sections and Relocation -*********************** - -* Menu: - -* Secs Background:: Background -* Ld Sections:: Linker Sections -* As Sections:: Assembler Internal Sections -* Sub-Sections:: Sub-Sections -* bss:: bss Section - diff --git a/gnu/dist/gas/doc/as.info-2 b/gnu/dist/gas/doc/as.info-2 deleted file mode 100644 index 85eaeea230a8..000000000000 --- a/gnu/dist/gas/doc/as.info-2 +++ /dev/null @@ -1,1368 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Secs Background, Next: Ld Sections, Up: Sections - -Background -========== - - Roughly, a section is a range of addresses, with no gaps; all data -"in" those addresses is treated the same for some particular purpose. -For example there may be a "read only" section. - - The linker `ld' reads many object files (partial programs) and -combines their contents to form a runnable program. When `as' emits an -object file, the partial program is assumed to start at address 0. -`ld' assigns the final addresses for the partial program, so that -different partial programs do not overlap. This is actually an -oversimplification, but it suffices to explain how `as' uses sections. - - `ld' moves blocks of bytes of your program to their run-time -addresses. These blocks slide to their run-time addresses as rigid -units; their length does not change and neither does the order of bytes -within them. Such a rigid unit is called a *section*. Assigning -run-time addresses to sections is called "relocation". It includes the -task of adjusting mentions of object-file addresses so they refer to -the proper run-time addresses. For the H8/300 and H8/500, and for the -Hitachi SH, `as' pads sections if needed to ensure they end on a word -(sixteen bit) boundary. - - An object file written by `as' has at least three sections, any of -which may be empty. These are named "text", "data" and "bss" sections. - - When it generates COFF output, `as' can also generate whatever other -named sections you specify using the `.section' directive (*note -`.section': Section.). If you do not use any directives that place -output in the `.text' or `.data' sections, these sections still exist, -but are empty. - - When `as' generates SOM or ELF output for the HPPA, `as' can also -generate whatever other named sections you specify using the `.space' -and `.subspace' directives. See `HP9000 Series 800 Assembly Language -Reference Manual' (HP 92432-90001) for details on the `.space' and -`.subspace' assembler directives. - - Additionally, `as' uses different names for the standard text, data, -and bss sections when generating SOM output. Program text is placed -into the `$CODE$' section, data into `$DATA$', and BSS into `$BSS$'. - - Within the object file, the text section starts at address `0', the -data section follows, and the bss section follows the data section. - - When generating either SOM or ELF output files on the HPPA, the text -section starts at address `0', the data section at address `0x4000000', -and the bss section follows the data section. - - To let `ld' know which data changes when the sections are relocated, -and how to change that data, `as' also writes to the object file -details of the relocation needed. To perform relocation `ld' must -know, each time an address in the object file is mentioned: - * Where in the object file is the beginning of this reference to an - address? - - * How long (in bytes) is this reference? - - * Which section does the address refer to? What is the numeric - value of - (ADDRESS) - (START-ADDRESS OF SECTION)? - - * Is the reference to an address "Program-Counter relative"? - - In fact, every address `as' ever uses is expressed as - (SECTION) + (OFFSET INTO SECTION) - -Further, most expressions `as' computes have this section-relative -nature. (For some object formats, such as SOM for the HPPA, some -expressions are symbol-relative instead.) - - In this manual we use the notation {SECNAME N} to mean "offset N -into section SECNAME." - - Apart from text, data and bss sections you need to know about the -"absolute" section. When `ld' mixes partial programs, addresses in the -absolute section remain unchanged. For example, address `{absolute 0}' -is "relocated" to run-time address 0 by `ld'. Although the linker -never arranges two partial programs' data sections with overlapping -addresses after linking, *by definition* their absolute sections must -overlap. Address `{absolute 239}' in one part of a program is always -the same address when the program is running as address `{absolute -239}' in any other part of the program. - - The idea of sections is extended to the "undefined" section. Any -address whose section is unknown at assembly time is by definition -rendered {undefined U}--where U is filled in later. Since numbers are -always defined, the only way to generate an undefined address is to -mention an undefined symbol. A reference to a named common block would -be such a symbol: its value is unknown at assembly time so it has -section *undefined*. - - By analogy the word *section* is used to describe groups of sections -in the linked program. `ld' puts all partial programs' text sections -in contiguous addresses in the linked program. It is customary to -refer to the *text section* of a program, meaning all the addresses of -all partial programs' text sections. Likewise for data and bss -sections. - - Some sections are manipulated by `ld'; others are invented for use -of `as' and have no meaning except during assembly. - - -File: as.info, Node: Ld Sections, Next: As Sections, Prev: Secs Background, Up: Sections - -Linker Sections -=============== - - `ld' deals with just four kinds of sections, summarized below. - -*named sections* -*text section* -*data section* - These sections hold your program. `as' and `ld' treat them as - separate but equal sections. Anything you can say of one section - is true another. When the program is running, however, it is - customary for the text section to be unalterable. The text - section is often shared among processes: it contains instructions, - constants and the like. The data section of a running program is - usually alterable: for example, C variables would be stored in the - data section. - -*bss section* - This section contains zeroed bytes when your program begins - running. It is used to hold unitialized variables or common - storage. The length of each partial program's bss section is - important, but because it starts out containing zeroed bytes there - is no need to store explicit zero bytes in the object file. The - bss section was invented to eliminate those explicit zeros from - object files. - -*absolute section* - Address 0 of this section is always "relocated" to runtime address - 0. This is useful if you want to refer to an address that `ld' - must not change when relocating. In this sense we speak of - absolute addresses being "unrelocatable": they do not change - during relocation. - -*undefined section* - This "section" is a catch-all for address references to objects - not in the preceding sections. - - An idealized example of three relocatable sections follows. The -example uses the traditional section names `.text' and `.data'. Memory -addresses are on the horizontal axis. - - +-----+----+--+ - partial program # 1: |ttttt|dddd|00| - +-----+----+--+ - - text data bss - seg. seg. seg. - - +---+---+---+ - partial program # 2: |TTT|DDD|000| - +---+---+---+ - - +--+---+-----+--+----+---+-----+~~ - linked program: | |TTT|ttttt| |dddd|DDD|00000| - +--+---+-----+--+----+---+-----+~~ - - addresses: 0 ... - - -File: as.info, Node: As Sections, Next: Sub-Sections, Prev: Ld Sections, Up: 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 -sections for most purposes; but they can be mentioned in `as' warning -messages, so it might be helpful to have an idea of their meanings to -`as'. These sections are used to permit the value of every expression -in your assembly language program to be a section-relative address. - -ASSEMBLER-INTERNAL-LOGIC-ERROR! - An internal assembler logic error has been found. This means - there is a bug in the assembler. - -expr section - The assembler stores complex expression internally as combinations - of symbols. When it needs to represent an expression as a symbol, - it puts it in the expr section. - - -File: as.info, Node: Sub-Sections, Next: bss, Prev: As Sections, Up: Sections - -Sub-Sections -============ - - Assembled bytes conventionally fall into two sections: text and data. -You may have separate groups of data in named sections that you want to -end up near to each other in the object file, even though they are not -contiguous in the assembler source. `as' allows you to use -"subsections" for this purpose. Within each section, there can be -numbered subsections with values from 0 to 8192. Objects assembled -into the same subsection go into the object file together with other -objects in the same subsection. For example, a compiler might want to -store constants in the text section, but might not want to have them -interspersed with the program being assembled. In this case, the -compiler could issue a `.text 0' before each section of code being -output, and a `.text 1' before each group of constants being output. - - Subsections are optional. If you do not use subsections, everything -goes in subsection number zero. - - Each subsection is zero-padded up to a multiple of four bytes. -(Subsections may be padded a different amount on different flavors of -`as'.) - - Subsections appear in your object file in numeric order, lowest -numbered to highest. (All this to be compatible with other people's -assemblers.) The object file contains no representation of -subsections; `ld' and other programs that manipulate object files see -no trace of them. They just see all your text subsections as a text -section, and all your data subsections as a data section. - - To specify which subsection you want subsequent statements assembled -into, use a numeric argument to specify it, in a `.text EXPRESSION' or -a `.data EXPRESSION' statement. When generating COFF output, you can -also use an extra subsection argument with arbitrary named sections: -`.section NAME, EXPRESSION'. EXPRESSION should be an absolute -expression. (*Note Expressions::.) If you just say `.text' then -`.text 0' is assumed. Likewise `.data' means `.data 0'. Assembly -begins in `text 0'. For instance: - .text 0 # The default subsection is text 0 anyway. - .ascii "This lives in the first text subsection. *" - .text 1 - .ascii "But this lives in the second text subsection." - .data 0 - .ascii "This lives in the data section," - .ascii "in the first data subsection." - .text 0 - .ascii "This lives in the first text section," - .ascii "immediately following the asterisk (*)." - - Each section has a "location counter" incremented by one for every -byte assembled into that section. Because subsections are merely a -convenience restricted to `as' there is no concept of a subsection -location counter. There is no way to directly manipulate a location -counter--but the `.align' directive changes it, and any label -definition captures its current value. The location counter of the -section where statements are being assembled is said to be the "active" -location counter. - - -File: as.info, Node: bss, Prev: Sub-Sections, Up: Sections - -bss Section -=========== - - The bss section is used for local common variable storage. You may -allocate address space in the bss section, but you may not dictate data -to load into it before your program executes. When your program starts -running, all the contents of the bss section are zeroed bytes. - - The `.lcomm' pseudo-op defines a symbol in the bss section; see -*Note `.lcomm': Lcomm. - - The `.comm' pseudo-op may be used to declare a common symbol, which -is another form of uninitialized symbol; see *Note `.comm': Comm. - - When assembling for a target which supports multiple sections, such -as ELF or COFF, you may switch into the `.bss' section and define -symbols as usual; see *Note `.section': Section. You may only assemble -zero values into the section. Typically the section will only contain -symbol definitions and `.skip' directives (*note `.skip': Skip.). - - -File: as.info, Node: Symbols, Next: Expressions, Prev: Sections, Up: Top - -Symbols -******* - - Symbols are a central concept: the programmer uses symbols to name -things, the linker uses symbols to link, and the debugger uses symbols -to debug. - - *Warning:* `as' does not place symbols in the object file in the - same order they were declared. This may break some debuggers. - -* Menu: - -* Labels:: Labels -* Setting Symbols:: Giving Symbols Other Values -* Symbol Names:: Symbol Names -* Dot:: The Special Dot Symbol -* Symbol Attributes:: Symbol Attributes - - -File: as.info, Node: Labels, Next: Setting Symbols, Up: Symbols - -Labels -====== - - A "label" is written as a symbol immediately followed by a colon -`:'. The symbol then represents the current value of the active -location counter, and is, for example, a suitable instruction operand. -You are warned if you use the same symbol to represent two different -locations: the first definition overrides any other definitions. - - On the HPPA, the usual form for a label need not be immediately -followed by a colon, but instead must start in column zero. Only one -label may be defined on a single line. To work around this, the HPPA -version of `as' also provides a special directive `.label' for defining -labels more flexibly. - - -File: as.info, Node: Setting Symbols, Next: Symbol Names, Prev: Labels, Up: Symbols - -Giving Symbols Other Values -=========================== - - A symbol can be given an arbitrary value by writing a symbol, -followed by an equals sign `=', followed by an expression (*note -Expressions::.). This is equivalent to using the `.set' directive. -*Note `.set': Set. - - -File: as.info, Node: Symbol Names, Next: Dot, Prev: Setting Symbols, Up: Symbols - -Symbol Names -============ - - Symbol names begin with a letter or with one of `._'. On most -machines, you can also use `$' in symbol names; exceptions are noted in -*Note Machine Dependencies::. That character may be followed by any -string of digits, letters, dollar signs (unless otherwise noted in -*Note Machine Dependencies::), and underscores. For the AMD 29K -family, `?' is also allowed in the body of a symbol name, though not at -its beginning. - - Case of letters is significant: `foo' is a different symbol name -than `Foo'. - - Each symbol has exactly one name. Each name in an assembly language -program refers to exactly one symbol. You may use that symbol name any -number of times in a program. - -Local Symbol Names ------------------- - - Local symbols help compilers and programmers use names temporarily. -There are ten local symbol names, which are re-used throughout the -program. You may refer to them using the names `0' `1' ... `9'. To -define a local symbol, write a label of the form `N:' (where N -represents any digit). To refer to the most recent previous definition -of that symbol write `Nb', using the same digit as when you defined the -label. To refer to the next definition of a local label, write -`Nf'--where N gives you a choice of 10 forward references. The `b' -stands for "backwards" and the `f' stands for "forwards". - - Local symbols are not emitted by the current GNU C compiler. - - There is no restriction on how you can use these labels, but -remember that at any point in the assembly you can refer to at most 10 -prior local labels and to at most 10 forward local labels. - - Local symbol names are only a notation device. They are immediately -transformed into more conventional symbol names before the assembler -uses them. The symbol names stored in the symbol table, appearing in -error messages and optionally emitted to the object file have these -parts: - -`L' - All local labels begin with `L'. Normally both `as' and `ld' - forget symbols that start with `L'. These labels are used for - symbols you are never intended to see. If you use the `-L' option - then `as' retains these symbols in the object file. If you also - instruct `ld' to retain these symbols, you may use them in - debugging. - -`DIGIT' - If the label is written `0:' then the digit is `0'. If the label - is written `1:' then the digit is `1'. And so on up through `9:'. - -`C-A' - This unusual character is included so you do not accidentally - invent a symbol of the same name. The character has ASCII value - `\001'. - -`*ordinal number*' - This is a serial number to keep the labels distinct. The first - `0:' gets the number `1'; The 15th `0:' gets the number `15'; - *etc.*. Likewise for the other labels `1:' through `9:'. - - For instance, the first `1:' is named `L1C-A1', the 44th `3:' is -named `L3C-A44'. - - -File: as.info, Node: Dot, Next: Symbol Attributes, Prev: Symbol Names, Up: Symbols - -The Special Dot Symbol -====================== - - The special symbol `.' refers to the current address that `as' is -assembling into. Thus, the expression `melvin: .long .' defines -`melvin' to contain its own address. Assigning a value to `.' is -treated the same as a `.org' directive. Thus, the expression `.=.+4' -is the same as saying `.space 4'. - - -File: as.info, Node: Symbol Attributes, Prev: Dot, Up: Symbols - -Symbol Attributes -================= - - Every symbol has, as well as its name, the attributes "Value" and -"Type". Depending on output format, symbols can also have auxiliary -attributes. - - If you use a symbol without defining it, `as' assumes zero for all -these attributes, and probably won't warn you. This makes the symbol -an externally defined symbol, which is generally what you would want. - -* Menu: - -* Symbol Value:: Value -* Symbol Type:: Type - - -* a.out Symbols:: Symbol Attributes: `a.out' - -* COFF Symbols:: Symbol Attributes for COFF - -* SOM Symbols:: Symbol Attributes for SOM - - -File: as.info, Node: Symbol Value, Next: Symbol Type, Up: Symbol Attributes - -Value ------ - - The value of a symbol is (usually) 32 bits. For a symbol which -labels a location in the text, data, bss or absolute sections the value -is the number of addresses from the start of that section to the label. -Naturally for text, data and bss sections the value of a symbol changes -as `ld' changes section base addresses during linking. Absolute -symbols' values do not change during linking: that is why they are -called absolute. - - The value of an undefined symbol is treated in a special way. If it -is 0 then the symbol is not defined in this assembler source file, and -`ld' tries to determine its value from other files linked into the same -program. You make this kind of symbol simply by mentioning a symbol -name without defining it. A non-zero value represents a `.comm' common -declaration. The value is how much common storage to reserve, in bytes -(addresses). The symbol refers to the first address of the allocated -storage. - - -File: as.info, Node: Symbol Type, Next: a.out Symbols, Prev: Symbol Value, Up: Symbol Attributes - -Type ----- - - The type attribute of a symbol contains relocation (section) -information, any flag settings indicating that a symbol is external, and -(optionally), other information for linkers and debuggers. The exact -format depends on the object-code output format in use. - - -File: as.info, Node: a.out Symbols, Next: COFF Symbols, Prev: Symbol Type, Up: Symbol Attributes - -Symbol Attributes: `a.out' --------------------------- - -* Menu: - -* Symbol Desc:: Descriptor -* Symbol Other:: Other - - -File: as.info, Node: Symbol Desc, Next: Symbol Other, Up: a.out Symbols - -Descriptor -.......... - - This is an arbitrary 16-bit value. You may establish a symbol's -descriptor value by using a `.desc' statement (*note `.desc': Desc.). -A descriptor value means nothing to `as'. - - -File: as.info, Node: Symbol Other, Prev: Symbol Desc, Up: a.out Symbols - -Other -..... - - This is an arbitrary 8-bit value. It means nothing to `as'. - - -File: as.info, Node: COFF Symbols, Next: SOM Symbols, Prev: a.out Symbols, Up: Symbol Attributes - -Symbol Attributes for COFF --------------------------- - - The COFF format supports a multitude of auxiliary symbol attributes; -like the primary symbol attributes, they are set between `.def' and -`.endef' directives. - -Primary Attributes -.................. - - The symbol name is set with `.def'; the value and type, -respectively, with `.val' and `.type'. - -Auxiliary Attributes -.................... - - The `as' directives `.dim', `.line', `.scl', `.size', and `.tag' can -generate auxiliary symbol table information for COFF. - - -File: as.info, Node: SOM Symbols, Prev: COFF Symbols, Up: Symbol Attributes - -Symbol Attributes for SOM -------------------------- - - The SOM format for the HPPA supports a multitude of symbol -attributes set with the `.EXPORT' and `.IMPORT' directives. - - The attributes are described in `HP9000 Series 800 Assembly Language -Reference Manual' (HP 92432-90001) under the `IMPORT' and `EXPORT' -assembler directive documentation. - - -File: as.info, Node: Expressions, Next: Pseudo Ops, Prev: Symbols, Up: Top - -Expressions -*********** - - An "expression" specifies an address or numeric value. Whitespace -may precede and/or follow an expression. - - The result of an expression must be an absolute number, or else an -offset into a particular section. If an expression is not absolute, -and there is not enough information when `as' sees the expression to -know its section, a second pass over the source program might be -necessary to interpret the expression--but the second pass is currently -not implemented. `as' aborts with an error message in this situation. - -* Menu: - -* Empty Exprs:: Empty Expressions -* Integer Exprs:: Integer Expressions - - -File: as.info, Node: Empty Exprs, Next: Integer Exprs, Up: Expressions - -Empty Expressions -================= - - An empty expression has no value: it is just whitespace or null. -Wherever an absolute expression is required, you may omit the -expression, and `as' assumes a value of (absolute) 0. This is -compatible with other assemblers. - - -File: as.info, Node: Integer Exprs, Prev: Empty Exprs, Up: Expressions - -Integer Expressions -=================== - - An "integer expression" is one or more *arguments* delimited by -*operators*. - -* Menu: - -* Arguments:: Arguments -* Operators:: Operators -* Prefix Ops:: Prefix Operators -* Infix Ops:: Infix Operators - - -File: as.info, Node: Arguments, Next: Operators, Up: Integer Exprs - -Arguments ---------- - - "Arguments" are symbols, numbers or subexpressions. In other -contexts arguments are sometimes called "arithmetic operands". In this -manual, to avoid confusing them with the "instruction operands" of the -machine language, we use the term "argument" to refer to parts of -expressions only, reserving the word "operand" to refer only to machine -instruction operands. - - Symbols are evaluated to yield {SECTION NNN} where SECTION is one of -text, data, bss, absolute, or undefined. NNN is a signed, 2's -complement 32 bit integer. - - Numbers are usually integers. - - A number can be a flonum or bignum. In this case, you are warned -that only the low order 32 bits are used, and `as' pretends these 32 -bits are an integer. You may write integer-manipulating instructions -that act on exotic constants, compatible with other assemblers. - - Subexpressions are a left parenthesis `(' followed by an integer -expression, followed by a right parenthesis `)'; or a prefix operator -followed by an argument. - - -File: as.info, Node: Operators, Next: Prefix Ops, Prev: Arguments, Up: Integer Exprs - -Operators ---------- - - "Operators" are arithmetic functions, like `+' or `%'. Prefix -operators are followed by an argument. Infix operators appear between -their arguments. Operators may be preceded and/or followed by -whitespace. - - -File: as.info, Node: Prefix Ops, Next: Infix Ops, Prev: Operators, Up: Integer Exprs - -Prefix Operator ---------------- - - `as' has the following "prefix operators". They each take one -argument, which must be absolute. - -`-' - "Negation". Two's complement negation. - -`~' - "Complementation". Bitwise not. - - -File: as.info, Node: Infix Ops, Prev: Prefix Ops, Up: Integer Exprs - -Infix Operators ---------------- - - "Infix operators" take two arguments, one on either side. Operators -have precedence, but operations with equal precedence are performed left -to right. Apart from `+' or `-', both arguments must be absolute, and -the result is absolute. - - 1. Highest Precedence - - `*' - "Multiplication". - - `/' - "Division". Truncation is the same as the C operator `/' - - `%' - "Remainder". - - `<' - `<<' - "Shift Left". Same as the C operator `<<'. - - `>' - `>>' - "Shift Right". Same as the C operator `>>'. - - 2. Intermediate precedence - - `|' - "Bitwise Inclusive Or". - - `&' - "Bitwise And". - - `^' - "Bitwise Exclusive Or". - - `!' - "Bitwise Or Not". - - 3. Lowest Precedence - - `+' - "Addition". If either argument is absolute, the result has - the section of the other argument. You may not add together - arguments from different sections. - - `-' - "Subtraction". If the right argument is absolute, the result - has the section of the left argument. If both arguments are - in the same section, the result is absolute. You may not - subtract arguments from different sections. - - In short, it's only meaningful to add or subtract the *offsets* in an -address; you can only have a defined section in one of the two -arguments. - - -File: as.info, Node: Pseudo Ops, Next: Machine Dependencies, Prev: Expressions, Up: Top - -Assembler Directives -******************** - - All assembler directives have names that begin with a period (`.'). -The rest of the name is letters, usually in lower case. - - This chapter discusses directives that are available regardless of -the target machine configuration for the GNU assembler. Some machine -configurations provide additional directives. *Note Machine -Dependencies::. - -* Menu: - -* Abort:: `.abort' - -* ABORT:: `.ABORT' - -* Align:: `.align ABS-EXPR , ABS-EXPR' -* App-File:: `.app-file STRING' -* Ascii:: `.ascii "STRING"'... -* Asciz:: `.asciz "STRING"'... -* Balign:: `.balign ABS-EXPR , ABS-EXPR' -* Byte:: `.byte EXPRESSIONS' -* Comm:: `.comm SYMBOL , LENGTH ' -* Data:: `.data SUBSECTION' - -* Def:: `.def NAME' - -* Desc:: `.desc SYMBOL, ABS-EXPRESSION' - -* Dim:: `.dim' - -* Double:: `.double FLONUMS' -* Eject:: `.eject' -* Else:: `.else' - -* Endef:: `.endef' - -* Endif:: `.endif' -* Equ:: `.equ SYMBOL, EXPRESSION' -* Equiv:: `.equiv SYMBOL, EXPRESSION' -* Err:: `.err' -* Extern:: `.extern' - -* File:: `.file STRING' - -* Fill:: `.fill REPEAT , SIZE , VALUE' -* Float:: `.float FLONUMS' -* Global:: `.global SYMBOL', `.globl SYMBOL' -* hword:: `.hword EXPRESSIONS' -* Ident:: `.ident' -* If:: `.if ABSOLUTE EXPRESSION' -* Include:: `.include "FILE"' -* Int:: `.int EXPRESSIONS' -* Irp:: `.irp SYMBOL,VALUES'... -* Irpc:: `.irpc SYMBOL,VALUES'... -* Lcomm:: `.lcomm SYMBOL , LENGTH' -* Lflags:: `.lflags' - -* Line:: `.line LINE-NUMBER' - -* Ln:: `.ln LINE-NUMBER' -* Linkonce:: `.linkonce [TYPE]' -* List:: `.list' -* Long:: `.long EXPRESSIONS' - -* Macro:: `.macro NAME ARGS'... -* MRI:: `.mri VAL' - -* Nolist:: `.nolist' -* Octa:: `.octa BIGNUMS' -* Org:: `.org NEW-LC , FILL' -* P2align:: `.p2align ABS-EXPR , ABS-EXPR' -* Psize:: `.psize LINES, COLUMNS' -* Quad:: `.quad BIGNUMS' -* Rept:: `.rept COUNT' -* Sbttl:: `.sbttl "SUBHEADING"' - -* Scl:: `.scl CLASS' -* Section:: `.section NAME, SUBSECTION' - -* Set:: `.set SYMBOL, EXPRESSION' -* Short:: `.short EXPRESSIONS' -* Single:: `.single FLONUMS' - -* Size:: `.size' - -* Skip:: `.skip SIZE , FILL' -* Sleb128:: `.sleb128 EXPRESSIONS' -* Space:: `.space SIZE , FILL' - -* Stab:: `.stabd, .stabn, .stabs' - -* String:: `.string "STR"' - -* Symver:: `.symver NAME,NAME2@NODENAME' - -* Tag:: `.tag STRUCTNAME' - -* Text:: `.text SUBSECTION' -* Title:: `.title "HEADING"' - -* Type:: `.type INT' -* Val:: `.val ADDR' - -* Uleb128:: `.uleb128 EXPRESSIONS' -* Word:: `.word EXPRESSIONS' -* Deprecated:: Deprecated Directives - - -File: as.info, Node: Abort, Next: ABORT, Up: Pseudo Ops - -`.abort' -======== - - This directive stops the assembly immediately. It is for -compatibility with other assemblers. The original idea was that the -assembly language source would be piped into the assembler. If the -sender of the source quit, it could use this directive tells `as' to -quit also. One day `.abort' will not be supported. - - -File: as.info, Node: ABORT, Next: Align, Prev: Abort, Up: Pseudo Ops - -`.ABORT' -======== - - When producing COFF output, `as' accepts this directive as a synonym -for `.abort'. - - When producing `b.out' output, `as' accepts this directive, but -ignores it. - - -File: as.info, Node: Align, Next: App-File, Prev: ABORT, Up: Pseudo Ops - -`.align ABS-EXPR, ABS-EXPR, ABS-EXPR' -===================================== - - Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -alignment required, as described below. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The way the required alignment is specified varies from system to -system. For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, -and i386 using ELF format, the first expression is the alignment -request in bytes. For example `.align 8' advances the location counter -until it is a multiple of 8. If the location counter is already a -multiple of 8, no change is needed. - - For other systems, including the i386 using a.out format, it is the -number of low-order zero bits the location counter must have after -advancement. For example `.align 3' advances the location counter -until it a multiple of 8. If the location counter is already a -multiple of 8, no change is needed. - - This inconsistency is due to the different behaviors of the various -native assemblers for these systems which GAS must emulate. GAS also -provides `.balign' and `.p2align' directives, described later, which -have a consistent behavior across all architectures (but are specific -to GAS). - - -File: as.info, Node: App-File, Next: Ascii, Prev: Align, Up: Pseudo Ops - -`.app-file STRING' -================== - - `.app-file' (which may also be spelled `.file') tells `as' that we -are about to start a new logical file. STRING is the new file name. -In general, the filename is recognized whether or not it is surrounded -by quotes `"'; but if you wish to specify an empty file name is -permitted, you must give the quotes-`""'. This statement may go away in -future: it is only recognized to be compatible with old `as' programs. - - -File: as.info, Node: Ascii, Next: Asciz, Prev: App-File, Up: Pseudo Ops - -`.ascii "STRING"'... -==================== - - `.ascii' expects zero or more string literals (*note Strings::.) -separated by commas. It assembles each string (with no automatic -trailing zero byte) into consecutive addresses. - - -File: as.info, Node: Asciz, Next: Balign, Prev: Ascii, Up: Pseudo Ops - -`.asciz "STRING"'... -==================== - - `.asciz' is just like `.ascii', but each string is followed by a -zero byte. The "z" in `.asciz' stands for "zero". - - -File: as.info, Node: Balign, Next: Byte, Prev: Asciz, Up: Pseudo Ops - -`.balign[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR' -========================================== - - Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -alignment request in bytes. For example `.balign 8' advances the -location counter until it is a multiple of 8. If the location counter -is already a multiple of 8, no change is needed. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The `.balignw' and `.balignl' directives are variants of the -`.balign' directive. The `.balignw' directive treats the fill pattern -as a two byte word value. The `.balignl' directives treats the fill -pattern as a four byte longword value. For example, `.balignw -4,0x368d' will align to a multiple of 4. If it skips two bytes, they -will be filled in with the value 0x368d (the exact placement of the -bytes depends upon the endianness of the processor). If it skips 1 or -3 bytes, the fill value is undefined. - - -File: as.info, Node: Byte, Next: Comm, Prev: Balign, Up: Pseudo Ops - -`.byte EXPRESSIONS' -=================== - - `.byte' expects zero or more expressions, separated by commas. Each -expression is assembled into the next byte. - - -File: as.info, Node: Comm, Next: Data, Prev: Byte, Up: Pseudo Ops - -`.comm SYMBOL , LENGTH ' -======================== - - `.comm' declares a common symbol named SYMBOL. When linking, a -common symbol in one object file may be merged with a defined or common -symbol of the same name in another object file. If `ld' does not see a -definition for the symbol-just one or more common symbols-then it will -allocate LENGTH bytes of uninitialized memory. LENGTH must be an -absolute expression. If `ld' sees multiple common symbols with the -same name, and they do not all have the same size, it will allocate -space using the largest size. - - When using ELF, the `.comm' directive takes an optional third -argument. This is the desired alignment of the symbol, specified as a -byte boundary (for example, an alignment of 16 means that the least -significant 4 bits of the address should be zero). The alignment must -be an absolute expression, and it must be a power of two. If `ld' -allocates uninitialized memory for the common symbol, it will use the -alignment when placing the symbol. If no alignment is specified, `as' -will set the alignment to the largest power of two less than or equal -to the size of the symbol, up to a maximum of 16. - - The syntax for `.comm' differs slightly on the HPPA. The syntax is -`SYMBOL .comm, LENGTH'; SYMBOL is optional. - - -File: as.info, Node: Data, Next: Def, Prev: Comm, Up: Pseudo Ops - -`.data SUBSECTION' -================== - - `.data' tells `as' to assemble the following statements onto the end -of the data subsection numbered SUBSECTION (which is an absolute -expression). If SUBSECTION is omitted, it defaults to zero. - - -File: as.info, Node: Def, Next: Desc, Prev: Data, Up: Pseudo Ops - -`.def NAME' -=========== - - Begin defining debugging information for a symbol NAME; the -definition extends until the `.endef' directive is encountered. - - This directive is only observed when `as' is configured for COFF -format output; when producing `b.out', `.def' is recognized, but -ignored. - - -File: as.info, Node: Desc, Next: Dim, Prev: Def, Up: Pseudo Ops - -`.desc SYMBOL, ABS-EXPRESSION' -============================== - - This directive sets the descriptor of the symbol (*note Symbol -Attributes::.) to the low 16 bits of an absolute expression. - - The `.desc' directive is not available when `as' is configured for -COFF output; it is only for `a.out' or `b.out' object format. For the -sake of compatibility, `as' accepts it, but produces no output, when -configured for COFF. - - -File: as.info, Node: Dim, Next: Double, Prev: Desc, Up: Pseudo Ops - -`.dim' -====== - - This directive is generated by compilers to include auxiliary -debugging information in the symbol table. It is only permitted inside -`.def'/`.endef' pairs. - - `.dim' is only meaningful when generating COFF format output; when -`as' is generating `b.out', it accepts this directive but ignores it. - - -File: as.info, Node: Double, Next: Eject, Prev: Dim, Up: Pseudo Ops - -`.double FLONUMS' -================= - - `.double' expects zero or more flonums, separated by commas. It -assembles floating point numbers. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Eject, Next: Else, Prev: Double, Up: Pseudo Ops - -`.eject' -======== - - Force a page break at this point, when generating assembly listings. - - -File: as.info, Node: Else, Next: Endef, Prev: Eject, Up: Pseudo Ops - -`.else' -======= - - `.else' is part of the `as' support for conditional assembly; *note -`.if': If.. It marks the beginning of a section of code to be -assembled if the condition for the preceding `.if' was false. - - -File: as.info, Node: Endef, Next: Endif, Prev: Else, Up: Pseudo Ops - -`.endef' -======== - - This directive flags the end of a symbol definition begun with -`.def'. - - `.endef' is only meaningful when generating COFF format output; if -`as' is configured to generate `b.out', it accepts this directive but -ignores it. - - -File: as.info, Node: Endif, Next: Equ, Prev: Endef, Up: Pseudo Ops - -`.endif' -======== - - `.endif' is part of the `as' support for conditional assembly; it -marks the end of a block of code that is only assembled conditionally. -*Note `.if': If. - - -File: as.info, Node: Equ, Next: Equiv, Prev: Endif, Up: Pseudo Ops - -`.equ SYMBOL, EXPRESSION' -========================= - - This directive sets the value of SYMBOL to EXPRESSION. It is -synonymous with `.set'; *note `.set': Set.. - - The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'. - - -File: as.info, Node: Equiv, Next: Err, Prev: Equ, Up: Pseudo Ops - -`.equiv SYMBOL, EXPRESSION' -=========================== - - The `.equiv' directive is like `.equ' and `.set', except that the -assembler will signal an error if SYMBOL is already defined. - - Except for the contents of the error message, this is roughly -equivalent to - .ifdef SYM - .err - .endif - .equ SYM,VAL - - -File: as.info, Node: Err, Next: Extern, Prev: Equiv, Up: Pseudo Ops - -`.err' -====== - - If `as' assembles a `.err' directive, it will print an error message -and, unless the `-Z' option was used, it will not generate an object -file. This can be used to signal error an conditionally compiled code. - - -File: as.info, Node: Extern, Next: File, Prev: Err, Up: Pseudo Ops - -`.extern' -========= - - `.extern' is accepted in the source program--for compatibility with -other assemblers--but it is ignored. `as' treats all undefined symbols -as external. - - -File: as.info, Node: File, Next: Fill, Prev: Extern, Up: Pseudo Ops - -`.file STRING' -============== - - `.file' (which may also be spelled `.app-file') tells `as' that we -are about to start a new logical file. STRING is the new file name. -In general, the filename is recognized whether or not it is surrounded -by quotes `"'; but if you wish to specify an empty file name, you must -give the quotes-`""'. This statement may go away in future: it is only -recognized to be compatible with old `as' programs. In some -configurations of `as', `.file' has already been removed to avoid -conflicts with other assemblers. *Note Machine Dependencies::. - - -File: as.info, Node: Fill, Next: Float, Prev: File, Up: Pseudo Ops - -`.fill REPEAT , SIZE , VALUE' -============================= - - RESULT, SIZE and VALUE are absolute expressions. This emits REPEAT -copies of SIZE bytes. REPEAT may be zero or more. SIZE may be zero or -more, but if it is more than 8, then it is deemed to have the value 8, -compatible with other people's assemblers. The contents of each REPEAT -bytes is taken from an 8-byte number. The highest order 4 bytes are -zero. The lowest order 4 bytes are VALUE rendered in the byte-order of -an integer on the computer `as' is assembling for. Each SIZE bytes in -a repetition is taken from the lowest order SIZE bytes of this number. -Again, this bizarre behavior is compatible with other people's -assemblers. - - SIZE and VALUE are optional. If the second comma and VALUE are -absent, VALUE is assumed zero. If the first comma and following tokens -are absent, SIZE is assumed to be 1. - - -File: as.info, Node: Float, Next: Global, Prev: Fill, Up: Pseudo Ops - -`.float FLONUMS' -================ - - This directive assembles zero or more flonums, separated by commas. -It has the same effect as `.single'. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Global, Next: hword, Prev: Float, Up: Pseudo Ops - -`.global SYMBOL', `.globl SYMBOL' -================================= - - `.global' makes the symbol visible to `ld'. If you define SYMBOL in -your partial program, its value is made available to other partial -programs that are linked with it. Otherwise, SYMBOL takes its -attributes from a symbol of the same name from another file linked into -the same program. - - Both spellings (`.globl' and `.global') are accepted, for -compatibility with other assemblers. - - On the HPPA, `.global' is not always enough to make it accessible to -other partial programs. You may need the HPPA-only `.EXPORT' directive -as well. *Note HPPA Assembler Directives: HPPA Directives. - - -File: as.info, Node: hword, Next: Ident, Prev: Global, Up: Pseudo Ops - -`.hword EXPRESSIONS' -==================== - - This expects zero or more EXPRESSIONS, and emits a 16 bit number for -each. - - This directive is a synonym for `.short'; depending on the target -architecture, it may also be a synonym for `.word'. - - -File: as.info, Node: Ident, Next: If, Prev: hword, Up: Pseudo Ops - -`.ident' -======== - - This directive is used by some assemblers to place tags in object -files. `as' simply accepts the directive for source-file compatibility -with such assemblers, but does not actually emit anything for it. - - -File: as.info, Node: If, Next: Include, Prev: Ident, Up: Pseudo Ops - -`.if ABSOLUTE EXPRESSION' -========================= - - `.if' marks the beginning of a section of code which is only -considered part of the source program being assembled if the argument -(which must be an ABSOLUTE EXPRESSION) is non-zero. The end of the -conditional section of code must be marked by `.endif' (*note `.endif': -Endif.); optionally, you may include code for the alternative -condition, flagged by `.else' (*note `.else': Else.). - - The following variants of `.if' are also supported: -`.ifdef SYMBOL' - Assembles the following section of code if the specified SYMBOL - has been defined. - -`.ifndef SYMBOL' -`.ifnotdef SYMBOL' - Assembles the following section of code if the specified SYMBOL - has not been defined. Both spelling variants are equivalent. - - -File: as.info, Node: Include, Next: Int, Prev: If, Up: Pseudo Ops - -`.include "FILE"' -================= - - This directive provides a way to include supporting files at -specified points in your source program. The code from FILE is -assembled as if it followed the point of the `.include'; when the end -of the included file is reached, assembly of the original file -continues. You can control the search paths used with the `-I' -command-line option (*note Command-Line Options: Invoking.). Quotation -marks are required around FILE. - - -File: as.info, Node: Int, Next: Irp, Prev: Include, Up: Pseudo Ops - -`.int EXPRESSIONS' -================== - - Expect zero or more EXPRESSIONS, of any section, separated by commas. -For each expression, emit a number that, at run time, is the value of -that expression. The byte order and bit size of the number depends on -what kind of target the assembly is for. - - -File: as.info, Node: Irp, Next: Irpc, Prev: Int, Up: Pseudo Ops - -`.irp SYMBOL,VALUES'... -======================= - - Evaluate a sequence of statements assigning different values to -SYMBOL. The sequence of statements starts at the `.irp' directive, and -is terminated by an `.endr' directive. For each VALUE, SYMBOL is set -to VALUE, and the sequence of statements is assembled. If no VALUE is -listed, the sequence of statements is assembled once, with SYMBOL set -to the null string. To refer to SYMBOL within the sequence of -statements, use \SYMBOL. - - For example, assembling - - .irp param,1,2,3 - move d\param,sp@- - .endr - - is equivalent to assembling - - move d1,sp@- - move d2,sp@- - move d3,sp@- - - -File: as.info, Node: Irpc, Next: Lcomm, Prev: Irp, Up: Pseudo Ops - -`.irpc SYMBOL,VALUES'... -======================== - - Evaluate a sequence of statements assigning different values to -SYMBOL. The sequence of statements starts at the `.irpc' directive, -and is terminated by an `.endr' directive. For each character in VALUE, -SYMBOL is set to the character, and the sequence of statements is -assembled. If no VALUE is listed, the sequence of statements is -assembled once, with SYMBOL set to the null string. To refer to SYMBOL -within the sequence of statements, use \SYMBOL. - - For example, assembling - - .irpc param,123 - move d\param,sp@- - .endr - - is equivalent to assembling - - move d1,sp@- - move d2,sp@- - move d3,sp@- - - -File: as.info, Node: Lcomm, Next: Lflags, Prev: Irpc, Up: Pseudo Ops - -`.lcomm SYMBOL , LENGTH' -======================== - - Reserve LENGTH (an absolute expression) bytes for a local common -denoted by SYMBOL. The section and value of SYMBOL are those of the -new local common. The addresses are allocated in the bss section, so -that at run-time the bytes start off zeroed. SYMBOL is not declared -global (*note `.global': Global.), so is normally not visible to `ld'. - - Some targets permit a third argument to be used with `.lcomm'. This -argument specifies the desired alignment of the symbol in the bss -section. - - The syntax for `.lcomm' differs slightly on the HPPA. The syntax is -`SYMBOL .lcomm, LENGTH'; SYMBOL is optional. - - -File: as.info, Node: Lflags, Next: Line, Prev: Lcomm, Up: Pseudo Ops - -`.lflags' -========= - - `as' accepts this directive, for compatibility with other -assemblers, but ignores it. - diff --git a/gnu/dist/gas/doc/as.info-3 b/gnu/dist/gas/doc/as.info-3 deleted file mode 100644 index 85a4889ccdb8..000000000000 --- a/gnu/dist/gas/doc/as.info-3 +++ /dev/null @@ -1,1589 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Line, Next: Ln, Prev: Lflags, Up: Pseudo Ops - -`.line LINE-NUMBER' -=================== - - Change the logical line number. LINE-NUMBER must be an absolute -expression. The next line has that logical line number. Therefore any -other statements on the current line (after a statement separator -character) are reported as on logical line number LINE-NUMBER - 1. One -day `as' will no longer support this directive: it is recognized only -for compatibility with existing assembler programs. - - *Warning:* In the AMD29K configuration of as, this command is not -available; use the synonym `.ln' in that context. - - Even though this is a directive associated with the `a.out' or -`b.out' object-code formats, `as' still recognizes it when producing -COFF output, and treats `.line' as though it were the COFF `.ln' *if* -it is found outside a `.def'/`.endef' pair. - - Inside a `.def', `.line' is, instead, one of the directives used by -compilers to generate auxiliary symbol information for debugging. - - -File: as.info, Node: Linkonce, Next: List, Prev: Ln, Up: Pseudo Ops - -`.linkonce [TYPE]' -================== - - Mark the current section so that the linker only includes a single -copy of it. This may be used to include the same section in several -different object files, but ensure that the linker will only include it -once in the final output file. The `.linkonce' pseudo-op must be used -for each instance of the section. Duplicate sections are detected -based on the section name, so it should be unique. - - This directive is only supported by a few object file formats; as of -this writing, the only object file format which supports it is the -Portable Executable format used on Windows NT. - - The TYPE argument is optional. If specified, it must be one of the -following strings. For example: - .linkonce same_size - Not all types may be supported on all object file formats. - -`discard' - Silently discard duplicate sections. This is the default. - -`one_only' - Warn if there are duplicate sections, but still keep only one copy. - -`same_size' - Warn if any of the duplicates have different sizes. - -`same_contents' - Warn if any of the duplicates do not have exactly the same - contents. - - -File: as.info, Node: Ln, Next: Linkonce, Prev: Line, Up: Pseudo Ops - -`.ln LINE-NUMBER' -================= - - `.ln' is a synonym for `.line'. - - -File: as.info, Node: MRI, Next: Nolist, Prev: Macro, Up: Pseudo Ops - -`.mri VAL' -========== - - If VAL is non-zero, this tells `as' to enter MRI mode. If VAL is -zero, this tells `as' to exit MRI mode. This change affects code -assembled until the next `.mri' directive, or until the end of the -file. *Note MRI mode: M. - - -File: as.info, Node: List, Next: Long, Prev: Linkonce, Up: Pseudo Ops - -`.list' -======= - - Control (in conjunction with the `.nolist' directive) whether or not -assembly listings are generated. These two directives maintain an -internal counter (which is zero initially). `.list' increments the -counter, and `.nolist' decrements it. Assembly listings are generated -whenever the counter is greater than zero. - - By default, listings are disabled. When you enable them (with the -`-a' command line option; *note Command-Line Options: Invoking.), the -initial value of the listing counter is one. - - -File: as.info, Node: Long, Next: Macro, Prev: List, Up: Pseudo Ops - -`.long EXPRESSIONS' -=================== - - `.long' is the same as `.int', *note `.int': Int.. - - -File: as.info, Node: Macro, Next: MRI, Prev: Long, Up: Pseudo Ops - -`.macro' -======== - - The commands `.macro' and `.endm' allow you to define macros that -generate assembly output. For example, this definition specifies a -macro `sum' that puts a sequence of numbers into memory: - - .macro sum from=0, to=5 - .long \from - .if \to-\from - sum "(\from+1)",\to - .endif - .endm - -With that definition, `SUM 0,5' is equivalent to this assembly input: - - .long 0 - .long 1 - .long 2 - .long 3 - .long 4 - .long 5 - -`.macro MACNAME' -`.macro MACNAME MACARGS ...' - Begin the definition of a macro called MACNAME. If your macro - definition requires arguments, specify their names after the macro - name, separated by commas or spaces. You can supply a default - value for any macro argument by following the name with `=DEFLT'. - For example, these are all valid `.macro' statements: - - `.macro comm' - Begin the definition of a macro called `comm', which takes no - arguments. - - `.macro plus1 p, p1' - `.macro plus1 p p1' - Either statement begins the definition of a macro called - `plus1', which takes two arguments; within the macro - definition, write `\p' or `\p1' to evaluate the arguments. - - `.macro reserve_str p1=0 p2' - Begin the definition of a macro called `reserve_str', with two - arguments. The first argument has a default value, but not - the second. After the definition is complete, you can call - the macro either as `reserve_str A,B' (with `\p1' evaluating - to A and `\p2' evaluating to B), or as `reserve_str ,B' (with - `\p1' evaluating as the default, in this case `0', and `\p2' - evaluating to B). - - When you call a macro, you can specify the argument values either - by position, or by keyword. For example, `sum 9,17' is equivalent - to `sum to=17, from=9'. - -`.endm' - Mark the end of a macro definition. - -`.exitm' - Exit early from the current macro definition. - -`\@' - `as' maintains a counter of how many macros it has executed in - this pseudo-variable; you can copy that number to your output with - `\@', but *only within a macro definition*. - - -File: as.info, Node: Nolist, Next: Octa, Prev: MRI, Up: Pseudo Ops - -`.nolist' -========= - - Control (in conjunction with the `.list' directive) whether or not -assembly listings are generated. These two directives maintain an -internal counter (which is zero initially). `.list' increments the -counter, and `.nolist' decrements it. Assembly listings are generated -whenever the counter is greater than zero. - - -File: as.info, Node: Octa, Next: Org, Prev: Nolist, Up: Pseudo Ops - -`.octa BIGNUMS' -=============== - - This directive expects zero or more bignums, separated by commas. -For each bignum, it emits a 16-byte integer. - - The term "octa" comes from contexts in which a "word" is two bytes; -hence *octa*-word for 16 bytes. - - -File: as.info, Node: Org, Next: P2align, Prev: Octa, Up: Pseudo Ops - -`.org NEW-LC , FILL' -==================== - - Advance the location counter of the current section to NEW-LC. -NEW-LC is either an absolute expression or an expression with the same -section as the current subsection. That is, you can't use `.org' to -cross sections: if NEW-LC has the wrong section, the `.org' directive -is ignored. To be compatible with former assemblers, if the section of -NEW-LC is absolute, `as' issues a warning, then pretends the section of -NEW-LC is the same as the current subsection. - - `.org' may only increase the location counter, or leave it -unchanged; you cannot use `.org' to move the location counter backwards. - - Because `as' tries to assemble programs in one pass, NEW-LC may not -be undefined. If you really detest this restriction we eagerly await a -chance to share your improved assembler. - - Beware that the origin is relative to the start of the section, not -to the start of the subsection. This is compatible with other people's -assemblers. - - When the location counter (of the current subsection) is advanced, -the intervening bytes are filled with FILL which should be an absolute -expression. If the comma and FILL are omitted, FILL defaults to zero. - - -File: as.info, Node: P2align, Next: Psize, Prev: Org, Up: Pseudo Ops - -`.p2align[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR' -=========================================== - - Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -number of low-order zero bits the location counter must have after -advancement. For example `.p2align 3' advances the location counter -until it a multiple of 8. If the location counter is already a -multiple of 8, no change is needed. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The `.p2alignw' and `.p2alignl' directives are variants of the -`.p2align' directive. The `.p2alignw' directive treats the fill -pattern as a two byte word value. The `.p2alignl' directives treats the -fill pattern as a four byte longword value. For example, `.p2alignw -2,0x368d' will align to a multiple of 4. If it skips two bytes, they -will be filled in with the value 0x368d (the exact placement of the -bytes depends upon the endianness of the processor). If it skips 1 or -3 bytes, the fill value is undefined. - - -File: as.info, Node: Psize, Next: Quad, Prev: P2align, Up: Pseudo Ops - -`.psize LINES , COLUMNS' -======================== - - Use this directive to declare the number of lines--and, optionally, -the number of columns--to use for each page, when generating listings. - - If you do not use `.psize', listings use a default line-count of 60. -You may omit the comma and COLUMNS specification; the default width is -200 columns. - - `as' generates formfeeds whenever the specified number of lines is -exceeded (or whenever you explicitly request one, using `.eject'). - - If you specify LINES as `0', no formfeeds are generated save those -explicitly specified with `.eject'. - - -File: as.info, Node: Quad, Next: Rept, Prev: Psize, Up: Pseudo Ops - -`.quad BIGNUMS' -=============== - - `.quad' expects zero or more bignums, separated by commas. For each -bignum, it emits an 8-byte integer. If the bignum won't fit in 8 -bytes, it prints a warning message; and just takes the lowest order 8 -bytes of the bignum. - - The term "quad" comes from contexts in which a "word" is two bytes; -hence *quad*-word for 8 bytes. - - -File: as.info, Node: Rept, Next: Sbttl, Prev: Quad, Up: Pseudo Ops - -`.rept COUNT' -============= - - Repeat the sequence of lines between the `.rept' directive and the -next `.endr' directive COUNT times. - - For example, assembling - - .rept 3 - .long 0 - .endr - - is equivalent to assembling - - .long 0 - .long 0 - .long 0 - - -File: as.info, Node: Sbttl, Next: Scl, Prev: Rept, Up: Pseudo Ops - -`.sbttl "SUBHEADING"' -===================== - - Use SUBHEADING as the title (third line, immediately after the title -line) when generating assembly listings. - - This directive affects subsequent pages, as well as the current page -if it appears within ten lines of the top of a page. - - -File: as.info, Node: Scl, Next: Section, Prev: Sbttl, Up: Pseudo Ops - -`.scl CLASS' -============ - - Set the storage-class value for a symbol. This directive may only be -used inside a `.def'/`.endef' pair. Storage class may flag whether a -symbol is static or external, or it may record further symbolic -debugging information. - - The `.scl' directive is primarily associated with COFF output; when -configured to generate `b.out' output format, `as' accepts this -directive but ignores it. - - -File: as.info, Node: Section, Next: Set, Prev: Scl, Up: Pseudo Ops - -`.section NAME' -=============== - - Use the `.section' directive to assemble the following code into a -section named NAME. - - This directive is only supported for targets that actually support -arbitrarily named sections; on `a.out' targets, for example, it is not -accepted, even with a standard `a.out' section name. - - For COFF targets, the `.section' directive is used in one of the -following ways: - .section NAME[, "FLAGS"] - .section NAME[, SUBSEGMENT] - - If the optional argument is quoted, it is taken as flags to use for -the section. Each flag is a single character. The following flags are -recognized: -`b' - bss section (uninitialized data) - -`n' - section is not loaded - -`w' - writable section - -`d' - data section - -`r' - read-only section - -`x' - executable section - - If no flags are specified, the default flags depend upon the section -name. If the section name is not recognized, the default will be for -the section to be loaded and writable. - - If the optional argument to the `.section' directive is not quoted, -it is taken as a subsegment number (*note Sub-Sections::.). - - For ELF targets, the `.section' directive is used like this: - .section NAME[, "FLAGS"[, @TYPE]] - The optional FLAGS argument is a quoted string which may contain any -combintion of the following characters: -`a' - section is allocatable - -`w' - section is writable - -`x' - section is executable - - The optional TYPE argument may contain one of the following -constants: -`@progbits' - section contains data - -`@nobits' - section does not contain data (i.e., section only occupies space) - - If no flags are specified, the default flags depend upon the section -name. If the section name is not recognized, the default will be for -the section to have none of the above flags: it will not be allocated -in memory, nor writable, nor executable. The section will contain data. - - For ELF targets, the assembler supports another type of `.section' -directive for compatibility with the Solaris assembler: - .section "NAME"[, FLAGS...] - Note that the section name is quoted. There may be a sequence of -comma separated flags: -`#alloc' - section is allocatable - -`#write' - section is writable - -`#execinstr' - section is executable - - -File: as.info, Node: Set, Next: Short, Prev: Section, Up: Pseudo Ops - -`.set SYMBOL, EXPRESSION' -========================= - - Set the value of SYMBOL to EXPRESSION. This changes SYMBOL's value -and type to conform to EXPRESSION. If SYMBOL was flagged as external, -it remains flagged (*note Symbol Attributes::.). - - You may `.set' a symbol many times in the same assembly. - - If you `.set' a global symbol, the value stored in the object file -is the last value stored into it. - - The syntax for `set' on the HPPA is `SYMBOL .set EXPRESSION'. - - -File: as.info, Node: Short, Next: Single, Prev: Set, Up: Pseudo Ops - -`.short EXPRESSIONS' -==================== - - `.short' is normally the same as `.word'. *Note `.word': Word. - - In some configurations, however, `.short' and `.word' generate -numbers of different lengths; *note Machine Dependencies::.. - - -File: as.info, Node: Single, Next: Size, Prev: Short, Up: Pseudo Ops - -`.single FLONUMS' -================= - - This directive assembles zero or more flonums, separated by commas. -It has the same effect as `.float'. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Size, Next: Skip, Prev: Single, Up: Pseudo Ops - -`.size' -======= - - This directive is generated by compilers to include auxiliary -debugging information in the symbol table. It is only permitted inside -`.def'/`.endef' pairs. - - `.size' is only meaningful when generating COFF format output; when -`as' is generating `b.out', it accepts this directive but ignores it. - - -File: as.info, Node: Sleb128, Next: Space, Prev: Skip, Up: Pseudo Ops - -`.sleb128 EXPRESSIONS' -====================== - - SLEB128 stands for "signed little endian base 128." This is a -compact, variable length representation of numbers used by the DWARF -symbolic debugging format. *Note `.uleb128': Uleb128. - - -File: as.info, Node: Skip, Next: Sleb128, Prev: Size, Up: Pseudo Ops - -`.skip SIZE , FILL' -=================== - - This directive emits SIZE bytes, each of value FILL. Both SIZE and -FILL are absolute expressions. If the comma and FILL are omitted, FILL -is assumed to be zero. This is the same as `.space'. - - -File: as.info, Node: Space, Next: Stab, Prev: Sleb128, Up: Pseudo Ops - -`.space SIZE , FILL' -==================== - - This directive emits SIZE bytes, each of value FILL. Both SIZE and -FILL are absolute expressions. If the comma and FILL are omitted, FILL -is assumed to be zero. This is the same as `.skip'. - - *Warning:* `.space' has a completely different meaning for HPPA - targets; use `.block' as a substitute. See `HP9000 Series 800 - Assembly Language Reference Manual' (HP 92432-90001) for the - meaning of the `.space' directive. *Note HPPA Assembler - Directives: HPPA Directives, for a summary. - - On the AMD 29K, this directive is ignored; it is accepted for -compatibility with other AMD 29K assemblers. - - *Warning:* In most versions of the GNU assembler, the directive - `.space' has the effect of `.block' *Note Machine Dependencies::. - - -File: as.info, Node: Stab, Next: String, Prev: Space, Up: Pseudo Ops - -`.stabd, .stabn, .stabs' -======================== - - There are three directives that begin `.stab'. All emit symbols -(*note Symbols::.), for use by symbolic debuggers. The symbols are not -entered in the `as' hash table: they cannot be referenced elsewhere in -the source file. Up to five fields are required: - -STRING - This is the symbol's name. It may contain any character except - `\000', so is more general than ordinary symbol names. Some - debuggers used to code arbitrarily complex structures into symbol - names using this field. - -TYPE - An absolute expression. The symbol's type is set to the low 8 - bits of this expression. Any bit pattern is permitted, but `ld' - and debuggers choke on silly bit patterns. - -OTHER - An absolute expression. The symbol's "other" attribute is set to - the low 8 bits of this expression. - -DESC - An absolute expression. The symbol's descriptor is set to the low - 16 bits of this expression. - -VALUE - An absolute expression which becomes the symbol's value. - - If a warning is detected while reading a `.stabd', `.stabn', or -`.stabs' statement, the symbol has probably already been created; you -get a half-formed symbol in your object file. This is compatible with -earlier assemblers! - -`.stabd TYPE , OTHER , DESC' - The "name" of the symbol generated is not even an empty string. - It is a null pointer, for compatibility. Older assemblers used a - null pointer so they didn't waste space in object files with empty - strings. - - The symbol's value is set to the location counter, relocatably. - When your program is linked, the value of this symbol is the - address of the location counter when the `.stabd' was assembled. - -`.stabn TYPE , OTHER , DESC , VALUE' - The name of the symbol is set to the empty string `""'. - -`.stabs STRING , TYPE , OTHER , DESC , VALUE' - All five fields are specified. - - -File: as.info, Node: String, Next: Symver, Prev: Stab, Up: Pseudo Ops - -`.string' "STR" -=============== - - Copy the characters in STR to the object file. You may specify more -than one string to copy, separated by commas. Unless otherwise -specified for a particular machine, the assembler marks the end of each -string with a 0 byte. You can use any of the escape sequences -described in *Note Strings: Strings. - - -File: as.info, Node: Symver, Next: Tag, Prev: String, Up: Pseudo Ops - -`.symver' -========= - - Use the `.symver' directive to bind symbols to specific version nodes -within a source file. This is only supported on ELF platforms, and is -typically used when assembling files to be linked into a shared library. -There are cases where it may make sense to use this in objects to be -bound into an application itself so as to override a versioned symbol -from a shared library. - - For ELF targets, the `.symver' directive is used like this: - .symver NAME, NAME2@NODENAME - In this case, the symbol NAME must exist and be defined within the -file being assembled. The `.versym' directive effectively creates a -symbol alias with the name NAME2@NODENAME, and in fact the main reason -that we just don't try and create a regular alias is that the @ -character isn't permitted in symbol names. The NAME2 part of the name -is the actual name of the symbol by which it will be externally -referenced. The name NAME itself is merely a name of convenience that -is used so that it is possible to have definitions for multiple -versions of a function within a single source file, and so that the -compiler can unambiguously know which version of a function is being -mentioned. The NODENAME portion of the alias should be the name of a -node specified in the version script supplied to the linker when -building a shared library. If you are attempting to override a -versioned symbol from a shared library, then NODENAME should correspond -to the nodename of the symbol you are trying to override. - - -File: as.info, Node: Tag, Next: Text, Prev: Symver, Up: Pseudo Ops - -`.tag STRUCTNAME' -================= - - This directive is generated by compilers to include auxiliary -debugging information in the symbol table. It is only permitted inside -`.def'/`.endef' pairs. Tags are used to link structure definitions in -the symbol table with instances of those structures. - - `.tag' is only used when generating COFF format output; when `as' is -generating `b.out', it accepts this directive but ignores it. - - -File: as.info, Node: Text, Next: Title, Prev: Tag, Up: Pseudo Ops - -`.text SUBSECTION' -================== - - Tells `as' to assemble the following statements onto the end of the -text subsection numbered SUBSECTION, which is an absolute expression. -If SUBSECTION is omitted, subsection number zero is used. - - -File: as.info, Node: Title, Next: Type, Prev: Text, Up: Pseudo Ops - -`.title "HEADING"' -================== - - Use HEADING as the title (second line, immediately after the source -file name and pagenumber) when generating assembly listings. - - This directive affects subsequent pages, as well as the current page -if it appears within ten lines of the top of a page. - - -File: as.info, Node: Type, Next: Val, Prev: Title, Up: Pseudo Ops - -`.type INT' -=========== - - This directive, permitted only within `.def'/`.endef' pairs, records -the integer INT as the type attribute of a symbol table entry. - - `.type' is associated only with COFF format output; when `as' is -configured for `b.out' output, it accepts this directive but ignores it. - - -File: as.info, Node: Val, Next: Uleb128, Prev: Type, Up: Pseudo Ops - -`.val ADDR' -=========== - - This directive, permitted only within `.def'/`.endef' pairs, records -the address ADDR as the value attribute of a symbol table entry. - - `.val' is used only for COFF output; when `as' is configured for -`b.out', it accepts this directive but ignores it. - - -File: as.info, Node: Uleb128, Next: Word, Prev: Val, Up: Pseudo Ops - -`.uleb128 EXPRESSIONS' -====================== - - ULEB128 stands for "unsigned little endian base 128." This is a -compact, variable length representation of numbers used by the DWARF -symbolic debugging format. *Note `.sleb128': Sleb128. - - -File: as.info, Node: Word, Next: Deprecated, Prev: Uleb128, Up: Pseudo Ops - -`.word EXPRESSIONS' -=================== - - This directive expects zero or more EXPRESSIONS, of any section, -separated by commas. - - The size of the number emitted, and its byte order, depend on what -target computer the assembly is for. - - *Warning: Special Treatment to support Compilers* - - Machines with a 32-bit address space, but that do less than 32-bit -addressing, require the following special treatment. If the machine of -interest to you does 32-bit addressing (or doesn't require it; *note -Machine Dependencies::.), you can ignore this issue. - - In order to assemble compiler output into something that works, `as' -occasionlly does strange things to `.word' directives. Directives of -the form `.word sym1-sym2' are often emitted by compilers as part of -jump tables. Therefore, when `as' assembles a directive of the form -`.word sym1-sym2', and the difference between `sym1' and `sym2' does -not fit in 16 bits, `as' creates a "secondary jump table", immediately -before the next label. This secondary jump table is preceded by a -short-jump to the first byte after the secondary table. This -short-jump prevents the flow of control from accidentally falling into -the new table. Inside the table is a long-jump to `sym2'. The -original `.word' contains `sym1' minus the address of the long-jump to -`sym2'. - - If there were several occurrences of `.word sym1-sym2' before the -secondary jump table, all of them are adjusted. If there was a `.word -sym3-sym4', that also did not fit in sixteen bits, a long-jump to -`sym4' is included in the secondary jump table, and the `.word' -directives are adjusted to contain `sym3' minus the address of the -long-jump to `sym4'; and so on, for as many entries in the original -jump table as necessary. - - -File: as.info, Node: Deprecated, Prev: Word, Up: Pseudo Ops - -Deprecated Directives -===================== - - One day these directives won't work. They are included for -compatibility with older assemblers. -.abort - -.app-file - -.line - -File: as.info, Node: Machine Dependencies, Next: Reporting Bugs, Prev: Pseudo Ops, Up: Top - -Machine Dependent Features -************************** - - The machine instruction sets are (almost by definition) different on -each machine where `as' runs. Floating point representations vary as -well, and `as' often supports a few additional directives or -command-line options for compatibility with other assemblers on a -particular platform. Finally, some versions of `as' support special -pseudo-instructions for branch optimization. - - This chapter discusses most of these differences, though it does not -include details on any machine's instruction set. For details on that -subject, see the hardware manufacturer's manual. - -* Menu: - - -* AMD29K-Dependent:: AMD 29K Dependent Features - -* ARC-Dependent:: ARC Dependent Features - -* ARM-Dependent:: ARM Dependent Features - -* D10V-Dependent:: D10V Dependent Features - -* H8/300-Dependent:: Hitachi H8/300 Dependent Features - -* H8/500-Dependent:: Hitachi H8/500 Dependent Features - -* HPPA-Dependent:: HPPA Dependent Features - -* i386-Dependent:: Intel 80386 Dependent Features - -* i960-Dependent:: Intel 80960 Dependent Features - -* M68K-Dependent:: M680x0 Dependent Features - -* MIPS-Dependent:: MIPS Dependent Features - -* SH-Dependent:: Hitachi SH Dependent Features - -* Sparc-Dependent:: SPARC Dependent Features - -* V850-Dependent:: V850 Dependent Features - -* Z8000-Dependent:: Z8000 Dependent Features - -* Vax-Dependent:: VAX Dependent Features - - -File: as.info, Node: ARC-Dependent, Next: ARM-Dependent, Prev: AMD29K-Dependent, Up: Machine Dependencies - -ARC Dependent Features -====================== - -* Menu: - -* ARC-Opts:: Options -* ARC-Float:: Floating Point -* ARC-Directives:: Sparc Machine Directives - - -File: as.info, Node: ARC-Opts, Next: ARC-Float, Up: ARC-Dependent - -Options -------- - - The ARC chip family includes several successive levels (or other -variants) of chip, using the same core instruction set, but including a -few additional instructions at each level. - - By default, `as' assumes the core instruction set (ARC base). The -`.cpu' pseudo-op is intended to be used to select the variant. - -`-mbig-endian' -`-mlittle-endian' - Any ARC configuration of `as' can select big-endian or - little-endian output at run time (unlike most other GNU development - tools, which must be configured for one or the other). Use - `-mbig-endian' to select big-endian output, and `-mlittle-endian' - for little-endian. - - -File: as.info, Node: ARC-Float, Next: ARC-Directives, Prev: ARC-Opts, Up: ARC-Dependent - -Floating Point --------------- - - The ARC cpu family currently does not have hardware floating point -support. Software floating point support is provided by `GCC' and uses -IEEE floating-point numbers. - - -File: as.info, Node: ARC-Directives, Prev: ARC-Float, Up: ARC-Dependent - -ARC Machine Directives ----------------------- - - The ARC version of `as' supports the following additional machine -directives: - -`.cpu' - This must be followed by the desired cpu. The ARC is intended to - be customizable, `.cpu' is used to select the desired variant - [though currently there are none]. - - -File: as.info, Node: AMD29K-Dependent, Next: ARC-Dependent, Up: Machine Dependencies - -AMD 29K Dependent Features -========================== - -* Menu: - -* AMD29K Options:: Options -* AMD29K Syntax:: Syntax -* AMD29K Floating Point:: Floating Point -* AMD29K Directives:: AMD 29K Machine Directives -* AMD29K Opcodes:: Opcodes - - -File: as.info, Node: AMD29K Options, Next: AMD29K Syntax, Up: AMD29K-Dependent - -Options -------- - - `as' has no additional command-line options for the AMD 29K family. - - -File: as.info, Node: AMD29K Syntax, Next: AMD29K Floating Point, Prev: AMD29K Options, Up: AMD29K-Dependent - -Syntax ------- - -* Menu: - -* AMD29K-Macros:: Macros -* AMD29K-Chars:: Special Characters -* AMD29K-Regs:: Register Names - - -File: as.info, Node: AMD29K-Macros, Next: AMD29K-Chars, Up: AMD29K Syntax - -Macros -...... - - The macro syntax used on the AMD 29K is like that described in the -AMD 29K Family Macro Assembler Specification. Normal `as' macros -should still work. - - -File: as.info, Node: AMD29K-Chars, Next: AMD29K-Regs, Prev: AMD29K-Macros, Up: AMD29K Syntax - -Special Characters -.................. - - `;' is the line comment character. - - The character `?' is permitted in identifiers (but may not begin an -identifier). - - -File: as.info, Node: AMD29K-Regs, Prev: AMD29K-Chars, Up: AMD29K Syntax - -Register Names -.............. - - General-purpose registers are represented by predefined symbols of -the form `GRNNN' (for global registers) or `LRNNN' (for local -registers), where NNN represents a number between `0' and `127', -written with no leading zeros. The leading letters may be in either -upper or lower case; for example, `gr13' and `LR7' are both valid -register names. - - You may also refer to general-purpose registers by specifying the -register number as the result of an expression (prefixed with `%%' to -flag the expression as a register number): - %%EXPRESSION - ---where EXPRESSION must be an absolute expression evaluating to a -number between `0' and `255'. The range [0, 127] refers to global -registers, and the range [128, 255] to local registers. - - In addition, `as' understands the following protected -special-purpose register names for the AMD 29K family: - - vab chd pc0 - ops chc pc1 - cps rbp pc2 - cfg tmc mmu - cha tmr lru - - These unprotected special-purpose register names are also recognized: - ipc alu fpe - ipa bp inte - ipb fc fps - q cr exop - - -File: as.info, Node: AMD29K Floating Point, Next: AMD29K Directives, Prev: AMD29K Syntax, Up: AMD29K-Dependent - -Floating Point --------------- - - The AMD 29K family uses IEEE floating-point numbers. - - -File: as.info, Node: AMD29K Directives, Next: AMD29K Opcodes, Prev: AMD29K Floating Point, Up: AMD29K-Dependent - -AMD 29K Machine Directives --------------------------- - -`.block SIZE , FILL' - This directive emits SIZE bytes, each of value FILL. Both SIZE - and FILL are absolute expressions. If the comma and FILL are - omitted, FILL is assumed to be zero. - - In other versions of the GNU assembler, this directive is called - `.space'. - -`.cputype' - This directive is ignored; it is accepted for compatibility with - other AMD 29K assemblers. - -`.file' - This directive is ignored; it is accepted for compatibility with - other AMD 29K assemblers. - - *Warning:* in other versions of the GNU assembler, `.file' is - used for the directive called `.app-file' in the AMD 29K - support. - -`.line' - This directive is ignored; it is accepted for compatibility with - other AMD 29K assemblers. - -`.sect' - This directive is ignored; it is accepted for compatibility with - other AMD 29K assemblers. - -`.use SECTION NAME' - Establishes the section and subsection for the following code; - SECTION NAME may be one of `.text', `.data', `.data1', or `.lit'. - With one of the first three SECTION NAME options, `.use' is - equivalent to the machine directive SECTION NAME; the remaining - case, `.use .lit', is the same as `.data 200'. - - -File: as.info, Node: AMD29K Opcodes, Prev: AMD29K Directives, Up: AMD29K-Dependent - -Opcodes -------- - - `as' implements all the standard AMD 29K opcodes. No additional -pseudo-instructions are needed on this family. - - For information on the 29K machine instruction set, see `Am29000 -User's Manual', Advanced Micro Devices, Inc. - - -File: as.info, Node: ARM-Dependent, Next: D10V-Dependent, Prev: ARC-Dependent, Up: Machine Dependencies - -ARM Dependent Features -====================== - -* Menu: - -* ARM Options:: Options -* ARM Syntax:: Syntax -* ARM Floating Point:: Floating Point -* ARM Directives:: ARM Machine Directives -* ARM Opcodes:: Opcodes - - -File: as.info, Node: ARM Options, Next: ARM Syntax, Up: ARM-Dependent - -Options -------- - -`-marm [2|250|3|6|60|600|610|620|7|7M|7D|7DM|7DI|7DMI|70|700|700I|710|710C|7100|7500|7500FE|7TDMI|8|STRONGARM|STRONGARM110]' - This option specifies the target processor. The assembler will - issue an error message if an attempt is made to assemble an - instruction which will not execute on the target processor. - -`-marmv [2|2A|3|3M|4|4T]' - This option specifies the target architecture. The assembler will - issue an error message if an attempt is made to assemble an - instruction which will not execute on the target architecture. - -`-mthumb' - This option specifies that only Thumb instructions should be - assembled. - -`-mall' - This option specifies that any Arm or Thumb instruction should be - assembled. - -`-mfpa [10|11]' - This option specifies the floating point architecture in use on the - target processor. - -`-mfpe-old' - Do not allow the assemble of floating point multiple instructions. - -`-mno-fpu' - Do not allow the assembly of any floating point instructions. - -`-mthumb-interwork' - This option specifies that the output generated by the assembler - should be marked as supporting interworking. - -`-mapcs [26|32]' - This option specifies that the output generated by the assembler - should be marked as supporting the indicated version of the Arm - Procedure. Calling Standard. - -`-EB' - This option specifies that the output generated by the assembler - should be marked as being encoded for a big-endian processor. - -`-EL' - This option specifies that the output generated by the assembler - should be marked as being encoded for a little-endian processor. - - -File: as.info, Node: ARM Syntax, Next: ARM Floating Point, Prev: ARM Options, Up: ARM-Dependent - -Syntax ------- - -* Menu: - -* ARM-Chars:: Special Characters -* ARM-Regs:: Register Names - - -File: as.info, Node: ARM-Chars, Next: ARM-Regs, Up: ARM Syntax - -Special Characters -.................. - - `;' is the line comment character. - - *TODO* Explain about /data modifier on symbols. - - -File: as.info, Node: ARM-Regs, Prev: ARM-Chars, Up: ARM Syntax - -Register Names -.............. - - *TODO* Explain about ARM register naming, and the predefined names. - - -File: as.info, Node: ARM Floating Point, Next: ARM Directives, Prev: ARM Syntax, Up: ARM-Dependent - -Floating Point --------------- - - The ARM family uses IEEE floating-point numbers. - - -File: as.info, Node: ARM Directives, Next: ARM Opcodes, Prev: ARM Floating Point, Up: ARM-Dependent - -ARM Machine Directives ----------------------- - -`.code [16|32]' - This directive selects the instruction set being generated. The - value 16 selects Thumb, with the value 32 selecting ARM. - -`.thumb' - This performs the same action as .CODE 16. - -`.arm' - This performs the same action as .CODE 32. - -`.force_thumb' - This directive forces the selection of Thumb instructions, even if - the target processor does not support those instructions - -`.thumb_func' - This directive specifies that the following symbol is the name of a - Thumb encoded function. This information is necessary in order to - allow the assembler and linker to generate correct code for - interworking between Arm and Thumb instructions and should be used - even if interworking is not going to be performed. - - -File: as.info, Node: ARM Opcodes, Prev: ARM Directives, Up: ARM-Dependent - -Opcodes -------- - - `as' implements all the standard ARM opcodes. - - *TODO* Document the pseudo-ops (adr, nop) - - For information on the ARM or Thumb instruction sets, see `ARM -Software Development Toolkit Reference Manual', Advanced RISC Machines -Ltd. - - -File: as.info, Node: D10V-Dependent, Next: H8/300-Dependent, Prev: ARM-Dependent, Up: Machine Dependencies - -D10V Dependent Features -======================= - -* Menu: - -* D10V-Opts:: D10V Options -* D10V-Syntax:: Syntax -* D10V-Float:: Floating Point -* D10V-Opcodes:: Opcodes - - -File: as.info, Node: D10V-Opts, Next: D10V-Syntax, Up: D10V-Dependent - -D10V Options ------------- - - The Mitsubishi D10V version of `as' has a few machine dependent -options. - -`-O' - The D10V can often execute two sub-instructions in parallel. When - this option is used, `as' will attempt to optimize its output by - detecting when instructions can be executed in parallel. - -`--nowarnswap' - To optimize execution performance, `as' will sometimes swap the - order of instructions. Normally this generates a warning. When - this option is used, no warning will be generated when - instructions are swapped. - - -File: as.info, Node: D10V-Syntax, Next: D10V-Float, Prev: D10V-Opts, Up: D10V-Dependent - -Syntax ------- - - The D10V syntax is based on the syntax in Mitsubishi's D10V -architecture manual. The differences are detailed below. - -* Menu: - -* D10V-Size:: Size Modifiers -* D10V-Subs:: Sub-Instructions -* D10V-Chars:: Special Characters -* D10V-Regs:: Register Names -* D10V-Addressing:: Addressing Modes -* D10V-Word:: @WORD Modifier - - -File: as.info, Node: D10V-Size, Next: D10V-Subs, Up: D10V-Syntax - -Size Modifiers -.............. - - The D10V version of `as' uses the instruction names in the D10V -Architecture Manual. However, the names in the manual are sometimes -ambiguous. There are instruction names that can assemble to a short or -long form opcode. How does the assembler pick the correct form? `as' -will always pick the smallest form if it can. When dealing with a -symbol that is not defined yet when a line is being assembled, it will -always use the long form. If you need to force the assembler to use -either the short or long form of the instruction, you can append either -`.s' (short) or `.l' (long) to it. For example, if you are writing an -assembly program and you want to do a branch to a symbol that is -defined later in your program, you can write `bra.s foo'. Objdump -and GDB will always append `.s' or `.l' to instructions which have both -short and long forms. - - -File: as.info, Node: D10V-Subs, Next: D10V-Chars, Prev: D10V-Size, Up: D10V-Syntax - -Sub-Instructions -................ - - The D10V assembler takes as input a series of instructions, either -one-per-line, or in the special two-per-line format described in the -next section. Some of these instructions will be short-form or -sub-instructions. These sub-instructions can be packed into a single -instruction. The assembler will do this automatically. It will also -detect when it should not pack instructions. For example, when a label -is defined, the next instruction will never be packaged with the -previous one. Whenever a branch and link instruction is called, it -will not be packaged with the next instruction so the return address -will be valid. Nops are automatically inserted when necessary. - - If you do not want the assembler automatically making these -decisions, you can control the packaging and execution type (parallel -or sequential) with the special execution symbols described in the next -section. - - -File: as.info, Node: D10V-Chars, Next: D10V-Regs, Prev: D10V-Subs, Up: D10V-Syntax - -Special Characters -.................. - - `;' and `#' are the line comment characters. Sub-instructions may -be executed in order, in reverse-order, or in parallel. Instructions -listed in the standard one-per-line format will be executed -sequentially. To specify the executing order, use the following -symbols: -`->' - Sequential with instruction on the left first. - -`<-' - Sequential with instruction on the right first. - -`||' - Parallel The D10V syntax allows either one instruction per line, -one instruction per line with the execution symbol, or two instructions -per line. For example -`abs a1 -> abs r0' - Execute these sequentially. The instruction on the right is in - the right container and is executed second. - -`abs r0 <- abs a1' - Execute these reverse-sequentially. The instruction on the right - is in the right container, and is executed first. - -`ld2w r2,@r8+ || mac a0,r0,r7' - Execute these in parallel. - -`ld2w r2,@r8+ ||' -`mac a0,r0,r7' - Two-line format. Execute these in parallel. - -`ld2w r2,@r8+' -`mac a0,r0,r7' - Two-line format. Execute these sequentially. Assembler will put - them in the proper containers. - -`ld2w r2,@r8+ ->' -`mac a0,r0,r7' - Two-line format. Execute these sequentially. Same as above but - second instruction will always go into right container. Since `$' -has no special meaning, you may use it in symbol names. - - -File: as.info, Node: D10V-Regs, Next: D10V-Addressing, Prev: D10V-Chars, Up: D10V-Syntax - -Register Names -.............. - - You can use the predefined symbols `r0' through `r15' to refer to -the D10V registers. You can also use `sp' as an alias for `r15'. The -accumulators are `a0' and `a1'. There are special register-pair names -that may optionally be used in opcodes that require even-numbered -registers. Register names are not case sensitive. - - Register Pairs -`r0-r1' - -`r2-r3' - -`r4-r5' - -`r6-r7' - -`r8-r9' - -`r10-r11' - -`r12-r13' - -`r14-r15' - The D10V also has predefined symbols for these control registers and -status bits: -`psw' - Processor Status Word - -`bpsw' - Backup Processor Status Word - -`pc' - Program Counter - -`bpc' - Backup Program Counter - -`rpt_c' - Repeat Count - -`rpt_s' - Repeat Start address - -`rpt_e' - Repeat End address - -`mod_s' - Modulo Start address - -`mod_e' - Modulo End address - -`iba' - Instruction Break Address - -`f0' - Flag 0 - -`f1' - Flag 1 - -`c' - Carry flag - - -File: as.info, Node: D10V-Addressing, Next: D10V-Word, Prev: D10V-Regs, Up: D10V-Syntax - -Addressing Modes -................ - - `as' understands the following addressing modes for the D10V. `RN' -in the following refers to any of the numbered registers, but *not* the -control registers. -`RN' - Register direct - -`@RN' - Register indirect - -`@RN+' - Register indirect with post-increment - -`@RN-' - Register indirect with post-decrement - -`@-SP' - Register indirect with pre-decrement - -`@(DISP, RN)' - Register indirect with displacement - -`ADDR' - PC relative address (for branch or rep). - -`#IMM' - Immediate data (the `#' is optional and ignored) - - -File: as.info, Node: D10V-Word, Prev: D10V-Addressing, Up: D10V-Syntax - -@WORD Modifier -.............. - - Any symbol followed by `@word' will be replaced by the symbol's value -shifted right by 2. This is used in situations such as loading a -register with the address of a function (or any other code fragment). -For example, if you want to load a register with the location of the -function `main' then jump to that function, you could do it as follws: - ldi r2, main@word - jmp r2 - - -File: as.info, Node: D10V-Float, Next: D10V-Opcodes, Prev: D10V-Syntax, Up: D10V-Dependent - -Floating Point --------------- - - The D10V has no hardware floating point, but the `.float' and -`.double' directives generates IEEE floating-point numbers for -compatibility with other development tools. - - -File: as.info, Node: D10V-Opcodes, Prev: D10V-Float, Up: D10V-Dependent - -Opcodes -------- - - For detailed information on the D10V machine instruction set, see -`D10V Architecture: A VLIW Microprocessor for Multimedia Applications' -(Mitsubishi Electric Corp.). `as' implements all the standard D10V -opcodes. The only changes are those described in the section on size -modifiers - - -File: as.info, Node: H8/300-Dependent, Next: H8/500-Dependent, Prev: D10V-Dependent, Up: Machine Dependencies - -H8/300 Dependent Features -========================= - -* Menu: - -* H8/300 Options:: Options -* H8/300 Syntax:: Syntax -* H8/300 Floating Point:: Floating Point -* H8/300 Directives:: H8/300 Machine Directives -* H8/300 Opcodes:: Opcodes - - -File: as.info, Node: H8/300 Options, Next: H8/300 Syntax, Up: H8/300-Dependent - -Options -------- - - `as' has no additional command-line options for the Hitachi H8/300 -family. - - -File: as.info, Node: H8/300 Syntax, Next: H8/300 Floating Point, Prev: H8/300 Options, Up: H8/300-Dependent - -Syntax ------- - -* Menu: - -* H8/300-Chars:: Special Characters -* H8/300-Regs:: Register Names -* H8/300-Addressing:: Addressing Modes - - -File: as.info, Node: H8/300-Chars, Next: H8/300-Regs, Up: H8/300 Syntax - -Special Characters -.................. - - `;' is the line comment character. - - `$' can be used instead of a newline to separate statements. -Therefore *you may not use `$' in symbol names* on the H8/300. - - -File: as.info, Node: H8/300-Regs, Next: H8/300-Addressing, Prev: H8/300-Chars, Up: H8/300 Syntax - -Register Names -.............. - - You can use predefined symbols of the form `rNh' and `rNl' to refer -to the H8/300 registers as sixteen 8-bit general-purpose registers. N -is a digit from `0' to `7'); for instance, both `r0h' and `r7l' are -valid register names. - - You can also use the eight predefined symbols `rN' to refer to the -H8/300 registers as 16-bit registers (you must use this form for -addressing). - - On the H8/300H, you can also use the eight predefined symbols `erN' -(`er0' ... `er7') to refer to the 32-bit general purpose registers. - - The two control registers are called `pc' (program counter; a 16-bit -register, except on the H8/300H where it is 24 bits) and `ccr' -(condition code register; an 8-bit register). `r7' is used as the -stack pointer, and can also be called `sp'. - - -File: as.info, Node: H8/300-Addressing, Prev: H8/300-Regs, Up: H8/300 Syntax - -Addressing Modes -................ - - as understands the following addressing modes for the H8/300: -`rN' - Register direct - -`@rN' - Register indirect - -`@(D, rN)' -`@(D:16, rN)' -`@(D:24, rN)' - Register indirect: 16-bit or 24-bit displacement D from register - N. (24-bit displacements are only meaningful on the H8/300H.) - -`@rN+' - Register indirect with post-increment - -`@-rN' - Register indirect with pre-decrement - -``@'AA' -``@'AA:8' -``@'AA:16' -``@'AA:24' - Absolute address `aa'. (The address size `:24' only makes sense - on the H8/300H.) - -`#XX' -`#XX:8' -`#XX:16' -`#XX:32' - Immediate data XX. You may specify the `:8', `:16', or `:32' for - clarity, if you wish; but `as' neither requires this nor uses - it--the data size required is taken from context. - -``@'`@'AA' -``@'`@'AA:8' - Memory indirect. You may specify the `:8' for clarity, if you - wish; but `as' neither requires this nor uses it. - - -File: as.info, Node: H8/300 Floating Point, Next: H8/300 Directives, Prev: H8/300 Syntax, Up: H8/300-Dependent - -Floating Point --------------- - - The H8/300 family has no hardware floating point, but the `.float' -directive generates IEEE floating-point numbers for compatibility with -other development tools. - - -File: as.info, Node: H8/300 Directives, Next: H8/300 Opcodes, Prev: H8/300 Floating Point, Up: H8/300-Dependent - -H8/300 Machine Directives -------------------------- - - `as' has only one machine-dependent directive for the H8/300: - -`.h8300h' - Recognize and emit additional instructions for the H8/300H - variant, and also make `.int' emit 32-bit numbers rather than the - usual (16-bit) for the H8/300 family. - - On the H8/300 family (including the H8/300H) `.word' directives -generate 16-bit numbers. - diff --git a/gnu/dist/gas/doc/as.info-4 b/gnu/dist/gas/doc/as.info-4 deleted file mode 100644 index 4da1f5cb5b58..000000000000 --- a/gnu/dist/gas/doc/as.info-4 +++ /dev/null @@ -1,1273 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: H8/300 Opcodes, Prev: H8/300 Directives, Up: H8/300-Dependent - -Opcodes -------- - - For detailed information on the H8/300 machine instruction set, see -`H8/300 Series Programming Manual' (Hitachi ADE-602-025). For -information specific to the H8/300H, see `H8/300H Series Programming -Manual' (Hitachi). - - `as' implements all the standard H8/300 opcodes. No additional -pseudo-instructions are needed on this family. - - The following table summarizes the H8/300 opcodes, and their -arguments. Entries marked `*' are opcodes used only on the H8/300H. - - Legend: - Rs source register - Rd destination register - abs absolute address - imm immediate data - disp:N N-bit displacement from a register - pcrel:N N-bit displacement relative to program counter - - add.b #imm,rd * andc #imm,ccr - add.b rs,rd band #imm,rd - add.w rs,rd band #imm,@rd - * add.w #imm,rd band #imm,@abs:8 - * add.l rs,rd bra pcrel:8 - * add.l #imm,rd * bra pcrel:16 - adds #imm,rd bt pcrel:8 - addx #imm,rd * bt pcrel:16 - addx rs,rd brn pcrel:8 - and.b #imm,rd * brn pcrel:16 - and.b rs,rd bf pcrel:8 - * and.w rs,rd * bf pcrel:16 - * and.w #imm,rd bhi pcrel:8 - * and.l #imm,rd * bhi pcrel:16 - * and.l rs,rd bls pcrel:8 - - * bls pcrel:16 bld #imm,rd - bcc pcrel:8 bld #imm,@rd - * bcc pcrel:16 bld #imm,@abs:8 - bhs pcrel:8 bnot #imm,rd - * bhs pcrel:16 bnot #imm,@rd - bcs pcrel:8 bnot #imm,@abs:8 - * bcs pcrel:16 bnot rs,rd - blo pcrel:8 bnot rs,@rd - * blo pcrel:16 bnot rs,@abs:8 - bne pcrel:8 bor #imm,rd - * bne pcrel:16 bor #imm,@rd - beq pcrel:8 bor #imm,@abs:8 - * beq pcrel:16 bset #imm,rd - bvc pcrel:8 bset #imm,@rd - * bvc pcrel:16 bset #imm,@abs:8 - bvs pcrel:8 bset rs,rd - * bvs pcrel:16 bset rs,@rd - bpl pcrel:8 bset rs,@abs:8 - * bpl pcrel:16 bsr pcrel:8 - bmi pcrel:8 bsr pcrel:16 - * bmi pcrel:16 bst #imm,rd - bge pcrel:8 bst #imm,@rd - * bge pcrel:16 bst #imm,@abs:8 - blt pcrel:8 btst #imm,rd - * blt pcrel:16 btst #imm,@rd - bgt pcrel:8 btst #imm,@abs:8 - * bgt pcrel:16 btst rs,rd - ble pcrel:8 btst rs,@rd - * ble pcrel:16 btst rs,@abs:8 - bclr #imm,rd bxor #imm,rd - bclr #imm,@rd bxor #imm,@rd - bclr #imm,@abs:8 bxor #imm,@abs:8 - bclr rs,rd cmp.b #imm,rd - bclr rs,@rd cmp.b rs,rd - bclr rs,@abs:8 cmp.w rs,rd - biand #imm,rd cmp.w rs,rd - biand #imm,@rd * cmp.w #imm,rd - biand #imm,@abs:8 * cmp.l #imm,rd - bild #imm,rd * cmp.l rs,rd - bild #imm,@rd daa rs - bild #imm,@abs:8 das rs - bior #imm,rd dec.b rs - bior #imm,@rd * dec.w #imm,rd - bior #imm,@abs:8 * dec.l #imm,rd - bist #imm,rd divxu.b rs,rd - bist #imm,@rd * divxu.w rs,rd - bist #imm,@abs:8 * divxs.b rs,rd - bixor #imm,rd * divxs.w rs,rd - bixor #imm,@rd eepmov - bixor #imm,@abs:8 * eepmovw - - * exts.w rd mov.w rs,@abs:16 - * exts.l rd * mov.l #imm,rd - * extu.w rd * mov.l rs,rd - * extu.l rd * mov.l @rs,rd - inc rs * mov.l @(disp:16,rs),rd - * inc.w #imm,rd * mov.l @(disp:24,rs),rd - * inc.l #imm,rd * mov.l @rs+,rd - jmp @rs * mov.l @abs:16,rd - jmp abs * mov.l @abs:24,rd - jmp @@abs:8 * mov.l rs,@rd - jsr @rs * mov.l rs,@(disp:16,rd) - jsr abs * mov.l rs,@(disp:24,rd) - jsr @@abs:8 * mov.l rs,@-rd - ldc #imm,ccr * mov.l rs,@abs:16 - ldc rs,ccr * mov.l rs,@abs:24 - * ldc @abs:16,ccr movfpe @abs:16,rd - * ldc @abs:24,ccr movtpe rs,@abs:16 - * ldc @(disp:16,rs),ccr mulxu.b rs,rd - * ldc @(disp:24,rs),ccr * mulxu.w rs,rd - * ldc @rs+,ccr * mulxs.b rs,rd - * ldc @rs,ccr * mulxs.w rs,rd - * mov.b @(disp:24,rs),rd neg.b rs - * mov.b rs,@(disp:24,rd) * neg.w rs - mov.b @abs:16,rd * neg.l rs - mov.b rs,rd nop - mov.b @abs:8,rd not.b rs - mov.b rs,@abs:8 * not.w rs - mov.b rs,rd * not.l rs - mov.b #imm,rd or.b #imm,rd - mov.b @rs,rd or.b rs,rd - mov.b @(disp:16,rs),rd * or.w #imm,rd - mov.b @rs+,rd * or.w rs,rd - mov.b @abs:8,rd * or.l #imm,rd - mov.b rs,@rd * or.l rs,rd - mov.b rs,@(disp:16,rd) orc #imm,ccr - mov.b rs,@-rd pop.w rs - mov.b rs,@abs:8 * pop.l rs - mov.w rs,@rd push.w rs - * mov.w @(disp:24,rs),rd * push.l rs - * mov.w rs,@(disp:24,rd) rotl.b rs - * mov.w @abs:24,rd * rotl.w rs - * mov.w rs,@abs:24 * rotl.l rs - mov.w rs,rd rotr.b rs - mov.w #imm,rd * rotr.w rs - mov.w @rs,rd * rotr.l rs - mov.w @(disp:16,rs),rd rotxl.b rs - mov.w @rs+,rd * rotxl.w rs - mov.w @abs:16,rd * rotxl.l rs - mov.w rs,@(disp:16,rd) rotxr.b rs - mov.w rs,@-rd * rotxr.w rs - - * rotxr.l rs * stc ccr,@(disp:24,rd) - bpt * stc ccr,@-rd - rte * stc ccr,@abs:16 - rts * stc ccr,@abs:24 - shal.b rs sub.b rs,rd - * shal.w rs sub.w rs,rd - * shal.l rs * sub.w #imm,rd - shar.b rs * sub.l rs,rd - * shar.w rs * sub.l #imm,rd - * shar.l rs subs #imm,rd - shll.b rs subx #imm,rd - * shll.w rs subx rs,rd - * shll.l rs * trapa #imm - shlr.b rs xor #imm,rd - * shlr.w rs xor rs,rd - * shlr.l rs * xor.w #imm,rd - sleep * xor.w rs,rd - stc ccr,rd * xor.l #imm,rd - * stc ccr,@rs * xor.l rs,rd - * stc ccr,@(disp:16,rd) xorc #imm,ccr - - Four H8/300 instructions (`add', `cmp', `mov', `sub') are defined -with variants using the suffixes `.b', `.w', and `.l' to specify the -size of a memory operand. `as' supports these suffixes, but does not -require them; since one of the operands is always a register, `as' can -deduce the correct size. - - For example, since `r0' refers to a 16-bit register, - mov r0,@foo -is equivalent to - mov.w r0,@foo - - If you use the size suffixes, `as' issues a warning when the suffix -and the register size do not match. - - -File: as.info, Node: H8/500-Dependent, Next: HPPA-Dependent, Prev: H8/300-Dependent, Up: Machine Dependencies - -H8/500 Dependent Features -========================= - -* Menu: - -* H8/500 Options:: Options -* H8/500 Syntax:: Syntax -* H8/500 Floating Point:: Floating Point -* H8/500 Directives:: H8/500 Machine Directives -* H8/500 Opcodes:: Opcodes - - -File: as.info, Node: H8/500 Options, Next: H8/500 Syntax, Up: H8/500-Dependent - -Options -------- - - `as' has no additional command-line options for the Hitachi H8/500 -family. - - -File: as.info, Node: H8/500 Syntax, Next: H8/500 Floating Point, Prev: H8/500 Options, Up: H8/500-Dependent - -Syntax ------- - -* Menu: - -* H8/500-Chars:: Special Characters -* H8/500-Regs:: Register Names -* H8/500-Addressing:: Addressing Modes - - -File: as.info, Node: H8/500-Chars, Next: H8/500-Regs, Up: H8/500 Syntax - -Special Characters -.................. - - `!' is the line comment character. - - `;' can be used instead of a newline to separate statements. - - Since `$' has no special meaning, you may use it in symbol names. - - -File: as.info, Node: H8/500-Regs, Next: H8/500-Addressing, Prev: H8/500-Chars, Up: H8/500 Syntax - -Register Names -.............. - - You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', -`r5', `r6', and `r7' to refer to the H8/500 registers. - - The H8/500 also has these control registers: - -`cp' - code pointer - -`dp' - data pointer - -`bp' - base pointer - -`tp' - stack top pointer - -`ep' - extra pointer - -`sr' - status register - -`ccr' - condition code register - - All registers are 16 bits long. To represent 32 bit numbers, use two -adjacent registers; for distant memory addresses, use one of the segment -pointers (`cp' for the program counter; `dp' for `r0'-`r3'; `ep' for -`r4' and `r5'; and `tp' for `r6' and `r7'. - - -File: as.info, Node: H8/500-Addressing, Prev: H8/500-Regs, Up: H8/500 Syntax - -Addressing Modes -................ - - as understands the following addressing modes for the H8/500: -`RN' - Register direct - -`@RN' - Register indirect - -`@(d:8, RN)' - Register indirect with 8 bit signed displacement - -`@(d:16, RN)' - Register indirect with 16 bit signed displacement - -`@-RN' - Register indirect with pre-decrement - -`@RN+' - Register indirect with post-increment - -`@AA:8' - 8 bit absolute address - -`@AA:16' - 16 bit absolute address - -`#XX:8' - 8 bit immediate - -`#XX:16' - 16 bit immediate - - -File: as.info, Node: H8/500 Floating Point, Next: H8/500 Directives, Prev: H8/500 Syntax, Up: H8/500-Dependent - -Floating Point --------------- - - The H8/500 family has no hardware floating point, but the `.float' -directive generates IEEE floating-point numbers for compatibility with -other development tools. - - -File: as.info, Node: H8/500 Directives, Next: H8/500 Opcodes, Prev: H8/500 Floating Point, Up: H8/500-Dependent - -H8/500 Machine Directives -------------------------- - - `as' has no machine-dependent directives for the H8/500. However, -on this platform the `.int' and `.word' directives generate 16-bit -numbers. - - -File: as.info, Node: H8/500 Opcodes, Prev: H8/500 Directives, Up: H8/500-Dependent - -Opcodes -------- - - For detailed information on the H8/500 machine instruction set, see -`H8/500 Series Programming Manual' (Hitachi M21T001). - - `as' implements all the standard H8/500 opcodes. No additional -pseudo-instructions are needed on this family. - - The following table summarizes H8/500 opcodes and their operands: - - Legend: - abs8 8-bit absolute address - abs16 16-bit absolute address - abs24 24-bit absolute address - crb `ccr', `br', `ep', `dp', `tp', `dp' - disp8 8-bit displacement - ea `rn', `@rn', `@(d:8, rn)', `@(d:16, rn)', - `@-rn', `@rn+', `@aa:8', `@aa:16', - `#xx:8', `#xx:16' - ea_mem `@rn', `@(d:8, rn)', `@(d:16, rn)', - `@-rn', `@rn+', `@aa:8', `@aa:16' - ea_noimm `rn', `@rn', `@(d:8, rn)', `@(d:16, rn)', - `@-rn', `@rn+', `@aa:8', `@aa:16' - fp r6 - imm4 4-bit immediate data - imm8 8-bit immediate data - imm16 16-bit immediate data - pcrel8 8-bit offset from program counter - pcrel16 16-bit offset from program counter - qim `-2', `-1', `1', `2' - rd any register - rs a register distinct from rd - rlist comma-separated list of registers in parentheses; - register ranges `rd-rs' are allowed - sp stack pointer (`r7') - sr status register - sz size; `.b' or `.w'. If omitted, default `.w' - - ldc[.b] ea,crb bcc[.w] pcrel16 - ldc[.w] ea,sr bcc[.b] pcrel8 - add[:q] sz qim,ea_noimm bhs[.w] pcrel16 - add[:g] sz ea,rd bhs[.b] pcrel8 - adds sz ea,rd bcs[.w] pcrel16 - addx sz ea,rd bcs[.b] pcrel8 - and sz ea,rd blo[.w] pcrel16 - andc[.b] imm8,crb blo[.b] pcrel8 - andc[.w] imm16,sr bne[.w] pcrel16 - bpt bne[.b] pcrel8 - bra[.w] pcrel16 beq[.w] pcrel16 - bra[.b] pcrel8 beq[.b] pcrel8 - bt[.w] pcrel16 bvc[.w] pcrel16 - bt[.b] pcrel8 bvc[.b] pcrel8 - brn[.w] pcrel16 bvs[.w] pcrel16 - brn[.b] pcrel8 bvs[.b] pcrel8 - bf[.w] pcrel16 bpl[.w] pcrel16 - bf[.b] pcrel8 bpl[.b] pcrel8 - bhi[.w] pcrel16 bmi[.w] pcrel16 - bhi[.b] pcrel8 bmi[.b] pcrel8 - bls[.w] pcrel16 bge[.w] pcrel16 - bls[.b] pcrel8 bge[.b] pcrel8 - - blt[.w] pcrel16 mov[:g][.b] imm8,ea_mem - blt[.b] pcrel8 mov[:g][.w] imm16,ea_mem - bgt[.w] pcrel16 movfpe[.b] ea,rd - bgt[.b] pcrel8 movtpe[.b] rs,ea_noimm - ble[.w] pcrel16 mulxu sz ea,rd - ble[.b] pcrel8 neg sz ea - bclr sz imm4,ea_noimm nop - bclr sz rs,ea_noimm not sz ea - bnot sz imm4,ea_noimm or sz ea,rd - bnot sz rs,ea_noimm orc[.b] imm8,crb - bset sz imm4,ea_noimm orc[.w] imm16,sr - bset sz rs,ea_noimm pjmp abs24 - bsr[.b] pcrel8 pjmp @rd - bsr[.w] pcrel16 pjsr abs24 - btst sz imm4,ea_noimm pjsr @rd - btst sz rs,ea_noimm prtd imm8 - clr sz ea prtd imm16 - cmp[:e][.b] imm8,rd prts - cmp[:i][.w] imm16,rd rotl sz ea - cmp[:g].b imm8,ea_noimm rotr sz ea - cmp[:g][.w] imm16,ea_noimm rotxl sz ea - Cmp[:g] sz ea,rd rotxr sz ea - dadd rs,rd rtd imm8 - divxu sz ea,rd rtd imm16 - dsub rs,rd rts - exts[.b] rd scb/f rs,pcrel8 - extu[.b] rd scb/ne rs,pcrel8 - jmp @rd scb/eq rs,pcrel8 - jmp @(imm8,rd) shal sz ea - jmp @(imm16,rd) shar sz ea - jmp abs16 shll sz ea - jsr @rd shlr sz ea - jsr @(imm8,rd) sleep - jsr @(imm16,rd) stc[.b] crb,ea_noimm - jsr abs16 stc[.w] sr,ea_noimm - ldm @sp+,(rlist) stm (rlist),@-sp - link fp,imm8 sub sz ea,rd - link fp,imm16 subs sz ea,rd - mov[:e][.b] imm8,rd subx sz ea,rd - mov[:i][.w] imm16,rd swap[.b] rd - mov[:l][.w] abs8,rd tas[.b] ea - mov[:l].b abs8,rd trapa imm4 - mov[:s][.w] rs,abs8 trap/vs - mov[:s].b rs,abs8 tst sz ea - mov[:f][.w] @(disp8,fp),rd unlk fp - mov[:f][.w] rs,@(disp8,fp) xch[.w] rs,rd - mov[:f].b @(disp8,fp),rd xor sz ea,rd - mov[:f].b rs,@(disp8,fp) xorc.b imm8,crb - mov[:g] sz rs,ea_mem xorc.w imm16,sr - mov[:g] sz ea,rd - - -File: as.info, Node: HPPA-Dependent, Next: i386-Dependent, Prev: H8/500-Dependent, Up: Machine Dependencies - -HPPA Dependent Features -======================= - -* Menu: - -* HPPA Notes:: Notes -* HPPA Options:: Options -* HPPA Syntax:: Syntax -* HPPA Floating Point:: Floating Point -* HPPA Directives:: HPPA Machine Directives -* HPPA Opcodes:: Opcodes - - -File: as.info, Node: HPPA Notes, Next: HPPA Options, Up: HPPA-Dependent - -Notes ------ - - As a back end for GNU CC `as' has been throughly tested and should -work extremely well. We have tested it only minimally on hand written -assembly code and no one has tested it much on the assembly output from -the HP compilers. - - The format of the debugging sections has changed since the original -`as' port (version 1.3X) was released; therefore, you must rebuild all -HPPA objects and libraries with the new assembler so that you can debug -the final executable. - - The HPPA `as' port generates a small subset of the relocations -available in the SOM and ELF object file formats. Additional relocation -support will be added as it becomes necessary. - - -File: as.info, Node: HPPA Options, Next: HPPA Syntax, Prev: HPPA Notes, Up: HPPA-Dependent - -Options -------- - - `as' has no machine-dependent command-line options for the HPPA. - - -File: as.info, Node: HPPA Syntax, Next: HPPA Floating Point, Prev: HPPA Options, Up: HPPA-Dependent - -Syntax ------- - - The assembler syntax closely follows the HPPA instruction set -reference manual; assembler directives and general syntax closely -follow the HPPA assembly language reference manual, with a few -noteworthy differences. - - First, a colon may immediately follow a label definition. This is -simply for compatibility with how most assembly language programmers -write code. - - Some obscure expression parsing problems may affect hand written -code which uses the `spop' instructions, or code which makes significant -use of the `!' line separator. - - `as' is much less forgiving about missing arguments and other -similar oversights than the HP assembler. `as' notifies you of missing -arguments as syntax errors; this is regarded as a feature, not a bug. - - Finally, `as' allows you to use an external symbol without -explicitly importing the symbol. *Warning:* in the future this will be -an error for HPPA targets. - - Special characters for HPPA targets include: - - `;' is the line comment character. - - `!' can be used instead of a newline to separate statements. - - Since `$' has no special meaning, you may use it in symbol names. - - -File: as.info, Node: HPPA Floating Point, Next: HPPA Directives, Prev: HPPA Syntax, Up: HPPA-Dependent - -Floating Point --------------- - - The HPPA family uses IEEE floating-point numbers. - - -File: as.info, Node: HPPA Directives, Next: HPPA Opcodes, Prev: HPPA Floating Point, Up: HPPA-Dependent - -HPPA Assembler Directives -------------------------- - - `as' for the HPPA supports many additional directives for -compatibility with the native assembler. This section describes them -only briefly. For detailed information on HPPA-specific assembler -directives, see `HP9000 Series 800 Assembly Language Reference Manual' -(HP 92432-90001). - - `as' does *not* support the following assembler directives described -in the HP manual: - - .endm .liston - .enter .locct - .leave .macro - .listoff - - Beyond those implemented for compatibility, `as' supports one -additional assembler directive for the HPPA: `.param'. It conveys -register argument locations for static functions. Its syntax closely -follows the `.export' directive. - - These are the additional directives in `as' for the HPPA: - -`.block N' -`.blockz N' - Reserve N bytes of storage, and initialize them to zero. - -`.call' - Mark the beginning of a procedure call. Only the special case - with *no arguments* is allowed. - -`.callinfo [ PARAM=VALUE, ... ] [ FLAG, ... ]' - Specify a number of parameters and flags that define the - environment for a procedure. - - PARAM may be any of `frame' (frame size), `entry_gr' (end of - general register range), `entry_fr' (end of float register range), - `entry_sr' (end of space register range). - - The values for FLAG are `calls' or `caller' (proc has - subroutines), `no_calls' (proc does not call subroutines), - `save_rp' (preserve return pointer), `save_sp' (proc preserves - stack pointer), `no_unwind' (do not unwind this proc), `hpux_int' - (proc is interrupt routine). - -`.code' - Assemble into the standard section called `$TEXT$', subsection - `$CODE$'. - -`.copyright "STRING"' - In the SOM object format, insert STRING into the object code, - marked as a copyright string. - -`.copyright "STRING"' - In the ELF object format, insert STRING into the object code, - marked as a version string. - -`.enter' - Not yet supported; the assembler rejects programs containing this - directive. - -`.entry' - Mark the beginning of a procedure. - -`.exit' - Mark the end of a procedure. - -`.export NAME [ ,TYP ] [ ,PARAM=R ]' - Make a procedure NAME available to callers. TYP, if present, must - be one of `absolute', `code' (ELF only, not SOM), `data', `entry', - `data', `entry', `millicode', `plabel', `pri_prog', or `sec_prog'. - - PARAM, if present, provides either relocation information for the - procedure arguments and result, or a privilege level. PARAM may be - `argwN' (where N ranges from `0' to `3', and indicates one of four - one-word arguments); `rtnval' (the procedure's result); or - `priv_lev' (privilege level). For arguments or the result, R - specifies how to relocate, and must be one of `no' (not - relocatable), `gr' (argument is in general register), `fr' (in - floating point register), or `fu' (upper half of float register). - For `priv_lev', R is an integer. - -`.half N' - Define a two-byte integer constant N; synonym for the portable - `as' directive `.short'. - -`.import NAME [ ,TYP ]' - Converse of `.export'; make a procedure available to call. The - arguments use the same conventions as the first two arguments for - `.export'. - -`.label NAME' - Define NAME as a label for the current assembly location. - -`.leave' - Not yet supported; the assembler rejects programs containing this - directive. - -`.origin LC' - Advance location counter to LC. Synonym for the `{No Value For - "as"}' portable directive `.org'. - -`.param NAME [ ,TYP ] [ ,PARAM=R ]' - Similar to `.export', but used for static procedures. - -`.proc' - Use preceding the first statement of a procedure. - -`.procend' - Use following the last statement of a procedure. - -`LABEL .reg EXPR' - Synonym for `.equ'; define LABEL with the absolute expression EXPR - as its value. - -`.space SECNAME [ ,PARAMS ]' - Switch to section SECNAME, creating a new section by that name if - necessary. You may only use PARAMS when creating a new section, - not when switching to an existing one. SECNAME may identify a - section by number rather than by name. - - If specified, the list PARAMS declares attributes of the section, - identified by keywords. The keywords recognized are `spnum=EXP' - (identify this section by the number EXP, an absolute expression), - `sort=EXP' (order sections according to this sort key when linking; - EXP is an absolute expression), `unloadable' (section contains no - loadable data), `notdefined' (this section defined elsewhere), and - `private' (data in this section not available to other programs). - -`.spnum SECNAM' - Allocate four bytes of storage, and initialize them with the - section number of the section named SECNAM. (You can define the - section number with the HPPA `.space' directive.) - -`.string "STR"' - Copy the characters in the string STR to the object file. *Note - Strings: Strings, for information on escape sequences you can use - in `as' strings. - - *Warning!* The HPPA version of `.string' differs from the usual - `as' definition: it does *not* write a zero byte after copying STR. - -`.stringz "STR"' - Like `.string', but appends a zero byte after copying STR to object - file. - -`.subspa NAME [ ,PARAMS ]' -`.nsubspa NAME [ ,PARAMS ]' - Similar to `.space', but selects a subsection NAME within the - current section. You may only specify PARAMS when you create a - subsection (in the first instance of `.subspa' for this NAME). - - If specified, the list PARAMS declares attributes of the - subsection, identified by keywords. The keywords recognized are - `quad=EXPR' ("quadrant" for this subsection), `align=EXPR' - (alignment for beginning of this subsection; a power of two), - `access=EXPR' (value for "access rights" field), `sort=EXPR' - (sorting order for this subspace in link), `code_only' (subsection - contains only code), `unloadable' (subsection cannot be loaded - into memory), `common' (subsection is common block), `dup_comm' - (initialized data may have duplicate names), or `zero' (subsection - is all zeros, do not write in object file). - - `.nsubspa' always creates a new subspace with the given name, even - if one with the same name already exists. - -`.version "STR"' - Write STR as version identifier in object code. - - -File: as.info, Node: HPPA Opcodes, Prev: HPPA Directives, Up: HPPA-Dependent - -Opcodes -------- - - For detailed information on the HPPA machine instruction set, see -`PA-RISC Architecture and Instruction Set Reference Manual' (HP -09740-90039). - - -File: as.info, Node: i386-Dependent, Next: i960-Dependent, Prev: HPPA-Dependent, Up: Machine Dependencies - -80386 Dependent Features -======================== - -* Menu: - -* i386-Options:: Options -* i386-Syntax:: AT&T Syntax versus Intel Syntax -* i386-Opcodes:: Opcode Naming -* i386-Regs:: Register Naming -* i386-prefixes:: Opcode Prefixes -* i386-Memory:: Memory References -* i386-jumps:: Handling of Jump Instructions -* i386-Float:: Floating Point -* i386-16bit:: Writing 16-bit Code -* i386-Notes:: Notes - - -File: as.info, Node: i386-Options, Next: i386-Syntax, Up: i386-Dependent - -Options -------- - - The 80386 has no machine dependent options. - - -File: as.info, Node: i386-Syntax, Next: i386-Opcodes, Prev: i386-Options, Up: i386-Dependent - -AT&T Syntax versus Intel Syntax -------------------------------- - - In order to maintain compatibility with the output of `gcc', `as' -supports AT&T System V/386 assembler syntax. This is quite different -from Intel syntax. We mention these differences because almost all -80386 documents used only Intel syntax. Notable differences between -the two syntaxes are: - - * AT&T immediate operands are preceded by `$'; Intel immediate - operands are undelimited (Intel `push 4' is AT&T `pushl $4'). - AT&T register operands are preceded by `%'; Intel register operands - are undelimited. AT&T absolute (as opposed to PC relative) - jump/call operands are prefixed by `*'; they are undelimited in - Intel syntax. - - * AT&T and Intel syntax use the opposite order for source and - destination operands. Intel `add eax, 4' is `addl $4, %eax'. The - `source, dest' convention is maintained for compatibility with - previous Unix assemblers. - - * In AT&T syntax the size of memory operands is determined from the - last character of the opcode name. Opcode suffixes of `b', `w', - and `l' specify byte (8-bit), word (16-bit), and long (32-bit) - memory references. Intel syntax accomplishes this by prefixes - memory operands (*not* the opcodes themselves) with `byte ptr', - `word ptr', and `dword ptr'. Thus, Intel `mov al, byte ptr FOO' - is `movb FOO, %al' in AT&T syntax. - - * Immediate form long jumps and calls are `lcall/ljmp $SECTION, - $OFFSET' in AT&T syntax; the Intel syntax is `call/jmp far - SECTION:OFFSET'. Also, the far return instruction is `lret - $STACK-ADJUST' in AT&T syntax; Intel syntax is `ret far - STACK-ADJUST'. - - * The AT&T assembler does not provide support for multiple section - programs. Unix style systems expect all programs to be single - sections. - - -File: as.info, Node: i386-Opcodes, Next: i386-Regs, Prev: i386-Syntax, Up: i386-Dependent - -Opcode Naming -------------- - - Opcode names are suffixed with one character modifiers which specify -the size of operands. The letters `b', `w', and `l' specify byte, -word, and long operands. If no suffix is specified by an instruction -and it contains no memory operands then `as' tries to fill in the -missing suffix based on the destination register operand (the last one -by convention). Thus, `mov %ax, %bx' is equivalent to `movw %ax, %bx'; -also, `mov $1, %bx' is equivalent to `movw $1, %bx'. Note that this is -incompatible with the AT&T Unix assembler which assumes that a missing -opcode suffix implies long operand size. (This incompatibility does -not affect compiler output since compilers always explicitly specify -the opcode suffix.) - - Almost all opcodes have the same names in AT&T and Intel format. -There are a few exceptions. The sign extend and zero extend -instructions need two sizes to specify them. They need a size to -sign/zero extend *from* and a size to zero extend *to*. This is -accomplished by using two opcode suffixes in AT&T syntax. Base names -for sign extend and zero extend are `movs...' and `movz...' in AT&T -syntax (`movsx' and `movzx' in Intel syntax). The opcode suffixes are -tacked on to this base name, the *from* suffix before the *to* suffix. -Thus, `movsbl %al, %edx' is AT&T syntax for "move sign extend *from* -%al *to* %edx." Possible suffixes, thus, are `bl' (from byte to long), -`bw' (from byte to word), and `wl' (from word to long). - - The Intel-syntax conversion instructions - - * `cbw' -- sign-extend byte in `%al' to word in `%ax', - - * `cwde' -- sign-extend word in `%ax' to long in `%eax', - - * `cwd' -- sign-extend word in `%ax' to long in `%dx:%ax', - - * `cdq' -- sign-extend dword in `%eax' to quad in `%edx:%eax', - -are called `cbtw', `cwtl', `cwtd', and `cltd' in AT&T naming. `as' -accepts either naming for these instructions. - - Far call/jump instructions are `lcall' and `ljmp' in AT&T syntax, -but are `call far' and `jump far' in Intel convention. - - -File: as.info, Node: i386-Regs, Next: i386-prefixes, Prev: i386-Opcodes, Up: i386-Dependent - -Register Naming ---------------- - - Register operands are always prefixes with `%'. The 80386 registers -consist of - - * the 8 32-bit registers `%eax' (the accumulator), `%ebx', `%ecx', - `%edx', `%edi', `%esi', `%ebp' (the frame pointer), and `%esp' - (the stack pointer). - - * the 8 16-bit low-ends of these: `%ax', `%bx', `%cx', `%dx', `%di', - `%si', `%bp', and `%sp'. - - * the 8 8-bit registers: `%ah', `%al', `%bh', `%bl', `%ch', `%cl', - `%dh', and `%dl' (These are the high-bytes and low-bytes of `%ax', - `%bx', `%cx', and `%dx') - - * the 6 section registers `%cs' (code section), `%ds' (data - section), `%ss' (stack section), `%es', `%fs', and `%gs'. - - * the 3 processor control registers `%cr0', `%cr2', and `%cr3'. - - * the 6 debug registers `%db0', `%db1', `%db2', `%db3', `%db6', and - `%db7'. - - * the 2 test registers `%tr6' and `%tr7'. - - * the 8 floating point register stack `%st' or equivalently - `%st(0)', `%st(1)', `%st(2)', `%st(3)', `%st(4)', `%st(5)', - `%st(6)', and `%st(7)'. - - -File: as.info, Node: i386-prefixes, Next: i386-Memory, Prev: i386-Regs, Up: i386-Dependent - -Opcode Prefixes ---------------- - - Opcode prefixes are used to modify the following opcode. They are -used to repeat string instructions, to provide section overrides, to -perform bus lock operations, and to give operand and address size -(16-bit operands are specified in an instruction by prefixing what would -normally be 32-bit operands with a "operand size" opcode prefix). -Opcode prefixes are usually given as single-line instructions with no -operands, and must directly precede the instruction they act upon. For -example, the `scas' (scan string) instruction is repeated with: - repne - scas - - Here is a list of opcode prefixes: - - * Section override prefixes `cs', `ds', `ss', `es', `fs', `gs'. - These are automatically added by specifying using the - SECTION:MEMORY-OPERAND form for memory references. - - * Operand/Address size prefixes `data16' and `addr16' change 32-bit - operands/addresses into 16-bit operands/addresses. Note that - 16-bit addressing modes (i.e. 8086 and 80286 addressing modes) are - not supported (yet). - - * The bus lock prefix `lock' inhibits interrupts during execution of - the instruction it precedes. (This is only valid with certain - instructions; see a 80386 manual for details). - - * The wait for coprocessor prefix `wait' waits for the coprocessor - to complete the current instruction. This should never be needed - for the 80386/80387 combination. - - * The `rep', `repe', and `repne' prefixes are added to string - instructions to make them repeat `%ecx' times. - - -File: as.info, Node: i386-Memory, Next: i386-jumps, Prev: i386-prefixes, Up: i386-Dependent - -Memory References ------------------ - - An Intel syntax indirect memory reference of the form - - SECTION:[BASE + INDEX*SCALE + DISP] - -is translated into the AT&T syntax - - SECTION:DISP(BASE, INDEX, SCALE) - -where BASE and INDEX are the optional 32-bit base and index registers, -DISP is the optional displacement, and SCALE, taking the values 1, 2, -4, and 8, multiplies INDEX to calculate the address of the operand. If -no SCALE is specified, SCALE is taken to be 1. SECTION specifies the -optional section register for the memory operand, and may override the -default section register (see a 80386 manual for section register -defaults). Note that section overrides in AT&T syntax *must* have be -preceded by a `%'. If you specify a section override which coincides -with the default section register, `as' does *not* output any section -register override prefixes to assemble the given instruction. Thus, -section overrides can be specified to emphasize which section register -is used for a given memory operand. - - Here are some examples of Intel and AT&T style memory references: - -AT&T: `-4(%ebp)', Intel: `[ebp - 4]' - BASE is `%ebp'; DISP is `-4'. SECTION is missing, and the default - section is used (`%ss' for addressing with `%ebp' as the base - register). INDEX, SCALE are both missing. - -AT&T: `foo(,%eax,4)', Intel: `[foo + eax*4]' - INDEX is `%eax' (scaled by a SCALE 4); DISP is `foo'. All other - fields are missing. The section register here defaults to `%ds'. - -AT&T: `foo(,1)'; Intel `[foo]' - This uses the value pointed to by `foo' as a memory operand. Note - that BASE and INDEX are both missing, but there is only *one* `,'. - This is a syntactic exception. - -AT&T: `%gs:foo'; Intel `gs:foo' - This selects the contents of the variable `foo' with section - register SECTION being `%gs'. - - Absolute (as opposed to PC relative) call and jump operands must be -prefixed with `*'. If no `*' is specified, `as' always chooses PC -relative addressing for jump/call labels. - - Any instruction that has a memory operand *must* specify its size -(byte, word, or long) with an opcode suffix (`b', `w', or `l', -respectively). - - -File: as.info, Node: i386-jumps, Next: i386-Float, Prev: i386-Memory, Up: i386-Dependent - -Handling of Jump Instructions ------------------------------ - - Jump instructions are always optimized to use the smallest possible -displacements. This is accomplished by using byte (8-bit) displacement -jumps whenever the target is sufficiently close. If a byte displacement -is insufficient a long (32-bit) displacement is used. We do not support -word (16-bit) displacement jumps (i.e. prefixing the jump instruction -with the `addr16' opcode prefix), since the 80386 insists upon masking -`%eip' to 16 bits after the word displacement is added. - - Note that the `jcxz', `jecxz', `loop', `loopz', `loope', `loopnz' -and `loopne' instructions only come in byte displacements, so that if -you use these instructions (`gcc' does not use them) you may get an -error message (and incorrect code). The AT&T 80386 assembler tries to -get around this problem by expanding `jcxz foo' to - - jcxz cx_zero - jmp cx_nonzero - cx_zero: jmp foo - cx_nonzero: - - -File: as.info, Node: i386-Float, Next: i386-16bit, Prev: i386-jumps, Up: i386-Dependent - -Floating Point --------------- - - All 80387 floating point types except packed BCD are supported. -(BCD support may be added without much difficulty). These data types -are 16-, 32-, and 64- bit integers, and single (32-bit), double -(64-bit), and extended (80-bit) precision floating point. Each -supported type has an opcode suffix and a constructor associated with -it. Opcode suffixes specify operand's data types. Constructors build -these data types into memory. - - * Floating point constructors are `.float' or `.single', `.double', - and `.tfloat' for 32-, 64-, and 80-bit formats. These correspond - to opcode suffixes `s', `l', and `t'. `t' stands for temporary - real, and that the 80387 only supports this format via the `fldt' - (load temporary real to stack top) and `fstpt' (store temporary - real and pop stack) instructions. - - * Integer constructors are `.word', `.long' or `.int', and `.quad' - for the 16-, 32-, and 64-bit integer formats. The corresponding - opcode suffixes are `s' (single), `l' (long), and `q' (quad). As - with the temporary real format the 64-bit `q' format is only - present in the `fildq' (load quad integer to stack top) and - `fistpq' (store quad integer and pop stack) instructions. - - Register to register operations do not require opcode suffixes, so -that `fst %st, %st(1)' is equivalent to `fstl %st, %st(1)'. - - -File: as.info, Node: i386-16bit, Next: i386-Notes, Prev: i386-Float, Up: i386-Dependent - -Writing 16-bit Code -------------------- - - While GAS normally writes only "pure" 32-bit i386 code, it has -limited support for writing code to run in real mode or in 16-bit -protected mode code segments. To do this, insert a `.code16' directive -before the assembly language instructions to be run in 16-bit mode. -You can switch GAS back to writing normal 32-bit code with the -`.code32' directive. - - GAS understands exactly the same assembly language syntax in 16-bit -mode as in 32-bit mode. The function of any given instruction is -exactly the same regardless of mode, as long as the resulting object -code is executed in the mode for which GAS wrote it. So, for example, -the `ret' mnemonic produces a 32-bit return instruction regardless of -whether it is to be run in 16-bit or 32-bit mode. (If GAS is in 16-bit -mode, it will add an operand size prefix to the instruction to force it -to be a 32-bit return.) - - This means, for one thing, that you can use GNU CC to write code to -be run in real mode or 16-bit protected mode. Just insert the statement -`asm(".code16");' at the beginning of your C source file, and while GNU -CC will still be generating 32-bit code, GAS will automatically add all -the necessary size prefixes to make that code run in 16-bit mode. Of -course, since GNU CC only writes small-model code (it doesn't know how -to attach segment selectors to pointers like native x86 compilers do), -any 16-bit code you write with GNU CC will essentially be limited to a -64K address space. Also, there will be a code size and performance -penalty due to all the extra address and operand size prefixes GAS has -to add to the instructions. - - Note that placing GAS in 16-bit mode does not mean that the resulting -code will necessarily run on a 16-bit pre-80386 processor. To write -code that runs on such a processor, you would have to refrain from using -*any* 32-bit constructs which require GAS to output address or operand -size prefixes. At the moment this would be rather difficult, because -GAS currently supports *only* 32-bit addressing modes: when writing -16-bit code, it *always* outputs address size prefixes for any -instruction that uses a non-register addressing mode. So you can write -code that runs on 16-bit processors, but only if that code never -references memory. - - -File: as.info, Node: i386-Notes, Prev: i386-16bit, Up: i386-Dependent - -Notes ------ - - There is some trickery concerning the `mul' and `imul' instructions -that deserves mention. The 16-, 32-, and 64-bit expanding multiplies -(base opcode `0xf6'; extension 4 for `mul' and 5 for `imul') can be -output only in the one operand form. Thus, `imul %ebx, %eax' does -*not* select the expanding multiply; the expanding multiply would -clobber the `%edx' register, and this would confuse `gcc' output. Use -`imul %ebx' to get the 64-bit product in `%edx:%eax'. - - We have added a two operand form of `imul' when the first operand is -an immediate mode expression and the second operand is a register. -This is just a shorthand, so that, multiplying `%eax' by 69, for -example, can be done with `imul $69, %eax' rather than `imul $69, %eax, -%eax'. - - -File: as.info, Node: i960-Dependent, Next: M68K-Dependent, Prev: i386-Dependent, Up: Machine Dependencies - -Intel 80960 Dependent Features -============================== - -* Menu: - -* Options-i960:: i960 Command-line Options -* Floating Point-i960:: Floating Point -* Directives-i960:: i960 Machine Directives -* Opcodes for i960:: i960 Opcodes - - -File: as.info, Node: Options-i960, Next: Floating Point-i960, Up: i960-Dependent - -i960 Command-line Options -------------------------- - -`-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC' - Select the 80960 architecture. Instructions or features not - supported by the selected architecture cause fatal errors. - - `-ACA' is equivalent to `-ACA_A'; `-AKC' is equivalent to `-AMC'. - Synonyms are provided for compatibility with other tools. - - If you do not specify any of these options, `as' generates code - for any instruction or feature that is supported by *some* version - of the 960 (even if this means mixing architectures!). In - principle, `as' attempts to deduce the minimal sufficient - processor type if none is specified; depending on the object code - format, the processor type may be recorded in the object file. If - it is critical that the `as' output match a specific architecture, - specify that architecture explicitly. - -`-b' - Add code to collect information about conditional branches taken, - for later optimization using branch prediction bits. (The - conditional branch instructions have branch prediction bits in the - CA, CB, and CC architectures.) If BR represents a conditional - branch instruction, the following represents the code generated by - the assembler when `-b' is specified: - - call INCREMENT ROUTINE - .word 0 # pre-counter - Label: BR - call INCREMENT ROUTINE - .word 0 # post-counter - - The counter following a branch records the number of times that - branch was *not* taken; the differenc between the two counters is - the number of times the branch *was* taken. - - A table of every such `Label' is also generated, so that the - external postprocessor `gbr960' (supplied by Intel) can locate all - the counters. This table is always labelled `__BRANCH_TABLE__'; - this is a local symbol to permit collecting statistics for many - separate object files. The table is word aligned, and begins with - a two-word header. The first word, initialized to 0, is used in - maintaining linked lists of branch tables. The second word is a - count of the number of entries in the table, which follow - immediately: each is a word, pointing to one of the labels - illustrated above. - - +------------+------------+------------+ ... +------------+ - | | | | | | - | *NEXT | COUNT: N | *BRLAB 1 | | *BRLAB N | - | | | | | | - +------------+------------+------------+ ... +------------+ - - __BRANCH_TABLE__ layout - - The first word of the header is used to locate multiple branch - tables, since each object file may contain one. Normally the links - are maintained with a call to an initialization routine, placed at - the beginning of each function in the file. The GNU C compiler - generates these calls automatically when you give it a `-b' option. - For further details, see the documentation of `gbr960'. - -`-no-relax' - Normally, Compare-and-Branch instructions with targets that require - displacements greater than 13 bits (or that have external targets) - are replaced with the corresponding compare (or `chkbit') and - branch instructions. You can use the `-no-relax' option to - specify that `as' should generate errors instead, if the target - displacement is larger than 13 bits. - - This option does not affect the Compare-and-Jump instructions; the - code emitted for them is *always* adjusted when necessary - (depending on displacement size), regardless of whether you use - `-no-relax'. - - -File: as.info, Node: Floating Point-i960, Next: Directives-i960, Prev: Options-i960, Up: i960-Dependent - -Floating Point --------------- - - `as' generates IEEE floating-point numbers for the directives -`.float', `.double', `.extended', and `.single'. - - -File: as.info, Node: Directives-i960, Next: Opcodes for i960, Prev: Floating Point-i960, Up: i960-Dependent - -i960 Machine Directives ------------------------ - -`.bss SYMBOL, LENGTH, ALIGN' - Reserve LENGTH bytes in the bss section for a local SYMBOL, - aligned to the power of two specified by ALIGN. LENGTH and ALIGN - must be positive absolute expressions. This directive differs - from `.lcomm' only in that it permits you to specify an alignment. - *Note `.lcomm': Lcomm. - -`.extended FLONUMS' - `.extended' expects zero or more flonums, separated by commas; for - each flonum, `.extended' emits an IEEE extended-format (80-bit) - floating-point number. - -`.leafproc CALL-LAB, BAL-LAB' - You can use the `.leafproc' directive in conjunction with the - optimized `callj' instruction to enable faster calls of leaf - procedures. If a procedure is known to call no other procedures, - you may define an entry point that skips procedure prolog code - (and that does not depend on system-supplied saved context), and - declare it as the BAL-LAB using `.leafproc'. If the procedure - also has an entry point that goes through the normal prolog, you - can specify that entry point as CALL-LAB. - - A `.leafproc' declaration is meant for use in conjunction with the - optimized call instruction `callj'; the directive records the data - needed later to choose between converting the `callj' into a `bal' - or a `call'. - - CALL-LAB is optional; if only one argument is present, or if the - two arguments are identical, the single argument is assumed to be - the `bal' entry point. - -`.sysproc NAME, INDEX' - The `.sysproc' directive defines a name for a system procedure. - After you define it using `.sysproc', you can use NAME to refer to - the system procedure identified by INDEX when calling procedures - with the optimized call instruction `callj'. - - Both arguments are required; INDEX must be between 0 and 31 - (inclusive). - - -File: as.info, Node: Opcodes for i960, Prev: Directives-i960, Up: i960-Dependent - -i960 Opcodes ------------- - - All Intel 960 machine instructions are supported; *note i960 -Command-line Options: Options-i960. for a discussion of selecting the -instruction subset for a particular 960 architecture. - - Some opcodes are processed beyond simply emitting a single -corresponding instruction: `callj', and Compare-and-Branch or -Compare-and-Jump instructions with target displacements larger than 13 -bits. - -* Menu: - -* callj-i960:: `callj' -* Compare-and-branch-i960:: Compare-and-Branch - - -File: as.info, Node: callj-i960, Next: Compare-and-branch-i960, Up: Opcodes for i960 - -`callj' -....... - - You can write `callj' to have the assembler or the linker determine -the most appropriate form of subroutine call: `call', `bal', or -`calls'. If the assembly source contains enough information--a -`.leafproc' or `.sysproc' directive defining the operand--then `as' -translates the `callj'; if not, it simply emits the `callj', leaving it -for the linker to resolve. - diff --git a/gnu/dist/gas/doc/as.info-5 b/gnu/dist/gas/doc/as.info-5 deleted file mode 100644 index df56d4bb09ef..000000000000 --- a/gnu/dist/gas/doc/as.info-5 +++ /dev/null @@ -1,1270 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Compare-and-branch-i960, Prev: callj-i960, Up: Opcodes for i960 - -Compare-and-Branch -.................. - - The 960 architectures provide combined Compare-and-Branch -instructions that permit you to store the branch target in the lower 13 -bits of the instruction word itself. However, if you specify a branch -target far enough away that its address won't fit in 13 bits, the -assembler can either issue an error, or convert your Compare-and-Branch -instruction into separate instructions to do the compare and the branch. - - Whether `as' gives an error or expands the instruction depends on -two choices you can make: whether you use the `-no-relax' option, and -whether you use a "Compare and Branch" instruction or a "Compare and -Jump" instruction. The "Jump" instructions are *always* expanded if -necessary; the "Branch" instructions are expanded when necessary -*unless* you specify `-no-relax'--in which case `as' gives an error -instead. - - These are the Compare-and-Branch instructions, their "Jump" variants, -and the instruction pairs they may expand into: - - Compare and - Branch Jump Expanded to - ------ ------ ------------ - bbc chkbit; bno - bbs chkbit; bo - cmpibe cmpije cmpi; be - cmpibg cmpijg cmpi; bg - cmpibge cmpijge cmpi; bge - cmpibl cmpijl cmpi; bl - cmpible cmpijle cmpi; ble - cmpibno cmpijno cmpi; bno - cmpibne cmpijne cmpi; bne - cmpibo cmpijo cmpi; bo - cmpobe cmpoje cmpo; be - cmpobg cmpojg cmpo; bg - cmpobge cmpojge cmpo; bge - cmpobl cmpojl cmpo; bl - cmpoble cmpojle cmpo; ble - cmpobne cmpojne cmpo; bne - - -File: as.info, Node: M68K-Dependent, Next: MIPS-Dependent, Prev: i960-Dependent, Up: Machine Dependencies - -M680x0 Dependent Features -========================= - -* Menu: - -* M68K-Opts:: M680x0 Options -* M68K-Syntax:: Syntax -* M68K-Moto-Syntax:: Motorola Syntax -* M68K-Float:: Floating Point -* M68K-Directives:: 680x0 Machine Directives -* M68K-opcodes:: Opcodes - - -File: as.info, Node: M68K-Opts, Next: M68K-Syntax, Up: M68K-Dependent - -M680x0 Options --------------- - - The Motorola 680x0 version of `as' has a few machine dependent -options. - - You can use the `-l' option to shorten the size of references to -undefined symbols. If you do not use the `-l' option, references to -undefined symbols are wide enough for a full `long' (32 bits). (Since -`as' cannot know where these symbols end up, `as' can only allocate -space for the linker to fill in later. Since `as' does not know how -far away these symbols are, it allocates as much space as it can.) If -you use this option, the references are only one word wide (16 bits). -This may be useful if you want the object file to be as small as -possible, and you know that the relevant symbols are always less than -17 bits away. - - For some configurations, especially those where the compiler normally -does not prepend an underscore to the names of user variables, the -assembler requires a `%' before any use of a register name. This is -intended to let the assembler distinguish between C variables and -functions named `a0' through `a7', and so on. The `%' is always -accepted, but is not required for certain configurations, notably -`sun3'. The `--register-prefix-optional' option may be used to permit -omitting the `%' even for configurations for which it is normally -required. If this is done, it will generally be impossible to refer to -C variables and functions with the same names as register names. - - Normally the character `|' is treated as a comment character, which -means that it can not be used in expressions. The `--bitwise-or' -option turns `|' into a normal character. In this mode, you must -either use C style comments, or start comments with a `#' character at -the beginning of a line. - - If you use an addressing mode with a base register without specifying -the size, `as' will normally use the full 32 bit value. For example, -the addressing mode `%a0@(%d0)' is equivalent to `%a0@(%d0:l)'. You -may use the `--base-size-default-16' option to tell `as' to default to -using the 16 bit value. In this case, `%a0@(%d0)' is equivalent to -`%a0@(%d0:w)'. You may use the `--base-size-default-32' option to -restore the default behaviour. - - If you use an addressing mode with a displacement, and the value of -the displacement is not known, `as' will normally assume that the value -is 32 bits. For example, if the symbol `disp' has not been defined, -`as' will assemble the addressing mode `%a0@(disp,%d0)' as though -`disp' is a 32 bit value. You may use the `--disp-size-default-16' -option to tell `as' to instead assume that the displacement is 16 bits. -In this case, `as' will assemble `%a0@(disp,%d0)' as though `disp' is -a 16 bit value. You may use the `--disp-size-default-32' option to -restore the default behaviour. - - `as' can assemble code for several different members of the Motorola -680x0 family. The default depends upon how `as' was configured when it -was built; normally, the default is to assemble code for the 68020 -microprocessor. The following options may be used to change the -default. These options control which instructions and addressing modes -are permitted. The members of the 680x0 family are very similar. For -detailed information about the differences, see the Motorola manuals. - -`-m68000' -`-m68ec000' -`-m68hc000' -`-m68hc001' -`-m68008' -`-m68302' -`-m68306' -`-m68307' -`-m68322' -`-m68356' - Assemble for the 68000. `-m68008', `-m68302', and so on are - synonyms for `-m68000', since the chips are the same from the - point of view of the assembler. - -`-m68010' - Assemble for the 68010. - -`-m68020' -`-m68ec020' - Assemble for the 68020. This is normally the default. - -`-m68030' -`-m68ec030' - Assemble for the 68030. - -`-m68040' -`-m68ec040' - Assemble for the 68040. - -`-m68060' -`-m68ec060' - Assemble for the 68060. - -`-mcpu32' -`-m68330' -`-m68331' -`-m68332' -`-m68333' -`-m68334' -`-m68336' -`-m68340' -`-m68341' -`-m68349' -`-m68360' - Assemble for the CPU32 family of chips. - -`-m5200' - Assemble for the ColdFire family of chips. - -`-m68881' -`-m68882' - Assemble 68881 floating point instructions. This is the default - for the 68020, 68030, and the CPU32. The 68040 and 68060 always - support floating point instructions. - -`-mno-68881' - Do not assemble 68881 floating point instructions. This is the - default for 68000 and the 68010. The 68040 and 68060 always - support floating point instructions, even if this option is used. - -`-m68851' - Assemble 68851 MMU instructions. This is the default for the - 68020, 68030, and 68060. The 68040 accepts a somewhat different - set of MMU instructions; `-m68851' and `-m68040' should not be used - together. - -`-mno-68851' - Do not assemble 68851 MMU instructions. This is the default for - the 68000, 68010, and the CPU32. The 68040 accepts a somewhat - different set of MMU instructions. - - -File: as.info, Node: M68K-Syntax, Next: M68K-Moto-Syntax, Prev: M68K-Opts, Up: M68K-Dependent - -Syntax ------- - - This syntax for the Motorola 680x0 was developed at MIT. - - The 680x0 version of `as' uses instructions names and syntax -compatible with the Sun assembler. Intervening periods are ignored; -for example, `movl' is equivalent to `mov.l'. - - In the following table APC stands for any of the address registers -(`%a0' through `%a7'), the program counter (`%pc'), the zero-address -relative to the program counter (`%zpc'), a suppressed address register -(`%za0' through `%za7'), or it may be omitted entirely. The use of -SIZE means one of `w' or `l', and it may be omitted, along with the -leading colon, unless a scale is also specified. The use of SCALE -means one of `1', `2', `4', or `8', and it may always be omitted along -with the leading colon. - - The following addressing modes are understood: -"Immediate" - `#NUMBER' - -"Data Register" - `%d0' through `%d7' - -"Address Register" - `%a0' through `%a7' - `%a7' is also known as `%sp', i.e. the Stack Pointer. `%a6' is - also known as `%fp', the Frame Pointer. - -"Address Register Indirect" - `%a0@' through `%a7@' - -"Address Register Postincrement" - `%a0@+' through `%a7@+' - -"Address Register Predecrement" - `%a0@-' through `%a7@-' - -"Indirect Plus Offset" - `APC@(NUMBER)' - -"Index" - `APC@(NUMBER,REGISTER:SIZE:SCALE)' - - The NUMBER may be omitted. - -"Postindex" - `APC@(NUMBER)@(ONUMBER,REGISTER:SIZE:SCALE)' - - The ONUMBER or the REGISTER, but not both, may be omitted. - -"Preindex" - `APC@(NUMBER,REGISTER:SIZE:SCALE)@(ONUMBER)' - - The NUMBER may be omitted. Omitting the REGISTER produces the - Postindex addressing mode. - -"Absolute" - `SYMBOL', or `DIGITS', optionally followed by `:b', `:w', or `:l'. - - -File: as.info, Node: M68K-Moto-Syntax, Next: M68K-Float, Prev: M68K-Syntax, Up: M68K-Dependent - -Motorola Syntax ---------------- - - The standard Motorola syntax for this chip differs from the syntax -already discussed (*note Syntax: M68K-Syntax.). `as' can accept -Motorola syntax for operands, even if MIT syntax is used for other -operands in the same instruction. The two kinds of syntax are fully -compatible. - - In the following table APC stands for any of the address registers -(`%a0' through `%a7'), the program counter (`%pc'), the zero-address -relative to the program counter (`%zpc'), or a suppressed address -register (`%za0' through `%za7'). The use of SIZE means one of `w' or -`l', and it may always be omitted along with the leading dot. The use -of SCALE means one of `1', `2', `4', or `8', and it may always be -omitted along with the leading asterisk. - - The following additional addressing modes are understood: - -"Address Register Indirect" - `(%a0)' through `(%a7)' - `%a7' is also known as `%sp', i.e. the Stack Pointer. `%a6' is - also known as `%fp', the Frame Pointer. - -"Address Register Postincrement" - `(%a0)+' through `(%a7)+' - -"Address Register Predecrement" - `-(%a0)' through `-(%a7)' - -"Indirect Plus Offset" - `NUMBER(%A0)' through `NUMBER(%A7)', or `NUMBER(%PC)'. - - The NUMBER may also appear within the parentheses, as in - `(NUMBER,%A0)'. When used with the PC, the NUMBER may be omitted - (with an address register, omitting the NUMBER produces Address - Register Indirect mode). - -"Index" - `NUMBER(APC,REGISTER.SIZE*SCALE)' - - The NUMBER may be omitted, or it may appear within the - parentheses. The APC may be omitted. The REGISTER and the APC - may appear in either order. If both APC and REGISTER are address - registers, and the SIZE and SCALE are omitted, then the first - register is taken as the base register, and the second as the - index register. - -"Postindex" - `([NUMBER,APC],REGISTER.SIZE*SCALE,ONUMBER)' - - The ONUMBER, or the REGISTER, or both, may be omitted. Either the - NUMBER or the APC may be omitted, but not both. - -"Preindex" - `([NUMBER,APC,REGISTER.SIZE*SCALE],ONUMBER)' - - The NUMBER, or the APC, or the REGISTER, or any two of them, may - be omitted. The ONUMBER may be omitted. The REGISTER and the APC - may appear in either order. If both APC and REGISTER are address - registers, and the SIZE and SCALE are omitted, then the first - register is taken as the base register, and the second as the - index register. - - -File: as.info, Node: M68K-Float, Next: M68K-Directives, Prev: M68K-Moto-Syntax, Up: M68K-Dependent - -Floating Point --------------- - - Packed decimal (P) format floating literals are not supported. Feel -free to add the code! - - The floating point formats generated by directives are these. - -`.float' - `Single' precision floating point constants. - -`.double' - `Double' precision floating point constants. - -`.extend' -`.ldouble' - `Extended' precision (`long double') floating point constants. - - -File: as.info, Node: M68K-Directives, Next: M68K-opcodes, Prev: M68K-Float, Up: M68K-Dependent - -680x0 Machine Directives ------------------------- - - In order to be compatible with the Sun assembler the 680x0 assembler -understands the following directives. - -`.data1' - This directive is identical to a `.data 1' directive. - -`.data2' - This directive is identical to a `.data 2' directive. - -`.even' - This directive is a special case of the `.align' directive; it - aligns the output to an even byte boundary. - -`.skip' - This directive is identical to a `.space' directive. - - -File: as.info, Node: M68K-opcodes, Prev: M68K-Directives, Up: M68K-Dependent - -Opcodes -------- - -* Menu: - -* M68K-Branch:: Branch Improvement -* M68K-Chars:: Special Characters - - -File: as.info, Node: M68K-Branch, Next: M68K-Chars, Up: M68K-opcodes - -Branch Improvement -.................. - - Certain pseudo opcodes are permitted for branch instructions. They -expand to the shortest branch instruction that reach the target. -Generally these mnemonics are made by substituting `j' for `b' at the -start of a Motorola mnemonic. - - The following table summarizes the pseudo-operations. A `*' flags -cases that are more fully described after the table: - - Displacement - +------------------------------------------------- - | 68020 68000/10 - Pseudo-Op |BYTE WORD LONG LONG non-PC relative - +------------------------------------------------- - jbsr |bsrs bsr bsrl jsr jsr - jra |bras bra bral jmp jmp - * jXX |bXXs bXX bXXl bNXs;jmpl bNXs;jmp - * dbXX |dbXX dbXX dbXX; bra; jmpl - * fjXX |fbXXw fbXXw fbXXl fbNXw;jmp - - XX: condition - NX: negative of condition XX - - `*'--see full description below - -`jbsr' -`jra' - These are the simplest jump pseudo-operations; they always map to - one particular machine instruction, depending on the displacement - to the branch target. - -`jXX' - Here, `jXX' stands for an entire family of pseudo-operations, - where XX is a conditional branch or condition-code test. The full - list of pseudo-ops in this family is: - jhi jls jcc jcs jne jeq jvc - jvs jpl jmi jge jlt jgt jle - - For the cases of non-PC relative displacements and long - displacements on the 68000 or 68010, `as' issues a longer code - fragment in terms of NX, the opposite condition to XX. For - example, for the non-PC relative case: - jXX foo - gives - bNXs oof - jmp foo - oof: - -`dbXX' - The full family of pseudo-operations covered here is - dbhi dbls dbcc dbcs dbne dbeq dbvc - dbvs dbpl dbmi dbge dblt dbgt dble - dbf dbra dbt - - Other than for word and byte displacements, when the source reads - `dbXX foo', `as' emits - dbXX oo1 - bra oo2 - oo1:jmpl foo - oo2: - -`fjXX' - This family includes - fjne fjeq fjge fjlt fjgt fjle fjf - fjt fjgl fjgle fjnge fjngl fjngle fjngt - fjnle fjnlt fjoge fjogl fjogt fjole fjolt - fjor fjseq fjsf fjsne fjst fjueq fjuge - fjugt fjule fjult fjun - - For branch targets that are not PC relative, `as' emits - fbNX oof - jmp foo - oof: - when it encounters `fjXX foo'. - - -File: as.info, Node: M68K-Chars, Prev: M68K-Branch, Up: M68K-opcodes - -Special Characters -.................. - - The immediate character is `#' for Sun compatibility. The -line-comment character is `|' (unless the `--bitwise-or' option is -used). If a `#' appears at the beginning of a line, it is treated as a -comment unless it looks like `# line file', in which case it is treated -normally. - - -File: as.info, Node: MIPS-Dependent, Next: SH-Dependent, Prev: M68K-Dependent, Up: Machine Dependencies - -MIPS Dependent Features -======================= - - GNU `as' for MIPS architectures supports several different MIPS -processors, and MIPS ISA levels I through IV. For information about -the MIPS instruction set, see `MIPS RISC Architecture', by Kane and -Heindrich (Prentice-Hall). For an overview of MIPS assembly -conventions, see "Appendix D: Assembly Language Programming" in the -same work. - -* Menu: - -* MIPS Opts:: Assembler options -* MIPS Object:: ECOFF object code -* MIPS Stabs:: Directives for debugging information -* MIPS ISA:: Directives to override the ISA level -* MIPS autoextend:: Directives for extending MIPS 16 bit instructions -* MIPS insn:: Directive to mark data as an instruction -* MIPS option stack:: Directives to save and restore options - - -File: as.info, Node: MIPS Opts, Next: MIPS Object, Up: MIPS-Dependent - -Assembler options ------------------ - - The MIPS configurations of GNU `as' support these special options: - -`-G NUM' - This option sets the largest size of an object that can be - referenced implicitly with the `gp' register. It is only accepted - for targets that use ECOFF format. The default value is 8. - -`-EB' -`-EL' - Any MIPS configuration of `as' can select big-endian or - little-endian output at run time (unlike the other GNU development - tools, which must be configured for one or the other). Use `-EB' - to select big-endian output, and `-EL' for little-endian. - -`-mips1' -`-mips2' -`-mips3' -`-mips4' - Generate code for a particular MIPS Instruction Set Architecture - level. `-mips1' corresponds to the R2000 and R3000 processors, - `-mips2' to the R6000 processor, `-mips3' to the R4000 processor, - and `-mips4' to the R8000 and R10000 processors. You can also - switch instruction sets during the assembly; see *Note Directives - to override the ISA level: MIPS ISA. - -`-mips16' -`-no-mips16' - Generate code for the MIPS 16 processor. This is equivalent to - putting `.set mips16' at the start of the assembly file. - `-no-mips16' turns off this option. - -`-m4650' -`-no-m4650' - Generate code for the MIPS R4650 chip. This tells the assembler - to accept the `mad' and `madu' instruction, and to not schedule - `nop' instructions around accesses to the `HI' and `LO' registers. - `-no-m4650' turns off this option. - -`-m4010' -`-no-m4010' - Generate code for the LSI R4010 chip. This tells the assembler to - accept the R4010 specific instructions (`addciu', `ffc', etc.), - and to not schedule `nop' instructions around accesses to the `HI' - and `LO' registers. `-no-m4010' turns off this option. - -`-mcpu=CPU' - Generate code for a particular MIPS cpu. This has little effect - on the assembler, but it is passed by `gcc'. - -`-nocpp' - This option is ignored. It is accepted for command-line - compatibility with other assemblers, which use it to turn off C - style preprocessing. With GNU `as', there is no need for - `-nocpp', because the GNU assembler itself never runs the C - preprocessor. - -`--trap' -`--no-break' - `as' automatically macro expands certain division and - multiplication instructions to check for overflow and division by - zero. This option causes `as' to generate code to take a trap - exception rather than a break exception when an error is detected. - The trap instructions are only supported at Instruction Set - Architecture level 2 and higher. - -`--break' -`--no-trap' - Generate code to take a break exception rather than a trap - exception when an error is detected. This is the default. - - -File: as.info, Node: MIPS Object, Next: MIPS Stabs, Prev: MIPS Opts, Up: MIPS-Dependent - -MIPS ECOFF object code ----------------------- - - Assembling for a MIPS ECOFF target supports some additional sections -besides the usual `.text', `.data' and `.bss'. The additional sections -are `.rdata', used for read-only data, `.sdata', used for small data, -and `.sbss', used for small common objects. - - When assembling for ECOFF, the assembler uses the `$gp' (`$28') -register to form the address of a "small object". Any object in the -`.sdata' or `.sbss' sections is considered "small" in this sense. For -external objects, or for objects in the `.bss' section, you can use the -`gcc' `-G' option to control the size of objects addressed via `$gp'; -the default value is 8, meaning that a reference to any object eight -bytes or smaller uses `$gp'. Passing `-G 0' to `as' prevents it from -using the `$gp' register on the basis of object size (but the assembler -uses `$gp' for objects in `.sdata' or `sbss' in any case). The size of -an object in the `.bss' section is set by the `.comm' or `.lcomm' -directive that defines it. The size of an external object may be set -with the `.extern' directive. For example, `.extern sym,4' declares -that the object at `sym' is 4 bytes in length, whie leaving `sym' -otherwise undefined. - - Using small ECOFF objects requires linker support, and assumes that -the `$gp' register is correctly initialized (normally done -automatically by the startup code). MIPS ECOFF assembly code must not -modify the `$gp' register. - - -File: as.info, Node: MIPS Stabs, Next: MIPS ISA, Prev: MIPS Object, Up: MIPS-Dependent - -Directives for debugging information ------------------------------------- - - MIPS ECOFF `as' supports several directives used for generating -debugging information which are not support by traditional MIPS -assemblers. These are `.def', `.endef', `.dim', `.file', `.scl', -`.size', `.tag', `.type', `.val', `.stabd', `.stabn', and `.stabs'. -The debugging information generated by the three `.stab' directives can -only be read by GDB, not by traditional MIPS debuggers (this -enhancement is required to fully support C++ debugging). These -directives are primarily used by compilers, not assembly language -programmers! - - -File: as.info, Node: MIPS ISA, Next: MIPS autoextend, Prev: MIPS Stabs, Up: MIPS-Dependent - -Directives to override the ISA level ------------------------------------- - - GNU `as' supports an additional directive to change the MIPS -Instruction Set Architecture level on the fly: `.set mipsN'. N should -be a number from 0 to 4. A value from 1 to 4 makes the assembler -accept instructions for the corresponding ISA level, from that point on -in the assembly. `.set mipsN' affects not only which instructions are -permitted, but also how certain macros are expanded. `.set mips0' -restores the ISA level to its original level: either the level you -selected with command line options, or the default for your -configuration. You can use this feature to permit specific R4000 -instructions while assembling in 32 bit mode. Use this directive with -care! - - The directive `.set mips16' puts the assembler into MIPS 16 mode, in -which it will assemble instructions for the MIPS 16 processor. Use -`.set nomips16' to return to normal 32 bit mode. - - Traditional MIPS assemblers do not support this directive. - - -File: as.info, Node: MIPS autoextend, Next: MIPS insn, Prev: MIPS ISA, Up: MIPS-Dependent - -Directives for extending MIPS 16 bit instructions -------------------------------------------------- - - By default, MIPS 16 instructions are automatically extended to 32 -bits when necessary. The directive `.set noautoextend' will turn this -off. When `.set noautoextend' is in effect, any 32 bit instruction -must be explicitly extended with the `.e' modifier (e.g., `li.e -$4,1000'). The directive `.set autoextend' may be used to once again -automatically extend instructions when necessary. - - This directive is only meaningful when in MIPS 16 mode. Traditional -MIPS assemblers do not support this directive. - - -File: as.info, Node: MIPS insn, Next: MIPS option stack, Prev: MIPS autoextend, Up: MIPS-Dependent - -Directive to mark data as an instruction ----------------------------------------- - - The `.insn' directive tells `as' that the following data is actually -instructions. This makes a difference in MIPS 16 mode: when loading -the address of a label which precedes instructions, `as' automatically -adds 1 to the value, so that jumping to the loaded address will do the -right thing. - - -File: as.info, Node: MIPS option stack, Prev: MIPS insn, Up: MIPS-Dependent - -Directives to save and restore options --------------------------------------- - - The directives `.set push' and `.set pop' may be used to save and -restore the current settings for all the options which are controlled -by `.set'. The `.set push' directive saves the current settings on a -stack. The `.set pop' directive pops the stack and restores the -settings. - - These directives can be useful inside an macro which must change an -option such as the ISA level or instruction reordering but does not want -to change the state of the code which invoked the macro. - - Traditional MIPS assemblers do not support these directives. - - -File: as.info, Node: SH-Dependent, Next: Sparc-Dependent, Prev: MIPS-Dependent, Up: Machine Dependencies - -Hitachi SH Dependent Features -============================= - -* Menu: - -* SH Options:: Options -* SH Syntax:: Syntax -* SH Floating Point:: Floating Point -* SH Directives:: SH Machine Directives -* SH Opcodes:: Opcodes - - -File: as.info, Node: SH Options, Next: SH Syntax, Up: SH-Dependent - -Options -------- - - `as' has no additional command-line options for the Hitachi SH -family. - - -File: as.info, Node: SH Syntax, Next: SH Floating Point, Prev: SH Options, Up: SH-Dependent - -Syntax ------- - -* Menu: - -* SH-Chars:: Special Characters -* SH-Regs:: Register Names -* SH-Addressing:: Addressing Modes - - -File: as.info, Node: SH-Chars, Next: SH-Regs, Up: SH Syntax - -Special Characters -.................. - - `!' is the line comment character. - - You can use `;' instead of a newline to separate statements. - - Since `$' has no special meaning, you may use it in symbol names. - - -File: as.info, Node: SH-Regs, Next: SH-Addressing, Prev: SH-Chars, Up: SH Syntax - -Register Names -.............. - - You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', -`r5', `r6', `r7', `r8', `r9', `r10', `r11', `r12', `r13', `r14', and -`r15' to refer to the SH registers. - - The SH also has these control registers: - -`pr' - procedure register (holds return address) - -`pc' - program counter - -`mach' -`macl' - high and low multiply accumulator registers - -`sr' - status register - -`gbr' - global base register - -`vbr' - vector base register (for interrupt vectors) - - -File: as.info, Node: SH-Addressing, Prev: SH-Regs, Up: SH Syntax - -Addressing Modes -................ - - `as' understands the following addressing modes for the SH. `RN' in -the following refers to any of the numbered registers, but *not* the -control registers. - -`RN' - Register direct - -`@RN' - Register indirect - -`@-RN' - Register indirect with pre-decrement - -`@RN+' - Register indirect with post-increment - -`@(DISP, RN)' - Register indirect with displacement - -`@(R0, RN)' - Register indexed - -`@(DISP, GBR)' - `GBR' offset - -`@(R0, GBR)' - GBR indexed - -`ADDR' -`@(DISP, PC)' - PC relative address (for branch or for addressing memory). The - `as' implementation allows you to use the simpler form ADDR - anywhere a PC relative address is called for; the alternate form - is supported for compatibility with other assemblers. - -`#IMM' - Immediate data - - -File: as.info, Node: SH Floating Point, Next: SH Directives, Prev: SH Syntax, Up: SH-Dependent - -Floating Point --------------- - - The SH family has no hardware floating point, but the `.float' -directive generates IEEE floating-point numbers for compatibility with -other development tools. - - -File: as.info, Node: SH Directives, Next: SH Opcodes, Prev: SH Floating Point, Up: SH-Dependent - -SH Machine Directives ---------------------- - -`uaword' -`ualong' - `as' will issue a warning when a misaligned `.word' or `.long' - directive is used. You may use `.uaword' or `.ualong' to indicate - that the value is intentionally misaligned. - - -File: as.info, Node: SH Opcodes, Prev: SH Directives, Up: SH-Dependent - -Opcodes -------- - - For detailed information on the SH machine instruction set, see -`SH-Microcomputer User's Manual' (Hitachi Micro Systems, Inc.). - - `as' implements all the standard SH opcodes. No additional -pseudo-instructions are needed on this family. Note, however, that -because `as' supports a simpler form of PC-relative addressing, you may -simply write (for example) - - mov.l bar,r0 - -where other assemblers might require an explicit displacement to `bar' -from the program counter: - - mov.l @(DISP, PC) - - Here is a summary of SH opcodes: - - Legend: - Rn a numbered register - Rm another numbered register - #imm immediate data - disp displacement - disp8 8-bit displacement - disp12 12-bit displacement - - add #imm,Rn lds.l @Rn+,PR - add Rm,Rn mac.w @Rm+,@Rn+ - addc Rm,Rn mov #imm,Rn - addv Rm,Rn mov Rm,Rn - and #imm,R0 mov.b Rm,@(R0,Rn) - and Rm,Rn mov.b Rm,@-Rn - and.b #imm,@(R0,GBR) mov.b Rm,@Rn - bf disp8 mov.b @(disp,Rm),R0 - bra disp12 mov.b @(disp,GBR),R0 - bsr disp12 mov.b @(R0,Rm),Rn - bt disp8 mov.b @Rm+,Rn - clrmac mov.b @Rm,Rn - clrt mov.b R0,@(disp,Rm) - cmp/eq #imm,R0 mov.b R0,@(disp,GBR) - cmp/eq Rm,Rn mov.l Rm,@(disp,Rn) - cmp/ge Rm,Rn mov.l Rm,@(R0,Rn) - cmp/gt Rm,Rn mov.l Rm,@-Rn - cmp/hi Rm,Rn mov.l Rm,@Rn - cmp/hs Rm,Rn mov.l @(disp,Rn),Rm - cmp/pl Rn mov.l @(disp,GBR),R0 - cmp/pz Rn mov.l @(disp,PC),Rn - cmp/str Rm,Rn mov.l @(R0,Rm),Rn - div0s Rm,Rn mov.l @Rm+,Rn - div0u mov.l @Rm,Rn - div1 Rm,Rn mov.l R0,@(disp,GBR) - exts.b Rm,Rn mov.w Rm,@(R0,Rn) - exts.w Rm,Rn mov.w Rm,@-Rn - extu.b Rm,Rn mov.w Rm,@Rn - extu.w Rm,Rn mov.w @(disp,Rm),R0 - jmp @Rn mov.w @(disp,GBR),R0 - jsr @Rn mov.w @(disp,PC),Rn - ldc Rn,GBR mov.w @(R0,Rm),Rn - ldc Rn,SR mov.w @Rm+,Rn - ldc Rn,VBR mov.w @Rm,Rn - ldc.l @Rn+,GBR mov.w R0,@(disp,Rm) - ldc.l @Rn+,SR mov.w R0,@(disp,GBR) - ldc.l @Rn+,VBR mova @(disp,PC),R0 - lds Rn,MACH movt Rn - lds Rn,MACL muls Rm,Rn - lds Rn,PR mulu Rm,Rn - lds.l @Rn+,MACH neg Rm,Rn - lds.l @Rn+,MACL negc Rm,Rn - - nop stc VBR,Rn - not Rm,Rn stc.l GBR,@-Rn - or #imm,R0 stc.l SR,@-Rn - or Rm,Rn stc.l VBR,@-Rn - or.b #imm,@(R0,GBR) sts MACH,Rn - rotcl Rn sts MACL,Rn - rotcr Rn sts PR,Rn - rotl Rn sts.l MACH,@-Rn - rotr Rn sts.l MACL,@-Rn - rte sts.l PR,@-Rn - rts sub Rm,Rn - sett subc Rm,Rn - shal Rn subv Rm,Rn - shar Rn swap.b Rm,Rn - shll Rn swap.w Rm,Rn - shll16 Rn tas.b @Rn - shll2 Rn trapa #imm - shll8 Rn tst #imm,R0 - shlr Rn tst Rm,Rn - shlr16 Rn tst.b #imm,@(R0,GBR) - shlr2 Rn xor #imm,R0 - shlr8 Rn xor Rm,Rn - sleep xor.b #imm,@(R0,GBR) - stc GBR,Rn xtrct Rm,Rn - stc SR,Rn - - -File: as.info, Node: Sparc-Dependent, Next: V850-Dependent, Prev: SH-Dependent, Up: Machine Dependencies - -SPARC Dependent Features -======================== - -* Menu: - -* Sparc-Opts:: Options -* Sparc-Aligned-Data:: Option to enforce aligned data -* Sparc-Float:: Floating Point -* Sparc-Directives:: Sparc Machine Directives - - -File: as.info, Node: Sparc-Opts, Next: Sparc-Aligned-Data, Up: Sparc-Dependent - -Options -------- - - The SPARC chip family includes several successive levels, using the -same core instruction set, but including a few additional instructions -at each level. There are exceptions to this however. For details on -what instructions each variant supports, please see the chip's -architecture reference manual. - - By default, `as' assumes the core instruction set (SPARC v6), but -"bumps" the architecture level as needed: it switches to successively -higher architectures as it encounters instructions that only exist in -the higher levels. - - If not configured for SPARC v9 (`sparc64-*-*') GAS will not bump -passed sparclite by default, an option must be passed to enable the v9 -instructions. - - GAS treats sparclite as being compatible with v8, unless an -architecture is explicitly requested. SPARC v9 is always incompatible -with sparclite. - -`-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite' -`-Av8plus | -Av8plusa | -Av9 | -Av9a' - Use one of the `-A' options to select one of the SPARC - architectures explicitly. If you select an architecture - explicitly, `as' reports a fatal error if it encounters an - instruction or feature requiring an incompatible or higher level. - - `-Av8plus' and `-Av8plusa' select a 32 bit environment. - - `-Av9' and `-Av9a' select a 64 bit environment and are not - available unless GAS is explicitly configured with 64 bit - environment support. - - `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with - UltraSPARC extensions. - -`-xarch=v8plus | -xarch=v8plusa' - For compatibility with the Solaris v9 assembler. These options are - equivalent to -Av8plus and -Av8plusa, respectively. - -`-bump' - Warn whenever it is necessary to switch to another level. If an - architecture level is explicitly requested, GAS will not issue - warnings until that level is reached, and will then bump the level - as required (except between incompatible levels). - -`-32 | -64' - Select the word size, either 32 bits or 64 bits. These options - are only available with the ELF object file format, and require - that the necessary BFD support has been included. - - -File: as.info, Node: Sparc-Aligned-Data, Next: Sparc-Float, Prev: Sparc-Opts, Up: Sparc-Dependent - -Enforcing aligned data ----------------------- - - SPARC GAS normally permits data to be misaligned. For example, it -permits the `.long' pseudo-op to be used on a byte boundary. However, -the native SunOS and Solaris assemblers issue an error when they see -misaligned data. - - You can use the `--enforce-aligned-data' option to make SPARC GAS -also issue an error about misaligned data, just as the SunOS and Solaris -assemblers do. - - The `--enforce-aligned-data' option is not the default because gcc -issues misaligned data pseudo-ops when it initializes certain packed -data structures (structures defined using the `packed' attribute). You -may have to assemble with GAS in order to initialize packed data -structures in your own code. - - -File: as.info, Node: Sparc-Float, Next: Sparc-Directives, Prev: Sparc-Aligned-Data, Up: Sparc-Dependent - -Floating Point --------------- - - The Sparc uses IEEE floating-point numbers. - - -File: as.info, Node: Sparc-Directives, Prev: Sparc-Float, Up: Sparc-Dependent - -Sparc Machine Directives ------------------------- - - The Sparc version of `as' supports the following additional machine -directives: - -`.align' - This must be followed by the desired alignment in bytes. - -`.common' - This must be followed by a symbol name, a positive number, and - `"bss"'. This behaves somewhat like `.comm', but the syntax is - different. - -`.half' - This is functionally identical to `.short'. - -`.proc' - This directive is ignored. Any text following it on the same line - is also ignored. - -`.reserve' - This must be followed by a symbol name, a positive number, and - `"bss"'. This behaves somewhat like `.lcomm', but the syntax is - different. - -`.seg' - This must be followed by `"text"', `"data"', or `"data1"'. It - behaves like `.text', `.data', or `.data 1'. - -`.skip' - This is functionally identical to the `.space' directive. - -`.word' - On the Sparc, the `.word' directive produces 32 bit values, - instead of the 16 bit values it produces on many other machines. - -`.xword' - On the Sparc V9 processor, the `.xword' directive produces 64 bit - values. - - -File: as.info, Node: Z8000-Dependent, Next: Vax-Dependent, Prev: V850-Dependent, Up: Machine Dependencies - -Z8000 Dependent Features -======================== - - The Z8000 as supports both members of the Z8000 family: the -unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with -24 bit addresses. - - When the assembler is in unsegmented mode (specified with the -`unsegm' directive), an address takes up one word (16 bit) sized -register. When the assembler is in segmented mode (specified with the -`segm' directive), a 24-bit address takes up a long (32 bit) register. -*Note Assembler Directives for the Z8000: Z8000 Directives, for a list -of other Z8000 specific assembler directives. - -* Menu: - -* Z8000 Options:: No special command-line options for Z8000 -* Z8000 Syntax:: Assembler syntax for the Z8000 -* Z8000 Directives:: Special directives for the Z8000 -* Z8000 Opcodes:: Opcodes - - -File: as.info, Node: Z8000 Options, Next: Z8000 Syntax, Up: Z8000-Dependent - -Options -------- - - `as' has no additional command-line options for the Zilog Z8000 -family. - - -File: as.info, Node: Z8000 Syntax, Next: Z8000 Directives, Prev: Z8000 Options, Up: Z8000-Dependent - -Syntax ------- - -* Menu: - -* Z8000-Chars:: Special Characters -* Z8000-Regs:: Register Names -* Z8000-Addressing:: Addressing Modes - - -File: as.info, Node: Z8000-Chars, Next: Z8000-Regs, Up: Z8000 Syntax - -Special Characters -.................. - - `!' is the line comment character. - - You can use `;' instead of a newline to separate statements. - - -File: as.info, Node: Z8000-Regs, Next: Z8000-Addressing, Prev: Z8000-Chars, Up: Z8000 Syntax - -Register Names -.............. - - The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can -refer to different sized groups of registers by register number, with -the prefix `r' for 16 bit registers, `rr' for 32 bit registers and `rq' -for 64 bit registers. You can also refer to the contents of the first -eight (of the sixteen 16 bit registers) by bytes. They are named `rNh' -and `rNl'. - -*byte registers* - r0l r0h r1h r1l r2h r2l r3h r3l - r4h r4l r5h r5l r6h r6l r7h r7l -*word registers* - r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 -*long word registers* - rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14 -*quad word registers* - rq0 rq4 rq8 rq12 - - -File: as.info, Node: Z8000-Addressing, Prev: Z8000-Regs, Up: Z8000 Syntax - -Addressing Modes -................ - - as understands the following addressing modes for the Z8000: - -`rN' - Register direct - -`@rN' - Indirect register - -`ADDR' - Direct: the 16 bit or 24 bit address (depending on whether the - assembler is in segmented or unsegmented mode) of the operand is - in the instruction. - -`address(rN)' - Indexed: the 16 or 24 bit address is added to the 16 bit register - to produce the final address in memory of the operand. - -`rN(#IMM)' - Base Address: the 16 or 24 bit register is added to the 16 bit sign - extended immediate displacement to produce the final address in - memory of the operand. - -`rN(rM)' - Base Index: the 16 or 24 bit register rN is added to the sign - extended 16 bit index register rM to produce the final address in - memory of the operand. - -`#XX' - Immediate data XX. - - -File: as.info, Node: Z8000 Directives, Next: Z8000 Opcodes, Prev: Z8000 Syntax, Up: Z8000-Dependent - -Assembler Directives for the Z8000 ----------------------------------- - - The Z8000 port of as includes these additional assembler directives, -for compatibility with other Z8000 assemblers. As shown, these do not -begin with `.' (unlike the ordinary as directives). - -`segm' - Generates code for the segmented Z8001. - -`unsegm' - Generates code for the unsegmented Z8002. - -`name' - Synonym for `.file' - -`global' - Synonym for `.global' - -`wval' - Synonym for `.word' - -`lval' - Synonym for `.long' - -`bval' - Synonym for `.byte' - -`sval' - Assemble a string. `sval' expects one string literal, delimited by - single quotes. It assembles each byte of the string into - consecutive addresses. You can use the escape sequence `%XX' - (where XX represents a two-digit hexadecimal number) to represent - the character whose ASCII value is XX. Use this feature to - describe single quote and other characters that may not appear in - string literals as themselves. For example, the C statement - `char *a = "he said \"it's 50% off\"";' is represented in Z8000 - assembly language (shown with the assembler output in hex at the - left) as - - 68652073 sval 'he said %22it%27s 50%25 off%22%00' - 61696420 - 22697427 - 73203530 - 25206F66 - 662200 - -`rsect' - synonym for `.section' - -`block' - synonym for `.space' - -`even' - special case of `.align'; aligns output to even byte boundary. - diff --git a/gnu/dist/gas/doc/as.info-6 b/gnu/dist/gas/doc/as.info-6 deleted file mode 100644 index b980f124c876..000000000000 --- a/gnu/dist/gas/doc/as.info-6 +++ /dev/null @@ -1,1051 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Z8000 Opcodes, Prev: Z8000 Directives, Up: Z8000-Dependent - -Opcodes -------- - - For detailed information on the Z8000 machine instruction set, see -`Z8000 Technical Manual'. - - The following table summarizes the opcodes and their arguments: - - rs 16 bit source register - rd 16 bit destination register - rbs 8 bit source register - rbd 8 bit destination register - rrs 32 bit source register - rrd 32 bit destination register - rqs 64 bit source register - rqd 64 bit destination register - addr 16/24 bit address - imm immediate data - - adc rd,rs clrb addr cpsir @rd,@rs,rr,cc - adcb rbd,rbs clrb addr(rd) cpsirb @rd,@rs,rr,cc - add rd,@rs clrb rbd dab rbd - add rd,addr com @rd dbjnz rbd,disp7 - add rd,addr(rs) com addr dec @rd,imm4m1 - add rd,imm16 com addr(rd) dec addr(rd),imm4m1 - add rd,rs com rd dec addr,imm4m1 - addb rbd,@rs comb @rd dec rd,imm4m1 - addb rbd,addr comb addr decb @rd,imm4m1 - addb rbd,addr(rs) comb addr(rd) decb addr(rd),imm4m1 - addb rbd,imm8 comb rbd decb addr,imm4m1 - addb rbd,rbs comflg flags decb rbd,imm4m1 - addl rrd,@rs cp @rd,imm16 di i2 - addl rrd,addr cp addr(rd),imm16 div rrd,@rs - addl rrd,addr(rs) cp addr,imm16 div rrd,addr - addl rrd,imm32 cp rd,@rs div rrd,addr(rs) - addl rrd,rrs cp rd,addr div rrd,imm16 - and rd,@rs cp rd,addr(rs) div rrd,rs - and rd,addr cp rd,imm16 divl rqd,@rs - and rd,addr(rs) cp rd,rs divl rqd,addr - and rd,imm16 cpb @rd,imm8 divl rqd,addr(rs) - and rd,rs cpb addr(rd),imm8 divl rqd,imm32 - andb rbd,@rs cpb addr,imm8 divl rqd,rrs - andb rbd,addr cpb rbd,@rs djnz rd,disp7 - andb rbd,addr(rs) cpb rbd,addr ei i2 - andb rbd,imm8 cpb rbd,addr(rs) ex rd,@rs - andb rbd,rbs cpb rbd,imm8 ex rd,addr - bit @rd,imm4 cpb rbd,rbs ex rd,addr(rs) - bit addr(rd),imm4 cpd rd,@rs,rr,cc ex rd,rs - bit addr,imm4 cpdb rbd,@rs,rr,cc exb rbd,@rs - bit rd,imm4 cpdr rd,@rs,rr,cc exb rbd,addr - bit rd,rs cpdrb rbd,@rs,rr,cc exb rbd,addr(rs) - bitb @rd,imm4 cpi rd,@rs,rr,cc exb rbd,rbs - bitb addr(rd),imm4 cpib rbd,@rs,rr,cc ext0e imm8 - bitb addr,imm4 cpir rd,@rs,rr,cc ext0f imm8 - bitb rbd,imm4 cpirb rbd,@rs,rr,cc ext8e imm8 - bitb rbd,rs cpl rrd,@rs ext8f imm8 - bpt cpl rrd,addr exts rrd - call @rd cpl rrd,addr(rs) extsb rd - call addr cpl rrd,imm32 extsl rqd - call addr(rd) cpl rrd,rrs halt - calr disp12 cpsd @rd,@rs,rr,cc in rd,@rs - clr @rd cpsdb @rd,@rs,rr,cc in rd,imm16 - clr addr cpsdr @rd,@rs,rr,cc inb rbd,@rs - clr addr(rd) cpsdrb @rd,@rs,rr,cc inb rbd,imm16 - clr rd cpsi @rd,@rs,rr,cc inc @rd,imm4m1 - clrb @rd cpsib @rd,@rs,rr,cc inc addr(rd),imm4m1 - inc addr,imm4m1 ldb rbd,rs(rx) mult rrd,addr(rs) - inc rd,imm4m1 ldb rd(imm16),rbs mult rrd,imm16 - incb @rd,imm4m1 ldb rd(rx),rbs mult rrd,rs - incb addr(rd),imm4m1 ldctl ctrl,rs multl rqd,@rs - incb addr,imm4m1 ldctl rd,ctrl multl rqd,addr - incb rbd,imm4m1 ldd @rs,@rd,rr multl rqd,addr(rs) - ind @rd,@rs,ra lddb @rs,@rd,rr multl rqd,imm32 - indb @rd,@rs,rba lddr @rs,@rd,rr multl rqd,rrs - inib @rd,@rs,ra lddrb @rs,@rd,rr neg @rd - inibr @rd,@rs,ra ldi @rd,@rs,rr neg addr - iret ldib @rd,@rs,rr neg addr(rd) - jp cc,@rd ldir @rd,@rs,rr neg rd - jp cc,addr ldirb @rd,@rs,rr negb @rd - jp cc,addr(rd) ldk rd,imm4 negb addr - jr cc,disp8 ldl @rd,rrs negb addr(rd) - ld @rd,imm16 ldl addr(rd),rrs negb rbd - ld @rd,rs ldl addr,rrs nop - ld addr(rd),imm16 ldl rd(imm16),rrs or rd,@rs - ld addr(rd),rs ldl rd(rx),rrs or rd,addr - ld addr,imm16 ldl rrd,@rs or rd,addr(rs) - ld addr,rs ldl rrd,addr or rd,imm16 - ld rd(imm16),rs ldl rrd,addr(rs) or rd,rs - ld rd(rx),rs ldl rrd,imm32 orb rbd,@rs - ld rd,@rs ldl rrd,rrs orb rbd,addr - ld rd,addr ldl rrd,rs(imm16) orb rbd,addr(rs) - ld rd,addr(rs) ldl rrd,rs(rx) orb rbd,imm8 - ld rd,imm16 ldm @rd,rs,n orb rbd,rbs - ld rd,rs ldm addr(rd),rs,n out @rd,rs - ld rd,rs(imm16) ldm addr,rs,n out imm16,rs - ld rd,rs(rx) ldm rd,@rs,n outb @rd,rbs - lda rd,addr ldm rd,addr(rs),n outb imm16,rbs - lda rd,addr(rs) ldm rd,addr,n outd @rd,@rs,ra - lda rd,rs(imm16) ldps @rs outdb @rd,@rs,rba - lda rd,rs(rx) ldps addr outib @rd,@rs,ra - ldar rd,disp16 ldps addr(rs) outibr @rd,@rs,ra - ldb @rd,imm8 ldr disp16,rs pop @rd,@rs - ldb @rd,rbs ldr rd,disp16 pop addr(rd),@rs - ldb addr(rd),imm8 ldrb disp16,rbs pop addr,@rs - ldb addr(rd),rbs ldrb rbd,disp16 pop rd,@rs - ldb addr,imm8 ldrl disp16,rrs popl @rd,@rs - ldb addr,rbs ldrl rrd,disp16 popl addr(rd),@rs - ldb rbd,@rs mbit popl addr,@rs - ldb rbd,addr mreq rd popl rrd,@rs - ldb rbd,addr(rs) mres push @rd,@rs - ldb rbd,imm8 mset push @rd,addr - ldb rbd,rbs mult rrd,@rs push @rd,addr(rs) - ldb rbd,rs(imm16) mult rrd,addr push @rd,imm16 - push @rd,rs set addr,imm4 subl rrd,imm32 - pushl @rd,@rs set rd,imm4 subl rrd,rrs - pushl @rd,addr set rd,rs tcc cc,rd - pushl @rd,addr(rs) setb @rd,imm4 tccb cc,rbd - pushl @rd,rrs setb addr(rd),imm4 test @rd - res @rd,imm4 setb addr,imm4 test addr - res addr(rd),imm4 setb rbd,imm4 test addr(rd) - res addr,imm4 setb rbd,rs test rd - res rd,imm4 setflg imm4 testb @rd - res rd,rs sinb rbd,imm16 testb addr - resb @rd,imm4 sinb rd,imm16 testb addr(rd) - resb addr(rd),imm4 sind @rd,@rs,ra testb rbd - resb addr,imm4 sindb @rd,@rs,rba testl @rd - resb rbd,imm4 sinib @rd,@rs,ra testl addr - resb rbd,rs sinibr @rd,@rs,ra testl addr(rd) - resflg imm4 sla rd,imm8 testl rrd - ret cc slab rbd,imm8 trdb @rd,@rs,rba - rl rd,imm1or2 slal rrd,imm8 trdrb @rd,@rs,rba - rlb rbd,imm1or2 sll rd,imm8 trib @rd,@rs,rbr - rlc rd,imm1or2 sllb rbd,imm8 trirb @rd,@rs,rbr - rlcb rbd,imm1or2 slll rrd,imm8 trtdrb @ra,@rb,rbr - rldb rbb,rba sout imm16,rs trtib @ra,@rb,rr - rr rd,imm1or2 soutb imm16,rbs trtirb @ra,@rb,rbr - rrb rbd,imm1or2 soutd @rd,@rs,ra trtrb @ra,@rb,rbr - rrc rd,imm1or2 soutdb @rd,@rs,rba tset @rd - rrcb rbd,imm1or2 soutib @rd,@rs,ra tset addr - rrdb rbb,rba soutibr @rd,@rs,ra tset addr(rd) - rsvd36 sra rd,imm8 tset rd - rsvd38 srab rbd,imm8 tsetb @rd - rsvd78 sral rrd,imm8 tsetb addr - rsvd7e srl rd,imm8 tsetb addr(rd) - rsvd9d srlb rbd,imm8 tsetb rbd - rsvd9f srll rrd,imm8 xor rd,@rs - rsvdb9 sub rd,@rs xor rd,addr - rsvdbf sub rd,addr xor rd,addr(rs) - sbc rd,rs sub rd,addr(rs) xor rd,imm16 - sbcb rbd,rbs sub rd,imm16 xor rd,rs - sc imm8 sub rd,rs xorb rbd,@rs - sda rd,rs subb rbd,@rs xorb rbd,addr - sdab rbd,rs subb rbd,addr xorb rbd,addr(rs) - sdal rrd,rs subb rbd,addr(rs) xorb rbd,imm8 - sdl rd,rs subb rbd,imm8 xorb rbd,rbs - sdlb rbd,rs subb rbd,rbs xorb rbd,rbs - sdll rrd,rs subl rrd,@rs - set @rd,imm4 subl rrd,addr - set addr(rd),imm4 subl rrd,addr(rs) - - -File: as.info, Node: Vax-Dependent, Prev: Z8000-Dependent, Up: Machine Dependencies - -VAX Dependent Features -====================== - -* Menu: - -* VAX-Opts:: VAX Command-Line Options -* VAX-float:: VAX Floating Point -* VAX-directives:: Vax Machine Directives -* VAX-opcodes:: VAX Opcodes -* VAX-branch:: VAX Branch Improvement -* VAX-operands:: VAX Operands -* VAX-no:: Not Supported on VAX - - -File: as.info, Node: VAX-Opts, Next: VAX-float, Up: Vax-Dependent - -VAX Command-Line Options ------------------------- - - The Vax version of `as' accepts any of the following options, gives -a warning message that the option was ignored and proceeds. These -options are for compatibility with scripts designed for other people's -assemblers. - -``-D' (Debug)' -``-S' (Symbol Table)' -``-T' (Token Trace)' - These are obsolete options used to debug old assemblers. - -``-d' (Displacement size for JUMPs)' - This option expects a number following the `-d'. Like options - that expect filenames, the number may immediately follow the `-d' - (old standard) or constitute the whole of the command line - argument that follows `-d' (GNU standard). - -``-V' (Virtualize Interpass Temporary File)' - Some other assemblers use a temporary file. This option commanded - them to keep the information in active memory rather than in a - disk file. `as' always does this, so this option is redundant. - -``-J' (JUMPify Longer Branches)' - Many 32-bit computers permit a variety of branch instructions to - do the same job. Some of these instructions are short (and fast) - but have a limited range; others are long (and slow) but can - branch anywhere in virtual memory. Often there are 3 flavors of - branch: short, medium and long. Some other assemblers would emit - short and medium branches, unless told by this option to emit - short and long branches. - -``-t' (Temporary File Directory)' - Some other assemblers may use a temporary file, and this option - takes a filename being the directory to site the temporary file. - Since `as' does not use a temporary disk file, this option makes - no difference. `-t' needs exactly one filename. - - The Vax version of the assembler accepts two options when compiled -for VMS. They are `-h', and `-+'. The `-h' option prevents `as' from -modifying the symbol-table entries for symbols that contain lowercase -characters (I think). The `-+' option causes `as' to print warning -messages if the FILENAME part of the object file, or any symbol name is -larger than 31 characters. The `-+' option also inserts some code -following the `_main' symbol so that the object file is compatible with -Vax-11 "C". - - -File: as.info, Node: VAX-float, Next: VAX-directives, Prev: VAX-Opts, Up: Vax-Dependent - -VAX Floating Point ------------------- - - Conversion of flonums to floating point is correct, and compatible -with previous assemblers. Rounding is towards zero if the remainder is -exactly half the least significant bit. - - `D', `F', `G' and `H' floating point formats are understood. - - Immediate floating literals (*e.g.* `S`$6.9') are rendered -correctly. Again, rounding is towards zero in the boundary case. - - The `.float' directive produces `f' format numbers. The `.double' -directive produces `d' format numbers. - - -File: as.info, Node: VAX-directives, Next: VAX-opcodes, Prev: VAX-float, Up: Vax-Dependent - -Vax Machine Directives ----------------------- - - The Vax version of the assembler supports four directives for -generating Vax floating point constants. They are described in the -table below. - -`.dfloat' - This expects zero or more flonums, separated by commas, and - assembles Vax `d' format 64-bit floating point constants. - -`.ffloat' - This expects zero or more flonums, separated by commas, and - assembles Vax `f' format 32-bit floating point constants. - -`.gfloat' - This expects zero or more flonums, separated by commas, and - assembles Vax `g' format 64-bit floating point constants. - -`.hfloat' - This expects zero or more flonums, separated by commas, and - assembles Vax `h' format 128-bit floating point constants. - - -File: as.info, Node: VAX-opcodes, Next: VAX-branch, Prev: VAX-directives, Up: Vax-Dependent - -VAX Opcodes ------------ - - All DEC mnemonics are supported. Beware that `case...' -instructions have exactly 3 operands. The dispatch table that follows -the `case...' instruction should be made with `.word' statements. This -is compatible with all unix assemblers we know of. - - -File: as.info, Node: VAX-branch, Next: VAX-operands, Prev: VAX-opcodes, Up: Vax-Dependent - -VAX Branch Improvement ----------------------- - - Certain pseudo opcodes are permitted. They are for branch -instructions. They expand to the shortest branch instruction that -reaches the target. Generally these mnemonics are made by substituting -`j' for `b' at the start of a DEC mnemonic. This feature is included -both for compatibility and to help compilers. If you do not need this -feature, avoid these opcodes. Here are the mnemonics, and the code -they can expand into. - -`jbsb' - `Jsb' is already an instruction mnemonic, so we chose `jbsb'. - (byte displacement) - `bsbb ...' - - (word displacement) - `bsbw ...' - - (long displacement) - `jsb ...' - -`jbr' -`jr' - Unconditional branch. - (byte displacement) - `brb ...' - - (word displacement) - `brw ...' - - (long displacement) - `jmp ...' - -`jCOND' - COND may be any one of the conditional branches `neq', `nequ', - `eql', `eqlu', `gtr', `geq', `lss', `gtru', `lequ', `vc', `vs', - `gequ', `cc', `lssu', `cs'. COND may also be one of the bit tests - `bs', `bc', `bss', `bcs', `bsc', `bcc', `bssi', `bcci', `lbs', - `lbc'. NOTCOND is the opposite condition to COND. - (byte displacement) - `bCOND ...' - - (word displacement) - `bNOTCOND foo ; brw ... ; foo:' - - (long displacement) - `bNOTCOND foo ; jmp ... ; foo:' - -`jacbX' - X may be one of `b d f g h l w'. - (word displacement) - `OPCODE ...' - - (long displacement) - OPCODE ..., foo ; - brb bar ; - foo: jmp ... ; - bar: - -`jaobYYY' - YYY may be one of `lss leq'. - -`jsobZZZ' - ZZZ may be one of `geq gtr'. - (byte displacement) - `OPCODE ...' - - (word displacement) - OPCODE ..., foo ; - brb bar ; - foo: brw DESTINATION ; - bar: - - (long displacement) - OPCODE ..., foo ; - brb bar ; - foo: jmp DESTINATION ; - bar: - -`aobleq' -`aoblss' -`sobgeq' -`sobgtr' - - (byte displacement) - `OPCODE ...' - - (word displacement) - OPCODE ..., foo ; - brb bar ; - foo: brw DESTINATION ; - bar: - - (long displacement) - OPCODE ..., foo ; - brb bar ; - foo: jmp DESTINATION ; - bar: - - -File: as.info, Node: VAX-operands, Next: VAX-no, Prev: VAX-branch, Up: Vax-Dependent - -VAX Operands ------------- - - The immediate character is `$' for Unix compatibility, not `#' as -DEC writes it. - - The indirect character is `*' for Unix compatibility, not `@' as DEC -writes it. - - The displacement sizing character is ``' (an accent grave) for Unix -compatibility, not `^' as DEC writes it. The letter preceding ``' may -have either case. `G' is not understood, but all other letters (`b i l -s w') are understood. - - Register names understood are `r0 r1 r2 ... r15 ap fp sp pc'. Upper -and lower case letters are equivalent. - - For instance - tstb *w`$4(r5) - - Any expression is permitted in an operand. Operands are comma -separated. - - -File: as.info, Node: VAX-no, Prev: VAX-operands, Up: Vax-Dependent - -Not Supported on VAX --------------------- - - Vax bit fields can not be assembled with `as'. Someone can add the -required code if they really need it. - - -File: as.info, Node: V850-Dependent, Next: Z8000-Dependent, Prev: Sparc-Dependent, Up: Machine Dependencies - -v850 Dependent Features -======================= - -* Menu: - -* V850 Options:: Options -* V850 Syntax:: Syntax -* V850 Floating Point:: Floating Point -* V850 Directives:: V850 Machine Directives -* V850 Opcodes:: Opcodes - - -File: as.info, Node: V850 Options, Next: V850 Syntax, Up: V850-Dependent - -Options -------- - - `as' supports the following additional command-line options for the -V850 processor family: - -`-wsigned_overflow' - Causes warnings to be produced when signed immediate values - overflow the space available for then within their opcodes. By - default this option is disabled as it is possible to receive - spurious warnings due to using exact bit patterns as immediate - constants. - -`-wunsigned_overflow' - Causes warnings to be produced when unsigned immediate values - overflow the space available for then within their opcodes. By - default this option is disabled as it is possible to receive - spurious warnings due to using exact bit patterns as immediate - constants. - -`-mv850' - Specifies that the assembled code should be marked as being - targeted at the V850 processor. This allows the linker to detect - attempts to link such code with code assembled for other - processors. - - -File: as.info, Node: V850 Syntax, Next: V850 Floating Point, Prev: V850 Options, Up: V850-Dependent - -Syntax ------- - -* Menu: - -* V850-Chars:: Special Characters -* V850-Regs:: Register Names - - -File: as.info, Node: V850-Chars, Next: V850-Regs, Up: V850 Syntax - -Special Characters -.................. - - `#' is the line comment character. - - -File: as.info, Node: V850-Regs, Prev: V850-Chars, Up: V850 Syntax - -Register Names -.............. - - `as' supports the following names for registers: -`general register 0' - r0, zero - -`general register 1' - r1 - -`general register 2' - r2, hp - -`general register 3' - r3, sp - -`general register 4' - r4, gp - -`general register 5' - r5, tp - -`general register 6' - r6 - -`general register 7' - r7 - -`general register 8' - r8 - -`general register 9' - r9 - -`general register 10' - r10 - -`general register 11' - r11 - -`general register 12' - r12 - -`general register 13' - r13 - -`general register 14' - r14 - -`general register 15' - r15 - -`general register 16' - r16 - -`general register 17' - r17 - -`general register 18' - r18 - -`general register 19' - r19 - -`general register 20' - r20 - -`general register 21' - r21 - -`general register 22' - r22 - -`general register 23' - r23 - -`general register 24' - r24 - -`general register 25' - r25 - -`general register 26' - r26 - -`general register 27' - r27 - -`general register 28' - r28 - -`general register 29' - r29 - -`general register 30' - r30, ep - -`general register 31' - r31, lp - -`system register 0' - eipc - -`system register 1' - eipsw - -`system register 2' - fepc - -`system register 3' - fepsw - -`system register 4' - ecr - -`system register 5' - psw - - -File: as.info, Node: V850 Floating Point, Next: V850 Directives, Prev: V850 Syntax, Up: V850-Dependent - -Floating Point --------------- - - The V850 family uses IEEE floating-point numbers. - - -File: as.info, Node: V850 Directives, Next: V850 Opcodes, Prev: V850 Floating Point, Up: V850-Dependent - -V850 Machine Directives ------------------------ - -`.offset ' - Moves the offset into the current section to the specified amount. - -`.section "name", ' - This is an extension to the standard .section directive. It sets - the current section to be and creates an alias for this - section called "name". - -`.v850' - Specifies that the assembled code should be marked as being - targeted at the V850 processor. This allows the linker to detect - attempts to link such code with code assembled for other - processors. - - -File: as.info, Node: V850 Opcodes, Prev: V850 Directives, Up: V850-Dependent - -Opcodes -------- - - `as' implements all the standard V850 opcodes. - - `as' also implements the following pseudo ops: - -`hi0()' - Computes the higher 16 bits of the given expression and stores it - into the immediate operand field of the given instruction. For - example: - - `mulhi hi0(here - there), r5, r6' - - computes the difference between the address of labels 'here' and - 'there', takes the upper 16 bits of this difference, shifts it - down 16 bits and then mutliplies it by the lower 16 bits in - register 5, putting the result into register 6. - -`lo()' - Computes the lower 16 bits of the given expression and stores it - into the immediate operand field of the given instruction. For - example: - - `addi lo(here - there), r5, r6' - - computes the difference between the address of labels 'here' and - 'there', takes the lower 16 bits of this difference and adds it to - register 5, putting the result into register 6. - -`hi()' - Computes the higher 16 bits of the given expression and then adds - the value of the most significant bit of the lower 16 bits of the - expression and stores the result into the immediate operand field - of the given instruction. For example the following code can be - used to compute the address of the label 'here' and store it into - register 6: - - `movhi hi(here), r0, r6' `movea lo(here), r6, r6' - - The reason for this special behaviour is that movea performs a sign - extention on its immediate operand. So for example if the address - of 'here' was 0xFFFFFFFF then without the special behaviour of the - hi() pseudo-op the movhi instruction would put 0xFFFF0000 into r6, - then the movea instruction would takes its immediate operand, - 0xFFFF, sign extend it to 32 bits, 0xFFFFFFFF, and then add it - into r6 giving 0xFFFEFFFF which is wrong (the fifth nibble is E). - With the hi() pseudo op adding in the top bit of the lo() pseudo - op, the movhi instruction actually stores 0 into r6 (0xFFFF + 1 = - 0x0000), so that the movea instruction stores 0xFFFFFFFF into r6 - - the right value. - -`sdaoff()' - Computes the offset of the named variable from the start of the - Small Data Area (whoes address is held in register 4, the GP - register) and stores the result as a 16 bit signed value in the - immediate operand field of the given instruction. For example: - - `ld.w sdaoff(_a_variable)[gp],r6' - - loads the contents of the location pointed to by the label - '_a_variable' into register 6, provided that the label is located - somewhere within +/- 32K of the address held in the GP register. - [Note the linker assumes that the GP register contains a fixed - address set to the address of the label called '__gp'. This can - either be set up automatically by the linker, or specifically set - by using the `--defsym __gp=' command line option]. - -`tdaoff()' - Computes the offset of the named variable from the start of the - Tiny Data Area (whoes address is held in register 30, the EP - register) and stores the result as a 7 or 8 bit unsigned value in - the immediate operand field of the given instruction. For example: - - `sld.w tdaoff(_a_variable)[ep],r6' - - loads the contents of the location pointed to by the label - '_a_variable' into register 6, provided that the label is located - somewhere within +256 bytes of the address held in the EP - register. [Note the linker assumes that the EP register contains - a fixed address set to the address of the label called '__ep'. - This can either be set up automatically by the linker, or - specifically set by using the `--defsym __ep=' command line - option]. - -`zdaoff()' - Computes the offset of the named variable from address 0 and - stores the result as a 16 bit signed value in the immediate - operand field of the given instruction. For example: - - `movea zdaoff(_a_variable),zero,r6' - - puts the address of the label '_a_variable' into register 6, - assuming that the label is somewhere within the first 32K of - memory. (Strictly speaking it also possible to access the last - 32K of memory as well, as the offsets are signed). - - For information on the V850 instruction set, see `V850 Family -32-/16-Bit single-Chip Microcontroller Architecture Manual' from NEC. -Ltd. - - -File: as.info, Node: Reporting Bugs, Next: Acknowledgements, Prev: Machine Dependencies, Up: Top - -Reporting Bugs -************** - - Your bug reports play an essential role in making `as' reliable. - - Reporting a bug may help you by bringing a solution to your problem, -or it may not. But in any case the principal function of a bug report -is to help the entire community by making the next version of `as' work -better. Bug reports are your contribution to the maintenance of `as'. - - In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -* Menu: - -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs - - -File: as.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -Have you found a bug? -===================== - - If you are not sure whether you have found a bug, here are some -guidelines: - - * If the assembler gets a fatal signal, for any input whatever, that - is a `as' bug. Reliable assemblers never crash. - - * If `as' produces an error message for valid input, that is a bug. - - * If `as' does not produce an error message for invalid input, that - is a bug. However, you should note that your idea of "invalid - input" might be our idea of "an extension" or "support for - traditional practice". - - * If you are an experienced user of assemblers, your suggestions for - improvement of `as' are welcome in any case. - - -File: as.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -How to report bugs -================== - - A number of companies and individuals offer support for GNU -products. If you obtained `as' from a support organization, we -recommend you contact that organization first. - - You can find contact information for many support companies and -individuals in the file `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for `as' -to `bug-gnu-utils@gnu.org'. - - The fundamental principle of reporting bugs usefully is this: -*report all the facts*. If you are not sure whether to state a fact or -leave it out, state it! - - Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a symbol you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug -is a stray memory reference which happens to fetch from the location -where that name is stored in memory; perhaps, if the name were -different, the contents of that location would fool the assembler into -doing the right thing despite the bug. Play it safe and give a -specific, complete example. That is the easiest thing for you to do, -and the most helpful. - - Keep in mind that the purpose of a bug report is to enable us to fix -the bug if it is new to us. Therefore, always write your bug reports -on the assumption that the bug has not been reported previously. - - Sometimes people give a few sketchy facts and ask, "Does this ring a -bell?" Those bug reports are useless, and we urge everyone to *refuse -to respond to them* except to chide the sender to report bugs properly. - - To enable us to fix the bug, you should include all these things: - - * The version of `as'. `as' announces it if you start it with the - `--version' argument. - - Without this, we will not know whether there is any point in - looking for the bug in the current version of `as'. - - * Any patches you may have applied to the `as' source. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile `as'--e.g. - "`gcc-2.7'". - - * The command arguments you gave the assembler to assemble your - example and observe the bug. To guarantee you will not omit - something important, list them all. A copy of the Makefile (or - the output from make) is sufficient. - - If we were to try to guess the arguments, we would probably guess - wrong and then we might not encounter the bug. - - * A complete input file that will reproduce the bug. If the bug is - observed when the assembler is invoked via a compiler, send the - assembler source, not the high level language source. Most - compilers will produce the assembler source when run with the `-S' - option. If you are using `gcc', use the options `-v - --save-temps'; this will save the assembler source in a file with - an extension of `.s', and also show you exactly how `as' is being - run. - - * A description of what behavior you observe that you believe is - incorrect. For example, "It gets a fatal signal." - - Of course, if the bug is that `as' gets a fatal signal, then we - will certainly notice it. But if the bug is incorrect output, we - might not notice unless it is glaringly wrong. You might as well - not give us a chance to make a mistake. - - Even if the problem you experience is a fatal signal, you should - still say so explicitly. Suppose something strange is going on, - such as, your copy of `as' is out of synch, or you have - encountered a bug in the C library on your system. (This has - happened!) Your copy might crash and ours would not. If you told - us to expect a crash, then when ours fails to crash, we would know - that the bug was not happening for us. If you had not told us to - expect a crash, then we would not be able to draw any conclusion - from our observations. - - * If you wish to suggest changes to the `as' source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you even - discuss something in the `as' source, refer to it by context, not - by line number. - - The line numbers in our development sources will not match those - in your sources. Your line numbers would convey no useful - information to us. - - Here are some things that are not necessary: - - * A description of the envelope of the bug. - - Often people who encounter a bug spend a lot of time investigating - which changes to the input file will make the bug go away and which - changes will not affect it. - - This is often time consuming and not very useful, because the way - we will find the bug is by running a single example under the - debugger with breakpoints, not by pure deduction from a series of - examples. We recommend that you save your time for something else. - - Of course, if you can find a simpler example to report *instead* - of the original one, that is a convenience for us. Errors in the - output will be easier to spot, running under the debugger will take - less time, and so on. - - However, simplification is not vital; if you do not want to do - this, report the bug anyway and send us the entire test case you - used. - - * A patch for the bug. - - A patch for the bug does help us if it is a good one. But do not - omit the necessary information, such as the test case, on the - assumption that a patch is all we need. We might see problems - with your patch and decide to fix the problem another way, or we - might not understand it at all. - - Sometimes with a program as complicated as `as' it is very hard to - construct an example that will make the program follow a certain - path through the code. If you do not send us the example, we will - not be able to construct one, so we will not be able to verify - that the bug is fixed. - - And if we cannot understand what bug you are trying to fix, or why - your patch should be an improvement, we will not install it. A - test case will help us to understand. - - * A guess about what the bug is or what it depends on. - - Such guesses are usually wrong. Even we cannot guess right about - such things without first using the debugger to find the facts. - - -File: as.info, Node: Acknowledgements, Next: Index, Prev: Reporting Bugs, Up: Top - -Acknowledgements -**************** - - If you have contributed to `as' and your name isn't listed here, it -is not meant as a slight. We just don't know about it. Send mail to -the maintainer, and we'll correct the situation. Currently the -maintainer is Ken Raeburn (email address `raeburn@cygnus.com'). - - Dean Elsner wrote the original GNU assembler for the VAX.(1) - - Jay Fenlason maintained GAS for a while, adding support for -GDB-specific debug information and the 68k series machines, most of the -preprocessing pass, and extensive changes in `messages.c', -`input-file.c', `write.c'. - - K. Richard Pixley maintained GAS for a while, adding various -enhancements and many bug fixes, including merging support for several -processors, breaking GAS up to handle multiple object file format back -ends (including heavy rewrite, testing, an integration of the coff and -b.out back ends), adding configuration including heavy testing and -verification of cross assemblers and file splits and renaming, -converted GAS to strictly ANSI C including full prototypes, added -support for m680[34]0 and cpu32, did considerable work on i960 -including a COFF port (including considerable amounts of reverse -engineering), a SPARC opcode file rewrite, DECstation, rs6000, and -hp300hpux host ports, updated "know" assertions and made them work, -much other reorganization, cleanup, and lint. - - Ken Raeburn wrote the high-level BFD interface code to replace most -of the code in format-specific I/O modules. - - The original VMS support was contributed by David L. Kashtan. Eric -Youngdale has done much work with it since. - - The Intel 80386 machine description was written by Eliot Dresselhaus. - - Minh Tran-Le at IntelliCorp contributed some AIX 386 support. - - The Motorola 88k machine description was contributed by Devon Bowen -of Buffalo University and Torbjorn Granlund of the Swedish Institute of -Computer Science. - - Keith Knowles at the Open Software Foundation wrote the original -MIPS back end (`tc-mips.c', `tc-mips.h'), and contributed Rose format -support (which hasn't been merged in yet). Ralph Campbell worked with -the MIPS code to support a.out format. - - Support for the Zilog Z8k and Hitachi H8/300 and H8/500 processors -(tc-z8k, tc-h8300, tc-h8500), and IEEE 695 object file format -(obj-ieee), was written by Steve Chamberlain of Cygnus Support. Steve -also modified the COFF back end to use BFD for some low-level -operations, for use with the H8/300 and AMD 29k targets. - - John Gilmore built the AMD 29000 support, added `.include' support, -and simplified the configuration of which versions accept which -directives. He updated the 68k machine description so that Motorola's -opcodes always produced fixed-size instructions (e.g. `jsr'), while -synthetic instructions remained shrinkable (`jbsr'). John fixed many -bugs, including true tested cross-compilation support, and one bug in -relaxation that took a week and required the proverbial one-bit fix. - - Ian Lance Taylor of Cygnus Support merged the Motorola and MIT -syntax for the 68k, completed support for some COFF targets (68k, i386 -SVR3, and SCO Unix), added support for MIPS ECOFF and ELF targets, -wrote the initial RS/6000 and PowerPC assembler, and made a few other -minor patches. - - Steve Chamberlain made `as' able to generate listings. - - Hewlett-Packard contributed support for the HP9000/300. - - Jeff Law wrote GAS and BFD support for the native HPPA object format -(SOM) along with a fairly extensive HPPA testsuite (for both SOM and -ELF object formats). This work was supported by both the Center for -Software Science at the University of Utah and Cygnus Support. - - Support for ELF format files has been worked on by Mark Eichin of -Cygnus Support (original, incomplete implementation for SPARC), Pete -Hoogenboom and Jeff Law at the University of Utah (HPPA mainly), -Michael Meissner of the Open Software Foundation (i386 mainly), and Ken -Raeburn of Cygnus Support (sparc, and some initial 64-bit support). - - Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote -GAS and BFD support for openVMS/Alpha. - - Several engineers at Cygnus Support have also provided many small -bug fixes and configuration enhancements. - - Many others have contributed large or small bugfixes and -enhancements. If you have contributed significant work and are not -mentioned on this list, and want to be, let us know. Some of the -history has been lost; we are not intentionally leaving anyone out. - - ---------- Footnotes ---------- - - (1) Any more details? - diff --git a/gnu/dist/gas/doc/as.info-7 b/gnu/dist/gas/doc/as.info-7 deleted file mode 100644 index 828ef53ae517..000000000000 --- a/gnu/dist/gas/doc/as.info-7 +++ /dev/null @@ -1,941 +0,0 @@ -This is Info file as.info, produced by Makeinfo version 1.68 from the -input file as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: as.info, Node: Index, Prev: Acknowledgements, Up: Top - -Index -***** - -* Menu: - -* #: Comments. -* #APP: Preprocessing. -* #NO_APP: Preprocessing. -* $ in symbol names <1>: D10V-Chars. -* $ in symbol names <2>: H8/500-Chars. -* $ in symbol names: SH-Chars. -* -: Command Line. -* -+ option, VAX/VMS: VAX-Opts. -* --base-size-default-16: M68K-Opts. -* --base-size-default-32: M68K-Opts. -* --bitwise-or option, M680x0: M68K-Opts. -* --disp-size-default-16: M68K-Opts. -* --disp-size-default-32: M68K-Opts. -* --register-prefix-optional option, M680x0: M68K-Opts. -* -a: a. -* -A options, i960: Options-i960. -* -ac: a. -* -ad: a. -* -ah: a. -* -al: a. -* -an: a. -* -as: a. -* -Asparclet: Sparc-Opts. -* -Asparclite: Sparc-Opts. -* -Av6: Sparc-Opts. -* -Av8: Sparc-Opts. -* -Av9: Sparc-Opts. -* -Av9a: Sparc-Opts. -* -b option, i960: Options-i960. -* -D: D. -* -D, ignored on VAX: VAX-Opts. -* -d, VAX option: VAX-Opts. -* -EB command line option, ARM: ARM Options. -* -EB option (MIPS): MIPS Opts. -* -EL command line option, ARM: ARM Options. -* -EL option (MIPS): MIPS Opts. -* -enforce-aligned-data: Sparc-Aligned-Data. -* -f: f. -* -G option (MIPS): MIPS Opts. -* -h option, VAX/VMS: VAX-Opts. -* -I PATH: I. -* -J, ignored on VAX: VAX-Opts. -* -K: K. -* -L: L. -* -l option, M680x0: M68K-Opts. -* -M: M. -* -m68000 and related options: M68K-Opts. -* -mall command line option, ARM: ARM Options. -* -mapcs command line option, ARM: ARM Options. -* -marm command line option, ARM: ARM Options. -* -marmv command line option, ARM: ARM Options. -* -mbig-endian option (ARC): ARC-Opts. -* -MD: MD. -* -mfpa command line option, ARM: ARM Options. -* -mfpe-old command line option, ARM: ARM Options. -* -mlittle-endian option (ARC): ARC-Opts. -* -mno-fpu command line option, ARM: ARM Options. -* -mthumb command line option, ARM: ARM Options. -* -mthumb-interwork command line option, ARM: ARM Options. -* -mv850 command line option, V850: V850 Options. -* -no-relax option, i960: Options-i960. -* -nocpp ignored (MIPS): MIPS Opts. -* -o: o. -* -R: R. -* -S, ignored on VAX: VAX-Opts. -* -statistics: statistics. -* -t, ignored on VAX: VAX-Opts. -* -T, ignored on VAX: VAX-Opts. -* -traditional-format: traditional-format. -* -v: v. -* -V, redundant on VAX: VAX-Opts. -* -version: v. -* -W: W. -* -wsigned_overflow command line option, V850: V850 Options. -* -wunsigned_overflow command line option, V850: V850 Options. -* . (symbol): Dot. -* .insn: MIPS insn. -* .o: Object. -* .param on HPPA: HPPA Directives. -* .set autoextend: MIPS autoextend. -* .set mipsN: MIPS ISA. -* .set noautoextend: MIPS autoextend. -* .set pop: MIPS option stack. -* .set push: MIPS option stack. -* .v850 directive, V850: V850 Directives. -* 16-bit code, i386: i386-16bit. -* 29K support: AMD29K-Dependent. -* : (label): Statements. -* @word modifier, D10V: D10V-Word. -* \" (doublequote character): Strings. -* \\ (\ character): Strings. -* \b (backspace character): Strings. -* \DDD (octal character code): Strings. -* \f (formfeed character): Strings. -* \n (newline character): Strings. -* \r (carriage return character): Strings. -* \t (tab): Strings. -* \XD... (hex character code): Strings. -* a.out: Object. -* a.out symbol attributes: a.out Symbols. -* ABORT directive: ABORT. -* abort directive: Abort. -* absolute section: Ld Sections. -* addition, permitted arguments: Infix Ops. -* addresses: Expressions. -* addresses, format of: Secs Background. -* addressing modes, D10V: D10V-Addressing. -* addressing modes, H8/300: H8/300-Addressing. -* addressing modes, H8/500: H8/500-Addressing. -* addressing modes, M680x0: M68K-Syntax. -* addressing modes, SH: SH-Addressing. -* addressing modes, Z8000: Z8000-Addressing. -* advancing location counter: Org. -* align directive: Align. -* align directive, SPARC: Sparc-Directives. -* altered difference tables: Word. -* alternate syntax for the 680x0: M68K-Moto-Syntax. -* AMD 29K floating point (IEEE): AMD29K Floating Point. -* AMD 29K identifiers: AMD29K-Chars. -* AMD 29K line comment character: AMD29K-Chars. -* AMD 29K machine directives: AMD29K Directives. -* AMD 29K macros: AMD29K-Macros. -* AMD 29K opcodes: AMD29K Opcodes. -* AMD 29K options (none): AMD29K Options. -* AMD 29K protected registers: AMD29K-Regs. -* AMD 29K register names: AMD29K-Regs. -* AMD 29K special purpose registers: AMD29K-Regs. -* AMD 29K support: AMD29K-Dependent. -* app-file directive: App-File. -* ARC architectures: ARC-Opts. -* ARC big-endian output: ARC-Opts. -* ARC endianness: Overview. -* ARC floating point (IEEE): ARC-Float. -* ARC little-endian output: ARC-Opts. -* ARC machine directives: ARC-Directives. -* ARC options: ARC-Opts. -* ARC support: ARC-Dependent. -* architecture options, i960: Options-i960. -* architecture options, M680x0: M68K-Opts. -* architectures, ARC: ARC-Opts. -* architectures, SPARC: Sparc-Opts. -* arguments for addition: Infix Ops. -* arguments for subtraction: Infix Ops. -* arguments in expressions: Arguments. -* arithmetic functions: Operators. -* arithmetic operands: Arguments. -* arm directive, ARM: ARM Directives. -* ARM floating point (IEEE): ARM Floating Point. -* ARM identifiers: ARM-Chars. -* ARM line comment character: ARM-Chars. -* ARM machine directives: ARM Directives. -* ARM opcodes: ARM Opcodes. -* ARM options (none): ARM Options. -* ARM register names: ARM-Regs. -* ARM support: ARM-Dependent. -* ascii directive: Ascii. -* asciz directive: Asciz. -* 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. -* assigning values to symbols: Equ. -* attributes, symbol: Symbol Attributes. -* auxiliary attributes, COFF symbols: COFF Symbols. -* auxiliary symbol information, COFF: Dim. -* Av7: Sparc-Opts. -* backslash (\\): Strings. -* backspace (\b): Strings. -* balign directive: Balign. -* balignl directive: Balign. -* balignw directive: Balign. -* big endian output, ARC: Overview. -* big endian output, MIPS: Overview. -* big-endian output, ARC: ARC-Opts. -* big-endian output, MIPS: MIPS Opts. -* bignums: Bignums. -* binary integers: Integers. -* bitfields, not supported on VAX: VAX-no. -* block: Z8000 Directives. -* block directive, AMD 29K: AMD29K Directives. -* branch improvement, M680x0: M68K-Branch. -* branch improvement, VAX: VAX-branch. -* branch recording, i960: Options-i960. -* branch statistics table, i960: Options-i960. -* bss directive, i960: Directives-i960. -* bss section <1>: Ld Sections. -* bss section: bss. -* bug criteria: Bug Criteria. -* bug reports: Bug Reporting. -* bugs in assembler: Reporting Bugs. -* bus lock prefixes, i386: i386-prefixes. -* bval: Z8000 Directives. -* byte directive: Byte. -* call instructions, i386: i386-Opcodes. -* callj, i960 pseudo-opcode: callj-i960. -* carriage return (\r): Strings. -* character constants: Characters. -* character escape codes: Strings. -* character, single: Chars. -* characters used in symbols: Symbol Intro. -* code directive, ARM: ARM Directives. -* code16 directive, i386: i386-16bit. -* code32 directive, i386: i386-16bit. -* COFF auxiliary symbol information: Dim. -* COFF structure debugging: Tag. -* COFF symbol attributes: COFF Symbols. -* COFF symbol descriptor: Desc. -* COFF symbol storage class: Scl. -* COFF symbol type: Type. -* COFF symbols, debugging: Def. -* COFF value attribute: Val. -* COMDAT: Linkonce. -* comm directive: Comm. -* command line conventions: Command Line. -* command line options, V850: V850 Options. -* command-line options ignored, VAX: VAX-Opts. -* comments: Comments. -* comments, M680x0: M68K-Chars. -* comments, removed by preprocessor: Preprocessing. -* common directive, SPARC: Sparc-Directives. -* common sections: Linkonce. -* common variable storage: bss. -* compare and jump expansions, i960: Compare-and-branch-i960. -* compare/branch instructions, i960: Compare-and-branch-i960. -* conditional assembly: If. -* constant, single character: Chars. -* constants: Constants. -* constants, bignum: Bignums. -* constants, character: Characters. -* constants, converted by preprocessor: Preprocessing. -* constants, floating point: Flonums. -* constants, integer: Integers. -* constants, number: Numbers. -* constants, string: Strings. -* continuing statements: Statements. -* conversion instructions, i386: i386-Opcodes. -* coprocessor wait, i386: i386-prefixes. -* cpu directive, SPARC: ARC-Directives. -* cputype directive, AMD 29K: AMD29K Directives. -* crash of assembler: Bug Criteria. -* current address: Dot. -* current address, advancing: Org. -* D10V @word modifier: D10V-Word. -* D10V addressing modes: D10V-Addressing. -* D10V floating point: D10V-Float. -* D10V line comment character: D10V-Chars. -* D10V opcode summary: D10V-Opcodes. -* D10V optimization: Overview. -* D10V options: D10V-Opts. -* D10V registers: D10V-Regs. -* D10V size modifiers: D10V-Size. -* D10V sub-instruction ordering: D10V-Chars. -* D10V sub-instructions: D10V-Subs. -* D10V support: D10V-Dependent. -* D10V syntax: D10V-Syntax. -* data alignment on SPARC: Sparc-Aligned-Data. -* data and text sections, joining: R. -* data directive: Data. -* data section: Ld Sections. -* data1 directive, M680x0: M68K-Directives. -* data2 directive, M680x0: M68K-Directives. -* debuggers, and symbol order: Symbols. -* debugging COFF symbols: Def. -* decimal integers: Integers. -* def directive: Def. -* dependency tracking: MD. -* deprecated directives: Deprecated. -* desc directive: Desc. -* descriptor, of a.out symbol: Symbol Desc. -* dfloat directive, VAX: VAX-directives. -* difference tables altered: Word. -* difference tables, warning: K. -* dim directive: Dim. -* directives and instructions: Statements. -* directives, M680x0: M68K-Directives. -* directives, machine independent: Pseudo Ops. -* directives, Z8000: Z8000 Directives. -* displacement sizing character, VAX: VAX-operands. -* dot (symbol): Dot. -* double directive: Double. -* double directive, i386: i386-Float. -* double directive, M680x0: M68K-Float. -* double directive, VAX: VAX-float. -* doublequote (\"): Strings. -* ECOFF sections: MIPS Object. -* ecr register, V850: V850-Regs. -* eight-byte integer: Quad. -* eipc register, V850: V850-Regs. -* eipsw register, V850: V850-Regs. -* eject directive: Eject. -* else directive: Else. -* empty expressions: Empty Exprs. -* emulation: Overview. -* endef directive: Endef. -* endianness, ARC: Overview. -* endianness, MIPS: Overview. -* endif directive: Endif. -* endm directive: Macro. -* EOF, newline must precede: Statements. -* ep register, V850: V850-Regs. -* equ directive: Equ. -* equiv directive: Equiv. -* err directive: Err. -* error messsages: Errors. -* error on valid input: Bug Criteria. -* errors, continuing after: Z. -* escape codes, character: Strings. -* even: Z8000 Directives. -* even directive, M680x0: M68K-Directives. -* exitm directive: Macro. -* expr (internal section): As Sections. -* expression arguments: Arguments. -* expressions: Expressions. -* expressions, empty: Empty Exprs. -* expressions, integer: Integer Exprs. -* extend directive M680x0: M68K-Float. -* extended directive, i960: Directives-i960. -* extern directive: Extern. -* faster processing (-f): f. -* fatal signal: Bug Criteria. -* fepc register, V850: V850-Regs. -* fepsw register, V850: V850-Regs. -* ffloat directive, VAX: VAX-directives. -* file directive: File. -* file directive, AMD 29K: AMD29K Directives. -* file name, logical <1>: App-File. -* file name, logical: File. -* files, including: Include. -* files, input: Input Files. -* fill directive: Fill. -* filling memory <1>: Skip. -* filling memory: Space. -* float directive: Float. -* float directive, i386: i386-Float. -* float directive, M680x0: M68K-Float. -* float directive, VAX: VAX-float. -* floating point numbers: Flonums. -* floating point numbers (double): Double. -* floating point numbers (single) <1>: Single. -* floating point numbers (single): Float. -* floating point, AMD 29K (IEEE): AMD29K Floating Point. -* floating point, ARC (IEEE): ARC-Float. -* floating point, ARM (IEEE): ARM Floating Point. -* floating point, D10V: D10V-Float. -* floating point, H8/300 (IEEE): H8/300 Floating Point. -* floating point, H8/500 (IEEE): H8/500 Floating Point. -* floating point, HPPA (IEEE): HPPA Floating Point. -* floating point, i386: i386-Float. -* floating point, i960 (IEEE): Floating Point-i960. -* floating point, M680x0: M68K-Float. -* floating point, SH (IEEE): SH Floating Point. -* floating point, SPARC (IEEE): Sparc-Float. -* floating point, V850 (IEEE): V850 Floating Point. -* floating point, VAX: VAX-float. -* flonums: Flonums. -* force_thumb directive, ARM: ARM Directives. -* format of error messages: Errors. -* format of warning messages: Errors. -* formfeed (\f): Strings. -* functions, in expressions: Operators. -* gbr960, i960 postprocessor: Options-i960. -* gfloat directive, VAX: VAX-directives. -* global: Z8000 Directives. -* global directive: Global. -* gp register, MIPS: MIPS Object. -* gp register, V850: V850-Regs. -* grouping data: Sub-Sections. -* H8/300 addressing modes: H8/300-Addressing. -* H8/300 floating point (IEEE): H8/300 Floating Point. -* H8/300 line comment character: H8/300-Chars. -* H8/300 line separator: H8/300-Chars. -* H8/300 machine directives (none): H8/300 Directives. -* H8/300 opcode summary: H8/300 Opcodes. -* H8/300 options (none): H8/300 Options. -* H8/300 registers: H8/300-Regs. -* H8/300 size suffixes: H8/300 Opcodes. -* H8/300 support: H8/300-Dependent. -* H8/300H, assembling for: H8/300 Directives. -* H8/500 addressing modes: H8/500-Addressing. -* H8/500 floating point (IEEE): H8/500 Floating Point. -* H8/500 line comment character: H8/500-Chars. -* H8/500 line separator: H8/500-Chars. -* H8/500 machine directives (none): H8/500 Directives. -* H8/500 opcode summary: H8/500 Opcodes. -* H8/500 options (none): H8/500 Options. -* H8/500 registers: H8/500-Regs. -* H8/500 support: H8/500-Dependent. -* half directive, SPARC: Sparc-Directives. -* hex character code (\XD...): Strings. -* hexadecimal integers: Integers. -* hfloat directive, VAX: VAX-directives. -* hi pseudo-op, V850: V850 Opcodes. -* hi0 pseudo-op, V850: V850 Opcodes. -* HPPA directives not supported: HPPA Directives. -* HPPA floating point (IEEE): HPPA Floating Point. -* HPPA Syntax: HPPA Options. -* HPPA-only directives: HPPA Directives. -* hword directive: hword. -* i386 16-bit code: i386-16bit. -* i386 conversion instructions: i386-Opcodes. -* i386 floating point: i386-Float. -* i386 immediate operands: i386-Syntax. -* i386 jump optimization: i386-jumps. -* i386 jump, call, return: i386-Syntax. -* i386 jump/call operands: i386-Syntax. -* i386 memory references: i386-Memory. -* i386 mul, imul instructions: i386-Notes. -* i386 opcode naming: i386-Opcodes. -* i386 opcode prefixes: i386-prefixes. -* i386 options (none): i386-Options. -* i386 register operands: i386-Syntax. -* i386 registers: i386-Regs. -* i386 sections: i386-Syntax. -* i386 size suffixes: i386-Syntax. -* i386 source, destination operands: i386-Syntax. -* i386 support: i386-Dependent. -* i386 syntax compatibility: i386-Syntax. -* i80306 support: i386-Dependent. -* i960 architecture options: Options-i960. -* i960 branch recording: Options-i960. -* i960 callj pseudo-opcode: callj-i960. -* i960 compare and jump expansions: Compare-and-branch-i960. -* i960 compare/branch instructions: Compare-and-branch-i960. -* i960 floating point (IEEE): Floating Point-i960. -* i960 machine directives: Directives-i960. -* i960 opcodes: Opcodes for i960. -* i960 options: Options-i960. -* i960 support: i960-Dependent. -* ident directive: Ident. -* identifiers, AMD 29K: AMD29K-Chars. -* identifiers, ARM: ARM-Chars. -* if directive: If. -* ifdef directive: If. -* ifndef directive: If. -* ifnotdef directive: If. -* immediate character, M680x0: M68K-Chars. -* immediate character, VAX: VAX-operands. -* immediate operands, i386: i386-Syntax. -* imul instruction, i386: i386-Notes. -* include directive: Include. -* include directive search path: I. -* indirect character, VAX: VAX-operands. -* infix operators: Infix Ops. -* inhibiting interrupts, i386: i386-prefixes. -* input: Input Files. -* input file linenumbers: Input Files. -* instruction set, M680x0: M68K-opcodes. -* instruction summary, D10V: D10V-Opcodes. -* instruction summary, H8/300: H8/300 Opcodes. -* instruction summary, H8/500: H8/500 Opcodes. -* instruction summary, SH: SH Opcodes. -* instruction summary, Z8000: Z8000 Opcodes. -* instructions and directives: Statements. -* int directive: Int. -* int directive, H8/300: H8/300 Directives. -* int directive, H8/500: H8/500 Directives. -* int directive, i386: i386-Float. -* integer expressions: Integer Exprs. -* integer, 16-byte: Octa. -* integer, 8-byte: Quad. -* integers: Integers. -* integers, 16-bit: hword. -* integers, 32-bit: Int. -* integers, binary: Integers. -* integers, decimal: Integers. -* integers, hexadecimal: Integers. -* integers, octal: Integers. -* integers, one byte: Byte. -* internal assembler sections: As Sections. -* invalid input: Bug Criteria. -* invocation summary: Overview. -* irp directive: Irp. -* irpc directive: Irpc. -* joining text and data sections: R. -* jump instructions, i386: i386-Opcodes. -* jump optimization, i386: i386-jumps. -* jump/call operands, i386: i386-Syntax. -* label (:): Statements. -* labels: Labels. -* lcomm directive: Lcomm. -* ld: Object. -* ldouble directive M680x0: M68K-Float. -* leafproc directive, i960: Directives-i960. -* length of symbols: Symbol Intro. -* lflags directive (ignored): Lflags. -* line comment character: Comments. -* line comment character, AMD 29K: AMD29K-Chars. -* line comment character, ARM: ARM-Chars. -* line comment character, D10V: D10V-Chars. -* line comment character, H8/300: H8/300-Chars. -* line comment character, H8/500: H8/500-Chars. -* line comment character, M680x0: M68K-Chars. -* line comment character, SH: SH-Chars. -* line comment character, V850: V850-Chars. -* line comment character, Z8000: Z8000-Chars. -* line directive: Line. -* line directive, AMD 29K: AMD29K Directives. -* line numbers, in input files: Input Files. -* line numbers, in warnings/errors: Errors. -* line separator character: Statements. -* line separator, H8/300: H8/300-Chars. -* line separator, H8/500: H8/500-Chars. -* line separator, SH: SH-Chars. -* line separator, Z8000: Z8000-Chars. -* lines starting with #: Comments. -* linker: Object. -* linker, and assembler: Secs Background. -* linkonce directive: Linkonce. -* list directive: List. -* listing control, turning off: Nolist. -* listing control, turning on: List. -* listing control: new page: Eject. -* listing control: paper size: Psize. -* listing control: subtitle: Sbttl. -* listing control: title line: Title. -* listings, enabling: a. -* little endian output, ARC: Overview. -* little endian output, MIPS: Overview. -* little-endian output, ARC: ARC-Opts. -* little-endian output, MIPS: MIPS Opts. -* ln directive: Ln. -* lo pseudo-op, V850: V850 Opcodes. -* local common symbols: Lcomm. -* local labels, retaining in output: L. -* local symbol names: Symbol Names. -* location counter: Dot. -* location counter, advancing: Org. -* logical file name <1>: File. -* logical file name: App-File. -* logical line number: Line. -* logical line numbers: Comments. -* long directive: Long. -* long directive, i386: i386-Float. -* lp register, V850: V850-Regs. -* lval: Z8000 Directives. -* M680x0 addressing modes: M68K-Syntax. -* M680x0 architecture options: M68K-Opts. -* M680x0 branch improvement: M68K-Branch. -* M680x0 directives: M68K-Directives. -* M680x0 floating point: M68K-Float. -* M680x0 immediate character: M68K-Chars. -* M680x0 line comment character: M68K-Chars. -* M680x0 opcodes: M68K-opcodes. -* M680x0 options: M68K-Opts. -* M680x0 pseudo-opcodes: M68K-Branch. -* M680x0 size modifiers: M68K-Syntax. -* M680x0 support: M68K-Dependent. -* M680x0 syntax: M68K-Syntax. -* machine dependencies: Machine Dependencies. -* machine directives, AMD 29K: AMD29K Directives. -* machine directives, ARC: ARC-Directives. -* machine directives, ARM: ARM Directives. -* machine directives, H8/300 (none): H8/300 Directives. -* machine directives, H8/500 (none): H8/500 Directives. -* machine directives, i960: Directives-i960. -* machine directives, SH: SH Directives. -* machine directives, SPARC: Sparc-Directives. -* machine directives, V850: V850 Directives. -* machine directives, VAX: VAX-directives. -* machine independent directives: Pseudo Ops. -* machine instructions (not covered): Manual. -* machine-independent syntax: Syntax. -* macro directive: Macro. -* macros: Macro. -* Macros, AMD 29K: AMD29K-Macros. -* macros, count executed: Macro. -* make rules: MD. -* manual, structure and purpose: Manual. -* memory references, i386: i386-Memory. -* merging text and data sections: R. -* messages from assembler: Errors. -* minus, permitted arguments: Infix Ops. -* MIPS architecture options: MIPS Opts. -* MIPS big-endian output: MIPS Opts. -* MIPS debugging directives: MIPS Stabs. -* MIPS ECOFF sections: MIPS Object. -* MIPS endianness: Overview. -* MIPS ISA: Overview. -* MIPS ISA override: MIPS ISA. -* MIPS little-endian output: MIPS Opts. -* MIPS option stack: MIPS option stack. -* MIPS processor: MIPS-Dependent. -* MIT: M68K-Syntax. -* mnemonics for opcodes, VAX: VAX-opcodes. -* mnemonics, D10V: D10V-Opcodes. -* mnemonics, H8/300: H8/300 Opcodes. -* mnemonics, H8/500: H8/500 Opcodes. -* mnemonics, SH: SH Opcodes. -* mnemonics, Z8000: Z8000 Opcodes. -* Motorola syntax for the 680x0: M68K-Moto-Syntax. -* MRI compatibility mode: M. -* mri directive: MRI. -* MRI mode, temporarily: MRI. -* mul instruction, i386: i386-Notes. -* multi-line statements: Statements. -* name: Z8000 Directives. -* named section: Section. -* named sections: Ld Sections. -* names, symbol: Symbol Names. -* naming object file: o. -* new page, in listings: Eject. -* newline (\n): Strings. -* newline, required at file end: Statements. -* nolist directive: Nolist. -* null-terminated strings: Asciz. -* number constants: Numbers. -* number of macros executed: Macro. -* numbered subsections: Sub-Sections. -* numbers, 16-bit: hword. -* numeric values: Expressions. -* object file: Object. -* object file format: Object Formats. -* object file name: o. -* object file, after errors: Z. -* obsolescent directives: Deprecated. -* octa directive: Octa. -* octal character code (\DDD): Strings. -* octal integers: Integers. -* offset directive, V850: V850 Directives. -* opcode mnemonics, VAX: VAX-opcodes. -* opcode naming, i386: i386-Opcodes. -* opcode prefixes, i386: i386-prefixes. -* opcode suffixes, i386: i386-Syntax. -* opcode summary, D10V: D10V-Opcodes. -* opcode summary, H8/300: H8/300 Opcodes. -* opcode summary, H8/500: H8/500 Opcodes. -* opcode summary, SH: SH Opcodes. -* opcode summary, Z8000: Z8000 Opcodes. -* opcodes for AMD 29K: AMD29K Opcodes. -* opcodes for ARM: ARM Opcodes. -* opcodes for V850: V850 Opcodes. -* opcodes, i960: Opcodes for i960. -* opcodes, M680x0: M68K-opcodes. -* operand delimiters, i386: i386-Syntax. -* operand notation, VAX: VAX-operands. -* operands in expressions: Arguments. -* operator precedence: Infix Ops. -* operators, in expressions: Operators. -* operators, permitted arguments: Infix Ops. -* optimization, D10V: Overview. -* option summary: Overview. -* options for AMD29K (none): AMD29K Options. -* options for ARC: ARC-Opts. -* options for ARM (none): ARM Options. -* options for i386 (none): i386-Options. -* options for SPARC: Sparc-Opts. -* options for V850 (none): V850 Options. -* options for VAX/VMS: VAX-Opts. -* options, all versions of assembler: Invoking. -* options, command line: Command Line. -* options, D10V: D10V-Opts. -* options, H8/300 (none): H8/300 Options. -* options, H8/500 (none): H8/500 Options. -* options, i960: Options-i960. -* options, M680x0: M68K-Opts. -* options, SH (none): SH Options. -* options, Z8000: Z8000 Options. -* org directive: Org. -* other attribute, of a.out symbol: Symbol Other. -* output file: Object. -* p2align directive: P2align. -* p2alignl directive: P2align. -* p2alignw directive: P2align. -* padding the location counter: Align. -* padding the location counter given a power of two: P2align. -* padding the location counter given number of bytes: Balign. -* page, in listings: Eject. -* paper size, for listings: Psize. -* paths for .include: I. -* patterns, writing in memory: Fill. -* plus, permitted arguments: Infix Ops. -* precedence of operators: Infix Ops. -* precision, floating point: Flonums. -* prefix operators: Prefix Ops. -* prefixes, i386: i386-prefixes. -* preprocessing: Preprocessing. -* preprocessing, turning on and off: Preprocessing. -* primary attributes, COFF symbols: COFF Symbols. -* proc directive, SPARC: Sparc-Directives. -* protected registers, AMD 29K: AMD29K-Regs. -* pseudo-opcodes, M680x0: M68K-Branch. -* pseudo-ops for branch, VAX: VAX-branch. -* pseudo-ops, machine independent: Pseudo Ops. -* psize directive: Psize. -* psw register, V850: V850-Regs. -* purpose of GNU assembler: GNU Assembler. -* quad directive: Quad. -* quad directive, i386: i386-Float. -* real-mode code, i386: i386-16bit. -* register names, AMD 29K: AMD29K-Regs. -* register names, ARM: ARM-Regs. -* register names, H8/300: H8/300-Regs. -* register names, V850: V850-Regs. -* register names, VAX: VAX-operands. -* register operands, i386: i386-Syntax. -* registers, D10V: D10V-Regs. -* registers, H8/500: H8/500-Regs. -* registers, i386: i386-Regs. -* registers, SH: SH-Regs. -* registers, Z8000: Z8000-Regs. -* relocation: Sections. -* relocation example: Ld Sections. -* repeat prefixes, i386: i386-prefixes. -* reporting bugs in assembler: Reporting Bugs. -* rept directive: Rept. -* reserve directive, SPARC: Sparc-Directives. -* return instructions, i386: i386-Syntax. -* rsect: Z8000 Directives. -* sbttl directive: Sbttl. -* scl directive: Scl. -* sdaoff pseudo-op, V850: V850 Opcodes. -* search path for .include: I. -* sect directive, AMD 29K: AMD29K Directives. -* section directive: Section. -* section directive, V850: V850 Directives. -* section override prefixes, i386: i386-prefixes. -* section-relative addressing: Secs Background. -* sections: Sections. -* sections in messages, internal: As Sections. -* sections, i386: i386-Syntax. -* sections, named: Ld Sections. -* seg directive, SPARC: Sparc-Directives. -* segm: Z8000 Directives. -* set directive: Set. -* SH addressing modes: SH-Addressing. -* SH floating point (IEEE): SH Floating Point. -* SH line comment character: SH-Chars. -* SH line separator: SH-Chars. -* SH machine directives: SH Directives. -* SH opcode summary: SH Opcodes. -* SH options (none): SH Options. -* SH registers: SH-Regs. -* SH support: SH-Dependent. -* short directive: Short. -* single character constant: Chars. -* single directive: Single. -* single directive, i386: i386-Float. -* sixteen bit integers: hword. -* sixteen byte integer: Octa. -* size directive: Size. -* size modifiers, D10V: D10V-Size. -* size modifiers, M680x0: M68K-Syntax. -* size prefixes, i386: i386-prefixes. -* size suffixes, H8/300: H8/300 Opcodes. -* sizes operands, i386: i386-Syntax. -* skip directive: Skip. -* skip directive, M680x0: M68K-Directives. -* skip directive, SPARC: Sparc-Directives. -* sleb128 directive: Sleb128. -* small objects, MIPS ECOFF: MIPS Object. -* SOM symbol attributes: SOM Symbols. -* source program: Input Files. -* source, destination operands; i386: i386-Syntax. -* sp register, V850: V850-Regs. -* space directive: Space. -* space used, maximum for assembly: statistics. -* SPARC architectures: Sparc-Opts. -* SPARC data alignment: Sparc-Aligned-Data. -* SPARC floating point (IEEE): Sparc-Float. -* SPARC machine directives: Sparc-Directives. -* SPARC options: Sparc-Opts. -* SPARC support: Sparc-Dependent. -* special characters, M680x0: M68K-Chars. -* special purpose registers, AMD 29K: AMD29K-Regs. -* stabd directive: Stab. -* stabn directive: Stab. -* stabs directive: Stab. -* stabX directives: Stab. -* standard assembler sections: Secs Background. -* standard input, as input file: Command Line. -* statement on multiple lines: Statements. -* statement separator character: Statements. -* statement separator, H8/300: H8/300-Chars. -* statement separator, H8/500: H8/500-Chars. -* statement separator, SH: SH-Chars. -* statement separator, Z8000: Z8000-Chars. -* statements, structure of: Statements. -* statistics, about assembly: statistics. -* stopping the assembly: Abort. -* string constants: Strings. -* string directive: String. -* string directive on HPPA: HPPA Directives. -* string literals: Ascii. -* string, copying to object file: String. -* structure debugging, COFF: Tag. -* sub-instruction ordering, D10V: D10V-Chars. -* sub-instructions, D10V: D10V-Subs. -* subexpressions: Arguments. -* subtitles for listings: Sbttl. -* subtraction, permitted arguments: Infix Ops. -* summary of options: Overview. -* support: HPPA-Dependent. -* supporting files, including: Include. -* suppressing warnings: W. -* sval: Z8000 Directives. -* symbol attributes: Symbol Attributes. -* symbol attributes, a.out: a.out Symbols. -* symbol attributes, COFF: COFF Symbols. -* symbol attributes, SOM: SOM Symbols. -* symbol descriptor, COFF: Desc. -* symbol names: Symbol Names. -* symbol names, $ in <1>: D10V-Chars. -* symbol names, $ in <2>: H8/500-Chars. -* symbol names, $ in: SH-Chars. -* symbol names, local: Symbol Names. -* symbol names, temporary: Symbol Names. -* symbol storage class (COFF): Scl. -* symbol type: Symbol Type. -* symbol type, COFF: Type. -* symbol value: Symbol Value. -* symbol value, setting: Set. -* symbol values, assigning: Setting Symbols. -* symbol versioning: Symver. -* symbol, common: Comm. -* symbol, making visible to linker: Global. -* symbolic debuggers, information for: Stab. -* symbols: Symbols. -* symbols with lowercase, VAX/VMS: VAX-Opts. -* symbols, assigning values to: Equ. -* symbols, local common: Lcomm. -* symver directive: Symver. -* syntax compatibility, i386: i386-Syntax. -* syntax, D10V: D10V-Syntax. -* syntax, M680x0: M68K-Syntax. -* syntax, machine-independent: Syntax. -* sysproc directive, i960: Directives-i960. -* tab (\t): Strings. -* tag directive: Tag. -* tdaoff pseudo-op, V850: V850 Opcodes. -* temporary symbol names: Symbol Names. -* text and data sections, joining: R. -* text directive: Text. -* text section: Ld Sections. -* tfloat directive, i386: i386-Float. -* thumb directive, ARM: ARM Directives. -* Thumb support: ARM-Dependent. -* thumb_func directive, ARM: ARM Directives. -* time, total for assembly: statistics. -* title directive: Title. -* tp register, V850: V850-Regs. -* trusted compiler: f. -* turning preprocessing on and off: Preprocessing. -* type directive: Type. -* type of a symbol: Symbol Type. -* ualong directive, SH: SH Directives. -* uaword directive, SH: SH Directives. -* uleb128 directive: Uleb128. -* undefined section: Ld Sections. -* unsegm: Z8000 Directives. -* use directive, AMD 29K: AMD29K Directives. -* V850 command line options: V850 Options. -* V850 floating point (IEEE): V850 Floating Point. -* V850 line comment character: V850-Chars. -* V850 machine directives: V850 Directives. -* V850 opcodes: V850 Opcodes. -* V850 options (none): V850 Options. -* V850 register names: V850-Regs. -* V850 support: V850-Dependent. -* val directive: Val. -* value attribute, COFF: Val. -* value of a symbol: Symbol Value. -* VAX bitfields not supported: VAX-no. -* VAX branch improvement: VAX-branch. -* VAX command-line options ignored: VAX-Opts. -* VAX displacement sizing character: VAX-operands. -* VAX floating point: VAX-float. -* VAX immediate character: VAX-operands. -* VAX indirect character: VAX-operands. -* VAX machine directives: VAX-directives. -* VAX opcode mnemonics: VAX-opcodes. -* VAX operand notation: VAX-operands. -* VAX register names: VAX-operands. -* VAX support: Vax-Dependent. -* Vax-11 C compatibility: VAX-Opts. -* VAX/VMS options: VAX-Opts. -* version of assembler: v. -* versions of symbols: Symver. -* VMS (VAX) options: VAX-Opts. -* warning for altered difference tables: K. -* warning messages: Errors. -* warnings, suppressing: W. -* whitespace: Whitespace. -* whitespace, removed by preprocessor: Preprocessing. -* wide floating point directives, VAX: VAX-directives. -* word directive: Word. -* word directive, H8/300: H8/300 Directives. -* word directive, H8/500: H8/500 Directives. -* word directive, i386: i386-Float. -* word directive, SPARC: Sparc-Directives. -* writing patterns in memory: Fill. -* wval: Z8000 Directives. -* xword directive, SPARC: Sparc-Directives. -* Z800 addressing modes: Z8000-Addressing. -* Z8000 directives: Z8000 Directives. -* Z8000 line comment character: Z8000-Chars. -* Z8000 line separator: Z8000-Chars. -* Z8000 opcode summary: Z8000 Opcodes. -* Z8000 options: Z8000 Options. -* Z8000 registers: Z8000-Regs. -* Z8000 support: Z8000-Dependent. -* zdaoff pseudo-op, V850: V850 Opcodes. -* zero register, V850: V850-Regs. -* zero-terminated strings: Asciz. - - diff --git a/gnu/dist/gas/doc/gasp.info b/gnu/dist/gas/doc/gasp.info deleted file mode 100644 index 70f37ee6f3e6..000000000000 --- a/gnu/dist/gas/doc/gasp.info +++ /dev/null @@ -1,1086 +0,0 @@ -This is Info file gasp.info, produced by Makeinfo version 1.68 from the -input file gasp.texi. - -START-INFO-DIR-ENTRY -* gasp: (gasp). The GNU Assembler Preprocessor -END-INFO-DIR-ENTRY - - Copyright (C) 1994, 1995 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: gasp.info, Node: Top, Next: Overview, Up: (dir) - -GASP -**** - - GASP is a preprocessor for assembly programs. - - This file describes version 1 of GASP. - - Steve Chamberlain wrote GASP; Roland Pesch wrote this manual. - -* Menu: - -* Overview:: What is GASP? -* Invoking GASP:: Command line options. -* Commands:: Preprocessor commands. -* Index:: Index. - - -File: gasp.info, Node: Overview, Next: Invoking GASP, Prev: Top, Up: Top - -What is GASP? -************* - - The primary purpose of the GNU assembler is to assemble the output of -other programs--notably compilers. When you have to hand-code -specialized routines in assembly, that means the GNU assembler is an -unfriendly processor: it has no directives for macros, conditionals, or -many other conveniences that you might expect. - - In some cases you can simply use the C preprocessor, or a generalized -preprocessor like M4; but this can be awkward, since none of these -things are designed with assembly in mind. - - GASP fills this need. It is expressly designed to provide the -facilities you need with hand-coded assembly code. Implementing it as a -preprocessor, rather than part of the assembler, allows the maximum -flexibility: you can use it with hand-coded assembly, without paying a -penalty of added complexity in the assembler you use for compiler -output. - - Here is a small example to give the flavor of GASP. This input to -GASP - - .MACRO saveregs from=8 to=14 - count .ASSIGNA \from - ! save r\from..r\to - .AWHILE \&count LE \to - mov r\&count,@-sp - count .ASSIGNA \&count + 1 - .AENDW - .ENDM - - saveregs from=12 - - bar: mov #H'dead+10,r0 - foo .SDATAC "hello"<10> - .END - -generates this assembly program: - - ! save r12..r14 - mov r12,@-sp - mov r13,@-sp - mov r14,@-sp - - bar: mov #57005+10,r0 - foo: .byte 6,104,101,108,108,111,10 - - -File: gasp.info, Node: Invoking GASP, Next: Commands, Prev: Overview, Up: Top - -Command Line Options -******************** - - The simplest way to use GASP is to run it as a filter and assemble -its output. In Unix and its ilk, you can do this, for example: - - $ gasp prog.asm | as -o prog.o - - Naturally, there are also a few command-line options to allow you to -request variations on this basic theme. Here is the full set of -possibilities for the GASP command line. - - gasp [ -a | --alternate ] - [ -c CHAR | --commentchar CHAR ] - [ -d | --debug ] [ -h | --help ] [ -M | --mri ] - [ -o OUTFILE | --output OUTFILE ] - [ -p | --print ] [ -s | --copysource ] - [ -u | --unreasonable ] [ -v | --version ] - INFILE ... - -`INFILE ...' - The input file names. You must specify at least one input file; - if you specify more, GASP preprocesses them all, concatenating the - output in the order you list the INFILE arguments. - - Mark the end of each input file with the preprocessor command - `.END'. *Note Miscellaneous commands: Other Commands. - -`-a' -`--alternate' - Use alternative macro syntax. *Note Alternate macro syntax: - Alternate, for a discussion of how this syntax differs from the - default GASP syntax. - -`-c 'CHAR'' -`--commentchar 'CHAR'' - Use CHAR as the comment character. The default comment character - is `!'. For example, to use a semicolon as the comment character, - specify `-c ';'' on the GASP command line. Since assembler - command characters often have special significance to command - shells, it is a good idea to quote or escape CHAR when you specify - a comment character. - - For the sake of simplicity, all examples in this manual use the - default comment character `!'. - -`-d' -`--debug' - Show debugging statistics. In this version of GASP, this option - produces statistics about the string buffers that GASP allocates - internally. For each defined buffersize S, GASP shows the number - of strings N that it allocated, with a line like this: - - strings size S : N - - GASP displays these statistics on the standard error stream, when - done preprocessing. - -`-h' -`--help' - Display a summary of the GASP command line options. - -`-M' -`--mri' - Use MRI compatibility mode. Using this option causes GASP to - accept the syntax and pseudo-ops used by the Microtec Research - `ASM68K' assembler. - -`-o OUTFILE' -`--output OUTFILE' - Write the output in a file called OUTFILE. If you do not use the - `-o' option, GASP writes its output on the standard output stream. - -`-p' -`--print' - Print line numbers. GASP obeys this option *only* if you also - specify `-s' to copy source lines to its output. With `-s -p', - GASP displays the line number of each source line copied - (immediately after the comment character at the beginning of the - line). - -`-s' -`--copysource' - Copy the source lines to the output file. Use this option to see - the effect of each preprocessor line on the GASP output. GASP - places a comment character (`!' by default) at the beginning of - each source line it copies, so that you can use this option and - still assemble the result. - -`-u' -`--unreasonable' - Bypass "unreasonable expansion" limit. Since you can define GASP - macros inside other macro definitions, the preprocessor normally - includes a sanity check. If your program requires more than 1,000 - nested expansions, GASP normally exits with an error message. Use - this option to turn off this check, allowing unlimited nested - expansions. - -`-v' -`--version' - Display the GASP version number. - - -File: gasp.info, Node: Commands, Next: Index, Prev: Invoking GASP, Up: Top - -Preprocessor Commands -********************* - - GASP commands have a straightforward syntax that fits in well with -assembly conventions. In general, a command extends for a line, and may -have up to three fields: an optional label, the command itself, and -optional arguments to the command. You can write commands in upper or -lower case, though this manual shows them in upper case. *Note Details -of the GASP syntax: Syntax Details, for more information. - -* Menu: - -* Conditionals:: -* Loops:: -* Variables:: -* Macros:: -* Data:: -* Listings:: -* Other Commands:: -* Syntax Details:: -* Alternate:: - - -File: gasp.info, Node: Conditionals, Next: Loops, Up: Commands - -Conditional assembly -==================== - - The conditional-assembly directives allow you to include or exclude -portions of an assembly depending on how a pair of expressions, or a -pair of strings, compare. - - The overall structure of conditionals is familiar from many other -contexts. `.AIF' marks the start of a conditional, and precedes -assembly for the case when the condition is true. An optional -`.AELSE' precedes assembly for the converse case, and an `.AENDI' marks -the end of the condition. - - You may nest conditionals up to a depth of 100; GASP rejects nesting -beyond that, because it may indicate a bug in your macro structure. - - Conditionals are primarily useful inside macro definitions, where you -often need different effects depending on argument values. *Note -Defining your own directives: Macros, for details about defining macros. - -`.AIF EXPRA CMP EXPRB' -`.AIF "STRA" CMP "STRB"' - The governing condition goes on the same line as the `.AIF' - preprocessor command. You may compare either two strings, or two - expressions. - - When you compare strings, only two conditional CMP comparison - operators are available: `EQ' (true if STRA and STRB are - identical), and `NE' (the opposite). - - When you compare two expressions, *both expressions must be - absolute* (*note Arithmetic expressions in GASP: Expressions.). - You can use these CMP comparison operators with expressions: - - `EQ' - Are EXPRA and EXPRB equal? (For strings, are STRA and STRB - identical?) - - `NE' - Are EXPRA and EXPRB different? (For strings, are STRA and - STRB different? - - `LT' - Is EXPRA less than EXPRB? (Not allowed for strings.) - - `LE' - Is EXPRA less than or equal to EXPRB? (Not allowed for - strings.) - - `GT' - Is EXPRA greater than EXPRB? (Not allowed for strings.) - - `GE' - Is EXPRA greater than or equal to EXPRB? (Not allowed for - strings.) - -`.AELSE' - Marks the start of assembly code to be included if the condition - fails. Optional, and only allowed within a conditional (between - `.AIF' and `.AENDI'). - -`.AENDI' - Marks the end of a conditional assembly. - - -File: gasp.info, Node: Loops, Next: Variables, Prev: Conditionals, Up: Commands - -Repetitive sections of assembly -=============================== - - Two preprocessor directives allow you to repeatedly issue copies of -the same block of assembly code. - -`.AREPEAT AEXP' -`.AENDR' - If you simply need to repeat the same block of assembly over and - over a fixed number of times, sandwich one instance of the - repeated block between `.AREPEAT' and `.AENDR'. Specify the - number of copies as AEXP (which must be an absolute expression). - For example, this repeats two assembly statements three times in - succession: - - .AREPEAT 3 - rotcl r2 - div1 r0,r1 - .AENDR - -`.AWHILE EXPRA CMP EXPRB' -`.AENDW' -`.AWHILE STRA CMP STRB' -`.AENDW' - To repeat a block of assembly depending on a conditional test, - rather than repeating it for a specific number of times, use - `.AWHILE'. `.AENDW' marks the end of the repeated block. The - conditional comparison works exactly the same way as for `.AIF', - with the same comparison operators (*note Conditional assembly: - Conditionals.). - - Since the terms of the comparison must be absolute expression, - `.AWHILE' is primarily useful within macros. *Note Defining your - own directives: Macros. - - You can use the `.EXITM' preprocessor directive to break out of -loops early (as well as to break out of macros). *Note Defining your -own directives: Macros. - - -File: gasp.info, Node: Variables, Next: Macros, Prev: Loops, Up: Commands - -Preprocessor variables -====================== - - You can use variables in GASP to represent strings, registers, or -the results of expressions. - - You must distinguish two kinds of variables: - 1. Variables defined with `.EQU' or `.ASSIGN'. To evaluate this kind - of variable in your assembly output, simply mention its name. For - example, these two lines define and use a variable `eg': - - eg .EQU FLIP-64 - ... - mov.l eg,r0 - - *Do not use* this kind of variable in conditional expressions or - while loops; GASP only evaluates these variables when writing - assembly output. - - 2. Variables for use during preprocessing. You can define these with - `.ASSIGNC' or `.ASSIGNA'. To evaluate this kind of variable, - write `\&' before the variable name; for example, - - opcit .ASSIGNA 47 - ... - .AWHILE \&opcit GT 0 - ... - .AENDW - - GASP treats macro arguments almost the same way, but to evaluate - them you use the prefix `\' rather than `\&'. *Note Defining your - own directives: Macros. - -`PVAR .EQU EXPR' - Assign preprocessor variable PVAR the value of the expression - EXPR. There are no restrictions on redefinition; use `.EQU' with - the same PVAR as often as you find it convenient. - -`PVAR .ASSIGN EXPR' - Almost the same as `.EQU', save that you may not redefine PVAR - using `.ASSIGN' once it has a value. - -`PVAR .ASSIGNA AEXPR' - Define a variable with a numeric value, for use during - preprocessing. AEXPR must be an absolute expression. You can - redefine variables with `.ASSIGNA' at any time. - -`PVAR .ASSIGNC "STR"' - Define a variable with a string value, for use during - preprocessing. You can redefine variables with `.ASSIGNC' at any - time. - -`PVAR .REG (REGISTER)' - Use `.REG' to define a variable that represents a register. In - particular, REGISTER is *not evaluated* as an expression. You may - use `.REG' at will to redefine register variables. - - All these directives accept the variable name in the "label" -position, that is at the left margin. You may specify a colon after -the variable name if you wish; the first example above could have -started `eg:' with the same effect. - - -File: gasp.info, Node: Macros, Next: Data, Prev: Variables, Up: Commands - -Defining your own directives -============================ - - The commands `.MACRO' and `.ENDM' allow you to define macros that -generate assembly output. You can use these macros with a syntax -similar to built-in GASP or assembler directives. For example, this -definition specifies a macro `SUM' that adds together a range of -consecutive registers: - - .MACRO SUM FROM=0, TO=9 - ! \FROM \TO - mov r\FROM,r10 - COUNT .ASSIGNA \FROM+1 - .AWHILE \&COUNT LE \TO - add r\&COUNT,r10 - COUNT .ASSIGNA \&COUNT+1 - .AENDW - .ENDM - -With that definition, `SUM 0,5' generates this assembly output: - - ! 0 5 - mov r0,r10 - add r1,r10 - add r2,r10 - add r3,r10 - add r4,r10 - add r5,r10 - -`.MACRO MACNAME' -`.MACRO MACNAME MACARGS ...' - Begin the definition of a macro called MACNAME. If your macro - definition requires arguments, specify their names after the macro - name, separated by commas or spaces. You can supply a default - value for any macro argument by following the name with `=DEFLT'. - For example, these are all valid `.MACRO' statements: - - `.MACRO COMM' - Begin the definition of a macro called `COMM', which takes no - arguments. - - `.MACRO PLUS1 P, P1' - `.MACRO PLUS1 P P1' - Either statement begins the definition of a macro called - `PLUS1', which takes two arguments; within the macro - definition, write `\P' or `\P1' to evaluate the arguments. - - `.MACRO RESERVE_STR P1=0 P2' - Begin the definition of a macro called `RESERVE_STR', with two - arguments. The first argument has a default value, but not - the second. After the definition is complete, you can call - the macro either as `RESERVE_STR A,B' (with `\P1' evaluating - to A and `\P2' evaluating to B), or as `RESERVE_STR ,B' (with - `\P1' evaluating as the default, in this case `0', and `\P2' - evaluating to B). - - When you call a macro, you can specify the argument values either - by position, or by keyword. For example, `SUM 9,17' is equivalent - to `SUM TO=17, FROM=9'. Macro arguments are preprocessor variables - similar to the variables you define with `.ASSIGNA' or `.ASSIGNC'; - in particular, you can use them in conditionals or for loop - control. (The only difference is the prefix you write to evaluate - the variable: for a macro argument, write `\ARGNAME', but for a - preprocessor variable, write `\&VARNAME'.) - -`NAME .MACRO' -`NAME .MACRO ( MACARGS ... )' - An alternative form of introducing a macro definition: specify the - macro name in the label position, and the arguments (if any) - between parentheses after the name. Defaulting rules and usage - work the same way as for the other macro definition syntax. - -`.ENDM' - Mark the end of a macro definition. - -`.EXITM' - Exit early from the current macro definition, `.AREPEAT' loop, or - `.AWHILE' loop. - -`\@' - GASP maintains a counter of how many macros it has executed in - this pseudo-variable; you can copy that number to your output with - `\@', but *only within a macro definition*. - -`LOCAL NAME [ , ... ]' - *Warning: `LOCAL' is only available if you select "alternate macro - syntax" with `-a' or `--alternate'.* *Note Alternate macro - syntax: Alternate. - - Generate a string replacement for each of the NAME arguments, and - replace any instances of NAME in each macro expansion. The - replacement string is unique in the assembly, and different for - each separate macro expansion. `LOCAL' allows you to write macros - that define symbols, without fear of conflict between separate - macro expansions. - - -File: gasp.info, Node: Data, Next: Listings, Prev: Macros, Up: Commands - -Data output -=========== - - In assembly code, you often need to specify working areas of memory; -depending on the application, you may want to initialize such memory or -not. GASP provides preprocessor directives to help you avoid -repetitive coding for both purposes. - - You can use labels as usual to mark the data areas. - -* Menu: - -* Initialized:: -* Uninitialized:: - - -File: gasp.info, Node: Initialized, Next: Uninitialized, Up: Data - -Initialized data ----------------- - - These are the GASP directives for initialized data, and the standard -GNU assembler directives they expand to: - -`.DATA EXPR, EXPR, ...' -`.DATA.B EXPR, EXPR, ...' -`.DATA.W EXPR, EXPR, ...' -`.DATA.L EXPR, EXPR, ...' - Evaluate arithmetic expressions EXPR, and emit the corresponding - `as' directive (labelled with LAB). The unqualified `.DATA' emits - `.long'; `.DATA.B' emits `.byte'; `.DATA.W' emits `.short'; and - `.DATA.L' emits `.long'. - - For example, `foo .DATA 1,2,3' emits `foo: .long 1,2,3'. - -`.DATAB REPEAT, EXPR' -`.DATAB.B REPEAT, EXPR' -`.DATAB.W REPEAT, EXPR' -`.DATAB.L REPEAT, EXPR' - Make `as' emit REPEAT copies of the value of the expression EXPR - (using the `as' directive `.fill'). `.DATAB.B' repeats one-byte - values; `.DATAB.W' repeats two-byte values; and `.DATAB.L' repeats - four-byte values. `.DATAB' without a suffix repeats four-byte - values, just like `.DATAB.L'. - - REPEAT must be an absolute expression with a positive value. - -`.SDATA "STR" ...' - String data. Emits a concatenation of bytes, precisely as you - specify them (in particular, *nothing is added to mark the end* of - the string). *Note String and numeric constants: Constants, for - details about how to write strings. `.SDATA' concatenates multiple - arguments, making it easy to switch between string - representations. You can use commas to separate the individual - arguments for clarity, if you choose. - -`.SDATAB REPEAT, "STR" ...' - Repeated string data. The first argument specifies how many - copies of the string to emit; the remaining arguments specify the - string, in the same way as the arguments to `.SDATA'. - -`.SDATAZ "STR" ...' - Zero-terminated string data. Just like `.SDATA', except that - `.SDATAZ' writes a zero byte at the end of the string. - -`.SDATAC "STR" ...' - Count-prefixed string data. Just like `.SDATA', except that GASP - precedes the string with a leading one-byte count. For example, - `.SDATAC "HI"' generates `.byte 2,72,73'. Since the count field - is only one byte, you can only use `.SDATAC' for strings less than - 256 bytes in length. - - -File: gasp.info, Node: Uninitialized, Prev: Initialized, Up: Data - -Uninitialized data ------------------- - - Use the `.RES', `.SRES', `.SRESC', and `.SRESZ' directives to -reserve memory and leave it uninitialized. GASP resolves these -directives to appropriate calls of the GNU `as' `.space' directive. - -`.RES COUNT' -`.RES.B COUNT' -`.RES.W COUNT' -`.RES.L COUNT' - Reserve room for COUNT uninitialized elements of data. The suffix - specifies the size of each element: `.RES.B' reserves COUNT bytes, - `.RES.W' reserves COUNT pairs of bytes, and `.RES.L' reserves - COUNT quartets. `.RES' without a suffix is equivalent to `.RES.L'. - -`.SRES COUNT' -`.SRES.B COUNT' -`.SRES.W COUNT' -`.SRES.L COUNT' - `.SRES' is a synonym for `.RES'. - -`.SRESC COUNT' -`.SRESC.B COUNT' -`.SRESC.W COUNT' -`.SRESC.L COUNT' - Like `.SRES', but reserves space for `COUNT+1' elements. - -`.SRESZ COUNT' -`.SRESZ.B COUNT' -`.SRESZ.W COUNT' -`.SRESZ.L COUNT' - Like `.SRES', but reserves space for `COUNT+1' elements. - - -File: gasp.info, Node: Listings, Next: Other Commands, Prev: Data, Up: Commands - -Assembly listing control -======================== - - The GASP listing-control directives correspond to related GNU `as' -directives. - -`.PRINT LIST' -`.PRINT NOLIST' - Print control. This directive emits the GNU `as' directive - `.list' or `.nolist', according to its argument. *Note `.list': - (as.info)List, for details on how these directives interact. - -`.FORM LIN=LN' -`.FORM COL=COLS' -`.FORM LIN=LN COL=COLS' - Specify the page size for assembly listings: LN represents the - number of lines, and COLS the number of columns. You may specify - either page dimension independently, or both together. If you do - not specify the number of lines, GASP assumes 60 lines; if you do - not specify the number of columns, GASP assumes 132 columns. (Any - values you may have specified in previous instances of `.FORM' do - *not* carry over as defaults.) Emits the `.psize' assembler - directive. - -`.HEADING STRING' - Specify STRING as the title of your assembly listings. Emits - `.title "STRING"'. - -`.PAGE' - Force a new page in assembly listings. Emits `.eject'. - - -File: gasp.info, Node: Other Commands, Next: Syntax Details, Prev: Listings, Up: Commands - -Miscellaneous commands -====================== - -`.ALTERNATE' - Use the alternate macro syntax henceforth in the assembly. *Note - Alternate macro syntax: Alternate. - -`.ORG' - This command is recognized, but not yet implemented. GASP - generates an error message for programs that use `.ORG'. - -`.RADIX S' - GASP understands numbers in any of base two, eight, ten, or - sixteen. You can encode the base explicitly in any numeric - constant (*note String and numeric constants: Constants.). If you - write numbers without an explicit indication of the base, the most - recent `.RADIX S' command determines how they are interpreted. S - is a single letter, one of the following: - - `.RADIX B' - Base 2. - - `.RADIX Q' - Base 8. - - `.RADIX D' - Base 10. This is the original default radix. - - `.RADIX H' - Base 16. - - You may specify the argument S in lower case (any of `bqdh') with - the same effects. - -`.EXPORT NAME' -`.GLOBAL NAME' - Declare NAME global (emits `.global NAME'). The two directives - are synonymous. - -`.PROGRAM' - No effect: GASP accepts this directive, and silently ignores it. - -`.END' - Mark end of each preprocessor file. GASP issues a warning if it - reaches end of file without seeing this command. - -`.INCLUDE "STR"' - Preprocess the file named by STR, as if its contents appeared - where the `.INCLUDE' directive does. GASP imposes a maximum limit - of 30 stacked include files, as a sanity check. - -`.ALIGN SIZE' - Evaluate the absolute expression SIZE, and emit the assembly - instruction `.align SIZE' using the result. - - -File: gasp.info, Node: Syntax Details, Next: Alternate, Prev: Other Commands, Up: Commands - -Details of the GASP syntax -========================== - - Since GASP is meant to work with assembly code, its statement syntax -has no surprises for the assembly programmer. - - *Whitespace* (blanks or tabs; *not* newline) is partially -significant, in that it delimits up to three fields in a line. The -amount of whitespace does not matter; you may line up fields in separate -lines if you wish, but GASP does not require that. - - The *first field*, an optional "label", must be flush left in a line -(with no leading whitespace) if it appears at all. You may use a colon -after the label if you wish; GASP neither requires the colon nor -objects to it (but will not include it as part of the label name). - - The *second field*, which must appear after some whitespace, -contains a GASP or assembly "directive". - - Any *further fields* on a line are "arguments" to the directive; you -can separate them from one another using either commas or whitespace. - -* Menu: - -* Markers:: -* Constants:: -* Symbols:: -* Expressions:: -* String Builtins:: - - -File: gasp.info, Node: Markers, Next: Constants, Up: Syntax Details - -Special syntactic markers -------------------------- - - GASP recognizes a few special markers: to delimit comments, to -continue a statement on the next line, to separate symbols from other -characters, and to copy text to the output literally. (One other -special marker, `\@', works only within macro definitions; *note -Defining your own directives: Macros..) - - The trailing part of any GASP source line may be a "comment". A -comment begins with the first unquoted comment character (`!' by -default), or an escaped or doubled comment character (`\!' or `!!' by -default), and extends to the end of a line. You can specify what -comment character to use with the `-c' option (*note Command Line -Options: Invoking GASP.). The two kinds of comment markers lead to -slightly different treatment: - -`!' - A single, un-escaped comment character generates an assembly - comment in the GASP output. GASP evaluates any preprocessor - variables (macro arguments, or variables defined with `.ASSIGNA' or - `.ASSIGNC') present. For example, a macro that begins like this - - .MACRO SUM FROM=0, TO=9 - ! \FROM \TO - - issues as the first line of output a comment that records the - values you used to call the macro. - -`\!' -`!!' - Either an escaped comment character, or a double comment character, - marks a GASP source comment. GASP does not copy such comments to - the assembly output. - - To *continue a statement* on the next line of the file, begin the -second line with the character `+'. - - Occasionally you may want to prevent GASP from preprocessing some -particular bit of text. To *copy literally* from the GASP source to -its output, place `\(' before the string to copy, and `)' at the end. -For example, write `\(\!)' if you need the characters `\!' in your -assembly output. - - To *separate a preprocessor variable* from text to appear -immediately after its value, write a single quote (`''). For example, -`.SDATA "\P'1"' writes a string built by concatenating the value of `P' -and the digit `1'. (You cannot achieve this by writing just `\P1', -since `P1' is itself a valid name for a preprocessor variable.) - - -File: gasp.info, Node: Constants, Next: Symbols, Prev: Markers, Up: Syntax Details - -String and numeric constants ----------------------------- - - There are two ways of writing "string constants" in GASP: as literal -text, and by numeric byte value. Specify a string literal between -double quotes (`"STR"'). Specify an individual numeric byte value as -an absolute expression between angle brackets (`'. Directives -that output strings allow you to specify any number of either kind of -value, in whatever order is convenient, and concatenate the result. -(Alternate syntax mode introduces a number of alternative string -notations; *note Alternate macro syntax: Alternate..) - - You can write "numeric constants" either in a specific base, or in -whatever base is currently selected (either 10, or selected by the most -recent `.RADIX'). - - To write a number in a *specific base*, use the pattern `S'DDD': a -base specifier character S, followed by a single quote followed by -digits DDD. The base specifier character matches those you can specify -with `.RADIX': `B' for base 2, `Q' for base 8, `D' for base 10, and `H' -for base 16. (You can write this character in lower case if you -prefer.) - - -File: gasp.info, Node: Symbols, Next: Expressions, Prev: Constants, Up: Syntax Details - -Symbols -------- - - GASP recognizes symbol names that start with any alphabetic -character, `_', or `$', and continue with any of the same characters or -with digits. Label names follow the same rules. - - -File: gasp.info, Node: Expressions, Next: String Builtins, Prev: Symbols, Up: Syntax Details - -Arithmetic expressions in GASP ------------------------------- - - There are two kinds of expressions, depending on their result: -"absolute" expressions, which resolve to a constant (that is, they do -not involve any values unknown to GASP), and "relocatable" expressions, -which must reduce to the form - - ADDSYM+CONST-SUBSYM - -where ADDSYM and SUBSYM are assembly symbols of unknown value, and -CONST is a constant. - - Arithmetic for GASP expressions follows very similar rules to C. -You can use parentheses to change precedence; otherwise, arithmetic -primitives have decreasing precedence in the order of the following -list. - - 1. Single-argument `+' (identity), `-' (arithmetic opposite), or `~' - (bitwise negation). *The argument must be an absolute expression.* - - 2. `*' (multiplication) and `/' (division). *Both arguments must be - absolute expressions.* - - 3. `+' (addition) and `-' (subtraction). *At least one argument must - be absolute.* - - 4. `&' (bitwise and). *Both arguments must be absolute.* - - 5. `|' (bitwise or) and `~' (bitwise exclusive or; `^' in C). *Both - arguments must be absolute.* - - -File: gasp.info, Node: String Builtins, Prev: Expressions, Up: Syntax Details - -String primitives ------------------ - - You can use these primitives to manipulate strings (in the argument -field of GASP statements): - -`.LEN("STR")' - Calculate the length of string `"STR"', as an absolute expression. - For example, `.RES.B .LEN("sample")' reserves six bytes of memory. - -`.INSTR("STRING", "SEG", IX)' - Search for the first occurrence of SEG after position IX of - STRING. For example, `.INSTR("ABCDEFG", "CDE", 0)' evaluates to - the absolute result `2'. - - The result is `-1' if SEG does not occur in STRING after position - IX. - -`.SUBSTR("STRING",START,LEN)' - The substring of STRING beginning at byte number START and - extending for LEN bytes. - - -File: gasp.info, Node: Alternate, Prev: Syntax Details, Up: Commands - -Alternate macro syntax -====================== - - If you specify `-a' or `--alternate' on the GASP command line, the -preprocessor uses somewhat different syntax. This syntax is -reminiscent of the syntax of Phar Lap macro assembler, but it is *not* -meant to be a full emulation of Phar Lap or similar assemblers. In -particular, GASP does not support directives such as `DB' and `IRP', -even in alternate syntax mode. - - In particular, `-a' (or `--alternate') elicits these differences: - -*Preprocessor directives* - You can use GASP preprocessor directives without a leading `.' - dot. For example, you can write `SDATA' with the same effect as - `.SDATA'. - -*LOCAL* - One additional directive, `LOCAL', is available. *Note Defining - your own directives: Macros, for an explanation of how to use - `LOCAL'. - -*String delimiters* - You can write strings delimited in these other ways besides - `"STRING"': - - `'STRING'' - You can delimit strings with single-quote charaters. - - `' - You can delimit strings with matching angle brackets. - -*single-character string escape* - To include any single character literally in a string (even if the - character would otherwise have some special meaning), you can - prefix the character with `!' (an exclamation mark). For example, - you can write `<4.3 !> 5.4!!>' to get the literal text `4.3 > - 5.4!'. - -*Expression results as strings* - You can write `%EXPR' to evaluate the expression EXPR and use the - result as a string. - - -File: gasp.info, Node: Index, Prev: Commands, Up: Top - -Index -***** - -* Menu: - -* ! default comment char: Invoking GASP. -* +: Markers. -* --alternate: Invoking GASP. -* --commentchar 'CHAR': Invoking GASP. -* --copysource: Invoking GASP. -* --debug: Invoking GASP. -* --help: Invoking GASP. -* --mri: Invoking GASP. -* --output OUTFILE: Invoking GASP. -* --print: Invoking GASP. -* --unreasonable: Invoking GASP. -* --version: Invoking GASP. -* -a: Invoking GASP. -* -c 'CHAR': Invoking GASP. -* -d: Invoking GASP. -* -h: Invoking GASP. -* -M: Invoking GASP. -* -o OUTFILE: Invoking GASP. -* -p: Invoking GASP. -* -s: Invoking GASP. -* -u: Invoking GASP. -* -v: Invoking GASP. -* .AELSE: Conditionals. -* .AENDI: Conditionals. -* .AENDR: Loops. -* .AENDW: Loops. -* .AIF "STRA" CMP "STRB": Conditionals. -* .AIF EXPRA CMP EXPRB: Conditionals. -* .ALIGN SIZE: Other Commands. -* .ALTERNATE: Other Commands. -* .AREPEAT AEXP: Loops. -* .AWHILE EXPRA CMP EXPRB: Loops. -* .AWHILE STRA CMP STRB: Loops. -* .DATA EXPR, EXPR, ...: Initialized. -* .DATA.B EXPR, EXPR, ...: Initialized. -* .DATA.L EXPR, EXPR, ...: Initialized. -* .DATA.W EXPR, EXPR, ...: Initialized. -* .DATAB REPEAT, EXPR: Initialized. -* .DATAB.B REPEAT, EXPR: Initialized. -* .DATAB.L REPEAT, EXPR: Initialized. -* .DATAB.W REPEAT, EXPR: Initialized. -* .END: Other Commands. -* .ENDM: Macros. -* .EXITM: Macros. -* .EXPORT NAME: Other Commands. -* .FORM COL=COLS: Listings. -* .FORM LIN=LN: Listings. -* .FORM LIN=LN COL=COLS: Listings. -* .GLOBAL NAME: Other Commands. -* .HEADING STRING: Listings. -* .INCLUDE "STR": Other Commands. -* .INSTR("STRING", "SEG", IX): String Builtins. -* .LEN("STR"): String Builtins. -* .MACRO MACNAME: Macros. -* .MACRO MACNAME MACARGS ...: Macros. -* .ORG: Other Commands. -* .PAGE: Listings. -* .PRINT LIST: Listings. -* .PRINT NOLIST: Listings. -* .PROGRAM: Other Commands. -* .RADIX S: Other Commands. -* .RES COUNT: Uninitialized. -* .RES.B COUNT: Uninitialized. -* .RES.L COUNT: Uninitialized. -* .RES.W COUNT: Uninitialized. -* .SDATA "STR" ...: Initialized. -* .SDATAB REPEAT, "STR" ...: Initialized. -* .SDATAC "STR" ...: Initialized. -* .SDATAZ "STR" ...: Initialized. -* .SRES COUNT: Uninitialized. -* .SRES.B COUNT: Uninitialized. -* .SRES.L COUNT: Uninitialized. -* .SRES.W COUNT: Uninitialized. -* .SRESC COUNT: Uninitialized. -* .SRESC.B COUNT: Uninitialized. -* .SRESC.L COUNT: Uninitialized. -* .SRESC.W COUNT: Uninitialized. -* .SRESZ COUNT: Uninitialized. -* .SRESZ.B COUNT: Uninitialized. -* .SRESZ.L COUNT: Uninitialized. -* .SRESZ.W COUNT: Uninitialized. -* .SUBSTR("STRING",START,LEN): String Builtins. -* ; as comment char: Invoking GASP. -* \@: Macros. -* absolute expressions: Expressions. -* argument fields: Syntax Details. -* avoiding preprocessing: Markers. -* bang, as comment: Invoking GASP. -* breaking out of loops: Loops. -* comment character, changing: Invoking GASP. -* comments: Markers. -* continuation character: Markers. -* copying literally to output: Markers. -* directive field: Syntax Details. -* EQ: Conditionals. -* exclamation mark, as comment: Invoking GASP. -* fields of GASP source line: Syntax Details. -* GE: Conditionals. -* GT: Conditionals. -* INFILE ...: Invoking GASP. -* label field: Syntax Details. -* LE: Conditionals. -* literal copy to output: Markers. -* LOCAL NAME [ , ... ]: Macros. -* loops, breaking out of: Loops. -* LT: Conditionals. -* macros, count executed: Macros. -* NAME .MACRO: Macros. -* NAME .MACRO ( MACARGS ... ): Macros. -* NE: Conditionals. -* number of macros executed: Macros. -* preprocessing, avoiding: Markers. -* PVAR .ASSIGN EXPR: Variables. -* PVAR .ASSIGNA AEXPR: Variables. -* PVAR .ASSIGNC "STR": Variables. -* PVAR .EQU EXPR: Variables. -* PVAR .REG (REGISTER): Variables. -* relocatable expressions: Expressions. -* semicolon, as comment: Invoking GASP. -* shriek, as comment: Invoking GASP. -* symbol separator: Markers. -* symbols, separating from text: Markers. -* text, separating from symbols: Markers. -* whitespace: Syntax Details. - - - -Tag Table: -Node: Top834 -Node: Overview1268 -Node: Invoking GASP2934 -Node: Commands6670 -Node: Conditionals7346 -Node: Loops9638 -Node: Variables11163 -Node: Macros13558 -Node: Data17520 -Node: Initialized17968 -Node: Uninitialized20247 -Node: Listings21258 -Node: Other Commands22454 -Node: Syntax Details24206 -Node: Markers25342 -Node: Constants27590 -Node: Symbols28792 -Node: Expressions29088 -Node: String Builtins30320 -Node: Alternate31101 -Node: Index32719 - -End Tag Table diff --git a/gnu/dist/gas/link.cmd b/gnu/dist/gas/link.cmd deleted file mode 100644 index a035ca87daa9..000000000000 --- a/gnu/dist/gas/link.cmd +++ /dev/null @@ -1,10 +0,0 @@ -ALIGN=1024 -RESNUM 0x0000, 0x8000 -; Putting in .lit1 gives errors. -ORDER .data=0x80002000, .data1, .lit, .bss -; Let's put this on the command line so it goes first, which is what -; GDB expects. -; LOAD /s2/amd/29k/lib/crt0.o -LOAD /s2/amd/29k/lib/libqcb0h.lib -LOAD /s2/amd/29k/lib/libscb0h.lib -LOAD /s2/amd/29k/lib/libacb0h.lib diff --git a/gnu/dist/gas/mac-as.r b/gnu/dist/gas/mac-as.r deleted file mode 100644 index f36c033cb070..000000000000 --- a/gnu/dist/gas/mac-as.r +++ /dev/null @@ -1,42 +0,0 @@ -/* Resources for GNU AS. */ - -#include "SysTypes.r" - -/* Version resources. */ - -resource 'vers' (1) { - 0, - 0, - 0, - 0, - verUs, - VERSION_STRING, - VERSION_STRING " (C) 1986-95 FSF, Inc." -}; - -resource 'vers' (2, purgeable) { - 0, - 0, - 0, - 0, - verUs, - VERSION_STRING, - "GAS " VERSION_STRING " for MPW" -}; - -#ifdef WANT_CFRG - -#include "CodeFragmentTypes.r" - -resource 'cfrg' (0) { - { - kPowerPC, - kFullLib, - kNoVersionNum, kNoVersionNum, - 0,0, - kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork, - PROG_NAME - } -}; - -#endif /* WANT_CFRG */ diff --git a/gnu/dist/gas/make-gas.com b/gnu/dist/gas/make-gas.com deleted file mode 100644 index 6b9bd3a71e0d..000000000000 --- a/gnu/dist/gas/make-gas.com +++ /dev/null @@ -1,153 +0,0 @@ -$!make-gas.com -$! Set the def dir to proper place for use in batch. Works for interactive to. -$flnm = f$enviroment("PROCEDURE") ! get current procedure name -$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' -$v = 'f$verify(0)' -$! -$! Command file to build a GNU assembler on VMS -$! -$! If you are using a version of GCC that supports global constants -$! you should remove the define="const=" from the gcc lines. -$! -$! Caution: Versions 1.38.1 and earlier had a bug in the handling of -$! some static constants. If you are using such a version of the -$! assembler, and you wish to compile without the "const=" hack, -$! you should first build this version *with* the "const=" -$! definition, and then use that assembler to rebuild it without the -$! "const=" definition. Failure to do this will result in an assembler -$! that will mung floating point constants. -$! -$! Note: The version of gas shipped on the GCC VMS tapes has been patched -$! to fix the above mentioned bug. -$! -$ !The gcc-vms driver was modified to use `-1' quite some time ago, -$ !so don't echo this text any more... -$ !write sys$output "If this assembler is going to be used with GCC 1.n, you" -$ !write sys$output "need to modify the driver to supply the -1 switch to gas." -$ !write sys$output "This is required because of a small change in how global" -$ !write sys$output "constant variables are handled. Failure to include this" -$ !write sys$output "will result in linker warning messages about mismatched -$ !write sys$output "psect attributes." -$! -$ gas_host="vms" -$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$ arch = f$element(arch_indx,"|","|VAX|Alpha|") -$ if arch.eqs."VAX" -$ then -$ cpu_type="vax" -$ obj_format="vms" -$ atof="vax" -$ else -$ cpu_type="alpha" -$ obj_format="evax" -$ atof="ieee" -$ endif -$ emulation="generic" -$! -$ COPY = "copy/noLog" -$! -$ C_DEFS :="""VMS""" -$! C_DEFS :="""VMS""","""const=""" -$ C_INCLUDES = "/Include=([],[.config],[-.include],[-.include.aout])" -$ C_FLAGS = "/noVerbose/Debug" + c_includes -$! -$! -$ on error then goto bail -$ if f$search("[-.libiberty]liberty.olb").eqs."" -$ then @[-.libiberty]vmsbuild.com -$ write sys$output "Now building gas." -$ endif -$ if "''p1'" .eqs. "LINK" then goto Link -$! -$! This helps gcc 1.nn find the aout/* files. -$! -$ aout_dev = f$parse(flnm,,,"DEVICE") -$ tmp = aout_dev - ":" -$if f$trnlnm(tmp).nes."" then aout_dev = f$trnlnm(tmp) -$ aout_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - - - "GAS]" + "INCLUDE.AOUT.]" - "][" -$assign 'aout_dir' aout/tran=conc -$ opcode_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - - - "GAS]" + "INCLUDE.OPCODE.]" - "][" -$assign 'opcode_dir' opcode/tran=conc -$! -$ set verify -$! -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]tc-'cpu_type'.obj [.config]tc-'cpu_type'.c -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]obj-'obj_format'.obj [.config]obj-'obj_format'.c -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]atof-'atof'.obj [.config]atof-'atof'.c -$ gcc 'c_flags'/Define=('C_DEFS') app.c -$ gcc 'c_flags'/Define=('C_DEFS') as.c -$ gcc 'c_flags'/Define=('C_DEFS') atof-generic.c -$ gcc 'c_flags'/Define=('C_DEFS') bignum-copy.c -$ gcc 'c_flags'/Define=('C_DEFS') cond.c -$ gcc 'c_flags'/Define=('C_DEFS') depend.c -$ gcc 'c_flags'/Define=('C_DEFS') ehopt.c -$ gcc 'c_flags'/Define=('C_DEFS') expr.c -$ gcc 'c_flags'/Define=('C_DEFS') flonum-konst.c -$ gcc 'c_flags'/Define=('C_DEFS') flonum-copy.c -$ gcc 'c_flags'/Define=('C_DEFS') flonum-mult.c -$ gcc 'c_flags'/Define=('C_DEFS') frags.c -$ gcc 'c_flags'/Define=('C_DEFS') hash.c -$ gcc 'c_flags'/Define=('C_DEFS') input-file.c -$ gcc 'c_flags'/Define=('C_DEFS') input-scrub.c -$ gcc 'c_flags'/Define=('C_DEFS') literal.c -$ gcc 'c_flags'/Define=('C_DEFS') messages.c -$ gcc 'c_flags'/Define=('C_DEFS') output-file.c -$ gcc 'c_flags'/Define=('C_DEFS') read.c -$ gcc 'c_flags'/Define=('C_DEFS') subsegs.c -$ gcc 'c_flags'/Define=('C_DEFS') symbols.c -$ gcc 'c_flags'/Define=('C_DEFS') write.c -$ gcc 'c_flags'/Define=('C_DEFS') listing.c -$ gcc 'c_flags'/Define=('C_DEFS') ecoff.c -$ gcc 'c_flags'/Define=('C_DEFS') stabs.c -$ gcc 'c_flags'/Define=('C_DEFS') sb.c -$ gcc 'c_flags'/Define=('C_DEFS') macro.c -$link: -$!'f$verify(0)' -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ create gcc-as.opt -! -! Linker options file for GNU assembler -! -$ open/Append ifile$ gcc-as.opt -$ write ifile$ "tc-''cpu_type'.obj" -$ write ifile$ "obj-''obj_format'.obj" -$ write ifile$ "atof-''atof'.obj" -$ COPY sys$input: ifile$: -app.obj,- -as.obj,- -atof-generic.obj,- -bignum-copy.obj,- -cond.obj,- -depend.obj,- -ehopt.obj,- -expr.obj,- -flonum-konst.obj,- -flonum-copy.obj,- -flonum-mult.obj,- -frags.obj,- -hash.obj,- -input-file.obj,- -input-scrub.obj,- -literal.obj,- -messages.obj,- -output-file.obj,- -read.obj,- -subsegs.obj,- -symbols.obj,- -write.obj,- -listing.obj,- -ecoff.obj,- -stabs.obj,- -sb.obj,- -macro.obj,- -[-.libiberty]liberty.olb/Lib -gnu_cc:[000000]gcclib.olb/Lib,sys$library:vaxcrtl.olb/Lib -! Tell linker exactly what psect attributes we want -- match VAXCRTL. -psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt -$ close ifile$ -$ set verify=(Proc,noImag) -$ link/noMap/Exec=gcc-as.exe gcc-as.opt/Opt,version.opt/Opt -$! -$bail: exit $status + 0*f$verify(v) !'f$verify(0)' diff --git a/gnu/dist/gas/makefile.vms b/gnu/dist/gas/makefile.vms deleted file mode 100644 index 4ffdb11699cd..000000000000 --- a/gnu/dist/gas/makefile.vms +++ /dev/null @@ -1,75 +0,0 @@ -# -# makefile for gas -# -# Created by Klaus K"ampf, kkaempf@progis.de -# - -ifeq ($(CC),gcc) -DEFS= -CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) -LFLAGS= -LIBS=,GNU_CC_LIBRARY:libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU_CC_LIBRARY:crt0.obj -else -DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\ -"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ -"_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec","const=") -CFLAGS=/noopt/debug/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS)\ -/warnings=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec) -LFLAGS= -LIBS=,sys$$library:vaxcrtl.olb/lib -endif - -OBJS=targ-cpu.obj,obj-format.obj,atof-targ.obj,app.obj,as.obj,atof-generic.obj,\ - bignum-copy.obj,cond.obj,depend.obj,expr.obj,flonum-konst.obj,flonum-copy.obj,\ - flonum-mult.obj,frags.obj,hash.obj,input-file.obj,input-scrub.obj,\ - literal.obj,messages.obj,output-file.obj,read.obj,subsegs.obj,symbols.obj,\ - write.obj,listing.obj,ecoff.obj,stabs.obj,sb.obj,macro.obj - -GASPOBJS = gasp.obj,macro.obj,sb.obj,hash.obj - -LIBIBERTY = [-.libiberty]libiberty.olb -LIBBFD = [-.bfd]libbfd.olb -LIBOPCODES = [-.opcodes]libopcodes.olb - -all: config.status [-.bfd]bfd.h as.exe gasp.exe - -as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY) - link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) - -gasp.exe: $(GASPOBJS) $(LIBBFD) $(LIBIBERTY) - link$(LFLAGS)/exe=$@ $(GASPOBJS),$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) - -config.status: - $$ @config-gas - -targ-cpu.c: [.config]tc-alpha.c - copy $< $@ -targ-cpu.h: [.config]tc-alpha.h - copy $< $@ -targ-env.h: [.config]te-generic.h - copy $< $@ -obj-format.h: [.config]obj-evax.h - copy $< $@ -obj-format.c: [.config]obj-evax.c - copy $< $@ -atof-targ.c: [.config]atof-ieee.c - copy $< $@ - -targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c - -[-.bfd]bfd.h: - $(CD) [-.bfd] - gmake -f makefile.vms - $(CD) [-.gas] - -clean: - $$ purge - $(RM) *.obj; - $(RM) *.exe; - $(RM) atof-targ.c; - $(RM) obj-format.c; - $(RM) obj-format.h; - $(RM) targ-env.h; - $(RM) targ-cpu.h; - $(RM) targ-cpu.c; - $(RM) config.status; diff --git a/gnu/dist/gas/mpw-config.in b/gnu/dist/gas/mpw-config.in deleted file mode 100644 index 9e29b1d945cf..000000000000 --- a/gnu/dist/gas/mpw-config.in +++ /dev/null @@ -1,115 +0,0 @@ -# Configuration fragment for GAS. - -Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'` - -If "{target_arch}" =~ /powerpc/ - Set short_arch_name "ppc" - Set target_cpu "powerpc" -Else - Set short_arch_name "{target_arch}" -End If - -# The following works for many configurations, though not all. - -Set obj_format `echo {target_canonical} | sed -e 's/.*-.*-//'` -Set target_os `echo {target_canonical} | sed -e 's/.*-.*-//'` - -Set bfd_gas no - -Set TDEFINES "" - -Set EXTRA_OBJECTS "" - -# Default emulation. - -Set em generic - -If "{target_canonical}" =~ /m68k-apple-macos/ - Set obj_format "coff" - Set TDEFINES '-d M68KCOFF' - Set EXTRA_OBJECTS '"{o}"m68k-parse.c.o' - -Else If "{target_canonical}" =~ /powerpc-apple-macos/ - Set obj_format "coff" - Set bfd_gas yes - Set em macos - -Else If "{target_canonical}" =~ /i386-\Option-x-go32/ - Set obj_format "coff" - Set TDEFINES '-d I386COFF' - -Else If "{target_canonical}" =~ /m68k-\Option-x-coff/ - Set TDEFINES '-d M68KCOFF' - -Else If "{target_canonical}" =~ /mips-idt-ecoff/ - Set bfd_gas yes - Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN=1' - -Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/ - # Assume other OSes etc use ELF - Set obj_format "elf" - Set bfd_gas yes - Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN=1' - forward-include "{srcroot}"bfd:elf-bfd.h 'bfd/elf-bfd.h' - -Else If "{target_canonical}" =~ /sh-\Option-x-hms/ - Set obj_format "coff" - forward-include "{srcroot}"opcodes:sh-opc.h 'opcodes/sh-opc.h' -End If - -forward-include "{srcdir}"config:tc-{short_arch_name}.c targ-cpu.c -forward-include "{srcdir}"config:tc-{short_arch_name}.h targ-cpu.h - -forward-include "{srcdir}"config:obj-{obj_format}.c obj-format.c -forward-include "{srcdir}"config:obj-{obj_format}.h obj-format.h - -forward-include "{srcdir}"config:te-{em}.h targ-env.h - -# Special cases for float handling. - -If "{target_arch}" =~ /ns32k/ - forward-include "{srcdir}"config:atof-ns32k.c atof-targ.c -Else If "{target_arch}" =~ /tahoe/ - forward-include "{srcdir}"config:atof-tahoe.c atof-targ.c -Else If "{target_arch}" =~ /vax/ - forward-include "{srcdir}"config:atof-vax.c atof-targ.c -Else - # Use IEEE by default. - forward-include "{srcdir}"config:atof-ieee.c atof-targ.c -End If - -Echo '# From mpw-config.in' > "{o}"mk.tmp -Echo "TDEFINES = " {TDEFINES} >> "{o}"mk.tmp -Echo "EXTRA_OBJECTS = " {EXTRA_OBJECTS} >> "{o}"mk.tmp -# (We use the -n option here so as not to get extra spaces inserted) -Echo -n 'TARG_CPU_DEP = {TARG_CPU_DEP_' >> "{o}"mk.tmp -Echo -n {short_arch_name} >> "{o}"mk.tmp -Echo -n '}' >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* conf. Generated by mpw-configure. */' > "{o}"conf.new -Echo -n '#define TARGET_CPU "' >> "{o}"conf.new -Echo -n "{target_cpu}" >> "{o}"conf.new -Echo '"' >> "{o}"conf.new -Echo -n '#define TARGET_OS "' >> "{o}"conf.new -Echo -n "{target_os}" >> "{o}"conf.new -Echo '"' >> "{o}"conf.new -Echo -n '#define TARGET_ALIAS "' >> "{o}"conf.new -Echo -n "{target_alias}" >> "{o}"conf.new -Echo '"' >> "{o}"conf.new -Echo -n '#define TARGET_CANONICAL "' >> "{o}"conf.new -Echo -n "{target_canonical}" >> "{o}"conf.new -Echo '"' >> "{o}"conf.new -Echo '#include "mpw.h"' >> "{o}"conf.new -If "{bfd_gas}" =~ /yes/ - Echo "#define BFD_ASSEMBLER" >> "{o}"conf.new -Else - Echo "#define MANY_SEGMENTS" >> "{o}"conf.new -End If -Echo '#define CR_EOL' >> "{o}"conf.new -Echo '#define OBJ_COFF_OMIT_TIMESTAMP' >> "{o}"conf.new -Echo '#define LOSING_COMPILER' >> "{o}"conf.new - -MoveIfChange "{o}"conf.new "{o}"conf - -sed -e "s/@srcdir@/{srcdir}/" "{srcdir}"gdbinit.in > "{o}"_gdbinit diff --git a/gnu/dist/gas/mpw-make.sed b/gnu/dist/gas/mpw-make.sed deleted file mode 100644 index 16f12a505500..000000000000 --- a/gnu/dist/gas/mpw-make.sed +++ /dev/null @@ -1,100 +0,0 @@ -# Sed commands that finish translating the GAS Unix Makefile to MPW syntax. - -/^# @target_frag@/a\ -\ -HDEFINES = \ -LOCAL_LOADLIBES = \ - -/^srcroot = /s/^/#/ -/^target_alias = /s/^/#/ - -/INCLUDES/s/-i "{srcdir}":\([a-z]*\)/-i "{topsrcdir}"\1/ -/INCLUDES/s/-i "{srcdir}"\.\./-i "{topsrcdir}"/ - -/^INCLUDES = .*$/s/$/ -i "{topsrcdir}"include:mpw: -i ::extra-include:/ - -/$(TARG_CPU_DEP_@target_cpu_type@)/s/$(TARG_CPU_DEP_@target_cpu_type@)/{TARG_CPU_DEP}/ - -/@OPCODES_LIB@/s/@OPCODES_LIB@/::opcodes:libopcodes.o/ -/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/ - -# Point at the libraries directly. -/@OPCODES_DEP@/s/@OPCODES_DEP@/::opcodes:libopcodes.o/ -/@BFDDEP@/s/@BFDDEP@/::bfd:libbfd.o/ - -# Don't need this. -/@HLDFLAGS@/s/@HLDFLAGS@// - -/extra_objects@/s/extra_objects@/{EXTRA_OBJECTS}/ - -/LOADLIBES/s/{LOADLIBES}/{EXTRALIBS}/ - -/@ALL_OBJ_DEPS@/s/@ALL_OBJ_DEPS@/::bfd:bfd.h/ - -# This causes problems - not sure why. -/^tags TAGS/,/etags /d - -/^make-gas.com/s/^/#/ - -/true/s/ ; @true$// - -# Remove references to conf.in, we don't need them. -/conf\.in/s/conf\.in//g - -# Use _gdbinit everywhere instead of .gdbinit. -/gdbinit/s/\.gdbinit/_gdbinit/g - -/atof-targ/s/"{s}"atof-targ\.c/"{o}"atof-targ.c/g -/config/s/"{s}"config\.h/"{o}"config.h/g -/config/s/^config\.h/"{o}"config.h/ -/obj-format/s/"{s}"obj-format\.c/"{o}"obj-format.c/g -/obj-format/s/"{s}"obj-format\.h/"{o}"obj-format.h/g -/targ-cpu/s/"{s}"targ-cpu\.c/"{o}"targ-cpu.c/g -/targ-cpu/s/"{s}"targ-cpu\.h/"{o}"targ-cpu.h/g -/targ-env/s/"{s}"targ-env\.h/"{o}"targ-env.h/g - -/m68k-parse.c/s/"{s}"m68k-parse\.c/"{o}"m68k-parse.c/g -/m68k-parse.c/s/^m68k-parse\.c/"{o}"m68k-parse.c/ - -# Whack out the config.h dependency, it only causes excess rebuilds. -/{OBJS}/s/{OBJS} \\Option-f "{o}"config.h/{OBJS} \\Option-f/ -/gasp.c/s/gasp\.c "{o}"config.h/gasp.c/ - -# ALL_CFLAGS includes TDEFINES, which is not desirable at link time. -/CC_LD/s/ALL_CFLAGS/CFLAGS/g - -# The resource file is called mac-as.r. -/as.new.r/s/as\.new\.r/mac-as.r/ -/gasp.new.r/s/gasp\.new\.r/mac-as.r/ - -# ...and the PROG_NAME doesn't have a .new in it. -/PROG_NAME/s/PROG_NAME='"'as.new'"'/PROG_NAME='"'as'"'/ -/PROG_NAME/s/PROG_NAME='"'gasp.new'"'/PROG_NAME='"'gasp'"'/ - -# Whack out recursive makes, they won't work. -/^[ ][ ]*srcroot=/,/^[ ][ ]*(cd /d - -# Work around quoting problems by using multiple echo commands. -/'#define GAS_VERSION "{VERSION}"'/c\ - Echo -n '#define GAS_VERSION "' >> "{o}"config.new\ - Echo -n "{VERSION}" >> "{o}"config.new\ - Echo -n '"' >> "{o}"config.new - -# Add a "stamps" target. -$a\ -stamps \\Option-f config-stamp\ - -/^install \\Option-f/,/^$/c\ -install \\Option-f all install-only\ -\ -install-only \\Option-f\ - NewFolderRecursive "{bindir}"\ - Duplicate -y :as.new "{bindir}"as\ - Duplicate -y :gasp.new "{bindir}"gasp\ - - -# Whack out config-rebuilding targets, they won't work. -/^Makefile \\Option-f/,/^$/d -/^config.status \\Option-f/,/^$/d - -/^"{o}"config.h \\Option-f/s/^/#/ diff --git a/gnu/dist/gcc/config/msdos/configur.bat b/gnu/dist/gcc/config/msdos/configur.bat deleted file mode 100644 index 03e410916866..000000000000 --- a/gnu/dist/gcc/config/msdos/configur.bat +++ /dev/null @@ -1,47 +0,0 @@ -@echo off -echo Configuring GCC for go32 -rem This batch file assumes a unix-type "sed" program - -if not exist config\msdos\configure.bat chdir ..\.. - -update config\i386\xm-dos.h config.h -update config\i386\xm-dos.h hconfig.h -update config\i386\xm-dos.h tconfig.h -update config\i386\go32.h tm.h -update config\i386\i386.md md -update config\i386\i386.c aux-output.c - -echo # Makefile generated by "configure.bat"> Makefile -echo all.dos: cccp cc1 cc1obj xgcc libgcc.a s-objlist >> Makefile -sed -f config/msdos/top.sed Makefile.in >> Makefile - -set LANG= - -if not exist ada\make-lang.in goto no_ada -sed -f config/msdos/top.sed ada\make-lang.in >> Makefile -sed -f config/msdos/top.sed ada\makefile.in > ada\Makefile -set LANG=%LANG% ada.& -:no_ada - -if not exist cp\make-lang.in goto no_cp -sed -f config/msdos/top.sed cp\make-lang.in >> Makefile -sed -f config/msdos/top.sed cp\makefile.in > cp\Makefile -set LANG=%LANG% c++.& -:no_cp - -echo lang.mostlyclean: %LANG% | sed "s/&/mostlyclean/g" >> Makefile -echo lang.clean: %LANG% | sed "s/&/clean/g" >> Makefile -echo lang.distclean: %LANG% | sed "s/&/distclean/g" >> Makefile -echo lang.maintainer-clean: %LANG% | sed "s/&/maintainer-clean/g" >> Makefile -echo /* options.h */ > options.h -if exist cp\lang-options.h echo #include "cp/lang-options.h" >> options.h -if exist ada\lang-options.h echo #include "ada/lang-options.h" >> options.h -if exist f\lang-options.h echo #include "f/lang-options.h" >> options.h -echo /* specs.h */ > specs.h -if exist cp\lang-specs.h echo #include "cp/lang-specs.h" >> specs.h -if exist ada\lang-specs.h echo #include "ada/lang-specs.h" >> specs.h -if exist f\lang-specs.h echo #include "f/lang-specs.h" >> specs.h - -echo #define MULTILIB_SELECT ". ;" > multilib.h1 -update multilib.h1 multilib.h -del multilib.h1 diff --git a/gnu/dist/gcc/config/t-gnu b/gnu/dist/gcc/config/t-gnu deleted file mode 100644 index 58969f21e209..000000000000 --- a/gnu/dist/gcc/config/t-gnu +++ /dev/null @@ -1,13 +0,0 @@ -LIBGCC1=libgcc1.null -CROSS_LIBGCC1=libgcc1.null - -# The pushl in CTOR initialization interferes with frame pointer elimination. - -# We need to use -fPIC when we are using gcc to compile the routines in -# crtstuff.c. This is only really needed when we are going to use gcc/g++ -# to produce a shared library, but since we don't know ahead of time when -# we will be doing that, we just always use -fPIC when compiling the -# routines in crtstuff.c. - -CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer -TARGET_LIBGCC2_CFLAGS = -fPIC diff --git a/gnu/dist/gcc/config/t-linux b/gnu/dist/gcc/config/t-linux deleted file mode 100644 index d67feed83c12..000000000000 --- a/gnu/dist/gcc/config/t-linux +++ /dev/null @@ -1,16 +0,0 @@ -# Don't run fixproto -STMP_FIXPROTO = - -# Don't install "assert.h" in gcc. We use the one in glibc. -INSTALL_ASSERT_H = - -# Compile crtbeginS.o and crtendS.o with pic. -CRTSTUFF_T_CFLAGS_S = -fPIC -# Compile libgcc2.a with pic. -TARGET_LIBGCC2_CFLAGS = -fPIC - -# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux -# C library can handle them. -LIBGCC1 = -CROSS_LIBGCC1 = -LIBGCC1_TEST = diff --git a/gnu/dist/gcc/config/t-linux-aout b/gnu/dist/gcc/config/t-linux-aout deleted file mode 100644 index 8826cddcab65..000000000000 --- a/gnu/dist/gcc/config/t-linux-aout +++ /dev/null @@ -1,11 +0,0 @@ -# Don't run fixproto -STMP_FIXPROTO = - -# Don't install "assert.h" in gcc. We use the one in glibc. -INSTALL_ASSERT_H = - -# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux -# C library can handle them. -LIBGCC1 = -CROSS_LIBGCC1 = -LIBGCC1_TEST = diff --git a/gnu/dist/gcc/config/t-linux-gnulibc1 b/gnu/dist/gcc/config/t-linux-gnulibc1 deleted file mode 100644 index 7bb7bce85b35..000000000000 --- a/gnu/dist/gcc/config/t-linux-gnulibc1 +++ /dev/null @@ -1,2 +0,0 @@ -# We are building for the Linux C library 5. -T_CFLAGS = -DUSE_GNULIBC_1 diff --git a/gnu/dist/gcc/config/t-rtems b/gnu/dist/gcc/config/t-rtems deleted file mode 100644 index aa0ca66d98b8..000000000000 --- a/gnu/dist/gcc/config/t-rtems +++ /dev/null @@ -1,6 +0,0 @@ -# RTEMS uses newlib which does not require prototype fixing -STMP_FIXPROTO = - -# Don't install "assert.h" in gcc. RTEMS uses the one in newlib. -INSTALL_ASSERT_H = - diff --git a/gnu/dist/gcc/config/t-svr4 b/gnu/dist/gcc/config/t-svr4 deleted file mode 100644 index e6be0c3b0c8f..000000000000 --- a/gnu/dist/gcc/config/t-svr4 +++ /dev/null @@ -1,8 +0,0 @@ -# We need to use -fPIC when we are using gcc to compile the routines in -# crtstuff.c. This is only really needed when we are going to use gcc/g++ -# to produce a shared library, but since we don't know ahead of time when -# we will be doing that, we just always use -fPIC when compiling the -# routines in crtstuff.c. Likewise for libgcc2.c. - -CRTSTUFF_T_CFLAGS = -fPIC -TARGET_LIBGCC2_CFLAGS = -fPIC diff --git a/gnu/dist/gcc/config/winnt/config-nt.bat b/gnu/dist/gcc/config/winnt/config-nt.bat deleted file mode 100644 index 688d1264e898..000000000000 --- a/gnu/dist/gcc/config/winnt/config-nt.bat +++ /dev/null @@ -1,58 +0,0 @@ -echo Configuring GCC for Windows NT on %2 -rem This batch file assumes a unix-type "sed" program - -if %2.==alpha. echo #include "alpha/xm-alpha.h" >config.h -if %2.==alpha. echo #include "winnt/xm-winnt.h" >>config.h -if %2.==alpha. echo #include "alpha/xm-winnt.h" >>config.h -if not %2.==alpha. echo #include "%2/xm-winnt.h" >config.h -copy config.h hconfig.h -copy config.h tconfig.h - -if %2.==alpha. echo #define TARGET_CPU_DEFAULT 64 >tm.h -if %2.==alpha. echo #include "alpha/alpha.h" >>tm.h -if %2.==alpha. echo #include "alpha/win-nt.h" >>tm.h -if not %2.==alpha. echo #include "%2/win-nt.h" >tm.h - -rem This batch file assumes a unix-type "sed" program - -echo # Makefile generated by "config-nt.bat"> Makefile -echo all.nt: cpp.exe cc1.exe cc1obj.exe xgcc.exe ld.exe stmp-headers libgcc.lib stmp-float_h specs stamp-objlist>> Makefile -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed Makefile.in >> Makefile - -set LANG= - -echo # >specs.h -echo # >options.h - -if not exist cp\make-lang.in goto no_cp -if exist cp\lang-specs.h echo #include "cp/lang-specs.h">>specs.h -if exist cp\lang-options.h echo #include "cp/lang-options.h">>options.h -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed cp\make-lang.in >> Makefile -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed cp\makefile.in > cp\Makefile -set LANG=%LANG% c++.# -:no_cp - -if not exist ada\make-lang.in goto no_ada -if exist ada\lang-specs.h echo #include "ada/lang-specs.h">>specs.h -if exist ada\lang-options.h echo #include "ada/lang-options.h">>options.h -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed ada\make-lang.in >> Makefile -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed ada\makefile.in > ada\Makefile -set LANG=%LANG% ada.# -:no_ada - -if not exist f\make-lang.in goto no_f -if exist f\lang-specs.h echo #include "f/lang-specs.h">>specs.h -if exist f\lang-options.h echo #include "f/lang-options.h">>options.h -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed f\make-lang.in >> Makefile -sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed f\makefile.in > f\Makefile -set LANG=%LANG% f.# -:no_f - -echo lang.mostlyclean: %LANG% | sed "s/#/mostlyclean/g" >> Makefile -echo lang.clean: %LANG% | sed "s/#/clean/g" >> Makefile -echo lang.distclean: %LANG% | sed "s/#/distclean/g" >> Makefile -echo lang.realclean: %LANG% | sed "s/#/realclean/g" >> Makefile - -echo #define MULTILIB_SELECT ". ;" > multilib.h1 -copy multilib.h1 multilib.h -del multilib.h1 diff --git a/gnu/dist/gcc/configure.bat b/gnu/dist/gcc/configure.bat deleted file mode 100644 index 33cbe65df6e1..000000000000 --- a/gnu/dist/gcc/configure.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -if %1.==go32. goto call_go32 -if %1.==winnt. goto call_winnt -echo Usage: configure go32 or configure winnt cpu -goto END - -:call_go32 -call config\msdos\configure %1 %2 %3 %4 -goto END - -:call_winnt -if %2.==i386. goto really_call_winnt -if %2.==alpha. goto really_call_winnt -echo Usage: configure winnt i386 or configure winnt alpha -goto END -:really_call_winnt -call config\winnt\config-nt %1 %2 %3 %4 -goto END - -:END - diff --git a/gnu/dist/gcc/cp/mpw-config.in b/gnu/dist/gcc/cp/mpw-config.in deleted file mode 100644 index 88dd85f72e9f..000000000000 --- a/gnu/dist/gcc/cp/mpw-config.in +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration fragment for G++. -# Most of the real configuration work happens in the main GCC configure. - -# We need to join some lines in the Makefile.in before the sed -# process will work properly. The funky little sed script works by -# recognizing lines with a trailing '$@ \', adding the next line to -# its "pattern space", editing out the backslash and line, then -# putting the result out. - -sed -e '/$@ \\/{N;s/$@ \\./$@ /;P;D;}' \Option-d - "{srcdir}"Makefile.in >"{o}"hacked_Makefile.in diff --git a/gnu/dist/gcc/cp/mpw-make.sed b/gnu/dist/gcc/cp/mpw-make.sed deleted file mode 100644 index 120b5a1fa3a5..000000000000 --- a/gnu/dist/gcc/cp/mpw-make.sed +++ /dev/null @@ -1,112 +0,0 @@ -# Sed commands to finish translating the G++ Unix makefile into MPW syntax. - -# Remove control-Ls, they upset MPW make. -s/ //g - -# Remove references to always-empty variables used to mark things. -/CYGNUS-LOCAL-/s/{CYGNUS-LOCAL-[a-z0-9]*}//g - -# Add a bunch of definitions, mostly empty. -/^# Variables that exist for you to override.$/a\ -\ -xmake_file = \ -tmake_file = \ -build_xm_file = \ -MALLOC = \ -MD_DEPS = \ -REAL_H = \ -HOST_CC_LD = {CC_LD}\ -ALL_CCLDFLAGS = \ -HOST_CCLDFLAGS = \ -CONFIG_H = \ -LIBDEPS = \ - -# The "target" variable is special to MPW make, avoid it. -/{target}/s/{target}/{target_canonical}/g - -# Suppress the suppression of smart makes. -/^\.y\.c/d - -# Whack out "..." assignments. -/\.\.\./s/^\([a-z_]*= \.\.\.\)/#\1/ - -# Previous edits go a little overboard, undo. -/^objext = /s/"{o}"// - -# Always link in low-level MPW functions. -/^LIBDEPS=/s/$/ ::strerror.c.o ::mpwlib.c.o/ -/{CLIB}/s/{CLIB}/ ::strerror.c.o ::mpwlib.c.o {CLIB}/ - -# Don't get tricky about finding various .o file, point at dir above. -/^SUBDIR_OBSTACK/s/`.*`/::obstack.c.o/ -/^SUBDIR_USE_ALLOCA/s/`.*`/::alloca.c.o/ -/^SUBDIR_MALLOC/s/`.*`// - -# Point includes at parent directly correctly. -/^INCLUDES = /s/:\./::/g -/^INCLUDES = /s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g -/^INCLUDES = /s,"{srcdir}"/\.\.,"{topsrcdir}"gcc:,g -/^INCLUDES = /s,"{srcdir}":config,"{topsrcdir}"gcc:config:,g - -# Add the special MPW include dirs. -/^INCLUDES = /s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/ - -# A nasty hack to reduce confusion. -/true/s/ ; @true$// - -# (should be in common translation?) -/{CC_LD} /s/$/ {EXTRALIBS}/ - -# Don't use general compiler flags (which may include definitions -# and other compiler-only bits) with linking commands. -/{CC_LD} /s/ALL_CFLAGS/ALL_CCLDFLAGS/ - -# Whack out build rules that are not useful. -/^Makefile \\Option-f /,/^$/d -/^config.status \\Option-f /,/^$/d -# (Note that MPW make is not case sensitive, and so this name -# is considered the same as "md_file".) -/^{MD_FILE} \\Option-f/,/^$/d - -# Depending on config.status is not useful for us. -/config.status/s/ config.status// - -# Repeat of stuff from generic edit. -/{s}/s/"{s}""{s}"/"{s}"/g -/{s}/s/"{s}""{srcdir}"/"{s}"/g -/{s}/s/"{srcdir}""{s}"/"{s}"/g - -# Fix references to C frontend files in main dir. -/::c-/s/"{o}"::c-/"{o}":c-/g - -# Fix pathnames to generated files in the objdir. -/parse/s/"{s}"parse\.\([chy]\)/"{o}"parse.\1/g -/parse/s/^parse\.\([chy]\)/"{o}"parse.\1/ -/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g -/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/ -/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g -/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/ - -# Put in the definition of YYEMPTY directly. -/grep/s/grep .* >>/Echo '#define YYEMPTY -1' >>/ - -# If the dates are wrong, then this tries to run gperf, which we don't -# really want. -/^"{srcdir}"hash.h/,/hash.h$/d - -# Sed the object file list instead of using cat (meow). -/cat/s/`cat /`sed -e 's,:,::,g' -e 's,{objext},.o,g' / - -# Simplify dependencies of generated parser files. -/^{PARSE_C}/s/^/#/ -/^stamp-parse/s/^stamp-parse/{PARSE_C}/ - -# Fix the compile line for the generated parser. -/{CC} -c/,/echo {PARSE_C}/c\ - {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\ - -# Change all Rez commands to use mac-gcc.r. -/{REZ}/s/"{s}"[-a-zA-Z{}]*\.r/"{topsrcdir}"gcc:mac-gcc.r/ - -# Remove pathname junk from the container name. -/{REZ}/s/'"'::cc1plus'"'/'"'cc1plus'"'/ diff --git a/gnu/dist/gcc/fixinc.dgux b/gnu/dist/gcc/fixinc.dgux deleted file mode 100644 index 422ba5f725fd..000000000000 --- a/gnu/dist/gcc/fixinc.dgux +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/sh -# -# modified for dgux by hassey@dg-rtp.dg.com based on -# -# fixinc.svr4 written by Ron Guilmette (rfg@ncd.com). -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# -# See README-fixinc for more information. - -# Directory containing the original header files. -INPUT=${2-${INPUT-/usr/include}} - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - cd $LIB; LIB=`${PWDCMD-pwd}` - ;; -esac - -echo 'Building fixincludes in ' ${LIB} - -# Determine whether this filesystem has symbolic links. -if ln -s X $LIB/ShouldNotExist 2>/dev/null; then - rm -f $LIB/ShouldNotExist - LINKS=true -else - LINKS=false -fi - -echo 'Making directories:' -cd ${INPUT} -if $LINKS; then - files=`ls -LR | sed -n s/:$//p` -else - files=`find . -type d -print | sed '/^.$/d'` -fi -for file in $files; do - rm -rf $LIB/$file - if [ ! -d $LIB/$file ] - then mkdir $LIB/$file - fi -done - -# treetops gets an alternating list -# of old directories to copy -# and the new directories to copy to. -treetops="${INPUT} ${LIB}" - -if $LINKS; then - echo 'Making internal symbolic directory links' - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if [ "$dest" ]; then - cwd=`pwd` - # In case $dest is relative, get to $file's dir first. - cd ${INPUT} - cd `echo ./$file | sed -n 's&[^/]*$&&p'` - # Check that the target directory exists. - # Redirections changed to avoid bug in sh on Ultrix. - (cd $dest) > /dev/null 2>&1 - if [ $? = 0 ]; then - cd $dest - # X gets the dir that the link actually leads to. - x=`pwd` - # If link leads back into ${INPUT}, - # make a similar link here. - if expr $x : "${INPUT}/.*" > /dev/null; then - # Y gets the actual target dir name, relative to ${INPUT}. - y=`echo $x | sed -n "s&${INPUT}/&&p"` - # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. - dots=`echo "$file" | - sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` - echo $file '->' $dots$y ': Making link' - rm -fr ${LIB}/$file > /dev/null 2>&1 - ln -s $dots$y ${LIB}/$file > /dev/null 2>&1 - else - # If the link is to outside ${INPUT}, - # treat this directory as if it actually contained the files. -# This line used to have $dest instead of $x. -# $dest seemed to be wrong for links found in subdirectories -# of ${INPUT}. Does this change break anything? - treetops="$treetops $x ${LIB}/$file" - fi - fi - cd $cwd - fi - done -fi - -# Completely replace <_int_varargs.h> with a file that defines -# va_list and gnuc_va_list - -file=_int_varargs.h -if [ -r ${INPUT}/$file ]; then - echo Replacing $file - cat > ${LIB}/$file << EOF -/* This file was generated by fixinc.dgux. */ -#ifndef __INT_VARARGS_H -#define __INT_VARARGS_H - -#if defined(__m88k__) && defined (__DGUX__) -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST -typedef struct -{ - int __va_arg; /* argument number */ - int *__va_stk; /* start of args passed on stack */ - int *__va_reg; /* start of args passed in regs */ -} __gnuc_va_list; -#endif /* not __GNUC_VA_LIST */ -#endif /* 88k && dgux */ - -#ifndef _VA_LIST_ -#define _VA_LIST_ -typedef __gnuc_va_list va_list; -#endif /* _VA_LIST_ */ - -#endif /* __INT_VARARGS_H */ - -EOF - chmod a+r ${LIB}/$file -fi - -echo 'Removing unneeded directories:' -cd $LIB -files=`find . -type d -print | sort -r` -for file in $files; do - rmdir $LIB/$file > /dev/null 2>&1 -done - -if $LINKS; then - echo 'Making internal symbolic non-directory links' - cd ${INPUT} - files=`find . -type l -print` - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if expr "$dest" : '[^/].*' > /dev/null; then - target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"` - if [ -f $target ]; then - ln -s $dest ${LIB}/$file >/dev/null 2>&1 - fi - fi - done -fi - -cd ${ORIG_DIR} - -exit 0 - diff --git a/gnu/dist/gcc/fixinc.irix b/gnu/dist/gcc/fixinc.irix deleted file mode 100644 index 337289a121ed..000000000000 --- a/gnu/dist/gcc/fixinc.irix +++ /dev/null @@ -1,190 +0,0 @@ -#! /bin/sh -# Install modified versions of certain problematic Irix include files. -# Copyright (C) 1997 Free Software Foundation, Inc. -# Contributed by Brendan Kehoe (brendan@cygnus.com). -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# See README-fixinc for more information. - -# Directory containing the original header files. -INPUT=${2-${INPUT-/usr/include}} - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - LIB=$ORIG_DIR/$LIB - ;; -esac - -echo 'Building fixincludes in ' ${LIB} - -# -# Note: For Irix, we deliberately don't try to create the directory trees, -# since we only modify math.h, limits.h and unistd.h. If we -# ADD ANY OTHERS, the "Making directories:" and symlinks code from -# fixinc.svr4 may have to go back in. - -# The Irix math.h defines struct exception, which conflicts with -# the class exception defined in the C++ file std/stdexcept.h. We -# redefine it to __math_exception. This is not a great fix, but I -# haven't been able to think of anything better. -file=math.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/struct exception/i\ -#ifdef __cplusplus\ -#define exception __math_exception\ -#endif'\ - -e '/struct exception/a\ -#ifdef __cplusplus\ -#undef exception\ -#endif' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# In limits.h, put #ifndefs around things that are supposed to be defined -# in float.h to avoid redefinition errors if float.h is included first. - -file=limits.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/[ ]FLT_MIN[ ]/i\ -#ifndef FLT_MIN -'\ - -e '/[ ]FLT_MIN[ ]/a\ -#endif -'\ - -e '/[ ]FLT_MAX[ ]/i\ -#ifndef FLT_MAX -'\ - -e '/[ ]FLT_MAX[ ]/a\ -#endif -'\ - -e '/[ ]FLT_DIG[ ]/i\ -#ifndef FLT_DIG -'\ - -e '/[ ]FLT_DIG[ ]/a\ -#endif -'\ - -e '/[ ]DBL_MIN[ ]/i\ -#ifndef DBL_MIN -'\ - -e '/[ ]DBL_MIN[ ]/a\ -#endif -'\ - -e '/[ ]DBL_MAX[ ]/i\ -#ifndef DBL_MAX -'\ - -e '/[ ]DBL_MAX[ ]/a\ -#endif -'\ - -e '/[ ]DBL_DIG[ ]/i\ -#ifndef DBL_DIG -'\ - -e '/[ ]DBL_DIG[ ]/a\ -#endif -' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# The Irix unistd.h will introduce a call to __vfork in its libc, but the -# function is never actually prototyped. -file=unistd.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/__vfork/i\ -extern pid_t __vfork(void);'\ - $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -exit 0 diff --git a/gnu/dist/gcc/fixinc.ptx b/gnu/dist/gcc/fixinc.ptx deleted file mode 100644 index 93a8f2c5d0e8..000000000000 --- a/gnu/dist/gcc/fixinc.ptx +++ /dev/null @@ -1,257 +0,0 @@ -#! /bin/sh -# Install modified versions of certain ANSI-incompatible -# native Sequent DYNIX/ptx System V Release 3.2 system include files. -# Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. -# Contributed by Bill Burton -# Portions adapted from fixinc.svr4 and fixincludes. -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This script munges the native include files provided with DYNIX/ptx -# so as to remove things which are violations of the ANSI C standard. -# This is done by first running fixinc.svr4 which does most of the -# work. A few includes have fixes made to them afterwards by this -# script. Once munged, the resulting new system include files are -# placed in a directory that GNU C will search *before* searching the -# /usr/include directory. This script should work properly for most -# DYNIX/ptx systems. For other types of systems, you should use the -# `fixincludes' script instead. -# -# See README-fixinc for more information. - -# Directory containing the original header files. -INPUT=${2-${INPUT-/usr/include}} - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - LIB=$ORIG_DIR/$LIB - ;; -esac - -echo 'Running fixinc.svr4' -# DYNIX/ptx has dirname so this is no problem -`dirname $0`/fixinc.svr4 $* -echo 'Finished fixinc.svr4' - -echo 'Building fixincludes in ' ${LIB} - -# Copied from fixincludes. -# Don't use or define the name va_list in stdio.h. -# This is for ANSI and also to interoperate properly with gcc's varargs.h. -file=stdio.h -if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null -fi - -if [ -r ${LIB}/$file ]; then - echo Fixing $file, use of va_list - # Arrange for stdio.h to use stdarg.h to define __gnuc_va_list - (echo "#define __need___va_list" - echo "#include ") > ${LIB}/${file}.sed - # Use __gnuc_va_list in arg types in place of va_list. - # On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the - # trailing parentheses and semicolon save all other systems from this. - # Define __va_list__ (something harmless and unused) instead of va_list. - # Don't claim to have defined va_list. - sed -e 's@ va_list @ __gnuc_va_list @' \ - -e 's@ va_list)@ __gnuc_va_list)@' \ - -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \ - -e 's@ va_list@ __va_list__@' \ - -e 's@\*va_list@*__va_list__@' \ - -e 's@ __va_list)@ __gnuc_va_list)@' \ - -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \ - -e 's@VA_LIST@DUMMY_VA_LIST@' \ - -e 's@_NEED___Va_LIST@_NEED___VA_LIST@' \ - ${LIB}/$file >> ${LIB}/${file}.sed - - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm -f ${LIB}/$file - fi -fi - -# In pwd.h, PTX 1.x needs stdio.h included since FILE * was added in a -# prototype later on in the file. -file=pwd.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep stdio $file_to_fix > /dev/null; then - true - else - sed -e '/#include /a\ -\ -#if defined(__STDC__) || defined(__cplusplus)\ -#include \ -#endif /* __STDC__ */ -' \ - $file_to_fix > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - echo Fixed $file_to_fix - fi -fi - -# Copied from fixincludes. -# math.h puts the declaration of matherr before the definition -# of struct exception, so the prototype (added by fixproto) causes havoc. -file=math.h -if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null -fi - -if [ -r ${LIB}/$file ]; then - echo Fixing $file, matherr declaration - sed -e '/^struct exception/,$b' \ - -e '/matherr/i\ -struct exception; -'\ - ${LIB}/$file > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm -f ${LIB}/$file - fi -fi - -# In netinet/in.h, the network byte swapping asm functions supported by the -# native cc compiler on PTX 1.x and 2.x is not supported in gcc. Instead, -# include written out by the fixinc.svr4 script which has -# these same routines written in an asm format supported by gcc. -file=netinet/in.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep __GNUC__ $file_to_fix > /dev/null; then - true - else - sed -e '/#define NETSWAP/a\ -\ -#if defined (__GNUC__) || defined (__GNUG__)\ -#include \ -#else /* not __GNUC__ */ -' \ - -e '/#endif[ ]*\/\* NETSWAP \*\//i\ -#endif /* not __GNUC__ */ -' \ - $file_to_fix > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - echo Fixed $file_to_fix - fi -fi - -# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction -# on the P5. This is not used by anything else so we ifdef it out. -file=sys/mc_param.h -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep __GNUC__ $file_to_fix > /dev/null; then - true - else - sed -e '/__asm/,/}/{ -/__asm/i\ -#if !defined (__GNUC__) && !defined (__GNUG__) -/}/a\ -#endif -}' \ - $file_to_fix > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - echo Fixed $file_to_fix - fi -fi - -# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction -# on the P5. This is not used by anything else so we ifdef it out. -file=sys/mc_param.h -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep __GNUC__ $file_to_fix > /dev/null; then - true - else - sed -e '/__asm/,/}/{ -/__asm/i\ -#if !defined (__GNUC__) && !defined (__GNUG__) -/}/a\ -#endif -}' \ - $file_to_fix > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - echo Fixed $file_to_fix - fi -fi - -exit 0 - diff --git a/gnu/dist/gcc/fixinc.sco b/gnu/dist/gcc/fixinc.sco deleted file mode 100644 index 5caaf7fc3854..000000000000 --- a/gnu/dist/gcc/fixinc.sco +++ /dev/null @@ -1,427 +0,0 @@ -#! /bin/sh -# -# fixinc.sco -- Install modified versions of SCO system include -# files. -# -# Based on fixinc.svr4 script by Ron Guilmette (rfg@ncd.com) (SCO -# modifications by Ian Lance Taylor (ian@airs.com)). -# -# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This script munges the native include files provided with SCO -# 3.2v4 systems so as to provide a reasonable namespace when -# compiling with gcc. The header files by default do not -# provide many essential definitions and declarations if -# __STDC__ is 1. This script modifies the header files to check -# for __STRICT_ANSI__ being defined instead. Once munged, the -# resulting new system include files are placed in a directory -# that GNU C will search *before* searching the /usr/include -# directory. This script should work properly for most SCO -# 3.2v4 systems. For other types of systems, you should use the -# `fixincludes' or the `fixinc.svr4' script instead. -# -# See README-fixinc for more information. - -# Directory containing the original header files. -INPUT=${2-${INPUT-/usr/include}} - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - cd $LIB; LIB=`${PWDCMD-pwd}` - ;; -esac - -echo 'Building fixincludes in ' ${LIB} - -# Determine whether this filesystem has symbolic links. -if ln -s X $LIB/ShouldNotExist 2>/dev/null; then - rm -f $LIB/ShouldNotExist - LINKS=true -else - LINKS=false -fi - -echo 'Making directories:' -cd ${INPUT} -if $LINKS; then - files=`ls -LR | sed -n s/:$//p` -else - files=`find . -type d -print | sed '/^.$/d'` -fi -for file in $files; do - rm -rf $LIB/$file - if [ ! -d $LIB/$file ] - then mkdir $LIB/$file - fi -done - -# treetops gets an alternating list -# of old directories to copy -# and the new directories to copy to. -treetops="${INPUT} ${LIB}" - -if $LINKS; then - echo 'Making internal symbolic directory links' - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if [ "$dest" ]; then - cwd=`pwd` - # In case $dest is relative, get to $file's dir first. - cd ${INPUT} - cd `echo ./$file | sed -n 's&[^/]*$&&p'` - # Check that the target directory exists. - # Redirections changed to avoid bug in sh on Ultrix. - (cd $dest) > /dev/null 2>&1 - if [ $? = 0 ]; then - cd $dest - # X gets the dir that the link actually leads to. - x=`pwd` - # If link leads back into ${INPUT}, - # make a similar link here. - if expr $x : "${INPUT}/.*" > /dev/null; then - # Y gets the actual target dir name, relative to ${INPUT}. - y=`echo $x | sed -n "s&${INPUT}/&&p"` - echo $file '->' $y ': Making link' - rm -fr ${LIB}/$file > /dev/null 2>&1 - ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1 - else - # If the link is to outside ${INPUT}, - # treat this directory as if it actually contained the files. -# This line used to have $dest instead of $x. -# $dest seemed to be wrong for links found in subdirectories -# of ${INPUT}. Does this change break anything? - treetops="$treetops $x ${LIB}/$file" - fi - fi - cd $cwd - fi - done -fi - -set - $treetops -while [ $# != 0 ]; do - # $1 is an old directory to copy, and $2 is the new directory to copy to. - echo "Finding header files in $1:" - cd ${INPUT} - cd $1 - files=`find . -name '*.h' -type f -print` - echo 'Checking header files:' - for file in $files; do - if egrep '!__STDC__' $file >/dev/null; then - if [ -r $file ]; then - cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w $2/$file - chmod a+r $2/$file - -# The following have been removed from the sed command below -# because it is more useful to leave these things in. -# The only reason to remove them was for -pedantic, -# which isn't much of a reason. -- rms. -# /^[ ]*#[ ]*ident/d - - sed -e ' - s/!__STDC__/!defined (__STRICT_ANSI__)/g - ' $2/$file > $2/$file.sed - mv $2/$file.sed $2/$file - if cmp $file $2/$file >/dev/null 2>&1; then - rm $2/$file - else - echo Fixed $file - fi - fi - fi - done - shift; shift -done - -# We shouldn't stay in the directory we just copied. -cd ${INPUT} - -# Fix first broken decl of getcwd present on some svr4 systems. - -file=stdlib.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \{0,\}\*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix second broken decl of getcwd present on some svr4 systems. Also -# fix the incorrect decl of profil present on some svr4 systems. - -file=unistd.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \ - | sed -e 's/profil(unsigned short \*, unsigned int, unsigned int, unsigned int)/profil(unsigned short *, size_t, int, unsigned)/' > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix third broken decl of getcwd on SCO. Also fix incorrect decl of -# link. -file=prototypes.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \ - | sed -e 's/const int link(const char \*, char \*)/extern int link(const char *, const char *)/' > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix an error in this file: the #if says _cplusplus, not the double -# underscore __cplusplus that it should be -file=tinfo.h -if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - mkdir ${LIB}/rpcsvc 2>/dev/null - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null -fi - -if [ -r ${LIB}/$file ]; then - echo Fixing $file, __cplusplus macro - sed -e 's/[ ]_cplusplus/ __cplusplus/' ${LIB}/$file > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm ${LIB}/$file - fi -fi - -# Fix prototype declaration of utime in sys/times.h. In 3.2v4.0 the -# const is missing. -file=sys/times.h -if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null -fi - -if [ -r ${LIB}/$file ]; then - echo Fixing $file, utime prototype - sed -e 's/(const char \*, struct utimbuf \*);/(const char *, const struct utimbuf *);/' ${LIB}/$file > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm ${LIB}/$file - fi -fi - -# This function is borrowed from fixinclude.svr4 -# The OpenServer math.h defines struct exception, which conflicts with -# the class exception defined in the C++ file std/stdexcept.h. We -# redefine it to __math_exception. This is not a great fix, but I -# haven't been able to think of anything better. -# -# OpenServer's math.h declares abs as inline int abs... Unfortunately, -# we blow over that one (with C++ linkage) and stick a new one in stdlib.h -# with C linkage. So we eat the one out of math.h. -file=math.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/struct exception/i\ -#ifdef __cplusplus\ -#define exception __math_exception\ -#endif'\ - -e '/struct exception/a\ -#ifdef __cplusplus\ -#undef exception\ -#endif' \ - -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \ - $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# -# Also, the static functions lstat() and fchmod() in -# cause G++ grief since they're not wrapped in "if __cplusplus". -# Fix that up now. -# -file=sys/stat.h -if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null -fi - -if [ -r ${LIB}/$file ]; then - echo Fixing $file, static definitions not C++-aware. - sed -e '/^static int[ ]*/i\ -#if __cplusplus\ -extern "C"\ -{\ -#endif /* __cplusplus */ \ -' \ --e '/^}$/a\ -#if __cplusplus\ -}\ -#endif /* __cplusplus */ \ -' ${LIB}/$file > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm -f ${LIB}/$file - fi -fi - -# This fix has the regex modified from the from fixinc.wrap -# Avoid the definition of the bool type in the following files when using -# g++, since it's now an official type in the C++ language. -for file in term.h tinfo.h -do - if [ -r $INPUT/$file ]; then - echo Checking $INPUT/$file - w='[ ]' - if grep "typedef$w.*char$w.*bool$w*;" $INPUT/$file >/dev/null - then - echo Fixed $file - rm -f $LIB/$file - cat << __EOF__ >$LIB/$file -#ifndef _CURSES_H_WRAPPER -#ifdef __cplusplus -# define bool __curses_bool_t -#endif -#include_next <$file> -#ifdef __cplusplus -# undef bool -#endif -#define _CURSES_H_WRAPPER -#endif /* _CURSES_H_WRAPPER */ -__EOF__ - # Define _CURSES_H_WRAPPER at the end of the wrapper, not the start, - # so that if #include_next gets another instance of the wrapper, - # this will follow the #include_next chain until we arrive at - # the real system include file. - chmod a+r $LIB/$file - fi - fi -done - -echo 'Removing unneeded directories:' -cd $LIB -files=`find . -type d -print | sort -r` -for file in $files; do - rmdir $LIB/$file > /dev/null 2>&1 -done - -if $LINKS; then - echo 'Making internal symbolic non-directory links' - cd ${INPUT} - files=`find . -type l -print` - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if expr "$dest" : '[^/].*' > /dev/null; then - target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"` - if [ -f $target ]; then - ln -s $dest ${LIB}/$file >/dev/null 2>&1 - fi - fi - done -fi - -exit 0 diff --git a/gnu/dist/gcc/fixinc.svr4 b/gnu/dist/gcc/fixinc.svr4 deleted file mode 100644 index 46e07ce0ac9f..000000000000 --- a/gnu/dist/gcc/fixinc.svr4 +++ /dev/null @@ -1,1726 +0,0 @@ -#! /bin/sh -# Install modified versions of certain ANSI-incompatible -# native System V Release 4 system include files. -# Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. -# Contributed by Ron Guilmette (rfg@monkeys.com). -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This script munges the native include files provided with System V -# Release 4 systems so as to remove things which are violations of the -# ANSI C standard. Once munged, the resulting new system include files -# are placed in a directory that GNU C will search *before* searching -# the /usr/include directory. This script should work properly for most -# System V Release 4 systems. For other types of systems, you should -# use the `fixincludes' script instead. -# -# See README-fixinc for more information. - -# Directory containing the original header files. -INPUT=${2-${INPUT-/usr/include}} - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - LIB=$ORIG_DIR/$LIB - ;; -esac - -echo 'Building fixincludes in ' ${LIB} - -# Determine whether this filesystem has symbolic links. -if ln -s X $LIB/ShouldNotExist 2>/dev/null; then - rm -f $LIB/ShouldNotExist - LINKS=true -else - LINKS=false -fi - -echo 'Making directories:' -cd ${INPUT} -if $LINKS; then - files=`find . -follow -type d -print 2>/dev/null | sed '/^.$/d'` -else - files=`find . -type d -print | sed '/^.$/d'` -fi -for file in $files; do - rm -rf $LIB/$file - if [ ! -d $LIB/$file ] - then mkdir $LIB/$file - fi -done - -# treetops gets an alternating list -# of old directories to copy -# and the new directories to copy to. -treetops="${INPUT} ${LIB}" - -if $LINKS; then - echo 'Making internal symbolic directory links' - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if [ "$dest" ]; then - cwd=`pwd` - # In case $dest is relative, get to $file's dir first. - cd ${INPUT} - cd `echo ./$file | sed -n 's&[^/]*$&&p'` - rwd=`pwd` - # Check that the target directory exists. - # Redirections changed to avoid bug in sh on Ultrix. - (cd $dest) > /dev/null 2>&1 - if [ $? = 0 ]; then - cd $dest - # X gets the dir that the link actually leads to. - x=`pwd` - # If link leads back into ${INPUT}, - # make a similar link here. - if expr "$dest" : '[^/][^/]*' >/dev/null && [ ! -h $dest ]; then - echo $file '->' $dest': Making link' - rm -fr ${LIB}/$file > /dev/null 2>&1 - ln -s $dest ${LIB}/$file > /dev/null 2>&1 - elif expr $x : "${INPUT}/.*" > /dev/null; then - # Y gets the actual target dir name, relative to ${INPUT}. - y=`echo $x | sed -n "s&${INPUT}/&&p"` - # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. - dots=`echo "$file" | - sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` - echo $file '->' $dots$y ': Making link' - rm -fr ${LIB}/$file > /dev/null 2>&1 - ln -s $dots$y ${LIB}/$file > /dev/null 2>&1 - elif expr $x : "${rwd}/.*" > /dev/null; then - # Y gets the actual target dir name, relative to the directory where the link is. - y=`echo $x | sed -n "s&${rwd}/&&p"` - # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. - dots=`echo "$file" | - sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` - echo $file '->' $dots$y ': Making link' - rm -fr ${LIB}/$file > /dev/null 2>&1 - ln -s $dots$y ${LIB}/$file > /dev/null 2>&1 - else - # If the link is to outside ${INPUT}, - # treat this directory as if it actually contained the files. -# This line used to have $dest instead of $x. -# $dest seemed to be wrong for links found in subdirectories -# of ${INPUT}. Does this change break anything? - treetops="$treetops $x ${LIB}/$file" - fi - fi - cd $cwd - fi - done -fi - -set - $treetops -while [ $# != 0 ]; do - # $1 is an old directory to copy, and $2 is the new directory to copy to. - echo "Finding header files in $1:" - cd ${INPUT} - cd $1 - files=`find . -name '*.h' -type f -print` - echo 'Checking header files:' - for file in $files; do - if [ -r $file ]; then - cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w $2/$file - chmod a+r $2/$file - -# The following have been removed from the sed command below -# because it is more useful to leave these things in. -# The only reason to remove them was for -pedantic, -# which isn't much of a reason. -- rms. -# /^[ ]*#[ ]*ident/d - -# This code makes Solaris SCSI fail, because it changes the -# alignment within some critical structures. See . -# s/u_char\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# Disable these also, since they probably aren't safe either. -# s/u_short\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/ushort\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/evcm_t\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/Pbyte\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*SEQSIZ\)/unsigned int\1/ - -# The change of u_char, etc, to u_int -# applies to bit fields. - sed -e ' - s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1% - s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1% - s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1% - s%^\([ ]*#[ ]*endif\)[ ]*[^/ ].*%\1% - s/#lint(on)/defined(lint)/g - s/#lint(off)/!defined(lint)/g - s/#machine(\([^)]*\))/defined(__\1__)/g - s/#system(\([^)]*\))/defined(__\1__)/g - s/#cpu(\([^)]*\))/defined(__\1__)/g - /#[a-z]*if.*[ (]m68k/ s/\([^_]\)m68k/\1__m68k__/g - /#[a-z]*if.*[ (]__i386\([^_]\)/ s/__i386/__i386__/g - /#[a-z]*if.*[ (]i386/ s/\([^_]\)i386/\1__i386__/g - /#[a-z]*if.*[ (!]__i860\([^_]\)/ s/__i860/__i860__/g - /#[a-z]*if.*[ (!]i860/ s/\([^_]\)i860/\1__i860__/g - /#[a-z]*if.*[ (]sparc/ s/\([^_]\)sparc/\1__sparc__/g - /#[a-z]*if.*[ (]mc68000/ s/\([^_]\)mc68000/\1__mc68000__/g - /#[a-z]*if.*[ (]vax/ s/\([^_]\)vax/\1__vax__/g - /#[a-z]*if.*[ (]sun/ s/\([^_]\)\(sun[a-z0-9]*\)\([^a-z0-9_]\)/\1__\2__\3/g - /#[a-z]*if.*[ (]sun/ s/\([^_]\)\(sun[a-z0-9]*\)$/\1__\2__/g - /#[a-z]*if.*[ (]ns32000/ s/\([^_]\)ns32000/\1__ns32000__/g - /#[a-z]*if.*[ (]pyr/ s/\([^_]\)pyr/\1__pyr__/g - /#[a-z]*if.*[ (]is68k/ s/\([^_]\)is68k/\1__is68k__/g - s/__STDC__[ ][ ]*==[ ][ ]*0/!defined (__STRICT_ANSI__)/g - s/__STDC__[ ][ ]*==[ ][ ]*1/defined (__STRICT_ANSI__)/g - s/__STDC__[ ][ ]*!=[ ][ ]*0/defined (__STRICT_ANSI__)/g - s/__STDC__[ ][ ]*!=[ ][ ]*1/!defined (__STRICT_ANSI__)/g - s/__STDC__ - 0 == 0/!defined (__STRICT_ANSI__)/g - s/__STDC__ - 0 == 1/defined (__STRICT_ANSI__)/g - /^typedef[ ][ ]*[unsigned ]*long[ ][ ]*[u_]*longlong_t;/s/long/long long/ - ' $2/$file > $2/$file.sed - mv $2/$file.sed $2/$file - if cmp $file $2/$file >/dev/null 2>&1; then - rm $2/$file - else - echo Fixed $file - fi - fi - done - shift; shift -done - -# Install the proper definition of the three standard types in header files -# that they come from. -for file in sys/types.h stdlib.h sys/stdtypes.h stddef.h memory.h unistd.h; do - if [ -r $file ] && [ ! -r ${LIB}/$file ]; then - cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" - chmod +w ${LIB}/$file 2>/dev/null - chmod a+r ${LIB}/$file 2>/dev/null - fi - - if [ -r ${LIB}/$file ]; then - echo Fixing size_t, ptrdiff_t and wchar_t in $file - sed \ - -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\ -#ifndef __SIZE_TYPE__\ -#define __SIZE_TYPE__ long unsigned int\ -#endif -' \ - -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \ - -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\ -#ifndef __PTRDIFF_TYPE__\ -#define __PTRDIFF_TYPE__ long int\ -#endif -' \ - -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \ - -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\ -#ifndef __WCHAR_TYPE__\ -#define __WCHAR_TYPE__ int\ -#endif -' \ - -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \ - ${LIB}/$file > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm ${LIB}/$file - fi - fi -done - -# Fix first broken decl of getcwd present on some svr4 systems. - -file=stdlib.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix second broken decl of getcwd present on some svr4 systems. Also -# fix the incorrect decl of profil present on some svr4 systems. - -file=unistd.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \ - | sed -e 's/profil(unsigned short \*, unsigned int, unsigned int, unsigned int)/profil(unsigned short *, size_t, int, unsigned)/' > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix the definition of NULL in so that it is conditional -# and so that it is correct for both C and C++. - -file=sys/param.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - chmod a+r /tmp/$base - sed -e '/^#define[ ]*NULL[ ]*0$/c\ -#ifndef NULL\ -#ifdef __cplusplus\ -#define __NULL_TYPE\ -#else /* !defined(__cplusplus) */\ -#define __NULL_TYPE (void *)\ -#endif /* !defined(__cplusplus) */\ -#define NULL (__NULL_TYPE 0)\ -#endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Likewise fix the definition of NULL in so that it is conditional -# and so that it is correct for both C and C++. - -file=stdio.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^#define[ ]*NULL[ ]*0$/c\ -#ifdef __cplusplus\ -#define __NULL_TYPE\ -#else /* !defined(__cplusplus) */\ -#define __NULL_TYPE (void *)\ -#endif /* !defined(__cplusplus) */\ -#define NULL (__NULL_TYPE 0)' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Likewise fix the definition of NULL in so that it is conditional -# and so that it is correct for both C and C++. - -file=dbm.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^#define[ ]*NULL[ ]*((char \*) 0)$/c\ -#ifndef NULL\ -#ifdef __cplusplus\ -#define __NULL_TYPE\ -#else /* !defined(__cplusplus) */\ -#define __NULL_TYPE (void *)\ -#endif /* !defined(__cplusplus) */\ -#define NULL (__NULL_TYPE 0)\ -#endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Add a prototyped declaration of mmap to . - -file=sys/mman.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^extern caddr_t mmap();$/c\ -#ifdef __STDC__\ -extern caddr_t mmap (caddr_t, size_t, int, int, int, off_t);\ -#else /* !defined(__STDC__) */\ -extern caddr_t mmap ();\ -#endif /* !defined(__STDC__) */' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Fix declarations of `ftw' and `nftw' in . On some/most SVR4 systems -# the file contains extern declarations of these functions followed -# by explicitly `static' definitions of these functions... and that's not -# allowed according to ANSI C. (Note however that on Solaris, this header -# file glitch has been pre-fixed by Sun. In the Solaris version of -# there are no static definitions of any function so we don't need to do -# any of this stuff when on Solaris. - -file=ftw.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if test -z "$file_to_fix" || grep 'define ftw' $file_to_fix > /dev/null; then -# Either we have no file at all, or else we have the pre-fixed Solaris -# one. Either way, we don't have to do anything. - true -else - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^extern int ftw(const/i\ -#if !defined(_STYPES)\ -static\ -#else\ -extern\ -#endif -'\ - -e 's/extern \(int ftw(const.*\)$/\1/' \ - -e '/^extern int nftw/i\ -#if defined(_STYPES)\ -static\ -#else\ -extern\ -#endif -'\ - -e 's/extern \(int nftw.*\)$/\1/' \ - -e '/^extern int ftw(),/c\ -#if !defined(_STYPES)\ -static\ -#else\ -extern\ -#endif\ - int ftw();\ -#if defined(_STYPES)\ -static\ -#else\ -extern\ -#endif\ - int nftw();' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Avoid the definition of the bool type in the Solaris 2.x curses.h when using -# g++, since it's now an official type in the C++ language. -file=curses.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi - -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e 's,^typedef[ ]char[ ]bool;$,#ifndef __cplusplus\ -typedef char bool;\ -#endif /* !defined __cplusplus */,' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Add a `static' declaration of `getrnge' into . - -# Don't do this if there is already a `static void getrnge' declaration -# present, since this would cause a redeclaration error. Solaris 2.x has -# such a declaration. - -file=regexp.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep "static void getrnge" $file_to_fix > /dev/null; then - true - else - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^static int[ ]*size;/c\ -static int size ;\ -\ -static int getrnge ();' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Disable apparent native compiler optimization cruft in SVR4.2 -# that is visible to any ANSI compiler using this include. Simply -# delete the lines that #define some string functions to internal forms. - -file=string.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/#define.*__std_hdr_/d' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Delete any #defines of `__i386' which may be present in . They -# tend to conflict with the compiler's own definition of this symbol. (We -# will use the compiler's definition.) -# Likewise __sparc, for Solaris, and __i860, and a few others -# (guessing it is necessary for all of them). - -file=ieeefp.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/#define[ ]*__i386 /d' -e '/#define[ ]*__sparc /d' \ - -e '/#define[ ]*__i860 /d' -e '/#define[ ]*__m88k /d' \ - -e '/#define[ ]*__mips /d' -e '/#define[ ]*__m68k /d' \ - /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Add a #define of _SIGACTION_ into . -# Also fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD. - -file=sys/signal.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^struct sigaction {/c\ -#define _SIGACTION_\ -struct sigaction {' \ - -e '1,$s/(void *(\*)())/(void (*)(int))/' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Fix declarations of `makedev', `major', and `minor' in . - -file=sys/mkdev.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^dev_t makedev(const/c\ -static dev_t makedev(const major_t, const minor_t);' \ - -e '/^dev_t makedev()/c\ -static dev_t makedev();' \ - -e '/^major_t major(const/c\ -static major_t major(const dev_t);' \ - -e '/^major_t major()/c\ -static major_t major();' \ - -e '/^minor_t minor(const/c\ -static minor_t minor(const dev_t);' \ - -e '/^minor_t minor()/c\ -static minor_t minor();' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Fix reference to NMSZ in . - -file=sys/adv.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed 's/\[NMSZ\]/\[RFS_NMSZ\]/g' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Fix reference to NC_NPI_RAW in . Also fix types of -# array initializers. - -file=sys/netcspace.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed 's/NC_NPI_RAW/NC_TPI_RAW/g' $file_to_fix \ - | sed 's/NC_/(unsigned long) NC_/' > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Conditionalize all of on _KERNEL being defined. - -file=fs/rfs/rf_cache.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/erec.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/err.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/char.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/getpages.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/map.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/cmn_err.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize all of on _KERNEL being defined. - -file=sys/kdebugger.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - -# Conditionalize some of on _KERNEL being defined. -# This has been taken out because it breaks on some versions of -# DYNIX/ptx, and it does not seem to do much good on any system. -# file=netinet/in.h -# base=`basename $file` -# if [ -r ${LIB}/$file ]; then -# file_to_fix=${LIB}/$file -# else -# if [ -r ${INPUT}/$file ]; then -# file_to_fix=${INPUT}/$file -# else -# file_to_fix="" -# fi -# fi -# if [ \! -z "$file_to_fix" ]; then -# echo Checking $file_to_fix -# if grep _KERNEL $file_to_fix > /dev/null; then -# true -# else -# sed -e '/#ifdef INKERNEL/i\ -# #ifdef _KERNEL -# ' \ -# -e '/#endif[ ]*\/\* INKERNEL \*\//a\ -# #endif /* _KERNEL */ -# ' \ -# $file_to_fix > ${LIB}/${file}.sed -# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file -# echo Fixed $file_to_fix -# fi -# fi - -# Conditionalize some of on __GNUC__ and __GNUG__. - -file=sys/endian.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep __GNUC__ $file_to_fix > /dev/null; then - true - else - sed -e '/# ifdef __STDC__/i\ -# if !defined (__GNUC__) && !defined (__GNUG__) -' \ - -e '/# include /s/ / /'\ - -e '/# include /i\ -# endif /* !defined (__GNUC__) && !defined (__GNUG__) */ -'\ - $file_to_fix > ${LIB}/${file}.sed - rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file - echo Fixed $file_to_fix - fi -fi - -# Commented out because tmcconne@sedona.intel.com says we don't clearly need it -# and the text in types.h is not erroneous. -## In sys/types.h, don't name the enum for booleans. -# -#file=sys/types.h -#base=`basename $file` -#if [ -r ${LIB}/$file ]; then -# file_to_fix=${LIB}/$file -#else -# if [ -r ${INPUT}/$file ]; then -# file_to_fix=${INPUT}/$file -# else -# file_to_fix="" -# fi -#fi -#if [ \! -z "$file_to_fix" ]; then -# echo Checking $file_to_fix -# if grep "enum boolean" $file_to_fix > /dev/null; then -# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed -# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file -# echo Fixed $file_to_fix -# else -# true -# fi -#fi - -# Remove useless extern keyword from struct forward declarations in -# and - -file=sys/stream.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e ' - s/extern struct stdata;/struct stdata;/g - s/extern struct strevent;/struct strevent;/g - ' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -file=sys/strsubr.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e ' - s/extern struct strbuf;/struct strbuf;/g - s/extern struct uio;/struct uio;/g - s/extern struct thread;/struct thread;/g - s/extern struct proc;/struct proc;/g - ' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Put storage class at start of decl, to avoid warning. -file=rpc/types.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e ' - s/const extern/extern const/g - ' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Convert functions to prototype form, and fix arg names in . - -file=sys/stat.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e '/^stat([ ]*[^c]/{ -N -N -s/(.*)\n/( / -s/;\n/, / -s/;$/)/ -}' \ - -e '/^lstat([ ]*[^c]/{ -N -N -s/(.*)\n/( / -s/;\n/, / -s/;$/)/ -}' \ - -e '/^fstat([ ]*[^i]/{ -N -N -s/(.*)\n/( / -s/;\n/, / -s/;$/)/ -}' \ - -e '/^mknod([ ]*[^c]/{ -N -N -N -s/(.*)\n/( / -s/;\n/, /g -s/;$/)/ -}' \ - -e '1,$s/\([^A-Za-z]\)path\([^A-Za-z]\)/\1__path\2/g' \ - -e '1,$s/\([^A-Za-z]\)buf\([^A-Za-z]\)/\1__buf\2/g' \ - -e '1,$s/\([^A-Za-z]\)fd\([^A-Za-z]\)/\1__fd\2/g' \ - -e '1,$s/ret\([^u]\)/__ret\1/g' \ - -e '1,$s/\([^_]\)mode\([^_]\)/\1__mode\2/g' \ - -e '1,$s/\([^_r]\)dev\([^_]\)/\1__dev\2/g' /tmp/$base > /tmp/$base.sed - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base.sed ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base /tmp/$base.sed -fi - -# Sony NEWSOS 5.0 does not support the complete ANSI C standard. - -if [ -x /bin/sony ]; then - if /bin/sony; then - - # Change to not define __filbuf, __flsbuf, and __iob - - file=stdio.h - base=`basename $file` - if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file - else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi - fi - if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e ' - s/__filbuf/_filbuf/g - s/__flsbuf/_flsbuf/g - s/__iob/_iob/g - ' /tmp/$base > /tmp/$base.sed - mv /tmp/$base.sed /tmp/$base - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base - fi - - # Change to not define __ctype - - file=ctype.h - base=`basename $file` - if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file - else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi - fi - if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - cp $file_to_fix /tmp/$base - chmod +w /tmp/$base - sed -e ' - s/__ctype/_ctype/g - ' /tmp/$base > /tmp/$base.sed - mv /tmp/$base.sed /tmp/$base - if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base - fi - fi -fi - -# In limits.h, put #ifndefs around things that are supposed to be defined -# in float.h to avoid redefinition errors if float.h is included first. -# Solaris 2.1 has this problem. - -file=limits.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/[ ]FLT_MIN[ ]/i\ -#ifndef FLT_MIN -'\ - -e '/[ ]FLT_MIN[ ]/a\ -#endif -'\ - -e '/[ ]FLT_MAX[ ]/i\ -#ifndef FLT_MAX -'\ - -e '/[ ]FLT_MAX[ ]/a\ -#endif -'\ - -e '/[ ]FLT_DIG[ ]/i\ -#ifndef FLT_DIG -'\ - -e '/[ ]FLT_DIG[ ]/a\ -#endif -'\ - -e '/[ ]DBL_MIN[ ]/i\ -#ifndef DBL_MIN -'\ - -e '/[ ]DBL_MIN[ ]/a\ -#endif -'\ - -e '/[ ]DBL_MAX[ ]/i\ -#ifndef DBL_MAX -'\ - -e '/[ ]DBL_MAX[ ]/a\ -#endif -'\ - -e '/[ ]DBL_DIG[ ]/i\ -#ifndef DBL_DIG -'\ - -e '/[ ]DBL_DIG[ ]/a\ -#endif -' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Completely replace with a file that includes gcc's -# stdarg.h or varargs.h files as appropriate. - -file=sys/varargs.h -if [ -r ${INPUT}/$file ]; then - echo Replacing $file - cat > ${LIB}/$file << EOF -/* This file was generated by fixincludes. */ -#ifndef _SYS_VARARGS_H -#define _SYS_VARARGS_H - -#ifdef __STDC__ -#include -#else -#include -#endif - -#endif /* _SYS_VARARGS_H */ -EOF - chmod a+r ${LIB}/$file -fi - -# In math.h, put #ifndefs around things that might be defined in a gcc -# specific math-*.h file. - -file=math.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/define[ ]HUGE_VAL[ ]/i\ -#ifndef HUGE_VAL -'\ - -e '/define[ ]HUGE_VAL[ ]/a\ -#endif -' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -# Solaris math.h and floatingpoint.h define __P without protection, -# which conflicts with the fixproto definition. The fixproto -# definition and the Solaris definition are used the same way. -for file in math.h floatingpoint.h; do - base=`basename $file` - if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file - else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi - fi - if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/^#define[ ]*__P/i\ -#ifndef __P -'\ - -e '/^#define[ ]*__P/a\ -#endif -' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base - fi -done - -# The Solaris math.h defines struct exception, which conflicts with -# the class exception defined in the C++ file std/stdexcept.h. We -# redefine it to __math_exception. This is not a great fix, but I -# haven't been able to think of anything better. -file=math.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e '/struct exception/i\ -#ifdef __cplusplus\ -#define exception __math_exception\ -#endif'\ - -e '/struct exception/a\ -#ifdef __cplusplus\ -#undef exception\ -#endif' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -echo 'Removing unneeded directories:' -cd $LIB -files=`find . -type d -print | sort -r` -for file in $files; do - rmdir $LIB/$file > /dev/null 2>&1 -done - -if $LINKS; then - echo 'Making internal symbolic non-directory links' - cd ${INPUT} - files=`find . -type l -print` - for file in $files; do - dest=`ls -ld $file | sed -n 's/.*-> //p'` - if expr "$dest" : '[^/].*' > /dev/null; then - target=${LIB}/`echo $file | sed "s|[^/]*\$|$dest|"` - if [ -f $target ]; then - ln -s $dest ${LIB}/$file >/dev/null 2>&1 - fi - fi - done -fi - -cd ${ORIG_DIR} - -echo 'Replacing ' -if [ \! -d $LIB/sys ]; then - mkdir $LIB/sys -fi -rm -f ${LIB}/sys/byteorder.h -cat <<'__EOF__' >${LIB}/sys/byteorder.h -#ifndef _SYS_BYTEORDER_H -#define _SYS_BYTEORDER_H - -/* Functions to convert `short' and `long' quantities from host byte order - to (internet) network byte order (i.e. big-endian). - - Written by Ron Guilmette (rfg@ncd.com). - - This isn't actually used by GCC. It is installed by fixinc.svr4. - - For big-endian machines these functions are essentially no-ops. - - For little-endian machines, we define the functions using specialized - asm sequences in cases where doing so yields better code (e.g. i386). */ - -#if !defined (__GNUC__) && !defined (__GNUG__) -#error You lose! This file is only useful with GNU compilers. -#endif - -#ifndef __BYTE_ORDER__ -/* Byte order defines. These are as defined on UnixWare 1.1, but with - double underscores added at the front and back. */ -#define __LITTLE_ENDIAN__ 1234 -#define __BIG_ENDIAN__ 4321 -#define __PDP_ENDIAN__ 3412 -#endif - -#ifdef __STDC__ -static __inline__ unsigned long htonl (unsigned long); -static __inline__ unsigned short htons (unsigned int); -static __inline__ unsigned long ntohl (unsigned long); -static __inline__ unsigned short ntohs (unsigned int); -#endif /* defined (__STDC__) */ - -#if defined (__i386__) - -#ifndef __BYTE_ORDER__ -#define __BYTE_ORDER__ __LITTLE_ENDIAN__ -#endif - -/* Convert a host long to a network long. */ - -/* We must use a new-style function definition, so that this will also - be valid for C++. */ -static __inline__ unsigned long -htonl (unsigned long __arg) -{ - register unsigned long __result; - - __asm__ ("xchg%B0 %b0,%h0\n\ - ror%L0 $16,%0\n\ - xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg)); - return __result; -} - -/* Convert a host short to a network short. */ - -static __inline__ unsigned short -htons (unsigned int __arg) -{ - register unsigned short __result; - - __asm__ ("xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg)); - return __result; -} - -#elif ((defined (__i860__) && !defined (__i860_big_endian__)) \ - || defined (__ns32k__) || defined (__vax__) \ - || defined (__spur__) || defined (__arm__)) - -#ifndef __BYTE_ORDER__ -#define __BYTE_ORDER__ __LITTLE_ENDIAN__ -#endif - -/* For other little-endian machines, using C code is just as efficient as - using assembly code. */ - -/* Convert a host long to a network long. */ - -static __inline__ unsigned long -htonl (unsigned long __arg) -{ - register unsigned long __result; - - __result = (__arg >> 24) & 0x000000ff; - __result |= (__arg >> 8) & 0x0000ff00; - __result |= (__arg << 8) & 0x00ff0000; - __result |= (__arg << 24) & 0xff000000; - return __result; -} - -/* Convert a host short to a network short. */ - -static __inline__ unsigned short -htons (unsigned int __arg) -{ - register unsigned short __result; - - __result = (__arg << 8) & 0xff00; - __result |= (__arg >> 8) & 0x00ff; - return __result; -} - -#else /* must be a big-endian machine */ - -#ifndef __BYTE_ORDER__ -#define __BYTE_ORDER__ __BIG_ENDIAN__ -#endif - -/* Convert a host long to a network long. */ - -static __inline__ unsigned long -htonl (unsigned long __arg) -{ - return __arg; -} - -/* Convert a host short to a network short. */ - -static __inline__ unsigned short -htons (unsigned int __arg) -{ - return __arg; -} - -#endif /* big-endian */ - -/* Convert a network long to a host long. */ - -static __inline__ unsigned long -ntohl (unsigned long __arg) -{ - return htonl (__arg); -} - -/* Convert a network short to a host short. */ - -static __inline__ unsigned short -ntohs (unsigned int __arg) -{ - return htons (__arg); -} - -__EOF__ - -if [ -r ${INPUT}/sys/byteorder.h ]; then - if grep BYTE_ORDER ${INPUT}/sys/byteorder.h >/dev/null 2>/dev/null; then - cat <<'__EOF__' >>${LIB}/sys/byteorder.h -#ifndef BYTE_ORDER -#define LITTLE_ENDIAN __LITTLE_ENDIAN__ -#define BIG_ENDIAN __BIG_ENDIAN__ -#define PDP_ENDIAN __PDP_ENDIAN__ -#define BYTE_ORDER __BYTE_ORDER__ -#endif - -__EOF__ - fi -fi - -cat <<'__EOF__' >>${LIB}/sys/byteorder.h -#endif /* !defined (_SYS_BYTEORDER_H) */ -__EOF__ - -chmod a+r ${LIB}/sys/byteorder.h - -exit 0 - diff --git a/gnu/dist/gcc/fixinc.winnt b/gnu/dist/gcc/fixinc.winnt deleted file mode 100644 index 915ac723b85e..000000000000 --- a/gnu/dist/gcc/fixinc.winnt +++ /dev/null @@ -1,232 +0,0 @@ -#! sh -# -# fixinc.winnt -- Install modified versions of Windows NT system include -# files. -# -# Based on fixinc.sco script by Ian Lance Taylor (ian@airs.com)). -# Modifications by Douglas Rupp (drupp@cs.washington.edu) -# -# This file is part of GNU CC. -# -# GNU CC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU CC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU CC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This script munges the native include files provided with Windows NT -# 3.5 SDK systems so as to provide a reasonable namespace when -# compiling with gcc. The header files by default do not -# provide many essential definitions and declarations if -# __STDC__ is 1. This script modifies the header files to check -# for __STRICT_ANSI__ being defined instead. Once munged, the -# resulting new system include files are placed in a directory -# that GNU C will search *before* searching the Include -# directory. -# -# See README-fixinc for more information. - -ORIG_DIR=`pwd` - -# Directory containing the original header files. -cd $2; SEDFILE=`${PWDCMD-pwd}`/fixinc-nt.sed -echo $SEDFILE -if [ ! -f $SEDFILE ] -then echo fixincludes: sed script 'fixinc-nt.sed' not found -exit 1 -fi -echo 'Using sed script: ' ${SEDFILE} - -cd $ORIG_DIR - -INPUT=${INCLUDE} -echo 'Using the Include environment variable to find header files to fix' - -# Fail if no arg to specify a directory for the output. -if [ x$1 = x ] -then echo fixincludes: no output directory specified -exit 1 -fi - -# Directory in which to store the results. -LIB=${1?"fixincludes: output directory not specified"} - -# Make sure it exists. -if [ ! -d $LIB ]; then - mkdir $LIB || exit 1 -fi - -ORIG_DIR=`pwd` - -# Make LIB absolute if it is relative. -# Don't do this if not necessary, since may screw up automounters. -case $LIB in -/*) - ;; -*) - cd $LIB; LIB=`${PWDCMD-pwd}` - ;; -esac - -echo 'Building fixincludes in ' ${LIB} - -# Determine whether this filesystem has symbolic links. -if ln -s X $LIB/ShouldNotExist 2>NUL; then - rm -f $LIB/ShouldNotExist - LINKS=true -else - LINKS=false -fi - -echo 'Making directories:' -cd ${INPUT} -if $LINKS; then - files=`ls -LR | sed -n s/:$//p` -else - files=`find . -type d -print | sed '/^.$/d'` -fi -for file in $files; do - rm -rf $LIB/$file - if [ ! -d $LIB/$file ] - then mkdir $LIB/$file - fi -done - -# treetops gets an alternating list -# of old directories to copy -# and the new directories to copy to. -treetops="${INPUT} ${LIB}" - -set - $treetops -while [ $# != 0 ]; do - # $1 is an old directory to copy, and $2 is the new directory to copy to. - echo "Finding header files in $1:" - cd ${INPUT} - cd $1 - files=`find . -name '*.[hH]' -type f -print` - echo 'Checking header files:' - for file in $files; do - echo $file - if egrep "!__STDC__" $file >NUL; then - if [ -r $file ]; then - cp $file $2/$file >NUL 2>&1 || echo "Can't copy $file" - chmod +w,a+r $2/$file - -# The following have been removed from the sed command below -# because it is more useful to leave these things in. -# The only reason to remove them was for -pedantic, -# which isn't much of a reason. -- rms. -# /^[ ]*#[ ]*ident/d - - sed -e ' - s/!__STDC__/!defined (__STRICT_ANSI__)/g - ' $2/$file > $2/$file.sed - mv $2/$file.sed $2/$file - if cmp $file $2/$file >NUL 2>&1; then - rm $2/$file - else - echo Fixed $file - fi - fi - fi - done - shift; shift -done - -# Fix first broken decl of getcwd present on some svr4 systems. - -file=direct.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -file=rpcndr.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e 's/Format\[\]/Format\[1\]/' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -file=winnt.h -base=`basename $file` -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - sed -e ' - s/^#if !defined (__cplusplus)/#if 0/ - s/^#define DECLSPEC_IMPORT __declspec(dllimport)/#define DECLSPEC_IMPORT/ - ' $file_to_fix > /tmp/$base - if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \ - true - else - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - fi - rm -f /tmp/$base -fi - -echo 'Removing unneeded directories:' -cd $LIB -files=`find . -type d -print | sort -r` -for file in $files; do - rmdir $LIB/$file > NUL 2>&1 -done - -exit 0 diff --git a/gnu/dist/gcc/gthr-dce.h b/gnu/dist/gcc/gthr-dce.h deleted file mode 100644 index 3cba8a0e4b86..000000000000 --- a/gnu/dist/gcc/gthr-dce.h +++ /dev/null @@ -1,150 +0,0 @@ - -/* Compile this one with gcc. */ -/* Copyright (C) 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef __gthr_dce_h -#define __gthr_dce_h - -/* DCE threads interface. - DCE threads are based on POSIX threads draft 4, and many things - have changed since then. */ - -#define __GTHREADS 1 - -#include - -typedef pthread_key_t __gthread_key_t; -typedef pthread_once_t __gthread_once_t; -typedef pthread_mutex_t __gthread_mutex_t; - -#define __GTHREAD_ONCE_INIT pthread_once_init -/* Howto define __GTHREAD_MUTEX_INIT? */ - -#if SUPPORTS_WEAK && GTHREAD_USE_WEAK - -#pragma weak pthread_once -#pragma weak pthread_once_init -#pragma weak pthread_key_create -#pragma weak pthread_key_delete -#pragma weak pthread_getspecific -#pragma weak pthread_setspecific -#pragma weak pthread_create - -#pragma weak pthread_mutex_lock -#pragma weak pthread_mutex_trylock -#pragma weak pthread_mutex_unlock - -static void *__gthread_active_ptr = &pthread_create; - -static inline int -__gthread_active_p () -{ - return __gthread_active_ptr != 0; -} - -#else /* not SUPPORTS_WEAK */ - -static inline int -__gthread_active_p () -{ - return 1; -} - -#endif /* SUPPORTS_WEAK */ - -static inline int -__gthread_once (__gthread_once_t *once, void (*func) ()) -{ - if (__gthread_active_p ()) - return pthread_once (once, func); - else - return -1; -} - -static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) -{ - return pthread_keycreate (key, dtor); -} - -static inline int -__gthread_key_dtor (__gthread_key_t key, void *ptr) -{ - /* Nothing needed. */ - return 0; -} - -static inline int -__gthread_key_delete (__gthread_key_t key) -{ - return pthread_key_delete (key); -} - -static inline void * -__gthread_getspecific (__gthread_key_t key) -{ - void *ptr; - if (pthread_getspecific (key, &ptr) == 0) - return ptr; - else - return 0; -} - -static inline int -__gthread_setspecific (__gthread_key_t key, const void *ptr) -{ - return pthread_setspecific (key, (void *) ptr); -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_lock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_trylock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_unlock (mutex); - else - return 0; -} - -#endif /* not __gthr_dce_h */ diff --git a/gnu/dist/gcc/gthr-solaris.h b/gnu/dist/gcc/gthr-solaris.h deleted file mode 100644 index a6f669c2e096..000000000000 --- a/gnu/dist/gcc/gthr-solaris.h +++ /dev/null @@ -1,177 +0,0 @@ -/* Threads compatibily routines for libgcc2. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef __gthr_solaris_h -#define __gthr_solaris_h - -/* Solaris threads as found in Solaris 2.[456]. - Actually these are Unix International (UI) threads, but I don't - know if anyone else implements these. */ - -#define __GTHREADS 1 - -#include -#include - -typedef thread_key_t __gthread_key_t; -typedef struct -{ - mutex_t mutex; - int once; -} __gthread_once_t; -typedef mutex_t __gthread_mutex_t; - -#define __GTHREAD_ONCE_INIT { DEFAULTMUTEX, 0 } -#define __GTHREAD_MUTEX_INIT DEFAULTMUTEX - -#if SUPPORTS_WEAK && GTHREAD_USE_WEAK - -#pragma weak thr_keycreate -#pragma weak thr_getspecific -#pragma weak thr_setspecific -#pragma weak thr_create - -#pragma weak mutex_lock -#pragma weak mutex_trylock -#pragma weak mutex_unlock - -/* This will not actually work in Solaris 2.5, since libc contains - dummy symbols of all thr_* routines. */ - -static void *__gthread_active_ptr = &thr_create; - -static inline int -__gthread_active_p () -{ - return __gthread_active_ptr != 0; -} - -#else /* not SUPPORTS_WEAK */ - -static inline int -__gthread_active_p () -{ - return 1; -} - -#endif /* SUPPORTS_WEAK */ - -static inline int -__gthread_once (__gthread_once_t *once, void (*func) ()) -{ - if (! __gthread_active_p ()) - return -1; - - if (once == 0 || func == 0) - return EINVAL; - - if (once->once == 0) - { - int status = mutex_lock (&once->mutex); - if (status != 0) - return status; - if (once->once == 0) - { - (*func) (); - once->once ++; - } - mutex_unlock (&once->mutex); - } - return 0; -} - -static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) -{ - /* Solaris 2.5 contains thr_* routines no-op in libc, so test if we actually - got a reasonable key value, and if not, fail. */ - *key = -1; - if (thr_keycreate (key, dtor) != 0 || *key == -1) - return -1; - else - return 0; -} - -static inline int -__gthread_key_dtor (__gthread_key_t key, void *ptr) -{ - /* Nothing needed. */ - return 0; -} - -static inline int -__gthread_key_delete (__gthread_key_t key) -{ - /* Not possible. */ - return -1; -} - -static inline void * -__gthread_getspecific (__gthread_key_t key) -{ - void *ptr; - if (thr_getspecific (key, &ptr) == 0) - return ptr; - else - return 0; -} - -static inline int -__gthread_setspecific (__gthread_key_t key, const void *ptr) -{ - return thr_setspecific (key, (void *) ptr); -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return mutex_lock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return mutex_trylock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return mutex_unlock (mutex); - else - return 0; -} - -#endif /* not __gthr_solaris_h */ diff --git a/gnu/dist/gcc/gthr-vxworks.h b/gnu/dist/gcc/gthr-vxworks.h deleted file mode 100644 index 987664678188..000000000000 --- a/gnu/dist/gcc/gthr-vxworks.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Threads compatibily routines for libgcc2 for VxWorks. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Mike Stump . - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef __gthr_vxworks_h -#define __gthr_vxworks_h - -/* POSIX threads specific definitions. - Easy, since the interface is just one-to-one mapping. */ - -#define __GTHREADS 1 - -#include -#include -/* typedef void *SEM_ID; */ - -typedef int __gthread_key_t; -typedef char __gthread_once_t; -typedef SEM_ID __gthread_mutex_t; - -#define __GTHREAD_MUTEX_INIT 0 -#define __GTHREAD_ONCE_INIT 0 - -#ifndef REG_SAVED_REG -static inline int -__gthread_once (__gthread_once_t *once, void (*func) ()) -{ - (*func)(); - return 0; -} - -extern __gthread_key_t eh_context_key; - -/* This is not the right way to do it, but the semantic of pthreads - don't map well enough onto VxWorks. */ - -static void -__ehdtor () -{ - if (eh_context_key) - free ((void*)eh_context_key); - eh_context_key = 0; -} - -/* This only works for the code in libgcc2.c. */ - -static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) -{ - *key = 0; - - /* We don't have a way to track dtor here, so instead, we - register a generic routine that can cleanup any task. */ - - taskDeleteHookAdd (__ehdtor); - - return 0; -} - -#define __gthread_setspecific(key, ptr) \ - (key = (int) ptr, 0) - -static inline int -__gthread_key_dtor (__gthread_key_t key, void *ptr) -{ - /* Just reset the key value to zero. */ - if (ptr) - return __gthread_setspecific (key, 0); - else - return 0; -} - -#define __gthread_key_delete(key) \ - taskVarDelete (taskIdSelf (), &key) - -#define __gthread_getspecific(key) \ - ((key == 0) \ - ? ((taskVarAdd (taskIdSelf (), &key) != OK) \ - ? (__terminate (), (void*)0) \ - : (void*)0) \ - : (void*)key) -#endif - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) -{ - if (*mutex == 0) - *mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE); - return semTake (*mutex, WAIT_FOREVER); -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) -{ - if (*mutex == 0) - *mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE); - return semTake (*mutex, NO_WAIT); -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) -{ - /* We could return the */ - return semGive (*mutex); -} - -#endif /* not __gthr_vxworks_h */ diff --git a/gnu/dist/gcc/make-l2.com b/gnu/dist/gcc/make-l2.com deleted file mode 100644 index 93694c8c4e8e..000000000000 --- a/gnu/dist/gcc/make-l2.com +++ /dev/null @@ -1,149 +0,0 @@ -$! make-l2.com -- VMS build procedure for libgcc2. -$ -$! Change working directory to the location of this command procedure. -$ flnm = f$enviroment("PROCEDURE") !get current procedure name -$ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' -$! -$! Command file to build libgcc2.olb. You should only run this once you -$! have the current compiler installed, otherwise some of the builtins will -$! not be recognized. Once you have built libgcc2.olb, you can merge this -$! with gnu_cc:[000000]gcclib.olb -$! -$! All of the C source code is assumed to be in libgcc2.c, and a list of the -$! modules that we need from there is in libgcc2.list (which is generated -$! when vmsconfig.com is run). The C++ source is found in the [.cp.inc] -$! directory and managed via libgcc2-cxx.list. -$! -$ if f$search("gcc-cc1.exe").eqs."" -$ then -$ gcc_cc1:=$gnu_cc:[000000]gcc-cc1 -$ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile -$ else -$ gcc_cc1:=$sys$disk:[]gcc-cc1 -$ endif -$! -$ if f$search("gcc-cpp.exe").eqs."" -$ then -$ gcc_cpp:=$gnu_cc:[000000]gcc-cpp -$ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile -$ Version:='f$trnlnm("GNU_CC_VERSION")' -$ else -$ gcc_cpp:=$sys$disk:[]gcc-cpp -$ open ifile$ version.opt -$ read ifile$ line -$ close ifile$ -$ Version=line - "ident=""" - """ -$ endif -$! -$ if f$search("gcc-cc1plus.exe").eqs."" -$ then gcc_cxx = "$gnu_cc:[000000]gcc-cc1plus" -$ else gcc_cxx = "$sys$disk:[]gcc-cc1plus" -$ endif -$! -$gcc_as:=$gnu_cc:[000000]gcc-as -$cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp -$ s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s -$! -$set symbol/scope=(nolocal,noglobal) -$! -$lib/create libgcc2.olb -$on error then goto c_err -$on control_y then goto c_err -$ -$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$open ifile$ libgcc2.list -$loop: -$! -$read ifile$ line/end=c_done -$i=0 -$loop1: -$flnm=f$element(i," ",line) -$i=i+1 -$if flnm.eqs."" then goto loop -$if flnm.eqs." " then goto loop -$! -$flnm = "L"+flnm -$if flnm.eqs."L_exit" then goto loop1 -$write sys$output "$ gcc/debug/define=""''flnm'"" LIBGCC2.C" -$! -$objname = flnm -$if flnm.eqs."L_builtin_New" then objname = "L_builtin_nnew" -$! -$! We do this by hand, since the VMS compiler driver does not have a way -$! of specifying an alternate location for the compiler executables. -$! -$ if arch .eqs. "alpha" -$ then -$ gcc_cpp "-D__IEEE_FLOAT" "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file' -$ gcc_cc1 'cpp_file' -dumpbase 'objname' - - -quiet -mgas "-O1" -mfloat-ieee -o 's_file' -$ else -$ gcc_cpp "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file' -$ gcc_cc1 'cpp_file' -dumpbase 'objname' - - -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file' -$ endif -$ delete/nolog 'cpp_file'; -$ gcc_as 's_file' -o 'objname'.OBJ -$ if arch .eqs. "vax" -$ then -$! Assemble again, preserving lowercase symbol names this time. -$ gcc_as -h3 's_file' -o 'objname'-c.OBJ -$ library libgcc2.olb 'objname'.obj,'objname'-c.obj -$ delete/nolog 'objname'.obj;,'objname'-c.obj; -$ else -$ library libgcc2.olb 'objname'.obj -$ delete/nolog 'objname'.obj; -$ endif -$ delete/nolog 's_file'; -$! -$! -$goto loop1 -$! -$! In case of error or abort, go here (In order to close file). -$! -$c_err: !'f$verify(0) -$close ifile$ -$ exit %x2c -$! -$c_done: -$close ifile$ -$ -$ -$ EXIT -$ !gcc-2.8.0: C++ libgcc2 code disabled since it's not adequately tested -$ -$! -$ p1 = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7+" "+p8 -$ p1 = " " + f$edit(p1,"COMPRESS,TRIM,UPCASE") + " " -$! (note: substring locations can only be equal when neither string is present) -$ if f$locate(" CC1PLUS ",p1).eq.f$locate(" CXX ",p1) then goto cxx_done -$ if f$search("libgcc2-cxx.list").eqs."" then goto cxx_done -$! -$ open/read ifile$ libgcc2-cxx.list -$cxx_line_loop: -$ read ifile$ line/end=cxx_done -$ i = 0 -$cxx_file_loop: -$ flnm = f$element(i,",",line) -$ i = i + 1 -$ if flnm.eqs."" .or. flnm.eqs."," then goto cxx_line_loop -$ write sys$output "$ gcc/plus/debug ''flnm'.cc" -$ objname = flnm -$! -$ gcc_cpp -+ "-I[]" "-I[.ginclude]" "-I[.cp.inc]" [.cp]'flnm'.cc 'cpp_file' -$ gcc_cxx 'cpp_file' -dumpbase 'objname' -fexceptions - - -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file' -$ delete/nolog 'cpp_file'; -$ gcc_as "-vGNU CC V''Version'" 's_file' -o 'objname'.OBJ -$! Assemble again, preserving lowercase symbol names this time. -$ gcc_as "-vGNU CC V''Version'" -h3 's_file' -o 'objname'-c.OBJ -$ delete/nolog 's_file'; -$ -$ library libgcc2.olb 'objname'.obj,'objname'-c.obj -$ delete/nolog 'objname'.obj;,'objname'-c.obj; -$! -$ goto cxx_file_loop -$! -$cxx_done: -$ close ifile$ -$ exit diff --git a/gnu/dist/gcc/patch-apollo-includes b/gnu/dist/gcc/patch-apollo-includes deleted file mode 100644 index 8daf88cb54e8..000000000000 --- a/gnu/dist/gcc/patch-apollo-includes +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# patch-apollo-includes -- fix some (but not all!) Apollo brain damage. - -FILES_TO_PATCH='sys/types.h setjmp.h' - -mkdir sys - -for i in $FILES_TO_PATCH; -do - cp /bsd4.3/usr/include/$i ./$i -done - -patch -b -apollo <<'EOP' -*** /bsd4.3/usr/include/sys/types.h Fri Apr 8 20:29:06 1988 ---- sys/types.h Wed Feb 26 21:17:57 1992 -*************** -*** 38,44 **** ---- 38,47 ---- - typedef char * caddr_t; - typedef u_long ino_t; - typedef long swblk_t; -+ #ifndef _SIZE_T -+ #define _SIZE_T - typedef long size_t; -+ #endif - typedef long time_t; - typedef long dev_t; - typedef long off_t; -*** /bsd4.3/usr/include/setjmp.h Fri Feb 3 21:40:21 1989 ---- setjmp.h Sun Feb 23 19:06:55 1992 -*************** -*** 24,30 **** ---- 24,39 ---- - #endif - - -+ #ifdef __GNUC__ - #ifdef _PROTOTYPES -+ extern int sigsetjmp (sigjmp_buf env, int savemask); -+ extern void siglongjmp (sigjmp_buf env, int val); -+ #else -+ extern int sigsetjmp(); -+ extern void siglongjmp(); -+ #endif /* _PROTOTYPES */ -+ #else /* not __GNUC__ */ -+ #ifdef _PROTOTYPES - extern int sigsetjmp( - sigjmp_buf env, - int savemask -*************** -*** 37,43 **** - extern int sigsetjmp() #options(abnormal); - extern void siglongjmp() #options(noreturn); - #endif /* _PROTOTYPES */ -! - #undef _PROTOTYPES - - #ifdef __cplusplus ---- 46,52 ---- - extern int sigsetjmp() #options(abnormal); - extern void siglongjmp() #options(noreturn); - #endif /* _PROTOTYPES */ -! #endif /* not __GNUC__ */ - #undef _PROTOTYPES - - #ifdef __cplusplus -EOP - -exit 0 diff --git a/gnu/dist/gcc/texinfo.tex b/gnu/dist/gcc/texinfo.tex deleted file mode 100644 index 9c1dac52c64d..000000000000 --- a/gnu/dist/gcc/texinfo.tex +++ /dev/null @@ -1,5298 +0,0 @@ -% texinfo.tex -- TeX macros to handle Texinfo files. -% $Id: texinfo.tex,v 1.1.1.5 1998/12/13 00:04:43 tv Exp $ -% -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 -% Free Software Foundation, Inc. -% -% This texinfo.tex file is free software; you can redistribute it and/or -% modify it under the terms of the GNU General Public License as -% published by the Free Software Foundation; either version 2, or (at -% your option) any later version. -% -% This texinfo.tex file is distributed in the hope that it will be -% useful, but WITHOUT ANY WARRANTY; without even the implied warranty -% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -% General Public License for more details. -% -% You should have received a copy of the GNU General Public License -% along with this texinfo.tex file; see the file COPYING. If not, write -% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -% Boston, MA 02111-1307, USA. -% -% In other words, you are welcome to use, share and improve this program. -% You are forbidden to forbid anyone else to use, share and improve -% what you give them. Help stamp out software-hoarding! -% -% Please try the latest version of texinfo.tex before submitting bug -% reports; you can get the latest version from: -% ftp://ftp.gnu.org/pub/gnu/texinfo.tex -% /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% (and all GNU mirrors, see ftp://ftp.gnu.org/pub/gnu/README.mirrors) -% ftp://tug.org/tex/texinfo.tex -% ftp://ctan.org/macros/texinfo/texinfo.tex -% (and all CTAN mirrors, finger ctan@tug.org for a list). -% The texinfo.tex in the texinfo distribution itself could well be out -% of date, so if that's what you're using, please check. -% -% Send bug reports to bug-texinfo@gnu.org. -% Please include a precise test case in each bug report, -% including a complete document with which we can reproduce the problem. -% -% To process a Texinfo manual with TeX, it's most reliable to use the -% texi2dvi shell script that comes with the distribution. For simple -% manuals, you can get away with: -% tex foo.texi -% texindex foo.?? -% tex foo.texi -% tex foo.texi -% dvips foo.dvi -o # or whatever, to process the dvi file. -% The extra runs of TeX get the cross-reference information correct. -% Sometimes one run after texindex suffices, and sometimes you need more -% than two; texi2dvi does it as many times as necessary. - - -% Make it possible to create a .fmt file just by loading this file: -% if the underlying format is not loaded, start by loading it now. -% Added by gildea November 1993. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi - -% This automatically updates the version number based on RCS. -\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.1.1.5 $ -\message{Loading texinfo package [Version \texinfoversion]:} - -% If in a .fmt file, print the version number -% and turn on active characters that we couldn't do earlier because -% they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}\message{} - \catcode`+=\active \catcode`\_=\active} - -% Save some parts of plain tex whose names we will redefine. - -\let\ptexb=\b -\let\ptexbullet=\bullet -\let\ptexc=\c -\let\ptexcomma=\, -\let\ptexdot=\. -\let\ptexdots=\dots -\let\ptexend=\end -\let\ptexequiv=\equiv -\let\ptexexclam=\! -\let\ptexi=\i -\let\ptexlbrace=\{ -\let\ptexrbrace=\} -\let\ptexstar=\* -\let\ptext=\t - -% We never want plain's outer \+ definition in Texinfo. -% For @tex, we can use \tabalign. -\let\+ = \relax - - -\message{Basics,} -\chardef\other=12 - -% If this character appears in an error message or help string, it -% starts a new line in the output. -\newlinechar = `^^J - -% Set up fixed words for English if not already set. -\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi -\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi -\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi -\ifx\putwordInfo\undefined \gdef\putwordfile{Info}\fi -\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi -\ifx\putwordon\undefined \gdef\putwordon{on}\fi -\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi -\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi -\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi -\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi -\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi -\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi -\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi - -% Ignore a token. -% -\def\gobble#1{} - -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} -\hyphenation{white-space} - -% Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset -\newdimen \normaloffset -\newdimen\pagewidth \newdimen\pageheight - -% Sometimes it is convenient to have everything in the transcript file -% and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. -% -\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\def\loggingall{\tracingcommands2 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% - -% For @cropmarks command. -% Do @cropmarks to get crop marks. -% -\newif\ifcropmarks -\let\cropmarks = \cropmarkstrue -% -% Dimensions to add cropmarks at corners. -% Added by P. A. MacKay, 12 Nov. 1986 -% -\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines -\newdimen\cornerlong \cornerlong=1pc -\newdimen\cornerthick \cornerthick=.3pt -\newdimen\topandbottommargin \topandbottommargin=.75in - -% Main output routine. -\chardef\PAGE = 255 -\output = {\onepageout{\pagecontents\PAGE}} - -\newbox\headlinebox -\newbox\footlinebox - -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions, but you have to call it yourself. -\def\onepageout#1{% - \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi - % - \ifodd\pageno \advance\hoffset by \bindingoffset - \else \advance\hoffset by -\bindingoffset\fi - % - % Do this outside of the \shipout so @code etc. will be expanded in - % the headline as they should be, not taken literally (outputting ''code). - \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% - \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% - % - {% - % Have to do this stuff outside the \shipout because we want it to - % take effect in \write's, yet the group defined by the \vbox ends - % before the \shipout runs. - % - \escapechar = `\\ % use backslash in output files. - \indexdummies % don't expand commands in the output. - \normalturnoffactive % \ in index entries must not stay \, e.g., if - % the page break happens to be in the middle of an example. - \shipout\vbox{% - \ifcropmarks \vbox to \outervsize\bgroup - \hsize = \outerhsize - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% - \vskip\topandbottommargin - \line\bgroup - \hfil % center the page within the outer (page) hsize. - \ifodd\pageno\hskip\bindingoffset\fi - \vbox\bgroup - \fi - % - \unvbox\headlinebox - \pagebody{#1}% - \ifdim\ht\footlinebox > 0pt - % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingxxx.) - % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 2\baselineskip - \unvbox\footlinebox - \fi - % - \ifcropmarks - \egroup % end of \vbox\bgroup - \hfil\egroup % end of (centering) \line\bgroup - \vskip\topandbottommargin plus1fill minus1fill - \boxmaxdepth = \cornerthick - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% - }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% - \egroup % \vbox from first cropmarks clause - \fi - }% end of \shipout\vbox - }% end of group with \turnoffactive - \advancepageno - \ifnum\outputpenalty>-20000 \else\dosupereject\fi -} - -\newinsert\margin \dimen\margin=\maxdimen - -\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} -{\catcode`\@ =11 -\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi -% marginal hacks, juha@viisa.uucp (Juha Takala) -\ifvoid\margin\else % marginal info is present - \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1 \unvbox#1 -\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi -\ifr@ggedbottom \kern-\dimen@ \vfil \fi} -} - -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - -% Parse an argument, then pass it to #1. The argument is the rest of -% the input line (except we remove a trailing comment). #1 should be a -% macro which expects an ordinary undelimited TeX argument. -% -\def\parsearg#1{% - \let\next = #1% - \begingroup - \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi -} - -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - -{\obeylines % - \gdef\parseargline#1^^M{% - \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% - }% -} - -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} - -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., -% @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup -} - -% Change the active space to expand to nothing. -% -\begingroup - \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup - - -\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} - -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment. Type Return to continue.} -\endgroup\fi} % This is not perfect, but it should reduce lossage - -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Type to continue.} - -\outer\def\begin{\parsearg\beginxxx} - -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} - -% @end foo executes the definition of \Efoo. -% -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi - \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname - \fi -} - -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% - \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% -} - -% Define the control sequence \E#1 to give an unmatched @end error. -% -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% -} - - -% Single-spacing is done by various environments (specifically, in -% \nonfillstart and \quotations). -\newskip\singlespaceskip \singlespaceskip = 12.5pt -\def\singlespace{% - % Why was this kern here? It messes up equalizing space above and below - % environments. --karl, 6may93 - %{\advance \baselineskip by -\singlespaceskip - %\kern \baselineskip}% - \setleading \singlespaceskip -} - -%% Simple single-character @ commands - -% @@ prints an @ -% Kludge this until the fonts are right (grr). -\def\@{{\tt\char64}} - -% This is turned off because it was never documented -% and you can use @w{...} around a quote to suppress ligatures. -%% Define @` and @' to be the same as ` and ' -%% but suppressing ligatures. -%\def\`{{`}} -%\def\'{{'}} - -% Used to generate quoted braces. -\def\mylbrace {{\tt\char123}} -\def\myrbrace {{\tt\char125}} -\let\{=\mylbrace -\let\}=\myrbrace -\begingroup - % Definitions to produce actual \{ & \} command in an index. - \catcode`\{ = 12 \catcode`\} = 12 - \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\@ = 0 \catcode`\\ = 12 - @gdef@lbracecmd[\{]% - @gdef@rbracecmd[\}]% -@endgroup - -% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent -% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. -\let\, = \c -\let\dotaccent = \. -\def\ringaccent#1{{\accent23 #1}} -\let\tieaccent = \t -\let\ubaraccent = \b -\let\udotaccent = \d - -% Other special characters: @questiondown @exclamdown -% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. -\def\questiondown{?`} -\def\exclamdown{!`} - -% Dotless i and dotless j, used for accents. -\def\imacro{i} -\def\jmacro{j} -\def\dotless#1{% - \def\temp{#1}% - \ifx\temp\imacro \ptexi - \else\ifx\temp\jmacro \j - \else \errmessage{@dotless can be used only with i or j}% - \fi\fi -} - -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} - -% @: forces normal size whitespace following. -\def\:{\spacefactor=1000 } - -% @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} - -% @. is an end-of-sentence period. -\def\.{.\spacefactor=3000 } - -% @! is an end-of-sentence bang. -\def\!{!\spacefactor=3000 } - -% @? is an end-of-sentence query. -\def\?{?\spacefactor=3000 } - -% @w prevents a word break. Without the \leavevmode, @w at the -% beginning of a paragraph, when TeX is still in vertical mode, would -% produce a whole line of output instead of starting the paragraph. -\def\w#1{\leavevmode\hbox{#1}} - -% @group ... @end group forces ... to be all on one page, by enclosing -% it in a TeX vbox. We use \vtop instead of \vbox to construct the box -% to keep its height that of a normal line. According to the rules for -% \topskip (p.114 of the TeXbook), the glue inserted is -% max (\topskip - \ht (first item), 0). If that height is large, -% therefore, no glue is inserted, and the space between the headline and -% the text is small, which looks bad. -% -\def\group{\begingroup - \ifnum\catcode13=\active \else - \errhelp = \groupinvalidhelp - \errmessage{@group invalid in context where filling is enabled}% - \fi - % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - \endgroup % End the \group. - }% - % - \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % - % Do @comment since we are called inside an environment such as - % @example, where each end-of-line in the input causes an - % end-of-line in the output. We don't want the end-of-line after - % the `@group' to put extra space in the output. Since @group - % should appear on a line by itself (according to the Texinfo - % manual), we don't worry about eating any user text. - \comment -} -% -% TeX puts in an \escapechar (i.e., `@') at the beginning of the help -% message, so this ends up printing `@group can only ...'. -% -\newhelp\groupinvalidhelp{% -group can only be used in environments such as @example,^^J% -where each line of input produces a line of output.} - -% @need space-in-mils -% forces a page break if there is not space-in-mils remaining. - -\newdimen\mil \mil=0.001in - -\def\need{\parsearg\needx} - -% Old definition--didn't work. -%\def\needx #1{\par % -%% This method tries to make TeX break the page naturally -%% if the depth of the box does not fit. -%{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 -%\prevdepth=-1000pt -%}} - -\def\needx#1{% - % Go into vertical mode, so we don't make a big box in the middle of a - % paragraph. - \par - % - % Don't add any leading before our big empty box, but allow a page - % break, since the best break might be right here. - \allowbreak - \nointerlineskip - \vtop to #1\mil{\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak -} - -% @br forces paragraph break - -\let\br = \par - -% @dots{} output an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. -% -\def\dots{\hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil -}} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \hbox to 2em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% - \spacefactor=3000 -} - - -% @page forces the start of a new page - -\def\page{\par\vfill\supereject} - -% @exdent text.... -% outputs text on separate line in roman font, starting at standard page margin - -% This records the amount of indent in the innermost environment. -% That's how much \exdent should take out. -\newskip\exdentamount - -% This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} - -% This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} - -% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. - -\def\inmargin#1{% -\strut\vadjust{\nobreak\kern-\strutdepth - \vtop to \strutdepth{\baselineskip\strutdepth\vss - \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} -\newskip\inmarginspacing \inmarginspacing=1cm -\def\strutdepth{\dp\strutbox} - -%\hbox{{\rm#1}}\hfil\break}} - -% @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup - \catcode`\\=12 - \catcode`~=12 - \catcode`^=12 - \catcode`_=12 - \catcode`|=12 - \catcode`<=12 - \catcode`>=12 - \catcode`+=12 - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. - \def\thisfile{#1}% - \input\thisfile -\endgroup} - -\def\thisfile{} - -% @center line outputs that line, centered - -\def\center{\parsearg\centerzzz} -\def\centerzzz #1{{\advance\hsize by -\leftskip -\advance\hsize by -\rightskip -\centerline{#1}}} - -% @sp n outputs n lines of vertical space - -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\vskip #1\baselineskip} - -% @comment ...line which is ignored... -% @c is the same as @comment -% @ignore ... @end ignore is another way to write a comment - -\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% -\parsearg \commentxxx} - -\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } - -\let\c=\comment - -% @paragraphindent is defined for the Info formatting commands only. -\let\paragraphindent=\comment - -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% -\let\chapter=\relax -\let\unnumbered=\relax -\let\top=\relax -\let\unnumberedsec=\relax -\let\unnumberedsection=\relax -\let\unnumberedsubsec=\relax -\let\unnumberedsubsection=\relax -\let\unnumberedsubsubsec=\relax -\let\unnumberedsubsubsection=\relax -\let\section=\relax -\let\subsec=\relax -\let\subsubsec=\relax -\let\subsection=\relax -\let\subsubsection=\relax -\let\appendix=\relax -\let\appendixsec=\relax -\let\appendixsection=\relax -\let\appendixsubsec=\relax -\let\appendixsubsection=\relax -\let\appendixsubsubsec=\relax -\let\appendixsubsubsection=\relax -\let\contents=\relax -\let\smallbook=\relax -\let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\everyheading = \relax - \let\evenheading = \relax - \let\oddheading = \relax - \let\everyfooting = \relax - \let\evenfooting = \relax - \let\oddfooting = \relax - \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax -} - -% Ignore @ignore ... @end ignore. -% -\def\ignore{\doignore{ignore}} - -% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} -\def\ifhtml{\doignore{ifhtml}} -\def\ifnottex{\doignore{ifnottex}} -\def\html{\doignore{html}} -\def\menu{\doignore{menu}} -\def\direntry{\doignore{direntry}} - -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. -% -\def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% - % - % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 - % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 - % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 - % - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - % - % And now expand that command. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi -} - -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont - \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont - \let\tensf = \nullfont - % Similarly for index fonts (mostly for their use in - % smallexample) - \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont - \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont - \let\indsf = \nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}}% -} - -% @set VAR sets the variable VAR to an empty value. -% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. -% -% Since we want to separate VAR from REST-OF-LINE (which might be -% empty), we can't just use \parsearg; we have to insert a space of our -% own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. -% -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} -\def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup -} -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} - -% @clear VAR clears (i.e., unsets) the variable VAR. -% -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} - -% @value{foo} gets the text saved in variable foo. -% -\def\value{\begingroup - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \valuexxx} -\def\valuexxx#1{\expandablevalue{#1}\endgroup} - -% We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable, since the result -% winds up in the index file. This means that if the variable's value -% contains other Texinfo commands, it's almost certain it will fail -% (although perhaps we could fix that with sufficient work to do a -% one-level expansion on the result, instead of complete). -% -\def\expandablevalue#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - {[No value for ``#1'']v}% - \else - \csname SET#1\endcsname - \fi -} - -% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined -% with @set. -% -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi -} -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} - -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been -% defined with @set, or has been undefined with @clear. -% -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text -% following, through the first @end iftex (etc.). Make `@end iftex' -% (etc.) valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} - -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. -% -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} - -% @asis just yields its argument. Used with @table, for example. -% -\def\asis#1{#1} - -% @math means output in math mode. -% We don't use $'s directly in the definition of \math because control -% sequences like \math are expanded when the toc file is written. Then, -% we read the toc file back, the $'s will be normal characters (as they -% should be, according to the definition of Texinfo). So we must use a -% control sequence to switch into and out of math mode. -% -% This isn't quite enough for @math to work properly in indices, but it -% seems unlikely it will ever be needed there. -% -\let\implicitmath = $ -\def\math#1{\implicitmath #1\implicitmath} - -% @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} - -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -\def\donoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\setref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\unnumbnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\appendixnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -% @refill is a no-op. -\let\refill=\relax - -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate (before @setfilename). -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \iflinks - \readauxfile - \opencontents - \fi % \openindices needs to do some work in any case. - \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. - % - % If texinfo.cnf is present on the system, read it. - % Useful for site-wide @afourpaper, etc. - % Just to be on the safe side, close the input stream before the \input. - \openin 1 texinfo.cnf - \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - \closein1 - \temp - % - \comment % Ignore the actual filename. -} - -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - -% @bye. -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - - -\message{fonts,} -% Font-change commands. - -% Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. -\newfam\sffam -\def\sf{\fam=\sffam \tensf} -\let\li = \sf % Sometimes we call it \li, not \sf. - -% We don't need math for this one. -\def\ttsl{\tenttsl} - -% Use Computer Modern fonts at \magstephalf (11pt). -\newcount\mainmagstep -\mainmagstep=\magstephalf - -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). -% #3 is the font's design size, #4 is a scale factor -\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} - -% Use cm as the default font prefix. -% To specify the font prefix, you must define \fontprefix -% before you read in texinfo.tex. -\ifx\fontprefix\undefined -\def\fontprefix{cm} -\fi -% Support font families that don't use the same naming scheme as CM. -\def\rmshape{r} -\def\rmbshape{bx} %where the normal face is bold -\def\bfshape{b} -\def\bxshape{bx} -\def\ttshape{tt} -\def\ttbshape{tt} -\def\ttslshape{sltt} -\def\itshape{ti} -\def\itbshape{bxti} -\def\slshape{sl} -\def\slbshape{bxsl} -\def\sfshape{ss} -\def\sfbshape{ss} -\def\scshape{csc} -\def\scbshape{csc} - -\ifx\bigger\relax -\let\mainmagstep=\magstep1 -\setfont\textrm\rmshape{12}{1000} -\setfont\texttt\ttshape{12}{1000} -\else -\setfont\textrm\rmshape{10}{\mainmagstep} -\setfont\texttt\ttshape{10}{\mainmagstep} -\fi -% Instead of cmb10, you many want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10. -\setfont\textbf\bfshape{10}{\mainmagstep} -\setfont\textit\itshape{10}{\mainmagstep} -\setfont\textsl\slshape{10}{\mainmagstep} -\setfont\textsf\sfshape{10}{\mainmagstep} -\setfont\textsc\scshape{10}{\mainmagstep} -\setfont\textttsl\ttslshape{10}{\mainmagstep} -\font\texti=cmmi10 scaled \mainmagstep -\font\textsy=cmsy10 scaled \mainmagstep - -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 -\setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} - -% Fonts for indices and small examples (9pt). -% We actually use the slanted font rather than the italic, -% because texinfo normally uses the slanted fonts for that. -% Do not make many font distinctions in general in the index, since they -% aren't very useful. -\setfont\ninett\ttshape{9}{1000} -\setfont\indrm\rmshape{9}{1000} -\setfont\indit\slshape{9}{1000} -\let\indsl=\indit -\let\indtt=\ninett -\let\indttsl=\ninett -\let\indsf=\indrm -\let\indbf=\indrm -\setfont\indsc\scshape{10}{900} -\font\indi=cmmi9 -\font\indsy=cmsy9 - -% Fonts for title page: -\setfont\titlerm\rmbshape{12}{\magstep3} -\setfont\titleit\itbshape{10}{\magstep4} -\setfont\titlesl\slbshape{10}{\magstep4} -\setfont\titlett\ttbshape{12}{\magstep3} -\setfont\titlettsl\ttslshape{10}{\magstep4} -\setfont\titlesf\sfbshape{17}{\magstep1} -\let\titlebf=\titlerm -\setfont\titlesc\scbshape{10}{\magstep4} -\font\titlei=cmmi12 scaled \magstep3 -\font\titlesy=cmsy10 scaled \magstep4 -\def\authorrm{\secrm} - -% Chapter (and unnumbered) fonts (17.28pt). -\setfont\chaprm\rmbshape{12}{\magstep2} -\setfont\chapit\itbshape{10}{\magstep3} -\setfont\chapsl\slbshape{10}{\magstep3} -\setfont\chaptt\ttbshape{12}{\magstep2} -\setfont\chapttsl\ttslshape{10}{\magstep3} -\setfont\chapsf\sfbshape{17}{1000} -\let\chapbf=\chaprm -\setfont\chapsc\scbshape{10}{\magstep3} -\font\chapi=cmmi12 scaled \magstep2 -\font\chapsy=cmsy10 scaled \magstep3 - -% Section fonts (14.4pt). -\setfont\secrm\rmbshape{12}{\magstep1} -\setfont\secit\itbshape{10}{\magstep2} -\setfont\secsl\slbshape{10}{\magstep2} -\setfont\sectt\ttbshape{12}{\magstep1} -\setfont\secttsl\ttslshape{10}{\magstep2} -\setfont\secsf\sfbshape{12}{\magstep1} -\let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep2} -\font\seci=cmmi12 scaled \magstep1 -\font\secsy=cmsy10 scaled \magstep2 - -% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. -% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. -% \setfont\ssecsl\slshape{10}{\magstep1} -% \setfont\ssectt\ttshape{10}{\magstep1} -% \setfont\ssecsf\sfshape{10}{\magstep1} - -%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than -%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. -%\setfont\ssectt\ttshape{10}{1315} -%\setfont\ssecsf\sfshape{10}{1315} - -%\let\ssecbf=\ssecrm - -% Subsection fonts (13.15pt). -\setfont\ssecrm\rmbshape{12}{\magstephalf} -\setfont\ssecit\itbshape{10}{1315} -\setfont\ssecsl\slbshape{10}{1315} -\setfont\ssectt\ttbshape{12}{\magstephalf} -\setfont\ssecttsl\ttslshape{10}{1315} -\setfont\ssecsf\sfbshape{12}{\magstephalf} -\let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} -\font\sseci=cmmi12 scaled \magstephalf -\font\ssecsy=cmsy10 scaled 1315 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. - -% In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts, we -% don't bother to reset \scriptfont and \scriptscriptfont (which would -% also require loading a lot more fonts). -% -\def\resetmathfonts{% - \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy - \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf - \textfont\ttfam = \tentt \textfont\sffam = \tensf -} - - -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl - \resetmathfonts} -\def\titlefonts{% - \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl - \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc - \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy - \let\tenttsl=\titlettsl - \resetmathfonts \setleading{25pt}} -\def\titlefont#1{{\titlefonts\rm #1}} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl - \resetmathfonts \setleading{19pt}} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl - \resetmathfonts \setleading{16pt}} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl - \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? -\def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl - \resetmathfonts \setleading{12pt}} - -% Set up the default fonts, so we can use them for creating boxes. -% -\textfonts - -% Define these so they can be easily changed for other fonts. -\def\angleleft{$\langle$} -\def\angleright{$\rangle$} - -% Count depth in font-changes, for error checks -\newcount\fontdepth \fontdepth=0 - -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} -\setfont\shortcontsl\slshape{12}{1000} - -%% Add scribe-like font environments, plus @l for inline lisp (usually sans -%% serif) and @ii for TeX italic - -% \smartitalic{ARG} outputs arg in italics, followed by an italic correction -% unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} - -\let\i=\smartitalic -\let\var=\smartitalic -\let\dfn=\smartitalic -\let\emph=\smartitalic -\let\cite=\smartitalic - -\def\b#1{{\bf #1}} -\let\strong=\b - -% We can't just use \exhyphenpenalty, because that only has effect at -% the end of a paragraph. Restore normal hyphenation at the end of the -% group within which \nohyphenation is presumably called. -% -\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} -\def\restorehyphenation{\hyphenchar\font = `- } - -\def\t#1{% - {\tt \rawbackslash \frenchspacing #1}% - \null -} -\let\ttfont=\t -\def\samp#1{`\tclose{#1}'\null} -\setfont\smallrm\rmshape{8}{1000} -\font\smallsy=cmsy9 -\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% - \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% - \vbox{\hrule\kern-0.4pt - \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% - \kern-0.4pt\hrule}% - \kern-.06em\raise0.4pt\hbox{\angleright}}}} -% The old definition, with no lozenge: -%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -\let\file=\samp - -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. -\def\tclose#1{% - {% - % Change normal interword space to be same as for the current font. - \spaceskip = \fontdimen2\font - % - % Switch to typewriter. - \tt - % - % But `\ ' produces the large typewriter interword space. - \def\ {{\spaceskip = 0pt{} }}% - % - % Turn off hyphenation. - \nohyphenation - % - \rawbackslash - \frenchspacing - #1% - }% - \null -} - -% We *must* turn on hyphenation at `-' and `_' in \code. -% Otherwise, it is too hard to avoid overfull hboxes -% in the Emacs manual, the Library manual, etc. - -% Unfortunately, TeX uses one parameter (\hyphenchar) to control -% both hyphenation at - and hyphenation within words. -% We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate at a dash. -% -- rms. -{ -\catcode`\-=\active -\catcode`\_=\active -\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 -% _ 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\codedash{-\discretionary{}{}{}} -\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} -\def\codex #1{\tclose{#1}\endgroup} - -%\let\exp=\tclose %Was temporary - -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. - -% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), -% `example' (@kbd uses ttsl only inside of @example and friends), -% or `code' (@kbd uses normal tty font always). -\def\kbdinputstyle{\parsearg\kbdinputstylexxx} -\def\kbdinputstylexxx#1{% - \def\arg{#1}% - \ifx\arg\worddistinct - \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% - \else\ifx\arg\wordexample - \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% - \else\ifx\arg\wordcode - \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% - \fi\fi\fi -} -\def\worddistinct{distinct} -\def\wordexample{example} -\def\wordcode{code} - -% Default is kbdinputdistinct. (Too much of a hassle to call the macro, -% the catcodes are wrong for parsearg to work.) -\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} - -\def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\kbdfont\look}}\fi -\else{\tclose{\kbdfont\look}}\fi} - -% @url. Quotes do not seem necessary, so use \code. -\let\url=\code - -% @uref (abbreviation for `urlref') takes an optional second argument -% specifying the text to display. First (mandatory) arg is the url. -% Perhaps eventually put in a hypertex \special here. -% -\def\uref#1{\urefxxx #1,,\finish} -\def\urefxxx#1,#2,#3\finish{% - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \unhbox0\ (\code{#1})% - \else - \code{#1}% - \fi -} - -% rms does not like the angle brackets --karl, 17may97. -% So now @email is just like @uref. -%\def\email#1{\angleleft{\tt #1}\angleright} -\let\email=\uref - -% Check if we are currently using a typewriter font. Since all the -% Computer Modern typewriter fonts have zero interword stretch (and -% shrink), and it is reasonable to expect all typewriter fonts to have -% this property, we can check that font parameter. -% -\def\ifmonospace{\ifdim\fontdimen3\font=0pt } - -% Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of -% @dmn{}pt. -% -\def\dmn#1{\thinspace #1} - -\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - -% @l was never documented to mean ``switch to the Lisp font'', -% and it is not used as such in any manual I can find. We need it for -% Polish suppressed-l. --karl, 22sep96. -%\def\l#1{{\li #1}\null} - -\def\r#1{{\rm #1}} % roman font -% Use of \lowercase was suggested. -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font - -% @pounds{} is a sterling sign. -\def\pounds{{\it\$}} - - -\message{page headings,} - -\newskip\titlepagetopglue \titlepagetopglue = 1.5in -\newskip\titlepagebottomglue \titlepagebottomglue = 2pc - -% First the title page. Must do @settitle before @titlepage. -\newif\ifseenauthor -\newif\iffinishedtitlepage - -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} - -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm -% I deinstalled the following change because \cmr12 is undefined. -% This change was not in the ChangeLog anyway. --rms. -% \let\subtitlerm=\cmr12 - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - \oldpage - \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} -} - -\def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - \HEADINGSon -} - -\def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue -} - -%%% Set up page headings and footings. - -\let\thispage=\folio - -\newtoks \evenheadline % Token sequence for heading line of even pages -\newtoks \oddheadline % Token sequence for heading line of odd pages -\newtoks \evenfootline % Token sequence for footing line of even pages -\newtoks \oddfootline % Token sequence for footing line of odd pages - -% Now make Tex use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} -\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline - \else \the\evenfootline \fi}\HEADINGShook} -\let\HEADINGShook=\relax - -% Commands to set those variables. -% For example, this is what @headings on does -% @evenheading @thistitle|@thispage|@thischapter -% @oddheading @thischapter|@thispage|@thistitle -% @evenfooting @thisfile|| -% @oddfooting ||@thisfile - -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% - -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% - \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% - % - % Leave some space for the footline. Hopefully ok to assume - % @evenfooting will not be used by itself. - \global\advance\pageheight by -\baselineskip - \global\advance\vsize by -\baselineskip -} - -\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} -% -}% unbind the catcode of @. - -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. -% @headings singleafter turns on single-sided headings after this page. -% By default, they are off at the start of a document, -% and turned `on' after @end titlepage. - -\def\headings #1 {\csname HEADINGS#1\endcsname} - -\def\HEADINGSoff{ -\global\evenheadline={\hfil} \global\evenfootline={\hfil} -\global\oddheadline={\hfil} \global\oddfootline={\hfil}} -\HEADINGSoff -% When we turn headings on, set the page number to 1. -% For double-sided printing, put current file name in lower left corner, -% chapter name on inside top of right hand pages, document -% title on inside top of left hand pages, and page numbers on outside top -% edge of all pages. -\def\HEADINGSdouble{ -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage -} -\let\contentsalignmacro = \chappager - -% For single-sided printing, chapter title goes across top left of page, -% page number on top right. -\def\HEADINGSsingle{ -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chappager -} -\def\HEADINGSon{\HEADINGSdouble} - -\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} -\let\HEADINGSdoubleafter=\HEADINGSafter -\def\HEADINGSdoublex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage -} - -\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} -\def\HEADINGSsinglex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chappager -} - -% Subroutines used in generating headings -% Produces Day Month Year style of output. -\def\today{\number\day\space -\ifcase\month\or -January\or February\or March\or April\or May\or June\or -July\or August\or September\or October\or November\or December\fi -\space\number\year} - -% Use this if you want the Month Day, Year style of output. -%\def\today{\ifcase\month\or -%January\or February\or March\or April\or May\or June\or -%July\or August\or September\or October\or November\or December\fi -%\space\number\day, \number\year} - -% @settitle line... specifies the title of the document, for headings -% It generates no output of its own - -\def\thistitle{No Title} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} - - -\message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). - -% default indentation of table text -\newdimen\tableindent \tableindent=.8in -% default indentation of @itemize and @enumerate text -\newdimen\itemindent \itemindent=.3in -% margin between end of table item and start of table text. -\newdimen\itemmargin \itemmargin=.1in - -% used internally for \itemindent minus \itemmargin -\newdimen\itemmax - -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with -% these defs. -% They also define \itemindex -% to index the item name in whatever manner is desired (perhaps none). - -\newif\ifitemxneedsnegativevskip - -\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} - -\def\internalBitem{\smallbreak \parsearg\itemzzz} -\def\internalBitemx{\itemxpar \parsearg\itemzzz} - -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - -\def\itemzzz #1{\begingroup % - \advance\hsize by -\rightskip - \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% - \itemindex{#1}% - \nobreak % This prevents a break before @itemx. - % - % Be sure we are not still in the middle of a paragraph. - %{\parskip = 0in - %\par - %}% - % - % If the item text does not fit in the space we have, put it on a line - % by itself, and do not allow a page break either before or after that - % line. We do not start a paragraph here because then if the next - % command is, e.g., @kindex, the whatsit would get put into the - % horizontal list on a line by itself, resulting in extra blank space. - \ifdim \wd0>\itemmax - % - % Make this a paragraph so we get the \parskip glue and wrapping, - % but leave it ragged-right. - \begingroup - \advance\leftskip by-\tableindent - \advance\hsize by\tableindent - \advance\rightskip by0pt plus1fil - \leavevmode\unhbox0\par - \endgroup - % - % We're going to be starting a paragraph, but we don't want the - % \parskip glue -- logically it's part of the @item we just started. - \nobreak \vskip-\parskip - % - % Stop a page break at the \parskip glue coming up. Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue. - \nobreak - \endgroup - \itemxneedsnegativevskipfalse - \else - % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. Since that - % text will be indented by \tableindent, we make the item text be in - % a zero-width box. - \noindent - \rlap{\hskip -\tableindent\box0}\ignorespaces% - \endgroup% - \itemxneedsnegativevskiptrue% - \fi -} - -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -%% Contains a kludge to get @end[description] to work -\def\description{\tablez{\dontindex}{1}{}{}{}{}} - -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % -} - -% This is the counter used by @enumerate, which is really @itemize - -\newcount \itemno - -\def\itemize{\parsearg\itemizezzz} - -\def\itemizezzz #1{% - \begingroup % ended by the @end itemize - \itemizey {#1}{\Eitemize} -} - -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} - -% Set sfcode to normal for the chars that usually have another value. -% These are `.?!:;,' -\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 - \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } - -% \splitoff TOKENS\endmark defines \first to be the first token in -% TOKENS, and \rest to be the remainder. -% -\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% - -% Allow an optional argument of an uppercase letter, lowercase letter, -% or number, to specify the first label in the enumerated list. No -% argument is the same as `1'. -% -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} -\def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % - % If we were given no argument, pretend we were given `1'. - \def\thearg{#1}% - \ifx\thearg\empty \def\thearg{1}\fi - % - % Detect if the argument is a single token. If so, it might be a - % letter. Otherwise, the only valid thing it can be is a number. - % (We will always have one token, because of the test we just made. - % This is a good thing, since \splitoff doesn't work given nothing at - % all -- the first parameter is undelimited.) - \expandafter\splitoff\thearg\endmark - \ifx\rest\empty - % Only one token in the argument. It could still be anything. - % A ``lowercase letter'' is one whose \lccode is nonzero. - % An ``uppercase letter'' is one whose \lccode is both nonzero, and - % not equal to itself. - % Otherwise, we assume it's a number. - % - % We need the \relax at the end of the \ifnum lines to stop TeX from - % continuing to look for a . - % - \ifnum\lccode\expandafter`\thearg=0\relax - \numericenumerate % a number (we hope) - \else - % It's a letter. - \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax - \lowercaseenumerate % lowercase letter - \else - \uppercaseenumerate % uppercase letter - \fi - \fi - \else - % Multiple tokens in the argument. We hope it's a number. - \numericenumerate - \fi -} - -% An @enumerate whose labels are integers. The starting integer is -% given in \thearg. -% -\def\numericenumerate{% - \itemno = \thearg - \startenumeration{\the\itemno}% -} - -% The starting (lowercase) letter is in \thearg. -\def\lowercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more lowercase letters in @enumerate; get a bigger - alphabet}% - \fi - \char\lccode\itemno - }% -} - -% The starting (uppercase) letter is in \thearg. -\def\uppercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more uppercase letters in @enumerate; get a bigger - alphabet} - \fi - \char\uccode\itemno - }% -} - -% Call itemizey, adding a period to the first argument and supplying the -% common last two arguments. Also subtract one from the initial value in -% \itemno, since @item increments \itemno. -% -\def\startenumeration#1{% - \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr -} - -% @alphaenumerate and @capsenumerate are abbreviations for giving an arg -% to @enumerate. -% -\def\alphaenumerate{\enumerate{a}} -\def\capsenumerate{\enumerate{A}} -\def\Ealphaenumerate{\Eenumerate} -\def\Ecapsenumerate{\Eenumerate} - -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{In hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} - -% @multitable macros -% Amy Hendrickson, 8/18/94, 3/6/96 -% -% @multitable ... @end multitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width -% can be specified either with sample text given in a template line, -% or in percent of \hsize, the current width of text on page. - -% Table can continue over pages but will only break between lines. - -% To make preamble: -% -% Either define widths of columns in terms of percent of \hsize: -% @multitable @columnfractions .25 .3 .45 -% @item ... -% -% Numbers following @columnfractions are the percent of the total -% current hsize to be used for each column. You may use as many -% columns as desired. - - -% Or use a template: -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item ... -% using the widest term desired in each column. -% -% For those who want to use more than one line's worth of words in -% the preamble, break the line within one argument and it -% will parse correctly, i.e., -% -% @multitable {Column 1 template} {Column 2 template} {Column 3 -% template} -% Not: -% @multitable {Column 1 template} {Column 2 template} -% {Column 3 template} - -% Each new table line starts with @item, each subsequent new column -% starts with @tab. Empty columns may be produced by supplying @tab's -% with nothing between them for as many times as empty columns are needed, -% ie, @tab@tab@tab will produce two empty columns. - -% @item, @tab, @multitable or @end multitable do not need to be on their -% own lines, but it will not hurt if they are. - -% Sample multitable: - -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff -% @tab Many paragraphs of text may be used in any column. -% -% They will wrap at the width determined by the template. -% @item@tab@tab This will be in third column. -% @end multitable - -% Default dimensions may be reset by user. -% @multitableparskip is vertical space between paragraphs in table. -% @multitableparindent is paragraph indent in table. -% @multitablecolmargin is horizontal space to be left between columns. -% @multitablelinespace is space to leave between table items, baseline -% to baseline. -% 0pt means it depends on current normal line spacing. -% -\newskip\multitableparskip -\newskip\multitableparindent -\newdimen\multitablecolspace -\newskip\multitablelinespace -\multitableparskip=0pt -\multitableparindent=6pt -\multitablecolspace=12pt -\multitablelinespace=0pt - -% Macros used to set up halign preamble: -% -\let\endsetuptable\relax -\def\xendsetuptable{\endsetuptable} -\let\columnfractions\relax -\def\xcolumnfractions{\columnfractions} -\newif\ifsetpercent - -% 2/1/96, to allow fractions to be given with more than one digit. -\def\pickupwholefraction#1 {\global\advance\colcount by1 % -\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% -\setuptable} - -\newcount\colcount -\def\setuptable#1{\def\firstarg{#1}% -\ifx\firstarg\xendsetuptable\let\go\relax% -\else - \ifx\firstarg\xcolumnfractions\global\setpercenttrue% - \else - \ifsetpercent - \let\go\pickupwholefraction % In this case arg of setuptable - % is the decimal point before the - % number given in percent of hsize. - % We don't need this so we don't use it. - \else - \global\advance\colcount by1 - \setbox0=\hbox{#1 }% Add a normal word space as a separator; - % typically that is always in the input, anyway. - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi% - \fi% -\ifx\go\pickupwholefraction\else\let\go\setuptable\fi% -\fi\go} - -% multitable syntax -\def\tab{&\hskip1sp\relax} % 2/2/96 - % tiny skip here makes sure this column space is - % maintained, even if it is never used. - -% @multitable ... @end multitable definitions: - -\def\multitable{\parsearg\dotable} -\def\dotable#1{\bgroup - \vskip\parskip - \let\item\crcr - \tolerance=9500 - \hbadness=9500 - \setmultitablespacing - \parskip=\multitableparskip - \parindent=\multitableparindent - \overfullrule=0pt - \global\colcount=0 - \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% - % - % To parse everything between @multitable and @item: - \setuptable#1 \endsetuptable - % - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - \everycr{\noalign{% - % - % \filbreak%% keeps underfull box messages off when table breaks over pages. - % Maybe so, but it also creates really weird page breaks when the table - % breaks over pages. Wouldn't \vfil be better? Wait until the problem - % manifests itself, so it can be fixed for real --karl. - \global\colcount=0\relax}}% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax - \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr -} - -\def\setmultitablespacing{% test to see if user has set \multitablelinespace. -% If so, do nothing. If not, give it an appropriate dimension based on -% current baselineskip. -\ifdim\multitablelinespace=0pt -%% strut to put in table in case some entry doesn't have descenders, -%% to keep lines equally spaced -\let\multistrut = \strut -%% Test to see if parskip is larger than space between lines of -%% table. If not, do nothing. -%% If so, set to same dimension as multitablelinespace. -\else -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi -\ifdim\multitableparskip>\multitablelinespace -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. -\fi% -\ifdim\multitableparskip=0pt -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. -\fi} - - -\message{indexing,} -% Index generation facilities - -% Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within \newindex. -{\catcode`\@=11 -\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} - -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. -% The name of an index should be no more than 2 characters long -% for the sake of vms. -% -\def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi - \expandafter\xdef\csname#1index\endcsname{% % Define @#1index - \noexpand\doindex{#1}} -} - -% @defindex foo == \newindex{foo} - -\def\defindex{\parsearg\newindex} - -% Define @defcodeindex, like @defindex except put all entries in @code. - -\def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi - \expandafter\xdef\csname#1index\endcsname{% - \noexpand\docodeindex{#1}} -} - -\def\defcodeindex{\parsearg\newcodeindex} - -% @synindex foo bar makes index foo feed into index bar. -% Do this instead of @defindex foo if you don't want it as a separate index. -% The \closeout helps reduce unnecessary open files; the limit on the -% Acorn RISC OS is a mere 16 files. -\def\synindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\doindex{#2}}% -} - -% @syncodeindex foo bar similar, but put all entries made for index foo -% inside @code. -\def\syncodeindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\docodeindex{#2}}% -} - -% Define \doindex, the driver for all \fooindex macros. -% Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. - -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} - -% like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} - -\def\indexdummies{% -\def\ { }% -% Take care of the plain tex accent commands. -\def\"{\realbackslash "}% -\def\`{\realbackslash `}% -\def\'{\realbackslash '}% -\def\^{\realbackslash ^}% -\def\~{\realbackslash ~}% -\def\={\realbackslash =}% -\def\b{\realbackslash b}% -\def\c{\realbackslash c}% -\def\d{\realbackslash d}% -\def\u{\realbackslash u}% -\def\v{\realbackslash v}% -\def\H{\realbackslash H}% -% Take care of the plain tex special European modified letters. -\def\oe{\realbackslash oe}% -\def\ae{\realbackslash ae}% -\def\aa{\realbackslash aa}% -\def\OE{\realbackslash OE}% -\def\AE{\realbackslash AE}% -\def\AA{\realbackslash AA}% -\def\o{\realbackslash o}% -\def\O{\realbackslash O}% -\def\l{\realbackslash l}% -\def\L{\realbackslash L}% -\def\ss{\realbackslash ss}% -% Take care of texinfo commands likely to appear in an index entry. -% (Must be a way to avoid doing expansion at all, and thus not have to -% laboriously list every single command here.) -\def\@{@}% will be @@ when we switch to @ as escape char. -%\let\{ = \lbracecmd -%\let\} = \rbracecmd -\def\_{{\realbackslash _}}% -\def\w{\realbackslash w }% -\def\bf{\realbackslash bf }% -%\def\rm{\realbackslash rm }% -\def\sl{\realbackslash sl }% -\def\sf{\realbackslash sf}% -\def\tt{\realbackslash tt}% -\def\gtr{\realbackslash gtr}% -\def\less{\realbackslash less}% -\def\hat{\realbackslash hat}% -\def\TeX{\realbackslash TeX}% -\def\dots{\realbackslash dots }% -\def\result{\realbackslash result}% -\def\equiv{\realbackslash equiv}% -\def\expansion{\realbackslash expansion}% -\def\print{\realbackslash print}% -\def\error{\realbackslash error}% -\def\point{\realbackslash point}% -\def\copyright{\realbackslash copyright}% -\def\tclose##1{\realbackslash tclose {##1}}% -\def\code##1{\realbackslash code {##1}}% -\def\dotless##1{\realbackslash dotless {##1}}% -\def\samp##1{\realbackslash samp {##1}}% -\def\,##1{\realbackslash ,{##1}}% -\def\t##1{\realbackslash t {##1}}% -\def\r##1{\realbackslash r {##1}}% -\def\i##1{\realbackslash i {##1}}% -\def\b##1{\realbackslash b {##1}}% -\def\sc##1{\realbackslash sc {##1}}% -\def\cite##1{\realbackslash cite {##1}}% -\def\key##1{\realbackslash key {##1}}% -\def\file##1{\realbackslash file {##1}}% -\def\var##1{\realbackslash var {##1}}% -\def\kbd##1{\realbackslash kbd {##1}}% -\def\dfn##1{\realbackslash dfn {##1}}% -\def\emph##1{\realbackslash emph {##1}}% -% -% Handle some cases of @value -- where the variable name does not -% contain - or _, and the value does not contain any -% (non-fully-expandable) commands. -\let\value = \expandablevalue -% -\unsepspaces -} - -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} - -% \indexnofonts no-ops all font-change commands. -% This is used when outputting the strings to sort the index by. -\def\indexdummyfont#1{#1} -\def\indexdummytex{TeX} -\def\indexdummydots{...} - -\def\indexnofonts{% -% Just ignore accents. -\let\,=\indexdummyfont -\let\"=\indexdummyfont -\let\`=\indexdummyfont -\let\'=\indexdummyfont -\let\^=\indexdummyfont -\let\~=\indexdummyfont -\let\==\indexdummyfont -\let\b=\indexdummyfont -\let\c=\indexdummyfont -\let\d=\indexdummyfont -\let\u=\indexdummyfont -\let\v=\indexdummyfont -\let\H=\indexdummyfont -\let\dotless=\indexdummyfont -% Take care of the plain tex special European modified letters. -\def\oe{oe}% -\def\ae{ae}% -\def\aa{aa}% -\def\OE{OE}% -\def\AE{AE}% -\def\AA{AA}% -\def\o{o}% -\def\O{O}% -\def\l{l}% -\def\L{L}% -\def\ss{ss}% -\let\w=\indexdummyfont -\let\t=\indexdummyfont -\let\r=\indexdummyfont -\let\i=\indexdummyfont -\let\b=\indexdummyfont -\let\emph=\indexdummyfont -\let\strong=\indexdummyfont -\let\cite=\indexdummyfont -\let\sc=\indexdummyfont -%Don't no-op \tt, since it isn't a user-level command -% and is used in the definitions of the active chars like <, >, |... -%\let\tt=\indexdummyfont -\let\tclose=\indexdummyfont -\let\code=\indexdummyfont -\let\file=\indexdummyfont -\let\samp=\indexdummyfont -\let\kbd=\indexdummyfont -\let\key=\indexdummyfont -\let\var=\indexdummyfont -\let\TeX=\indexdummytex -\let\dots=\indexdummydots -\def\@{@}% -} - -% To define \realbackslash, we must make \ not be an escape. -% We must first make another character (@) an escape -% so we do not become unable to do a definition. - -{\catcode`\@=0 \catcode`\\=\other - @gdef@realbackslash{\}} - -\let\indexbackslash=0 %overridden during \printindex. -\let\SETmarginindex=\relax % put index entries in margin (undocumented)? - -% For \ifx comparisons. -\def\emptymacro{\empty} - -% Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} - -% Workhorse for all \fooindexes. -% #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. -% -\def\dosubind#1#2#3{% - % Put the index entry in the margin if desired. - \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% - \fi - {% - \count255=\lastpenalty - {% - \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ - {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. - \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - \def\thirdarg{#3}% - % - % If third arg is present, precede it with space in sort key. - \ifx\thirdarg\emptymacro - \let\subentry = \empty - \else - \def\subentry{ #3}% - \fi - % - % First process the index-string with all font commands turned off - % to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% - % - % Now produce the complete index entry, with both the sort key and the - % original text, including any font commands. - \toks0 = {#2}% - \edef\temp{% - \write\csname#1indfile\endcsname{% - \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - }% - % - % If third (subentry) arg is present, add it to the index string. - \ifx\thirdarg\emptymacro \else - \toks0 = {#3}% - \edef\temp{\temp{\the\toks0}}% - \fi - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - \iflinks - \skip0 = \lastskip \ifdim\lastskip = 0pt \else \vskip-\lastskip \fi - \temp - \ifdim\skip0 = 0pt \else \vskip\skip0 \fi - \fi - }% - }% - \penalty\count255 - }% -} - -% The index entry written in the file actually looks like -% \entry {sortstring}{page}{topic} -% or -% \entry {sortstring}{page}{topic}{subtopic} -% The texindex program reads in these files and writes files -% containing these kinds of lines: -% \initial {c} -% before the first topic whose initial is c -% \entry {topic}{pagelist} -% for a topic that is used without subtopics -% \primary {topic} -% for the beginning of a topic that is used with subtopics -% \secondary {subtopic}{pagelist} -% for each subtopic. - -% Define the user-accessible indexing commands -% @findex, @vindex, @kindex, @cindex. - -\def\findex {\fnindex} -\def\kindex {\kyindex} -\def\cindex {\cpindex} -\def\vindex {\vrindex} -\def\tindex {\tpindex} -\def\pindex {\pgindex} - -\def\cindexsub {\begingroup\obeylines\cindexsub} -{\obeylines % -\gdef\cindexsub "#1" #2^^M{\endgroup % -\dosubind{cp}{#2}{#1}}} - -% Define the macros used in formatting output of the sorted index material. - -% @printindex causes a particular index (the ??s file) to get printed. -% It does not print any chapter heading (usually an @unnumbered). -% -\def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{\begingroup - \dobreak \chapheadingskip{10000}% - % - \indexfonts \rm - \tolerance = 9500 - \indexbreaks - % - % See if the index file exists and is nonempty. - % Change catcode of @ here so that if the index file contains - % \initial {@} - % as its first line, TeX doesn't complain about mismatched braces - % (because it thinks @} is a control sequence). - \catcode`\@ = 11 - \openin 1 \jobname.#1s - \ifeof 1 - % \enddoublecolumns gets confused if there is no text in the index, - % and it loses the chapter title and the aux file entries for the - % index. The easiest way to prevent this problem is to make sure - % there is some text. - (Index is nonexistent) - \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - % false. We have to make TeX try to read something from the file, so - % it can discover if there is anything in it. - \read 1 to \temp - \ifeof 1 - (Index is empty) - \else - % Index files are almost Texinfo source, but we use \ as the escape - % character. It would be better to use @, but that's too big a change - % to make right now. - \def\indexbackslash{\rawbackslashxx}% - \catcode`\\ = 0 - \escapechar = `\\ - \begindoublecolumns - \input \jobname.#1s - \enddoublecolumns - \fi - \fi - \closein 1 -\endgroup} - -% These macros are used by the sorted index file itself. -% Change them to control the appearance of the index. - -% Same as \bigskipamount except no shrink. -% \balancecolumns gets confused if there is any shrink. -\newskip\initialskipamount \initialskipamount 12pt plus4pt - -\def\initial #1{% -{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt -\ifdim\lastskip<\initialskipamount -\removelastskip \penalty-200 \vskip \initialskipamount\fi -\line{\secbf#1\hfill}\kern 2pt\penalty10000}} - -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. -% -\def\entry #1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent=2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% - % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. - % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ #2% The page number ends the paragraph. - \fi% - \par -\endgroup} - -% Like \dotfill except takes at least 1 em. -\def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} - -\def\primary #1{\line{#1\hfil}} - -\newskip\secondaryindent \secondaryindent=0.5cm - -\def\secondary #1#2{ -{\parfillskip=0in \parskip=0in -\hangindent =1in \hangafter=1 -\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par -}} - -% Define two-column mode, which we use to typeset indexes. -% Adapted from the TeXbook, page 416, which is to say, -% the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 - -\newbox\partialpage -\newdimen\doublecolumnhsize - -\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns - % Grab any single-column material above us. - \output = {\global\setbox\partialpage = \vbox{% - % - % Here is a possibility not foreseen in manmac: if we accumulate a - % whole lot of material, we might end up calling this \output - % routine twice in a row (see the doublecol-lose test, which is - % essentially a couple of indexes with @setchapternewpage off). In - % that case, we must prevent the second \partialpage from - % simply overwriting the first, causing us to lose the page. - % This will preserve it until a real output routine can ship it - % out. Generally, \partialpage will be empty when this runs and - % this will be a no-op. - \unvbox\partialpage - % - % Unvbox the main output page. - \unvbox255 - \kern-\topskip \kern\baselineskip - }}% - \eject - % - % Use the double-column output routine for subsequent pages. - \output = {\doublecolumnout}% - % - % Change the page size parameters. We could do this once outside this - % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 - % format, but then we repeat the same computation. Repeating a couple - % of assignments once per index is clearly meaningless for the - % execution time, so we may as well do it in one place. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - % below is chosen so that the gutter has the same value (well, +-<1pt) - % as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - % can restore it in \pagesofar, after \hsize itself has (potentially) - % been clobbered. - % - \doublecolumnhsize = \hsize - \advance\doublecolumnhsize by -.04154\hsize - \divide\doublecolumnhsize by 2 - \hsize = \doublecolumnhsize - % - % Double the \vsize as well. (We don't need a separate register here, - % since nobody clobbers \vsize.) - \vsize = 2\vsize -} -\def\doublecolumnout{% - \splittopskip=\topskip \splitmaxdepth=\maxdepth - % Get the available space for the double columns -- the normal - % (undoubled) page height minus any material left over from the - % previous page. - \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage - % box0 will be the left-hand column, box2 the right. - \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ - \onepageout\pagesofar - \unvbox255 - \penalty\outputpenalty -} -\def\pagesofar{% - % Re-output the contents of the output page -- any previous material, - % followed by the two boxes we just split. - \unvbox\partialpage - \hsize = \doublecolumnhsize - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% -} -\def\enddoublecolumns{% - \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 -} -\def\balancecolumns{% - % 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 - \global\setbox1=\vsplit3 to\dimen@ - \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt - \repeat}% - \setbox0=\vbox to\dimen@{\unvbox1}% - \setbox2=\vbox to\dimen@{\unvbox3}% - \pagesofar -} -\catcode`\@ = \other - - -\message{sectioning,} -% Define chapters, sections, etc. - -\newcount\chapno -\newcount\secno \secno=0 -\newcount\subsecno \subsecno=0 -\newcount\subsubsecno \subsubsecno=0 - -% This counter is funny since it counts through charcodes of letters A, B, ... -\newcount\appendixno \appendixno = `\@ -\def\appendixletter{\char\the\appendixno} - -\newwrite\contentsfile -% This is called from \setfilename. -\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{\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\result{\realbackslash result}% - \def\equiv{\realbackslash equiv}% - \def\expansion{\realbackslash expansion}% - \def\print{\realbackslash print}% - \def\error{\realbackslash error}% - \def\point{\realbackslash point}% - \def\copyright{\realbackslash copyright}% - \def\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 -\newcount\secbase\secbase=0 % @raise/lowersections modify this count - -% @raisesections: treat @section as chapter, @subsection as section, etc. -\def\raisesections{\global\advance\secbase by -1} -\let\up=\raisesections % original BFox name - -% @lowersections: treat @chapter as section, @section as subsection, etc. -\def\lowersections{\global\advance\secbase by 1} -\let\down=\lowersections % original BFox name - -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} - \else - \numberedsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} - \else - \appendixsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} - \else - \unnumberedsubsubseczzz{#2} - \fi -\fi -} - - -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{\seccheck{chapter}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% -\chapmacro {#1}{\the\chapno}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -% We don't substitute the actual chapter name into \thischapter -% because we don't want its macros evaluated now. -\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\donoderef % -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec -}} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{\seccheck{appendix}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 \message{Appendix \appendixletter}% -\chapmacro {#1}{\putwordAppendix{} \appendixletter}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash chapentry{\the\toks0}% - {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\appendixnoderef % -\global\let\section = \appendixsec -\global\let\subsection = \appendixsubsec -\global\let\subsubsection = \appendixsubsubsec -}} - -% @centerchap is like @unnumbered, but the heading is centered. -\outer\def\centerchap{\parsearg\centerchapyyy} -\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} - -\outer\def\top{\parsearg\unnumberedyyy} -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{\seccheck{unnumbered}% -\secno=0 \subsecno=0 \subsubsecno=0 -% -% This used to be simply \message{#1}, but TeX fully expands the -% argument to \message. Therefore, if #1 contained @-commands, TeX -% expanded them. For example, in `@unnumbered The @cite{Book}', TeX -% expanded @cite (which turns out to cause errors because \cite is meant -% to be executed, not expanded). -% -% Anyway, we don't want the fully-expanded definition of @cite to appear -% as a result of the \message, we just want `@cite' itself. We use -% \the to achieve this: TeX expands \the only once, -% simply yielding the contents of the . -\toks0 = {#1}\message{(\the\toks0)}% -% -\unnumbchapmacro {#1}% -\gdef\thischapter{#1}\gdef\thissection{#1}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\unnumbnoderef % -\global\let\section = \unnumberedsec -\global\let\subsection = \unnumberedsubsec -\global\let\subsubsection = \unnumberedsubsubsec -}} - -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{\seccheck{section}% -\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 % -{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{\seccheck{appendixsection}% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash secentry % -{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{\seccheck{subsection}% -\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 % -{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash subsecentry % -{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% -\plainsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash subsubsecentry{\the\toks0} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% -\plainsubsubsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\toks0 = {#1}% -\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% -\escapechar=`\\% -\iflinks \write\contentsfile\temp \fi -\unnumbnoderef % -\penalty 10000 % -}} - -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - -% These macros control what the section commands do, according -% to what kind of chapter we are in (ordinary, appendix, or unnumbered). -% Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec - -% Define @majorheading, @heading and @subheading - -% NOTE on use of \vbox for chapter headings, section headings, and -% such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - - -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% -{\advance\chapheadingskip by 10pt \chapbreak }% -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -% @heading, @subheading, @subsubheading. -\def\heading{\parsearg\plainsecheading} -\def\subheading{\parsearg\plainsubsecheading} -\def\subsubheading{\parsearg\plainsubsubsecheading} - -% These macros generate a chapter, section, etc. heading only -% (including whitespace, linebreaking, etc. around it), -% given all the information in convenient, parsed form. - -%%% Args are the skip and penalty (usually negative) -\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} - -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - -%%% Define plain chapter starts, and page on/off switching for it -% Parameter controlling skip before chapter headings (if needed) - -\newskip\chapheadingskip - -\def\chapbreak{\dobreak \chapheadingskip {-4000}} -\def\chappager{\par\vfill\supereject} -\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} - -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} - -\def\CHAPPAGoff{ -\global\let\contentsalignmacro = \chappager -\global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} - -\def\CHAPPAGon{ -\global\let\contentsalignmacro = \chappager -\global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager -\global\def\HEADINGSon{\HEADINGSsingle}} - -\def\CHAPPAGodd{ -\global\let\contentsalignmacro = \chapoddpage -\global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage -\global\def\HEADINGSon{\HEADINGSdouble}} - -\CHAPPAGon - -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain -\global\let\centerchapmacro=\centerchfplain} - -% Plain chapter opening. -% #1 is the text, #2 the chapter number or empty if unnumbered. -\def\chfplain#1#2{% - \pchapsepmacro - {% - \chapfonts \rm - \def\chapnum{#2}% - \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 \centerparametersmaybe - \unhbox0 #1\par}% - }% - \nobreak\bigskip % no page break after a chapter title - \nobreak -} - -% Plain opening for unnumbered. -\def\unnchfplain#1{\chfplain{#1}{}} - -% @centerchap -- centered and unnumbered. -\let\centerparametersmaybe = \relax -\def\centerchfplain#1{{% - \def\centerparametersmaybe{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt - }% - \chfplain{#1}{}% -}} - -\CHAPFplain % The default - -\def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} - -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} - -\def\centerchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % -} - -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen -\global\let\centerchapmacro=\centerchfopen} - - -% Section titles. -\newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} -\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} -\def\plainsecheading#1{\sectionheading{sec}{}{#1}} - -% Subsection titles. -\newskip \subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} -\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} -\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} - -% Subsubsection titles. -\let\subsubsecheadingskip = \subsecheadingskip -\let\subsubsecheadingbreak = \subsecheadingbreak -\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} -\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} - - -% Print any size section title. -% -% #1 is the section type (sec/subsec/subsubsec), #2 is the section -% number (maybe empty), #3 the text. -\def\sectionheading#1#2#3{% - {% - \expandafter\advance\csname #1headingskip\endcsname by \parskip - \csname #1headingbreak\endcsname - }% - {% - % Switch to the right set of fonts. - \csname #1fonts\endcsname \rm - % - % Only insert the separating space if we have a section number. - \def\secnum{#2}% - \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% - % - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 % zero if no section number - \unhbox0 #3}% - }% - \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak -} - - -\message{toc printing,} -% Finish up the main text and prepare to read what we've written -% to \contentsfile. - -\newskip\contentsrightmargin \contentsrightmargin=1in -\def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund - \contentsalignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. - \fi - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - % We can't do this, because then an actual ^ in a section - % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. -} - - -% Normal (long) toc. -\outer\def\contents{% - \startcontents{\putwordTableofContents}% - \input \jobname.toc - \endgroup - \vfill \eject -} - -% And just the chapters. -\outer\def\summarycontents{% - \startcontents{\putwordShortContents}% - % - \let\chapentry = \shortchapentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc - \endgroup - \vfill \eject -} -\let\shortcontents = \summarycontents - -% These macros generate individual entries in the table of contents. -% The first argument is the chapter or section name. -% The last argument is the page number. -% The arguments in between are the chapter number, section number, ... - -% Chapter-level things, for both the long and short contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} - -% See comments in \dochapentry re vbox and related settings -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% -} - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. -\setbox0 = \hbox{\shortcontrm \putwordAppendix } -\newdimen\shortappendixwidth \shortappendixwidth = \wd0 - -\def\shortchaplabel#1{% - % We typeset #1 in a box of constant width, regardless of the text of - % #1, so the chapter titles will come out aligned. - \setbox0 = \hbox{#1}% - \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi - % - % This space should be plenty, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% -} - -\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} - -% Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} - -% Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} - -% And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - -% This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc - -% Now for the actual typesetting. In all these, #1 is the text and #2 is the -% page number. -% -% If the toc has to be broken over pages, we want it to be at chapters -% if at all possible; hence the \penalty. -\def\dochapentry#1#2{% - \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno{#2}}% - \endgroup - \nobreak\vskip .25\baselineskip plus.1\baselineskip -} - -\def\dosecentry#1#2{\begingroup - \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsecentry#1#2{\begingroup - \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsubsecentry#1#2{\begingroup - \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -\def\tocentry#1#2{\begingroup - \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - % Do not use \turnoffactive in these arguments. Since the toc is - % typeset in cmr, so characters such as _ would come out wrong; we - % have to do the usual translation tricks. - \entry{#1}{#2}% -\endgroup} - -% Space between chapter (or whatever) number and the title. -\def\labelspace{\hskip1em \relax} - -\def\dopageno#1{{\rm #1}} -\def\doshortpageno#1{{\rm #1}} - -\def\chapentryfonts{\secfonts \rm} -\def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts - - -\message{environments,} - -% Since these characters are used in examples, it should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% Furthermore, these definitions must come after we define our fonts. -\newbox\dblarrowbox \newbox\longdblarrowbox -\newbox\pushcharbox \newbox\bullbox -\newbox\equivbox \newbox\errorbox - -%{\tentt -%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} -%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} -%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} -%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} -% Adapted from the manmac format (p.420 of TeXbook) -%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex -% depth .1ex\hfil} -%} - -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -\def\point{$\star$} -\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} -\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - -% Adapted from the TeXbook's \boxit. -{\tentt \global\dimen0 = 3em}% Width of the box. -\dimen2 = .55pt % Thickness of rules -% The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} - -\global\setbox\errorbox=\hbox to \dimen0{\hfil - \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. - \advance\hsize by -2\dimen2 % Rules. - \vbox{ - \hrule height\dimen2 - \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. - \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. - \kern3pt\vrule width\dimen2}% Space to right. - \hrule height\dimen2} - \hfil} - -% The @error{} command. -\def\error{\leavevmode\lower.7ex\copy\errorbox} - -% @tex ... @end tex escapes into raw Tex temporarily. -% One exception: @ is still an escape character, so that @end tex works. -% But \@ or @@ will get a plain tex @ character. - -\def\tex{\begingroup - \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 - \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 - \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie - \catcode `\%=14 - \catcode 43=12 % plus - \catcode`\"=12 - \catcode`\==12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \escapechar=`\\ - % - \let\b=\ptexb - \let\bullet=\ptexbullet - \let\c=\ptexc - \let\,=\ptexcomma - \let\.=\ptexdot - \let\dots=\ptexdots - \let\equiv=\ptexequiv - \let\!=\ptexexclam - \let\i=\ptexi - \let\{=\ptexlbrace - \let\+=\tabalign - \let\}=\ptexrbrace - \let\*=\ptexstar - \let\t=\ptext - % - \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% - \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% - \def\@{@}% -\let\Etex=\endgroup} - -% Define @lisp ... @endlisp. -% @lisp does a \begingroup so it can rebind things, -% including the definition of @endlisp (which normally is erroneous). - -% Amount to narrow the margins by for @lisp. -\newskip\lispnarrowing \lispnarrowing=0.4in - -% This is the definition that ^^M gets inside @lisp, @example, and other -% such environments. \null is better than a space, since it doesn't -% have any width. -\def\lisppar{\null\endgraf} - -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - -% This space is always present above and below environments. -\newskip\envskipamount \envskipamount = 0pt - -% Make spacing and below environment symmetrical. We use \parskip here -% to help in doing that, since in @example-like environments \parskip -% is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip -% -\def\aboveenvbreak{{\advance\envskipamount by \parskip -\endgraf \ifdim\lastskip<\envskipamount -\removelastskip \penalty-50 \vskip\envskipamount \fi}} - -\let\afterenvbreak = \aboveenvbreak - -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. -\let\nonarrowing=\relax - -% @cartouche ... @end cartouche: draw rectangle w/rounded corners around -% environment contents. -\font\circle=lcircle10 -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip -\circthick=\fontdimen8\circle -% -\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth -\def\ctr{{\hskip 6pt\circle\char'010}} -\def\cbl{{\circle\char'012\hskip -6pt}} -\def\cbr{{\hskip 6pt\circle\char'011}} -\def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} -\def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} -% -\newskip\lskip\newskip\rskip - -\long\def\cartouche{% -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip -\def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} - - -% This macro is called at the beginning of all the @example variants, -% inside a group. -\def\nonfillstart{% - \aboveenvbreak - \inENV % This group ends at the end of the body - \hfuzz = 12pt % Don't be fussy - \sepspaces % Make spaces be word-separators rather than space tokens. - \singlespace - \let\par = \lisppar % don't ignore blank lines - \obeylines % each line of input is a line of output - \parskip = 0pt - \parindent = 0pt - \emergencystretch = 0pt % don't try to avoid overfull boxes - % @cartouche defines \nonarrowing to inhibit narrowing - % at next level down. - \ifx\nonarrowing\relax - \advance \leftskip by \lispnarrowing - \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax - \fi -} - -% To ending an @example-like environment, we first end the paragraph -% (via \afterenvbreak's vertical glue), and then the group. That way we -% keep the zero \parskip that the environments set -- \parskip glue -% will be inserted at the beginning of the next paragraph in the -% document, after the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup}% - -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - % Make @kbd do something special, if requested. - \let\kbdfont\kbdexamplefont - \rawbackslash % have \ input char produce \ char from current font - \gobble -} - -% Define the \E... control sequence only if we are inside the -% environment, so the error checking in \end will work. -% -% We must call \lisp last in the definition, since it reads the -% return following the @example (or whatever) command. -% -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} -\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% @smallexample and @smalllisp. This is not used unless the @smallbook -% command is given. Originally contributed by Pavel@xerox. -% -\def\smalllispx{\begingroup - \nonfillstart - \let\Esmalllisp = \nonfillfinish - \let\Esmallexample = \nonfillfinish - % - % Smaller fonts for small examples. - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - \gobble -} - -% This is @display; same as @lisp except use roman font. -% -\def\display{\begingroup - \nonfillstart - \let\Edisplay = \nonfillfinish - \gobble -} - -% This is @format; same as @display except don't narrow margins. -% -\def\format{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eformat = \nonfillfinish - \gobble -} - -% @flushleft (same as @format) and @flushright. -% -\def\flushleft{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushleft = \nonfillfinish - \gobble -} -\def\flushright{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushright = \nonfillfinish - \advance\leftskip by 0pt plus 1fill - \gobble} - -% @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. -% -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body - {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \singlespace - \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% - % - % @cartouche defines \nonarrowing to inhibit narrowing at next level down. - \ifx\nonarrowing\relax - \advance\leftskip by \lispnarrowing - \advance\rightskip by \lispnarrowing - \exdentamount = \lispnarrowing - \let\nonarrowing = \relax - \fi -} - -\message{defuns,} -% Define formatter for defuns -% First, allow user to change definition object font (\df) internally -\def\setdeffont #1 {\csname DEF#1\endcsname} - -\newskip\defbodyindent \defbodyindent=.4in -\newskip\defargsindent \defargsindent=50pt -\newskip\deftypemargin \deftypemargin=12pt -\newskip\deflastargmargin \deflastargmargin=18pt - -\newcount\parencount -% define \functionparens, which makes ( and ) and & do special things. -% \functionparens affects the group it is contained in. -\def\activeparens{% -\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active -\catcode`\[=\active \catcode`\]=\active} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - \global\advance\parencount by 1 -} -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - % also in that case restore the outer-level definition of (. - \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - \global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } -\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\def\ampnr{\&} -\def\lbrb{{\bf\char`\[}} -\def\rbrb{{\bf\char`\]}} - -% First, defname, which formats the header line itself. -% #1 should be the function name. -% #2 should be the type of definition, such as "Function". - -\def\defname #1#2{% -% Get the values of \leftskip and \rightskip as they were -% outside the @def... -\dimen2=\leftskip -\advance\dimen2 by -\defbodyindent -\dimen3=\rightskip -\advance\dimen3 by -\defbodyindent -\noindent % -\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% -\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line -\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 % -% Now output arg 2 ("Function" or some such) -% ending at \deftypemargin from the right margin, -% but stuck inside a box of width 0 so it does not interfere with linebreaking -{% Adjust \hsize to exclude the ambient margins, -% so that \rightline will obey them. -\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 -\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% -% Make all lines underfull and no complaints: -\tolerance=10000 \hbadness=10000 -\advance\leftskip by -\defbodyindent -\exdentamount=\defbodyindent -{\df #1}\enskip % Generate function name -} - -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} - -% @deftypemethod has an extra argument that nothing else does. Sigh. -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by the space, is the class name. -% #5 is the method's return type. -% -\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} - -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% - \parindent=0in - \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines -} - -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{#3{#4}}% -} - -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody -% -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. -% -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{\parsetpheaderline{#3{#4}}}\empty -} - -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does. -% -\def\removeemptybraces\empty#1\relax{#1} - -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. -% -\def\parsetpheaderline#1#2#3{% - #1{\removeemptybraces#2\relax}{#3}% -}% - -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} - -% Split up #2 at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. - -{\obeylines -\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% -\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% -\ifx\relax #3% -#1{#2}{}\else #1{#2}{#3#4}\fi}} - -% So much for the things common to all kinds of definitions. - -% Define @defun. - -% First, define the processing that is wanted for arguments of \defun -% Use this to expand the args and terminate the paragraph they make up - -\def\defunargs #1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -\hyphenchar\tensl=0 -#1% -\hyphenchar\tensl=45 -\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -% Do complete processing of one @defun or @defunx line already parsed. - -% @deffn Command forward-char nchars - -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} - -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defun == @deffn Function - -\def\defun{\defparsebody\Edefun\defunx\defunheader} - -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Function}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefun int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} - -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% -\deftypefunargs {#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} - -% \defheaderxcond#1\relax$$$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} - -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$$$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defmac == @deffn Macro - -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} - -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Macro}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} - -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Special Form}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% This definition is run if you use @defunx -% anywhere other than immediately after a @defun or @defunx. - -\def\deffnx #1 {\errmessage{@deffnx in invalid context}} -\def\defunx #1 {\errmessage{@defunx in invalid context}} -\def\defmacx #1 {\errmessage{@defmacx in invalid context}} -\def\defspecx #1 {\errmessage{@defspecx in invalid context}} -\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypefunx #1 {\errmessage{@deftypeunx in invalid context}} - -% @defmethod, and so on - -% @defop CATEGORY CLASS OPERATION ARG... - -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} - -\def\defopheader #1#2#3{% -\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype{} on #1}% -\defunargs {#3}\endgroup % -} - -% @deftypemethod CLASS RETURN-TYPE METHOD ARG... -% -\def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} -% -% #1 is the class name, #2 the data type, #3 the method name, #4 the args. -\def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup -} - -% @defmethod == @defop Method -% -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup -} - -% @defcv {Class Option} foo-class foo-flag - -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} - -\def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype{} of #1}% -\defvarargs {#3}\endgroup % -} - -% @defivar == @defcv {Instance Variable} - -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} - -\def\defivarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{Instance Variable of #1}% -\defvarargs {#3}\endgroup % -} - -% These definitions are run if you use @defmethodx, etc., -% anywhere other than immediately after a @defmethod, etc. - -\def\defopx #1 {\errmessage{@defopx in invalid context}} -\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} -\def\defcvx #1 {\errmessage{@defcvx in invalid context}} -\def\defivarx #1 {\errmessage{@defivarx in invalid context}} - -% Now @defvar - -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000} - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{Variable}% -\defvarargs {#2}\endgroup % -} - -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{User Option}% -\defvarargs {#2}\endgroup % -} - -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name, perhaps followed by text that -% is actually part of the data type, which should not be put into the index. -\def\deftypevarheader #1#2{% -\dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% -\interlinepenalty=10000 -\endgraf\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{\dovarind#3 \relax% -\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 -\endgroup} - -% This definition is run if you use @defvarx -% anywhere other than immediately after a @defvar or @defvarx. - -\def\defvrx #1 {\errmessage{@defvrx in invalid context}} -\def\defvarx #1 {\errmessage{@defvarx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% This definition is run if you use @deftpx, etc -% anywhere other than immediately after a @deftp, etc. - -\def\deftpx #1 {\errmessage{@deftpx in invalid context}} - - -\message{macros,} -% @macro. - -% To do this right we need a feature of e-TeX, \scantokens, -% which we arrange to emulate with a temporary file in ordinary TeX. -\ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scantokens#1{% -% \toks0={#1}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{#1}%\the\toks0}% - \immediate\closeout\macscribble - \input \jobname.tmp -} -\fi - -\newcount\paramno % Count of parameters -\newtoks\macname % Macro name -\newif\ifrecursive % Is it recursive? - -% Utility: does \let #1 = #2, except with \csnames. -\def\cslet#1#2{% -\expandafter\expandafter -\expandafter\let -\expandafter\expandafter -\csname#1\endcsname -\csname#2\endcsname} - -% Macro bodies are absorbed as an argument in a context where -% all characters are catcode 10, 11 or 12, except \ which is active -% (as in normal texinfo). It is necessary to change the definition of \. - -\def\macrobodyctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\{=12 - \catcode`\}=12 - \catcode`\@=12 - \catcode`\^^M=10 - \usembodybackslash} - -% \mbodybackslash is the definition of \ in @macro bodies. -% It maps \foo\ => \csname macarg.foo\endcsname => #N -% where N is the macro parameter number. -% We define \csname macarg.\endcsname to be \realbackslash, so -% \\ in macro replacement text gets you a backslash. - -{\catcode`@=0 \catcode`\\=\active - @gdef@usembodybackslash{@let\=@mbodybackslash} - @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} -} -\expandafter\def\csname macarg.\endcsname{\realbackslash} - -% The catcode games are necessary because @macro may or may not -% have a brace-surrounded list of arguments, and we need to do -% different stuff in each case. Making {, } \other is the only -% way to prevent their being deleted by the tokenizer. -\def\macro{\recursivefalse - \bgroup\catcode`\{=\other\catcode`\}=\other\parsearg\macroxxx} -\def\rmacro{\recursivetrue - \bgroup\catcode`\{=\other\catcode`\}=\other\parsearg\macroxxx} - -\def\macroxxx#1{\egroup % started in \macro - \getargs{#1}% now \macname is the macname and \toks0 the arglist - \edef\temp{\the\toks0}% - \ifx\temp\empty % no arguments - \paramno=0% - \else - \expandafter\parsemargdef \the\toks0;% - \fi - \expandafter\ifx \csname macsave.\the\macname\endcsname \relax - \cslet{macsave.\the\macname}{\the\macname}% - \else - \message{Warning: redefining \the\macname}% - \fi - \begingroup \macrobodyctxt - \ifrecursive \expandafter\parsermacbody - \else \expandafter\parsemacbody - \fi} - -\def\unmacro{\parsearg\unmacroxxx} -\def\unmacroxxx#1{ - \expandafter\ifx \csname macsave.\the\macname\endcsname \relax - \errmessage{Macro \the\macname\ not defined.}% - \else - \cslet{#1}{macsave.#1}% - \expandafter\let \csname macsave.\the\macname\endcsname \undefined - \fi -} - -% Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.blah for each blah -% in the params list, to be ##N where N is the position in that list. -% That gets used by \mbodybackslash (above). - -% This code has to take great care with `macro parameter char #'. The -% eight hashes in a row on the macarg.#1 line collapse to four in the -% definition of \macarg.blah, to two when \parsemacbody expands the -% macro replacement text, and to one when \defmacro writes the macro -% definiton. The games with \twohash are to postpone expansion till -% the very end, when \parsemargdefyyy crunches \paramlist into -% something that can be splatted into a \expandafter\def\blah line (in -% \defmacro). -\def\parsemargdef#1;{\paramno=0\def\paramlist{}\parsemargdefxxx#1,;,} -\def\parsemargdefxxx#1,{% - \let\twohash\relax - \if#1;\let\next=\parsemargdefyyy - \else \let\next=\parsemargdefxxx - \advance\paramno by 1% - \expandafter\edef\csname macarg.#1\endcsname{########\the\paramno}% - \edef\paramlist{\paramlist\twohash\twohash\the\paramno,}% - \fi\next} -\def\parsemargdefyyy{\let\twohash##\relax \edef\paramlist{\paramlist}} - -% These two commands read recursive and nonrecursive macro bodies. -% (They're different since rec and nonrec macros end differently.) - -\long\def\parsemacbody#1@end macro% -{\xdef\temp{#1} \endgroup\defmacro}% -\long\def\parsermacbody#1@end macro% -{\xdef\temp{#1} \endgroup\defmacro}% - - -% This defines the macro itself. There are six cases: recursive and -% nonrecursive macros of zero, one, and many arguments. -% Much magic with \expandafter here. -\def\defmacro{% - \ifrecursive - \ifcase\paramno - % 0 - \expandafter\edef\csname\the\macname\endcsname{% - \noexpand\scantokens{\temp}}% - \or % 1 - \expandafter\edef\csname\the\macname\endcsname{% - \noexpand\braceorline\csname\the\macname xxx\endcsname}% - \expandafter\edef\csname\the\macname xxx\endcsname##1{% - \noexpand\scantokens{\temp}}% - \else % many - \expandafter\edef\csname\the\macname\endcsname##1{% - \csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\edef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\noexpand\scantokens{\temp}}% - \fi - \else - \ifcase\paramno - % 0 - \expandafter\edef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scantokens{\temp}\egroup}% - \or % 1 - \expandafter\edef\csname\the\macname\endcsname{% - \noexpand\braceorline\csname\the\macname xxx\endcsname}% - \expandafter\edef\csname\the\macname xxx\endcsname##1{% - \noexpand\norecurse{\the\macname} - \noexpand\scantokens{\temp}\egroup}% - \else % many - \expandafter\edef\csname\the\macname\endcsname##1{% - \csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\edef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \noexpand\norecurse{\the\macname} - \noexpand\scantokens{\temp}\egroup}% - \fi - \fi} - -\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} - -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg) -\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} -\def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg - \fi \next} - -% We need {} to be \other inside these commands. [] are temporary -% grouping symbols. -\begingroup -\catcode`\{=\other \catcode`\}=\other -\catcode`\[=1 \catcode`\]=2 - -% @macro can be called with or without a brace-surrounded macro -% argument list. These three sequences extract the macro name and arg -% list in hopefully all cases. Note that anything on the line after the -% first pair of braces will be thrown out (Makeinfo puts it into the -% macro body). -\gdef\getargs#1[\getargsxxx|#1 {}|] -\gdef\getargsxxx|#1 {#2}#3|[% - \toks0=[#2]% - \edef\tmp[\the\toks0]% - \ifx\tmp\empty - \getargsnospaces|#1{}|% - \else - \macname=[#1]% - \fi] -\gdef\getargsnospaces|#1{#2}#3|[\macname=[#1]\toks0=[#2]] - -\endgroup - - -\message{cross references,} -\newwrite\auxfile - -\newif\ifhavexrefs % True if xref values are known. -\newif\ifwarnedxrefs % True if we warned once that they aren't known. - -% @inforef is relatively simple. -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} - -% @setref{foo} defines a cross-reference point named foo. - -\def\setref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ysectionnumberandtype}} - -\def\unnumbsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ynothing}} - -\def\appendixsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Yappendixletterandtype}} - -% \xref, \pxref, and \ref generate cross-references to specified points. -% For \xrefX, #1 is the node name, #2 the name of the Info -% cross-reference, #3 the printed node name, #4 the name of the Info -% file, #5 the name of the printed manual. All but the node name can be -% omitted. -% -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} -\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup - \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax - % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% - \else - % Use the actual chapter/section title appear inside - % the square brackets. Use the real section title if we have it. - \ifdim \wd1>0pt% - % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% - \else - \ifhavexrefs - % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% - \else - % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% - \fi% - \fi - \fi - \fi - % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% - \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\normalturnoffactive \refx{#1-snt}{}}% - \space [\printednodename],\space - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \fi -\endgroup} - -% \dosetq is the interface for calls from other macros - -% Use \normalturnoffactive so that punctuation chars such as underscore -% and backslash work in node names. (\turnoffactive doesn't do \.) -\def\dosetq#1#2{% - {\let\folio=0 - \normalturnoffactive - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks - \next - \fi - }% -} - -% \internalsetq {foo}{page} expands into -% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} -% When the aux file is read, ' is the escape character - -\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq - -\def\Ypagenumber{\folio} - -\def\Ytitle{\thissection} - -\def\Ynothing{} - -\def\Ysectionnumberandtype{% -\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % -\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\def\Yappendixletterandtype{% -\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% -\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\gdef\xreftie{'tie} - -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Non-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi - -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. - -\def\refx#1#2{% - \expandafter\ifx\csname X#1\endcsname\relax - % If not defined, say something at least. - \angleleft un\-de\-fined\angleright - \iflinks - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% - \fi - \fi - \fi - \else - % It's defined, so just use it. - \csname X#1\endcsname - \fi - #2% Output the suffix in any case. -} - -% This is the macro invoked by entries in the aux file. -% -\def\xrdef#1{\begingroup - % Reenable \ as an escape while reading the second argument. - \catcode`\\ = 0 - \afterassignment\endgroup - \expandafter\gdef\csname X#1\endcsname -} - -% Read the last existing aux file, if any. No error if none exists. -\def\readauxfile{\begingroup - \catcode`\^^@=\other - \catcode`\^^A=\other - \catcode`\^^B=\other - \catcode`\^^C=\other - \catcode`\^^D=\other - \catcode`\^^E=\other - \catcode`\^^F=\other - \catcode`\^^G=\other - \catcode`\^^H=\other - \catcode`\^^K=\other - \catcode`\^^L=\other - \catcode`\^^N=\other - \catcode`\^^P=\other - \catcode`\^^Q=\other - \catcode`\^^R=\other - \catcode`\^^S=\other - \catcode`\^^T=\other - \catcode`\^^U=\other - \catcode`\^^V=\other - \catcode`\^^W=\other - \catcode`\^^X=\other - \catcode`\^^Z=\other - \catcode`\^^[=\other - \catcode`\^^\=\other - \catcode`\^^]=\other - \catcode`\^^^=\other - \catcode`\^^_=\other - \catcode`\@=\other - \catcode`\^=\other - % It was suggested to define this as 7, which would allow ^^e4 etc. - % in xref tags, i.e., node names. But since ^^e4 notation isn't - % supported in the main text, it doesn't seem desirable. Furthermore, - % that is not enough: for node names that actually contain a ^ - % character, we would end up writing a line like this: 'xrdef {'hat - % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first - % argument, and \hat is not an expandable control sequence. It could - % all be worked out, but why? Either we support ^^ or we don't. - % - % The other change necessary for this was to define \auxhat: - % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter - % and then to call \auxhat in \setq. - % - \catcode`\~=\other - \catcode`\[=\other - \catcode`\]=\other - \catcode`\"=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\$=\other - \catcode`\#=\other - \catcode`\&=\other - \catcode`+=\other % avoid \+ for paranoia even though we've turned it off - % Make the characters 128-255 be printing characters - {% - \count 1=128 - \def\loop{% - \catcode\count 1=\other - \advance\count 1 by 1 - \ifnum \count 1<256 \loop \fi - }% - }% - % The aux file uses ' as the escape (for now). - % Turn off \ as an escape so we do not lose on - % entries which were dumped with control sequences in their names. - % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ - % Reference to such entries still does not work the way one would wish, - % but at least they do not bomb out when the aux file is read in. - \catcode`\{=1 - \catcode`\}=2 - \catcode`\%=\other - \catcode`\'=0 - \catcode`\\=\other - % - \openin 1 \jobname.aux - \ifeof 1 \else - \closein 1 - \input \jobname.aux - \global\havexrefstrue - \global\warnedobstrue - \fi - % Open the new aux file. TeX will close it automatically at exit. - \openout\auxfile=\jobname.aux -\endgroup} - - -% Footnotes. - -\newcount \footnoteno - -% The trailing space in the following definition for supereject is -% vital for proper filling; pages come out unaligned when you do a -% pagealignmacro call if that space before the closing brace is -% removed. (Generally, numeric constants should always be followed by a -% space to prevent strange expansion errors.) -\def\supereject{\par\penalty -20000\footnoteno =0 } - -% @footnotestyle is meaningful for info output only. -\let\footnotestyle=\comment - -\let\ptexfootnote=\footnote - -{\catcode `\@=11 -% -% Auto-number footnotes. Otherwise like plain. -\gdef\footnote{% - \global\advance\footnoteno by \@ne - \edef\thisfootno{$^{\the\footnoteno}$}% - % - % In case the footnote comes at the end of a sentence, preserve the - % extra spacing after we do the footnote number. - \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi - % - % Remove inadvertent blank space before typesetting the footnote number. - \unskip - \thisfootno\@sf - \footnotezzz -}% - -% Don't bother with the trickery in plain.tex to not require the -% footnote text as a parameter. Our footnotes don't need to be so general. -% -% Oh yes, they do; otherwise, @ifset and anything else that uses -% \parseargline fail inside footnotes because the tokens are fixed when -% the footnote is read. --karl, 16nov96. -% -\long\gdef\footnotezzz{\insert\footins\bgroup - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - % So reset some parameters. - \interlinepenalty\interfootnotelinepenalty - \splittopskip\ht\strutbox % top baseline for broken footnotes - \splitmaxdepth\dp\strutbox - \floatingpenalty\@MM - \leftskip\z@skip - \rightskip\z@skip - \spaceskip\z@skip - \xspaceskip\z@skip - \parindent\defaultparindent - % - % Hang the footnote text off the number. - \hang - \textindent{\thisfootno}% - % - % Don't crash into the line above the footnote text. Since this - % expands into a box, it must come within the paragraph, lest it - % provide a place where TeX can split the footnote. - \footstrut - \futurelet\next\fo@t -} -\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t - \else\let\next\f@t\fi \next} -\def\f@@t{\bgroup\aftergroup\@foot\let\next} -\def\f@t#1{#1\@foot} -\def\@foot{\strut\egroup} - -}%end \catcode `\@=11 - -% Set the baselineskip to #1, and the lineskip and strut size -% correspondingly. There is no deep meaning behind these magic numbers -% used as factors; they just match (closely enough) what Knuth defined. -% -\def\lineskipfactor{.08333} -\def\strutheightpercent{.70833} -\def\strutdepthpercent {.29167} -% -\def\setleading#1{% - \normalbaselineskip = #1\relax - \normallineskip = \lineskipfactor\normalbaselineskip - \normalbaselines - \setbox\strutbox =\hbox{% - \vrule width0pt height\strutheightpercent\baselineskip - depth \strutdepthpercent \baselineskip - }% -} - -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt} - -% @image. We use the macros from epsf.tex to support this. -% If epsf.tex is not installed and @image is used, we complain. -% -% Check for and read epsf.tex up front. If we read it only at @image -% time, we might be inside a group, and then its definitions would get -% undone and the next image would fail. -\openin 1 = epsf.tex -\ifeof 1 \else - \closein 1 - % Do not bother showing banner with post-v2.7 epsf.tex (available in - % doc/epsf.tex until it shows up on ctan). - \def\epsfannounce{\toks0 = }% - \input epsf.tex -\fi -% -\newif\ifwarnednoepsf -\newhelp\noepsfhelp{epsf.tex must be installed for images to - work. It is also included in the Texinfo distribution, or you can get - it from ftp://ftp.tug.org/tex/epsf.tex.} -% -% Only complain once about lack of epsf.tex. -\def\image#1{% - \ifx\epsfbox\undefined - \ifwarnednoepsf \else - \errhelp = \noepsfhelp - \errmessage{epsf.tex not found, images will be ignored}% - \global\warnednoepsftrue - \fi - \else - \imagexxx #1,,,\finish - \fi -} -% -% Arguments to @image: -% #1 is (mandatory) image filename; we tack on .eps extension. -% #2 is (optional) width, #3 is (optional) height. -% #4 is just the usual extra ignored arg for parsing this stuff. -\def\imagexxx#1,#2,#3,#4\finish{% - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - % If the image is by itself, center it. - \ifvmode - \centerline{\epsfbox{#1.eps}}% - \else - \epsfbox{#1.eps}% - \fi -} - - -\message{paper sizes,} -% And other related parameters. - -\newdimen\defaultparindent \defaultparindent = 15pt - -\chapheadingskip = 15pt plus 4pt minus 2pt -\secheadingskip = 12pt plus 3pt minus 2pt -\subsecheadingskip = 9pt plus 2pt minus 2pt - -% Prevent underfull vbox error messages. -\vbadness = 10000 - -% Following George Bush, just get rid of widows and orphans. -\widowpenalty=10000 -\clubpenalty=10000 - -% Use TeX 3.0's \emergencystretch to help line breaking, but if we're -% using an old version of TeX, don't do anything. We want the amount of -% stretch added to depend on the line length, hence the dependence on -% \hsize. This makes it come to about 9pt for the 8.5x11 format. We -% call this whenever the paper size is set. -% -\def\setemergencystretch{% - \ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% - \else - \emergencystretch = \hsize - \divide\emergencystretch by 45 - \fi -} - -% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; -% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can -% set \parskip and call \setleading for \baselineskip. -% -\def\internalpagesizes#1#2#3#4#5#6{% - \voffset = #3\relax - \topskip = #6\relax - \splittopskip = \topskip - % - \vsize = #1\relax - \advance\vsize by \topskip - \outervsize = \vsize - \advance\outervsize by 0.6in - \pageheight = \vsize - % - \hsize = #2\relax - \outerhsize = \hsize - \advance\outerhsize by 0.5in - \pagewidth = \hsize - % - \normaloffset = #4\relax - \bindingoffset = #5\relax - % - \parindent = \defaultparindent - \setemergencystretch -} - -% @letterpaper (the default). -\def\letterpaper{{\globaldefs = 1 - \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% - % - % If page is nothing but text, make it come out even. - \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% -}} - -% Use @smallbook to reset parameters for 7x9.5 (or so) format. -\def\smallbook{{\globaldefs = 1 - \parskip = 2pt plus 1pt - \setleading{12pt}% - % - \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% - % - \lispnarrowing = 0.3in - \tolerance = 700 - \hfuzz = 1pt - \contentsrightmargin = 0pt - \deftypemargin = 0pt - \defbodyindent = .5cm - % - \let\smalllisp = \smalllispx - \let\smallexample = \smalllispx - \def\Esmallexample{\Esmalllisp}% -}} - -% Use @afourpaper to print on European A4 paper. -\def\afourpaper{{\globaldefs = 1 - \setleading{12pt}% - \parskip = 3pt plus 2pt minus 1pt - % - \internalpagesizes{53\baselineskip}{6.5in}{\voffset}{.25in}{\bindingoffset}{44pt}% - % - \tolerance = 700 - \hfuzz = 1pt -}} - -% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin -% 29mm, hence bottom margin 28mm, nominal side margin 3cm. -\def\afourlatex{{\globaldefs = 1 - \setleading{13.6pt}% - % - \afourpaper - \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% - % - \globaldefs = 0 -}} - -% Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{% - \afourpaper - \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% - % - \globaldefs = 0 -} - -% @pagesizes TEXTHEIGHT[,TEXTWIDTH] -% Perhaps we should allow setting the margins, \topskip, \parskip, -% and/or leading, also. Or perhaps we should compute them somehow. -% -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} -\def\pagesizesyyy#1,#2,#3\finish{{% - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi - \globaldefs = 1 - % - \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% - % - \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% -}} - -% Set default to letter. -% -\letterpaper - -\message{and turning on texinfo input format.} - -% Define macros to output various characters with catcode for normal text. -\catcode`\"=\other -\catcode`\~=\other -\catcode`\^=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode`\+=\other -\def\normaldoublequote{"} -\def\normaltilde{~} -\def\normalcaret{^} -\def\normalunderscore{_} -\def\normalverticalbar{|} -\def\normalless{<} -\def\normalgreater{>} -\def\normalplus{+} - -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, -% where something hairier probably needs to be done. -% -% #1 is what to print if we are indeed using \tt; #2 is what to print -% otherwise. Since all the Computer Modern typewriter fonts have zero -% interword stretch (and shrink), and it is reasonable to expect all -% typewriter fonts to have this, we can check that font parameter. -% -\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} - -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). -% Most of these we simply print from the \tt font, but for some, we can -% use math or other variants that look better in normal text. - -\catcode`\"=\active -\def\activedoublequote{{\tt\char34}} -\let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt\char126}} -\chardef\hat=`\^ -\catcode`\^=\active -\def^{{\tt \hat}} - -\catcode`\_=\active -\def_{\ifusingtt\normalunderscore\_} -% Subroutine for the previous macro. -\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} - -\catcode`\|=\active -\def|{{\tt\char124}} -\chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} -\chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -%\catcode 27=\active -%\def^^[{$\diamondsuit$} - -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active - -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - -\catcode`\@=0 - -% \rawbackslashxx output one backslash character in current font -\global\chardef\rawbackslashxx=`\\ -%{\catcode`\\=\other -%@gdef@rawbackslashxx{\}} - -% \rawbackslash redefines \ as input to do \rawbackslashxx. -{\catcode`\\=\active -@gdef@rawbackslash{@let\=@rawbackslashxx }} - -% \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} - -% Say @foo, not \foo, in error messages. -\escapechar=`\@ - -% \catcode 17=0 % Define control-q -\catcode`\\=\active - -% Used sometimes to turn off (effectively) the active characters -% even after parsing them. -@def@turnoffactive{@let"=@normaldoublequote -@let\=@realbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -@def@normalturnoffactive{@let"=@normaldoublequote -@let\=@normalbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive - -% If a .fmt file is being used, we don't want the `\input texinfo' to show up. -% That is what \eatinput is for; after that, the `\' should revert to printing -% a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput - -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\{ in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also back turn on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% -@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi - @catcode`+=@active @catcode`@_=@active} - -% These look ok in all fonts, so just make them not special. The @rm below -% makes sure that the current font starts out as the newly loaded cmr10 -@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other - -@textfonts -@rm - -@c Local variables: -@c page-delimiter: "^\\\\message" -@c End: diff --git a/gnu/dist/gcc/vmsconfig.com b/gnu/dist/gcc/vmsconfig.com deleted file mode 100644 index d98bb1092203..000000000000 --- a/gnu/dist/gcc/vmsconfig.com +++ /dev/null @@ -1,500 +0,0 @@ -$ ! -$ ! Set up to compile GCC on VMS. -$ ! -$ ! Set the def dir to proper place for use in batch. Works for interactive too. -$flnm = f$enviroment("PROCEDURE") ! get current procedure name -$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' -$ ! -$set symbol/scope=(nolocal,noglobal) -$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ ! -$ echo = "write sys$output" -$ ! -$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$ arch = f$element(arch_indx,"|","|vax|alpha|") -$ ! -$ if f$search("config.h") .nes. "" then delete config.h.* -$ if arch .eqs. "vax" -$ then -$ copy [.config.'arch']xm-vms.h []config.h -$ echo "Linked `config.h' to `[.config.''arch']xm-vms.h'." -$else -$ open/write cfile []config.h -$ write cfile "#include "+"""config/"+arch+"/xm-"+arch+".h"+""" -$ write cfile "#include "+"""config/"+arch+"/xm-vms.h"+""" -$ close cfile -$ echo "Created `config.h'." -$ endif -$ ! -$ if f$search("tconfig.h") .nes. "" then delete tconfig.h.* -$ create []tconfig.h -$DECK -/* tconfig.h == config.h :: target and host configurations are the same */ -#include "config.h" -$EOD -$ echo "Created `tconfig.h'. -$ ! -$ if f$search("hconfig.h") .nes. "" then delete hconfig.h.* -$ create []hconfig.h -$DECK -/* hconfig.h == config.h :: host and target configurations are the same */ -#include "config.h" -$EOD -$ echo "Created `hconfig.h'. -$ ! -$ if f$search("tm.h") .nes. "" then delete tm.h.* -$ ! -$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - - [.config.'arch']vms.h /output=[]tm.h -$DECK -! -! Copy file, changing lines of the form -! #include "vax/*" -! or -! #include "alpha/*" -! into -! #include "config-*" -! - file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); - targ := LINE_BEGIN & '#include' & SPAN(ASCII(32)+ASCII(9)) - & '"' & ('vax' | 'alpha') & '/'; - rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); - LOOP - incl := SEARCH_QUIETLY(targ, FORWARD, EXACT, rang); - EXITIF incl = 0; - POSITION(BEGINNING_OF(incl)); - ERASE(incl); - COPY_TEXT('#include "config-'); - rang := CREATE_RANGE(END_OF(incl), END_OF(file)); - ENDLOOP; - WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); - QUIT -$ EOD -$ echo "Generated `tm.h' from `[.config.''arch']vms.h'." -$ ! -$ !crude hack to allow compiling from [.cp] subdirectory -$ if f$search("config-''arch'.h") .nes. "" then delete config-'arch'.h;* -$ copy [.config.'arch']'arch'.h []config-'arch'.h -$ echo "Linked `config-''arch'.h' to `[.config.''arch']''arch'.h' for `tm.h'." -$ ! -$ call make_lang_incl "options.h" -$ ! -$ call make_lang_incl "specs.h" -$ ! -$ if arch .eqs. "vax" -$ then -$ if f$search("''arch'.md") .nes. "" then delete 'arch'.md;* -$ copy [.config.'arch']'arch'.md []'arch'.md -$ echo "Copied `''arch'.md' from `[.config.''arch']''arch'.md'." -$ endif -$ ! -$ if f$search("aux-output.c") .nes. "" then delete aux-output.c.* -$ copy [.config.'arch']'arch'.c []aux-output.c -$ echo "Linked `aux-output.c' to `[.config.''arch']''arch'.c'. -$ ! -$ ! -$ ! -$ ! Create the file version.opt, which helps identify the executable. -$ ! -$search version.c version_string,"="/match=and/output=t.tmp -$open ifile$ t.tmp -$read ifile$ line -$close ifile$ -$delete t.tmp; -$line=f$element(1,"""",line) !extract the portion between 1st & 2nd quotes -$! Format of 'line' is "name-nn.nn.nn[.nn] [date text]" (without the quotes). -$! We want "name-nn.nn.nn[.nn][-date]"; "-date" suffix is optional. -$id = f$element(1,"-",line) !strip "name-" prefix -$if id.eqs."-" then id = line !no prefix found? -$id = f$element(0," ",id) + "-" + f$element(1," ",id) !first two tokens -$id = id - "- " !in case 2nd token was empty -$if f$length(id).gt.15 then id = f$extract(0,15,id) !length limitation -$! -$open/write ifile$ version.opt -$write ifile$ "ident="+""""+id+"""" -$close ifile$ -$purge version.opt -$! -$! -$! create linker options files that lists all of the components for all -$! possible compilers. We do this by editing the file Makefile.in, and -$! generating the relevant files from it. -$! -$! -$! Make a copy of the makefile if the sources are on a disk that is NFS -$! mounted on a unix machine. -$if f$search("Makefile.in").eqs."" .and. f$search("$M$akefile.in").nes."" - - then copy $M$akefile.in Makefile.in -$! This should be automated across all front-end subdirectories. -$! For now, it's hardcoded. -$if f$search("[.cp]Makefile.in").eqs."" .and. f$search("[.cp]$M$akefile.in").nes."" - - then copy [.cp]$M$akefile.in [.cp]Makefile.in -$! -$! -$echo "Now processing Makefile.in to generate linker option files." -$edit/TPU/noJournal/noSection/noDisplay/Command=sys$input: Makefile.in - - /Start_Position=('arch_indx') ! 1 for vax, 2 for alpha -!! -VARIABLE makefile_buf, opt_file_buf, complist_buf, extra_compilers; ! Globals. -VARIABLE arch; ! String 'vax' or 'alpha', set in configure_makefile(). - -!! -PROCEDURE process_makefile( ) - ! - ! Interpret Makefile.in and subsidiary Make-lang.in templates. - ! - LOCAL range1, cmark, makefilename; - - makefilename := GET_INFO (COMMAND_LINE, 'FILE_NAME'); ! "Makefile.in" - makefile_buf := CREATE_BUFFER ("makefile", makefilename); - opt_file_buf := CREATE_BUFFER ("opt_file"); - complist_buf := CREATE_BUFFER ("complist"); - extra_compilers := CREATE_ARRAY; - ! - SET (NO_WRITE, makefile_buf, ON); ! Used as workspace; don't save it. - SET (OUTPUT_FILE, complist_buf, "compilers.list"); - ! - ! Make some textual substitutions. - ! - configure_makefile (); - ! - ! Collect a list of supported compilers (``COMPILERS=xxx'' macro). - ! - identify_compilers (); - ! - ! Plus other known compilers described by Make-lang.in makefile fragments. - ! Add new entries as needed; args are (target name, subdirectory name). - ! - additional_compiler ("cc1plus", "cp"); - ! - WRITE_FILE (complist_buf); ! Now save "compilers.list". - ! - ! Add to this list, as required. The file "Makefile.in" is searched for - ! a tag that looks like "LINE_BEGIN + 'tag + (optional space) + "="". - ! The contents are assumed to be a list of object files, and from this - ! list a VMS linker options file is generated. - ! - generate_option_file ("OBJS", "=", "independent.opt"); - generate_option_file ("LIB2FUNCS", "=", "libgcc2.list"); - generate_option_file ("CXX_LIB2FUNCS", "=", "libgcc2-cxx.list"); - ! - ! Now change OBJS in the Makefile, so each language specific options file - ! does not pick up all of the language independent files. - ! - POSITION (BEGINNING_OF (makefile_buf)); - COPY_TEXT ("OBJS="); ! New copy with empty value, seen before real OBJS. - SPLIT_LINE; - ! - ! Lastly, process each compiler-specific object dependency list. - ! - POSITION (BEGINNING_OF (complist_buf)); - LOOP - cmark := MARK (NONE); - EXITIF (cmark = END_OF (complist_buf)); - ! The current line contains the name of a compiler target, such as "cc1". - MESSAGE (CURRENT_LINE); ! Give some interactive feedback. - generate_option_file (CURRENT_LINE, ":", CURRENT_LINE + "-objs.opt"); - POSITION (cmark); - MOVE_VERTICAL (1); ! Go to the next line. - ENDLOOP; -ENDPROCEDURE; !process_makefile -!! - -PROCEDURE process_objc_lib( ) - ! - ! Interpret objc/Makefile, after finishing the top makefile. - ! - ON_ERROR - [TPU$_OPENIN]: - MESSAGE ("Cannot load objc/Makefile for ""ObjClib""; skipping it."); - RETURN; - ENDON_ERROR; - - ERASE (makefile_buf); !discard top Makefile - POSITION (END_OF (makefile_buf)); - READ_FILE ("[.objc]Make-lang.in"); !load objc one - MESSAGE ("objclib"); - pat_replace (ASCII(9), " "); !change any to - generate_option_file ("OBJC_O", "=", "objc-objs.opt"); - POSITION (BEGINNING_OF (makefile_buf)); - ! Join any continuation lines; we want the header list to be one line. - pat_replace ("\" & LINE_END, ); - generate_option_file ("OBJC_H", "=", "objc-hdrs.list"); -ENDPROCEDURE; !process_objc_lib -!! - -PROCEDURE configure_makefile( ) - ! - ! Plug in some values normally handled by `configure'. Rather than - ! replacing the dummy entries, insert the real entries before them. - ! - IF (GET_INFO (COMMAND_LINE, 'START_RECORD') <> 2) THEN - arch := 'vax'; - ELSE - arch := 'alpha'; - ENDIF; - POSITION (BEGINNING_OF (makefile_buf)); - COPY_TEXT ("target=" + arch + "-vms"); SPLIT_LINE; - COPY_TEXT ("out_file=aux-output.c"); SPLIT_LINE; ! 'arch'/'arch'.c - COPY_TEXT ("out_object_file=aux-output.o"); SPLIT_LINE; ! aux-output.obj - COPY_TEXT ("md_file=" + arch + ".md"); SPLIT_LINE; ! 'arch'/'arch'.md - COPY_TEXT ("tm_file=tm.h"); SPLIT_LINE; ! 'arch'/tm-vms.h - pat_replace ("@" & - SPAN("abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ#~0123456789") - & "@", ); ! strip `configure' dummy values -ENDPROCEDURE; !configure_makefile -!! - -PROCEDURE identify_compilers( ) - ! - ! Retrieve the list of supported compilers from Makefile.in, and put them - ! into file "compilers.list", one per line, for subsequent access from DCL. - ! - LOCAL range1; - - ! Strip most comments from the makefile, to speed up subsequent processing. - POSITION (BEGINNING_OF (makefile_buf)); - pat_replace (LINE_BEGIN & "#" & REMAIN & LINE_END, ); - pat_replace ("$(exeext)", ); - pat_replace ("@all_compilers@", ); -!# ! Convert directory references to VMS syntax (actually, just strip it). -!# pat_replace (" $(srcdir)/", " "); - ! Look up the ``COMPILERS=cc1 xyzzy'' Makefile macro and put - ! its ``cc1 xyzzy'' value into the compilers buffer. - POSITION (BEGINNING_OF (complist_buf)); -!#--at some point we may want to add this-- -!# recursive_fetch_tag ("CCCP", "="); ! Include the preprocessor. -!# POSITION (END_OF (complist_buf)); - recursive_fetch_tag ("COMPILERS", "="); - ! Convert all spaces into newlines, then remove any blank lines. - pat_replace (SPAN(" "), LINE_END); - pat_replace (LINE_BEGIN & LINE_END, ); -ENDPROCEDURE; !identify_compilers -!! - -PROCEDURE additional_compiler( cname, subdir ) - ! - ! Load Make-lang.in for compiler CNAME from SUBDIR and append it to the - ! end of Makefile.in's buffer. Add CNAME to the "compilers.list" buffer. - ! - ON_ERROR - ! Don't abort if user removes the supporting subdirectory for a - ! language she's not interested in. - [TPU$_OPENIN]: - MESSAGE ("Cannot load " + subdir + "/Make-lang.in for " - + '"' + cname + '"' + "; skipping it."); - RETURN; - ENDON_ERROR; - - POSITION (END_OF (makefile_buf)); - SPLIT_LINE; ! Separate with a blank line. - READ_FILE ("[." + subdir + "]Make-lang.in"); ! Load Makefile fragment. - ! Make sure that $(xxx_OTH_SRCS) expands to empty string by renaming $(it) - pat_replace ("_OTH_SRCS)", "_OTH_SRCS_dummy_)"); - ! Convert subdirectory references into VMS syntax. - pat_replace ("$(srcdir)/" + subdir + "/", "[." + subdir + "]"); - - ! Temporary? hack for cp/Make-lang.in's mishandling of "input.c". - IF (subdir = 'cp') THEN - pat_replace ("[.cp]input.c", ); ! Discard this text. - ENDIF; - - ! Add this name to compilers.list. - POSITION (END_OF (complist_buf)); - COPY_TEXT (cname); - ! Make array entry indexed by compiler's file name; its value is arbitrary. - extra_compilers{cname} := subdir; -ENDPROCEDURE; !additional_compiler -!! - -PROCEDURE generate_option_file( tag_name, punct, outfile_name ) - ! - ! Produce a file listing the names of particular object files, for use - ! as input to the linker and also for use in finding source names by - ! make-cc1.com. Generally, any name suffix will be suppressed. - ! - LOCAL range1, range2; - - POSITION (BEGINNING_OF (opt_file_buf)); - recursive_fetch_tag (tag_name, punct); - ! First fix up for subdirectory/Make-lang.in. - IF (pat_replace ("stamp-objlist" & (SPAN(" ")|LINE_END), " ") > 0) THEN - recursive_fetch_tag ("stamp-objlist", ":"); - ENDIF; - ! Now fix up a few things in the output buffer. - pat_replace ("Makefile" & (SPAN(" ")|LINE_END), " "); -!# FILL (CURRENT_BUFFER, " ", 1, 80, 0); ! Condense things a bit. - pat_replace ("." & ("o"|"c"|"y") & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END); - pat_replace ("." & ("o"|"c"|"y") & SPAN(" "), ","); - pat_replace (".h" & (SPAN(" ")|LINE_END), ".h,"); - ! Remove trailing commas, if present. - pat_replace ("," & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END); - ! Get rid of spaces and blank lines. - pat_replace (SPAN(" "), LINE_END); - pat_replace (LINE_BEGIN & LINE_END, ); - ! Second fix up for subdirectory/Make-lang.in; - ! avoid "sticky defaults" when linker processes the resulting options file. - IF (extra_compilers{outfile_name - "-objs.opt"} <> TPU$K_UNSPECIFIED) THEN - POSITION (BEGINNING_OF (opt_file_buf)); - range1 := CREATE_RANGE (MARK (NONE), END_OF (CURRENT_BUFFER), NONE); - LOOP - range2 := SEARCH_QUIETLY (LINE_BEGIN | ",", FORWARD, EXACT, range1); - EXITIF (range2 = 0); - POSITION (BEGINNING_OF (range2)); - IF (CURRENT_CHARACTER = ",") THEN MOVE_HORIZONTAL (1); ENDIF; - ! If it's not already "[.subdir]name", explicitly make it "[]name". - IF (CURRENT_CHARACTER <> "[") THEN COPY_TEXT ("[]"); ENDIF; - MOVE_HORIZONTAL (1); - MODIFY_RANGE (range1, MARK (NONE), END_OF (range1)); - ENDLOOP; - ENDIF; - ! Now write the output file. - SET (OUTPUT_FILE, opt_file_buf, outfile_name); - WRITE_FILE (opt_file_buf); - ERASE (opt_file_buf); ! Clear buffer out for next opt_file pass. -ENDPROCEDURE; !generate_option_file -!! - -PROCEDURE recursive_fetch_tag( tag_n, punct ) - ! - ! Look up TAG_N, copy it to OPT_FILE_BUF, and then translate any $(...) - ! definitions that appear. The translation is put at the current point. - ! - LOCAL mark1, mark2, range1, tag_range, tag_string; - - fetch_tag (tag_n, punct); - ! Substitute any makefile symbols $(...). - POSITION (BEGINNING_OF (CURRENT_BUFFER)); - LOOP - range1 := SEARCH_QUIETLY ("$(" & - SPAN("abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ#~0123456789") - & ")", FORWARD, EXACT); - EXITIF (range1 = 0); - POSITION (BEGINNING_OF (range1)); - MOVE_HORIZONTAL (2); ! Past opening "$(". - mark1 := MARK (NONE); - POSITION (END_OF (range1)); - MOVE_HORIZONTAL (-1); ! In front of closing ")". - mark2 := MARK (NONE); - tag_range := CREATE_RANGE (mark1, mark2, NONE); - POSITION (END_OF (range1)); - tag_string := STR (tag_range); - ERASE (range1); - fetch_tag (tag_string, "="); - POSITION (BEGINNING_OF (CURRENT_BUFFER)); - ENDLOOP; -ENDPROCEDURE; !recursive_fetch_tag -!! - -PROCEDURE fetch_tag( tag_n, punct ) - ! - ! Looks up the translation of a tag, and inserts it at the current location - ! in the buffer. - ! - LOCAL mark0, mark1, mark2, range2; - - mark0 := MARK (NONE); ! Remember where we started; restore before return. - POSITION (BEGINNING_OF (makefile_buf)); - ! The tag definition always starts in the first column, and might have - ! optional space(es) before "=" or ":" punctuation. - range2 := SEARCH_QUIETLY (LINE_BEGIN & tag_n & ((SPAN(" ") & punct) | punct), - FORWARD, EXACT); - IF (range2 = 0) THEN - POSITION (mark0); - RETURN; - ENDIF; - POSITION (END_OF (range2)); - MOVE_HORIZONTAL (1); ! Move beyond "TAG=". - mark1 := MARK (NONE); - POSITION (BEGINNING_OF (range2)); - LOOP - MOVE_VERTICAL (1); - MOVE_HORIZONTAL (-2); - EXITIF (CURRENT_CHARACTER <> "\"); - ERASE_CHARACTER (1); - MOVE_HORIZONTAL (1); - ENDLOOP; - MOVE_HORIZONTAL (1); - mark2 := MARK (NONE); - range2 := CREATE_RANGE (mark1, mark2, NONE); - POSITION (mark0); - IF (LENGTH (range2) <> 0) THEN - COPY_TEXT (range2); - ENDIF; -ENDPROCEDURE; !fetch_tag -!! - -PROCEDURE pat_replace( oldstring, newstring ) - ! - ! Replace all occurrences of a pattern. - ! - LOCAL range1, range2, kill_it, count; - - count := 0; - kill_it := (GET_INFO (newstring, 'TYPE') = UNSPECIFIED); ! Omitted arg. - range1 := CREATE_RANGE (BEGINNING_OF (CURRENT_BUFFER), - END_OF (CURRENT_BUFFER), NONE); - LOOP - range2 := SEARCH_QUIETLY (oldstring, FORWARD, EXACT, range1); - EXITIF (range2 = 0); - count := count + 1; - POSITION (BEGINNING_OF (range2)); - ERASE (range2); - IF (newstring = LINE_END) THEN - SPLIT_LINE; - ELSE IF (NOT kill_it) THEN - COPY_TEXT (newstring); - ENDIF; ENDIF; - MODIFY_RANGE (range1, MARK (NONE), END_OF (range1)); - ENDLOOP; - RETURN count; -ENDPROCEDURE; !pat_replace -!! - -! -! This is the main routine. -! -process_makefile (); -process_objc_lib (); !this uses a different makefile -QUIT; ! All done; don't write any modified buffers. -!! -$ echo "" -$! -$! Remove excessive versions of the option files... -$! -$ purge *.opt,*.list -$! -$! -$! -$ if f$search("config.status") .nes. "" then delete config.status.* -$ create config.status -$ open/append ifile$ config.status -$ write ifile$ "Links are now set up for use with a ''arch' running VMS." -$ close ifile$ -$ type config.status -$ echo "" -$! -$ exit -$ -$! -$! Construct a header file based on subdirectory contents -$! -$make_lang_incl: subroutine -$ if f$search(p1).nes."" then delete 'p1';* -$ create 'p1' !empty file with ordinary text-file attributes -$ open/Append ifile$ 'p1' -$ write ifile$ "/* ''p1' */" -$ hfile = f$search("[]''p1'") -$ topdir = f$parse(hfile,,,"DIRECTORY") - "]" -$lang_incl_loop: -$ hfile = f$search("[.*]lang-''p1'") -$ if hfile.eqs."" then goto lang_incl_done -$ dir = f$parse(hfile,,,"DIRECTORY") - "]" -$! convert absolute path to relative one, yielding "[.subdir]" -$ dir = "[" + f$edit(dir - topdir,"LOWERCASE") + "]" -$ write ifile$ "#include ""''dir'lang-''p1'""" -$ goto lang_incl_loop -$lang_incl_done: -$ close ifile$ -$ echo "Created `''p1''." -$ endsubroutine !make_lang_incl diff --git a/gnu/dist/gdb/mpw-config.in b/gnu/dist/gdb/mpw-config.in deleted file mode 100644 index 47e71868f766..000000000000 --- a/gnu/dist/gdb/mpw-config.in +++ /dev/null @@ -1,82 +0,0 @@ -# Configuration fragment for GDB. - -If "{host_canonical}" =~ /m68k-apple-mpw/ - forward-include "{srcdir}"config:m68k:xm-mpw.h xm.h - Set siow_lib '"{Libraries}"SIOW.o' - -Else If "{host_canonical}" =~ /powerpc-apple-mpw/ - forward-include "{srcdir}"config:powerpc:xm-mpw.h xm.h - Set siow_lib '"{PPCLibraries}"PPCSIOW.o' - -End If - -Set xdepfiles '"{o}"mac-xdep.c.o' - -Set enable_cflags "" - -# Make a copy of this file and give it a different name, so it -# won't be confused with GDB's serial.h. - -Duplicate -y "{CIncludes}"Serial.h MacSerial.h - -Echo "/* dummy */" >termio.h - -If "{target_canonical}" =~ /m68k-apple-macos/ - forward-include "{srcdir}"config:m68k:tm-mac.h tm.h - forward-include "{srcdir}"config:m68k:tm-m68k.h 'm68k/tm-m68k.h' - Set tdepfiles '"{o}"m68k-tdep.c.o' - -Else If "{target_canonical}" =~ /powerpc-apple-macos/ - forward-include "{srcdir}"config:powerpc:tm-macos.h tm.h - forward-include "{srcdir}"config:rs6000:tm-rs6000.h 'rs6000/tm-rs6000.h' - Set tdepfiles '"{o}"rs6000-tdep.c.o "{o}"xcoffread.c.o' - -Else If "{target_canonical}" =~ /i386-unknown-go32/ - forward-include "{srcdir}"config:i386:tm-i386v.h tm.h - Set tdepfiles '"{o}"i386-tdep.c.o' - -Else If "{target_canonical}" =~ /mips-idt-ecoff/ - forward-include "{srcdir}"config:mips:tm-embed.h tm.h - forward-include "{srcdir}"config:mips:tm-bigmips.h 'mips/tm-bigmips.h' - forward-include "{srcdir}"config:mips:tm-mips.h 'mips/tm-mips.h' - Set tdepfiles '"{o}"mips-tdep.c.o "{o}"remote-mips.c.o' - - -Else If "{target_canonical}" =~ /sh-hitachi-hms/ - forward-include "{srcdir}"config:sh:tm-sh.h tm.h - Set tdepfiles '"{o}"sh-tdep.c.o' - -End If - -If "{target_canonical}" =~ /m68k-apple-macos/ - forward-include "{srcdir}"config:m68k:nm-macos.h nm.h - Set natdepfiles '"{o}"mac-nat.c.o' - -Else If "{target_canonical}" =~ /powerpc-apple-macos/ - forward-include "{srcdir}"config:powerpc:nm-macos.h nm.h - Set natdepfiles '"{o}"mac-nat.c.o' - -Else - forward-include "{srcdir}"config:nm-empty.h nm.h - Set natdepfiles ' ' - -End If - -Echo '# From mpw-config.in' > "{o}"mk.tmp -Echo "TDEPFILES = " {tdepfiles} >> "{o}"mk.tmp -Echo "XDEPFILES = " {xdepfiles} >> "{o}"mk.tmp -Echo "NATDEPFILES = " {natdepfiles} >> "{o}"mk.tmp -Echo "XM_ADD_FILES = " >> "{o}"mk.tmp -Echo "TM_ADD_FILES = " >> "{o}"mk.tmp -Echo "NAT_ADD_FILES = " >> "{o}"mk.tmp -Echo "XM_CDEPS = " >> "{o}"mk.tmp -Echo "TM_CDEPS = " >> "{o}"mk.tmp -Echo "NAT_CDEPS = " >> "{o}"mk.tmp -Echo "SIOW_LIB = " {siow_lib} >> "{o}"mk.tmp -Echo "ENABLE_CFLAGS = " {enable_cflags} >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new -Echo '#include "mpw.h"' >> "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h diff --git a/gnu/dist/gdb/mpw-make.sed b/gnu/dist/gdb/mpw-make.sed deleted file mode 100644 index 9cfaaa3aa9f3..000000000000 --- a/gnu/dist/gdb/mpw-make.sed +++ /dev/null @@ -1,167 +0,0 @@ -# Sed commands that finish translating the GDB Unix Makefile to MPW syntax. - -/^host_alias =/s/^/#/ -/^target_alias =/s/^/#/ - -/^host_makefile_frag@$/d -/^target_makefile_frag@$/d - -/@ENABLE_CFLAGS@/s/@ENABLE_CFLAGS@/{ENABLE_CFLAGS}/g -/^ENABLE_CFLAGS=/s/^/#/ - -# Edit all the symbolic definitions pointing to various libraries and such. - -/^INCLUDE_DIR = /s/"{srcdir}":include/"{topsrcdir}"include:/ - -/^MMALLOC_DIR = /s/::mmalloc/mmalloc:/ -/^MMALLOC_SRC = /s/"{srcdir}"/"{topsrcdir}"/ -/^MMALLOC =/s/=.*$/=/ -/#MMALLOC_DISABLE/s/^#// - -/^BFD_DIR = /s/::bfd/bfd:/ -/^BFD = /s/{BFD_DIR}:libbfd/{BFD_DIR}libbfd/ -/^BFD_SRC = /s/"{srcdir}"/"{topsrcdir}"/ - -/^READLINE_DIR = /s/::readline/readline:/ -/^READLINE =/s/=.*$/=/ -/^READLINE_SRC = /s/"{srcdir}"/"{topsrcdir}"/ - -/^INCLUDE_CFLAGS = /s/$/ -i "{topsrcdir}"include:mpw: -i ::extra-include:/ - -/^SER_HARDWIRE =/s/ser-unix/ser-mac/ - -/^TERMCAP =/s/ =.*$/ =/ - -/@DEFS@/s/@DEFS@//g - -/@YACC@/s/@YACC@/byacc/g - -/@ENABLE_OBS@/s/@ENABLE_OBS@//g - -/@ENABLE_CLIBS@/s/@ENABLE_CLIBS@//g - -/@LIBS@/s/@LIBS@//g - -/INCLUDE_DIR/s/"{s}"{INCLUDE_DIR}/{INCLUDE_DIR}/g -/INCLUDE_DIR/s/{INCLUDE_DIR}:/{INCLUDE_DIR}/g -/INCLUDE_DIR/s/"{INCLUDE_DIR}":/"{INCLUDE_DIR}"/g - -/{BFD_DIR}/s/"{BFD_DIR}":/"{BFD_DIR}"/g -/{BFD_DIR}/s/\([ ]\){BFD_DIR}/\1::{BFD_DIR}/g -/{BFD_DIR}/s/\([ ]\)"{BFD_DIR}"/\1::"{BFD_DIR}"/g - -/{BFD_SRC}/s/"{s}"{BFD_SRC}/{BFD_SRC}/g -/{BFD_SRC}/s/{BFD_SRC}:/{BFD_SRC}/g - -/{READLINE_SRC}/s/"{s}"{READLINE_SRC}/{READLINE_SRC}/g - -/^readline_headers =/,/^$/c\ -readline_headers =\ - - -/{MMALLOC_CHECK}/s/{MMALLOC_CHECK}//g - -# This isn't really useful, and seems to cause nonsensical complaints. -/{ALLDEPFILES}/s/{ALLDEPFILES}//g - -/^copying.c \\Option-f /,/^$/d - -# Fix the syntax of bits of C code that go into version.c. -/char /s/'char .Option-x/'char */ - -/version/s/"{s}"version\.c/"{o}"version.c/g -/version/s/^version\.c/"{o}"version.c/ -/config/s/"{s}"config\.h/"{o}"config.h/g -/config/s/^config\.h/"{o}"config.h/ -/xm/s/"{s}"xm\.h/"{o}"xm.h/g -/xm/s/^xm\.h/"{o}"xm.h/ -/tm/s/"{s}"tm\.h/"{o}"tm.h/g -/tm/s/^tm\.h/"{o}"tm.h/ -/nm/s/"{s}"nm\.h/"{o}"nm.h/g -/nm/s/^nm\.h/"{o}"nm.h/ - -/exp.tab.c/s/"{s}"\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/g -/exp.tab.c/s/^\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/ - -/y.tab/s/"{s}"y.tab\.c/"{o}"y.tab.c/g -/y.tab/s/^y.tab\.c/"{o}"y.tab.c/ - -/init/s/"{s}"init\.c-tmp/"{o}"init.c-tmp/g -/init/s/^init\.c-tmp/"{o}"init.c-tmp/ -/init/s/"{s}"init\.c/"{o}"init.c/g -/init/s/^init\.c/"{o}"init.c/ - -/"{o}"version.c \\Option-f Makefile/,/^$/c\ -"{o}"version.c \\Option-f Makefile\ - echo -n 'char *version = "' >"{o}"version.c\ - echo -n "{VERSION}" >>"{o}"version.c\ - echo '";' >>"{o}"version.c\ - echo -n 'char *host_name = "' >>"{o}"version.c\ - echo -n "{host_alias}" >>"{o}"version.c\ - echo '";' >>"{o}"version.c\ - echo -n 'char *target_name = "' >>"{o}"version.c\ - echo -n "{target_alias}" >>"{o}"version.c\ - echo '";' >>"{o}"version.c\ - - -# Open-brace in a command causes much confusion; replace with the -# result from a script. -/initialize_all_files ()/c\ - Echo -n 'void initialize_all_files () ' >> "{o}"init.c-tmp\ - open-brace >> "{o}"init.c-tmp - -# Replace the whole sed bit for init.c; it's simpler that way... -/filename=`echo $i | sed/,/esac/c\ - set filename "`Echo {i} | sed \\Option-d\ - -e '/^Onindy.c.o/d' \\Option-d\ - -e '/^nindy.c.o/d' \\Option-d\ - -e '/ttyflush.c.o/d' \\Option-d\ - -e '/xdr_ld.c.o/d' \\Option-d\ - -e '/xdr_ptrace.c.o/d' \\Option-d\ - -e '/xdr_rdb.c.o/d' \\Option-d\ - -e '/udr.c.o/d' \\Option-d\ - -e '/udip2soc.c.o/d' \\Option-d\ - -e '/udi2go32.c.o/d' \\Option-d\ - -e '/version.c.o/d' \\Option-d\ - -e '/[a-z0-9A-Z_]*-exp.tab.c.o/d' \\Option-d\ - -e 's/\\.c\\.o/.c/' \\Option-d\ - -e 's/^://'`"\ - If "{filename}" != ""\ - sed <"{s}""{filename}" >>"{o}"init.c-tmp -n \\Option-d\ - -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\\([a-z_0-9A-Z]*\\).*/ {extern void \\1 (); \\1 ();}/p'\ - End If - -# Fix the main compile/link command. -/{CC_LD} {INTERNAL_LDFLAGS} -o gdb/,/"{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES}/c\ - {CC_LD} {INTERNAL_LDFLAGS} -o gdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES} {EXTRALIBS}\ - {MAKEPEF} gdb{PROG_EXT} -o gdb {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\ - {REZ} "{s}"mac-gdb.r -o gdb -append -d PROG_NAME='"'gdb'"' -d VERSION_STRING='"'{version}'"'\ - -/^install \\Option-f /,/^$/c\ -install \\Option-f all install-only\ -\ -install-only \\Option-f \ - Duplicate -y gdb "{bindir}"gdb\ - If "`Exists SiowGDB`" != ""\ - Duplicate -y SiowGDB "{bindir}"SiowGDB\ - End If\ - - -# Don't do any recursive subdir stuff. -/ subdir_do/s/{MAKE}/null-command/ - -# Edit out actions that only confuse MPW Make. -/^config.status \\Option-f/,/^$/d -/^Makefile \\Option-f/,/^$/d - -/^"{o}"config.h \\Option-f/s/^/#/ - -# Add an action to build SIOWgdb. -$a\ -SIOWgdb \\Option-f {OBS} {TSOBS} {ADD_DEPS} {CDEPS} "{o}"init.c.o\ - Delete -i -y SIOWgdb\ - {CC_LD} {INTERNAL_LDFLAGS} -t 'APPL' -c 'gdb ' -o SIOWgdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {SIOW_LIB} {LOADLIBES} {EXTRALIBS}\ - {MAKEPEF} SIOWgdb{PROG_EXT} -o SIOWgdb -ft 'APPL' -fc 'gdb ' {MAKEPEF_FLAGS} \ - {REZ} -o SIOWgdb "{RIncludes}"siow.r -append -d __kPrefSize=5000 -d __kMinSize=2000 -d APPNAME='"'SIOWgdb'"' \ - {REZ} "{s}"mac-gdb.r -o SIOWgdb -append -d VERSION_STRING='"'{version}'"'\ - diff --git a/gnu/dist/gprof/alpha.h b/gnu/dist/gprof/alpha.h deleted file mode 100644 index b91324ed8dbc..000000000000 --- a/gnu/dist/gprof/alpha.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)alpha.h 1.4 (Berkeley) 6/1/90 - */ -#ifndef alpha_h -#define alpha_h - -/* - * Offset (in bytes) of the code from the entry address of a routine. - * (see hist_assign_samples for use and explanation.) - */ -#define OFFSET_TO_CODE 0 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) - -/* - * Minimum size of an instruction (in bytes): - */ -#define MIN_INSN_SIZE 4 - -#endif /* alpha_h */ diff --git a/gnu/dist/gprof/configure.bat b/gnu/dist/gprof/configure.bat deleted file mode 100644 index 22ef37eff885..000000000000 --- a/gnu/dist/gprof/configure.bat +++ /dev/null @@ -1,18 +0,0 @@ -@echo off -echo Configuring gprof for go32 -rem This batch file assumes a unix-type "sed" program - -echo # Makefile generated by "configure.bat"> Makefile - -if exist config.sed del config.sed - -echo "/^###$/ i\ ">>config.sed -echo "MY_MACHINE=i386\ ">>config.sed -echo "CC=gcc ">>config.sed - -echo # >> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile -del config.sed -del config2.sed diff --git a/gnu/dist/gprof/dummy.c b/gnu/dist/gprof/dummy.c deleted file mode 100644 index 184cec650520..000000000000 --- a/gnu/dist/gprof/dummy.c +++ /dev/null @@ -1,19 +0,0 @@ -#include "gprof.h" -#include "symtab.h" - - -/* - * dummy.c -- This file should be used for an unsupported processor type. - * It does nothing, but prevents findcall() from being unresolved. - */ - -void -DEFUN (find_call, (parent, p_lowpc, p_highpc), - Sym * parent AND bfd_vma p_lowpc AND bfd_vma p_highpc) -{ - fprintf (stderr, "%s: -c not supported on this machine architecture\n", - whoami); - - /* Don't give the error more than once. */ - ignore_direct_calls = FALSE; -} diff --git a/gnu/dist/gprof/dummy.h b/gnu/dist/gprof/dummy.h deleted file mode 100644 index 4c37c15f072f..000000000000 --- a/gnu/dist/gprof/dummy.h +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)dummy.h 5.1 (Berkeley) 4/18/91 - */ -#ifndef dummy_h -#define dummy_h - -/* - * dummy.h -- This file should be used when a processor is not yet supported. - */ - -/* - * Offset (in bytes) of the code from the entry address of a routine. - * (see hist_assign_samples()) for use and explanation.) - */ -#define OFFSET_TO_CODE 0 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) - -enum opermodes - { - dummy - }; -typedef enum opermodes operandenum; - -#endif /* dummy_h */ diff --git a/gnu/dist/gprof/gprof.info b/gnu/dist/gprof/gprof.info deleted file mode 100644 index 2d6a82ad2dba..000000000000 --- a/gnu/dist/gprof/gprof.info +++ /dev/null @@ -1,62 +0,0 @@ -This is Info file gprof.info, produced by Makeinfo version 1.68 from -the input file gprof.texi. - -START-INFO-DIR-ENTRY -* gprof: (gprof). Profiling your program's execution -END-INFO-DIR-ENTRY - - This file documents the gprof profiler of the GNU system. - - Copyright (C) 1988, 1992, 1997, 1998 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -Indirect: -gprof.info-1: 906 -gprof.info-2: 47222 - -Tag Table: -(Indirect) -Node: Top906 -Node: Introduction1958 -Node: Compiling4287 -Node: Executing6948 -Node: Invoking9312 -Node: Output Options10726 -Node: Analysis Options17037 -Node: Miscellaneous Options20230 -Node: Depricated Options21381 -Node: Symspecs23451 -Node: Output24849 -Node: Flat Profile25874 -Node: Call Graph30802 -Node: Primary34019 -Node: Callers36552 -Node: Subroutines38659 -Node: Cycles40458 -Node: Line-by-line47222 -Node: Annotated Source51020 -Node: Inaccuracy53881 -Node: Sampling Error54135 -Node: Assumptions56700 -Node: How do I?58168 -Node: Incompatibilities59386 -Node: Details60853 -Node: Implementation61202 -Node: File Format67096 -Node: Internals71349 -Node: Debugging79716 - -End Tag Table diff --git a/gnu/dist/gprof/gprof.info-1 b/gnu/dist/gprof/gprof.info-1 deleted file mode 100644 index 1dc4006ff390..000000000000 --- a/gnu/dist/gprof/gprof.info-1 +++ /dev/null @@ -1,1109 +0,0 @@ -This is Info file gprof.info, produced by Makeinfo version 1.68 from -the input file gprof.texi. - -START-INFO-DIR-ENTRY -* gprof: (gprof). Profiling your program's execution -END-INFO-DIR-ENTRY - - This file documents the gprof profiler of the GNU system. - - Copyright (C) 1988, 1992, 1997, 1998 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: gprof.info, Node: Top, Next: Introduction, Up: (dir) - -Profiling a Program: Where Does It Spend Its Time? -************************************************** - - This manual describes the GNU profiler, `gprof', and how you can use -it to determine which parts of a program are taking most of the -execution time. We assume that you know how to write, compile, and -execute programs. GNU `gprof' was written by Jay Fenlason. - - This manual was updated August 1997 by Brent Baccala. - -* Menu: - -* Introduction:: What profiling means, and why it is useful. - -* Compiling:: How to compile your program for profiling. -* Executing:: Executing your program to generate profile data -* Invoking:: How to run `gprof', and its options - -* Output:: Interpreting `gprof''s output - -* Inaccuracy:: Potential problems you should be aware of -* How do I?:: Answers to common questions -* Incompatibilities:: (between GNU `gprof' and Unix `gprof'.) -* Details:: Details of how profiling is done - - -File: gprof.info, Node: Introduction, Next: Compiling, Prev: Top, Up: Top - -Introduction to Profiling -************************* - - Profiling allows you to learn where your program spent its time and -which functions called which other functions while it was executing. -This information can show you which pieces of your program are slower -than you expected, and might be candidates for rewriting to make your -program execute faster. It can also tell you which functions are being -called more or less often than you expected. This may help you spot -bugs that had otherwise been unnoticed. - - Since the profiler uses information collected during the actual -execution of your program, it can be used on programs that are too -large or too complex to analyze by reading the source. However, how -your program is run will affect the information that shows up in the -profile data. If you don't use some feature of your program while it -is being profiled, no profile information will be generated for that -feature. - - Profiling has several steps: - - * You must compile and link your program with profiling enabled. - *Note Compiling::. - - * You must execute your program to generate a profile data file. - *Note Executing::. - - * You must run `gprof' to analyze the profile data. *Note - Invoking::. - - The next three chapters explain these steps in greater detail. - - Several forms of output are available from the analysis. - - The "flat profile" shows how much time your program spent in each -function, and how many times that function was called. If you simply -want to know which functions burn most of the cycles, it is stated -concisely here. *Note Flat Profile::. - - The "call graph" shows, for each function, which functions called -it, which other functions it called, and how many times. There is also -an estimate of how much time was spent in the subroutines of each -function. This can suggest places where you might try to eliminate -function calls that use a lot of time. *Note Call Graph::. - - The "annotated source" listing is a copy of the program's source -code, labeled with the number of times each line of the program was -executed. *Note Annotated Source::. - - To better understand how profiling works, you may wish to read a -description of its implementation. *Note Implementation::. - - -File: gprof.info, Node: Compiling, Next: Executing, Prev: Introduction, Up: Top - -Compiling a Program for Profiling -********************************* - - The first step in generating profile information for your program is -to compile and link it with profiling enabled. - - To compile a source file for profiling, specify the `-pg' option when -you run the compiler. (This is in addition to the options you normally -use.) - - To link the program for profiling, if you use a compiler such as `cc' -to do the linking, simply specify `-pg' in addition to your usual -options. The same option, `-pg', alters either compilation or linking -to do what is necessary for profiling. Here are examples: - - cc -g -c myprog.c utils.c -pg - cc -o myprog myprog.o utils.o -pg - - The `-pg' option also works with a command that both compiles and -links: - - cc -o myprog myprog.c utils.c -g -pg - - If you run the linker `ld' directly instead of through a compiler -such as `cc', you may have to specify a profiling startup file -`gcrt0.o' as the first input file instead of the usual startup file -`crt0.o'. In addition, you would probably want to specify the -profiling C library, `libc_p.a', by writing `-lc_p' instead of the -usual `-lc'. This is not absolutely necessary, but doing this gives -you number-of-calls information for standard library functions such as -`read' and `open'. For example: - - ld -o myprog /lib/gcrt0.o myprog.o utils.o -lc_p - - If you compile only some of the modules of the program with `-pg', -you can still profile the program, but you won't get complete -information about the modules that were compiled without `-pg'. The -only information you get for the functions in those modules is the -total time spent in them; there is no record of how many times they -were called, or from where. This will not affect the flat profile -(except that the `calls' field for the functions will be blank), but -will greatly reduce the usefulness of the call graph. - - If you wish to perform line-by-line profiling, you will also need to -specify the `-g' option, instructing the compiler to insert debugging -symbols into the program that match program addresses to source code -lines. *Note Line-by-line::. - - In addition to the `-pg' and `-g' options, you may also wish to -specify the `-a' option when compiling. This will instrument the -program to perform basic-block counting. As the program runs, it will -count how many times it executed each branch of each `if' statement, -each iteration of each `do' loop, etc. This will enable `gprof' to -construct an annotated source code listing showing how many times each -line of code was executed. - - -File: gprof.info, Node: Executing, Next: Invoking, Prev: Compiling, Up: Top - -Executing the Program -********************* - - Once the program is compiled for profiling, you must run it in order -to generate the information that `gprof' needs. Simply run the program -as usual, using the normal arguments, file names, etc. The program -should run normally, producing the same output as usual. It will, -however, run somewhat slower than normal because of the time spent -collecting and the writing the profile data. - - The way you run the program--the arguments and input that you give -it--may have a dramatic effect on what the profile information shows. -The profile data will describe the parts of the program that were -activated for the particular input you use. For example, if the first -command you give to your program is to quit, the profile data will show -the time used in initialization and in cleanup, but not much else. - - Your program will write the profile data into a file called -`gmon.out' just before exiting. If there is already a file called -`gmon.out', its contents are overwritten. There is currently no way to -tell the program to write the profile data under a different name, but -you can rename the file afterward if you are concerned that it may be -overwritten. - - In order to write the `gmon.out' file properly, your program must -exit normally: by returning from `main' or by calling `exit'. Calling -the low-level function `_exit' does not write the profile data, and -neither does abnormal termination due to an unhandled signal. - - The `gmon.out' file is written in the program's *current working -directory* at the time it exits. This means that if your program calls -`chdir', the `gmon.out' file will be left in the last directory your -program `chdir''d to. If you don't have permission to write in this -directory, the file is not written, and you will get an error message. - - Older versions of the GNU profiling library may also write a file -called `bb.out'. This file, if present, contains an human-readable -listing of the basic-block execution counts. Unfortunately, the -appearance of a human-readable `bb.out' means the basic-block counts -didn't get written into `gmon.out'. The Perl script `bbconv.pl', -included with the `gprof' source distribution, will convert a `bb.out' -file into a format readable by `gprof'. - - -File: gprof.info, Node: Invoking, Next: Output, Prev: Executing, Up: Top - -`gprof' Command Summary -*********************** - - After you have a profile data file `gmon.out', you can run `gprof' -to interpret the information in it. The `gprof' program prints a flat -profile and a call graph on standard output. Typically you would -redirect the output of `gprof' into a file with `>'. - - You run `gprof' like this: - - gprof OPTIONS [EXECUTABLE-FILE [PROFILE-DATA-FILES...]] [> OUTFILE] - -Here square-brackets indicate optional arguments. - - If you omit the executable file name, the file `a.out' is used. If -you give no profile data file name, the file `gmon.out' is used. If -any file is not in the proper format, or if the profile data file does -not appear to belong to the executable file, an error message is -printed. - - You can give more than one profile data file by entering all their -names after the executable file name; then the statistics in all the -data files are summed together. - - The order of these options does not matter. - -* Menu: - -* Output Options:: Controlling `gprof''s output style -* Analysis Options:: Controlling how `gprof' analyses its data -* Miscellaneous Options:: -* Depricated Options:: Options you no longer need to use, but which - have been retained for compatibility -* Symspecs:: Specifying functions to include or exclude - - -File: gprof.info, Node: Output Options, Next: Analysis Options, Up: Invoking - -Output Options -============== - - These options specify which of several output formats `gprof' should -produce. - - Many of these options take an optional "symspec" to specify -functions to be included or excluded. These options can be specified -multiple times, with different symspecs, to include or exclude sets of -symbols. *Note Symspecs::. - - Specifying any of these options overrides the default (`-p -q'), -which prints a flat profile and call graph analysis for all functions. - -`-A[SYMSPEC]' -`--annotated-source[=SYMSPEC]' - The `-A' option causes `gprof' to print annotated source code. If - SYMSPEC is specified, print output only for matching symbols. - *Note Annotated Source::. - -`-b' -`--brief' - If the `-b' option is given, `gprof' doesn't print the verbose - blurbs that try to explain the meaning of all of the fields in the - tables. This is useful if you intend to print out the output, or - are tired of seeing the blurbs. - -`-C[SYMSPEC]' -`--exec-counts[=SYMSPEC]' - The `-C' option causes `gprof' to print a tally of functions and - the number of times each was called. If SYMSPEC is specified, - print tally only for matching symbols. - - If the profile data file contains basic-block count records, - specifing the `-l' option, along with `-C', will cause basic-block - execution counts to be tallied and displayed. - -`-i' -`--file-info' - The `-i' option causes `gprof' to display summary information - about the profile data file(s) and then exit. The number of - histogram, call graph, and basic-block count records is displayed. - -`-I DIRS' -`--directory-path=DIRS' - The `-I' option specifies a list of search directories in which to - find source files. Environment variable GPROF_PATH can also be - used to convery this information. Used mostly for annotated - source output. - -`-J[SYMSPEC]' -`--no-annotated-source[=SYMSPEC]' - The `-J' option causes `gprof' not to print annotated source code. - If SYMSPEC is specified, `gprof' prints annotated source, but - excludes matching symbols. - -`-L' -`--print-path' - Normally, source filenames are printed with the path component - suppressed. The `-L' option causes `gprof' to print the full - pathname of source filenames, which is determined from symbolic - debugging information in the image file and is relative to the - directory in which the compiler was invoked. - -`-p[SYMSPEC]' -`--flat-profile[=SYMSPEC]' - The `-p' option causes `gprof' to print a flat profile. If - SYMSPEC is specified, print flat profile only for matching symbols. - *Note Flat Profile::. - -`-P[SYMSPEC]' -`--no-flat-profile[=SYMSPEC]' - The `-P' option causes `gprof' to suppress printing a flat profile. - If SYMSPEC is specified, `gprof' prints a flat profile, but - excludes matching symbols. - -`-q[SYMSPEC]' -`--graph[=SYMSPEC]' - The `-q' option causes `gprof' to print the call graph analysis. - If SYMSPEC is specified, print call graph only for matching symbols - and their children. *Note Call Graph::. - -`-Q[SYMSPEC]' -`--no-graph[=SYMSPEC]' - The `-Q' option causes `gprof' to suppress printing the call graph. - If SYMSPEC is specified, `gprof' prints a call graph, but excludes - matching symbols. - -`-y' -`--separate-files' - This option affects annotated source output only. Normally, gprof - prints annotated source files to standard-output. If this option - is specified, annotated source for a file named `path/filename' is - generated in the file `filename-ann'. - -`-Z[SYMSPEC]' -`--no-exec-counts[=SYMSPEC]' - The `-Z' option causes `gprof' not to print a tally of functions - and the number of times each was called. If SYMSPEC is specified, - print tally, but exclude matching symbols. - -`--function-ordering' - The `--function-ordering' option causes `gprof' to print a - suggested function ordering for the program based on profiling - data. This option suggests an ordering which may improve paging, - tlb and cache behavior for the program on systems which support - arbitrary ordering of functions in an executable. - - The exact details of how to force the linker to place functions in - a particular order is system dependent and out of the scope of this - manual. - -`--file-ordering MAP_FILE' - The `--file-ordering' option causes `gprof' to print a suggested - .o link line ordering for the program based on profiling data. - This option suggests an ordering which may improve paging, tlb and - cache behavior for the program on systems which do not support - arbitrary ordering of functions in an executable. - - Use of the `-a' argument is highly recommended with this option. - - The MAP_FILE argument is a pathname to a file which provides - function name to object file mappings. The format of the file is - similar to the output of the program `nm'. - - c-parse.o:00000000 T yyparse - c-parse.o:00000004 C yyerrflag - c-lang.o:00000000 T maybe_objc_method_name - c-lang.o:00000000 T print_lang_statistics - c-lang.o:00000000 T recognize_objc_keyword - c-decl.o:00000000 T print_lang_identifier - c-decl.o:00000000 T print_lang_type - ... - - GNU `nm' `--extern-only' `--defined-only' `-v' `--print-file-name' - can be used to create MAP_FILE. - -`-T' -`--traditional' - The `-T' option causes `gprof' to print its output in - "traditional" BSD style. - -`-w WIDTH' -`--width=WIDTH' - Sets width of output lines to WIDTH. Currently only used when - printing the function index at the bottom of the call graph. - -`-x' -`--all-lines' - This option affects annotated source output only. By default, - only the lines at the beginning of a basic-block are annotated. - If this option is specified, every line in a basic-block is - annotated by repeating the annotation for the first line. This - behavior is similar to `tcov''s `-a'. - -`--demangle' -`--no-demangle' - These options control whether C++ symbol names should be demangled - when printing output. The default is to demangle symbols. The - `--no-demangle' option may be used to turn off demangling. - - -File: gprof.info, Node: Analysis Options, Next: Miscellaneous Options, Prev: Output Options, Up: Invoking - -Analysis Options -================ - -`-a' -`--no-static' - The `-a' option causes `gprof' to suppress the printing of - statically declared (private) functions. (These are functions - whose names are not listed as global, and which are not visible - outside the file/function/block where they were defined.) Time - spent in these functions, calls to/from them, etc, will all be - attributed to the function that was loaded directly before it in - the executable file. This option affects both the flat profile - and the call graph. - -`-c' -`--static-call-graph' - The `-c' option causes the call graph of the program to be - augmented by a heuristic which examines the text space of the - object file and identifies function calls in the binary machine - code. Since normal call graph records are only generated when - functions are entered, this option identifies children that could - have been called, but never were. Calls to functions that were - not compiled with profiling enabled are also identified, but only - if symbol table entries are present for them. Calls to dynamic - library routines are typically *not* found by this option. - Parents or children identified via this heuristic are indicated in - the call graph with call counts of `0'. - -`-D' -`--ignore-non-functions' - The `-D' option causes `gprof' to ignore symbols which are not - known to be functions. This option will give more accurate - profile data on systems where it is supported (Solaris and HPUX for - example). - -`-k FROM/TO' - The `-k' option allows you to delete from the call graph any arcs - from symbols matching symspec FROM to those matching symspec TO. - -`-l' -`--line' - The `-l' option enables line-by-line profiling, which causes - histogram hits to be charged to individual source code lines, - instead of functions. If the program was compiled with - basic-block counting enabled, this option will also identify how - many times each line of code was executed. While line-by-line - profiling can help isolate where in a large function a program is - spending its time, it also significantly increases the running - time of `gprof', and magnifies statistical inaccuracies. *Note - Sampling Error::. - -`-m NUM' -`--min-count=NUM' - This option affects execution count output only. Symbols that are - executed less than NUM times are suppressed. - -`-n[SYMSPEC]' -`--time[=SYMSPEC]' - The `-n' option causes `gprof', in its call graph analysis, to - only propagate times for symbols matching SYMSPEC. - -`-N[SYMSPEC]' -`--no-time[=SYMSPEC]' - The `-n' option causes `gprof', in its call graph analysis, not to - propagate times for symbols matching SYMSPEC. - -`-z' -`--display-unused-functions' - If you give the `-z' option, `gprof' will mention all functions in - the flat profile, even those that were never called, and that had - no time spent in them. This is useful in conjunction with the - `-c' option for discovering which routines were never called. - - -File: gprof.info, Node: Miscellaneous Options, Next: Depricated Options, Prev: Analysis Options, Up: Invoking - -Miscellaneous Options -===================== - -`-d[NUM]' -`--debug[=NUM]' - The `-d NUM' option specifies debugging options. If NUM is not - specified, enable all debugging. *Note Debugging::. - -`-ONAME' -`--file-format=NAME' - Selects the format of the profile data files. Recognized formats - are `auto' (the default), `bsd', `magic', and `prof' (not yet - supported). - -`-s' -`--sum' - The `-s' option causes `gprof' to summarize the information in the - profile data files it read in, and write out a profile data file - called `gmon.sum', which contains all the information from the - profile data files that `gprof' read in. The file `gmon.sum' may - be one of the specified input files; the effect of this is to - merge the data in the other input files into `gmon.sum'. - - Eventually you can run `gprof' again without `-s' to analyze the - cumulative data in the file `gmon.sum'. - -`-v' -`--version' - The `-v' flag causes `gprof' to print the current version number, - and then exit. - - -File: gprof.info, Node: Depricated Options, Next: Symspecs, Prev: Miscellaneous Options, Up: Invoking - -Depricated Options -================== - - These options have been replaced with newer versions that use - symspecs. - -`-e FUNCTION_NAME' - The `-e FUNCTION' option tells `gprof' to not print information - about the function FUNCTION_NAME (and its children...) in the call - graph. The function will still be listed as a child of any - functions that call it, but its index number will be shown as - `[not printed]'. More than one `-e' option may be given; only one - FUNCTION_NAME may be indicated with each `-e' option. - -`-E FUNCTION_NAME' - The `-E FUNCTION' option works like the `-e' option, but time - spent in the function (and children who were not called from - anywhere else), will not be used to compute the - percentages-of-time for the call graph. More than one `-E' option - may be given; only one FUNCTION_NAME may be indicated with each - `-E' option. - -`-f FUNCTION_NAME' - The `-f FUNCTION' option causes `gprof' to limit the call graph to - the function FUNCTION_NAME and its children (and their - children...). More than one `-f' option may be given; only one - FUNCTION_NAME may be indicated with each `-f' option. - -`-F FUNCTION_NAME' - The `-F FUNCTION' option works like the `-f' option, but only time - spent in the function and its children (and their children...) - will be used to determine total-time and percentages-of-time for - the call graph. More than one `-F' option may be given; only one - FUNCTION_NAME may be indicated with each `-F' option. The `-F' - option overrides the `-E' option. - - Note that only one function can be specified with each `-e', `-E', -`-f' or `-F' option. To specify more than one function, use multiple -options. For example, this command: - - gprof -e boring -f foo -f bar myprogram > gprof.output - -lists in the call graph all functions that were reached from either -`foo' or `bar' and were not reachable from `boring'. - - -File: gprof.info, Node: Symspecs, Prev: Depricated Options, Up: Invoking - -Symspecs -======== - - Many of the output options allow functions to be included or excluded -using "symspecs" (symbol specifications), which observe the following -syntax: - - filename_containing_a_dot - | funcname_not_containing_a_dot - | linenumber - | ( [ any_filename ] `:' ( any_funcname | linenumber ) ) - - Here are some sample symspecs: - -`main.c' - Selects everything in file "main.c"--the dot in the string tells - gprof to interpret the string as a filename, rather than as a - function name. To select a file whose name does not contain a - dot, a trailing colon should be specified. For example, "odd:" is - interpreted as the file named "odd". - -`main' - Selects all functions named "main". Notice that there may be - multiple instances of the same function name because some of the - definitions may be local (i.e., static). Unless a function name - is unique in a program, you must use the colon notation explained - below to specify a function from a specific source file. - Sometimes, function names contain dots. In such cases, it is - necessar to add a leading colon to the name. For example, ":.mul" - selects function ".mul". - -`main.c:main' - Selects function "main" in file "main.c". - -`main.c:134' - Selects line 134 in file "main.c". - - -File: gprof.info, Node: Output, Next: Inaccuracy, Prev: Invoking, Up: Top - -Interpreting `gprof''s Output -***************************** - - `gprof' can produce several different output styles, the most -important of which are described below. The simplest output styles -(file information, execution count, and function and file ordering) are -not described here, but are documented with the respective options that -trigger them. *Note Output Options::. - -* Menu: - -* Flat Profile:: The flat profile shows how much time was spent - executing directly in each function. -* Call Graph:: The call graph shows which functions called which - others, and how much time each function used - when its subroutine calls are included. -* Line-by-line:: `gprof' can analyze individual source code lines -* Annotated Source:: The annotated source listing displays source code - labeled with execution counts - - -File: gprof.info, Node: Flat Profile, Next: Call Graph, Up: Output - -The Flat Profile -================ - - The "flat profile" shows the total amount of time your program spent -executing each function. Unless the `-z' option is given, functions -with no apparent time spent in them, and no apparent calls to them, are -not mentioned. Note that if a function was not compiled for profiling, -and didn't run long enough to show up on the program counter histogram, -it will be indistinguishable from a function that was never called. - - This is part of a flat profile for a small program: - - Flat profile: - - Each sample counts as 0.01 seconds. - % cumulative self self total - time seconds seconds calls ms/call ms/call name - 33.34 0.02 0.02 7208 0.00 0.00 open - 16.67 0.03 0.01 244 0.04 0.12 offtime - 16.67 0.04 0.01 8 1.25 1.25 memccpy - 16.67 0.05 0.01 7 1.43 1.43 write - 16.67 0.06 0.01 mcount - 0.00 0.06 0.00 236 0.00 0.00 tzset - 0.00 0.06 0.00 192 0.00 0.00 tolower - 0.00 0.06 0.00 47 0.00 0.00 strlen - 0.00 0.06 0.00 45 0.00 0.00 strchr - 0.00 0.06 0.00 1 0.00 50.00 main - 0.00 0.06 0.00 1 0.00 0.00 memcpy - 0.00 0.06 0.00 1 0.00 10.11 print - 0.00 0.06 0.00 1 0.00 0.00 profil - 0.00 0.06 0.00 1 0.00 50.00 report - ... - -The functions are sorted by first by decreasing run-time spent in them, -then by decreasing number of calls, then alphabetically by name. The -functions `mcount' and `profil' are part of the profiling aparatus and -appear in every flat profile; their time gives a measure of the amount -of overhead due to profiling. - - Just before the column headers, a statement appears indicating how -much time each sample counted as. This "sampling period" estimates the -margin of error in each of the time figures. A time figure that is not -much larger than this is not reliable. In this example, each sample -counted as 0.01 seconds, suggesting a 100 Hz sampling rate. The -program's total execution time was 0.06 seconds, as indicated by the -`cumulative seconds' field. Since each sample counted for 0.01 -seconds, this means only six samples were taken during the run. Two of -the samples occured while the program was in the `open' function, as -indicated by the `self seconds' field. Each of the other four samples -occured one each in `offtime', `memccpy', `write', and `mcount'. Since -only six samples were taken, none of these values can be regarded as -particularly reliable. In another run, the `self seconds' field for -`mcount' might well be `0.00' or `0.02'. *Note Sampling Error::, for a -complete discussion. - - The remaining functions in the listing (those whose `self seconds' -field is `0.00') didn't appear in the histogram samples at all. -However, the call graph indicated that they were called, so therefore -they are listed, sorted in decreasing order by the `calls' field. -Clearly some time was spent executing these functions, but the paucity -of histogram samples prevents any determination of how much time each -took. - - Here is what the fields in each line mean: - -`% time' - This is the percentage of the total execution time your program - spent in this function. These should all add up to 100%. - -`cumulative seconds' - This is the cumulative total number of seconds the computer spent - executing this functions, plus the time spent in all the functions - above this one in this table. - -`self seconds' - This is the number of seconds accounted for by this function alone. - The flat profile listing is sorted first by this number. - -`calls' - This is the total number of times the function was called. If the - function was never called, or the number of times it was called - cannot be determined (probably because the function was not - compiled with profiling enabled), the "calls" field is blank. - -`self ms/call' - This represents the average number of milliseconds spent in this - function per call, if this function is profiled. Otherwise, this - field is blank for this function. - -`total ms/call' - This represents the average number of milliseconds spent in this - function and its descendants per call, if this function is - profiled. Otherwise, this field is blank for this function. This - is the only field in the flat profile that uses call graph - analysis. - -`name' - This is the name of the function. The flat profile is sorted by - this field alphabetically after the "self seconds" and "calls" - fields are sorted. - - -File: gprof.info, Node: Call Graph, Next: Line-by-line, Prev: Flat Profile, Up: Output - -The Call Graph -============== - - The "call graph" shows how much time was spent in each function and -its children. From this information, you can find functions that, -while they themselves may not have used much time, called other -functions that did use unusual amounts of time. - - Here is a sample call from a small program. This call came from the -same `gprof' run as the flat profile example in the previous chapter. - - granularity: each sample hit covers 2 byte(s) for 20.00% of 0.05 seconds - - index % time self children called name - - [1] 100.0 0.00 0.05 start [1] - 0.00 0.05 1/1 main [2] - 0.00 0.00 1/2 on_exit [28] - 0.00 0.00 1/1 exit [59] - ----------------------------------------------- - 0.00 0.05 1/1 start [1] - [2] 100.0 0.00 0.05 1 main [2] - 0.00 0.05 1/1 report [3] - ----------------------------------------------- - 0.00 0.05 1/1 main [2] - [3] 100.0 0.00 0.05 1 report [3] - 0.00 0.03 8/8 timelocal [6] - 0.00 0.01 1/1 print [9] - 0.00 0.01 9/9 fgets [12] - 0.00 0.00 12/34 strncmp [40] - 0.00 0.00 8/8 lookup [20] - 0.00 0.00 1/1 fopen [21] - 0.00 0.00 8/8 chewtime [24] - 0.00 0.00 8/16 skipspace [44] - ----------------------------------------------- - [4] 59.8 0.01 0.02 8+472 [4] - 0.01 0.02 244+260 offtime [7] - 0.00 0.00 236+1 tzset [26] - ----------------------------------------------- - - The lines full of dashes divide this table into "entries", one for -each function. Each entry has one or more lines. - - In each entry, the primary line is the one that starts with an index -number in square brackets. The end of this line says which function -the entry is for. The preceding lines in the entry describe the -callers of this function and the following lines describe its -subroutines (also called "children" when we speak of the call graph). - - The entries are sorted by time spent in the function and its -subroutines. - - The internal profiling function `mcount' (*note Flat Profile::.) is -never mentioned in the call graph. - -* Menu: - -* Primary:: Details of the primary line's contents. -* Callers:: Details of caller-lines' contents. -* Subroutines:: Details of subroutine-lines' contents. -* Cycles:: When there are cycles of recursion, - such as `a' calls `b' calls `a'... - - -File: gprof.info, Node: Primary, Next: Callers, Up: Call Graph - -The Primary Line ----------------- - - The "primary line" in a call graph entry is the line that describes -the function which the entry is about and gives the overall statistics -for this function. - - For reference, we repeat the primary line from the entry for function -`report' in our main example, together with the heading line that shows -the names of the fields: - - index % time self children called name - ... - [3] 100.0 0.00 0.05 1 report [3] - - Here is what the fields in the primary line mean: - -`index' - Entries are numbered with consecutive integers. Each function - therefore has an index number, which appears at the beginning of - its primary line. - - Each cross-reference to a function, as a caller or subroutine of - another, gives its index number as well as its name. The index - number guides you if you wish to look for the entry for that - function. - -`% time' - This is the percentage of the total time that was spent in this - function, including time spent in subroutines called from this - function. - - The time spent in this function is counted again for the callers of - this function. Therefore, adding up these percentages is - meaningless. - -`self' - This is the total amount of time spent in this function. This - should be identical to the number printed in the `seconds' field - for this function in the flat profile. - -`children' - This is the total amount of time spent in the subroutine calls - made by this function. This should be equal to the sum of all the - `self' and `children' entries of the children listed directly - below this function. - -`called' - This is the number of times the function was called. - - If the function called itself recursively, there are two numbers, - separated by a `+'. The first number counts non-recursive calls, - and the second counts recursive calls. - - In the example above, the function `report' was called once from - `main'. - -`name' - This is the name of the current function. The index number is - repeated after it. - - If the function is part of a cycle of recursion, the cycle number - is printed between the function's name and the index number (*note - Cycles::.). For example, if function `gnurr' is part of cycle - number one, and has index number twelve, its primary line would be - end like this: - - gnurr [12] - - -File: gprof.info, Node: Callers, Next: Subroutines, Prev: Primary, Up: Call Graph - -Lines for a Function's Callers ------------------------------- - - A function's entry has a line for each function it was called by. -These lines' fields correspond to the fields of the primary line, but -their meanings are different because of the difference in context. - - For reference, we repeat two lines from the entry for the function -`report', the primary line and one caller-line preceding it, together -with the heading line that shows the names of the fields: - - index % time self children called name - ... - 0.00 0.05 1/1 main [2] - [3] 100.0 0.00 0.05 1 report [3] - - Here are the meanings of the fields in the caller-line for `report' -called from `main': - -`self' - An estimate of the amount of time spent in `report' itself when it - was called from `main'. - -`children' - An estimate of the amount of time spent in subroutines of `report' - when `report' was called from `main'. - - The sum of the `self' and `children' fields is an estimate of the - amount of time spent within calls to `report' from `main'. - -`called' - Two numbers: the number of times `report' was called from `main', - followed by the total number of nonrecursive calls to `report' from - all its callers. - -`name and index number' - The name of the caller of `report' to which this line applies, - followed by the caller's index number. - - Not all functions have entries in the call graph; some options to - `gprof' request the omission of certain functions. When a caller - has no entry of its own, it still has caller-lines in the entries - of the functions it calls. - - If the caller is part of a recursion cycle, the cycle number is - printed between the name and the index number. - - If the identity of the callers of a function cannot be determined, a -dummy caller-line is printed which has `' as the "caller's -name" and all other fields blank. This can happen for signal handlers. - - -File: gprof.info, Node: Subroutines, Next: Cycles, Prev: Callers, Up: Call Graph - -Lines for a Function's Subroutines ----------------------------------- - - A function's entry has a line for each of its subroutines--in other -words, a line for each other function that it called. These lines' -fields correspond to the fields of the primary line, but their meanings -are different because of the difference in context. - - For reference, we repeat two lines from the entry for the function -`main', the primary line and a line for a subroutine, together with the -heading line that shows the names of the fields: - - index % time self children called name - ... - [2] 100.0 0.00 0.05 1 main [2] - 0.00 0.05 1/1 report [3] - - Here are the meanings of the fields in the subroutine-line for `main' -calling `report': - -`self' - An estimate of the amount of time spent directly within `report' - when `report' was called from `main'. - -`children' - An estimate of the amount of time spent in subroutines of `report' - when `report' was called from `main'. - - The sum of the `self' and `children' fields is an estimate of the - total time spent in calls to `report' from `main'. - -`called' - Two numbers, the number of calls to `report' from `main' followed - by the total number of nonrecursive calls to `report'. This ratio - is used to determine how much of `report''s `self' and `children' - time gets credited to `main'. *Note Assumptions::. - -`name' - The name of the subroutine of `main' to which this line applies, - followed by the subroutine's index number. - - If the caller is part of a recursion cycle, the cycle number is - printed between the name and the index number. - - -File: gprof.info, Node: Cycles, Prev: Subroutines, Up: Call Graph - -How Mutually Recursive Functions Are Described ----------------------------------------------- - - The graph may be complicated by the presence of "cycles of -recursion" in the call graph. A cycle exists if a function calls -another function that (directly or indirectly) calls (or appears to -call) the original function. For example: if `a' calls `b', and `b' -calls `a', then `a' and `b' form a cycle. - - Whenever there are call paths both ways between a pair of functions, -they belong to the same cycle. If `a' and `b' call each other and `b' -and `c' call each other, all three make one cycle. Note that even if -`b' only calls `a' if it was not called from `a', `gprof' cannot -determine this, so `a' and `b' are still considered a cycle. - - The cycles are numbered with consecutive integers. When a function -belongs to a cycle, each time the function name appears in the call -graph it is followed by `'. - - The reason cycles matter is that they make the time values in the -call graph paradoxical. The "time spent in children" of `a' should -include the time spent in its subroutine `b' and in `b''s -subroutines--but one of `b''s subroutines is `a'! How much of `a''s -time should be included in the children of `a', when `a' is indirectly -recursive? - - The way `gprof' resolves this paradox is by creating a single entry -for the cycle as a whole. The primary line of this entry describes the -total time spent directly in the functions of the cycle. The -"subroutines" of the cycle are the individual functions of the cycle, -and all other functions that were called directly by them. The -"callers" of the cycle are the functions, outside the cycle, that -called functions in the cycle. - - Here is an example portion of a call graph which shows a cycle -containing functions `a' and `b'. The cycle was entered by a call to -`a' from `main'; both `a' and `b' called `c'. - - index % time self children called name - ---------------------------------------- - 1.77 0 1/1 main [2] - [3] 91.71 1.77 0 1+5 [3] - 1.02 0 3 b [4] - 0.75 0 2 a [5] - ---------------------------------------- - 3 a [5] - [4] 52.85 1.02 0 0 b [4] - 2 a [5] - 0 0 3/6 c [6] - ---------------------------------------- - 1.77 0 1/1 main [2] - 2 b [4] - [5] 38.86 0.75 0 1 a [5] - 3 b [4] - 0 0 3/6 c [6] - ---------------------------------------- - -(The entire call graph for this program contains in addition an entry -for `main', which calls `a', and an entry for `c', with callers `a' and -`b'.) - - index % time self children called name - - [1] 100.00 0 1.93 0 start [1] - 0.16 1.77 1/1 main [2] - ---------------------------------------- - 0.16 1.77 1/1 start [1] - [2] 100.00 0.16 1.77 1 main [2] - 1.77 0 1/1 a [5] - ---------------------------------------- - 1.77 0 1/1 main [2] - [3] 91.71 1.77 0 1+5 [3] - 1.02 0 3 b [4] - 0.75 0 2 a [5] - 0 0 6/6 c [6] - ---------------------------------------- - 3 a [5] - [4] 52.85 1.02 0 0 b [4] - 2 a [5] - 0 0 3/6 c [6] - ---------------------------------------- - 1.77 0 1/1 main [2] - 2 b [4] - [5] 38.86 0.75 0 1 a [5] - 3 b [4] - 0 0 3/6 c [6] - ---------------------------------------- - 0 0 3/6 b [4] - 0 0 3/6 a [5] - [6] 0.00 0 0 6 c [6] - ---------------------------------------- - - The `self' field of the cycle's primary line is the total time spent -in all the functions of the cycle. It equals the sum of the `self' -fields for the individual functions in the cycle, found in the entry in -the subroutine lines for these functions. - - The `children' fields of the cycle's primary line and subroutine -lines count only subroutines outside the cycle. Even though `a' calls -`b', the time spent in those calls to `b' is not counted in `a''s -`children' time. Thus, we do not encounter the problem of what to do -when the time in those calls to `b' includes indirect recursive calls -back to `a'. - - The `children' field of a caller-line in the cycle's entry estimates -the amount of time spent *in the whole cycle*, and its other -subroutines, on the times when that caller called a function in the -cycle. - - The `calls' field in the primary line for the cycle has two numbers: -first, the number of times functions in the cycle were called by -functions outside the cycle; second, the number of times they were -called by functions in the cycle (including times when a function in -the cycle calls itself). This is a generalization of the usual split -into nonrecursive and recursive calls. - - The `calls' field of a subroutine-line for a cycle member in the -cycle's entry says how many time that function was called from -functions in the cycle. The total of all these is the second number in -the primary line's `calls' field. - - In the individual entry for a function in a cycle, the other -functions in the same cycle can appear as subroutines and as callers. -These lines show how many times each function in the cycle called or -was called from each other function in the cycle. The `self' and -`children' fields in these lines are blank because of the difficulty of -defining meanings for them when recursion is going on. - diff --git a/gnu/dist/gprof/gprof.info-2 b/gnu/dist/gprof/gprof.info-2 deleted file mode 100644 index 0e319ec81652..000000000000 --- a/gnu/dist/gprof/gprof.info-2 +++ /dev/null @@ -1,761 +0,0 @@ -This is Info file gprof.info, produced by Makeinfo version 1.68 from -the input file gprof.texi. - -START-INFO-DIR-ENTRY -* gprof: (gprof). Profiling your program's execution -END-INFO-DIR-ENTRY - - This file documents the gprof profiler of the GNU system. - - Copyright (C) 1988, 1992, 1997, 1998 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: gprof.info, Node: Line-by-line, Next: Annotated Source, Prev: Call Graph, Up: Output - -Line-by-line Profiling -====================== - - `gprof''s `-l' option causes the program to perform "line-by-line" -profiling. In this mode, histogram samples are assigned not to -functions, but to individual lines of source code. The program usually -must be compiled with a `-g' option, in addition to `-pg', in order to -generate debugging symbols for tracking source code lines. - - The flat profile is the most useful output table in line-by-line -mode. The call graph isn't as useful as normal, since the current -version of `gprof' does not propagate call graph arcs from source code -lines to the enclosing function. The call graph does, however, show -each line of code that called each function, along with a count. - - Here is a section of `gprof''s output, without line-by-line -profiling. Note that `ct_init' accounted for four histogram hits, and -13327 calls to `init_block'. - - Flat profile: - - Each sample counts as 0.01 seconds. - % cumulative self self total - time seconds seconds calls us/call us/call name - 30.77 0.13 0.04 6335 6.31 6.31 ct_init - - - Call graph (explanation follows) - - - granularity: each sample hit covers 4 byte(s) for 7.69% of 0.13 seconds - - index % time self children called name - - 0.00 0.00 1/13496 name_too_long - 0.00 0.00 40/13496 deflate - 0.00 0.00 128/13496 deflate_fast - 0.00 0.00 13327/13496 ct_init - [7] 0.0 0.00 0.00 13496 init_block - - Now let's look at some of `gprof''s output from the same program run, -this time with line-by-line profiling enabled. Note that `ct_init''s -four histogram hits are broken down into four lines of source code - -one hit occured on each of lines 349, 351, 382 and 385. In the call -graph, note how `ct_init''s 13327 calls to `init_block' are broken down -into one call from line 396, 3071 calls from line 384, 3730 calls from -line 385, and 6525 calls from 387. - - Flat profile: - - Each sample counts as 0.01 seconds. - % cumulative self - time seconds seconds calls name - 7.69 0.10 0.01 ct_init (trees.c:349) - 7.69 0.11 0.01 ct_init (trees.c:351) - 7.69 0.12 0.01 ct_init (trees.c:382) - 7.69 0.13 0.01 ct_init (trees.c:385) - - - Call graph (explanation follows) - - - granularity: each sample hit covers 4 byte(s) for 7.69% of 0.13 seconds - - % time self children called name - - 0.00 0.00 1/13496 name_too_long (gzip.c:1440) - 0.00 0.00 1/13496 deflate (deflate.c:763) - 0.00 0.00 1/13496 ct_init (trees.c:396) - 0.00 0.00 2/13496 deflate (deflate.c:727) - 0.00 0.00 4/13496 deflate (deflate.c:686) - 0.00 0.00 5/13496 deflate (deflate.c:675) - 0.00 0.00 12/13496 deflate (deflate.c:679) - 0.00 0.00 16/13496 deflate (deflate.c:730) - 0.00 0.00 128/13496 deflate_fast (deflate.c:654) - 0.00 0.00 3071/13496 ct_init (trees.c:384) - 0.00 0.00 3730/13496 ct_init (trees.c:385) - 0.00 0.00 6525/13496 ct_init (trees.c:387) - [6] 0.0 0.00 0.00 13496 init_block (trees.c:408) - - -File: gprof.info, Node: Annotated Source, Prev: Line-by-line, Up: Output - -The Annotated Source Listing -============================ - - `gprof''s `-A' option triggers an annotated source listing, which -lists the program's source code, each function labeled with the number -of times it was called. You may also need to specify the `-I' option, -if `gprof' can't find the source code files. - - Compiling with `gcc ... -g -pg -a' augments your program with -basic-block counting code, in addition to function counting code. This -enables `gprof' to determine how many times each line of code was -exeucted. For example, consider the following function, taken from -gzip, with line numbers added: - - 1 ulg updcrc(s, n) - 2 uch *s; - 3 unsigned n; - 4 { - 5 register ulg c; - 6 - 7 static ulg crc = (ulg)0xffffffffL; - 8 - 9 if (s == NULL) { - 10 c = 0xffffffffL; - 11 } else { - 12 c = crc; - 13 if (n) do { - 14 c = crc_32_tab[...]; - 15 } while (--n); - 16 } - 17 crc = c; - 18 return c ^ 0xffffffffL; - 19 } - - `updcrc' has at least five basic-blocks. One is the function -itself. The `if' statement on line 9 generates two more basic-blocks, -one for each branch of the `if'. A fourth basic-block results from the -`if' on line 13, and the contents of the `do' loop form the fifth -basic-block. The compiler may also generate additional basic-blocks to -handle various special cases. - - A program augmented for basic-block counting can be analyzed with -`gprof -l -A'. I also suggest use of the `-x' option, which ensures -that each line of code is labeled at least once. Here is `updcrc''s -annotated source listing for a sample `gzip' run: - - ulg updcrc(s, n) - uch *s; - unsigned n; - 2 ->{ - register ulg c; - - static ulg crc = (ulg)0xffffffffL; - - 2 -> if (s == NULL) { - 1 -> c = 0xffffffffL; - 1 -> } else { - 1 -> c = crc; - 1 -> if (n) do { - 26312 -> c = crc_32_tab[...]; - 26312,1,26311 -> } while (--n); - } - 2 -> crc = c; - 2 -> return c ^ 0xffffffffL; - 2 ->} - - In this example, the function was called twice, passing once through -each branch of the `if' statement. The body of the `do' loop was -executed a total of 26312 times. Note how the `while' statement is -annotated. It began execution 26312 times, once for each iteration -through the loop. One of those times (the last time) it exited, while -it branched back to the beginning of the loop 26311 times. - - -File: gprof.info, Node: Inaccuracy, Next: How do I?, Prev: Output, Up: Top - -Inaccuracy of `gprof' Output -**************************** - -* Menu: - -* Sampling Error:: Statistical margins of error -* Assumptions:: Estimating children times - - -File: gprof.info, Node: Sampling Error, Next: Assumptions, Up: Inaccuracy - -Statistical Sampling Error -========================== - - The run-time figures that `gprof' gives you are based on a sampling -process, so they are subject to statistical inaccuracy. If a function -runs only a small amount of time, so that on the average the sampling -process ought to catch that function in the act only once, there is a -pretty good chance it will actually find that function zero times, or -twice. - - By contrast, the number-of-calls and basic-block figures are derived -by counting, not sampling. They are completely accurate and will not -vary from run to run if your program is deterministic. - - The "sampling period" that is printed at the beginning of the flat -profile says how often samples are taken. The rule of thumb is that a -run-time figure is accurate if it is considerably bigger than the -sampling period. - - The actual amount of error can be predicted. For N samples, the -*expected* error is the square-root of N. For example, if the sampling -period is 0.01 seconds and `foo''s run-time is 1 second, N is 100 -samples (1 second/0.01 seconds), sqrt(N) is 10 samples, so the expected -error in `foo''s run-time is 0.1 seconds (10*0.01 seconds), or ten -percent of the observed value. Again, if the sampling period is 0.01 -seconds and `bar''s run-time is 100 seconds, N is 10000 samples, -sqrt(N) is 100 samples, so the expected error in `bar''s run-time is 1 -second, or one percent of the observed value. It is likely to vary -this much *on the average* from one profiling run to the next. -(*Sometimes* it will vary more.) - - This does not mean that a small run-time figure is devoid of -information. If the program's *total* run-time is large, a small -run-time for one function does tell you that that function used an -insignificant fraction of the whole program's time. Usually this means -it is not worth optimizing. - - One way to get more accuracy is to give your program more (but -similar) input data so it will take longer. Another way is to combine -the data from several runs, using the `-s' option of `gprof'. Here is -how: - - 1. Run your program once. - - 2. Issue the command `mv gmon.out gmon.sum'. - - 3. Run your program again, the same as before. - - 4. Merge the new data in `gmon.out' into `gmon.sum' with this command: - - gprof -s EXECUTABLE-FILE gmon.out gmon.sum - - 5. Repeat the last two steps as often as you wish. - - 6. Analyze the cumulative data using this command: - - gprof EXECUTABLE-FILE gmon.sum > OUTPUT-FILE - - -File: gprof.info, Node: Assumptions, Prev: Sampling Error, Up: Inaccuracy - -Estimating `children' Times -=========================== - - Some of the figures in the call graph are estimates--for example, the -`children' time values and all the the time figures in caller and -subroutine lines. - - There is no direct information about these measurements in the -profile data itself. Instead, `gprof' estimates them by making an -assumption about your program that might or might not be true. - - The assumption made is that the average time spent in each call to -any function `foo' is not correlated with who called `foo'. If `foo' -used 5 seconds in all, and 2/5 of the calls to `foo' came from `a', -then `foo' contributes 2 seconds to `a''s `children' time, by -assumption. - - This assumption is usually true enough, but for some programs it is -far from true. Suppose that `foo' returns very quickly when its -argument is zero; suppose that `a' always passes zero as an argument, -while other callers of `foo' pass other arguments. In this program, -all the time spent in `foo' is in the calls from callers other than `a'. -But `gprof' has no way of knowing this; it will blindly and incorrectly -charge 2 seconds of time in `foo' to the children of `a'. - - We hope some day to put more complete data into `gmon.out', so that -this assumption is no longer needed, if we can figure out how. For the -nonce, the estimated figures are usually more useful than misleading. - - -File: gprof.info, Node: How do I?, Next: Incompatibilities, Prev: Inaccuracy, Up: Top - -Answers to Common Questions -*************************** - -How do I find which lines in my program were executed the most times? - Compile your program with basic-block counting enabled, run it, - then use the following pipeline: - - gprof -l -C OBJFILE | sort -k 3 -n -r - - This listing will show you the lines in your code executed most - often, but not necessarily those that consumed the most time. - -How do I find which lines in my program called a particular function? - Use `gprof -l' and lookup the function in the call graph. The - callers will be broken down by function and line number. - -How do I analyze a program that runs for less than a second? - Try using a shell script like this one: - - for i in `seq 1 100`; do - fastprog - mv gmon.out gmon.out.$i - done - - gprof -s fastprog gmon.out.* - - gprof fastprog gmon.sum - - If your program is completely deterministic, all the call counts - will be simple multiples of 100 (i.e. a function called once in - each run will appear with a call count of 100). - - -File: gprof.info, Node: Incompatibilities, Next: Details, Prev: How do I?, Up: Top - -Incompatibilities with Unix `gprof' -*********************************** - - GNU `gprof' and Berkeley Unix `gprof' use the same data file -`gmon.out', and provide essentially the same information. But there -are a few differences. - - * GNU `gprof' uses a new, generalized file format with support for - basic-block execution counts and non-realtime histograms. A magic - cookie and version number allows `gprof' to easily identify new - style files. Old BSD-style files can still be read. *Note File - Format::. - - * For a recursive function, Unix `gprof' lists the function as a - parent and as a child, with a `calls' field that lists the number - of recursive calls. GNU `gprof' omits these lines and puts the - number of recursive calls in the primary line. - - * When a function is suppressed from the call graph with `-e', GNU - `gprof' still lists it as a subroutine of functions that call it. - - * GNU `gprof' accepts the `-k' with its argument in the form - `from/to', instead of `from to'. - - * In the annotated source listing, if there are multiple basic - blocks on the same line, GNU `gprof' prints all of their counts, - seperated by commas. - - * The blurbs, field widths, and output formats are different. GNU - `gprof' prints blurbs after the tables, so that you can see the - tables without skipping the blurbs. - - -File: gprof.info, Node: Details, Prev: Incompatibilities, Up: Top - -Details of Profiling -******************** - -* Menu: - -* Implementation:: How a program collets profiling information -* File Format:: Format of `gmon.out' files -* Internals:: `gprof''s internal operation -* Debugging:: Using `gprof''s `-d' option - - -File: gprof.info, Node: Implementation, Next: File Format, Up: Details - -Implementation of Profiling -=========================== - - Profiling works by changing how every function in your program is -compiled so that when it is called, it will stash away some information -about where it was called from. From this, the profiler can figure out -what function called it, and can count how many times it was called. -This change is made by the compiler when your program is compiled with -the `-pg' option, which causes every function to call `mcount' (or -`_mcount', or `__mcount', depending on the OS and compiler) as one of -its first operations. - - The `mcount' routine, included in the profiling library, is -responsible for recording in an in-memory call graph table both its -parent routine (the child) and its parent's parent. This is typically -done by examining the stack frame to find both the address of the -child, and the return address in the original parent. Since this is a -very machine-dependant operation, `mcount' itself is typically a short -assembly-language stub routine that extracts the required information, -and then calls `__mcount_internal' (a normal C function) with two -arguments - `frompc' and `selfpc'. `__mcount_internal' is responsible -for maintaining the in-memory call graph, which records `frompc', -`selfpc', and the number of times each of these call arcs was -transversed. - - GCC Version 2 provides a magical function -(`__builtin_return_address'), which allows a generic `mcount' function -to extract the required information from the stack frame. However, on -some architectures, most notably the SPARC, using this builtin can be -very computationally expensive, and an assembly language version of -`mcount' is used for performance reasons. - - Number-of-calls information for library routines is collected by -using a special version of the C library. The programs in it are the -same as in the usual C library, but they were compiled with `-pg'. If -you link your program with `gcc ... -pg', it automatically uses the -profiling version of the library. - - Profiling also involves watching your program as it runs, and -keeping a histogram of where the program counter happens to be every -now and then. Typically the program counter is looked at around 100 -times per second of run time, but the exact frequency may vary from -system to system. - - This is done is one of two ways. Most UNIX-like operating systems -provide a `profil()' system call, which registers a memory array with -the kernel, along with a scale factor that determines how the program's -address space maps into the array. Typical scaling values cause every -2 to 8 bytes of address space to map into a single array slot. On -every tick of the system clock (assuming the profiled program is -running), the value of the program counter is examined and the -corresponding slot in the memory array is incremented. Since this is -done in the kernel, which had to interrupt the process anyway to handle -the clock interrupt, very little additional system overhead is required. - - However, some operating systems, most notably Linux 2.0 (and -earlier), do not provide a `profil()' system call. On such a system, -arrangements are made for the kernel to periodically deliver a signal -to the process (typically via `setitimer()'), which then performs the -same operation of examining the program counter and incrementing a slot -in the memory array. Since this method requires a signal to be -delivered to user space every time a sample is taken, it uses -considerably more overhead than kernel-based profiling. Also, due to -the added delay required to deliver the signal, this method is less -accurate as well. - - A special startup routine allocates memory for the histogram and -either calls `profil()' or sets up a clock signal handler. This -routine (`monstartup') can be invoked in several ways. On Linux -systems, a special profiling startup file `gcrt0.o', which invokes -`monstartup' before `main', is used instead of the default `crt0.o'. -Use of this special startup file is one of the effects of using `gcc -... -pg' to link. On SPARC systems, no special startup files are used. -Rather, the `mcount' routine, when it is invoked for the first time -(typically when `main' is called), calls `monstartup'. - - If the compiler's `-a' option was used, basic-block counting is also -enabled. Each object file is then compiled with a static array of -counts, initially zero. In the executable code, every time a new -basic-block begins (i.e. when an `if' statement appears), an extra -instruction is inserted to increment the corresponding count in the -array. At compile time, a paired array was constructed that recorded -the starting address of each basic-block. Taken together, the two -arrays record the starting address of every basic-block, along with the -number of times it was executed. - - The profiling library also includes a function (`mcleanup') which is -typically registered using `atexit()' to be called as the program -exits, and is responsible for writing the file `gmon.out'. Profiling -is turned off, various headers are output, and the histogram is -written, followed by the call-graph arcs and the basic-block counts. - - The output from `gprof' gives no indication of parts of your program -that are limited by I/O or swapping bandwidth. This is because samples -of the program counter are taken at fixed intervals of the program's -run time. Therefore, the time measurements in `gprof' output say -nothing about time that your program was not running. For example, a -part of the program that creates so much data that it cannot all fit in -physical memory at once may run very slowly due to thrashing, but -`gprof' will say it uses little time. On the other hand, sampling by -run time has the advantage that the amount of load due to other users -won't directly affect the output you get. - - -File: gprof.info, Node: File Format, Next: Internals, Prev: Implementation, Up: Details - -Profiling Data File Format -========================== - - The old BSD-derived file format used for profile data does not -contain a magic cookie that allows to check whether a data file really -is a gprof file. Furthermore, it does not provide a version number, -thus rendering changes to the file format almost impossible. GNU -`gprof' uses a new file format that provides these features. For -backward compatibility, GNU `gprof' continues to support the old -BSD-derived format, but not all features are supported with it. For -example, basic-block execution counts cannot be accommodated by the old -file format. - - The new file format is defined in header file `gmon_out.h'. It -consists of a header containing the magic cookie and a version number, -as well as some spare bytes available for future extensions. All data -in a profile data file is in the native format of the host on which the -profile was collected. GNU `gprof' adapts automatically to the -byte-order in use. - - In the new file format, the header is followed by a sequence of -records. Currently, there are three different record types: histogram -records, call-graph arc records, and basic-block execution count -records. Each file can contain any number of each record type. When -reading a file, GNU `gprof' will ensure records of the same type are -compatible with each other and compute the union of all records. For -example, for basic-block execution counts, the union is simply the sum -of all execution counts for each basic-block. - -Histogram Records ------------------ - - Histogram records consist of a header that is followed by an array of -bins. The header contains the text-segment range that the histogram -spans, the size of the histogram in bytes (unlike in the old BSD -format, this does not include the size of the header), the rate of the -profiling clock, and the physical dimension that the bin counts -represent after being scaled by the profiling clock rate. The physical -dimension is specified in two parts: a long name of up to 15 characters -and a single character abbreviation. For example, a histogram -representing real-time would specify the long name as "seconds" and the -abbreviation as "s". This feature is useful for architectures that -support performance monitor hardware (which, fortunately, is becoming -increasingly common). For example, under DEC OSF/1, the "uprofile" -command can be used to produce a histogram of, say, instruction cache -misses. In this case, the dimension in the histogram header could be -set to "i-cache misses" and the abbreviation could be set to "1" -(because it is simply a count, not a physical dimension). Also, the -profiling rate would have to be set to 1 in this case. - - Histogram bins are 16-bit numbers and each bin represent an equal -amount of text-space. For example, if the text-segment is one thousand -bytes long and if there are ten bins in the histogram, each bin -represents one hundred bytes. - -Call-Graph Records ------------------- - - Call-graph records have a format that is identical to the one used in -the BSD-derived file format. It consists of an arc in the call graph -and a count indicating the number of times the arc was traversed during -program execution. Arcs are specified by a pair of addresses: the -first must be within caller's function and the second must be within -the callee's function. When performing profiling at the function -level, these addresses can point anywhere within the respective -function. However, when profiling at the line-level, it is better if -the addresses are as close to the call-site/entry-point as possible. -This will ensure that the line-level call-graph is able to identify -exactly which line of source code performed calls to a function. - -Basic-Block Execution Count Records ------------------------------------ - - Basic-block execution count records consist of a header followed by a -sequence of address/count pairs. The header simply specifies the -length of the sequence. In an address/count pair, the address -identifies a basic-block and the count specifies the number of times -that basic-block was executed. Any address within the basic-address can -be used. - - -File: gprof.info, Node: Internals, Next: Debugging, Prev: File Format, Up: Details - -`gprof''s Internal Operation -============================ - - Like most programs, `gprof' begins by processing its options. -During this stage, it may building its symspec list -(`sym_ids.c:sym_id_add'), if options are specified which use symspecs. -`gprof' maintains a single linked list of symspecs, which will -eventually get turned into 12 symbol tables, organized into six -include/exclude pairs - one pair each for the flat profile -(INCL_FLAT/EXCL_FLAT), the call graph arcs (INCL_ARCS/EXCL_ARCS), -printing in the call graph (INCL_GRAPH/EXCL_GRAPH), timing propagation -in the call graph (INCL_TIME/EXCL_TIME), the annotated source listing -(INCL_ANNO/EXCL_ANNO), and the execution count listing -(INCL_EXEC/EXCL_EXEC). - - After option processing, `gprof' finishes building the symspec list -by adding all the symspecs in `default_excluded_list' to the exclude -lists EXCL_TIME and EXCL_GRAPH, and if line-by-line profiling is -specified, EXCL_FLAT as well. These default excludes are not added to -EXCL_ANNO, EXCL_ARCS, and EXCL_EXEC. - - Next, the BFD library is called to open the object file, verify that -it is an object file, and read its symbol table (`core.c:core_init'), -using `bfd_canonicalize_symtab' after mallocing an appropiate sized -array of asymbols. At this point, function mappings are read (if the -`--file-ordering' option has been specified), and the core text space -is read into memory (if the `-c' option was given). - - `gprof''s own symbol table, an array of Sym structures, is now built. -This is done in one of two ways, by one of two routines, depending on -whether line-by-line profiling (`-l' option) has been enabled. For -normal profiling, the BFD canonical symbol table is scanned. For -line-by-line profiling, every text space address is examined, and a new -symbol table entry gets created every time the line number changes. In -either case, two passes are made through the symbol table - one to -count the size of the symbol table required, and the other to actually -read the symbols. In between the two passes, a single array of type -`Sym' is created of the appropiate length. Finally, -`symtab.c:symtab_finalize' is called to sort the symbol table and -remove duplicate entries (entries with the same memory address). - - The symbol table must be a contiguous array for two reasons. First, -the `qsort' library function (which sorts an array) will be used to -sort the symbol table. Also, the symbol lookup routine -(`symtab.c:sym_lookup'), which finds symbols based on memory address, -uses a binary search algorithm which requires the symbol table to be a -sorted array. Function symbols are indicated with an `is_func' flag. -Line number symbols have no special flags set. Additionally, a symbol -can have an `is_static' flag to indicate that it is a local symbol. - - With the symbol table read, the symspecs can now be translated into -Syms (`sym_ids.c:sym_id_parse'). Remember that a single symspec can -match multiple symbols. An array of symbol tables (`syms') is created, -each entry of which is a symbol table of Syms to be included or -excluded from a particular listing. The master symbol table and the -symspecs are examined by nested loops, and every symbol that matches a -symspec is inserted into the appropriate syms table. This is done -twice, once to count the size of each required symbol table, and again -to build the tables, which have been malloced between passes. From now -on, to determine whether a symbol is on an include or exclude symspec -list, `gprof' simply uses its standard symbol lookup routine on the -appropriate table in the `syms' array. - - Now the profile data file(s) themselves are read -(`gmon_io.c:gmon_out_read'), first by checking for a new-style -`gmon.out' header, then assuming this is an old-style BSD `gmon.out' if -the magic number test failed. - - New-style histogram records are read by `hist.c:hist_read_rec'. For -the first histogram record, allocate a memory array to hold all the -bins, and read them in. When multiple profile data files (or files -with multiple histogram records) are read, the starting address, ending -address, number of bins and sampling rate must match between the -various histograms, or a fatal error will result. If everything -matches, just sum the additional histograms into the existing in-memory -array. - - As each call graph record is read (`call_graph.c:cg_read_rec'), the -parent and child addresses are matched to symbol table entries, and a -call graph arc is created by `cg_arcs.c:arc_add', unless the arc fails -a symspec check against INCL_ARCS/EXCL_ARCS. As each arc is added, a -linked list is maintained of the parent's child arcs, and of the child's -parent arcs. Both the child's call count and the arc's call count are -incremented by the record's call count. - - Basic-block records are read (`basic_blocks.c:bb_read_rec'), but -only if line-by-line profiling has been selected. Each basic-block -address is matched to a corresponding line symbol in the symbol table, -and an entry made in the symbol's bb_addr and bb_calls arrays. Again, -if multiple basic-block records are present for the same address, the -call counts are cumulative. - - A gmon.sum file is dumped, if requested (`gmon_io.c:gmon_out_write'). - - If histograms were present in the data files, assign them to symbols -(`hist.c:hist_assign_samples') by iterating over all the sample bins -and assigning them to symbols. Since the symbol table is sorted in -order of ascending memory addresses, we can simple follow along in the -symbol table as we make our pass over the sample bins. This step -includes a symspec check against INCL_FLAT/EXCL_FLAT. Depending on the -histogram scale factor, a sample bin may span multiple symbols, in -which case a fraction of the sample count is allocated to each symbol, -proportional to the degree of overlap. This effect is rare for normal -profiling, but overlaps are more common during line-by-line profiling, -and can cause each of two adjacent lines to be credited with half a -hit, for example. - - If call graph data is present, `cg_arcs.c:cg_assemble' is called. -First, if `-c' was specified, a machine-dependant routine (`find_call') -scans through each symbol's machine code, looking for subroutine call -instructions, and adding them to the call graph with a zero call count. -A topological sort is performed by depth-first numbering all the -symbols (`cg_dfn.c:cg_dfn'), so that children are always numbered less -than their parents, then making a array of pointers into the symbol -table and sorting it into numerical order, which is reverse topological -order (children appear before parents). Cycles are also detected at -this point, all members of which are assigned the same topological -number. Two passes are now made through this sorted array of symbol -pointers. The first pass, from end to beginning (parents to children), -computes the fraction of child time to propogate to each parent and a -print flag. The print flag reflects symspec handling of -INCL_GRAPH/EXCL_GRAPH, with a parent's include or exclude (print or no -print) property being propagated to its children, unless they -themselves explicitly appear in INCL_GRAPH or EXCL_GRAPH. A second -pass, from beginning to end (children to parents) actually propogates -the timings along the call graph, subject to a check against -INCL_TIME/EXCL_TIME. With the print flag, fractions, and timings now -stored in the symbol structures, the topological sort array is now -discarded, and a new array of pointers is assembled, this time sorted -by propagated time. - - Finally, print the various outputs the user requested, which is now -fairly straightforward. The call graph (`cg_print.c:cg_print') and -flat profile (`hist.c:hist_print') are regurgitations of values already -computed. The annotated source listing -(`basic_blocks.c:print_annotated_source') uses basic-block information, -if present, to label each line of code with call counts, otherwise only -the function call counts are presented. - - The function ordering code is marginally well documented in the -source code itself (`cg_print.c'). Basically, the functions with the -most use and the most parents are placed first, followed by other -functions with the most use, followed by lower use functions, followed -by unused functions at the end. - - -File: gprof.info, Node: Debugging, Prev: Internals, Up: Details - -Debugging `gprof' ------------------ - - If `gprof' was compiled with debugging enabled, the `-d' option -triggers debugging output (to stdout) which can be helpful in -understanding its operation. The debugging number specified is -interpreted as a sum of the following options: - -2 - Topological sort - Monitor depth-first numbering of symbols during call graph analysis - -4 - Cycles - Shows symbols as they are identified as cycle heads - -16 - Tallying - As the call graph arcs are read, show each arc and how the total - calls to each function are tallied - -32 - Call graph arc sorting - Details sorting individual parents/children within each call graph - entry - -64 - Reading histogram and call graph records - Shows address ranges of histograms as they are read, and each call - graph arc - -128 - Symbol table - Reading, classifying, and sorting the symbol table from the object - file. For line-by-line profiling (`-l' option), also shows line - numbers being assigned to memory addresses. - -256 - Static call graph - Trace operation of `-c' option - -512 - Symbol table and arc table lookups - Detail operation of lookup routines - -1024 - Call graph propagation - Shows how function times are propagated along the call graph - -2048 - Basic-blocks - Shows basic-block records as they are read from profile data (only - meaningful with `-l' option) - -4096 - Symspecs - Shows symspec-to-symbol pattern matching operation - -8192 - Annotate source - Tracks operation of `-A' option - - diff --git a/gnu/dist/gprof/i386.h b/gnu/dist/gprof/i386.h deleted file mode 100644 index f85f55cbbd96..000000000000 --- a/gnu/dist/gprof/i386.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)tahoe.h 1.4 (Berkeley) 6/1/90 - */ - -/* - * Right now, this does very little - */ - - /* - * opcode of the `callf' instruction - */ - /* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#define OFFSET_TO_CODE 0 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) - -#ifdef __MSDOS__ -#define FOPEN_RB "rb" -#endif diff --git a/gnu/dist/gprof/ns532.c b/gnu/dist/gprof/ns532.c deleted file mode 100644 index c68fae4473c9..000000000000 --- a/gnu/dist/gprof/ns532.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "gprof.h" -#include "symtab.h" - -/* - * dummy.c -- This file should be used for an unsupported processor type. - * It does nothing, but prevents findcall() from being unresolved. - */ - -void -find_call (parent, p_lowpc, p_highpc) - Sym *parent; - bfd_vma p_lowpc; - bfd_vma p_highpc; -{ - fprintf (stderr, "%s: -c supported on this machine architecture\n", - whoami); -} diff --git a/gnu/dist/gprof/ns532.h b/gnu/dist/gprof/ns532.h deleted file mode 100644 index 2fa22334e031..000000000000 --- a/gnu/dist/gprof/ns532.h +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)dummy.h 5.1 (Berkeley) 4/18/91 - */ - -/* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#ifdef MACH -#include -#define hertz() (HZ) -#endif -#define OFFSET_OF_CODE 0 -#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT)) - -enum opermodes - { - dummy - }; -typedef enum opermodes operandenum; diff --git a/gnu/dist/gprof/sparc.h b/gnu/dist/gprof/sparc.h deleted file mode 100644 index 48e5d230aa77..000000000000 --- a/gnu/dist/gprof/sparc.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)tahoe.h 1.4 (Berkeley) 6/1/90 - */ - - /* - * opcode of the `callf' instruction - */ -#define CALL (0xc0000000) - /* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#define OFFSET_TO_CODE 0 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) diff --git a/gnu/dist/gprof/tahoe.h b/gnu/dist/gprof/tahoe.h deleted file mode 100644 index 4d153a44f543..000000000000 --- a/gnu/dist/gprof/tahoe.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)tahoe.h 1.4 (Berkeley) 6/1/90 - */ - - /* - * opcode of the `callf' instruction - */ -#define CALLF 0xfe - - /* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#define OFFSET_TO_CODE 2 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) - - /* - * register for pc relative addressing - */ -#define PC 0xf - -enum opermodes - { - literal, indexed, reg, regdef, autodec, autoinc, autoincdef, - bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef, - immediate, absolute, byterel, bytereldef, wordrel, wordreldef, - longrel, longreldef - }; -typedef enum opermodes operandenum; diff --git a/gnu/dist/gprof/vax.h b/gnu/dist/gprof/vax.h deleted file mode 100644 index 69ec9c26ee9f..000000000000 --- a/gnu/dist/gprof/vax.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)vax.h 5.4 (Berkeley) 6/1/90 - */ - - /* - * opcode of the `calls' instruction - */ -#define CALLS 0xfb - - /* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#define OFFSET_TO_CODE 2 -#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT)) - - /* - * register for pc relative addressing - */ -#define PC 0xf - -enum opermodes - { - literal, indexed, reg, regdef, autodec, autoinc, autoincdef, - bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef, - immediate, absolute, byterel, bytereldef, wordrel, wordreldef, - longrel, longreldef - }; -typedef enum opermodes operandenum; - -struct modebyte - { - unsigned int regfield:4; - unsigned int modefield:4; - }; diff --git a/gnu/dist/ld/configure.bat b/gnu/dist/ld/configure.bat deleted file mode 100644 index 4643bdb5540b..000000000000 --- a/gnu/dist/ld/configure.bat +++ /dev/null @@ -1,72 +0,0 @@ -@echo off -echo Configuring ld for go32 -echo This makefile will be built for GNUISH make -rem This batch file assumes a unix-type "sed" program - -update ..\bfd\hosts\go32.h sysdep.h - -echo # Makefile generated by "configure.bat"> Makefile -echo LONGARGS = gcc:ar >> Makefile -echo CC=gcc >> Makefile -echo host_alias=go32 >> Makefile -echo target_alias=go32 >> Makefile - -update ../bfd/hosts/go32.h sysdep.h - -if exist config.sed del config.sed - -echo "s/^ \$(srcdir)\/move-if-change/ update/ ">> config.sed -echo "s/:\([^ ]\)/: \1/g ">> config.sed -echo "s/^ \ *\.\// go32 / ">> config.sed -echo "s/`echo \$(srcdir)\///g ">> config.sed -echo "s/ | sed 's,\^\\\.\/,,'`//g ">> config.sed -echo "s/^ cd \$(srcdir)[ ]*;// ">> config.sed - -echo "/^####$/ i\ ">> config.sed -echo "CC = gcc\ ">> config.sed -echo "EMUL=go32\ ">> config.sed -echo "EMULATION_OFILES=ego32.o ei386aout.o ">> config.sed - -echo "/^SHELL *=/ d ">> config.sed -echo "s/$(SHELL)/sh.exe/g ">> config.sed - -echo "s/'"/\\"/g ">> config.sed -echo "s/"'/\\"/g ">> config.sed - -echo "/^ldmain.o: ldmain.c/,/fi/ { ">> config.sed -echo " s/; *\\$// ">> config.sed -echo " s/-DSCRIPTDIR[^ ]*/-DSCRIPTDIR=\\".\\"/ ">> config.sed -echo " s/config.status// ">> config.sed -echo " /ldmain.o:/ p ">> config.sed -echo " /(CC)/ p ">> config.sed -echo " d ">> config.sed -echo "} ">> config.sed - -echo "s/^SHELL.*$/SHELL=sh.exe/ ">> config.sed -echo "s/genscripts.sh/genscripts.dos/g ">> config.sed - -echo "s/^ldemul-list.h/not-ldemul-list.h/ ">> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile -del config.sed -del config2.sed - -echo set -a > genscripts.dj -sed -e "/^[a-zA-Z0-9_]*=/ s/^/export /" -e "s/(. \(.*\))/sh \1/" -e "/\.em/ d" genscripts.sh >> genscripts.dj -type emultempl\generic.em >> genscripts.dj -update genscripts.dj genscripts.dos - -echo extern ld_emulation_xfer_type ld_go32_emulation; > ldemul-list.h2 -echo extern ld_emulation_xfer_type ld_i386aout_emulation; >> ldemul-list.h2 -echo #define EMULATION_LIST \>>ldemul-list.h2 -echo &ld_go32_emulation,\>>ldemul-list.h2 -echo &ld_i386aout_emulation,\>>ldemul-list.h2 -echo 0>>ldemul-list.h2 - -update ldemul-list.h2 ldemul-list.h - -if exist ldscripts\dostest goto ldscripts -mkdir ldscripts -dir > ldscripts\dostest -:ldscripts diff --git a/gnu/dist/ld/ld.info b/gnu/dist/ld/ld.info deleted file mode 100644 index 6c8a6bb777ad..000000000000 --- a/gnu/dist/ld/ld.info +++ /dev/null @@ -1,75 +0,0 @@ -This is Info file ld.info, produced by Makeinfo version 1.68 from the -input file ./ld.texinfo. - -START-INFO-DIR-ENTRY -* Ld: (ld). The GNU linker. -END-INFO-DIR-ENTRY - - This file documents the GNU linker LD. - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -Indirect: -ld.info-1: 885 -ld.info-2: 50016 -ld.info-3: 95553 -ld.info-4: 128011 - -Tag Table: -(Indirect) -Node: Top885 -Node: Overview1391 -Node: Invocation2504 -Node: Options2912 -Node: Environment40868 -Node: Commands42256 -Node: Scripts43603 -Node: Expressions44701 -Node: Integers45676 -Node: Symbols46516 -Node: Location Counter47262 -Node: Operators48410 -Node: Evaluation49321 -Node: Assignment50016 -Node: Arithmetic Functions53547 -Node: Semicolons57465 -Node: MEMORY57914 -Node: SECTIONS61097 -Node: Section Definition62716 -Node: Section Placement64712 -Node: Section Data Expressions70869 -Node: Section Options74977 -Node: Overlays79288 -Node: PHDRS83074 -Node: Entry Point87896 -Node: Version Script89437 -Node: Option Commands95553 -Node: Machine Dependent102740 -Node: H8/300103160 -Node: i960103956 -Node: BFD105624 -Node: BFD outline107078 -Node: BFD information loss108363 -Node: Canonical format110871 -Node: Reporting Bugs115217 -Node: Bug Criteria115910 -Node: Bug Reporting116604 -Node: MRI123395 -Node: Index128011 - -End Tag Table diff --git a/gnu/dist/ld/ld.info-1 b/gnu/dist/ld/ld.info-1 deleted file mode 100644 index 2985d7f16296..000000000000 --- a/gnu/dist/ld/ld.info-1 +++ /dev/null @@ -1,1181 +0,0 @@ -This is Info file ld.info, produced by Makeinfo version 1.68 from the -input file ./ld.texinfo. - -START-INFO-DIR-ENTRY -* Ld: (ld). The GNU linker. -END-INFO-DIR-ENTRY - - This file documents the GNU linker LD. - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: ld.info, Node: Top, Next: Overview, Up: (dir) - -Using ld -******** - - This file documents the GNU linker ld. - -* Menu: - -* Overview:: Overview -* Invocation:: Invocation -* Commands:: Command Language - -* Machine Dependent:: Machine Dependent Features - -* BFD:: BFD - -* Reporting Bugs:: Reporting Bugs -* MRI:: MRI Compatible Script Files -* Index:: Index - - -File: ld.info, Node: Overview, Next: Invocation, Prev: Top, Up: Top - -Overview -******** - - `ld' combines a number of object and archive files, relocates their -data and ties up symbol references. Usually the last step in compiling -a program is to run `ld'. - - `ld' accepts Linker Command Language files written in a superset of -AT&T's Link Editor Command Language syntax, to provide explicit and -total control over the linking process. - - This version of `ld' uses the general purpose BFD libraries to -operate on object files. This allows `ld' to read, combine, and write -object files in many different formats--for example, COFF or `a.out'. -Different formats may be linked together to produce any available kind -of object file. *Note BFD::, for more information. - - Aside from its flexibility, the GNU linker is more helpful than other -linkers in providing diagnostic information. Many linkers abandon -execution immediately upon encountering an error; whenever possible, -`ld' continues executing, allowing you to identify other errors (or, in -some cases, to get an output file in spite of the error). - - -File: ld.info, Node: Invocation, Next: Commands, Prev: Overview, Up: Top - -Invocation -********** - - The GNU linker `ld' is meant to cover a broad range of situations, -and to be as compatible as possible with other linkers. As a result, -you have many choices to control its behavior. - -* Menu: - -* Options:: Command Line Options -* Environment:: Environment Variables - - -File: ld.info, Node: Options, Next: Environment, Up: Invocation - -Command Line Options -==================== - - The linker supports a plethora of command-line options, but in actual -practice few of them are used in any particular context. For instance, -a frequent use of `ld' is to link standard Unix object files on a -standard, supported Unix system. On such a system, to link a file -`hello.o': - - ld -o OUTPUT /lib/crt0.o hello.o -lc - - This tells `ld' to produce a file called OUTPUT as the result of -linking the file `/lib/crt0.o' with `hello.o' and the library `libc.a', -which will come from the standard search directories. (See the -discussion of the `-l' option below.) - - The command-line options to `ld' may be specified in any order, and -may be repeated at will. Repeating most options with a different -argument will either have no further effect, or override prior -occurrences (those further to the left on the command line) of that -option. Options which may be meaningfully specified more than once are -noted in the descriptions below. - - Non-option arguments are objects files which are to be linked -together. They may follow, precede, or be mixed in with command-line -options, except that an object file argument may not be placed between -an option and its argument. - - Usually the linker is invoked with at least one object file, but you -can specify other forms of binary input files using `-l', `-R', and the -script command language. If *no* binary input files at all are -specified, the linker does not produce any output, and issues the -message `No input files'. - - If the linker can not recognize the format of an object file, it will -assume that it is a linker script. A script specified in this way -augments the main linker script used for the link (either the default -linker script or the one specified by using `-T'). This feature -permits the linker to link against a file which appears to be an object -or an archive, but actually merely defines some symbol values, or uses -`INPUT' or `GROUP' to load other objects. Note that specifying a -script in this way should only be used to augment the main linker -script; if you want to use some command that logically can only appear -once, such as the `SECTIONS' or `MEMORY' command, you must replace the -default linker script using the `-T' option. *Note Commands::. - - For options whose names are a single letter, option arguments must -either follow the option letter without intervening whitespace, or be -given as separate arguments immediately following the option that -requires them. - - For options whose names are multiple letters, either one dash or two -can precede the option name; for example, `--oformat' and `--oformat' -are equivalent. Arguments to multiple-letter options must either be -separated from the option name by an equals sign, or be given as -separate arguments immediately following the option that requires them. -For example, `--oformat srec' and `--oformat=srec' are equivalent. -Unique abbreviations of the names of multiple-letter options are -accepted. - -`-aKEYWORD' - This option is supported for HP/UX compatibility. The KEYWORD - argument must be one of the strings `archive', `shared', or - `default'. `-aarchive' is functionally equivalent to `-Bstatic', - and the other two keywords are functionally equivalent to - `-Bdynamic'. This option may be used any number of times. - -`-AARCHITECTURE' -`--architecture=ARCHITECTURE' - In the current release of `ld', this option is useful only for the - Intel 960 family of architectures. In that `ld' configuration, the - ARCHITECTURE argument identifies the particular architecture in - the 960 family, enabling some safeguards and modifying the - archive-library search path. *Note `ld' and the Intel 960 family: - i960, for details. - - Future releases of `ld' may support similar functionality for - other architecture families. - -`-b INPUT-FORMAT' -`--format=INPUT-FORMAT' - `ld' may be configured to support more than one kind of object - file. If your `ld' is configured this way, you can use the `-b' - option to specify the binary format for input object files that - follow this option on the command line. Even when `ld' is - configured to support alternative object formats, you don't - usually need to specify this, as `ld' should be configured to - expect as a default input format the most usual format on each - machine. INPUT-FORMAT is a text string, the name of a particular - format supported by the BFD libraries. (You can list the - available binary formats with `objdump -i'.) *Note BFD::. - - You may want to use this option if you are linking files with an - unusual binary format. You can also use `-b' to switch formats - explicitly (when linking object files of different formats), by - including `-b INPUT-FORMAT' before each group of object files in a - particular format. - - The default format is taken from the environment variable - `GNUTARGET'. *Note Environment::. You can also define the input - format from a script, using the command `TARGET'; see *Note Option - Commands::. - -`-c MRI-COMMANDFILE' -`--mri-script=MRI-COMMANDFILE' - For compatibility with linkers produced by MRI, `ld' accepts script - files written in an alternate, restricted command language, - described in *Note MRI Compatible Script Files: MRI. Introduce - MRI script files with the option `-c'; use the `-T' option to run - linker scripts written in the general-purpose `ld' scripting - language. If MRI-CMDFILE does not exist, `ld' looks for it in the - directories specified by any `-L' options. - -`-d' -`-dc' -`-dp' - These three options are equivalent; multiple forms are supported - for compatibility with other linkers. They assign space to common - symbols even if a relocatable output file is specified (with - `-r'). The script command `FORCE_COMMON_ALLOCATION' has the same - effect. *Note Option Commands::. - -`-e ENTRY' -`--entry=ENTRY' - Use ENTRY as the explicit symbol for beginning execution of your - program, rather than the default entry point. *Note Entry Point::, - for a discussion of defaults and other ways of specifying the - entry point. - -`-E' -`--export-dynamic' - When creating a dynamically linked executable, add all symbols to - the dynamic symbol table. The dynamic symbol table is the set of - symbols which are visible from dynamic objects at run time. - - If you do not use this option, the dynamic symbol table will - normally contain only those symbols which are referenced by some - dynamic object mentioned in the link. - - If you use `dlopen' to load a dynamic object which needs to refer - back to the symbols defined by the program, rather than some other - dynamic object, then you will probably need to use this option when - linking the program itself. - -`-f' -`--auxiliary NAME' - When creating an ELF shared object, set the internal DT_AUXILIARY - field to the specified name. This tells the dynamic linker that - the symbol table of the shared object should be used as an - auxiliary filter on the symbol table of the shared object NAME. - - If you later link a program against this filter object, then, when - you run the program, the dynamic linker will see the DT_AUXILIARY - field. If the dynamic linker resolves any symbols from the filter - object, it will first check whether there is a definition in the - shared object NAME. If there is one, it will be used instead of - the definition in the filter object. The shared object NAME need - not exist. Thus the shared object NAME may be used to provide an - alternative implementation of certain functions, perhaps for - debugging or for machine specific performance. - - This option may be specified more than once. The DT_AUXILIARY - entries will be created in the order in which they appear on the - command line. - -`-F NAME' -`--filter NAME' - When creating an ELF shared object, set the internal DT_FILTER - field to the specified name. This tells the dynamic linker that - the symbol table of the shared object which is being created - should be used as a filter on the symbol table of the shared - object NAME. - - If you later link a program against this filter object, then, when - you run the program, the dynamic linker will see the DT_FILTER - field. The dynamic linker will resolve symbols according to the - symbol table of the filter object as usual, but it will actually - link to the definitions found in the shared object NAME. Thus the - filter object can be used to select a subset of the symbols - provided by the object NAME. - - Some older linkers used the `-F' option throughout a compilation - toolchain for specifying object-file format for both input and - output object files. The GNU linker uses other mechanisms for this - purpose: the `-b', `--format', `--oformat' options, the `TARGET' - command in linker scripts, and the `GNUTARGET' environment - variable. The GNU linker will ignore the `-F' option when not - creating an ELF shared object. - -`--force-exe-suffix' - Make sure that an output file has a .exe suffix. - - If a successfully built fully linked output file does not have a - `.exe' or `.dll' suffix, this option forces the linker to copy the - output file to one of the same name with a `.exe' suffix. This - option is useful when using unmodified Unix makefiles on a - Microsoft Windows host, since some versions of Windows won't run - an image unless it ends in a `.exe' suffix. - -`-g' - Ignored. Provided for compatibility with other tools. - -`-GVALUE' -`--gpsize=VALUE' - Set the maximum size of objects to be optimized using the GP - register to SIZE. This is only meaningful for object file formats - such as MIPS ECOFF which supports putting large and small objects - into different sections. This is ignored for other object file - formats. - -`-hNAME' -`-soname=NAME' - When creating an ELF shared object, set the internal DT_SONAME - field to the specified name. When an executable is linked with a - shared object which has a DT_SONAME field, then when the - executable is run the dynamic linker will attempt to load the - shared object specified by the DT_SONAME field rather than the - using the file name given to the linker. - -`-i' - Perform an incremental link (same as option `-r'). - -`-lARCHIVE' -`--library=ARCHIVE' - Add archive file ARCHIVE to the list of files to link. This - option may be used any number of times. `ld' will search its - path-list for occurrences of `libARCHIVE.a' for every ARCHIVE - specified. - - On systems which support shared libraries, `ld' may also search for - libraries with extensions other than `.a'. Specifically, on ELF - and SunOS systems, `ld' will search a directory for a library with - an extension of `.so' before searching for one with an extension of - `.a'. By convention, a `.so' extension indicates a shared library. - - The linker will search an archive only once, at the location where - it is specified on the command line. If the archive defines a - symbol which was undefined in some object which appeared before - the archive on the command line, the linker will include the - appropriate file(s) from the archive. However, an undefined - symbol in an object appearing later on the command line will not - cause the linker to search the archive again. - - See the `-(' option for a way to force the linker to search - archives multiple times. - - You may list the same archive multiple times on the command line. - - This type of archive searching is standard for Unix linkers. - However, if you are using `ld' on AIX, note that it is different - from the behaviour of the AIX linker. - -`-LSEARCHDIR' -`--library-path=SEARCHDIR' - Add path SEARCHDIR to the list of paths that `ld' will search for - archive libraries and `ld' control scripts. You may use this - option any number of times. The directories are searched in the - order in which they are specified on the command line. - Directories specified on the command line are searched before the - default directories. All `-L' options apply to all `-l' options, - regardless of the order in which the options appear. - - The default set of paths searched (without being specified with - `-L') depends on which emulation mode `ld' is using, and in some - cases also on how it was configured. *Note Environment::. - - The paths can also be specified in a link script with the - `SEARCH_DIR' command. Directories specified this way are searched - at the point in which the linker script appears in the command - line. - -`-mEMULATION' - Emulate the EMULATION linker. You can list the available - emulations with the `--verbose' or `-V' options. - - If the `-m' option is not used, the emulation is taken from the - `LDEMULATION' environment variable, if that is defined. - - Otherwise, the default emulation depends upon how the linker was - configured. - -`-M' -`--print-map' - Print a link map to the standard output. A link map provides - information about the link, including the following: - - * Where object files and symbols are mapped into memory. - - * How common symbols are allocated. - - * All archive members included in the link, with a mention of - the symbol which caused the archive member to be brought in. - -`-n' -`--nmagic' - Set the text segment to be read only, and mark the output as - `NMAGIC' if possible. - -`-N' -`--omagic' - Set the text and data sections to be readable and writable. Also, - do not page-align the data segment. If the output format supports - Unix style magic numbers, mark the output as `OMAGIC'. - -`-o OUTPUT' -`--output=OUTPUT' - Use OUTPUT as the name for the program produced by `ld'; if this - option is not specified, the name `a.out' is used by default. The - script command `OUTPUT' can also specify the output file name. - -`-r' -`--relocateable' - Generate relocatable output--i.e., generate an output file that - can in turn serve as input to `ld'. This is often called "partial - linking". As a side effect, in environments that support standard - Unix magic numbers, this option also sets the output file's magic - number to `OMAGIC'. If this option is not specified, an absolute - file is produced. When linking C++ programs, this option *will - not* resolve references to constructors; to do that, use `-Ur'. - - This option does the same thing as `-i'. - -`-R FILENAME' -`--just-symbols=FILENAME' - Read symbol names and their addresses from FILENAME, but do not - relocate it or include it in the output. This allows your output - file to refer symbolically to absolute locations of memory defined - in other programs. You may use this option more than once. - - For compatibility with other ELF linkers, if the `-R' option is - followed by a directory name, rather than a file name, it is - treated as the `-rpath' option. - -`-s' -`--strip-all' - Omit all symbol information from the output file. - -`-S' -`--strip-debug' - Omit debugger symbol information (but not all symbols) from the - output file. - -`-t' -`--trace' - Print the names of the input files as `ld' processes them. - -`-T COMMANDFILE' -`--script=COMMANDFILE' - Read link commands from the file COMMANDFILE. These commands - replace `ld''s default link script (rather than adding to it), so - COMMANDFILE must specify everything necessary to describe the - target format. You must use this option if you want to use a - command which can only appear once in a linker script, such as the - `SECTIONS' or `MEMORY' command. *Note Commands::. If COMMANDFILE - does not exist, `ld' looks for it in the directories specified by - any preceding `-L' options. Multiple `-T' options accumulate. - -`-u SYMBOL' -`--undefined=SYMBOL' - Force SYMBOL to be entered in the output file as an undefined - symbol. Doing this may, for example, trigger linking of - additional modules from standard libraries. `-u' may be repeated - with different option arguments to enter additional undefined - symbols. - -`-v' -`--version' -`-V' - Display the version number for `ld'. The `-V' option also lists - the supported emulations. - -`-x' -`--discard-all' - Delete all local symbols. - -`-X' -`--discard-locals' - Delete all temporary local symbols. For most targets, this is all - local symbols whose names begin with `L'. - -`-y SYMBOL' -`--trace-symbol=SYMBOL' - Print the name of each linked file in which SYMBOL appears. This - option may be given any number of times. On many systems it is - necessary to prepend an underscore. - - This option is useful when you have an undefined symbol in your - link but don't know where the reference is coming from. - -`-Y PATH' - Add PATH to the default library search path. This option exists - for Solaris compatibility. - -`-z KEYWORD' - This option is ignored for Solaris compatibility. - -`-( ARCHIVES -)' -`--start-group ARCHIVES --end-group' - The ARCHIVES should be a list of archive files. They may be - either explicit file names, or `-l' options. - - The specified archives are searched repeatedly until no new - undefined references are created. Normally, an archive is - searched only once in the order that it is specified on the - command line. If a symbol in that archive is needed to resolve an - undefined symbol referred to by an object in an archive that - appears later on the command line, the linker would not be able to - resolve that reference. By grouping the archives, they all be - searched repeatedly until all possible references are resolved. - - Using this option has a significant performance cost. It is best - to use it only when there are unavoidable circular references - between two or more archives. - -`-assert KEYWORD' - This option is ignored for SunOS compatibility. - -`-Bdynamic' -`-dy' -`-call_shared' - Link against dynamic libraries. This is only meaningful on - platforms for which shared libraries are supported. This option - is normally the default on such platforms. The different variants - of this option are for compatibility with various systems. You - may use this option multiple times on the command line: it affects - library searching for `-l' options which follow it. - -`-Bstatic' -`-dn' -`-non_shared' -`-static' - Do not link against shared libraries. This is only meaningful on - platforms for which shared libraries are supported. The different - variants of this option are for compatibility with various - systems. You may use this option multiple times on the command - line: it affects library searching for `-l' options which follow - it. - -`-Bsymbolic' - When creating a shared library, bind references to global symbols - to the definition within the shared library, if any. Normally, it - is possible for a program linked against a shared library to - override the definition within the shared library. This option is - only meaningful on ELF platforms which support shared libraries. - -`--cref' - Output a cross reference table. If a linker map file is being - generated, the cross reference table is printed to the map file. - Otherwise, it is printed on the standard output. - - The format of the table is intentionally simple, so that it may be - easily processed by a script if necessary. The symbols are - printed out, sorted by name. For each symbol, a list of file - names is given. If the symbol is defined, the first file listed - is the location of the definition. The remaining files contain - references to the symbol. - -`--defsym SYMBOL=EXPRESSION' - Create a global symbol in the output file, containing the absolute - address given by EXPRESSION. You may use this option as many - times as necessary to define multiple symbols in the command line. - A limited form of arithmetic is supported for the EXPRESSION in - this context: you may give a hexadecimal constant or the name of - an existing symbol, or use `+' and `-' to add or subtract - hexadecimal constants or symbols. If you need more elaborate - expressions, consider using the linker command language from a - script (*note Assignment: Symbol Definitions: Assignment.). - *Note:* there should be no white space between SYMBOL, the equals - sign ("<=>"), and EXPRESSION. - -`--dynamic-linker FILE' - Set the name of the dynamic linker. This is only meaningful when - generating dynamically linked ELF executables. The default dynamic - linker is normally correct; don't use this unless you know what - you are doing. - -`-EB' - Link big-endian objects. This affects the default output format. - -`-EL' - Link little-endian objects. This affects the default output - format. - -`--embedded-relocs' - This option is only meaningful when linking MIPS embedded PIC code, - generated by the -membedded-pic option to the GNU compiler and - assembler. It causes the linker to create a table which may be - used at runtime to relocate any data which was statically - initialized to pointer values. See the code in testsuite/ld-empic - for details. - -`--help' - Print a summary of the command-line options on the standard output - and exit. - -`-Map MAPFILE' - Print a link map to the file MAPFILE. See the description of the - `-M' option, above. - -`--no-keep-memory' - `ld' normally optimizes for speed over memory usage by caching the - symbol tables of input files in memory. This option tells `ld' to - instead optimize for memory usage, by rereading the symbol tables - as necessary. This may be required if `ld' runs out of memory - space while linking a large executable. - -`--no-warn-mismatch' - Normally `ld' will give an error if you try to link together input - files that are mismatched for some reason, perhaps because they - have been compiled for different processors or for different - endiannesses. This option tells `ld' that it should silently - permit such possible errors. This option should only be used with - care, in cases when you have taken some special action that - ensures that the linker errors are inappropriate. - -`--no-whole-archive' - Turn off the effect of the `--whole-archive' option for subsequent - archive files. - -`--noinhibit-exec' - Retain the executable output file whenever it is still usable. - Normally, the linker will not produce an output file if it - encounters errors during the link process; it exits without - writing an output file when it issues any error whatsoever. - -`--oformat OUTPUT-FORMAT' - `ld' may be configured to support more than one kind of object - file. If your `ld' is configured this way, you can use the - `--oformat' option to specify the binary format for the output - object file. Even when `ld' is configured to support alternative - object formats, you don't usually need to specify this, as `ld' - should be configured to produce as a default output format the most - usual format on each machine. OUTPUT-FORMAT is a text string, the - name of a particular format supported by the BFD libraries. (You - can list the available binary formats with `objdump -i'.) The - script command `OUTPUT_FORMAT' can also specify the output format, - but this option overrides it. *Note BFD::. - -`-qmagic' - This option is ignored for Linux compatibility. - -`-Qy' - This option is ignored for SVR4 compatibility. - -`--relax' - An option with machine dependent effects. This option is only - supported on a few targets. *Note `ld' and the H8/300: H8/300. - *Note `ld' and the Intel 960 family: i960. - - On some platforms, the `--relax' option performs global - optimizations that become possible when the linker resolves - addressing in the program, such as relaxing address modes and - synthesizing new instructions in the output object file. - - On platforms where this is not supported, `--relax' is accepted, - but ignored. - -`--retain-symbols-file FILENAME' - Retain *only* the symbols listed in the file FILENAME, discarding - all others. FILENAME is simply a flat file, with one symbol name - per line. This option is especially useful in environments (such - as VxWorks) where a large global symbol table is accumulated - gradually, to conserve run-time memory. - - `--retain-symbols-file' does *not* discard undefined symbols, or - symbols needed for relocations. - - You may only specify `--retain-symbols-file' once in the command - line. It overrides `-s' and `-S'. - -`-rpath DIR' - Add a directory to the runtime library search path. This is used - when linking an ELF executable with shared objects. All `-rpath' - arguments are concatenated and passed to the runtime linker, which - uses them to locate shared objects at runtime. The `-rpath' - option is also used when locating shared objects which are needed - by shared objects explicitly included in the link; see the - description of the `-rpath-link' option. If `-rpath' is not used - when linking an ELF executable, the contents of the environment - variable `LD_RUN_PATH' will be used if it is defined. - - The `-rpath' option may also be used on SunOS. By default, on - SunOS, the linker will form a runtime search patch out of all the - `-L' options it is given. If a `-rpath' option is used, the - runtime search path will be formed exclusively using the `-rpath' - options, ignoring the `-L' options. This can be useful when using - gcc, which adds many `-L' options which may be on NFS mounted - filesystems. - - For compatibility with other ELF linkers, if the `-R' option is - followed by a directory name, rather than a file name, it is - treated as the `-rpath' option. - -`-rpath-link DIR' - When using ELF or SunOS, one shared library may require another. - This happens when an `ld -shared' link includes a shared library - as one of the input files. - - When the linker encounters such a dependency when doing a - non-shared, non-relocateable link, it will automatically try to - locate the required shared library and include it in the link, if - it is not included explicitly. In such a case, the `-rpath-link' - option specifies the first set of directories to search. The - `-rpath-link' option may specify a sequence of directory names - either by specifying a list of names separated by colons, or by - appearing multiple times. - - The linker uses the following search paths to locate required - shared libraries. - 1. Any directories specified by `-rpath-link' options. - - 2. Any directories specified by `-rpath' options. The difference - between `-rpath' and `-rpath-link' is that directories - specified by `-rpath' options are included in the executable - and used at runtime, whereas the `-rpath-link' option is only - effective at link time. - - 3. On an ELF system, if the `-rpath' and `rpath-link' options - were not used, search the contents of the environment variable - `LD_RUN_PATH'. - - 4. On SunOS, if the `-rpath' option was not used, search any - directories specified using `-L' options. - - 5. For a native linker, the contents of the environment variable - `LD_LIBRARY_PATH'. - - 6. The default directories, normally `/lib' and `/usr/lib'. - - If the required shared library is not found, the linker will issue - a warning and continue with the link. - -`-shared' -`-Bshareable' - Create a shared library. This is currently only supported on ELF, - XCOFF and SunOS platforms. On SunOS, the linker will - automatically create a shared library if the `-e' option is not - used and there are undefined symbols in the link. - -`--sort-common' - This option tells `ld' to sort the common symbols by size when it - places them in the appropriate output sections. First come all - the one byte symbols, then all the two bytes, then all the four - bytes, and then everything else. This is to prevent gaps between - symbols due to alignment constraints. - -`--split-by-file' - Similar to `--split-by-reloc' but creates a new output section for - each input file. - -`--split-by-reloc COUNT' - Trys to creates extra sections in the output file so that no single - output section in the file contains more than COUNT relocations. - This is useful when generating huge relocatable for downloading - into certain real time kernels with the COFF object file format; - since COFF cannot represent more than 65535 relocations in a - single section. Note that this will fail to work with object file - formats which do not support arbitrary sections. The linker will - not split up individual input sections for redistribution, so if a - single input section contains more than COUNT relocations one - output section will contain that many relocations. - -`--stats' - Compute and display statistics about the operation of the linker, - such as execution time and memory usage. - -`--traditional-format' - For some targets, the output of `ld' is different in some ways from - the output of some existing linker. This switch requests `ld' to - use the traditional format instead. - - For example, on SunOS, `ld' combines duplicate entries in the - symbol string table. This can reduce the size of an output file - with full debugging information by over 30 percent. - Unfortunately, the SunOS `dbx' program can not read the resulting - program (`gdb' has no trouble). The `--traditional-format' switch - tells `ld' to not combine duplicate entries. - -`-Tbss ORG' -`-Tdata ORG' -`-Ttext ORG' - Use ORG as the starting address for--respectively--the `bss', - `data', or the `text' segment of the output file. ORG must be a - single hexadecimal integer; for compatibility with other linkers, - you may omit the leading `0x' usually associated with hexadecimal - values. - -`-Ur' - For anything other than C++ programs, this option is equivalent to - `-r': it generates relocatable output--i.e., an output file that - can in turn serve as input to `ld'. When linking C++ programs, - `-Ur' *does* resolve references to constructors, unlike `-r'. It - does not work to use `-Ur' on files that were themselves linked - with `-Ur'; once the constructor table has been built, it cannot - be added to. Use `-Ur' only for the last partial link, and `-r' - for the others. - -`--verbose' - Display the version number for `ld' and list the linker emulations - supported. Display which input files can and cannot be opened. - Display the linker script if using a default builtin script. - -`--version-script=VERSION-SCRIPTFILE' - Specify the name of a version script to the linker. This is - typically used when creating shared libraries to specify - additional information about the version heirarchy for the library - being created. This option is only meaningful on ELF platforms - which support shared libraries. *Note Version Script::. - -`--warn-common' - Warn when a common symbol is combined with another common symbol - or with a symbol definition. Unix linkers allow this somewhat - sloppy practice, but linkers on some other operating systems do - not. This option allows you to find potential problems from - combining global symbols. Unfortunately, some C libraries use - this practice, so you may get some warnings about symbols in the - libraries as well as in your programs. - - There are three kinds of global symbols, illustrated here by C - examples: - - `int i = 1;' - A definition, which goes in the initialized data section of - the output file. - - `extern int i;' - An undefined reference, which does not allocate space. There - must be either a definition or a common symbol for the - variable somewhere. - - `int i;' - A common symbol. If there are only (one or more) common - symbols for a variable, it goes in the uninitialized data - area of the output file. The linker merges multiple common - symbols for the same variable into a single symbol. If they - are of different sizes, it picks the largest size. The - linker turns a common symbol into a declaration, if there is - a definition of the same variable. - - The `--warn-common' option can produce five kinds of warnings. - Each warning consists of a pair of lines: the first describes the - symbol just encountered, and the second describes the previous - symbol encountered with the same name. One or both of the two - symbols will be a common symbol. - - 1. Turning a common symbol into a reference, because there is - already a definition for the symbol. - FILE(SECTION): warning: common of `SYMBOL' - overridden by definition - FILE(SECTION): warning: defined here - - 2. Turning a common symbol into a reference, because a later - definition for the symbol is encountered. This is the same - as the previous case, except that the symbols are encountered - in a different order. - FILE(SECTION): warning: definition of `SYMBOL' - overriding common - FILE(SECTION): warning: common is here - - 3. Merging a common symbol with a previous same-sized common - symbol. - FILE(SECTION): warning: multiple common - of `SYMBOL' - FILE(SECTION): warning: previous common is here - - 4. Merging a common symbol with a previous larger common symbol. - FILE(SECTION): warning: common of `SYMBOL' - overridden by larger common - FILE(SECTION): warning: larger common is here - - 5. Merging a common symbol with a previous smaller common - symbol. This is the same as the previous case, except that - the symbols are encountered in a different order. - FILE(SECTION): warning: common of `SYMBOL' - overriding smaller common - FILE(SECTION): warning: smaller common is here - -`--warn-constructors' - Warn if any global constructors are used. This is only useful for - a few object file formats. For formats like COFF or ELF, the - linker can not detect the use of global constructors. - -`--warn-multiple-gp' - Warn if multiple global pointer values are required in the output - file. This is only meaningful for certain processors, such as the - Alpha. Specifically, some processors put large-valued constants - in a special section. A special register (the global pointer) - points into the middle of this section, so that constants can be - loaded efficiently via a base-register relative addressing mode. - Since the offset in base-register relative mode is fixed and - relatively small (e.g., 16 bits), this limits the maximum size of - the constant pool. Thus, in large programs, it is often necessary - to use multiple global pointer values in order to be able to - address all possible constants. This option causes a warning to - be issued whenever this case occurs. - -`--warn-once' - Only warn once for each undefined symbol, rather than once per - module which refers to it. - -`--warn-section-align' - Warn if the address of an output section is changed because of - alignment. Typically, the alignment will be set by an input - section. The address will only be changed if it not explicitly - specified; that is, if the `SECTIONS' command does not specify a - start address for the section (*note SECTIONS::.). - -`--whole-archive' - For each archive mentioned on the command line after the - `--whole-archive' option, include every object file in the archive - in the link, rather than searching the archive for the required - object files. This is normally used to turn an archive file into - a shared library, forcing every object to be included in the - resulting shared library. This option may be used more than once. - -`--wrap SYMBOL' - Use a wrapper function for SYMBOL. Any undefined reference to - SYMBOL will be resolved to `__wrap_SYMBOL'. Any undefined - reference to `__real_SYMBOL' will be resolved to SYMBOL. - - This can be used to provide a wrapper for a system function. The - wrapper function should be called `__wrap_SYMBOL'. If it wishes - to call the system function, it should call `__real_SYMBOL'. - - Here is a trivial example: - - void * - __wrap_malloc (int c) - { - printf ("malloc called with %ld\n", c); - return __real_malloc (c); - } - - If you link other code with this file using `--wrap malloc', then - all calls to `malloc' will call the function `__wrap_malloc' - instead. The call to `__real_malloc' in `__wrap_malloc' will call - the real `malloc' function. - - You may wish to provide a `__real_malloc' function as well, so that - links without the `--wrap' option will succeed. If you do this, - you should not put the definition of `__real_malloc' in the same - file as `__wrap_malloc'; if you do, the assembler may resolve the - call before the linker has a chance to wrap it to `malloc'. - - -File: ld.info, Node: Environment, Prev: Options, Up: Invocation - -Environment Variables -===================== - - You can change the behavior of `ld' with the environment variables -`GNUTARGET' and `LDEMULATION'. - - `GNUTARGET' determines the input-file object format if you don't use -`-b' (or its synonym `--format'). Its value should be one of the BFD -names for an input format (*note BFD::.). If there is no `GNUTARGET' -in the environment, `ld' uses the natural format of the target. If -`GNUTARGET' is set to `default' then BFD attempts to discover the input -format by examining binary input files; this method often succeeds, but -there are potential ambiguities, since there is no method of ensuring -that the magic number used to specify object-file formats is unique. -However, the configuration procedure for BFD on each system places the -conventional format for that system first in the search-list, so -ambiguities are resolved in favor of convention. - - `LDEMULATION' determines the default emulation if you don't use the -`-m' option. The emulation can affect various aspects of linker -behaviour, particularly the default linker script. You can list the -available emulations with the `--verbose' or `-V' options. If the `-m' -option is not used, and the `LDEMULATION' environment variable is not -defined, the default emulation depends upon how the linker was -configured. - - -File: ld.info, Node: Commands, Next: Machine Dependent, Prev: Invocation, Up: Top - -Command Language -**************** - - The command language provides explicit control over the link process, -allowing complete specification of the mapping between the linker's -input files and its output. It controls: - * input files - - * file formats - - * output file layout - - * addresses of sections - - * placement of common blocks - - You may supply a command file (also known as a linker script) to the -linker either explicitly through the `-T' option, or implicitly as an -ordinary file. Normally you should use the `-T' option. An implicit -linker script should only be used when you want to augment, rather than -replace, the default linker script; typically an implicit linker script -would consist only of `INPUT' or `GROUP' commands. - - If the linker opens a file which it cannot recognize as a supported -object or archive format, nor as a linker script, it reports an error. - -* Menu: - -* Scripts:: Linker Scripts -* Expressions:: Expressions -* MEMORY:: MEMORY Command -* SECTIONS:: SECTIONS Command -* PHDRS:: PHDRS Command -* Entry Point:: The Entry Point -* Version Script:: Version Script -* Option Commands:: Option Commands - - -File: ld.info, Node: Scripts, Next: Expressions, Up: Commands - -Linker Scripts -============== - - The `ld' command language is a collection of statements; some are -simple keywords setting a particular option, some are used to select and -group input files or name output files; and two statement types have a -fundamental and pervasive impact on the linking process. - - The most fundamental command of the `ld' command language is the -`SECTIONS' command (*note SECTIONS::.). Every meaningful command -script must have a `SECTIONS' command: it specifies a "picture" of the -output file's layout, in varying degrees of detail. No other command -is required in all cases. - - The `MEMORY' command complements `SECTIONS' by describing the -available memory in the target architecture. This command is optional; -if you don't use a `MEMORY' command, `ld' assumes sufficient memory is -available in a contiguous block for all output. *Note MEMORY::. - - You may include comments in linker scripts just as in C: delimited -by `/*' and `*/'. As in C, comments are syntactically equivalent to -whitespace. - - -File: ld.info, Node: Expressions, Next: MEMORY, Prev: Scripts, Up: Commands - -Expressions -=========== - - Many useful commands involve arithmetic expressions. The syntax for -expressions in the command language is identical to that of C -expressions, with the following features: - * All expressions evaluated as integers and are of "long" or - "unsigned long" type. - - * All constants are integers. - - * All of the C arithmetic operators are provided. - - * You may reference, define, and create global variables. - - * You may call special purpose built-in functions. - -* Menu: - -* Integers:: Integers -* Symbols:: Symbol Names -* Location Counter:: The Location Counter -* Operators:: Operators -* Evaluation:: Evaluation -* Assignment:: Assignment: Defining Symbols -* Arithmetic Functions:: Built-In Functions -* Semicolons:: Semicolon Usage - - -File: ld.info, Node: Integers, Next: Symbols, Up: Expressions - -Integers --------- - - An octal integer is `0' followed by zero or more of the octal digits -(`01234567'). - _as_octal = 0157255; - - A decimal integer starts with a non-zero digit followed by zero or -more digits (`0123456789'). - _as_decimal = 57005; - - A hexadecimal integer is `0x' or `0X' followed by one or more -hexadecimal digits chosen from `0123456789abcdefABCDEF'. - _as_hex = 0xdead; - - To write a negative integer, use the prefix operator `-' (*note -Operators::.). - _as_neg = -57005; - - Additionally the suffixes `K' and `M' may be used to scale a -constant by `1024' or `1024*1024' respectively. For example, the -following all refer to the same quantity: - - _fourk_1 = 4K; - _fourk_2 = 4096; - _fourk_3 = 0x1000; - - -File: ld.info, Node: Symbols, Next: Location Counter, Prev: Integers, Up: Expressions - -Symbol Names ------------- - - Unless quoted, symbol names start with a letter, underscore, or point -and may include any letters, underscores, digits, points, and hyphens. -Unquoted symbol names must not conflict with any keywords. You can -specify a symbol which contains odd characters or has the same name as -a keyword, by surrounding the symbol name in double quotes: - "SECTION" = 9; - "with a space" = "also with a space" + 10; - - Since symbols can contain many non-alphabetic characters, it is -safest to delimit symbols with spaces. For example, `A-B' is one -symbol, whereas `A - B' is an expression involving subtraction. - - -File: ld.info, Node: Location Counter, Next: Operators, Prev: Symbols, Up: Expressions - -The Location Counter --------------------- - - The special linker variable "dot" `.' always contains the current -output location counter. Since the `.' always refers to a location in -an output section, it must always appear in an expression within a -`SECTIONS' command. The `.' symbol may appear anywhere that an ordinary -symbol is allowed in an expression, but its assignments have a side -effect. Assigning a value to the `.' symbol will cause the location -counter to be moved. This may be used to create holes in the output -section. The location counter may never be moved backwards. - SECTIONS - { - output : - { - file1(.text) - . = . + 1000; - file2(.text) - . += 1000; - file3(.text) - } = 0x1234; - } - -In the previous example, `file1' is located at the beginning of the -output section, then there is a 1000 byte gap. Then `file2' appears, -also with a 1000 byte gap following before `file3' is loaded. The -notation `= 0x1234' specifies what data to write in the gaps (*note -Section Options::.). - - -File: ld.info, Node: Operators, Next: Evaluation, Prev: Location Counter, Up: Expressions - -Operators ---------- - - The linker recognizes the standard C set of arithmetic operators, -with the standard bindings and precedence levels: - precedence associativity Operators Notes - (highest) - 1 left ! - ~ (1) - 2 left * / % - 3 left + - - 4 left >> << - 5 left == != > < <= >= - 6 left & - 7 left | - 8 left && - 9 left || - 10 right ? : - 11 right &= += -= *= /= (2) - (lowest) - Notes: (1) Prefix operators (2) *Note Assignment::. - - -File: ld.info, Node: Evaluation, Next: Assignment, Prev: Operators, Up: Expressions - -Evaluation ----------- - - The linker uses "lazy evaluation" for expressions; it only calculates -an expression when absolutely necessary. The linker needs the value of -the start address, and the lengths of memory regions, in order to do any -linking at all; these values are computed as soon as possible when the -linker reads in the command file. However, other values (such as symbol -values) are not known or needed until after storage allocation. Such -values are evaluated later, when other information (such as the sizes of -output sections) is available for use in the symbol assignment -expression. - diff --git a/gnu/dist/ld/ld.info-2 b/gnu/dist/ld/ld.info-2 deleted file mode 100644 index 2fe314f7db68..000000000000 --- a/gnu/dist/ld/ld.info-2 +++ /dev/null @@ -1,1189 +0,0 @@ -This is Info file ld.info, produced by Makeinfo version 1.68 from the -input file ./ld.texinfo. - -START-INFO-DIR-ENTRY -* Ld: (ld). The GNU linker. -END-INFO-DIR-ENTRY - - This file documents the GNU linker LD. - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: ld.info, Node: Assignment, Next: Arithmetic Functions, Prev: Evaluation, Up: Expressions - -Assignment: Defining Symbols ----------------------------- - - You may create global symbols, and assign values (addresses) to -global symbols, using any of the C assignment operators: - -`SYMBOL = EXPRESSION ;' -`SYMBOL &= EXPRESSION ;' -`SYMBOL += EXPRESSION ;' -`SYMBOL -= EXPRESSION ;' -`SYMBOL *= EXPRESSION ;' -`SYMBOL /= EXPRESSION ;' - Two things distinguish assignment from other operators in `ld' -expressions. - * Assignment may only be used at the root of an expression; `a=b+3;' - is allowed, but `a+b=3;' is an error. - - * You must place a trailing semicolon ("<;>") at the end of an - assignment statement. - - Assignment statements may appear: - * as commands in their own right in an `ld' script; or - - * as independent statements within a `SECTIONS' command; or - - * as part of the contents of a section definition in a `SECTIONS' - command. - - The first two cases are equivalent in effect--both define a symbol -with an absolute address. The last case defines a symbol whose address -is relative to a particular section (*note SECTIONS::.). - - When a linker expression is evaluated and assigned to a variable, it -is given either an absolute or a relocatable type. An absolute -expression type is one in which the symbol contains the value that it -will have in the output file; a relocatable expression type is one in -which the value is expressed as a fixed offset from the base of a -section. - - The type of the expression is controlled by its position in the -script file. A symbol assigned within a section definition is created -relative to the base of the section; a symbol assigned in any other -place is created as an absolute symbol. Since a symbol created within a -section definition is relative to the base of the section, it will -remain relocatable if relocatable output is requested. A symbol may be -created with an absolute value even when assigned to within a section -definition by using the absolute assignment function `ABSOLUTE'. For -example, to create an absolute symbol whose address is the last byte of -an output section named `.data': - SECTIONS{ ... - .data : - { - *(.data) - _edata = ABSOLUTE(.) ; - } - ... } - - The linker tries to put off the evaluation of an assignment until all -the terms in the source expression are known (*note Evaluation::.). For -instance, the sizes of sections cannot be known until after allocation, -so assignments dependent upon these are not performed until after -allocation. Some expressions, such as those depending upon the location -counter "dot", `.' must be evaluated during allocation. If the result -of an expression is required, but the value is not available, then an -error results. For example, a script like the following - SECTIONS { ... - text 9+this_isnt_constant : - { ... - } - ... } - -will cause the error message "`Non constant expression for initial -address'". - - In some cases, it is desirable for a linker script to define a symbol -only if it is referenced, and only if it is not defined by any object -included in the link. For example, traditional linkers defined the -symbol `etext'. However, ANSI C requires that the user be able to use -`etext' as a function name without encountering an error. The -`PROVIDE' keyword may be used to define a symbol, such as `etext', only -if it is referenced but not defined. The syntax is `PROVIDE(SYMBOL = -EXPRESSION)'. - - -File: ld.info, Node: Arithmetic Functions, Next: Semicolons, Prev: Assignment, Up: Expressions - -Arithmetic Functions --------------------- - - The command language includes a number of built-in functions for use -in link script expressions. -`ABSOLUTE(EXP)' - Return the absolute (non-relocatable, as opposed to non-negative) - value of the expression EXP. Primarily useful to assign an - absolute value to a symbol within a section definition, where - symbol values are normally section-relative. - -`ADDR(SECTION)' - Return the absolute address of the named SECTION. Your script must - previously have defined the location of that section. In the - following example, `symbol_1' and `symbol_2' are assigned identical - values: - SECTIONS{ ... - .output1 : - { - start_of_output_1 = ABSOLUTE(.); - ... - } - .output : - { - symbol_1 = ADDR(.output1); - symbol_2 = start_of_output_1; - } - ... } - -`LOADADDR(SECTION)' - Return the absolute load address of the named SECTION. This is - normally the same as `ADDR', but it may be different if the `AT' - keyword is used in the section definition (*note Section - Options::.). - -`ALIGN(EXP)' - Return the result of the current location counter (`.') aligned to - the next EXP boundary. EXP must be an expression whose value is a - power of two. This is equivalent to - (. + EXP - 1) & ~(EXP - 1) - - `ALIGN' doesn't change the value of the location counter--it just - does arithmetic on it. As an example, to align the output `.data' - section to the next `0x2000' byte boundary after the preceding - section and to set a variable within the section to the next - `0x8000' boundary after the input sections: - SECTIONS{ ... - .data ALIGN(0x2000): { - *(.data) - variable = ALIGN(0x8000); - } - ... } - - The first use of `ALIGN' in this example specifies the location of - a section because it is used as the optional START attribute of a - section definition (*note Section Options::.). The second use - simply defines the value of a variable. - - The built-in `NEXT' is closely related to `ALIGN'. - -`DEFINED(SYMBOL)' - Return 1 if SYMBOL is in the linker global symbol table and is - defined, otherwise return 0. You can use this function to provide - default values for symbols. For example, the following - command-file fragment shows how to set a global symbol `begin' to - the first location in the `.text' section--but if a symbol called - `begin' already existed, its value is preserved: - - SECTIONS{ ... - .text : { - begin = DEFINED(begin) ? begin : . ; - ... - } - ... } - -`NEXT(EXP)' - Return the next unallocated address that is a multiple of EXP. - This function is closely related to `ALIGN(EXP)'; unless you use - the `MEMORY' command to define discontinuous memory for the output - file, the two functions are equivalent. - -`SIZEOF(SECTION)' - Return the size in bytes of the named SECTION, if that section has - been allocated. In the following example, `symbol_1' and - `symbol_2' are assigned identical values: - SECTIONS{ ... - .output { - .start = . ; - ... - .end = . ; - } - symbol_1 = .end - .start ; - symbol_2 = SIZEOF(.output); - ... } - -`SIZEOF_HEADERS' -`sizeof_headers' - Return the size in bytes of the output file's headers. You can - use this number as the start address of the first section, if you - choose, to facilitate paging. - -`MAX(EXP1, EXP2)' - Returns the maximum of EXP1 and EXP2. - -`MIN(EXP1, EXP2)' - Returns the minimum of EXP1 and EXP2. - - -File: ld.info, Node: Semicolons, Prev: Arithmetic Functions, Up: Expressions - -Semicolons ----------- - - Semicolons ("<;>") are required in the following places. In all -other places they can appear for aesthetic reasons but are otherwise -ignored. - -`Assignment' - Semicolons must appear at the end of assignment expressions. - *Note Assignment:: - -`PHDRS' - Semicolons must appear at the end of a `PHDRS' statement. *Note - PHDRS:: - - -File: ld.info, Node: MEMORY, Next: SECTIONS, Prev: Expressions, Up: Commands - -Memory Layout -============= - - The linker's default configuration permits allocation of all -available memory. You can override this configuration by using the -`MEMORY' command. The `MEMORY' command describes the location and size -of blocks of memory in the target. By using it carefully, you can -describe which memory regions may be used by the linker, and which -memory regions it must avoid. The linker does not shuffle sections to -fit into the available regions, but does move the requested sections -into the correct regions and issue errors when the regions become too -full. - - A command file may contain at most one use of the `MEMORY' command; -however, you can define as many blocks of memory within it as you wish. -The syntax is: - - MEMORY - { - NAME (ATTR) : ORIGIN = ORIGIN, LENGTH = LEN - ... - } - -`NAME' - is a name used internally by the linker to refer to the region. Any - symbol name may be used. The region names are stored in a separate - name space, and will not conflict with symbols, file names or - section names. Use distinct names to specify multiple regions. - -`(ATTR)' - is an optional list of attributes that specify whether to use a - particular memory to place sections that are not listed in the - linker script. Valid attribute lists must be made up of the - characters "`ALIRWX'" that match section attributes. If you omit - the attribute list, you may omit the parentheses around it as - well. The attributes currently supported are: - - ``Letter'' - `Section Attribute' - - ``R'' - Read-only sections. - - ``W'' - Read/write sections. - - ``X'' - Sections containing executable code. - - ``A'' - Allocated sections. - - ``I'' - Initialized sections. - - ``L'' - Same as `I'. - - ``!'' - Invert the sense of any of the following attributes. - -`ORIGIN' - is the start address of the region in physical memory. It is an - expression that must evaluate to a constant before memory - allocation is performed. The keyword `ORIGIN' may be abbreviated - to `org' or `o' (but not, for example, `ORG'). - -`LEN' - is the size in bytes of the region (an expression). The keyword - `LENGTH' may be abbreviated to `len' or `l'. - - For example, to specify that memory has two regions available for -allocation--one starting at 0 for 256 kilobytes, and the other starting -at `0x40000000' for four megabytes. The `rom' memory region will get -all sections without an explicit memory register that are either -read-only or contain code, while the `ram' memory region will get the -sections. - - MEMORY - { - rom (rx) : ORIGIN = 0, LENGTH = 256K - ram (!rx) : org = 0x40000000, l = 4M - } - - Once you have defined a region of memory named MEM, you can direct -specific output sections there by using a command ending in `>MEM' -within the `SECTIONS' command (*note Section Options::.). If the -combined output sections directed to a region are too big for the -region, the linker will issue an error message. - - -File: ld.info, Node: SECTIONS, Next: PHDRS, Prev: MEMORY, Up: Commands - -Specifying Output Sections -========================== - - The `SECTIONS' command controls exactly where input sections are -placed into output sections, their order in the output file, and to -which output sections they are allocated. - - You may use at most one `SECTIONS' command in a script file, but you -can have as many statements within it as you wish. Statements within -the `SECTIONS' command can do one of three things: - - * define the entry point; - - * assign a value to a symbol; - - * describe the placement of a named output section, and which input - sections go into it. - - You can also use the first two operations--defining the entry point -and defining symbols--outside the `SECTIONS' command: *note Entry -Point::., and *Note Assignment::. They are permitted here as well for -your convenience in reading the script, so that symbols and the entry -point can be defined at meaningful points in your output-file layout. - - If you do not use a `SECTIONS' command, the linker places each input -section into an identically named output section in the order that the -sections are first encountered in the input files. If all input -sections are present in the first file, for example, the order of -sections in the output file will match the order in the first input -file. - -* Menu: - -* Section Definition:: Section Definitions -* Section Placement:: Section Placement -* Section Data Expressions:: Section Data Expressions -* Section Options:: Optional Section Attributes -* Overlays:: Overlays - - -File: ld.info, Node: Section Definition, Next: Section Placement, Up: SECTIONS - -Section Definitions -------------------- - - The most frequently used statement in the `SECTIONS' command is the -"section definition", which specifies the properties of an output -section: its location, alignment, contents, fill pattern, and target -memory region. Most of these specifications are optional; the simplest -form of a section definition is - SECTIONS { ... - SECNAME : { - CONTENTS - } - ... } - -SECNAME is the name of the output section, and CONTENTS a specification -of what goes there--for example, a list of input files or sections of -input files (*note Section Placement::.). The whitespace around -SECNAME is required, so that the section name is unambiguous. The -other whitespace shown is optional. You do need the colon `:' and the -braces `{}', however. - - SECNAME must meet the constraints of your output format. In formats -which only support a limited number of sections, such as `a.out', the -name must be one of the names supported by the format (`a.out', for -example, allows only `.text', `.data' or `.bss'). If the output format -supports any number of sections, but with numbers and not names (as is -the case for Oasys), the name should be supplied as a quoted numeric -string. A section name may consist of any sequence of characters, but -any name which does not conform to the standard `ld' symbol name syntax -must be quoted. *Note Symbol Names: Symbols. - - The special SECNAME `/DISCARD/' may be used to discard input -sections. Any sections which are assigned to an output section named -`/DISCARD/' are not included in the final link output. - - The linker will not create output sections which do not have any -contents. This is for convenience when referring to input sections that -may or may not exist. For example, - .foo { *(.foo) } - will only create a `.foo' section in the output file if there is a -`.foo' section in at least one input file. - - -File: ld.info, Node: Section Placement, Next: Section Data Expressions, Prev: Section Definition, Up: SECTIONS - -Section Placement ------------------ - - In a section definition, you can specify the contents of an output -section by listing particular input files, by listing particular -input-file sections, or by a combination of the two. You can also place -arbitrary data in the section, and define symbols relative to the -beginning of the section. - - The CONTENTS of a section definition may include any of the -following kinds of statement. You can include as many of these as you -like in a single section definition, separated from one another by -whitespace. - -`FILENAME' - You may simply name a particular input file to be placed in the - current output section; *all* sections from that file are placed - in the current section definition. If the file name has already - been mentioned in another section definition, with an explicit - section name list, then only those sections which have not yet - been allocated are used. - - To specify a list of particular files by name: - .data : { afile.o bfile.o cfile.o } - - The example also illustrates that multiple statements can be - included in the contents of a section definition, since each file - name is a separate statement. - -`FILENAME( SECTION )' -`FILENAME( SECTION , SECTION, ... )' -`FILENAME( SECTION SECTION ... )' - You can name one or more sections from your input files, for - insertion in the current output section. If you wish to specify a - list of input-file sections inside the parentheses, separate the - section names with whitespace. - -`* (SECTION)' -`* (SECTION, SECTION, ...)' -`* (SECTION SECTION ...)' - Instead of explicitly naming particular input files in a link - control script, you can refer to *all* files from the `ld' command - line: use `*' instead of a particular file name before the - parenthesized input-file section list. - - If you have already explicitly included some files by name, `*' - refers to all *remaining* files--those whose places in the output - file have not yet been defined. - - For example, to copy sections `1' through `4' from an Oasys file - into the `.text' section of an `a.out' file, and sections `13' and - `14' into the `.data' section: - SECTIONS { - .text :{ - *("1" "2" "3" "4") - } - - .data :{ - *("13" "14") - } - } - - `[ SECTION ... ]' used to be accepted as an alternate way to - specify named sections from all unallocated input files. Because - some operating systems (VMS) allow brackets in file names, that - notation is no longer supported. - -`FILENAME`( COMMON )'' -`*( COMMON )' - Specify where in your output file to place uninitialized data with - this notation. `*(COMMON)' by itself refers to all uninitialized - data from all input files (so far as it is not yet allocated); - FILENAME`(COMMON)' refers to uninitialized data from a particular - file. Both are special cases of the general mechanisms for - specifying where to place input-file sections: `ld' permits you to - refer to uninitialized data as if it were in an input-file section - named `COMMON', regardless of the input file's format. - - In any place where you may use a specific file or section name, you -may also use a wildcard pattern. The linker handles wildcards much as -the Unix shell does. A `*' character matches any number of characters. -A `?' character matches any single character. The sequence `[CHARS]' -will match a single instance of any of the CHARS; the `-' character may -be used to specify a range of characters, as in `[a-z]' to match any -lower case letter. A `\' character may be used to quote the following -character. - - When a file name is matched with a wildcard, the wildcard characters -will not match a `/' character (used to separate directory names on -Unix). A pattern consisting of a single `*' character is an exception; -it will always match any file name. In a section name, the wildcard -characters will match a `/' character. - - Wildcards only match files which are explicitly specified on the -command line. The linker does not search directories to expand -wildcards. However, if you specify a simple file name--a name with no -wildcard characters--in a linker script, and the file name is not also -specified on the command line, the linker will attempt to open the file -as though it appeared on the command line. - - In the following example, the command script arranges the output file -into three consecutive sections, named `.text', `.data', and `.bss', -taking the input for each from the correspondingly named sections of -all the input files: - - SECTIONS { - .text : { *(.text) } - .data : { *(.data) } - .bss : { *(.bss) *(COMMON) } - } - - The following example reads all of the sections from file `all.o' -and places them at the start of output section `outputa' which starts -at location `0x10000'. All of section `.input1' from file `foo.o' -follows immediately, in the same output section. All of section -`.input2' from `foo.o' goes into output section `outputb', followed by -section `.input1' from `foo1.o'. All of the remaining `.input1' and -`.input2' sections from any files are written to output section -`outputc'. - - SECTIONS { - outputa 0x10000 : - { - all.o - foo.o (.input1) - } - outputb : - { - foo.o (.input2) - foo1.o (.input1) - } - outputc : - { - *(.input1) - *(.input2) - } - } - - This example shows how wildcard patterns might be used to partition -files. All `.text' sections are placed in `.text', and all `.bss' -sections are placed in `.bss'. For all files beginning with an upper -case character, the `.data' section is placed into `.DATA'; for all -other files, the `.data' section is placed into `.data'. - - SECTIONS { - .text : { *(.text) } - .DATA : { [A-Z]*(.data) } - .data : { *(.data) } - .bss : { *(.bss) } - } - - -File: ld.info, Node: Section Data Expressions, Next: Section Options, Prev: Section Placement, Up: SECTIONS - -Section Data Expressions ------------------------- - - The foregoing statements arrange, in your output file, data -originating from your input files. You can also place data directly in -an output section from the link command script. Most of these -additional statements involve expressions (*note Expressions::.). -Although these statements are shown separately here for ease of -presentation, no such segregation is needed within a section definition -in the `SECTIONS' command; you can intermix them freely with any of the -statements we've just described. - -`CREATE_OBJECT_SYMBOLS' - Create a symbol for each input file in the current section, set to - the address of the first byte of data written from that input - file. For instance, with `a.out' files it is conventional to have - a symbol for each input file. You can accomplish this by defining - the output `.text' section as follows: - SECTIONS { - .text 0x2020 : - { - CREATE_OBJECT_SYMBOLS - *(.text) - _etext = ALIGN(0x2000); - } - ... - } - - If `sample.ld' is a file containing this script, and `a.o', `b.o', - `c.o', and `d.o' are four input files with contents like the - following-- - /* a.c */ - - afunction() { } - int adata=1; - int abss; - - `ld -M -T sample.ld a.o b.o c.o d.o' would create a map like this, - containing symbols matching the object file names: - 00000000 A __DYNAMIC - 00004020 B _abss - 00004000 D _adata - 00002020 T _afunction - 00004024 B _bbss - 00004008 D _bdata - 00002038 T _bfunction - 00004028 B _cbss - 00004010 D _cdata - 00002050 T _cfunction - 0000402c B _dbss - 00004018 D _ddata - 00002068 T _dfunction - 00004020 D _edata - 00004030 B _end - 00004000 T _etext - 00002020 t a.o - 00002038 t b.o - 00002050 t c.o - 00002068 t d.o - -`SYMBOL = EXPRESSION ;' -`SYMBOL F= EXPRESSION ;' - SYMBOL is any symbol name (*note Symbols::.). "F=" refers to any - of the operators `&= += -= *= /=' which combine arithmetic and - assignment. - - When you assign a value to a symbol within a particular section - definition, the value is relative to the beginning of the section - (*note Assignment::.). If you write - - SECTIONS { - abs = 14 ; - ... - .data : { ... rel = 14 ; ... } - abs2 = 14 + ADDR(.data); - ... - } - - `abs' and `rel' do not have the same value; `rel' has the same - value as `abs2'. - -`BYTE(EXPRESSION)' -`SHORT(EXPRESSION)' -`LONG(EXPRESSION)' -`QUAD(EXPRESSION)' -`SQUAD(EXPRESSION)' - By including one of these four statements in a section definition, - you can explicitly place one, two, four, eight unsigned, or eight - signed bytes (respectively) at the current address of that - section. When using a 64 bit host or target, `QUAD' and `SQUAD' - are the same. When both host and target are 32 bits, `QUAD' uses - an unsigned 32 bit value, and `SQUAD' sign extends the value. - Both will use the correct endianness when writing out the value. - - Multiple-byte quantities are represented in whatever byte order is - appropriate for the output file format (*note BFD::.). - -`FILL(EXPRESSION)' - Specify the "fill pattern" for the current section. Any otherwise - unspecified regions of memory within the section (for example, - regions you skip over by assigning a new value to the location - counter `.') are filled with the two least significant bytes from - the EXPRESSION argument. A `FILL' statement covers memory - locations *after* the point it occurs in the section definition; by - including more than one `FILL' statement, you can have different - fill patterns in different parts of an output section. - - -File: ld.info, Node: Section Options, Next: Overlays, Prev: Section Data Expressions, Up: SECTIONS - -Optional Section Attributes ---------------------------- - - Here is the full syntax of a section definition, including all the -optional portions: - - SECTIONS { - ... - SECNAME START BLOCK(ALIGN) (NOLOAD) : AT ( LDADR ) - { CONTENTS } >REGION :PHDR =FILL - ... - } - - SECNAME and CONTENTS are required. *Note Section Definition::, and -*Note Section Placement::, for details on CONTENTS. The remaining -elements--START, `BLOCK(ALIGN)', `(NOLOAD)', `AT ( LDADR )', `>REGION', -`:PHDR', and `=FILL'--are all optional. - -`START' - You can force the output section to be loaded at a specified - address by specifying START immediately following the section name. - START can be represented as any expression. The following example - generates section OUTPUT at location `0x40000000': - - SECTIONS { - ... - output 0x40000000: { - ... - } - ... - } - -`BLOCK(ALIGN)' - You can include `BLOCK()' specification to advance the location - counter `.' prior to the beginning of the section, so that the - section will begin at the specified alignment. ALIGN is an - expression. - -`(NOLOAD)' - The `(NOLOAD)' directive will mark a section to not be loaded at - run time. The linker will process the section normally, but will - mark it so that a program loader will not load it into memory. - For example, in the script sample below, the `ROM' section is - addressed at memory location `0' and does not need to be loaded - when the program is run. The contents of the `ROM' section will - appear in the linker output file as usual. - - SECTIONS { - ROM 0 (NOLOAD) : { ... } - ... - } - -`AT ( LDADR )' - The expression LDADR that follows the `AT' keyword specifies the - load address of the section. The default (if you do not use the - `AT' keyword) is to make the load address the same as the - relocation address. This feature is designed to make it easy to - build a ROM image. For example, this `SECTIONS' definition - creates two output sections: one called `.text', which starts at - `0x1000', and one called `.mdata', which is loaded at the end of - the `.text' section even though its relocation address is - `0x2000'. The symbol `_data' is defined with the value `0x2000': - - SECTIONS - { - .text 0x1000 : { *(.text) _etext = . ; } - .mdata 0x2000 : - AT ( ADDR(.text) + SIZEOF ( .text ) ) - { _data = . ; *(.data); _edata = . ; } - .bss 0x3000 : - { _bstart = . ; *(.bss) *(COMMON) ; _bend = . ;} - } - - The run-time initialization code (for C programs, usually `crt0') - for use with a ROM generated this way has to include something like - the following, to copy the initialized data from the ROM image to - its runtime address: - - char *src = _etext; - char *dst = _data; - - /* ROM has data at end of text; copy it. */ - while (dst < _edata) { - *dst++ = *src++; - } - - /* Zero bss */ - for (dst = _bstart; dst< _bend; dst++) - *dst = 0; - -`>REGION' - Assign this section to a previously defined region of memory. - *Note MEMORY::. - -`:PHDR' - Assign this section to a segment described by a program header. - *Note PHDRS::. If a section is assigned to one or more segments, - then all subsequent allocated sections will be assigned to those - segments as well, unless they use an explicitly `:PHDR' modifier. - To prevent a section from being assigned to a segment when it would - normally default to one, use `:NONE'. - -`=FILL' - Including `=FILL' in a section definition specifies the initial - fill value for that section. You may use any expression to - specify FILL. Any unallocated holes in the current output section - when written to the output file will be filled with the two least - significant bytes of the value, repeated as necessary. You can - also change the fill value with a `FILL' statement in the CONTENTS - of a section definition. - - -File: ld.info, Node: Overlays, Prev: Section Options, Up: SECTIONS - -Overlays --------- - - The `OVERLAY' command provides an easy way to describe sections -which are to be loaded as part of a single memory image but are to be -run at the same memory address. At run time, some sort of overlay -manager will copy the overlaid sections in and out of the runtime memory -address as required, perhaps by simply manipulating addressing bits. -This approach can be useful, for example, when a certain region of -memory is faster than another. - - The `OVERLAY' command is used within a `SECTIONS' command. It -appears as follows: - OVERLAY START : [ NOCROSSREFS ] AT ( LDADDR ) - { - SECNAME1 { CONTENTS } :PHDR =FILL - SECNAME2 { CONTENTS } :PHDR =FILL - ... - } >REGION :PHDR =FILL - - Everything is optional except `OVERLAY' (a keyword), and each -section must have a name (SECNAME1 and SECNAME2 above). The section -definitions within the `OVERLAY' construct are identical to those -within the general `SECTIONS' contruct (*note SECTIONS::.), except that -no addresses and no memory regions may be defined for sections within -an `OVERLAY'. - - The sections are all defined with the same starting address. The -load addresses of the sections are arranged such that they are -consecutive in memory starting at the load address used for the -`OVERLAY' as a whole (as with normal section definitions, the load -address is optional, and defaults to the start address; the start -address is also optional, and defaults to `.'). - - If the `NOCROSSREFS' keyword is used, and there any references among -the sections, the linker will report an error. Since the sections all -run at the same address, it normally does not make sense for one -section to refer directly to another. *Note NOCROSSREFS: Option -Commands. - - For each section within the `OVERLAY', the linker automatically -defines two symbols. The symbol `__load_start_SECNAME' is defined as -the starting load address of the section. The symbol -`__load_stop_SECNAME' is defined as the final load address of the -section. Any characters within SECNAME which are not legal within C -identifiers are removed. C (or assembler) code may use these symbols -to move the overlaid sections around as necessary. - - At the end of the overlay, the value of `.' is set to the start -address of the overlay plus the size of the largest section. - - Here is an example. Remember that this would appear inside a -`SECTIONS' construct. - - OVERLAY 0x1000 : AT (0x4000) - { - .text0 { o1/*.o(.text) } - .text1 { o2/*.o(.text) } - } - - This will define both `.text0' and `.text1' to start at address -0x1000. `.text0' will be loaded at address 0x4000, and `.text1' will -be loaded immediately after `.text0'. The following symbols will be -defined: `__load_start_text0', `__load_stop_text0', -`__load_start_text1', `__load_stop_text1'. - - C code to copy overlay `.text1' into the overlay area might look -like the following. - - extern char __load_start_text1, __load_stop_text1; - memcpy ((char *) 0x1000, &__load_start_text1, - &__load_stop_text1 - &__load_start_text1); - - Note that the `OVERLAY' command is just syntactic sugar, since -everything it does can be done using the more basic commands. The above -example could have been written identically as follows. - - .text0 0x1000 : AT (0x4000) { o1/*.o(.text) } - __load_start_text0 = LOADADDR (.text0); - __load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0); - .text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) } - __load_start_text1 = LOADADDR (.text1); - __load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1); - . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1)); - - -File: ld.info, Node: PHDRS, Next: Entry Point, Prev: SECTIONS, Up: Commands - -ELF Program Headers -=================== - - The ELF object file format uses "program headers", which are read by -the system loader and describe how the program should be loaded into -memory. These program headers must be set correctly in order to run the -program on a native ELF system. The linker will create reasonable -program headers by default. However, in some cases, it is desirable to -specify the program headers more precisely; the `PHDRS' command may be -used for this purpose. When the `PHDRS' command is used, the linker -will not generate any program headers itself. - - The `PHDRS' command is only meaningful when generating an ELF output -file. It is ignored in other cases. This manual does not describe the -details of how the system loader interprets program headers; for more -information, see the ELF ABI. The program headers of an ELF file may -be displayed using the `-p' option of the `objdump' command. - - This is the syntax of the `PHDRS' command. The words `PHDRS', -`FILEHDR', `AT', and `FLAGS' are keywords. - - PHDRS - { - NAME TYPE [ FILEHDR ] [ PHDRS ] [ AT ( ADDRESS ) ] - [ FLAGS ( FLAGS ) ] ; - } - - The NAME is used only for reference in the `SECTIONS' command of the -linker script. It does not get put into the output file. - - Certain program header types describe segments of memory which are -loaded from the file by the system loader. In the linker script, the -contents of these segments are specified by directing allocated output -sections to be placed in the segment. To do this, the command -describing the output section in the `SECTIONS' command should use -`:NAME', where NAME is the name of the program header as it appears in -the `PHDRS' command. *Note Section Options::. - - It is normal for certain sections to appear in more than one segment. -This merely implies that one segment of memory contains another. This -is specified by repeating `:NAME', using it once for each program -header in which the section is to appear. - - If a section is placed in one or more segments using `:NAME', then -all subsequent allocated sections which do not specify `:NAME' are -placed in the same segments. This is for convenience, since generally -a whole set of contiguous sections will be placed in a single segment. -To prevent a section from being assigned to a segment when it would -normally default to one, use `:NONE'. - - The `FILEHDR' and `PHDRS' keywords which may appear after the -program header type also indicate contents of the segment of memory. -The `FILEHDR' keyword means that the segment should include the ELF -file header. The `PHDRS' keyword means that the segment should include -the ELF program headers themselves. - - The TYPE may be one of the following. The numbers indicate the -value of the keyword. - -`PT_NULL' (0) - Indicates an unused program header. - -`PT_LOAD' (1) - Indicates that this program header describes a segment to be - loaded from the file. - -`PT_DYNAMIC' (2) - Indicates a segment where dynamic linking information can be found. - -`PT_INTERP' (3) - Indicates a segment where the name of the program interpreter may - be found. - -`PT_NOTE' (4) - Indicates a segment holding note information. - -`PT_SHLIB' (5) - A reserved program header type, defined but not specified by the - ELF ABI. - -`PT_PHDR' (6) - Indicates a segment where the program headers may be found. - -EXPRESSION - An expression giving the numeric type of the program header. This - may be used for types not defined above. - - It is possible to specify that a segment should be loaded at a -particular address in memory. This is done using an `AT' expression. -This is identical to the `AT' command used in the `SECTIONS' command -(*note Section Options::.). Using the `AT' command for a program -header overrides any information in the `SECTIONS' command. - - Normally the segment flags are set based on the sections. The -`FLAGS' keyword may be used to explicitly specify the segment flags. -The value of FLAGS must be an integer. It is used to set the `p_flags' -field of the program header. - - Here is an example of the use of `PHDRS'. This shows a typical set -of program headers used on a native ELF system. - - PHDRS - { - headers PT_PHDR PHDRS ; - interp PT_INTERP ; - text PT_LOAD FILEHDR PHDRS ; - data PT_LOAD ; - dynamic PT_DYNAMIC ; - } - - SECTIONS - { - . = SIZEOF_HEADERS; - .interp : { *(.interp) } :text :interp - .text : { *(.text) } :text - .rodata : { *(.rodata) } /* defaults to :text */ - ... - . = . + 0x1000; /* move to a new page in memory */ - .data : { *(.data) } :data - .dynamic : { *(.dynamic) } :data :dynamic - ... - } - - -File: ld.info, Node: Entry Point, Next: Version Script, Prev: PHDRS, Up: Commands - -The Entry Point -=============== - - The linker command language includes a command specifically for -defining the first executable instruction in an output file (its "entry -point"). Its argument is a symbol name: - ENTRY(SYMBOL) - - Like symbol assignments, the `ENTRY' command may be placed either as -an independent command in the command file, or among the section -definitions within the `SECTIONS' command--whatever makes the most -sense for your layout. - - `ENTRY' is only one of several ways of choosing the entry point. -You may indicate it in any of the following ways (shown in descending -order of priority: methods higher in the list override methods lower -down). - * the `-e' ENTRY command-line option; - - * the `ENTRY(SYMBOL)' command in a linker control script; - - * the value of the symbol `start', if present; - - * the address of the first byte of the `.text' section, if present; - - * The address `0'. - - For example, you can use these rules to generate an entry point with -an assignment statement: if no symbol `start' is defined within your -input files, you can simply define it, assigning it an appropriate -value-- - - start = 0x2020; - -The example shows an absolute address, but you can use any expression. -For example, if your input object files use some other symbol-name -convention for the entry point, you can just assign the value of -whatever symbol contains the start address to `start': - - start = other_symbol ; - - -File: ld.info, Node: Version Script, Next: Option Commands, Prev: Entry Point, Up: Commands - -Version Script -============== - - The linker command script includes a command specifically for -specifying a version script, and is only meaningful for ELF platforms -that support shared libraries. A version script can be build directly -into the linker script that you are using, or you can supply the -version script as just another input file to the linker at the time -that you link. The command script syntax is: - VERSION { version script contents } - The version script can also be specified to the linker by means of -the `--version-script' linker command line option. Version scripts are -only meaningful when creating shared libraries. - - The format of the version script itself is identical to that used by -Sun's linker in Solaris 2.5. Versioning is done by defining a tree of -version nodes with the names and interdependencies specified in the -version script. The version script can specify which symbols are bound -to which version nodes, and it can reduce a specified set of symbols to -local scope so that they are not globally visible outside of the shared -library. - - The easiest way to demonstrate the version script language is with a -few examples. - - VERS_1.1 { - global: - foo1; - local: - old*; - original*; - new*; - }; - - VERS_1.2 { - foo2; - } VERS_1.1; - - VERS_2.0 { - bar1; bar2; - } VERS_1.2; - - In this example, three version nodes are defined. `VERS_1.1' is the -first version node defined, and has no other dependencies. The symbol -`foo1' is bound to this version node, and a number of symbols that have -appeared within various object files are reduced in scope to local so -that they are not visible outside of the shared library. - - Next, the node `VERS_1.2' is defined. It depends upon `VERS_1.1'. -The symbol `foo2' is bound to this version node. - - Finally, the node `VERS_2.0' is defined. It depends upon -`VERS_1.2'. The symbols `bar1' and `bar2' are bound to this version -node. - - Symbols defined in the library which aren't specifically bound to a -version node are effectively bound to an unspecified base version of the -library. It is possible to bind all otherwise unspecified symbols to a -given version node using `global: *' somewhere in the version script. - - Lexically the names of the version nodes have no specific meaning -other than what they might suggest to the person reading them. The -`2.0' version could just as well have appeared in between `1.1' and -`1.2'. However, this would be a confusing way to write a version -script. - - When you link an application against a shared library that has -versioned symbols, the application itself knows which version of each -symbol it requires, and it also knows which version nodes it needs from -each shared library it is linked against. Thus at runtime, the dynamic -loader can make a quick check to make sure that the libraries you have -linked against do in fact supply all of the version nodes that the -application will need to resolve all of the dynamic symbols. In this -way it is possible for the dynamic linker to know with certainty that -all external symbols that it needs will be resolvable without having to -search for each symbol reference. - - The symbol versioning is in effect a much more sophisticated way of -doing minor version checking that SunOS does. The fundamental problem -that is being addressed here is that typically references to external -functions are bound on an as-needed basis, and are not all bound when -the application starts up. If a shared library is out of date, a -required interface may be missing; when the application tries to use -that interface, it may suddenly and unexpectedly fail. With symbol -versioning, the user will get a warning when they start their program if -the libraries being used with the application are too old. - - There are several GNU extensions to Sun's versioning approach. The -first of these is the ability to bind a symbol to a version node in the -source file where the symbol is defined instead of in the versioning -script. This was done mainly to reduce the burden on the library -maintainer. This can be done by putting something like: - - __asm__(".symver original_foo,foo@VERS_1.1"); - - in the C source file. This renamed the function `original_foo' to -be an alias for `foo' bound to the version node `VERS_1.1'. The -`local:' directive can be used to prevent the symbol `original_foo' -from being exported. - - The second GNU extension is to allow multiple versions of the same -function to appear in a given shared library. In this way an -incompatible change to an interface can take place without increasing -the major version number of the shared library, while still allowing -applications linked against the old interface to continue to function. - - This can only be accomplished by using multiple `.symver' directives -in the assembler. An example of this would be: - - __asm__(".symver original_foo,foo@"); - __asm__(".symver old_foo,foo@VERS_1.1"); - __asm__(".symver old_foo1,foo@VERS_1.2"); - __asm__(".symver new_foo,foo@@VERS_2.0"); - - In this example, `foo@' represents the symbol `foo' bound to the -unspecified base version of the symbol. The source file that contains -this example would define 4 C functions: `original_foo', `old_foo', -`old_foo1', and `new_foo'. - - When you have multiple definitions of a given symbol, there needs to -be some way to specify a default version to which external references to -this symbol will be bound. This can be accomplished with the -`foo@@VERS_2.0' type of `.symver' directive. Only one version of a -symbol can be declared 'default' in this manner - otherwise you would -effectively have multiple definitions of the same symbol. - - If you wish to bind a reference to a specific version of the symbol -within the shared library, you can use the aliases of convenience (i.e. -`old_foo'), or you can use the `.symver' directive to specifically bind -to an external version of the function in question. - diff --git a/gnu/dist/ld/ld.info-3 b/gnu/dist/ld/ld.info-3 deleted file mode 100644 index da73d64aa53a..000000000000 --- a/gnu/dist/ld/ld.info-3 +++ /dev/null @@ -1,753 +0,0 @@ -This is Info file ld.info, produced by Makeinfo version 1.68 from the -input file ./ld.texinfo. - -START-INFO-DIR-ENTRY -* Ld: (ld). The GNU linker. -END-INFO-DIR-ENTRY - - This file documents the GNU linker LD. - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: ld.info, Node: Option Commands, Prev: Version Script, Up: Commands - -Option Commands -=============== - - The command language includes a number of other commands that you can -use for specialized purposes. They are similar in purpose to -command-line options. - -`CONSTRUCTORS' - When linking using the `a.out' object file format, the linker uses - an unusual set construct to support C++ global constructors and - destructors. When linking object file formats which do not support - arbitrary sections, such as `ECOFF' and `XCOFF', the linker will - automatically recognize C++ global constructors and destructors by - name. For these object file formats, the `CONSTRUCTORS' command - tells the linker where this information should be placed. The - `CONSTRUCTORS' command is ignored for other object file formats. - - The symbol `__CTOR_LIST__' marks the start of the global - constructors, and the symbol `__DTOR_LIST' marks the end. The - first word in the list is the number of entries, followed by the - address of each constructor or destructor, followed by a zero - word. The compiler must arrange to actually run the code. For - these object file formats GNU C++ calls constructors from a - subroutine `__main'; a call to `__main' is automatically inserted - into the startup code for `main'. GNU C++ runs destructors either - by using `atexit', or directly from the function `exit'. - - For object file formats such as `COFF' or `ELF' which support - multiple sections, GNU C++ will normally arrange to put the - addresses of global constructors and destructors into the `.ctors' - and `.dtors' sections. Placing the following sequence into your - linker script will build the sort of table which the GNU C++ - runtime code expects to see. - - __CTOR_LIST__ = .; - LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) - *(.ctors) - LONG(0) - __CTOR_END__ = .; - __DTOR_LIST__ = .; - LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) - *(.dtors) - LONG(0) - __DTOR_END__ = .; - - Normally the compiler and linker will handle these issues - automatically, and you will not need to concern yourself with - them. However, you may need to consider this if you are using C++ - and writing your own linker scripts. - -`FLOAT' -`NOFLOAT' - These keywords were used in some older linkers to request a - particular math subroutine library. `ld' doesn't use the - keywords, assuming instead that any necessary subroutines are in - libraries specified using the general mechanisms for linking to - archives; but to permit the use of scripts that were written for - the older linkers, the keywords `FLOAT' and `NOFLOAT' are accepted - and ignored. - -`FORCE_COMMON_ALLOCATION' - This command has the same effect as the `-d' command-line option: - to make `ld' assign space to common symbols even if a relocatable - output file is specified (`-r'). - -`INCLUDE FILENAME' - Include the linker script FILENAME at this point. The file will - be searched for in the current directory, and in any directory - specified with the `-L' option. You can nest calls to `INCLUDE' - up to 10 levels deep. - -`INPUT ( FILE, FILE, ... )' -`INPUT ( FILE FILE ... )' - Use this command to include binary input files in the link, without - including them in a particular section definition. Specify the - full name for each FILE, including `.a' if required. - - `ld' searches for each FILE through the archive-library search - path, just as for files you specify on the command line. See the - description of `-L' in *Note Command Line Options: Options. - - If you use `-lFILE', `ld' will transform the name to `libFILE.a' - as with the command line argument `-l'. - -`GROUP ( FILE, FILE, ... )' -`GROUP ( FILE FILE ... )' - This command is like `INPUT', except that the named files should - all be archives, and they are searched repeatedly until no new - undefined references are created. See the description of `-(' in - *Note Command Line Options: Options. - -`OUTPUT ( FILENAME )' - Use this command to name the link output file FILENAME. The - effect of `OUTPUT(FILENAME)' is identical to the effect of - `-o FILENAME', which overrides it. You can use this command to - supply a default output-file name other than `a.out'. - -`OUTPUT_ARCH ( BFDNAME )' - Specify a particular output machine architecture, with one of the - names used by the BFD back-end routines (*note BFD::.). This - command is often unnecessary; the architecture is most often set - implicitly by either the system BFD configuration or as a side - effect of the `OUTPUT_FORMAT' command. - -`OUTPUT_FORMAT ( BFDNAME )' - When `ld' is configured to support multiple object code formats, - you can use this command to specify a particular output format. - BFDNAME is one of the names used by the BFD back-end routines - (*note BFD::.). The effect is identical to the effect of the - `--oformat' command-line option. This selection affects only the - output file; the related command `TARGET' affects primarily input - files. - -`SEARCH_DIR ( PATH )' - Add PATH to the list of paths where `ld' looks for archive - libraries. `SEARCH_DIR(PATH)' has the same effect as `-LPATH' on - the command line. - -`STARTUP ( FILENAME )' - Ensure that FILENAME is the first input file used in the link - process. - -`TARGET ( FORMAT )' - When `ld' is configured to support multiple object code formats, - you can use this command to change the input-file object code - format (like the command-line option `-b' or its synonym - `--format'). The argument FORMAT is one of the strings used by - BFD to name binary formats. If `TARGET' is specified but - `OUTPUT_FORMAT' is not, the last `TARGET' argument is also used as - the default format for the `ld' output file. *Note BFD::. - - If you don't use the `TARGET' command, `ld' uses the value of the - environment variable `GNUTARGET', if available, to select the - output file format. If that variable is also absent, `ld' uses - the default format configured for your machine in the BFD - libraries. - -`NOCROSSREFS ( SECTION SECTION ... )' - This command may be used to tell `ld' to issue an error about any - references among certain sections. - - In certain types of programs, particularly on embedded systems, - when one section is loaded into memory, another section will not - be. Any direct references between the two sections would be - errors. For example, it would be an error if code in one section - called a function defined in the other section. - - The `NOCROSSREFS' command takes a list of section names. If `ld' - detects any cross references between the sections, it reports an - error and returns a non-zero exit status. The `NOCROSSREFS' - command uses output section names, defined in the `SECTIONS' - command. It does not use the names of input sections. - - -File: ld.info, Node: Machine Dependent, Next: BFD, Prev: Commands, Up: Top - -Machine Dependent Features -************************** - - `ld' has additional features on some platforms; the following -sections describe them. Machines where `ld' has no additional -functionality are not listed. - -* Menu: - -* H8/300:: `ld' and the H8/300 -* i960:: `ld' and the Intel 960 family - - -File: ld.info, Node: H8/300, Next: i960, Up: Machine Dependent - -`ld' and the H8/300 -=================== - - For the H8/300, `ld' can perform these global optimizations when you -specify the `--relax' command-line option. - -*relaxing address modes* - `ld' finds all `jsr' and `jmp' instructions whose targets are - within eight bits, and turns them into eight-bit program-counter - relative `bsr' and `bra' instructions, respectively. - -*synthesizing instructions* - `ld' finds all `mov.b' instructions which use the sixteen-bit - absolute address form, but refer to the top page of memory, and - changes them to use the eight-bit address form. (That is: the - linker turns `mov.b `@'AA:16' into `mov.b `@'AA:8' whenever the - address AA is in the top page of memory). - - -File: ld.info, Node: i960, Prev: H8/300, Up: Machine Dependent - -`ld' and the Intel 960 family -============================= - - You can use the `-AARCHITECTURE' command line option to specify one -of the two-letter names identifying members of the 960 family; the -option specifies the desired output target, and warns of any -incompatible instructions in the input files. It also modifies the -linker's search strategy for archive libraries, to support the use of -libraries specific to each particular architecture, by including in the -search loop names suffixed with the string identifying the architecture. - - For example, if your `ld' command line included `-ACA' as well as -`-ltry', the linker would look (in its built-in search paths, and in -any paths you specify with `-L') for a library with the names - - try - libtry.a - tryca - libtryca.a - -The first two possibilities would be considered in any event; the last -two are due to the use of `-ACA'. - - You can meaningfully use `-A' more than once on a command line, since -the 960 architecture family allows combination of target architectures; -each use will add another pair of name variants to search for when `-l' -specifies a library. - - `ld' supports the `--relax' option for the i960 family. If you -specify `--relax', `ld' finds all `balx' and `calx' instructions whose -targets are within 24 bits, and turns them into 24-bit program-counter -relative `bal' and `cal' instructions, respectively. `ld' also turns -`cal' instructions into `bal' instructions when it determines that the -target subroutine is a leaf routine (that is, the target subroutine does -not itself call any subroutines). - - -File: ld.info, Node: BFD, Next: Reporting Bugs, Prev: Machine Dependent, Up: Top - -BFD -*** - - The linker accesses object and archive files using the BFD libraries. -These libraries allow the linker to use the same routines to operate on -object files whatever the object file format. A different object file -format can be supported simply by creating a new BFD back end and adding -it to the library. To conserve runtime memory, however, the linker and -associated tools are usually configured to support only a subset of the -object file formats available. You can use `objdump -i' (*note -objdump: (binutils.info)objdump.) to list all the formats available for -your configuration. - - As with most implementations, BFD is a compromise between several -conflicting requirements. The major factor influencing BFD design was -efficiency: any time used converting between formats is time which -would not have been spent had BFD not been involved. This is partly -offset by abstraction payback; since BFD simplifies applications and -back ends, more time and care may be spent optimizing algorithms for a -greater speed. - - One minor artifact of the BFD solution which you should bear in mind -is the potential for information loss. There are two places where -useful information can be lost using the BFD mechanism: during -conversion and during output. *Note BFD information loss::. - -* Menu: - -* BFD outline:: How it works: an outline of BFD - - -File: ld.info, Node: BFD outline, Up: BFD - -How it works: an outline of BFD -=============================== - - When an object file is opened, BFD subroutines automatically -determine the format of the input object file. They then build a -descriptor in memory with pointers to routines that will be used to -access elements of the object file's data structures. - - As different information from the the object files is required, BFD -reads from different sections of the file and processes them. For -example, a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting between -the object file's representation of symbols and an internal canonical -format. When the linker asks for the symbol table of an object file, it -calls through a memory pointer to the routine from the relevant BFD -back end which reads and converts the table into a canonical form. The -linker then operates upon the canonical form. When the link is finished -and the linker writes the output file's symbol table, another BFD back -end routine is called to take the newly created symbol table and -convert it into the chosen output format. - -* Menu: - -* BFD information loss:: Information Loss -* Canonical format:: The BFD canonical object-file format - - -File: ld.info, Node: BFD information loss, Next: Canonical format, Up: BFD outline - -Information Loss ----------------- - - *Information can be lost during output.* The output formats -supported by BFD do not provide identical facilities, and information -which can be described in one form has nowhere to go in another format. -One example of this is alignment information in `b.out'. There is -nowhere in an `a.out' format file to store alignment information on the -contained data, so when a file is linked from `b.out' and an `a.out' -image is produced, alignment information will not propagate to the -output file. (The linker will still use the alignment information -internally, so the link is performed correctly). - - Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections -(e.g., `a.out') or has sections without names (e.g., the Oasys format), -the link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker -command language. - - *Information can be lost during canonicalization.* The BFD internal -canonical form of the external formats is not exhaustive; there are -structures in input formats for which there is no direct representation -internally. This means that the BFD back ends cannot maintain all -possible data richness through the transformation between external to -internal and back to external formats. - - This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD canonical -form has structures which are opaque to the BFD core, and exported only -to the back ends. When a file is read in one format, the canonical form -is generated for BFD and the application. At the same time, the back -end saves away any information which may otherwise be lost. If the data -is then written back in the same format, the back end routine will be -able to use the canonical form provided by the BFD core as well as the -information it prepared earlier. Since there is a great deal of -commonality between back ends, there is no information lost when -linking or copying big endian COFF to little endian COFF, or `a.out' to -`b.out'. When a mixture of formats is linked, the information is only -lost from the files whose format differs from the destination. - - -File: ld.info, Node: Canonical format, Prev: BFD information loss, Up: BFD outline - -The BFD canonical object-file format ------------------------------------- - - The greatest potential for loss of information occurs when there is -the least overlap between the information provided by the source -format, that stored by the canonical format, and that needed by the -destination format. A brief description of the canonical form may help -you understand which kinds of data you can count on preserving across -conversions. - -*files* - Information stored on a per-file basis includes target machine - architecture, particular implementation format type, a demand - pageable bit, and a write protected bit. Information like Unix - magic numbers is not stored here--only the magic numbers' meaning, - so a `ZMAGIC' file would have both the demand pageable bit and the - write protected text bit set. The byte order of the target is - stored on a per-file basis, so that big- and little-endian object - files may be used with one another. - -*sections* - Each section in the input file contains the name of the section, - the section's original address in the object file, size and - alignment information, various flags, and pointers into other BFD - data structures. - -*symbols* - Each symbol contains a pointer to the information for the object - file which originally defined it, its name, its value, and various - flag bits. When a BFD back end reads in a symbol table, it - relocates all symbols to make them relative to the base of the - section where they were defined. Doing this ensures that each - symbol points to its containing section. Each symbol also has a - varying amount of hidden private data for the BFD back end. Since - the symbol points to the original file, the private data format - for that symbol is accessible. `ld' can operate on a collection - of symbols of wildly different formats without problems. - - Normal global and simple local symbols are maintained on output, - so an output file (no matter its format) will retain symbols - pointing to functions and to global, static, and common variables. - Some symbol information is not worth retaining; in `a.out', type - information is stored in the symbol table as long symbol names. - This information would be useless to most COFF debuggers; the - linker has command line switches to allow users to throw it away. - - There is one word of type information within the symbol, so if the - format supports symbol type information within symbols (for - example, COFF, IEEE, Oasys) and the type is simple enough to fit - within one word (nearly everything but aggregates), the - information will be preserved. - -*relocation level* - Each canonical BFD relocation record contains a pointer to the - symbol to relocate to, the offset of the data to relocate, the - section the data is in, and a pointer to a relocation type - descriptor. Relocation is performed by passing messages through - the relocation type descriptor and the symbol pointer. Therefore, - relocations can be performed on output data using a relocation - method that is only available in one of the input formats. For - instance, Oasys provides a byte relocation format. A relocation - record requesting this relocation type would point indirectly to a - routine to perform this, so the relocation may be performed on a - byte being written to a 68k COFF file, even though 68k COFF has no - such relocation type. - -*line numbers* - Object formats can contain, for debugging purposes, some form of - mapping between symbols, source line numbers, and addresses in the - output file. These addresses have to be relocated along with the - symbol information. Each symbol with an associated list of line - number records points to the first record of the list. The head - of a line number list consists of a pointer to the symbol, which - allows finding out the address of the function whose line number - is being described. The rest of the list is made up of pairs: - offsets into the section and line numbers. Any format which can - simply derive this information can pass it successfully between - formats (COFF, IEEE and Oasys). - - -File: ld.info, Node: Reporting Bugs, Next: MRI, Prev: BFD, Up: Top - -Reporting Bugs -************** - - Your bug reports play an essential role in making `ld' reliable. - - Reporting a bug may help you by bringing a solution to your problem, -or it may not. But in any case the principal function of a bug report -is to help the entire community by making the next version of `ld' work -better. Bug reports are your contribution to the maintenance of `ld'. - - In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -* Menu: - -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs - - -File: ld.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -Have you found a bug? -===================== - - If you are not sure whether you have found a bug, here are some -guidelines: - - * If the linker gets a fatal signal, for any input whatever, that is - a `ld' bug. Reliable linkers never crash. - - * If `ld' produces an error message for valid input, that is a bug. - - * If `ld' does not produce an error message for invalid input, that - may be a bug. In the general case, the linker can not verify that - object files are correct. - - * If you are an experienced user of linkers, your suggestions for - improvement of `ld' are welcome in any case. - - -File: ld.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -How to report bugs -================== - - A number of companies and individuals offer support for GNU -products. If you obtained `ld' from a support organization, we -recommend you contact that organization first. - - You can find contact information for many support companies and -individuals in the file `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for `ld' -to `bug-gnu-utils@gnu.org'. - - The fundamental principle of reporting bugs usefully is this: -*report all the facts*. If you are not sure whether to state a fact or -leave it out, state it! - - Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a symbol you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug is -a stray memory reference which happens to fetch from the location where -that name is stored in memory; perhaps, if the name were different, the -contents of that location would fool the linker into doing the right -thing despite the bug. Play it safe and give a specific, complete -example. That is the easiest thing for you to do, and the most helpful. - - Keep in mind that the purpose of a bug report is to enable us to fix -the bug if it is new to us. Therefore, always write your bug reports -on the assumption that the bug has not been reported previously. - - Sometimes people give a few sketchy facts and ask, "Does this ring a -bell?" Those bug reports are useless, and we urge everyone to *refuse -to respond to them* except to chide the sender to report bugs properly. - - To enable us to fix the bug, you should include all these things: - - * The version of `ld'. `ld' announces it if you start it with the - `--version' argument. - - Without this, we will not know whether there is any point in - looking for the bug in the current version of `ld'. - - * Any patches you may have applied to the `ld' source, including any - patches made to the `BFD' library. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile `ld'--e.g. - "`gcc-2.7'". - - * The command arguments you gave the linker to link your example and - observe the bug. To guarantee you will not omit something - important, list them all. A copy of the Makefile (or the output - from make) is sufficient. - - If we were to try to guess the arguments, we would probably guess - wrong and then we might not encounter the bug. - - * A complete input file, or set of input files, that will reproduce - the bug. It is generally most helpful to send the actual object - files, uuencoded if necessary to get them through the mail system. - Making them available for anonymous FTP is not as good, but may - be the only reasonable choice for large object files. - - If the source files were assembled using `gas' or compiled using - `gcc', then it may be OK to send the source files rather than the - object files. In this case, be sure to say exactly what version of - `gas' or `gcc' was used to produce the object files. Also say how - `gas' or `gcc' were configured. - - * A description of what behavior you observe that you believe is - incorrect. For example, "It gets a fatal signal." - - Of course, if the bug is that `ld' gets a fatal signal, then we - will certainly notice it. But if the bug is incorrect output, we - might not notice unless it is glaringly wrong. You might as well - not give us a chance to make a mistake. - - Even if the problem you experience is a fatal signal, you should - still say so explicitly. Suppose something strange is going on, - such as, your copy of `ld' is out of synch, or you have - encountered a bug in the C library on your system. (This has - happened!) Your copy might crash and ours would not. If you told - us to expect a crash, then when ours fails to crash, we would know - that the bug was not happening for us. If you had not told us to - expect a crash, then we would not be able to draw any conclusion - from our observations. - - * If you wish to suggest changes to the `ld' source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you even - discuss something in the `ld' source, refer to it by context, not - by line number. - - The line numbers in our development sources will not match those - in your sources. Your line numbers would convey no useful - information to us. - - Here are some things that are not necessary: - - * A description of the envelope of the bug. - - Often people who encounter a bug spend a lot of time investigating - which changes to the input file will make the bug go away and which - changes will not affect it. - - This is often time consuming and not very useful, because the way - we will find the bug is by running a single example under the - debugger with breakpoints, not by pure deduction from a series of - examples. We recommend that you save your time for something else. - - Of course, if you can find a simpler example to report *instead* - of the original one, that is a convenience for us. Errors in the - output will be easier to spot, running under the debugger will take - less time, and so on. - - However, simplification is not vital; if you do not want to do - this, report the bug anyway and send us the entire test case you - used. - - * A patch for the bug. - - A patch for the bug does help us if it is a good one. But do not - omit the necessary information, such as the test case, on the - assumption that a patch is all we need. We might see problems - with your patch and decide to fix the problem another way, or we - might not understand it at all. - - Sometimes with a program as complicated as `ld' it is very hard to - construct an example that will make the program follow a certain - path through the code. If you do not send us the example, we will - not be able to construct one, so we will not be able to verify - that the bug is fixed. - - And if we cannot understand what bug you are trying to fix, or why - your patch should be an improvement, we will not install it. A - test case will help us to understand. - - * A guess about what the bug is or what it depends on. - - Such guesses are usually wrong. Even we cannot guess right about - such things without first using the debugger to find the facts. - - -File: ld.info, Node: MRI, Next: Index, Prev: Reporting Bugs, Up: Top - -MRI Compatible Script Files -*************************** - - To aid users making the transition to GNU `ld' from the MRI linker, -`ld' can use MRI compatible linker scripts as an alternative to the -more general-purpose linker scripting language described in *Note -Command Language: Commands. MRI compatible linker scripts have a much -simpler command set than the scripting language otherwise used with -`ld'. GNU `ld' supports the most commonly used MRI linker commands; -these commands are described here. - - In general, MRI scripts aren't of much use with the `a.out' object -file format, since it only has three sections and MRI scripts lack some -features to make use of them. - - You can specify a file containing an MRI-compatible script using the -`-c' command-line option. - - Each command in an MRI-compatible script occupies its own line; each -command line starts with the keyword that identifies the command (though -blank lines are also allowed for punctuation). If a line of an -MRI-compatible script begins with an unrecognized keyword, `ld' issues -a warning message, but continues processing the script. - - Lines beginning with `*' are comments. - - You can write these commands using all upper-case letters, or all -lower case; for example, `chip' is the same as `CHIP'. The following -list shows only the upper-case form of each command. - -`ABSOLUTE SECNAME' -`ABSOLUTE SECNAME, SECNAME, ... SECNAME' - Normally, `ld' includes in the output file all sections from all - the input files. However, in an MRI-compatible script, you can - use the `ABSOLUTE' command to restrict the sections that will be - present in your output program. If the `ABSOLUTE' command is used - at all in a script, then only the sections named explicitly in - `ABSOLUTE' commands will appear in the linker output. You can - still use other input sections (whatever you select on the command - line, or using `LOAD') to resolve addresses in the output file. - -`ALIAS OUT-SECNAME, IN-SECNAME' - Use this command to place the data from input section IN-SECNAME - in a section called OUT-SECNAME in the linker output file. - - IN-SECNAME may be an integer. - -`ALIGN SECNAME = EXPRESSION' - Align the section called SECNAME to EXPRESSION. The EXPRESSION - should be a power of two. - -`BASE EXPRESSION' - Use the value of EXPRESSION as the lowest address (other than - absolute addresses) in the output file. - -`CHIP EXPRESSION' -`CHIP EXPRESSION, EXPRESSION' - This command does nothing; it is accepted only for compatibility. - -`END' - This command does nothing whatever; it's only accepted for - compatibility. - -`FORMAT OUTPUT-FORMAT' - Similar to the `OUTPUT_FORMAT' command in the more general linker - language, but restricted to one of these output formats: - - 1. S-records, if OUTPUT-FORMAT is `S' - - 2. IEEE, if OUTPUT-FORMAT is `IEEE' - - 3. COFF (the `coff-m68k' variant in BFD), if OUTPUT-FORMAT is - `COFF' - -`LIST ANYTHING...' - Print (to the standard output file) a link map, as produced by the - `ld' command-line option `-M'. - - The keyword `LIST' may be followed by anything on the same line, - with no change in its effect. - -`LOAD FILENAME' -`LOAD FILENAME, FILENAME, ... FILENAME' - Include one or more object file FILENAME in the link; this has the - same effect as specifying FILENAME directly on the `ld' command - line. - -`NAME OUTPUT-NAME' - OUTPUT-NAME is the name for the program produced by `ld'; the - MRI-compatible command `NAME' is equivalent to the command-line - option `-o' or the general script language command `OUTPUT'. - -`ORDER SECNAME, SECNAME, ... SECNAME' -`ORDER SECNAME SECNAME SECNAME' - Normally, `ld' orders the sections in its output file in the order - in which they first appear in the input files. In an - MRI-compatible script, you can override this ordering with the - `ORDER' command. The sections you list with `ORDER' will appear - first in your output file, in the order specified. - -`PUBLIC NAME=EXPRESSION' -`PUBLIC NAME,EXPRESSION' -`PUBLIC NAME EXPRESSION' - Supply a value (EXPRESSION) for external symbol NAME used in the - linker input files. - -`SECT SECNAME, EXPRESSION' -`SECT SECNAME=EXPRESSION' -`SECT SECNAME EXPRESSION' - You can use any of these three forms of the `SECT' command to - specify the start address (EXPRESSION) for section SECNAME. If - you have more than one `SECT' statement for the same SECNAME, only - the *first* sets the start address. - diff --git a/gnu/dist/ld/ld.info-4 b/gnu/dist/ld/ld.info-4 deleted file mode 100644 index 5690611506c9..000000000000 --- a/gnu/dist/ld/ld.info-4 +++ /dev/null @@ -1,432 +0,0 @@ -This is Info file ld.info, produced by Makeinfo version 1.68 from the -input file ./ld.texinfo. - -START-INFO-DIR-ENTRY -* Ld: (ld). The GNU linker. -END-INFO-DIR-ENTRY - - This file documents the GNU linker LD. - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software -Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. - - -File: ld.info, Node: Index, Prev: MRI, Up: Top - -Index -***** - -* Menu: - -* ": Symbols. -* *( COMMON ): Section Placement. -* *(SECTION): Section Placement. -* -(: Options. -* --relax on i960: i960. -* -AARCH: Options. -* -aKEYWORD: Options. -* -architecture=ARCH: Options. -* -assert KEYWORD: Options. -* -auxiliary: Options. -* -b FORMAT: Options. -* -Bdynamic: Options. -* -Bshareable: Options. -* -Bstatic: Options. -* -Bsymbolic: Options. -* -c MRI-CMDFILE: Options. -* -call_shared: Options. -* -cref: Options. -* -d: Options. -* -dc: Options. -* -defsym SYMBOL=EXP: Options. -* -discard-all: Options. -* -discard-locals: Options. -* -dn: Options. -* -dp: Options. -* -dy: Options. -* -dynamic-linker FILE: Options. -* -E: Options. -* -e ENTRY: Options. -* -EB: Options. -* -EL: Options. -* -embedded-relocs: Options. -* -entry=ENTRY: Options. -* -export-dynamic: Options. -* -f: Options. -* -F: Options. -* -filter: Options. -* -force-exe-suffix: Options. -* -format=FORMAT: Options. -* -g: Options. -* -G: Options. -* -gpsize: Options. -* -help: Options. -* -hNAME: Options. -* -i: Options. -* -just-symbols=FILE: Options. -* -lARCHIVE: Options. -* -LDIR: Options. -* -library-path=DIR: Options. -* -library=ARCHIVE: Options. -* -M: Options. -* -m EMULATION: Options. -* -Map: Options. -* -mri-script=MRI-CMDFILE: Options. -* -N: Options. -* -n: Options. -* -nmagic: Options. -* -no-keep-memory: Options. -* -no-warn-mismatch: Options. -* -no-whole-archive: Options. -* -noinhibit-exec: Options. -* -non_shared: Options. -* -o OUTPUT: Options. -* -oformat: Options. -* -omagic: Options. -* -output=OUTPUT: Options. -* -print-map: Options. -* -qmagic: Options. -* -Qy: Options. -* -r: Options. -* -R FILE: Options. -* -relax: Options. -* -relocateable: Options. -* -rpath: Options. -* -rpath-link: Options. -* -S: Options. -* -s: Options. -* -script=SCRIPT: Options. -* -shared: Options. -* -soname=NAME: Options. -* -sort-common: Options. -* -split-by-file: Options. -* -split-by-reloc: Options. -* -static: Options. -* -stats: Options. -* -strip-all: Options. -* -strip-debug: Options. -* -t: Options. -* -T SCRIPT: Options. -* -Tbss ORG: Options. -* -Tdata ORG: Options. -* -trace: Options. -* -trace-symbol=SYMBOL: Options. -* -traditional-format: Options. -* -Ttext ORG: Options. -* -u SYMBOL: Options. -* -undefined=SYMBOL: Options. -* -Ur: Options. -* -v: Options. -* -V: Options. -* -verbose: Options. -* -version: Options. -* -version-script=VERSION-SCRIPTFILE: Options. -* -warn-comon: Options. -* -warn-constructors: Options. -* -warn-multiple-gp: Options. -* -warn-once: Options. -* -warn-section-align: Options. -* -whole-archive: Options. -* -wrap: Options. -* -X: Options. -* -x: Options. -* -Y PATH: Options. -* -y SYMBOL: Options. -* -z KEYWORD: Options. -* .: Location Counter. -* 0x: Integers. -* :PHDR: Section Options. -* ;: Assignment. -* =FILL: Section Options. -* >REGION: Section Options. -* [SECTION...], not supported: Section Placement. -* ABSOLUTE (MRI): MRI. -* absolute and relocatable symbols: Assignment. -* ABSOLUTE(EXP): Arithmetic Functions. -* ADDR(SECTION): Arithmetic Functions. -* ALIAS (MRI): MRI. -* ALIGN (MRI): MRI. -* ALIGN(EXP): Arithmetic Functions. -* aligning sections: Section Options. -* allocating memory: MEMORY. -* architectures: Options. -* archive files, from cmd line: Options. -* arithmetic: Expressions. -* arithmetic operators: Operators. -* assignment in scripts: Assignment. -* assignment, in section defn: Section Data Expressions. -* AT ( LDADR ): Section Options. -* back end: BFD. -* BASE (MRI): MRI. -* BFD canonical format: Canonical format. -* BFD requirements: BFD. -* big-endian objects: Options. -* binary input files: Option Commands. -* binary input format: Options. -* BLOCK(ALIGN): Section Options. -* bug criteria: Bug Criteria. -* bug reports: Bug Reporting. -* bugs in ld: Reporting Bugs. -* BYTE(EXPRESSION): Section Data Expressions. -* C++ constructors, arranging in link: Option Commands. -* CHIP (MRI): MRI. -* combining symbols, warnings on: Options. -* command files: Commands. -* command line: Options. -* commands, fundamental: Scripts. -* comments: Scripts. -* common allocation <1>: Options. -* common allocation: Option Commands. -* commons in output: Section Placement. -* compatibility, MRI: Options. -* constructors: Options. -* CONSTRUCTORS: Option Commands. -* constructors, arranging in link: Option Commands. -* contents of a section: Section Placement. -* crash of linker: Bug Criteria. -* CREATE_OBJECT_SYMBOLS: Section Data Expressions. -* cross reference table: Options. -* cross references: Option Commands. -* current output location: Location Counter. -* dbx: Options. -* decimal integers: Integers. -* default emulation: Environment. -* default input format: Environment. -* DEFINED(SYMBOL): Arithmetic Functions. -* deleting local symbols: Options. -* direct output: Section Data Expressions. -* discontinuous memory: MEMORY. -* dot: Location Counter. -* dynamic linker, from command line: Options. -* dynamic symbol table: Options. -* ELF program headers: PHDRS. -* emulation: Options. -* emulation, default: Environment. -* END (MRI): MRI. -* endianness: Options. -* entry point, defaults: Entry Point. -* entry point, from command line: Options. -* ENTRY(SYMBOL): Entry Point. -* error on valid input: Bug Criteria. -* expression evaluation order: Evaluation. -* expression syntax: Expressions. -* expression, absolute: Arithmetic Functions. -* expressions in a section: Section Data Expressions. -* fatal signal: Bug Criteria. -* FILENAME: Section Placement. -* filename symbols: Section Data Expressions. -* FILENAME(SECTION): Section Placement. -* files and sections, section defn: Section Placement. -* files, including in output sections: Section Placement. -* fill pattern, entire section: Section Options. -* FILL(EXPRESSION): Section Data Expressions. -* first input file: Option Commands. -* first instruction: Entry Point. -* FLOAT: Option Commands. -* FORCE_COMMON_ALLOCATION: Option Commands. -* FORMAT (MRI): MRI. -* format, output file: Option Commands. -* functions in expression language: Arithmetic Functions. -* fundamental script commands: Scripts. -* GNU linker: Overview. -* GNUTARGET <1>: Option Commands. -* GNUTARGET: Environment. -* GROUP ( FILES ): Option Commands. -* grouping input files: Option Commands. -* groups of archives: Options. -* H8/300 support: H8/300. -* header size: Arithmetic Functions. -* help: Options. -* hexadecimal integers: Integers. -* holes: Location Counter. -* holes, filling: Section Data Expressions. -* i960 support: i960. -* INCLUDE FILENAME: Option Commands. -* including a linker script: Option Commands. -* including an entire archive: Options. -* incremental link: Options. -* INPUT ( FILES ): Option Commands. -* input file format: Option Commands. -* input filename symbols: Section Data Expressions. -* input files, displaying: Options. -* input files, section defn: Section Placement. -* input format: Options. -* input sections to output section: Section Placement. -* integer notation: Integers. -* integer suffixes: Integers. -* internal object-file format: Canonical format. -* invalid input: Bug Criteria. -* K and M integer suffixes: Integers. -* l =: MEMORY. -* L, deleting symbols beginning: Options. -* layout of output file: Scripts. -* lazy evaluation: Evaluation. -* ld bugs, reporting: Bug Reporting. -* LDEMULATION: Environment. -* len =: MEMORY. -* LENGTH =: MEMORY. -* link map: Options. -* link-time runtime library search path: Options. -* linker crash: Bug Criteria. -* LIST (MRI): MRI. -* little-endian objects: Options. -* LOAD (MRI): MRI. -* load address, specifying: Section Options. -* LOADADDR(SECTION): Arithmetic Functions. -* loading, preventing: Section Options. -* local symbols, deleting: Options. -* location counter: Location Counter. -* LONG(EXPRESSION): Section Data Expressions. -* M and K integer suffixes: Integers. -* machine architecture, output: Option Commands. -* machine dependencies: Machine Dependent. -* MAX: Arithmetic Functions. -* MEMORY: MEMORY. -* memory region attributes: MEMORY. -* memory regions and sections: Section Options. -* memory usage: Options. -* MIN: Arithmetic Functions. -* MIPS embedded PIC code: Options. -* MRI compatibility: MRI. -* NAME (MRI): MRI. -* names: Symbols. -* naming memory regions: MEMORY. -* naming output sections: Section Definition. -* naming the output file <1>: Options. -* naming the output file: Option Commands. -* negative integers: Integers. -* NEXT(EXP): Arithmetic Functions. -* NMAGIC: Options. -* NOCROSSREFS ( SECTIONS ): Option Commands. -* NOFLOAT: Option Commands. -* NOLOAD: Section Options. -* Non constant expression: Assignment. -* o =: MEMORY. -* objdump -i: BFD. -* object file management: BFD. -* object files: Options. -* object formats available: BFD. -* object size: Options. -* octal integers: Integers. -* OMAGIC: Options. -* opening object files: BFD outline. -* Operators for arithmetic: Operators. -* options: Options. -* ORDER (MRI): MRI. -* org =: MEMORY. -* ORIGIN =: MEMORY. -* OUTPUT ( FILENAME ): Option Commands. -* output file after errors: Options. -* output file layout: Scripts. -* OUTPUT_ARCH ( BFDNAME ): Option Commands. -* OUTPUT_FORMAT ( BFDNAME ): Option Commands. -* OVERLAY: Overlays. -* overlays: Overlays. -* partial link: Options. -* path for libraries: Option Commands. -* PHDRS: PHDRS. -* precedence in expressions: Operators. -* prevent unnecessary loading: Section Options. -* program headers: PHDRS. -* program headers and sections: Section Options. -* provide: Assignment. -* PUBLIC (MRI): MRI. -* QUAD(EXPRESSION): Section Data Expressions. -* quoted symbol names: Symbols. -* read-only text: Options. -* read/write from cmd line: Options. -* regions of memory: MEMORY. -* relaxing addressing modes: Options. -* relaxing on H8/300: H8/300. -* relaxing on i960: i960. -* relocatable and absolute symbols: Assignment. -* relocatable output: Options. -* reporting bugs in ld: Reporting Bugs. -* requirements for BFD: BFD. -* retaining specified symbols: Options. -* rounding up location counter: Arithmetic Functions. -* runtime library name: Options. -* runtime library search path: Options. -* scaled integers: Integers. -* script files: Options. -* search directory, from cmd line: Options. -* search path, libraries: Option Commands. -* SEARCH_DIR ( PATH ): Option Commands. -* SECT (MRI): MRI. -* section address <1>: Section Options. -* section address: Arithmetic Functions. -* section alignment: Section Options. -* section alignment, warnings on: Options. -* section definition: Section Definition. -* section defn, full syntax: Section Options. -* section fill pattern: Section Options. -* section load address: Arithmetic Functions. -* section size: Arithmetic Functions. -* section start: Section Options. -* section, assigning to memory region: Section Options. -* section, assigning to program header: Section Options. -* SECTIONS: SECTIONS. -* segment origins, cmd line: Options. -* semicolon: Assignment. -* shared libraries: Options. -* SHORT(EXPRESSION): Section Data Expressions. -* SIZEOF(SECTION): Arithmetic Functions. -* SIZEOF_HEADERS: Arithmetic Functions. -* sizeof_headers: Arithmetic Functions. -* specify load address: Section Options. -* SQUAD(EXPRESSION): Section Data Expressions. -* standard Unix system: Options. -* start address, section: Section Options. -* start of execution: Entry Point. -* STARTUP ( FILENAME ): Option Commands. -* strip all symbols: Options. -* strip debugger symbols: Options. -* stripping all but some symbols: Options. -* suffixes for integers: Integers. -* SYMBOL = EXPRESSION ;: Section Data Expressions. -* symbol defaults: Arithmetic Functions. -* symbol definition, scripts: Assignment. -* SYMBOL F= EXPRESSION ;: Section Data Expressions. -* symbol names: Symbols. -* symbol tracing: Options. -* symbol versions: Version Script. -* symbol-only input: Options. -* symbols, from command line: Options. -* symbols, relocatable and absolute: Assignment. -* symbols, retaining selectively: Options. -* synthesizing linker: Options. -* synthesizing on H8/300: H8/300. -* TARGET ( FORMAT ): Option Commands. -* traditional format: Options. -* unallocated address, next: Arithmetic Functions. -* undefined symbol: Options. -* undefined symbols, warnings on: Options. -* uninitialized data: Section Placement. -* unspecified memory: Section Data Expressions. -* usage: Options. -* variables, defining: Assignment. -* verbose: Options. -* version: Options. -* version script: Version Script. -* version script, symbol versions: Options. -* VERSION {script text}: Version Script. -* versions of symbols: Version Script. -* warnings, on combining symbols: Options. -* warnings, on section alignment: Options. -* warnings, on undefined symbols: Options. -* what is this?: Overview. - - diff --git a/gnu/dist/ld/mpw-config.in b/gnu/dist/ld/mpw-config.in deleted file mode 100644 index b2542cc612c6..000000000000 --- a/gnu/dist/ld/mpw-config.in +++ /dev/null @@ -1,52 +0,0 @@ -# Configuration fragment for LD. - -If "{target_canonical}" =~ /m68k-apple-macos/ - Set emulname m68kcoff - forward-include "{srcdir}"mpw-em68kcoff.c em68kcoff.c - Set emulation_ofiles "{o}"em68kcoff.c.o - -Else If "{target_canonical}" =~ /powerpc-apple-macos/ - Set emulname ppcmacos - forward-include "{srcdir}"mpw-eppcmac.c eppcmacos.c - Set emulation_ofiles "{o}"eppcmacos.c.o - -Else If "{target_canonical}" =~ /i386-\Option-x-go32/ - Set emulname i386go32 - forward-include "{srcdir}"mpw-ei386go32.c ei386go32.c - Set emulation_ofiles "{o}"ei386go32.c.o - -Else If "{target_canonical}" =~ /mips-\Option-x-ecoff/ - Set emulname mipsidt - forward-include "{srcdir}"mpw-idtmips.c emipsidt.c - Set emulation_ofiles "{o}"emipsidt.c.o - -Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/ - Set emulname elf32ebmip - forward-include "{srcdir}"mpw-elfmips.c eelf32ebmip.c - Set emulation_ofiles "{o}"eelf32ebmip.c.o - -Else If "{target_canonical}" =~ /sh-\Option-x-hms/ - Set emulname sh - forward-include "{srcdir}"mpw-esh.c esh.c - Set emulation_ofiles "{o}"esh.c.o -End If - -Echo '/* This file is automatically generated. DO NOT EDIT! */' > "{o}"ldemul-tmp.h -Echo "extern ld_emulation_xfer_type ld_{emulname}_emulation;" >> "{o}"ldemul-tmp.h -Echo '#define EMULATION_LIST \' >> "{o}"ldemul-tmp.h -Echo " &ld_{emulname}_emulation, \" >> "{o}"ldemul-tmp.h -Echo ' 0' >> "{o}"ldemul-tmp.h - -MoveIfChange "{o}"ldemul-tmp.h "{o}"ldemul-list.h - -Echo '# From mpw-config.in' > "{o}"mk.tmp -Echo "EMUL = " {emulname} >> "{o}"mk.tmp -Echo "EMULATION_OFILES = " {emulation_ofiles} >> "{o}"mk.tmp -Echo 'version = ' `Search 'ld version ' {srcdir}ldver.c | sed -e 's/.*ld version \([^ ]*\).*/\1/'` >> "{o}"mk.tmp -Echo "TDEFINES = " >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new -Echo '#include "mpw.h"' >> "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h diff --git a/gnu/dist/ld/mpw-elfmips.c b/gnu/dist/ld/mpw-elfmips.c deleted file mode 100644 index ec88bb7493ee..000000000000 --- a/gnu/dist/ld/mpw-elfmips.c +++ /dev/null @@ -1,1470 +0,0 @@ -/* This file is is generated by a shell script. DO NOT EDIT! */ - -/* 32 bit ELF emulation code for elf32ebmip - Copyright (C) 1991, 93, 94, 95, 1996 Free Software Foundation, Inc. - Written by Steve Chamberlain - ELF support by Ian Lance Taylor - -This file is part of GLD, the Gnu Linker. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define TARGET_IS_elf32ebmip - -#include "bfd.h" -#include "sysdep.h" - -#include - -#include "bfdlink.h" - -#include "ld.h" -#include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" -#include "ldmisc.h" -#include "ldexp.h" -#include "ldlang.h" -#include "ldgram.h" - -static void gldelf32ebmip_before_parse PARAMS ((void)); -static boolean gldelf32ebmip_open_dynamic_archive - PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static void gldelf32ebmip_after_open PARAMS ((void)); -static void gldelf32ebmip_check_needed - PARAMS ((lang_input_statement_type *)); -static void gldelf32ebmip_stat_needed - PARAMS ((lang_input_statement_type *)); -static boolean gldelf32ebmip_search_needed - PARAMS ((const char *, const char *)); -static boolean gldelf32ebmip_try_needed PARAMS ((const char *)); -static void gldelf32ebmip_before_allocation PARAMS ((void)); -static void gldelf32ebmip_find_statement_assignment - PARAMS ((lang_statement_union_type *)); -static void gldelf32ebmip_find_exp_assignment PARAMS ((etree_type *)); -static boolean gldelf32ebmip_place_orphan - PARAMS ((lang_input_statement_type *, asection *)); -static void gldelf32ebmip_place_section - PARAMS ((lang_statement_union_type *)); -static char *gldelf32ebmip_get_script PARAMS ((int *isfile)); - -static void -gldelf32ebmip_before_parse() -{ - ldfile_output_architecture = bfd_arch_mips; - config.dynamic_link = true; -} - -/* Try to open a dynamic archive. This is where we know that ELF - dynamic libraries have an extension of .so. */ - -static boolean -gldelf32ebmip_open_dynamic_archive (arch, search, entry) - const char *arch; - search_dirs_type *search; - lang_input_statement_type *entry; -{ - const char *filename; - char *string; - - if (! entry->is_archive) - return false; - - filename = entry->filename; - - string = (char *) xmalloc (strlen (search->name) - + strlen (filename) - + strlen (arch) - + sizeof "/lib.so"); - - sprintf (string, "%s/lib%s%s.so", search->name, filename, arch); - - if (! ldfile_try_open_bfd (string, entry)) - { - free (string); - return false; - } - - entry->filename = string; - - /* We have found a dynamic object to include in the link. The ELF - backend linker will create a DT_NEEDED entry in the .dynamic - section naming this file. If this file includes a DT_SONAME - entry, it will be used. Otherwise, the ELF linker will just use - the name of the file. For an archive found by searching, like - this one, the DT_NEEDED entry should consist of just the name of - the file, without the path information used to find it. Note - that we only need to do this if we have a dynamic object; an - archive will never be referenced by a DT_NEEDED entry. - - FIXME: This approach--using bfd_elf_set_dt_needed_name--is not - very pretty. I haven't been able to think of anything that is - pretty, though. */ - if (bfd_check_format (entry->the_bfd, bfd_object) - && (entry->the_bfd->flags & DYNAMIC) != 0) - { - char *needed_name; - - ASSERT (entry->is_archive && entry->search_dirs_flag); - needed_name = (char *) xmalloc (strlen (filename) - + strlen (arch) - + sizeof "lib.so"); - sprintf (needed_name, "lib%s%s.so", filename, arch); - bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name); - } - - return true; -} - - -/* These variables are required to pass information back and forth - between after_open and check_needed and stat_needed. */ - -static struct bfd_link_needed_list *global_needed; -static struct stat global_stat; -static boolean global_found; - -/* This is called after all the input files have been opened. */ - -static void -gldelf32ebmip_after_open () -{ - struct bfd_link_needed_list *needed, *l; - - /* We only need to worry about this when doing a final link. */ - if (link_info.relocateable || link_info.shared) - return; - - /* Get the list of files which appear in DT_NEEDED entries in - dynamic objects included in the link (often there will be none). - For each such file, we want to track down the corresponding - library, and include the symbol table in the link. This is what - the runtime dynamic linker will do. Tracking the files down here - permits one dynamic object to include another without requiring - special action by the person doing the link. Note that the - needed list can actually grow while we are stepping through this - loop. */ - needed = bfd_elf_get_needed_list (output_bfd, &link_info); - for (l = needed; l != NULL; l = l->next) - { - struct bfd_link_needed_list *ll; - const char *lib_path; - size_t len; - search_dirs_type *search; - - /* If we've already seen this file, skip it. */ - for (ll = needed; ll != l; ll = ll->next) - if (strcmp (ll->name, l->name) == 0) - break; - if (ll != l) - continue; - - /* See if this file was included in the link explicitly. */ - global_needed = l; - global_found = false; - lang_for_each_input_file (gldelf32ebmip_check_needed); - if (global_found) - continue; - - /* We need to find this file and include the symbol table. We - want to search for the file in the same way that the dynamic - linker will search. That means that we want to use - rpath_link, rpath, then the environment variable - LD_LIBRARY_PATH (native only), then the linker script - LIB_SEARCH_DIRS. We do not search using the -L arguments. */ - if (gldelf32ebmip_search_needed (command_line.rpath_link, - l->name)) - continue; - if (gldelf32ebmip_search_needed (command_line.rpath, l->name)) - continue; - if (command_line.rpath_link == NULL - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); - if (gldelf32ebmip_search_needed (lib_path, l->name)) - continue; - } - len = strlen (l->name); - for (search = search_head; search != NULL; search = search->next) - { - char *filename; - - if (search->cmdline) - continue; - filename = (char *) xmalloc (strlen (search->name) + len + 2); - sprintf (filename, "%s/%s", search->name, l->name); - if (gldelf32ebmip_try_needed (filename)) - break; - free (filename); - } - if (search != NULL) - continue; - - einfo ("%P: warning: %s, needed by %B, not found\n", - l->name, l->by); - } -} - -/* Search for a needed file in a path. */ - -static boolean -gldelf32ebmip_search_needed (path, name) - const char *path; - const char *name; -{ - const char *s; - size_t len; - - if (path == NULL || *path == '\0') - return false; - len = strlen (name); - while (1) - { - char *filename, *sset; - - s = strchr (path, ':'); - if (s == NULL) - s = path + strlen (path); - - filename = (char *) xmalloc (s - path + len + 2); - if (s == path) - sset = filename; - else - { - memcpy (filename, path, s - path); - filename[s - path] = '/'; - sset = filename + (s - path) + 1; - } - strcpy (sset, name); - - if (gldelf32ebmip_try_needed (filename)) - return true; - - free (filename); - - if (*s == '\0') - break; - path = s + 1; - } - - return false; -} - -/* This function is called for each possible name for a dynamic object - named by a DT_NEEDED entry. */ - -static boolean -gldelf32ebmip_try_needed (name) - const char *name; -{ - bfd *abfd; - - abfd = bfd_openr (name, bfd_get_target (output_bfd)); - if (abfd == NULL) - return false; - if (! bfd_check_format (abfd, bfd_object)) - { - (void) bfd_close (abfd); - return false; - } - if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0) - { - (void) bfd_close (abfd); - return false; - } - - /* We've found a dynamic object matching the DT_NEEDED entry. */ - - /* We have already checked that there is no other input file of the - same name. We must now check again that we are not including the - same file twice. We need to do this because on many systems - libc.so is a symlink to, e.g., libc.so.1. The SONAME entry will - reference libc.so.1. If we have already included libc.so, we - don't want to include libc.so.1 if they are the same file, and we - can only check that using stat. */ - - if (bfd_stat (abfd, &global_stat) != 0) - einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd); - global_found = false; - lang_for_each_input_file (gldelf32ebmip_stat_needed); - if (global_found) - { - /* Return true to indicate that we found the file, even though - we aren't going to do anything with it. */ - return true; - } - - /* Tell the ELF backend that don't want the output file to have a - DT_NEEDED entry for this file. */ - bfd_elf_set_dt_needed_name (abfd, ""); - - /* Add this file into the symbol table. */ - if (! bfd_link_add_symbols (abfd, &link_info)) - einfo ("%F%B: could not read symbols: %E\n", abfd); - - return true; -} - -/* See if an input file matches a DT_NEEDED entry by name. */ - -static void -gldelf32ebmip_check_needed (s) - lang_input_statement_type *s; -{ - if (global_found) - return; - - if (s->filename != NULL - && strcmp (s->filename, global_needed->name) == 0) - { - global_found = true; - return; - } - - if (s->the_bfd != NULL) - { - const char *soname; - - soname = bfd_elf_get_dt_soname (s->the_bfd); - if (soname != NULL - && strcmp (soname, global_needed->name) == 0) - { - global_found = true; - return; - } - } - - if (s->search_dirs_flag - && s->filename != NULL - && strchr (global_needed->name, '/') == NULL) - { - const char *f; - - f = strrchr (s->filename, '/'); - if (f != NULL - && strcmp (f + 1, global_needed->name) == 0) - { - global_found = true; - return; - } - } -} - -/* See if an input file matches a DT_NEEDED entry by running stat on - the file. */ - -static void -gldelf32ebmip_stat_needed (s) - lang_input_statement_type *s; -{ - struct stat st; - const char *suffix; - const char *soname; - const char *f; - - if (global_found) - return; - if (s->the_bfd == NULL) - return; - - if (bfd_stat (s->the_bfd, &st) != 0) - { - einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd); - return; - } - - if (st.st_dev == global_stat.st_dev - && st.st_ino == global_stat.st_ino) - { - global_found = true; - return; - } - - /* We issue a warning if it looks like we are including two - different versions of the same shared library. For example, - there may be a problem if -lc picks up libc.so.6 but some other - shared library has a DT_NEEDED entry of libc.so.5. This is a - hueristic test, and it will only work if the name looks like - NAME.so.VERSION. FIXME: Depending on file names is error-prone. - If we really want to issue warnings about mixing version numbers - of shared libraries, we need to find a better way. */ - - if (strchr (global_needed->name, '/') != NULL) - return; - suffix = strstr (global_needed->name, ".so."); - if (suffix == NULL) - return; - suffix += sizeof ".so." - 1; - - soname = bfd_elf_get_dt_soname (s->the_bfd); - if (soname == NULL) - soname = s->filename; - - f = strrchr (soname, '/'); - if (f != NULL) - ++f; - else - f = soname; - - if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0) - einfo ("%P: warning: %s, needed by %B, may conflict with %s\n", - global_needed->name, global_needed->by, f); -} - -/* This is called after the sections have been attached to output - sections, but before any sizes or addresses have been set. */ - -static void -gldelf32ebmip_before_allocation () -{ - const char *rpath; - asection *sinterp; - - /* If we are going to make any variable assignments, we need to let - the ELF backend know about them in case the variables are - referred to by dynamic objects. */ - lang_for_each_statement (gldelf32ebmip_find_statement_assignment); - - /* Let the ELF backend work out the sizes of any sections required - by dynamic linking. */ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); - if (! bfd_elf32_size_dynamic_sections (output_bfd, - command_line.soname, - rpath, - command_line.export_dynamic, - &link_info, - &sinterp)) - einfo ("%P%F: failed to set dynamic section sizes: %E\n"); - - /* Let the user override the dynamic linker we are using. */ - if (command_line.interpreter != NULL - && sinterp != NULL) - { - sinterp->contents = (bfd_byte *) command_line.interpreter; - sinterp->_raw_size = strlen (command_line.interpreter) + 1; - } - - /* Look for any sections named .gnu.warning. As a GNU extensions, - we treat such sections as containing warning messages. We print - out the warning message, and then zero out the section size so - that it does not get copied into the output file. */ - - { - LANG_FOR_EACH_INPUT_STATEMENT (is) - { - asection *s; - bfd_size_type sz; - char *msg; - boolean ret; - - if (is->just_syms_flag) - continue; - - s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning"); - if (s == NULL) - continue; - - sz = bfd_section_size (is->the_bfd, s); - msg = xmalloc ((size_t) sz + 1); - if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz)) - einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n", - is->the_bfd); - msg[sz] = '\0'; - ret = link_info.callbacks->warning (&link_info, msg, - (const char *) NULL, - is->the_bfd, (asection *) NULL, - (bfd_vma) 0); - ASSERT (ret); - free (msg); - - /* Clobber the section size, so that we don't waste copying the - warning into the output file. */ - s->_raw_size = 0; - } - } - -#if defined (TARGET_IS_elf32bmip) || defined (TARGET_IS_elf32lmip) - /* For MIPS ELF the .reginfo section requires special handling. - Each input section is 24 bytes, and the final output section must - also be 24 bytes. We handle this by clobbering all but the first - input section size to 0. The .reginfo section is handled - specially by the backend code anyhow. */ - { - boolean found = false; - LANG_FOR_EACH_INPUT_STATEMENT (is) - { - asection *s; - - if (is->just_syms_flag) - continue; - - s = bfd_get_section_by_name (is->the_bfd, ".reginfo"); - if (s == NULL) - continue; - - if (! found) - { - found = true; - continue; - } - - s->_raw_size = 0; - s->_cooked_size = 0; - } - } -#endif -} - -/* This is called by the before_allocation routine via - lang_for_each_statement. It locates any assignment statements, and - tells the ELF backend about them, in case they are assignments to - symbols which are referred to by dynamic objects. */ - -static void -gldelf32ebmip_find_statement_assignment (s) - lang_statement_union_type *s; -{ - if (s->header.type == lang_assignment_statement_enum) - gldelf32ebmip_find_exp_assignment (s->assignment_statement.exp); -} - -/* Look through an expression for an assignment statement. */ - -static void -gldelf32ebmip_find_exp_assignment (exp) - etree_type *exp; -{ - struct bfd_link_hash_entry *h; - - switch (exp->type.node_class) - { - case etree_provide: - h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst, - false, false, false); - if (h == NULL) - break; - - /* We call record_link_assignment even if the symbol is defined. - This is because if it is defined by a dynamic object, we - actually want to use the value defined by the linker script, - not the value from the dynamic object (because we are setting - symbols like etext). If the symbol is defined by a regular - object, then, as it happens, calling record_link_assignment - will do no harm. */ - - /* Fall through. */ - case etree_assign: - if (strcmp (exp->assign.dst, ".") != 0) - { - if (! (bfd_elf32_record_link_assignment - (output_bfd, &link_info, exp->assign.dst, - exp->type.node_class == etree_provide ? true : false))) - einfo ("%P%F: failed to record assignment to %s: %E\n", - exp->assign.dst); - } - gldelf32ebmip_find_exp_assignment (exp->assign.src); - break; - - case etree_binary: - gldelf32ebmip_find_exp_assignment (exp->binary.lhs); - gldelf32ebmip_find_exp_assignment (exp->binary.rhs); - break; - - case etree_trinary: - gldelf32ebmip_find_exp_assignment (exp->trinary.cond); - gldelf32ebmip_find_exp_assignment (exp->trinary.lhs); - gldelf32ebmip_find_exp_assignment (exp->trinary.rhs); - break; - - case etree_unary: - gldelf32ebmip_find_exp_assignment (exp->unary.child); - break; - - default: - break; - } -} - -/* Place an orphan section. We use this to put random SHF_ALLOC - sections in the right segment. */ - -static asection *hold_section; -static lang_output_section_statement_type *hold_use; -static lang_output_section_statement_type *hold_text; -static lang_output_section_statement_type *hold_rodata; -static lang_output_section_statement_type *hold_data; -static lang_output_section_statement_type *hold_bss; -static lang_output_section_statement_type *hold_rel; - -/*ARGSUSED*/ -static boolean -gldelf32ebmip_place_orphan (file, s) - lang_input_statement_type *file; - asection *s; -{ - lang_output_section_statement_type *place; - asection *snew, **pps; - lang_statement_list_type *old; - lang_statement_list_type add; - etree_type *address; - const char *secname, *ps; - lang_output_section_statement_type *os; - - if ((s->flags & SEC_ALLOC) == 0) - return false; - - /* Look through the script to see where to place this section. */ - hold_section = s; - hold_use = NULL; - lang_for_each_statement (gldelf32ebmip_place_section); - - if (hold_use != NULL) - { - /* We have already placed a section with this name. */ - wild_doit (&hold_use->children, s, hold_use, file); - return true; - } - - secname = bfd_get_section_name (s->owner, s); - - /* If this is a final link, then always put .gnu.warning.SYMBOL - sections into the .text section to get them out of the way. */ - if (! link_info.shared - && ! link_info.relocateable - && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 - && hold_text != NULL) - { - wild_doit (&hold_text->children, s, hold_text, file); - return true; - } - - /* Decide which segment the section should go in based on the - section name and section flags. */ - place = NULL; - if ((s->flags & SEC_HAS_CONTENTS) == 0 - && hold_bss != NULL) - place = hold_bss; - else if ((s->flags & SEC_READONLY) == 0 - && hold_data != NULL) - place = hold_data; - else if (strncmp (secname, ".rel", 4) == 0 - && hold_rel != NULL) - place = hold_rel; - else if ((s->flags & SEC_CODE) == 0 - && (s->flags & SEC_READONLY) != 0 - && hold_rodata != NULL) - place = hold_rodata; - else if ((s->flags & SEC_READONLY) != 0 - && hold_text != NULL) - place = hold_text; - if (place == NULL) - return false; - - /* Create the section in the output file, and put it in the right - place. This shuffling is to make the output file look neater. */ - snew = bfd_make_section (output_bfd, secname); - if (snew == NULL) - einfo ("%P%F: output format %s cannot represent section called %s\n", - output_bfd->xvec->name, secname); - if (place->bfd_section != NULL) - { - for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) - ; - *pps = snew->next; - snew->next = place->bfd_section->next; - place->bfd_section->next = snew; - } - - /* Start building a list of statements for this section. */ - old = stat_ptr; - stat_ptr = &add; - lang_list_init (stat_ptr); - - /* If the name of the section is representable in C, then create - symbols to mark the start and the end of the section. */ - for (ps = secname; *ps != '\0'; ps++) - if (! isalnum (*ps) && *ps != '_') - break; - if (*ps == '\0' && config.build_constructors) - { - char *symname; - - symname = (char *) xmalloc (ps - secname + sizeof "__start_"); - sprintf (symname, "__start_%s", secname); - lang_add_assignment (exp_assop ('=', symname, - exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 - << s->alignment_power)))); - } - - if (! link_info.relocateable) - address = NULL; - else - address = exp_intop ((bfd_vma) 0); - - lang_enter_output_section_statement (secname, address, 0, - (bfd_vma) 0, - (etree_type *) NULL, - (etree_type *) NULL, - (etree_type *) NULL); - - os = lang_output_section_statement_lookup (secname); - wild_doit (&os->children, s, os, file); - - lang_leave_output_section_statement ((bfd_vma) 0, "*default*"); - stat_ptr = &add; - - if (*ps == '\0' && config.build_constructors) - { - char *symname; - - symname = (char *) xmalloc (ps - secname + sizeof "__stop_"); - sprintf (symname, "__stop_%s", secname); - lang_add_assignment (exp_assop ('=', symname, - exp_nameop (NAME, "."))); - } - - /* Now stick the new statement list right after PLACE. */ - *add.tail = place->header.next; - place->header.next = add.head; - - stat_ptr = old; - - return true; -} - -static void -gldelf32ebmip_place_section (s) - lang_statement_union_type *s; -{ - lang_output_section_statement_type *os; - - if (s->header.type != lang_output_section_statement_enum) - return; - - os = &s->output_section_statement; - - if (strcmp (os->name, hold_section->name) == 0) - hold_use = os; - - if (strcmp (os->name, ".text") == 0) - hold_text = os; - else if (strcmp (os->name, ".rodata") == 0) - hold_rodata = os; - else if (strcmp (os->name, ".data") == 0) - hold_data = os; - else if (strcmp (os->name, ".bss") == 0) - hold_bss = os; - else if (hold_rel == NULL - && os->bfd_section != NULL - && strncmp (os->name, ".rel", 4) == 0) - hold_rel = os; -} - -static char * -gldelf32ebmip_get_script(isfile) - int *isfile; -{ - *isfile = 0; - - if (link_info.relocateable == true && config.build_constructors == true) - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - /* For some reason, the Solaris linker makes bad executables\n\ - if gld -r is used and the intermediate file has sections starting\n\ - at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld\n\ - bug. But for now assigning the zero vmas works. */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - .interp 0 : { *(.interp) }\n\ - .reginfo 0 : { *(.reginfo) }\n\ - .dynamic 0 : { *(.dynamic) }\n\ - .dynstr 0 : { *(.dynstr) }\n\ - .dynsym 0 : { *(.dynsym) }\n\ - .hash 0 : { *(.hash) }\n\ - .rel.text 0 : { *(.rel.text) }\n\ - .rela.text 0 : { *(.rela.text) }\n\ - .rel.data 0 : { *(.rel.data) }\n\ - .rela.data 0 : { *(.rela.data) }\n\ - .rel.rodata 0 : { *(.rel.rodata) }\n\ - .rela.rodata 0 : { *(.rela.rodata) }\n\ - .rel.got 0 : { *(.rel.got) }\n\ - .rela.got 0 : { *(.rela.got) }\n\ - .rel.ctors 0 : { *(.rel.ctors) }\n\ - .rela.ctors 0 : { *(.rela.ctors) }\n\ - .rel.dtors 0 : { *(.rel.dtors) }\n\ - .rela.dtors 0 : { *(.rela.dtors) }\n\ - .rel.init 0 : { *(.rel.init) }\n\ - .rela.init 0 : { *(.rela.init) }\n\ - .rel.fini 0 : { *(.rel.fini) }\n\ - .rela.fini 0 : { *(.rela.fini) }\n\ - .rel.bss 0 : { *(.rel.bss) }\n\ - .rela.bss 0 : { *(.rela.bss) }\n\ - .rel.plt 0 : { *(.rel.plt) }\n\ - .rela.plt 0 : { *(.rela.plt) }\n\ - .rodata 0 : { *(.rodata) }\n\ - .rodata1 0 : { *(.rodata1) }\n\ - .init 0 : { *(.init) } =0\n\ - .text 0 :\n\ - {\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - .fini 0 : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - .data 0 :\n\ - {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .data1 0 : { *(.data1) }\n\ - .ctors 0 : { *(.ctors) }\n\ - .dtors 0 : { *(.dtors) }\n\ - .got 0 :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata 0 : { *(.sdata) }\n\ - .sbss 0 : { *(.sbss) *(.scommon) }\n\ - .bss 0 :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; - else if (link_info.relocateable == true) - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - /* For some reason, the Solaris linker makes bad executables\n\ - if gld -r is used and the intermediate file has sections starting\n\ - at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld\n\ - bug. But for now assigning the zero vmas works. */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - .interp 0 : { *(.interp) }\n\ - .reginfo 0 : { *(.reginfo) }\n\ - .dynamic 0 : { *(.dynamic) }\n\ - .dynstr 0 : { *(.dynstr) }\n\ - .dynsym 0 : { *(.dynsym) }\n\ - .hash 0 : { *(.hash) }\n\ - .rel.text 0 : { *(.rel.text) }\n\ - .rela.text 0 : { *(.rela.text) }\n\ - .rel.data 0 : { *(.rel.data) }\n\ - .rela.data 0 : { *(.rela.data) }\n\ - .rel.rodata 0 : { *(.rel.rodata) }\n\ - .rela.rodata 0 : { *(.rela.rodata) }\n\ - .rel.got 0 : { *(.rel.got) }\n\ - .rela.got 0 : { *(.rela.got) }\n\ - .rel.ctors 0 : { *(.rel.ctors) }\n\ - .rela.ctors 0 : { *(.rela.ctors) }\n\ - .rel.dtors 0 : { *(.rel.dtors) }\n\ - .rela.dtors 0 : { *(.rela.dtors) }\n\ - .rel.init 0 : { *(.rel.init) }\n\ - .rela.init 0 : { *(.rela.init) }\n\ - .rel.fini 0 : { *(.rel.fini) }\n\ - .rela.fini 0 : { *(.rela.fini) }\n\ - .rel.bss 0 : { *(.rel.bss) }\n\ - .rela.bss 0 : { *(.rela.bss) }\n\ - .rel.plt 0 : { *(.rel.plt) }\n\ - .rela.plt 0 : { *(.rela.plt) }\n\ - .rodata 0 : { *(.rodata) }\n\ - .rodata1 0 : { *(.rodata1) }\n\ - .init 0 : { *(.init) } =0\n\ - .text 0 :\n\ - {\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - .fini 0 : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - .data 0 :\n\ - {\n\ - *(.data)\n\ - }\n\ - .data1 0 : { *(.data1) }\n\ - .ctors 0 : { *(.ctors) }\n\ - .dtors 0 : { *(.dtors) }\n\ - .got 0 :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata 0 : { *(.sdata) }\n\ - .sbss 0 : { *(.sbss) *(.scommon) }\n\ - .bss 0 :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; - else if (!config.text_read_only) - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - SEARCH_DIR(/usr/local/mips-elf/lib);\n\ -/* Do we need any of these for elf?\n\ - __DYNAMIC = 0; */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - . = 0x0400000;\n\ - .interp : { *(.interp) }\n\ - .reginfo : { *(.reginfo) }\n\ - .dynamic : { *(.dynamic) }\n\ - .dynstr : { *(.dynstr) }\n\ - .dynsym : { *(.dynsym) }\n\ - .hash : { *(.hash) }\n\ - .rel.text : { *(.rel.text) }\n\ - .rela.text : { *(.rela.text) }\n\ - .rel.data : { *(.rel.data) }\n\ - .rela.data : { *(.rela.data) }\n\ - .rel.rodata : { *(.rel.rodata) }\n\ - .rela.rodata : { *(.rela.rodata) }\n\ - .rel.got : { *(.rel.got) }\n\ - .rela.got : { *(.rela.got) }\n\ - .rel.ctors : { *(.rel.ctors) }\n\ - .rela.ctors : { *(.rela.ctors) }\n\ - .rel.dtors : { *(.rel.dtors) }\n\ - .rela.dtors : { *(.rela.dtors) }\n\ - .rel.init : { *(.rel.init) }\n\ - .rela.init : { *(.rela.init) }\n\ - .rel.fini : { *(.rel.fini) }\n\ - .rela.fini : { *(.rela.fini) }\n\ - .rel.bss : { *(.rel.bss) }\n\ - .rela.bss : { *(.rela.bss) }\n\ - .rel.plt : { *(.rel.plt) }\n\ - .rela.plt : { *(.rela.plt) }\n\ - .rodata : { *(.rodata) }\n\ - .rodata1 : { *(.rodata1) }\n\ - .init : { *(.init) } =0\n\ - .text :\n\ - {\n\ - _ftext = . ;\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - _etext = .;\n\ - PROVIDE (etext = .);\n\ - .fini : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - . = .;\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - . += . - 0x0400000;\n\ - .data :\n\ - {\n\ - _fdata = . ;\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .data1 : { *(.data1) }\n\ - .ctors : { *(.ctors) }\n\ - .dtors : { *(.dtors) }\n\ - _gp = ALIGN(16) + 0x7ff0;\n\ - .got :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata : { *(.sdata) }\n\ - .lit8 : { *(.lit8) }\n\ - .lit4 : { *(.lit4) }\n\ - _edata = .;\n\ - PROVIDE (edata = .);\n\ - __bss_start = .;\n\ - _fbss = .;\n\ - .sbss : { *(.sbss) *(.scommon) }\n\ - .bss :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - _end = . ;\n\ - PROVIDE (end = .);\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; - else if (!config.magic_demand_paged) - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - SEARCH_DIR(/usr/local/mips-elf/lib);\n\ -/* Do we need any of these for elf?\n\ - __DYNAMIC = 0; */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - . = 0x0400000;\n\ - .interp : { *(.interp) }\n\ - .reginfo : { *(.reginfo) }\n\ - .dynamic : { *(.dynamic) }\n\ - .dynstr : { *(.dynstr) }\n\ - .dynsym : { *(.dynsym) }\n\ - .hash : { *(.hash) }\n\ - .rel.text : { *(.rel.text) }\n\ - .rela.text : { *(.rela.text) }\n\ - .rel.data : { *(.rel.data) }\n\ - .rela.data : { *(.rela.data) }\n\ - .rel.rodata : { *(.rel.rodata) }\n\ - .rela.rodata : { *(.rela.rodata) }\n\ - .rel.got : { *(.rel.got) }\n\ - .rela.got : { *(.rela.got) }\n\ - .rel.ctors : { *(.rel.ctors) }\n\ - .rela.ctors : { *(.rela.ctors) }\n\ - .rel.dtors : { *(.rel.dtors) }\n\ - .rela.dtors : { *(.rela.dtors) }\n\ - .rel.init : { *(.rel.init) }\n\ - .rela.init : { *(.rela.init) }\n\ - .rel.fini : { *(.rel.fini) }\n\ - .rela.fini : { *(.rela.fini) }\n\ - .rel.bss : { *(.rel.bss) }\n\ - .rela.bss : { *(.rela.bss) }\n\ - .rel.plt : { *(.rel.plt) }\n\ - .rela.plt : { *(.rela.plt) }\n\ - .rodata : { *(.rodata) }\n\ - .rodata1 : { *(.rodata1) }\n\ - .init : { *(.init) } =0\n\ - .text :\n\ - {\n\ - _ftext = . ;\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - _etext = .;\n\ - PROVIDE (etext = .);\n\ - .fini : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - . = 0x10000000;\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - . += 0x10000000 - 0x0400000;\n\ - .data :\n\ - {\n\ - _fdata = . ;\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .data1 : { *(.data1) }\n\ - .ctors : { *(.ctors) }\n\ - .dtors : { *(.dtors) }\n\ - _gp = ALIGN(16) + 0x7ff0;\n\ - .got :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata : { *(.sdata) }\n\ - .lit8 : { *(.lit8) }\n\ - .lit4 : { *(.lit4) }\n\ - _edata = .;\n\ - PROVIDE (edata = .);\n\ - __bss_start = .;\n\ - _fbss = .;\n\ - .sbss : { *(.sbss) *(.scommon) }\n\ - .bss :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - _end = . ;\n\ - PROVIDE (end = .);\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; - else if (link_info.shared) - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - SEARCH_DIR(/usr/local/mips-elf/lib);\n\ -/* Do we need any of these for elf?\n\ - __DYNAMIC = 0; */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - . = 0x5ffe0000 + SIZEOF_HEADERS;\n\ - .reginfo : { *(.reginfo) }\n\ - .dynamic : { *(.dynamic) }\n\ - .dynstr : { *(.dynstr) }\n\ - .dynsym : { *(.dynsym) }\n\ - .hash : { *(.hash) }\n\ - .rel.text : { *(.rel.text) }\n\ - .rela.text : { *(.rela.text) }\n\ - .rel.data : { *(.rel.data) }\n\ - .rela.data : { *(.rela.data) }\n\ - .rel.rodata : { *(.rel.rodata) }\n\ - .rela.rodata : { *(.rela.rodata) }\n\ - .rel.got : { *(.rel.got) }\n\ - .rela.got : { *(.rela.got) }\n\ - .rel.ctors : { *(.rel.ctors) }\n\ - .rela.ctors : { *(.rela.ctors) }\n\ - .rel.dtors : { *(.rel.dtors) }\n\ - .rela.dtors : { *(.rela.dtors) }\n\ - .rel.init : { *(.rel.init) }\n\ - .rela.init : { *(.rela.init) }\n\ - .rel.fini : { *(.rel.fini) }\n\ - .rela.fini : { *(.rela.fini) }\n\ - .rel.bss : { *(.rel.bss) }\n\ - .rela.bss : { *(.rela.bss) }\n\ - .rel.plt : { *(.rel.plt) }\n\ - .rela.plt : { *(.rela.plt) }\n\ - .rodata : { *(.rodata) }\n\ - .rodata1 : { *(.rodata1) }\n\ - .init : { *(.init) } =0\n\ - .text :\n\ - {\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - .fini : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - . = 0x10000000;\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - . += 0x10000;\n\ - .data :\n\ - {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .data1 : { *(.data1) }\n\ - .ctors : { *(.ctors) }\n\ - .dtors : { *(.dtors) }\n\ - _gp = ALIGN(16) + 0x7ff0;\n\ - .got :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata : { *(.sdata) }\n\ - .lit8 : { *(.lit8) }\n\ - .lit4 : { *(.lit4) }\n\ - .sbss : { *(.sbss) *(.scommon) }\n\ - .bss :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; - else - return "OUTPUT_FORMAT(\"elf32-bigmips\", \"elf32-bigmips\",\n\ - \"elf32-littlemips\")\n\ -OUTPUT_ARCH(mips)\n\ -ENTRY(_start)\n\ - SEARCH_DIR(/usr/local/mips-elf/lib);\n\ -/* Do we need any of these for elf?\n\ - __DYNAMIC = 0; */\n\ -SECTIONS\n\ -{\n\ - /* Read-only sections, merged into text segment: */\n\ - . = 0x0400000;\n\ - .interp : { *(.interp) }\n\ - .reginfo : { *(.reginfo) }\n\ - .dynamic : { *(.dynamic) }\n\ - .dynstr : { *(.dynstr) }\n\ - .dynsym : { *(.dynsym) }\n\ - .hash : { *(.hash) }\n\ - .rel.text : { *(.rel.text) }\n\ - .rela.text : { *(.rela.text) }\n\ - .rel.data : { *(.rel.data) }\n\ - .rela.data : { *(.rela.data) }\n\ - .rel.rodata : { *(.rel.rodata) }\n\ - .rela.rodata : { *(.rela.rodata) }\n\ - .rel.got : { *(.rel.got) }\n\ - .rela.got : { *(.rela.got) }\n\ - .rel.ctors : { *(.rel.ctors) }\n\ - .rela.ctors : { *(.rela.ctors) }\n\ - .rel.dtors : { *(.rel.dtors) }\n\ - .rela.dtors : { *(.rela.dtors) }\n\ - .rel.init : { *(.rel.init) }\n\ - .rela.init : { *(.rela.init) }\n\ - .rel.fini : { *(.rel.fini) }\n\ - .rela.fini : { *(.rela.fini) }\n\ - .rel.bss : { *(.rel.bss) }\n\ - .rela.bss : { *(.rela.bss) }\n\ - .rel.plt : { *(.rel.plt) }\n\ - .rela.plt : { *(.rela.plt) }\n\ - .rodata : { *(.rodata) }\n\ - .rodata1 : { *(.rodata1) }\n\ - .init : { *(.init) } =0\n\ - .text :\n\ - {\n\ - _ftext = . ;\n\ - *(.text)\n\ - *(.stub)\n\ - /* .gnu.warning sections are handled specially by elf32.em. */\n\ - *(.gnu.warning)\n\ - } =0\n\ - _etext = .;\n\ - PROVIDE (etext = .);\n\ - .fini : { *(.fini) } =0\n\ - /* Adjust the address for the data segment. We want to adjust up to\n\ - the same address within the page on the next page up. It would\n\ - be more correct to do this:\n\ - . = 0x10000000;\n\ - The current expression does not correctly handle the case of a\n\ - text segment ending precisely at the end of a page; it causes the\n\ - data segment to skip a page. The above expression does not have\n\ - this problem, but it will currently (2/95) cause BFD to allocate\n\ - a single segment, combining both text and data, for this case.\n\ - This will prevent the text segment from being shared among\n\ - multiple executions of the program; I think that is more\n\ - important than losing a page of the virtual address space (note\n\ - that no actual memory is lost; the page which is skipped can not\n\ - be referenced). */\n\ - . += 0x10000000 - 0x0400000;\n\ - .data :\n\ - {\n\ - _fdata = . ;\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .data1 : { *(.data1) }\n\ - .ctors : { *(.ctors) }\n\ - .dtors : { *(.dtors) }\n\ - _gp = ALIGN(16) + 0x7ff0;\n\ - .got :\n\ - {\n\ - *(.got.plt) *(.got)\n\ - }\n\ - /* We want the small data sections together, so single-instruction offsets\n\ - can access them all, and initialized data all before uninitialized, so\n\ - we can shorten the on-disk segment size. */\n\ - .sdata : { *(.sdata) }\n\ - .lit8 : { *(.lit8) }\n\ - .lit4 : { *(.lit4) }\n\ - _edata = .;\n\ - PROVIDE (edata = .);\n\ - __bss_start = .;\n\ - _fbss = .;\n\ - .sbss : { *(.sbss) *(.scommon) }\n\ - .bss :\n\ - {\n\ - *(.dynbss)\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - _end = . ;\n\ - PROVIDE (end = .);\n\ - /* These are needed for ELF backends which have not yet been\n\ - converted to the new style linker. */\n\ - .stab 0 : { *(.stab) }\n\ - .stabstr 0 : { *(.stabstr) }\n\ - /* DWARF debug sections.\n\ - Symbols in the .debug DWARF section are relative to the beginning of the\n\ - section so we begin .debug at 0. It's not clear yet what needs to happen\n\ - for the others. */\n\ - .debug 0 : { *(.debug) }\n\ - .debug_srcinfo 0 : { *(.debug_srcinfo) }\n\ - .debug_aranges 0 : { *(.debug_aranges) }\n\ - .debug_pubnames 0 : { *(.debug_pubnames) }\n\ - .debug_sfnames 0 : { *(.debug_sfnames) }\n\ - .line 0 : { *(.line) }\n\ - /* These must appear regardless of . */\n\ - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }\n\ - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }\n\ -}\n\n"; -} - -struct ld_emulation_xfer_struct ld_elf32ebmip_emulation = -{ - gldelf32ebmip_before_parse, - syslib_default, - hll_default, - after_parse_default, - gldelf32ebmip_after_open, - after_allocation_default, - set_output_arch_default, - ldemul_default_target, - gldelf32ebmip_before_allocation, - gldelf32ebmip_get_script, - "elf32ebmip", - "elf32-bigmips", - NULL, - NULL, - gldelf32ebmip_open_dynamic_archive, - gldelf32ebmip_place_orphan -}; diff --git a/gnu/dist/ld/mpw-eppcmac.c b/gnu/dist/ld/mpw-eppcmac.c deleted file mode 100644 index 3df5a024ea69..000000000000 --- a/gnu/dist/ld/mpw-eppcmac.c +++ /dev/null @@ -1,1224 +0,0 @@ -/* This file is is generated by a shell script. DO NOT EDIT! */ - -/* AIX emulation code for ppcmacos - Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc. - Written by Steve Chamberlain - AIX support by Ian Lance Taylor - -This file is part of GLD, the Gnu Linker. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define TARGET_IS_ppcmacos - -#include "bfd.h" -#include "sysdep.h" -#include "libiberty.h" -#include "getopt.h" -#include "bfdlink.h" - -#include - -#include "ld.h" -#include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" -#include "ldmisc.h" -#include "ldexp.h" -#include "ldlang.h" -#include "ldctor.h" -#include "ldgram.h" - -static void gldppcmacos_before_parse PARAMS ((void)); -static int gldppcmacos_parse_args PARAMS ((int, char **)); -static void gldppcmacos_after_open PARAMS ((void)); -static void gldppcmacos_before_allocation PARAMS ((void)); -static void gldppcmacos_read_file PARAMS ((const char *, boolean)); -static void gldppcmacos_free PARAMS ((PTR)); -static void gldppcmacos_find_relocs - PARAMS ((lang_statement_union_type *)); -static void gldppcmacos_find_exp_assignment PARAMS ((etree_type *)); -static char *gldppcmacos_get_script PARAMS ((int *isfile)); - -/* The file alignment required for each section. */ -static unsigned long file_align; - -/* The maximum size the stack is permitted to grow. This is stored in - the a.out header. */ -static unsigned long maxstack; - -/* The maximum data size. This is stored in the a.out header. */ -static unsigned long maxdata; - -/* Whether to perform garbage collection. */ -static int gc = 1; - -/* The module type to use. */ -static unsigned short modtype = ('1' << 8) | 'L'; - -/* Whether the .text section must be read-only (i.e., no relocs - permitted). */ -static int textro; - -/* Whether to implement Unix like linker semantics. */ -static int unix_ld; - -/* Structure used to hold import file list. */ - -struct filelist -{ - struct filelist *next; - const char *name; -}; - -/* List of import files. */ -static struct filelist *import_files; - -/* List of export symbols read from the export files. */ - -struct export_symbol_list -{ - struct export_symbol_list *next; - const char *name; - boolean syscall; -}; - -static struct export_symbol_list *export_symbols; - -/* This routine is called before anything else is done. */ - -static void -gldppcmacos_before_parse() -{ -#ifndef TARGET_ /* I.e., if not generic. */ - ldfile_output_architecture = bfd_arch_powerpc; -#endif /* not TARGET_ */ -} - -/* Handle AIX specific options. */ - -static int -gldppcmacos_parse_args (argc, argv) - int argc; - char **argv; -{ - int prevoptind = optind; - int prevopterr = opterr; - int indx; - int longind; - int optc; - long val; - char *end; - -#define OPTION_IGNORE (300) -#define OPTION_AUTOIMP (OPTION_IGNORE + 1) -#define OPTION_ERNOTOK (OPTION_AUTOIMP + 1) -#define OPTION_EROK (OPTION_ERNOTOK + 1) -#define OPTION_EXPORT (OPTION_EROK + 1) -#define OPTION_IMPORT (OPTION_EXPORT + 1) -#define OPTION_LOADMAP (OPTION_IMPORT + 1) -#define OPTION_MAXDATA (OPTION_LOADMAP + 1) -#define OPTION_MAXSTACK (OPTION_MAXDATA + 1) -#define OPTION_MODTYPE (OPTION_MAXSTACK + 1) -#define OPTION_NOAUTOIMP (OPTION_MODTYPE + 1) -#define OPTION_NOSTRCMPCT (OPTION_NOAUTOIMP + 1) -#define OPTION_PD (OPTION_NOSTRCMPCT + 1) -#define OPTION_PT (OPTION_PD + 1) -#define OPTION_STRCMPCT (OPTION_PT + 1) -#define OPTION_UNIX (OPTION_STRCMPCT + 1) - - static struct option longopts[] = { - {"basis", no_argument, NULL, OPTION_IGNORE}, - {"bautoimp", no_argument, NULL, OPTION_AUTOIMP}, - {"bcomprld", no_argument, NULL, OPTION_IGNORE}, - {"bcrld", no_argument, NULL, OPTION_IGNORE}, - {"bcror31", no_argument, NULL, OPTION_IGNORE}, - {"bD", required_argument, NULL, OPTION_MAXDATA}, - {"bE", required_argument, NULL, OPTION_EXPORT}, - {"bernotok", no_argument, NULL, OPTION_ERNOTOK}, - {"berok", no_argument, NULL, OPTION_EROK}, - {"berrmsg", no_argument, NULL, OPTION_IGNORE}, - {"bexport", required_argument, NULL, OPTION_EXPORT}, - {"bf", no_argument, NULL, OPTION_ERNOTOK}, - {"bgc", no_argument, &gc, 1}, - {"bh", required_argument, NULL, OPTION_IGNORE}, - {"bhalt", required_argument, NULL, OPTION_IGNORE}, - {"bI", required_argument, NULL, OPTION_IMPORT}, - {"bimport", required_argument, NULL, OPTION_IMPORT}, - {"bl", required_argument, NULL, OPTION_LOADMAP}, - {"bloadmap", required_argument, NULL, OPTION_LOADMAP}, - {"bmaxdata", required_argument, NULL, OPTION_MAXDATA}, - {"bmaxstack", required_argument, NULL, OPTION_MAXSTACK}, - {"bM", required_argument, NULL, OPTION_MODTYPE}, - {"bmodtype", required_argument, NULL, OPTION_MODTYPE}, - {"bnoautoimp", no_argument, NULL, OPTION_NOAUTOIMP}, - {"bnodelcsect", no_argument, NULL, OPTION_IGNORE}, - {"bnoentry", no_argument, NULL, OPTION_IGNORE}, - {"bnogc", no_argument, &gc, 0}, - {"bnso", no_argument, NULL, OPTION_NOAUTOIMP}, - {"bnostrcmpct", no_argument, NULL, OPTION_NOSTRCMPCT}, - {"bnotextro", no_argument, &textro, 0}, - {"bnro", no_argument, &textro, 0}, - {"bpD", required_argument, NULL, OPTION_PD}, - {"bpT", required_argument, NULL, OPTION_PT}, - {"bro", no_argument, &textro, 1}, - {"bS", required_argument, NULL, OPTION_MAXSTACK}, - {"bso", no_argument, NULL, OPTION_AUTOIMP}, - {"bstrcmpct", no_argument, NULL, OPTION_STRCMPCT}, - {"btextro", no_argument, &textro, 1}, - {"static", no_argument, NULL, OPTION_NOAUTOIMP}, - {"unix", no_argument, NULL, OPTION_UNIX}, - {NULL, no_argument, NULL, 0} - }; - - /* Options supported by the AIX linker which we do not support: -f, - -S, -v, -Z, -bbindcmds, -bbinder, -bbindopts, -bcalls, -bcaps, - -bcror15, -bdebugopt, -bdbg, -bdelcsect, -bex?, -bfilelist, -bfl, - -bgcbypass, -bglink, -binsert, -bi, -bloadmap, -bl, -bmap, -bnl, - -bnobind, -bnocomprld, -bnocrld, -bnoerrmsg, -bnoglink, - -bnoloadmap, -bnl, -bnoobjreorder, -bnoquiet, -bnoreorder, - -bnotypchk, -bnox, -bquiet, -bR, -brename, -breorder, -btypchk, - -bx, -bX, -bxref. */ - - /* If the current option starts with -b, change the first : to an =. - The AIX linker uses : to separate the option from the argument; - changing it to = lets us treat it as a getopt option. */ - indx = optind; - if (indx == 0) - indx = 1; - if (indx < argc && strncmp (argv[indx], "-b", 2) == 0) - { - char *s; - - for (s = argv[indx]; *s != '\0'; s++) - { - if (*s == ':') - { - *s = '='; - break; - } - } - } - - opterr = 0; - optc = getopt_long_only (argc, argv, "-D:H:KT:z", longopts, &longind); - opterr = prevopterr; - - switch (optc) - { - default: - optind = prevoptind; - return 0; - - case 0: - /* Long option which just sets a flag. */ - break; - - case 'D': - val = strtol (optarg, &end, 0); - if (*end != '\0') - einfo ("%P: warning: ignoring invalid -D number %s\n", optarg); - else if (val != -1) - lang_section_start (".data", exp_intop (val)); - break; - - case 'H': - val = strtoul (optarg, &end, 0); - if (*end != '\0' - || (val & (val - 1)) != 0) - einfo ("%P: warning: ignoring invalid -H number %s\n", optarg); - else - file_align = val; - break; - - case 'K': - case 'z': - /* FIXME: This should use the page size for the target system. */ - file_align = 4096; - break; - - case 'T': - /* On AIX this is the same as GNU ld -Ttext. When we see -T - number, we assume the AIX option is intended. Otherwise, we - assume the usual GNU ld -T option is intended. We can't just - ignore the AIX option, because gcc passes it to the linker. */ - val = strtoul (optarg, &end, 0); - if (*end != '\0') - { - optind = prevoptind; - return 0; - } - lang_section_start (".text", exp_intop (val)); - break; - - case OPTION_IGNORE: - break; - - case OPTION_AUTOIMP: - link_info.static_link = false; - break; - - case OPTION_ERNOTOK: - force_make_executable = false; - break; - - case OPTION_EROK: - force_make_executable = true; - break; - - case OPTION_EXPORT: - gldppcmacos_read_file (optarg, false); - break; - - case OPTION_IMPORT: - { - struct filelist *n; - struct filelist **flpp; - - n = (struct filelist *) xmalloc (sizeof (struct filelist)); - n->next = NULL; - n->name = optarg; - flpp = &import_files; - while (*flpp != NULL) - flpp = &(*flpp)->next; - *flpp = n; - } - break; - - case OPTION_LOADMAP: - config.map_filename = optarg; - break; - - case OPTION_MAXDATA: - val = strtoul (optarg, &end, 0); - if (*end != '\0') - einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n", - optarg); - else - maxdata = val; - break; - - case OPTION_MAXSTACK: - val = strtoul (optarg, &end, 0); - if (*end != '\0') - einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n", - optarg); - else - maxstack = val; - break; - - case OPTION_MODTYPE: - if (*optarg == 'S') - { - link_info.shared = true; - ++optarg; - } - if (*optarg == '\0' || optarg[1] == '\0') - einfo ("%P: warning: ignoring invalid module type %s\n", optarg); - else - modtype = (*optarg << 8) | optarg[1]; - break; - - case OPTION_NOAUTOIMP: - link_info.static_link = true; - break; - - case OPTION_NOSTRCMPCT: - link_info.traditional_format = true; - break; - - case OPTION_PD: - /* This sets the page that the .data section is supposed to - start on. The offset within the page should still be the - offset within the file, so we need to build an appropriate - expression. */ - val = strtoul (optarg, &end, 0); - if (*end != '\0') - einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg); - else - { - etree_type *t; - - t = exp_binop ('+', - exp_intop (val), - exp_binop ('&', - exp_nameop (NAME, "."), - exp_intop (0xfff))); - t = exp_binop ('&', - exp_binop ('+', t, exp_intop (7)), - exp_intop (~ (bfd_vma) 7)); - lang_section_start (".data", t); - } - break; - - case OPTION_PT: - /* This set the page that the .text section is supposed to start - on. The offset within the page should still be the offset - within the file. */ - val = strtoul (optarg, &end, 0); - if (*end != '\0') - einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg); - else - { - etree_type *t; - - t = exp_binop ('+', - exp_intop (val), - exp_nameop (SIZEOF_HEADERS, NULL)); - t = exp_binop ('&', - exp_binop ('+', t, exp_intop (7)), - exp_intop (~ (bfd_vma) 7)); - lang_section_start (".text", t); - } - break; - - case OPTION_STRCMPCT: - link_info.traditional_format = false; - break; - - case OPTION_UNIX: - unix_ld = true; - break; - } - - return 1; -} - -/* This is called when an input file can not be recognized as a BFD - object or an archive. If the file starts with #!, we must treat it - as an import file. This is for AIX compatibility. */ - -static boolean -gldppcmacos_unrecognized_file (entry) - lang_input_statement_type *entry; -{ - FILE *e; - boolean ret; - - e = fopen (entry->filename, FOPEN_RT); - if (e == NULL) - return false; - - ret = false; - - if (getc (e) == '#' && getc (e) == '!') - { - struct filelist *n; - struct filelist **flpp; - - n = (struct filelist *) xmalloc (sizeof (struct filelist)); - n->next = NULL; - n->name = entry->filename; - flpp = &import_files; - while (*flpp != NULL) - flpp = &(*flpp)->next; - *flpp = n; - - ret = true; - entry->loaded = true; - } - - fclose (e); - - return ret; -} - -/* This is called after the input files have been opened. */ - -static void -gldppcmacos_after_open () -{ - boolean r; - struct set_info *p; - - /* Call ldctor_build_sets, after pretending that this is a - relocateable link. We do this because AIX requires relocation - entries for all references to symbols, even in a final - executable. Of course, we only want to do this if we are - producing an XCOFF output file. */ - r = link_info.relocateable; - if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL) - link_info.relocateable = true; - ldctor_build_sets (); - link_info.relocateable = r; - - /* For each set, record the size, so that the XCOFF backend can - output the correct csect length. */ - for (p = sets; p != (struct set_info *) NULL; p = p->next) - { - bfd_size_type size; - - /* If the symbol is defined, we may have been invoked from - collect, and the sets may already have been built, so we do - not do anything. */ - if (p->h->type == bfd_link_hash_defined - || p->h->type == bfd_link_hash_defweak) - continue; - - if (p->reloc != BFD_RELOC_CTOR) - { - /* Handle this if we need to. */ - abort (); - } - - size = (p->count + 2) * 4; - if (! bfd_xcoff_link_record_set (output_bfd, &link_info, p->h, size)) - einfo ("%F%P: bfd_xcoff_link_record_set failed: %E\n"); - } -} - -/* This is called after the sections have been attached to output - sections, but before any sizes or addresses have been set. */ - -static void -gldppcmacos_before_allocation () -{ - struct filelist *fl; - struct export_symbol_list *el; - char *libpath; - asection *special_sections[6]; - int i; - - /* Handle the import and export files, if any. */ - for (fl = import_files; fl != NULL; fl = fl->next) - gldppcmacos_read_file (fl->name, true); - for (el = export_symbols; el != NULL; el = el->next) - { - struct bfd_link_hash_entry *h; - - h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false); - if (h == NULL) - einfo ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n"); - if (! bfd_xcoff_export_symbol (output_bfd, &link_info, h, el->syscall)) - einfo ("%P%F: bfd_xcoff_export_symbol failed: %E\n"); - } - - /* Track down all relocations called for by the linker script (these - are typically constructor/destructor entries created by - CONSTRUCTORS) and let the backend know it will need to create - .loader relocs for them. */ - lang_for_each_statement (gldppcmacos_find_relocs); - - /* We need to build LIBPATH from the -L arguments. If any -rpath - arguments were used, though, we use -rpath instead, as a GNU - extension. */ - if (command_line.rpath != NULL) - libpath = command_line.rpath; - else if (search_head == NULL) - libpath = (char *) ""; - else - { - size_t len; - search_dirs_type *search; - - len = strlen (search_head->name); - libpath = xmalloc (len + 1); - strcpy (libpath, search_head->name); - for (search = search_head->next; search != NULL; search = search->next) - { - size_t nlen; - - nlen = strlen (search->name); - libpath = xrealloc (libpath, len + nlen + 2); - libpath[len] = ':'; - strcpy (libpath + len + 1, search->name); - len += nlen + 1; - } - } - - /* Let the XCOFF backend set up the .loader section. */ - if (! bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath, - entry_symbol, file_align, - maxstack, maxdata, - gc && ! unix_ld ? true : false, - modtype, - textro ? true : false, - unix_ld, - special_sections)) - einfo ("%P%F: failed to set dynamic section sizes: %E\n"); - - /* Look through the special sections, and put them in the right - place in the link ordering. This is especially magic. */ - for (i = 0; i < 6; i++) - { - asection *sec; - lang_output_section_statement_type *os; - lang_statement_union_type **pls; - lang_input_section_type *is; - const char *oname; - boolean start; - - sec = special_sections[i]; - if (sec == NULL) - continue; - - /* Remove this section from the list of the output section. - This assumes we know what the script looks like. */ - is = NULL; - os = lang_output_section_find (sec->output_section->name); - if (os == NULL) - einfo ("%P%F: can't find output section %s\n", - sec->output_section->name); - for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next) - { - if ((*pls)->header.type == lang_input_section_enum - && (*pls)->input_section.section == sec) - { - is = (lang_input_section_type *) *pls; - *pls = (*pls)->next; - break; - } - if ((*pls)->header.type == lang_wild_statement_enum) - { - lang_statement_union_type **pwls; - - for (pwls = &(*pls)->wild_statement.children.head; - *pwls != NULL; - pwls = &(*pwls)->next) - { - if ((*pwls)->header.type == lang_input_section_enum - && (*pwls)->input_section.section == sec) - { - is = (lang_input_section_type *) *pwls; - *pwls = (*pwls)->next; - break; - } - } - if (is != NULL) - break; - } - } - - if (is == NULL) - einfo ("%P%F: can't find %s in output section\n", - bfd_get_section_name (sec->owner, sec)); - - /* Now figure out where the section should go. */ - switch (i) - { - default: /* to avoid warnings */ - case 0: - /* _text */ - oname = ".text"; - start = true; - break; - case 1: - /* _etext */ - oname = ".text"; - start = false; - break; - case 2: - /* _data */ - oname = ".data"; - start = true; - break; - case 3: - /* _edata */ - oname = ".data"; - start = false; - break; - case 4: - case 5: - /* _end and end */ - oname = ".bss"; - start = false; - break; - } - - os = lang_output_section_find (oname); - - if (start) - { - is->header.next = os->children.head; - os->children.head = (lang_statement_union_type *) is; - } - else - { - is->header.next = NULL; - lang_statement_append (&os->children, - (lang_statement_union_type *) is, - &is->header.next); - } - } -} - -/* Read an import or export file. For an import file, this is called - by the before_allocation emulation routine. For an export file, - this is called by the parse_args emulation routine. */ - -static void -gldppcmacos_read_file (filename, import) - const char *filename; - boolean import; -{ - struct obstack *o; - FILE *f; - int lineno; - int c; - boolean keep; - const char *imppath; - const char *impfile; - const char *impmember; - - o = (struct obstack *) xmalloc (sizeof (struct obstack)); - obstack_specify_allocation (o, 0, 0, xmalloc, gldppcmacos_free); - - f = fopen (filename, FOPEN_RT); - if (f == NULL) - { - bfd_set_error (bfd_error_system_call); - einfo ("%F%s: %E\n", filename); - } - - keep = false; - - imppath = NULL; - impfile = NULL; - impmember = NULL; - - lineno = 0; - while ((c = getc (f)) != EOF) - { - char *s; - char *symname; - boolean syscall; - bfd_vma address; - struct bfd_link_hash_entry *h; - - if (c != '\n') - { - obstack_1grow (o, c); - continue; - } - - obstack_1grow (o, '\0'); - ++lineno; - - s = (char *) obstack_base (o); - while (isspace ((unsigned char) *s)) - ++s; - if (*s == '\0' - || *s == '*' - || (*s == '#' && s[1] == ' ') - || (! import && *s == '#' && s[1] == '!')) - { - obstack_free (o, obstack_base (o)); - continue; - } - - if (*s == '#' && s[1] == '!') - { - s += 2; - while (isspace ((unsigned char) *s)) - ++s; - if (*s == '\0') - { - imppath = NULL; - impfile = NULL; - impmember = NULL; - obstack_free (o, obstack_base (o)); - } - else if (*s == '(') - einfo ("%F%s%d: #! ([member]) is not supported in import files\n", - filename, lineno); - else - { - char cs; - char *file; - - (void) obstack_finish (o); - keep = true; - imppath = s; - file = NULL; - while (! isspace ((unsigned char) *s) && *s != '(' && *s != '\0') - { - if (*s == '/') - file = s + 1; - ++s; - } - if (file != NULL) - { - file[-1] = '\0'; - impfile = file; - if (imppath == file - 1) - imppath = "/"; - } - else - { - impfile = imppath; - imppath = ""; - } - cs = *s; - *s = '\0'; - while (isspace ((unsigned char) cs)) - { - ++s; - cs = *s; - } - if (cs != '(') - { - impmember = ""; - if (cs != '\0') - einfo ("%s:%d: warning: syntax error in import file\n", - filename, lineno); - } - else - { - ++s; - impmember = s; - while (*s != ')' && *s != '\0') - ++s; - if (*s == ')') - *s = '\0'; - else - einfo ("%s:%d: warning: syntax error in import file\n", - filename, lineno); - } - } - - continue; - } - - /* This is a symbol to be imported or exported. */ - symname = s; - syscall = false; - address = (bfd_vma) -1; - - while (! isspace ((unsigned char) *s) && *s != '\0') - ++s; - if (*s != '\0') - { - char *se; - - *s++ = '\0'; - - while (isspace ((unsigned char) *s)) - ++s; - - se = s; - while (! isspace ((unsigned char) *se) && *se != '\0') - ++se; - if (*se != '\0') - { - *se++ = '\0'; - while (isspace ((unsigned char) *se)) - ++se; - if (*se != '\0') - einfo ("%s%d: warning: syntax error in import/export file\n", - filename, lineno); - } - - if (strcasecmp (s, "svc") == 0 - || strcasecmp (s, "syscall") == 0) - syscall = true; - else - { - char *end; - - address = strtoul (s, &end, 0); - if (*end != '\0') - einfo ("%s:%d: warning: syntax error in import/export file\n", - filename, lineno); - } - } - - if (! import) - { - struct export_symbol_list *n; - - ldlang_add_undef (symname); - n = ((struct export_symbol_list *) - xmalloc (sizeof (struct export_symbol_list))); - n->next = export_symbols; - n->name = buystring (symname); - n->syscall = syscall; - export_symbols = n; - } - else - { - h = bfd_link_hash_lookup (link_info.hash, symname, false, false, - true); - if (h == NULL || h->type == bfd_link_hash_new) - { - /* We can just ignore attempts to import an unreferenced - symbol. */ - } - else - { - if (! bfd_xcoff_import_symbol (output_bfd, &link_info, h, - address, imppath, impfile, - impmember)) - einfo ("%X%s:%d: failed to import symbol %s: %E\n", - filename, lineno, symname); - } - } - - obstack_free (o, obstack_base (o)); - } - - if (obstack_object_size (o) > 0) - { - einfo ("%s:%d: warning: ignoring unterminated last line\n", - filename, lineno); - obstack_free (o, obstack_base (o)); - } - - if (! keep) - { - obstack_free (o, NULL); - free (o); - } -} - -/* This routine saves us from worrying about declaring free. */ - -static void -gldppcmacos_free (p) - PTR p; -{ - free (p); -} - -/* This is called by the before_allocation routine via - lang_for_each_statement. It looks for relocations and assignments - to symbols. */ - -static void -gldppcmacos_find_relocs (s) - lang_statement_union_type *s; -{ - if (s->header.type == lang_reloc_statement_enum) - { - lang_reloc_statement_type *rs; - - rs = &s->reloc_statement; - if (rs->name == NULL) - einfo ("%F%P: only relocations against symbols are permitted\n"); - if (! bfd_xcoff_link_count_reloc (output_bfd, &link_info, rs->name)) - einfo ("%F%P: bfd_xcoff_link_count_reloc failed: %E\n"); - } - - if (s->header.type == lang_assignment_statement_enum) - gldppcmacos_find_exp_assignment (s->assignment_statement.exp); -} - -/* Look through an expression for an assignment statement. */ - -static void -gldppcmacos_find_exp_assignment (exp) - etree_type *exp; -{ - struct bfd_link_hash_entry *h; - - switch (exp->type.node_class) - { - case etree_provide: - h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst, - false, false, false); - if (h == NULL) - break; - /* Fall through. */ - case etree_assign: - if (strcmp (exp->assign.dst, ".") != 0) - { - if (! bfd_xcoff_record_link_assignment (output_bfd, &link_info, - exp->assign.dst)) - einfo ("%P%F: failed to record assignment to %s: %E\n", - exp->assign.dst); - } - gldppcmacos_find_exp_assignment (exp->assign.src); - break; - - case etree_binary: - gldppcmacos_find_exp_assignment (exp->binary.lhs); - gldppcmacos_find_exp_assignment (exp->binary.rhs); - break; - - case etree_trinary: - gldppcmacos_find_exp_assignment (exp->trinary.cond); - gldppcmacos_find_exp_assignment (exp->trinary.lhs); - gldppcmacos_find_exp_assignment (exp->trinary.rhs); - break; - - case etree_unary: - gldppcmacos_find_exp_assignment (exp->unary.child); - break; - - default: - break; - } -} - -static char * -gldppcmacos_get_script(isfile) - int *isfile; -{ - *isfile = 0; - - if (link_info.relocateable == true && config.build_constructors == true) - return -"OUTPUT_FORMAT(\"xcoff-powermac\")\n\ -OUTPUT_ARCH(powerpc)\n\ -ENTRY(__start)\n\ -SECTIONS\n\ -{\n\ - .pad 0 : { *(.pad) }\n\ - .text 0 : {\n\ - *(.text)\n\ - *(.pr)\n\ - *(.ro)\n\ - *(.db)\n\ - *(.gl)\n\ - *(.xo)\n\ - *(.ti)\n\ - *(.tb)\n\ - }\n\ - .data 0 : {\n\ - *(.data)\n\ - *(.rw)\n\ - *(.sv)\n\ - *(.ua)\n\ - . = ALIGN(4);\n\ - CONSTRUCTORS\n\ - *(.ds)\n\ - *(.tc0)\n\ - *(.tc)\n\ - *(.td)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(.bs)\n\ - *(.uc)\n\ - *(COMMON)\n\ - }\n\ - .loader 0 : {\n\ - *(.loader)\n\ - }\n\ - .debug 0 : {\n\ - *(.debug)\n\ - }\n\ -}\n\n" - ; else if (link_info.relocateable == true) return -"OUTPUT_FORMAT(\"xcoff-powermac\")\n\ -OUTPUT_ARCH(powerpc)\n\ -ENTRY(__start)\n\ -SECTIONS\n\ -{\n\ - .pad 0 : { *(.pad) }\n\ - .text 0 : {\n\ - *(.text)\n\ - *(.pr)\n\ - *(.ro)\n\ - *(.db)\n\ - *(.gl)\n\ - *(.xo)\n\ - *(.ti)\n\ - *(.tb)\n\ - }\n\ - .data 0 : {\n\ - *(.data)\n\ - *(.rw)\n\ - *(.sv)\n\ - *(.ua)\n\ - . = ALIGN(4);\n\ - *(.ds)\n\ - *(.tc0)\n\ - *(.tc)\n\ - *(.td)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(.bs)\n\ - *(.uc)\n\ - *(COMMON)\n\ - }\n\ - .loader 0 : {\n\ - *(.loader)\n\ - }\n\ - .debug 0 : {\n\ - *(.debug)\n\ - }\n\ -}\n\n" - ; else if (!config.text_read_only) return -"OUTPUT_FORMAT(\"xcoff-powermac\")\n\ -OUTPUT_ARCH(powerpc)\n\ - SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\ -ENTRY(__start)\n\ -SECTIONS\n\ -{\n\ - .pad 0 : { *(.pad) }\n\ - .text : {\n\ - PROVIDE (_text = .);\n\ - *(.text)\n\ - *(.pr)\n\ - *(.ro)\n\ - *(.db)\n\ - *(.gl)\n\ - *(.xo)\n\ - *(.ti)\n\ - *(.tb)\n\ - PROVIDE (_etext = .);\n\ - }\n\ - .data 0 : {\n\ - PROVIDE (_data = .);\n\ - *(.data)\n\ - *(.rw)\n\ - *(.sv)\n\ - *(.ua)\n\ - . = ALIGN(4);\n\ - CONSTRUCTORS\n\ - *(.ds)\n\ - *(.tc0)\n\ - *(.tc)\n\ - *(.td)\n\ - PROVIDE (_edata = .);\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(.bs)\n\ - *(.uc)\n\ - *(COMMON)\n\ - PROVIDE (_end = .);\n\ - PROVIDE (end = .);\n\ - }\n\ - .loader 0 : {\n\ - *(.loader)\n\ - }\n\ - .debug 0 : {\n\ - *(.debug)\n\ - }\n\ -}\n\n" - ; else if (!config.magic_demand_paged) return -"OUTPUT_FORMAT(\"xcoff-powermac\")\n\ -OUTPUT_ARCH(powerpc)\n\ - SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\ -ENTRY(__start)\n\ -SECTIONS\n\ -{\n\ - .pad 0 : { *(.pad) }\n\ - .text : {\n\ - PROVIDE (_text = .);\n\ - *(.text)\n\ - *(.pr)\n\ - *(.ro)\n\ - *(.db)\n\ - *(.gl)\n\ - *(.xo)\n\ - *(.ti)\n\ - *(.tb)\n\ - PROVIDE (_etext = .);\n\ - }\n\ - .data 0 : {\n\ - PROVIDE (_data = .);\n\ - *(.data)\n\ - *(.rw)\n\ - *(.sv)\n\ - *(.ua)\n\ - . = ALIGN(4);\n\ - CONSTRUCTORS\n\ - *(.ds)\n\ - *(.tc0)\n\ - *(.tc)\n\ - *(.td)\n\ - PROVIDE (_edata = .);\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(.bs)\n\ - *(.uc)\n\ - *(COMMON)\n\ - PROVIDE (_end = .);\n\ - PROVIDE (end = .);\n\ - }\n\ - .loader 0 : {\n\ - *(.loader)\n\ - }\n\ - .debug 0 : {\n\ - *(.debug)\n\ - }\n\ -}\n\n" - ; else return -"OUTPUT_FORMAT(\"xcoff-powermac\")\n\ -OUTPUT_ARCH(powerpc)\n\ - SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\ -ENTRY(__start)\n\ -SECTIONS\n\ -{\n\ - .pad 0 : { *(.pad) }\n\ - .text : {\n\ - PROVIDE (_text = .);\n\ - *(.text)\n\ - *(.pr)\n\ - *(.ro)\n\ - *(.db)\n\ - *(.gl)\n\ - *(.xo)\n\ - *(.ti)\n\ - *(.tb)\n\ - PROVIDE (_etext = .);\n\ - }\n\ - .data 0 : {\n\ - PROVIDE (_data = .);\n\ - *(.data)\n\ - *(.rw)\n\ - *(.sv)\n\ - *(.ua)\n\ - . = ALIGN(4);\n\ - CONSTRUCTORS\n\ - *(.ds)\n\ - *(.tc0)\n\ - *(.tc)\n\ - *(.td)\n\ - PROVIDE (_edata = .);\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(.bs)\n\ - *(.uc)\n\ - *(COMMON)\n\ - PROVIDE (_end = .);\n\ - PROVIDE (end = .);\n\ - }\n\ - .loader 0 : {\n\ - *(.loader)\n\ - }\n\ - .debug 0 : {\n\ - *(.debug)\n\ - }\n\ -}\n\n" -; } - -struct ld_emulation_xfer_struct ld_ppcmacos_emulation = -{ - gldppcmacos_before_parse, - syslib_default, - hll_default, - after_parse_default, - gldppcmacos_after_open, - after_allocation_default, - set_output_arch_default, - ldemul_default_target, - gldppcmacos_before_allocation, - gldppcmacos_get_script, - "ppcmacos", - "xcoff-powermac", - 0, /* finish */ - 0, /* create_output_section_statements */ - 0, /* open_dynamic_archive */ - 0, /* place_orphan */ - 0, /* set_symbols */ - gldppcmacos_parse_args, - gldppcmacos_unrecognized_file -}; diff --git a/gnu/dist/ld/mpw-esh.c b/gnu/dist/ld/mpw-esh.c deleted file mode 100644 index 93bc5f54c72e..000000000000 --- a/gnu/dist/ld/mpw-esh.c +++ /dev/null @@ -1,315 +0,0 @@ -/* This file is is generated by a shell script. DO NOT EDIT! */ - -/* emulate the original gld for the given sh - Copyright (C) 1991, 1993 Free Software Foundation, Inc. - Written by Steve Chamberlain steve@cygnus.com - -This file is part of GLD, the Gnu Linker. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define TARGET_IS_sh - -#include "libiberty.h" -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" - -#include "ld.h" -#include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" -#include "ldmisc.h" - -static void gldsh_before_parse PARAMS ((void)); -static char *gldsh_get_script PARAMS ((int *isfile)); - -static void -gldsh_before_parse() -{ -#ifndef TARGET_ /* I.e., if not generic. */ - ldfile_output_architecture = bfd_arch_sh; -#endif /* not TARGET_ */ -} - -static char * -gldsh_get_script(isfile) - int *isfile; -{ - *isfile = 0; - - if (link_info.relocateable == true && config.build_constructors == true) - return -concat( -"OUTPUT_FORMAT(\"coff-sh\")\n\ -OUTPUT_ARCH(sh)\n\ -MEMORY\n\ -{\n\ - ram : o = 0x1000, l = 512k\n\ -}\n\ - "," SECTIONS\n\ -{\n\ - "," .text :\n\ - {\n\ - *(.text)\n\ - *(.strings)\n\ - } \n\ - .tors :\n\ - {\n\ - ___ctors = . ;\n\ - *(.ctors)\n\ - ___ctors_end = . ;\n\ - ___dtors = . ;\n\ - *(.dtors)\n\ - ___dtors_end = . ;\n\ - } \n\ - "," .data :\n\ - {\n\ - *(.data)\n\ - } \n\ - "," .bss :\n\ - {\n\ - *(.bss)\n\ - *(COMMON)\n\ - } \n\ - "," .stack :\n\ - {\n\ - *(.stack)\n\ - } \n\ - "," .stab 0 :\n\ - {\n\ - *(.stab)\n\ - }\n\ - "," .stabstr 0 :\n\ - {\n\ - *(.stabstr)\n\ - }\n\ -}\n\n", NULL) - ; else if (link_info.relocateable == true) return -concat ( -"OUTPUT_FORMAT(\"coff-sh\")\n\ -OUTPUT_ARCH(sh)\n\ - "," MEMORY\n\ -{\n\ - ram : o = 0x1000, l = 512k\n\ -}\n\ - "," SECTIONS\n\ -{\n\ - "," .text :\n\ - {\n\ - *(.text)\n\ - *(.strings)\n\ - } \n\ - "," .tors :\n\ - {\n\ - ___ctors = . ;\n\ - *(.ctors)\n\ - ___ctors_end = . ;\n\ - ___dtors = . ;\n\ - *(.dtors)\n\ - ___dtors_end = . ;\n\ - } \n\ - "," .data :\n\ - {\n\ - *(.data)\n\ - } \n\ - "," .bss :\n\ - {\n\ - *(.bss)\n\ - *(COMMON)\n\ - } \n\ - "," .stack :\n\ - {\n\ - *(.stack)\n\ - } \n\ - "," .stab 0 :\n\ - {\n\ - *(.stab)\n\ - }\n\ - "," .stabstr 0 :\n\ - {\n\ - *(.stabstr)\n\ - }\n\ -}\n\n", NULL) - ; else if (!config.text_read_only) return -concat ( -"OUTPUT_FORMAT(\"coff-sh\")\n\ -OUTPUT_ARCH(sh)\n\ -MEMORY\n\ -{\n\ - ram : o = 0x1000, l = 512k\n\ -}\n\ -SECTIONS\n\ -{\n\ - "," .text :\n\ - {\n\ - *(.text)\n\ - *(.strings)\n\ - _etext = . ; \n\ - } > ram\n\ - "," .tors :\n\ - {\n\ - ___ctors = . ;\n\ - *(.ctors)\n\ - ___ctors_end = . ;\n\ - ___dtors = . ;\n\ - *(.dtors)\n\ - ___dtors_end = . ;\n\ - } > ram\n\ - "," .data :\n\ - {\n\ - *(.data)\n\ - _edata = . ; \n\ - } > ram\n\ - "," .bss :\n\ - {\n\ - _bss_start = . ; \n\ - *(.bss)\n\ - *(COMMON)\n\ - _end = . ; \n\ - } > ram\n\ - "," .stack 0x30000 :\n\ - {\n\ - _stack = . ; \n\ - *(.stack)\n\ - } > ram\n\ - "," .stab 0 (NOLOAD) :\n\ - {\n\ - *(.stab)\n\ - }\n\ - "," .stabstr 0 (NOLOAD) :\n\ - {\n\ - *(.stabstr)\n\ - }\n\ -}\n\n", NULL) - ; else if (!config.magic_demand_paged) return -concat ( -"OUTPUT_FORMAT(\"coff-sh\")\n\ -OUTPUT_ARCH(sh)\n\ -MEMORY\n\ -{\n\ - ram : o = 0x1000, l = 512k\n\ -}\n\ -SECTIONS\n\ -{\n\ - "," .text :\n\ - {\n\ - *(.text)\n\ - *(.strings)\n\ - _etext = . ; \n\ - } > ram\n\ - "," .tors :\n\ - {\n\ - ___ctors = . ;\n\ - *(.ctors)\n\ - ___ctors_end = . ;\n\ - ___dtors = . ;\n\ - *(.dtors)\n\ - ___dtors_end = . ;\n\ - } > ram\n\ - "," .data :\n\ - {\n\ - *(.data)\n\ - _edata = . ; \n\ - } > ram\n\ - "," .bss :\n\ - {\n\ - _bss_start = . ; \n\ - *(.bss)\n\ - *(COMMON)\n\ - _end = . ; \n\ - } > ram\n\ - "," .stack 0x30000 :\n\ - {\n\ - _stack = . ; \n\ - *(.stack)\n\ - } > ram\n\ - "," .stab 0 (NOLOAD) :\n\ - {\n\ - *(.stab)\n\ - }\n\ - "," .stabstr 0 (NOLOAD) :\n\ - {\n\ - *(.stabstr)\n\ - }\n\ -}\n\n", NULL) - ; else return -concat ( -"OUTPUT_FORMAT(\"coff-sh\")\n\ -OUTPUT_ARCH(sh)\n\ -MEMORY\n\ -{\n\ - ram : o = 0x1000, l = 512k\n\ -}\n\ -SECTIONS\n\ -{\n\ - "," .text :\n\ - {\n\ - *(.text)\n\ - *(.strings)\n\ - _etext = . ; \n\ - } > ram\n\ - "," .tors :\n\ - {\n\ - ___ctors = . ;\n\ - *(.ctors)\n\ - ___ctors_end = . ;\n\ - ___dtors = . ;\n\ - *(.dtors)\n\ - ___dtors_end = . ;\n\ - } > ram\n\ - "," .data :\n\ - {\n\ - *(.data)\n\ - _edata = . ; \n\ - } > ram\n\ - "," .bss :\n\ - {\n\ - _bss_start = . ; \n\ - *(.bss)\n\ - *(COMMON)\n\ - _end = . ; \n\ - } > ram\n\ - "," .stack 0x30000 :\n\ - {\n\ - _stack = . ; \n\ - *(.stack)\n\ - } > ram\n\ - "," .stab 0 (NOLOAD) :\n\ - {\n\ - *(.stab)\n\ - }\n\ - "," .stabstr 0 (NOLOAD) :\n\ - {\n\ - *(.stabstr)\n\ - }\n\ -}\n\n", NULL) -; } - -struct ld_emulation_xfer_struct ld_sh_emulation = -{ - gldsh_before_parse, - syslib_default, - hll_default, - after_parse_default, - after_open_default, - after_allocation_default, - set_output_arch_default, - ldemul_default_target, - before_allocation_default, - gldsh_get_script, - "sh", - "coff-sh" -}; diff --git a/gnu/dist/ld/mpw-idtmips.c b/gnu/dist/ld/mpw-idtmips.c deleted file mode 100644 index b8450e06eccf..000000000000 --- a/gnu/dist/ld/mpw-idtmips.c +++ /dev/null @@ -1,430 +0,0 @@ -/* This file is is generated by a shell script. DO NOT EDIT! */ - -/* Handle embedded relocs for MIPS. - Copyright 1994 Free Software Foundation, Inc. - Written by Ian Lance Taylor based on generic.em. - -This file is part of GLD, the Gnu Linker. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define TARGET_IS_mipsidt - -#include "libiberty.h" -#include "bfd.h" -#include "sysdep.h" -#include "bfdlink.h" - -#include "ld.h" -#include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" -#include "ldmisc.h" - -static void gldmipsidt_before_parse PARAMS ((void)); -static void gldmipsidt_after_open PARAMS ((void)); -static void check_sections PARAMS ((bfd *, asection *, PTR)); -static void gldmipsidt_after_allocation PARAMS ((void)); -static char *gldmipsidt_get_script PARAMS ((int *isfile)); - -static void -gldmipsidt_before_parse() -{ -#ifndef TARGET_ /* I.e., if not generic. */ - ldfile_output_architecture = bfd_arch_mips; -#endif /* not TARGET_ */ -} - -/* This function is run after all the input files have been opened. - We create a .rel.sdata section for each input file with a non zero - .sdata section. The BFD backend will fill in these sections with - magic numbers which can be used to relocate the data section at run - time. This will only do the right thing if all the input files - have been compiled using -membedded-pic. */ - -static void -gldmipsidt_after_open () -{ - bfd *abfd; - - if (! command_line.embedded_relocs - || link_info.relocateable) - return; - - for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next) - { - asection *datasec; - - datasec = bfd_get_section_by_name (abfd, ".sdata"); - - /* Note that we assume that the reloc_count field has already - been set up. We could call bfd_get_reloc_upper_bound, but - that returns the size of a memory buffer rather than a reloc - count. We do not want to call bfd_canonicalize_reloc, - because although it would always work it would force us to - read in the relocs into BFD canonical form, which would waste - a significant amount of time and memory. */ - if (datasec != NULL && datasec->reloc_count > 0) - { - asection *relsec; - - relsec = bfd_make_section (abfd, ".rel.sdata"); - if (relsec == NULL - || ! bfd_set_section_flags (abfd, relsec, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY)) - || ! bfd_set_section_alignment (abfd, relsec, 2) - || ! bfd_set_section_size (abfd, relsec, - datasec->reloc_count * 4)) - einfo ("%F%B: can not create .rel.sdata section: %E\n"); - } - - /* Double check that all other data sections are empty, as is - required for embedded PIC code. */ - bfd_map_over_sections (abfd, check_sections, (PTR) datasec); - } -} - -/* Check that of the data sections, only the .sdata section has - relocs. This is called via bfd_map_over_sections. */ - -static void -check_sections (abfd, sec, sdatasec) - bfd *abfd; - asection *sec; - PTR sdatasec; -{ - if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0 - && sec != (asection *) sdatasec - && sec->reloc_count != 0) - einfo ("%F%X: section %s has relocs; can not use --embedded-relocs\n", - abfd, bfd_get_section_name (abfd, sec)); -} - -/* This function is called after the section sizes and offsets have - been set. If we are generating embedded relocs, it calls a special - BFD backend routine to do the work. */ - -static void -gldmipsidt_after_allocation () -{ - bfd *abfd; - - if (! command_line.embedded_relocs - || link_info.relocateable) - return; - - for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next) - { - asection *datasec, *relsec; - char *errmsg; - - datasec = bfd_get_section_by_name (abfd, ".sdata"); - - if (datasec == NULL || datasec->reloc_count == 0) - continue; - - relsec = bfd_get_section_by_name (abfd, ".rel.sdata"); - ASSERT (relsec != NULL); - - if (! bfd_mips_ecoff_create_embedded_relocs (abfd, &link_info, - datasec, relsec, - &errmsg)) - { - if (errmsg == NULL) - einfo ("%B%X: can not create runtime reloc information: %E\n", - abfd); - else - einfo ("%X%B: can not create runtime reloc information: %s\n", - abfd, errmsg); - } - } -} - -static char * -gldmipsidt_get_script(isfile) - int *isfile; -{ - *isfile = 0; - - if (link_info.relocateable == true && config.build_constructors == true) - return -concat( -"OUTPUT_FORMAT(\"ecoff-bigmips\", \"ecoff-bigmips\",\n\ - \"ecoff-littlemips\")\n\ - SEARCH_DIR(/usr/local/mips-idt-ecoff/lib);\n\ -ENTRY(start)\n\ -SECTIONS\n\ -{\n\ - .text : {\n\ - ;\n\ - *(.init)\n\ - ;\n\ - *(.text)\n\ - *(.rel.sdata)\n\ - *(.fini)\n\ - ;\n\ - ;\n\ - }\n\ - "," .rdata : {\n\ - *(.rdata)\n\ - }\n\ - .data : {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - .lit8 : {\n\ - *(.lit8)\n\ - }\n\ - .lit4 : {\n\ - *(.lit4)\n\ - }\n\ - "," .sdata : {\n\ - *(.sdata)\n\ - }\n\ - .sbss : {\n\ - *(.sbss)\n\ - *(.scommon)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ -}\n\n", NULL) - ; else if (link_info.relocateable == true) return -"OUTPUT_FORMAT(\"ecoff-bigmips\", \"ecoff-bigmips\",\n\ - \"ecoff-littlemips\")\n\ - SEARCH_DIR(/usr/local/mips-idt-ecoff/lib);\n\ -ENTRY(start)\n\ -SECTIONS\n\ -{\n\ - .text : {\n\ - ;\n\ - *(.init)\n\ - ;\n\ - *(.text)\n\ - *(.rel.sdata)\n\ - *(.fini)\n\ - ;\n\ - ;\n\ - }\n\ - .rdata : {\n\ - *(.rdata)\n\ - }\n\ - .data : {\n\ - *(.data)\n\ - }\n\ - .lit8 : {\n\ - *(.lit8)\n\ - }\n\ - .lit4 : {\n\ - *(.lit4)\n\ - }\n\ - .sdata : {\n\ - *(.sdata)\n\ - }\n\ - .sbss : {\n\ - *(.sbss)\n\ - *(.scommon)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ -}\n\n" - ; else if (!config.text_read_only) return -concat( -"OUTPUT_FORMAT(\"ecoff-bigmips\", \"ecoff-bigmips\",\n\ - \"ecoff-littlemips\")\n\ - SEARCH_DIR(/usr/local/mips-idt-ecoff/lib);\n\ -ENTRY(start)\n\ -SECTIONS\n\ -{\n\ - . = 0xa0012000;\n\ - .text : {\n\ - _ftext = . ;\n\ - *(.init)\n\ - eprol = .;\n\ - *(.text)\n\ - PROVIDE (__runtime_reloc_start = .);\n\ - *(.rel.sdata)\n\ - PROVIDE (__runtime_reloc_stop = .);\n\ - *(.fini)\n\ - etext = .;\n\ - _etext = .;\n\ -"," }\n\ - . = .;\n\ - .rdata : {\n\ - *(.rdata)\n\ - }\n\ - _fdata = ALIGN(16);\n\ - .data : {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - _gp = ALIGN(16) + 0x8000;\n\ - .lit8 : {\n\ - *(.lit8)\n\ - }\n\ - .lit4 : {\n\ - *(.lit4)\n\ - }\n\ - .sdata : {\n\ - *(.sdata)\n\ - }\n\ -"," edata = .;\n\ - _edata = .;\n\ - _fbss = .;\n\ - .sbss : {\n\ - *(.sbss)\n\ - *(.scommon)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - end = .;\n\ - _end = .;\n\ -}\n\n" -, NULL) - ; else if (!config.magic_demand_paged) return -concat ( -"OUTPUT_FORMAT(\"ecoff-bigmips\", \"ecoff-bigmips\",\n\ - \"ecoff-littlemips\")\n\ - SEARCH_DIR(/usr/local/mips-idt-ecoff/lib);\n\ -ENTRY(start)\n\ -SECTIONS\n\ -{\n\ - . = 0xa0012000;\n\ - .text : {\n\ - _ftext = . ;\n\ - *(.init)\n\ - eprol = .;\n\ - *(.text)\n\ - PROVIDE (__runtime_reloc_start = .);\n\ - *(.rel.sdata)\n\ - PROVIDE (__runtime_reloc_stop = .);\n\ - *(.fini)\n\ - etext = .;\n\ - _etext = .;\n\ - "," }\n\ - . = .;\n\ - .rdata : {\n\ - *(.rdata)\n\ - }\n\ - _fdata = ALIGN(16);\n\ - .data : {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - _gp = ALIGN(16) + 0x8000;\n\ - .lit8 : {\n\ - *(.lit8)\n\ - "," }\n\ - .lit4 : {\n\ - *(.lit4)\n\ - }\n\ - .sdata : {\n\ - *(.sdata)\n\ - }\n\ - edata = .;\n\ - _edata = .;\n\ - _fbss = .;\n\ - .sbss : {\n\ - *(.sbss)\n\ - *(.scommon)\n\ - "," }\n\ - .bss : {\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - end = .;\n\ - _end = .;\n\ -}\n\n" -, NULL) - ; else return -concat ( -"OUTPUT_FORMAT(\"ecoff-bigmips\", \"ecoff-bigmips\",\n\ - \"ecoff-littlemips\")\n\ - SEARCH_DIR(/usr/local/mips-idt-ecoff/lib);\n\ -ENTRY(start)\n\ -SECTIONS\n\ -{\n\ - . = 0xa0012000;\n\ - .text : {\n\ - _ftext = . ;\n\ - *(.init)\n\ - eprol = .;\n\ - *(.text)\n\ - PROVIDE (__runtime_reloc_start = .);\n\ - *(.rel.sdata)\n\ - PROVIDE (__runtime_reloc_stop = .);\n\ - *(.fini)\n\ - etext = .;\n\ - _etext = .;\n\ - "," }\n\ - . = .;\n\ - .rdata : {\n\ - *(.rdata)\n\ - }\n\ - _fdata = ALIGN(16);\n\ - .data : {\n\ - *(.data)\n\ - CONSTRUCTORS\n\ - }\n\ - _gp = ALIGN(16) + 0x8000;\n\ - .lit8 : {\n\ - *(.lit8)\n\ - }\n\ - .lit4 : {\n\ - *(.lit4)\n\ - "," }\n\ - .sdata : {\n\ - *(.sdata)\n\ - }\n\ - edata = .;\n\ - _edata = .;\n\ - _fbss = .;\n\ - .sbss : {\n\ - *(.sbss)\n\ - *(.scommon)\n\ - }\n\ - .bss : {\n\ - *(.bss)\n\ - *(COMMON)\n\ - }\n\ - end = .;\n\ - _end = .;\n\ -}\n\n" -, NULL) -; } - -struct ld_emulation_xfer_struct ld_mipsidt_emulation = -{ - gldmipsidt_before_parse, - syslib_default, - hll_default, - after_parse_default, - gldmipsidt_after_open, - gldmipsidt_after_allocation, - set_output_arch_default, - ldemul_default_target, - before_allocation_default, - gldmipsidt_get_script, - "mipsidt", - "ecoff-bigmips" -}; diff --git a/gnu/dist/ld/mpw-make.sed b/gnu/dist/ld/mpw-make.sed deleted file mode 100644 index c91970839a9c..000000000000 --- a/gnu/dist/ld/mpw-make.sed +++ /dev/null @@ -1,95 +0,0 @@ -# Sed commands to finish translating the ld Makefile.in into MPW syntax. - -/HDEFINES/s/@HDEFINES@// - -/^target_alias = @target_alias@/s/^/#/ - -/^EMUL = @EMUL@/s/^/#/ - -/^EMULATION_OFILES = @EMULATION_OFILES@/s/^/#/ - -# Fixadd to the include paths. -/^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/ -/BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": / -/INCDIR/s/-i {INCDIR} /-i "{INCDIR}": / - -# Use byacc instead of bison (for now anyway). -/BISON/s/^BISON =.*$/BISON = byacc/ -#/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = / - -# Suppress the suppression of smart makes. -/^\.y\.c/d - -# Hack up ldmain compile. -/^"{o}"ldmain.c.o \\Option-f .* config.status$/,/^$/c\ -"{o}"ldmain.c.o \\Option-f "{s}"ldmain.c\ - {CC} @DASH_C_FLAG@ -d DEFAULT_EMULATION={dq}{EMUL}{dq} -d SCRIPTDIR={dq}{scriptdir}{dq} {ALL_CFLAGS} "{s}"ldmain.c -o "{o}"ldmain.c.o\ - - -# Remove ldemul-list.h build, rely on configure to make one. -/^ldemul-list.h /,/Rename -y "{s}"ldemul-tmp.h /d - -# Fix pathnames to generated files. -/config.h/s/"{s}"config\.h/"{o}"config.h/g -/config.h/s/^config\.h/"{o}"config.h/ - -/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g -/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/ -/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g -/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/ - -/ldgram.c/s/"{s}"ldgram\.c/"{o}"ldgram.c/g -/ldgram.c/s/^ldgram\.c/"{o}"ldgram.c/ - -/ldgram.h/s/"{s}"ldgram\.h/"{o}"ldgram.h/g -/ldgram.h/s/^ldgram\.h/"{o}"ldgram.h/ - -/ldlex.c/s/"{s}"ldlex\.c/"{o}"ldlex.c/g -/ldlex.c/s/^ldlex\.c/"{o}"ldlex.c/ - -/ldlex.c.new/s/"{s}"ldlex\.c\.new/"{o}"ldlex.c.new/g - -/lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g - -/ldemul-list.h/s/"{s}"ldemul-list\.h/"{o}"ldemul-list.h/g -/ldemul-list.h/s/^ldemul-list\.h/"{o}"ldemul-list.h/ - -# Edit pathnames to emulation files. -/"{s}"e.*\.c/s/"{s}"e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/g -/^e.*\.c/s/^e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/ - -# We can't run genscripts, so don't try. -/{GENSCRIPTS}/s/{GENSCRIPTS}/null-command/ - -# Comment out the TDIRS bits. -/^TDIRS@/s/^/#/ - -# Point at the BFD library directly. -/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/ - -# Don't need this. -/@HLDFLAGS@/s/@HLDFLAGS@// - -#/sed.*free/,/> "{o}"ldlex.c.new/c\ -# \ Catenate "{o}"lex.yy.c >"{o}"ldlex.c.new - -# The resource file is called mac-ld.r. -/{LD_PROG}.r/s/{LD_PROG}\.r/mac-ld.r/ - -/^install \\Option-f /,/^$/c\ -install \\Option-f all install-only\ -\ -install-only \\Option-f\ - NewFolderRecursive "{bindir}"\ - Duplicate -y :ld.new "{bindir}"ld\ - - -# Remove dependency rebuilding crud. -/^.dep /,/# .PHONY /d - -# Remove the lintlog action, pipe symbols in column 1 lose. -/^lintlog \\Option-f/,/^$/d - -/^Makefile \\Option-f/,/^$/d -/^"{o}"config.h \\Option-f/,/^$/d -/^config.status \\Option-f/,/^$/d diff --git a/gnu/dist/ld/scripttempl/elfmips.sc b/gnu/dist/ld/scripttempl/elfmips.sc deleted file mode 100644 index 9dae3e534834..000000000000 --- a/gnu/dist/ld/scripttempl/elfmips.sc +++ /dev/null @@ -1,207 +0,0 @@ -# -# Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) -# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start -# OTHER_READONLY_SECTIONS - other than .text .init .rodata ... -# (e.g., .PARISC.milli) -# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... -# (e.g., .PARISC.global) -# OTHER_SECTIONS - at the end -# EXECUTABLE_SYMBOLS - symbols that must be defined for an -# executable (e.g., _DYNAMIC_LINK) -# TEXT_START_SYMBOLS - symbols that appear at the start of the -# .text section. -# DATA_START_SYMBOLS - symbols that appear at the start of the -# .data section. -# OTHER_BSS_SYMBOLS - symbols that appear at the start of the -# .bss section besides __bss_start. -# EMBEDDED - whether this is for an embedded system. -# -# When adding sections, do note that the names of some sections are used -# when specifying the start address of the next. -# - -# We use a start address of __start for Irix 5 and GNU/Linux/MIPS, -# _start for other targets. This is for compatibility with Irix 5, -# and with old MIPS ELF toolchains. -if [ -z "$ENTRY" ]; then - case "${target}" in - mips*-*-irix5*) ENTRY=__start ;; - mips*-*-linux*) ENTRY=__start ;; - *) ENTRY=_start ;; - esac -fi - -# if this is for an embedded system, don't add SIZEOF_HEADERS. -if [ -z "$EMBEDDED" ]; then - test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" -else - test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}" -fi - -test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} -test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} -test "$LD_FLAG" = "N" && DATA_ADDR=. -INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -cat <> config.h -echo #define NEED_psignal 1 >> config.h -goto exit - -:h8300 -echo Configuring libiberty for H8/300 -copy Makefile.dos Makefile - -:exit diff --git a/gnu/dist/libiberty/mpw-config.in b/gnu/dist/libiberty/mpw-config.in deleted file mode 100644 index 2a21802148d6..000000000000 --- a/gnu/dist/libiberty/mpw-config.in +++ /dev/null @@ -1,7 +0,0 @@ -# MPW configuration fragment for libiberty. - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h - - diff --git a/gnu/dist/libiberty/mpw-make.sed b/gnu/dist/libiberty/mpw-make.sed deleted file mode 100644 index 6f2a5e77b2bd..000000000000 --- a/gnu/dist/libiberty/mpw-make.sed +++ /dev/null @@ -1,51 +0,0 @@ -# Sed commands to finish translating libiberty's Unix makefile to MPW syntax. - -# Comment out a useless thing. -/^\.always\./s/^/#/ - -# Replace the auto-generated list with the list of what we know we need. -s/`cat needed-list`/"{o}"alloca.c.o "{o}"bcopy.c.o "{o}"getpagesize.c.o "{o}"insque.c.o "{o}"mpw.c.o "{o}"strcasecmp.c.o "{o}"strdup.c.o "{o}"strncasecmp.c.o/ - -# Paste in some desirable definitions. -# The default rule here completely replaces the tricky stuff in the Unix -# Makefile.in. -/^###$/a\ -\ -HDEFINES = -d NEED_sys_siglist -d NEED_sys_errlist -d NEED_basename -d NEED_strcasecmp -d NEED_strncasecmp\ -INCLUDES = -i : -i {INCDIR}: -i {INCDIR}:mpw: -i ::extra-include: -i "{s}"\ -\ -.c.o \\Option-f .c\ - {CC} @DASH_C_FLAG@ {DepDir}{Default}.c {LIBCFLAGS} {INCLUDES} {HDEFINES} @SEGMENT_FLAG({Default})@ -o {TargDir}{Default}.c.o\ - -# Remove dependency on needed-list, which we don't use. -/DO_ALSO =/s/needed-list// - -/INCDIR=/s/"{srcdir}"{MULTISRCTOP}::/"{topsrcdir}"/ - -# Whack out the COMPILE.c trickiness. -/^COMPILE.c /,/^$/d - -# Remove the multido trickiness from the "all" target. -/^all \\Option-f/,/^$/c\ -all \\Option-f {TARGETLIB}\ - - -# Remove the RULE1/RULE2 crud. -/if \[/,/fi/d -/^RULE1 =/,/RULE2 =/d -/RULE2/s/RULE2/TARGETLIB/ - -# Don't want fdmatch ever. -s/ "{o}"fdmatch.c.o// - -# Fix paths to generated files. -/config.h/s/"{s}"config.h/"{o}"config.h/ - -# Whack out config rebuild rules. -/^"{o}"config.h \\Option-f/,/^$/d - - - - - - diff --git a/gnu/dist/libiberty/vmsbuild.com b/gnu/dist/libiberty/vmsbuild.com deleted file mode 100644 index 4fede380bfd6..000000000000 --- a/gnu/dist/libiberty/vmsbuild.com +++ /dev/null @@ -1,165 +0,0 @@ -$! libiberty/vmsbuild.com -- build liberty.olb for VMS host, VMS target -$! -$ CC = "gcc /noVerbose/Debug/Incl=([],[-.include])" -$ LIBR = "library /Obj" -$ LINK = "link" -$ DELETE= "delete /noConfirm" -$ SEARCH= "search /Exact" -$ ECHO = "write sys$output" -$ ABORT = "exit %x002C" -$! -$ LIB_NAME = "liberty.olb" !this is what we're going to construct -$ WORK_LIB = "new-lib.olb" !used to guard against an incomplete build -$ -$! manually copied from Makefile.in -$ REQUIRED_OFILES = "argv.o basename.o choose-temp.o concat.o cplus-dem.o "- - + "fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o "- - + "floatformat.o objalloc.o obstack.o spaces.o strerror.o strsignal.o "- - + "xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o" -$! anything not caught by link+search of dummy.* should be added here -$ EXTRA_OFILES = "" -$! -$! move to the directory which contains this command procedure -$ old_dir = f$environ("DEFAULT") -$ new_dir = f$parse("_._;",f$environ("PROCEDURE")) - "_._;" -$ set default 'new_dir' -$ -$ ECHO "Starting libiberty build..." -$ create config.h -/* libiberty config.h for VMS */ -#define NEED_sys_siglist -#define NEED_strsignal -#define NEED_psignal -#define NEED_basename -$ LIBR 'WORK_LIB' /Create -$ -$! first pass: compile "required" modules -$ ofiles = REQUIRED_OFILES + " " + EXTRA_OFILES -$ pass = 1 -$ gosub do_ofiles -$ -$! second pass: process dummy.c, using the first pass' results -$ ECHO " now checking run-time library for missing functionality" -$ if f$search("dummy.obj").nes."" then DELETE dummy.obj;* -$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc -$ define/noLog sys$output _NL: ! driver's use of multiple image activation -$ on error then continue -$ 'CC' dummy.c -$ deassign sys$error !restore, more or less -$ deassign sys$output -$ if f$search("dummy.obj").eqs."" then goto pass2_failure1 -$! link dummy.obj, capturing full linker feedback in dummy.map -$ oldmsg = f$environ("MESSAGE") -$ set message /Facility/Severity/Identification/Text -$ define/User sys$output _NL: -$ define/User sys$error _NL: -$ LINK/Map=dummy.map/noExe dummy.obj,'WORK_LIB'/Libr,- - gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr -$ set message 'oldmsg' -$ if f$search("dummy.map").eqs."" then goto pass2_failure2 -$ DELETE dummy.obj;* -$ SEARCH dummy.map "%LINK-I-UDFSYM" /Output=dummy.list -$ DELETE dummy.map;* -$ ECHO " check completed" -$! we now have a file with one entry per line of unresolvable symbols -$ ofiles = "" -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ open/Read ifile$ dummy.list -$iloop: read/End=idone ifile$ iline -$ iline = f$edit(iline,"COMPRESS,TRIM,LOWERCASE") -$ ofiles = ofiles + " " + f$element(1," ",iline) + ".o" -$ goto iloop -$idone: close ifile$ -$ DELETE dummy.list;* -$ on error then ABORT -$ -$! third pass: compile "missing" modules collected in pass 2 -$ pass = 3 -$ gosub do_ofiles -$ -$! finish up -$ LIBR 'WORK_LIB' /Compress /Output='LIB_NAME' !new-lib.olb -> liberty.olb -$ DELETE 'WORK_LIB';* -$ -$! all done -$ ECHO "Completed libiberty build." -$ type sys$input: - - You many wish to do - $ COPY LIBERTY.OLB GNU_CC:[000000] - so that this run-time library resides in the same location as gcc's - support library. When building gas, be sure to leave the original - copy of liberty.olb here so that gas's build procedure can find it. - -$ set default 'old_dir' -$ exit -$ -$! -$! compile each element of the space-delimited list 'ofiles' -$! -$do_ofiles: -$ ofiles = f$edit(ofiles,"COMPRESS,TRIM") -$ i = 0 -$oloop: -$ f = f$element(i," ",ofiles) -$ if f.eqs." " then goto odone -$ f = f - ".o" !strip dummy suffix -$ ECHO " ''f'" -$ skip_f = 0 -$ if pass.eq.3 .and. f$search("''f'.c").eqs."" then gosub chk_deffunc -$ if .not.skip_f -$ then -$ 'CC' 'f'.c -$ LIBR 'WORK_LIB' 'f'.obj /Insert -$ DELETE 'f'.obj;* -$ endif -$ i = i + 1 -$ goto oloop -$odone: -$ return -$ -$! -$! check functions.def for a DEFFUNC() entry corresponding to missing file 'f'.c -$! -$chk_deffunc: -$ define/User sys$output _NL: -$ define/User sys$error _NL: -$ SEARCH functions.def "DEFFUNC","''f'" /Match=AND -$ if (($status.and.%x7FFFFFFF) .eq. 1) -$ then -$ skip_f = 1 -$ open/Append config_h config.h -$ write config_h "#define NEED_''f'" -$ close config_h -$ endif -$ return -$ -$! -$pass2_failure1: -$! if we reach here, dummy.c failed to compile and we're really stuck -$ type sys$input: - - Cannot compile the library contents checker (dummy.c + functions.def), - so cannot continue! - -$! attempt the compile again, without suppressing diagnostic messages this time -$ on error then ABORT +0*f$verify(v) -$ v = f$verify(1) -$ 'CC' dummy.c -$ ABORT +0*f$verify(v) !'f$verify(0)' -$! -$pass2_failure2: -$! should never reach here.. -$ type sys$input: - - Cannot link the library contents checker (dummy.obj), so cannot continue! - -$! attempt the link again, without suppressing diagnostic messages this time -$ on error then ABORT +0*f$verify(v) -$ v = f$verify(1) -$ LINK/Map=dummy.map/noExe dummy.obj,'WORK_LIB'/Libr,- - gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr -$ ABORT +0*f$verify(v) !'f$verify(0)' -$ -$! not reached -$ exit diff --git a/gnu/dist/makeall.bat b/gnu/dist/makeall.bat deleted file mode 100644 index d2d415f0a49a..000000000000 --- a/gnu/dist/makeall.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -chdir libiberty -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\bfd -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\opcodes -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\gprof -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\binutils -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\gas -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir ..\ld -make %1 %2 %3 %4 %5 %6 %7 %8 %9 -chdir .. diff --git a/gnu/dist/makefile.vms b/gnu/dist/makefile.vms deleted file mode 100644 index 164b57a07256..000000000000 --- a/gnu/dist/makefile.vms +++ /dev/null @@ -1,37 +0,0 @@ -# -# makefile for bfd, binutils and gas -# -# Created by Klaus K"ampf (kkaempf@progis.de) -# -# You must use Version 3.75p (proGIS enhanced) of GNU Make -# -# -CC = gcc - -all: - $$ @setup - $(CD) [.bfd] - gmake "CC=$(CC)" - $(CD) [-.opcodes] - gmake "CC=$(CC)" - $(CD) [-.libiberty] - gmake "CC=$(CC)" - $(CD) [-.binutils] - gmake "CC=$(CC)" - $(CD) [-.gas] - gmake "CC=$(CC)" - $(CD) [-] - -clean: - $(CD) [.bfd] - gmake clean - $(CD) [-.opcodes] - gmake clean - $(CD) [-.libiberty] - gmake clean - $(CD) [-.binutils] - gmake clean - $(CD) [-.gas] - gmake clean - $(CD) [-] - diff --git a/gnu/dist/mpw-README b/gnu/dist/mpw-README deleted file mode 100644 index 767140b5b263..000000000000 --- a/gnu/dist/mpw-README +++ /dev/null @@ -1,376 +0,0 @@ -This is basic information about the Macintosh(tm) MPW(tm) port of the -GNU tools. The information below applies to both native and cross -compilers. - -(Please note that there are two versions of this file; "mpw-README" -is the source form, and "Read Me for MPW" is the distribution form. -"Read Me for MPW" has 8-bit chars such as \Option-d embedded in it.) - -INSTALLING GNU TOOLS - -* System Requirements - -To use these tools, you will need a Mac with a 68020 or better or else -any PowerMac, System 7.1 or later, and MPW 3.3 or 3.4. You will *not* -need any other MPW compiler unless you want to rebuild from sources, -nor even any include files, unless you are building actual Mac -applications. For PowerMac native you will need PPCLink, however; -also the executables are PowerPC-only. - -* Automated Installation - -The simplest way to install GNU tools is to run the Install script. -The script will copy things to where you want to keep them, will build -a UserStartup file with settings corresponding to where things were -copied, and offer to put that UserStartup file in your MPW folder. - -The Install script does not alter anything in the System Folder, and -it does not take any action without confirmation. - -The Install script will be at the top level of the binary -distribution, or at the top level of the object directory if -rebuilding from source. (The sources include a file called -"mpw-install" at the top level, but it is the source to the Install -script and cannot be run directly.) - -* Manual Installation - -If you don't want to run the Install script, you can do installation -manually; this section describes the steps involved. - -The GNU tools can go in any directory that is in your {Commands} list. -We generally put all the tools somewhere like {Boot}Cygnus:latest:bin, -and then add to a UserStartup file: - - set Commands "{Boot}Cygnus:latest:bin:,{Commands}" - -However, the cpp and cc1 programs of GCC are not normally stored here. -Instead, they will be in a "lib" directory that is alongside "bin", -and organized by target and version underneath, with names like - - :lib:gcc-lib::cygnus-: - -If you build and install everything yourself according to the build -instructions below, then you will not have any problems. However, you -may discover that GCC seems unable to find the right cpp and cc1; -usually this will be because directory names have changed. (Even -renaming your hard disk will make this happen.) In such cases, you -have several choices. One is just to add this directory to -{Commands}, but then you will not be able to get any other cpp or cc1, -such as those used by a different target or version. Another way is -to rename your disk and directories to match the prefix used when the -tools were compiled. Finally, you can set the variable -GCC_EXEC_PREFIX to point to the library directory: - - set GCC_EXEC_PREFIX MyDisk:Stuff:lib:gcc-lib: - export GCC_EXEC_PREFIX - -You may also want to edit MPW's HEXA 128 resource. When GCC is built -using a native GCC, it is compiled to use a special stack allocator -function alloca(). While this is very efficient, it means that GCC -will need considerable stack space to run, especially when compiling -large programs with optimization turned on. You give MPW more stack -by editing the HEXA 128 resource of the MPW Shell. A value of "0008 -0000" gives 512K of stack size, which is usually sufficient. - -USING GNU TOOLS - -* Using Native PowerMac GCC - -Using a native PowerMac GCC to produce MPW tools or MacOS applications -is more complicated than just "gC foo.c", although no more complicated -than with other Mac compilers. - -To build a native PowerMac MPW tool, use this sequence, where hello.c -is the usual "hello world" program, and genericcfrg.r is the Rez file -with the code fragment resource: - -gC -I{CIncludes} -fno-builtin -Dpascal= -c -g hello.c -PPCLink hello.o -o hello \Option-d - "{PPCLibraries}"StdCRuntime.o \Option-d - "{SharedLibraries}"InterfaceLib \Option-d - "{SharedLibraries}"StdCLib \Option-d - "{PPCLibraries}"PPCToolLibs.o \Option-d - "{PPCLibraries}"PPCCRuntime.o \Option-d - "{GCCPPCLibraries}"libgcc.xcoff -rez -d APPNAME='"'hello'"' GenericCFRG.r -o hello -setfile -t 'MPST' -c 'MPS ' hello - -The same sequence works to build a MacOS application, but you set the file -type to 'APPL' and don't link in PPCToolLibs.o. For further details on -using MPW to build Mac applications, see the general MPW documentation. - -Recent versions of PPCLink have an option to generate the code -fragment resource and automatically set creator and file type; -here is what GenericCFRG.r should look like if you have an older -PPCLink or are using GNU ld: - -#include "CodeFragmentTypes.r" - -resource 'cfrg' (0) { - { - kPowerPC, - kFullLib, - kNoVersionNum,kNoVersionNum, - 0,0, - kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork, - APPNAME // must be defined on Rez command line with -d option - } -}; - -In general this port of GCC supports the same option syntax and -behavior as its Unix counterpart. It also has similar compilation -rules, so it will run the assembler on .s files and so forth. - -The GCC manual includes full information on the available options. -One option that may be especially useful is "-v", which shows you what -tools and options are being used; unlike most Mac C compilers, GCC -directs assembly and linking in addition to compilation. - -MPW GCC does feature two extensions to the option syntax; '-d macro=name' -works just as '-Dmacro=name' does in Unix, and '-i directory' works the -same as '-Idirectory'. - -MPW GCC supports the usual Pascal-style strings and alignment pragmas. - -To find standard include files you can set the variable GCCIncludes: - - set GCCIncludes MyDisk:MyIncludes: - export GCCIncludes - -GCCIncludes is similar to MPW's CIncludes or CW's MWCIncludes. In -order to use MPW's usual include files, just say: - - set GCCIncludes "{CIncludes}" - export GCCIncludes - -* Using GCC as a Cross-Compiler - -If you have a cross-compiler, and you have all of the correct -target-side crt0 and libraries available, then to compile and link a -file "foo.c", you can say just - - gC foo.c - -The output file will be an MPW binary file named "a.out"; the format -of the contents will depend on which target is in use, so for instance -a MIPS-targeting GCC will produce ECOFF or ELF executables. - -Note that using MPW include files with a cross-compiler is somewhat -dangerous. - -* Using the Assembler and Friends - -The assembler ("as") and linker ("ld") are faithful ports of their -Unix counterparts. Similarly, the binutils "ar", "cplusfilt", "nm", -"objcopy", "objdump", "ranlib", "size", "strings", and "strip" are all -like they are under Unix. (Note that "cplusfilt" is usually called -"c++filt" under Unix.) - -* Using GDB - -There are two flavors of GDB. "gdb" is an MPW tool that works very -much like it does in Unix; put a command into the MPW worksheet and -type the key to send it to GDB. While "gdb" is running, you -cannot do anything else in MPW, although you can switch to other -Mac applications and use them. - -"SiowGDB" is also a Mac application, but it is GDB using the SIOW -package to provide console emulation. Commands are exactly as for the -MPW tool, but since this is its own application, you can switch -between it and MPW. - -BUILDING GNU TOOLS - -This port of the GNU tools uses a configure script similar to -that used for GNU tools under Unix, but rewritten for MPW. As with -Unix configuration, there is an "object" directory that may be -different from the "source" directory. In the example commands below, -we will assume that we are currently in the object directory, and that -the source directory is "{Boot}Cygnus:src:". - -* Requirements for Building - -In addition to the sources, you will need a set of tools that the -configure and build scripts assume to be available. These tools -(and their versions, if relevant) are as follows: - - byacc tool - flex (2.3.7) tool (and Flex.skel file) - forward-include script - MoveIfChange script - mpw-touch script - mpw-true script - NewFolderRecursive script - null-command script - open-brace script - sed (1.13) tool - tr-7to8 script - true script - -The scripts are in the sources, under utils:mpw:. You must arrange to -get the other tools yourself (they are readily available from the -"usual" net sites, and are also on many CDROMS). In addition, there -will usually be a set of these available at ftp.cygnus.com, in pub/mac. - -You may put the build tools in your usual Tools or Scripts -directories, or keep them in a separate directories. We prefer to -make a directory called "buildtools" and we put this in one of our -UserStartup files: - - set Commands "{Boot}Cygnus:buildtools:,{Commands}" - -Flex uses an environment variable FLEX_SKELETON to locate its skeleton -file, so you need to do something like this, preferably in a UserStartup: - - Set FLEX_SKELETON "{Boot}"Cygnus:buildtools:Flex.skel - Export FLEX_SKELETON - -* Configuring - -Before you can build anything, you must configure. You do this by -creating an directory where object files will be stored, setdirectory -to that directory and do a configure command: - - {Boot}Cygnus:src:mpw-configure --target --cc --srcdir {Boot}Cygnus:src: --prefix - -If the source directory is not in your {Commands} list, then you must -supply a full pathname to mpw-configure, since mpw-configure invokes -itself after switching into each subdirectory. Using a relative -pathname, even something like ':mpw-configure', will therefore not work. - - must be a known target. Valid ones include "m68k-apple-macos", -"powerpc-apple-macos", "i386-unknown-go32", "mips-idt-ecoff", and -"sh-hitachi-hms". Not all target types are accepted for all of the -tools yet. - - must be the name of the compiler to use. It defaults to "mpwc". - - (m68k) - mpwc MPW C - sc68k Symantec C - mwc68k Metrowerks C (Codewarrior) - gcc68k GCC - - (powerpc) - ppcc PPCC - mrc Macintosh on RisC (Mister C, aka(?) Frankenstein) - scppc Symantec C - mwcppc Metrowerks C (Codewarrior) - gccppc GCC - -Not all compilers will compile all tools equally well! For m68k Macs, -MPW C has the best record so far (it has problems, but they can be -worked around), while for PowerMacs, CodeWarrior is the only compiler -that has successfully compiled everything into running code. - - is the path that "gcc" will prepend when looking for tools -to execute. GCC_EXEC_PREFIX overrides this value, so you need not -include it if you plan to use GCC_EXEC_PREFIX. - -As an example, here is the configure line that you could use to build -native PowerMac GCC: - -"{Boot}"Cygnus:src:mpw-configure --cc mwcppc --target powerpc-apple-macos --srcdir "{Boot}"Cygnus:src: --prefix "{Boot}"GNUTools: - -* Building - -If you use CodeWarrior, you *must* first set MWCIncludes to -{CIncludes}. This is because you will be building MPW tools, and -their standard I/O works by making references to data that is part of -the MPW Shell, which means that the code must be compiled and linked -with macros that refer to that data, and those macros are in -{CIncludes}, not the default {MWCIncludes}. Without this change, you -will encounter problems compiling libiberty/mpw.c, but tweaking that -file only masks the real problem, and does not fix it. - -The command - - mpw-build - -will build everything. Building will take over an hour on a Quadra 800 -or PowerMac 8100/110, longer if the sources are on a shared volume. - -You may see some warnings; these are mostly likely benign, typically -disagreements about declarations of library and system functions. - -* Installing - -To install the just-built tools, use the command - - mpw-build install - -This part of the installation procedure just copies files to the -location specified at configure time by , and, in some cases, -renames them from temporary internal names to their usual names. This -install process is *not* the same as what the Install script does; -Install can copy tools from the installation location chosen at -configuration time to a user-chosen place, and sets up a UserStartup -file. Note that while the Install script is optional, the install -build action performs some tasks would be very hard to replicate -manually, so you should always do it before using the tools. - -* Known Problems With Using Various Compilers to Build - -Most versions of MPW C have problems with compiling GNU software. - -MPW C 3.2.x has preprocessing bugs that render it incapable of -compiling the BFD library, so it can't be used at all for building BFD. - -MPW C 3.3, 3.3.1, and 3.3.2 will spontaneously claim to have found -errors in the source code, but in fact the code is perfectly fine. If -this happens, just set the working directory back to the top-level -objdir (where the configure command above was performed), and type -"mpw-build all" again. If it goes on through the supposed error, then -you got one of the spurious errors. A full build may require a number -of these restarts. - -MPW C 3.3.3 seems to work OK, at least with the aid of a number of -workarounds that are in the sources (look for #ifdef MPW_C). - -Versions of MPW Make earlier than 4.0d2 have exhibited bizarre behavior, -failure to substitute variables and the like. - -Metrowerks CW6 PPC linker (MWLinkPPC) seems to do bad things with memory -if the "Modern Memory Manager" is turned on (in the Memory control panel), -but works OK if it is turned off. - -Metrowerks CW6 loses bigtime compiling opcodes:ppc-opc.c, which has -some deeply nested macros. (CW7 is OK.) There is a way to patch the -file, by substituting constant values. If you need to do this, -contact shebs@cygnus.com for details. - - is missing from {CIncludes} in the MPW version that comes -with CW7. You can just copy the one in CW7's {MWCIncludes}. - -CW8 and later have changes to headers and such that will require changes -to the source in order to be able to use them to rebuild. - -KNOWN BUGS - -The declarations for memcpy and memcmp in some versions of header files -may conflict with GCC's builtin definition. Either use -fno-builtin -or ignore the warnings. - -This is not a bug, but - watch out for cr/nl translation! For instance, -if config/mpw-mh-mpw is not properly translated because it has been -copied or updated separately, then everything will almost build, but -you will get puzzling error messages from make or the compiler. - -'/' or ' ' embedded in any device, directory, or file name may or may -not work. - -objcopy -O srec foo.o makes random output filenames. - -Mac-x-mips requires -mgas but Unix hosts don't. - -GDB will frequently require a '/' on the front of a device name in order -to recognize it as an absolute rather than a relative pathname. - -GDB doesn't seem to use the printer port correctly, although it tries. - -The cursor doesn't always spin as much as it should. To get elaborate -statistics and warnings about spin rates, add this to UserStartup: - - set MEASURE_SPIN all - export MEASURE_SPIN diff --git a/gnu/dist/mpw-build.in b/gnu/dist/mpw-build.in deleted file mode 100644 index 86d9530fa3b5..000000000000 --- a/gnu/dist/mpw-build.in +++ /dev/null @@ -1,204 +0,0 @@ -# Top-level script fragment to build everything for MPW. - -Set savedir "`Directory`" - -#Set Echo 1 - -Set ThisScript "{0}" - -Set objdir ":" - -Set verify 0 - -Set BuildTarget "none" - -# Parse arguments. - -Loop - Break If {#} == 0 - If "{BuildTarget}" =~ /none/ - Set BuildTarget "{1}" - Else - Echo Only one build target allowed, ignoring "{1}" - End If - Shift 1 -End Loop - -If "{BuildTarget}" =~ /none/ - Set BuildTarget "all" -End If - -If {verify} == 1 - Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ... -End If - -Set ranmake 0 - -If "`Exists Makefile`" != "" - Echo "Set Echo 1" >{BuildTarget}.makeout - Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout - {BuildTarget}.makeout - Delete {BuildTarget}.makeout - Set ranmake 1 -End If - -If "`Exists Makefile.PPC`" != "" - Echo "Set Echo 1" >{BuildTarget}.makeout.ppc - Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc - {BuildTarget}.makeout.ppc - Delete {BuildTarget}.makeout.ppc - Set ranmake 1 -End If - -If {ranmake} == 1 - Exit -End If - -# Dispatch on various pseudo-targets. - -If "{BuildTarget}" =~ /all/ - Echo Started `Date` - "{ThisScript}" all-gcc - "{ThisScript}" all-gdb - Echo Finished `Date` -Else If "{BuildTarget}" =~ /all-libiberty/ - "{ThisScript}" do-libiberty -Else If "{BuildTarget}" =~ /all-bfd/ - "{ThisScript}" do-bfd -Else If "{BuildTarget}" =~ /all-opcodes/ - "{ThisScript}" do-opcodes -Else If "{BuildTarget}" =~ /all-byacc/ - "{ThisScript}" do-byacc -Else If "{BuildTarget}" =~ /all-flex/ - "{ThisScript}" all-libiberty - "{ThisScript}" do-flex -Else If "{BuildTarget}" =~ /all-binutils/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-bfd - "{ThisScript}" all-opcodes - "{ThisScript}" do-binutils -Else If "{BuildTarget}" =~ /all-gas/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-bfd - "{ThisScript}" all-opcodes - "{ThisScript}" do-gas -Else If "{BuildTarget}" =~ /all-gcc/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-gas - "{ThisScript}" all-binutils - "{ThisScript}" all-ld - "{ThisScript}" do-gcc -Else If "{BuildTarget}" =~ /all-gdb/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-bfd - "{ThisScript}" all-opcodes - "{ThisScript}" do-gdb -Else If "{BuildTarget}" =~ /all-grez/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-bfd - "{ThisScript}" do-grez -Else If "{BuildTarget}" =~ /all-ld/ - "{ThisScript}" all-libiberty - "{ThisScript}" all-bfd - "{ThisScript}" all-opcodes - "{ThisScript}" do-ld -Else If "{BuildTarget}" =~ /do-byacc/ - SetDirectory :byacc: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-flex/ - SetDirectory :flex: - ::mpw-build _bootstrap - ::mpw-build all -Else If "{BuildTarget}" =~ /do-bfd/ - SetDirectory :bfd: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-libiberty/ - SetDirectory :libiberty: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-opcodes/ - SetDirectory :opcodes: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-binutils/ - SetDirectory :binutils: - ::mpw-build stamps - ::mpw-build all -Else If "{BuildTarget}" =~ /do-gas/ - SetDirectory :gas: - ::mpw-build stamps - ::mpw-build all -Else If "{BuildTarget}" =~ /do-gcc/ - SetDirectory :gcc: - :mpw-build all -Else If "{BuildTarget}" =~ /do-gdb/ - SetDirectory :gdb: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-grez/ - SetDirectory :grez: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-ld/ - SetDirectory :ld: - ::mpw-build all -Else If "{BuildTarget}" =~ /do-newlib/ - SetDirectory :newlib: - ::mpw-build all -Else If "{BuildTarget}" =~ /install/ - "{ThisScript}" install-only-top - "{ThisScript}" install-binutils - "{ThisScript}" install-gas - "{ThisScript}" install-gcc - "{ThisScript}" install-ld - "{ThisScript}" install-gdb -Else If "{BuildTarget}" =~ /install-binutils/ - SetDirectory :binutils: - ::mpw-build install -Else If "{BuildTarget}" =~ /install-gas/ - SetDirectory :gas: - ::mpw-build install -Else If "{BuildTarget}" =~ /install-gcc/ - SetDirectory :gcc: - :mpw-build install -Else If "{BuildTarget}" =~ /install-gdb/ - SetDirectory :gdb: - ::mpw-build install -Else If "{BuildTarget}" =~ /install-grez/ - SetDirectory :grez: - ::mpw-build install -Else If "{BuildTarget}" =~ /install-ld/ - SetDirectory :ld: - ::mpw-build install -Else If "{BuildTarget}" =~ /install-only/ - "{ThisScript}" install-only-top - "{ThisScript}" install-only-binutils - "{ThisScript}" install-only-gas - "{ThisScript}" install-only-gcc - "{ThisScript}" install-only-gdb - "{ThisScript}" install-only-ld -Else If "{BuildTarget}" =~ /install-only-binutils/ - SetDirectory :binutils: - ::mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-gas/ - SetDirectory :gas: - ::mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-gcc/ - SetDirectory :gcc: - :mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-gdb/ - SetDirectory :gdb: - ::mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-grez/ - SetDirectory :grez: - ::mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-ld/ - SetDirectory :ld: - ::mpw-build install-only -Else If "{BuildTarget}" =~ /install-only-top/ - NewFolderRecursive "{prefix}" - If "{prefix}" != "`Directory`" - Duplicate -y 'Read Me for MPW' "{prefix}"'Read Me for MPW' - Duplicate -y Install "{prefix}"Install - End If -Else - Echo {BuildTarget} not understood, ignoring -End If - -SetDirectory "{savedir}" diff --git a/gnu/dist/mpw-config.in b/gnu/dist/mpw-config.in deleted file mode 100644 index 8028737a8b61..000000000000 --- a/gnu/dist/mpw-config.in +++ /dev/null @@ -1,113 +0,0 @@ -# Configuration fragment for Cygnus source tree. - -# Check that we can find all the special tools that we will need. -# The test for sed is semi-pointless, because it's already been invoked -# by the calculation of target_cpu in the main configure script, but -# the test will also show which one is being used. - -Set Exit 0 -Echo byacc is `Which byacc` -Echo flex is `Which flex` -Echo forward-include is `Which forward-include` -Echo MoveIfChange is `Which MoveIfChange` -Echo mpw-touch is `Which mpw-touch` -Echo mpw-true is `Which mpw-true` -Echo NewFolderRecursive is `Which NewFolderRecursive` -Echo null-command is `Which null-command` -Echo open-brace is `Which open-brace` -Echo sed is `Which sed` -Echo 'tr-7to8' is `Which tr-7to8` -Echo true is `Which true` -Set Exit 1 - -Set host_libs "mmalloc libiberty opcodes bfd readline gash tcl tk tclX" - -Set host_tools "texinfo byacc flex bison binutils ld gas gcc gdb make patch \Option-d - prms send-pr gprof gdbtest tgas etc expect dejagnu sim bash \Option-d - m4 autoconf ispell grep diff rcs cvs fileutils shellutils time \Option-d - textutils wdiff find emacs emacs19 uudecode hello tar gzip indent \Option-d - recode release sed utils guile perl apache inet gawk" - -Set target_libs "newlib" - -Set target_tools "examples" - -# Configure the resource compiler if targeting Macs. -If {target_os} =~ /macos/ || {target_os} =~ /mpw/ - Set host_tools "{host_tools} grez" -End If - -Set configdirs "{host_libs} {host_tools} {target_libs} {target_tools}" -Export configdirs - -# Make up a special include directory that tools will share. - -If "`Exists "{objdir}"extra-include`" == "" - NewFolder "{objdir}"extra-include -End If - -Set edir "{objdir}extra-include:" - -forward-include "{srcdir}"include:mpw:sys:file.h "{edir}"'sys/file.h' -forward-include "{srcdir}"include:mpw:sys:ioctl.h "{edir}"'sys/ioctl.h' -forward-include "{srcdir}"include:mpw:sys:param.h "{edir}"'sys/param.h' -forward-include "{srcdir}"include:mpw:sys:resource.h "{edir}"'sys/resource.h' -forward-include "{srcdir}"include:mpw:sys:stat.h "{edir}"'sys/stat.h' -forward-include "{srcdir}"include:mpw:sys:time.h "{edir}"'sys/time.h' -forward-include "{srcdir}"include:mpw:sys:types.h "{edir}"'sys/types.h' - -forward-include "{srcroot}"include:aout:aout64.h "{edir}"'aout/aout64.h' -forward-include "{srcroot}"include:aout:ar.h "{edir}"'aout/ar.h' -forward-include "{srcroot}"include:aout:ranlib.h "{edir}"'aout/ranlib.h' -forward-include "{srcroot}"include:aout:reloc.h "{edir}"'aout/reloc.h' -forward-include "{srcroot}"include:aout:stab.def "{edir}"'aout/stab.def' -forward-include "{srcroot}"include:aout:stab_gnu.h "{edir}"'aout/stab_gnu.h' - -If "`Exists "{srcroot}"include:aout:"{target_cpu}".h`" != "" - forward-include "{srcroot}"include:aout:"{target_cpu}".h "{edir}"'aout/'"{target_cpu}"'.h' -End If - -forward-include "{srcroot}"include:coff:ecoff.h "{edir}"'coff/ecoff.h' -forward-include "{srcroot}"include:coff:internal.h "{edir}"'coff/internal.h' -forward-include "{srcroot}"include:coff:sym.h "{edir}"'coff/sym.h' -forward-include "{srcroot}"include:coff:symconst.h "{edir}"'coff/symconst.h' - -If "`Exists "{srcroot}"include:coff:"{target_cpu}".h`" != "" - forward-include "{srcroot}"include:coff:"{target_cpu}".h "{edir}"'coff/'"{target_cpu}"'.h' -End If -If "{target_cpu}" =~ /powerpc/ - forward-include "{srcroot}"include:coff:rs6000.h "{edir}"'coff/rs6000.h' -End If - -forward-include "{srcroot}"include:elf:common.h "{edir}"'elf/common.h' -forward-include "{srcroot}"include:elf:dwarf.h "{edir}"'elf/dwarf.h' -forward-include "{srcroot}"include:elf:dwarf2.h "{edir}"'elf/dwarf2.h' -forward-include "{srcroot}"include:elf:external.h "{edir}"'elf/external.h' -forward-include "{srcroot}"include:elf:internal.h "{edir}"'elf/internal.h' - -# Believe it or not, GDB needs this for all targets. -forward-include "{srcroot}"include:elf:mips.h "{edir}"'elf/mips.h' - -If "`Exists "{srcroot}"include:elf:"{target_cpu}".h`" != "" - forward-include "{srcroot}"include:elf:"{target_cpu}".h "{edir}"'elf/'"{target_cpu}"'.h' -End If -If "{target_cpu}" =~ /powerpc/ - forward-include "{srcroot}"include:elf:ppc.h "{edir}"'elf/ppc.h' -End If - -If "`Exists "{srcroot}"include:opcode:"{target_cpu}".h`" != "" - forward-include "{srcroot}"include:opcode:"{target_cpu}".h "{edir}"'opcode/'"{target_cpu}"'.h' -End If -If "{target_cpu}" =~ /powerpc/ - forward-include "{srcroot}"include:opcode:ppc.h "{edir}"'opcode/ppc.h' -End If - -# Add some bfd includes that get mentioned outside the bfd dir. - -forward-include "{srcroot}"bfd:libcoff.h "{edir}"'bfd/libcoff.h' -forward-include "{srcroot}"bfd:libecoff.h "{edir}"'bfd/libecoff.h' - -# Translate random files into MPW-only character set. - -tr-7to8 "{srcdir}"mpw-README > "{objdir}Read Me for MPW" -tr-7to8 "{srcdir}"mpw-install > "{objdir}"Install diff --git a/gnu/dist/mpw-configure b/gnu/dist/mpw-configure deleted file mode 100644 index cf45148ec636..000000000000 --- a/gnu/dist/mpw-configure +++ /dev/null @@ -1,448 +0,0 @@ -# Configuration script -# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -### WARNING -### This script must NOT use any 8-bit chars! -### WARNING - -# This is an MPW Shell script that sets everything up for compilation, -# mainly creating directories, and editing copies of files. - -Set savedir "`Directory`" - -#Set Echo 1 - -Set ThisScript "{0}" - -Set srcroot "--------" - -Set srcdir ":" - -Set objdir ":" - -Set prefix "{MPW}":GNUTools: - -Set exec_prefix "" - -Set bindir "" - -Set host_alias "m68k-apple-mpw" - -Set target_alias {host_alias} - -Set host_cc "mpwc" - -Set with_gnu_ld 0 - -Set helpoutput 0 - -Set recurse 1 - -Set verify 0 -Set verifystr "" - -Set enable_options "" -Set disable_options "" - -# Parse arguments. - -Loop - Break If {#} == 0 - If "{1}" =~ /--cc/ - Set host_cc "{2}" - Shift 1 - Else If "{1}" =~ /--bindir/ - Set bindir "{2}" - Shift 1 - Else If "{1}" =~ /--disable-?+/ - Set `Echo {1} | sed -e 's/--disable-/enable_/'` no - Set disable_options "{disable_options} '{1}'" - Else If "{1}" =~ /--enable-?+/ - Set `Echo {1} | sed -e 's/--enable-/enable_/'` yes - Set enable_options "{enable_options} '{1}'" - Else If "{1}" =~ /--exec-prefix/ - Set exec_prefix "{2}" - Shift 1 - Else If "{1}" =~ /--help/ - Set helpoutput 1 - Else If "{1}" =~ /--host/ - Set host_alias "{2}" - Shift 1 - Else If "{1}" =~ /--norecursion/ - Set recurse 0 - Else If "{1}" =~ /--prefix/ - Set prefix "{2}" - Shift 1 - Else If "{1}" =~ /--srcdir/ - Set srcdir "{2}" - Shift 1 - Else If "{1}" =~ /--srcroot/ - Set srcroot "{2}" - Shift 1 - Else If "{1}" =~ /--target/ - Set target_alias "{2}" - Shift 1 - Else If "{1}" =~ /-v/ - Set verify 1 - Set verifystr "-v" - Else If "{1}" =~ /--with-gnu-ld/ - Set with_gnu_ld 1 - Else - Echo -n 'mpw-configure: Unrecognized option: "' - Echo -n "{1}" - Echo '"; use --help for usage.' - Exit 1 - End If - Shift 1 -End Loop - -If {helpoutput} == 1 - Echo "Usage: mpw-configure [OPTIONS]" - Echo "" - Echo "Options: [defaults in brackets]" - Echo "--bindir DIR directory for binaries []" - Echo "--cc CC use C compiler CC [mpwc]" - Echo "--disable-FOO do not include feature FOO" - Echo "--enable-FOO include feature FOO" - Echo "--exec-prefix DIR install host-dependent files into DIR []" - Echo "--help print this message" - Echo "--host HOST configure for HOST [m68k-apple-mpw]" - Echo "--norecursion configure this directory only [recurse]" - Echo "--prefix DIR install into DIR [{MPW}:GNUTools:]" - Echo "--srcdir DIR find the sources in DIR [:]" - Echo "--srcroot DIR find the toplevel sources in DIR [:]" - Echo "--target TARGET configure for TARGET [TARGET=HOST]" - Echo "-v verbose" - Echo "--with-gnu-ld link using GNU ld [no]" - Exit 0 -End If - -Set Exit 0 - -# Default exec_prefix from prefix. - -If "{exec_prefix}" == "" - Set exec_prefix "{prefix}" -End If - -If "{bindir}" == "" - Set bindir "{prefix}"bin: -End If - -# Point to the correct set of tools to use with the chosen compiler. - -If "{host_cc}" =~ /mpwc/ - Set host_alias "m68k-apple-mpw" - Set cc_name '{CC_MPW_C}' - Set segment_flag '-s ' - Set ar_name '{AR_LIB}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_LINK}' - Set prog_ext_name '{PROG_EXT_68K}' - Set extralibs_name '{EXTRALIBS_C}' - Set makepef_name '{MAKEPEF_NULL}' - Set rez_name '{REZ_68K}' -Else If "{host_cc}" =~ /sc68k/ - Set host_alias "m68k-apple-mpw" - Set cc_name '{CC_SC}' - Set segment_flag '-s ' - Set ar_name '{AR_LIB}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_LINK}' - Set prog_ext_name '{PROG_EXT_68K}' - Set extralibs_name '{EXTRALIBS_C}' - Set makepef_name '{MAKEPEF_NULL}' - Set rez_name '{REZ_68K}' -Else If "{host_cc}" =~ /mwc68k/ - Set host_alias "m68k-apple-mpw" - Set cc_name '{CC_MWC68K}' - Set segment_flag '-s ' - Set ar_name '{AR_MWLINK68K}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_MWLINK68K}' - Set prog_ext_name '{PROG_EXT_68K}' - Set extralibs_name '{EXTRALIBS_MWC68K}' - Set makepef_name '{MAKEPEF_NULL}' - Set rez_name '{REZ_68K}' -Else If "{host_cc}" =~ /gcc68k/ - Set host_alias "m68k-apple-mpw" - Set cc_name '{CC_68K_GCC}' - Set segment_flag '-s ' - Set ar_name '{AR_68K_AR}' - Set ranlib_name '{RANLIB_RANLIB}' - Set cc_ld_name '{CC_68K_GCC}' - Set prog_ext_name '{PROG_EXT_68K}' - Set extralibs_name '{EXTRALIBS_C}' - Set makepef_name '{MAKEPEF_NULL}' - Set rez_name '{REZ_68K}' -Else If "{host_cc}" =~ /ppcc/ - Set host_alias "powerpc-apple-mpw" - Set cc_name '{CC_PPCC}' - Set segment_flag '-d ___s_e_g___=' - Set ar_name '{AR_PPCLINK}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_PPCLINK}' - Set prog_ext_name '{PROG_EXT_XCOFF}' - Set extralibs_name '{EXTRALIBS_PPC}' - Set makepef_name '{MAKEPEF_PPC}' - Set rez_name '{REZ_PPC}' -Else If "{host_cc}" =~ /mrc/ - Set host_alias "powerpc-apple-mpw" - Set cc_name '{CC_MRC}' - Set segment_flag '-d ___s_e_g___=' - Set ar_name '{AR_PPCLINK}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_PPCLINK}' - Set prog_ext_name '{PROG_EXT_XCOFF}' - Set extralibs_name '{EXTRALIBS_PPC}' - Set makepef_name '{MAKEPEF_PPC}' - Set rez_name '{REZ_PPC}' -Else If "{host_cc}" =~ /scppc/ - Set host_alias "powerpc-apple-mpw" - Set cc_name '{CC_SC}' - Set segment_flag '-d ___s_e_g___=' - Set ar_name '{AR_PPCLINK}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_PPCLINK}' - Set prog_ext_name '{PROG_EXT_XCOFF}' - Set extralibs_name '{EXTRALIBS_PPC}' - Set makepef_name '{MAKEPEF_PPC}' - Set rez_name '{REZ_PPC}' -Else If "{host_cc}" =~ /mwcppc/ - Set host_alias "powerpc-apple-mpw" - Set cc_name '{CC_MWCPPC}' - Set segment_flag '-d ___s_e_g___=' - Set ar_name '{AR_MWLINKPPC}' - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_MWLINKPPC}' - # Misleading, but we don't need a PEF step. - Set prog_ext_name '{PROG_EXT_68K}' - Set extralibs_name '{EXTRALIBS_MWCPPC}' - Set makepef_name '{MAKEPEF_NULL}' - Set rez_name '{REZ_PPC}' -Else If "{host_cc}" =~ /gccppc/ - Set host_alias "powerpc-apple-mpw" - Set cc_name '{CC_PPC_GCC}' - Set segment_flag '-d ___s_e_g___=' - Set ar_name '{AR_PPCLINK}' - If {with_gnu_ld} == 1 - Set ranlib_name '{RANLIB_RANLIB}' - Set cc_ld_name '{CC_LD_GLD}' - Else - Set ranlib_name '{RANLIB_NULL}' - Set cc_ld_name '{CC_LD_PPCLINK}' - End If - Set prog_ext_name '{PROG_EXT_XCOFF}' - Set extralibs_name '{EXTRALIBS_PPC}' - Set makepef_name '{MAKEPEF_PPC}' - Set rez_name '{REZ_PPC}' -Else - Echo "{host_cc}" is not a known MPW compiler type -End If - -Set dash_c_flag '' -If "{host_cc}" =~ /gcc68k/ - Set dash_c_flag '-c' -Else If "{host_cc}" =~ /gccppc/ - Set dash_c_flag '-c' -End If - -# (should interpret aliases if not in canonical form) - -Set host_canonical "{host_alias}" - -Set target_canonical "{target_alias}" - -Set configdirs "" - -If "{srcroot}" =~ /--------/ - Set srcroot "{srcdir}" -End If -If "`Exists "{srcdir}"`" == "" - Echo Source directory {srcdir} does not exist! - Exit 1 -End If -If "`Exists "{srcroot}"`" == "" - Echo Top-level source directory {srcroot} does not exist! - Exit 1 -End If - -Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`" -Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`" -Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`" - -# Create a file that is guaranteed to be older than any other here. - -If "`Exists "{objdir}"_oldest`" == "" - mpw-touch _oldest -End If - -# Record this before creating any files, makefiles sometimes mention -# dependencies on config.status. - -Echo "# This directory was configured as follows:" >config.new -Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir} --srcroot {srcroot} --prefix {prefix} --cc {host_cc} {verifystr} {enable_options} {disable_options} --norecursion" >>config.new -MoveIfChange config.new config.status - -If "`Exists "{srcdir}"mpw-config.in`" != "" - tr-7to8 "{srcdir}"mpw-config.in >"{objdir}"mpw-config.in - Execute "{objdir}"mpw-config.in -End If - -# Start Makefile construction by defining all the variables chosen by -# configuration. - -Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem -Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem -Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem -Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem -Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem -Echo "mpw_exec_prefix = " {exec_prefix} >> "{objdir}"Makefile.tem -Echo "mpw_bindir = " {bindir} >> "{objdir}"Makefile.tem -Echo "host_alias = " {host_alias} >> "{objdir}"Makefile.tem -Echo "target_alias = " {target_alias} >> "{objdir}"Makefile.tem -Echo "target_cpu = " {target_cpu} >> "{objdir}"Makefile.tem -Echo "target_vendor = " {target_vendor} >> "{objdir}"Makefile.tem -Echo "target_os = " {target_os} >> "{objdir}"Makefile.tem -Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem -Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem -Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem -Echo "CC = " {cc_name} >> "{objdir}"Makefile.tem -Echo "AR = " {ar_name} >> "{objdir}"Makefile.tem -Echo "RANLIB = " {ranlib_name} >> "{objdir}"Makefile.tem -Echo "CC_LD = " {cc_ld_name} >> "{objdir}"Makefile.tem -Echo "PROG_EXT = " {prog_ext_name} >> "{objdir}"Makefile.tem -Echo "EXTRALIBS = " {extralibs_name} >> "{objdir}"Makefile.tem -Echo "MAKEPEF = " {makepef_name} >> "{objdir}"Makefile.tem -Echo "REZ = " {rez_name} >> "{objdir}"Makefile.tem - -If {host_cc} =~ /gccppc/ - Echo -n "dq =\Option-d\Option-d\Option-d" > "{objdir}"Makefile.tem0 - Echo '"' >> "{objdir}"Makefile.tem0 - tr-7to8 "{objdir}"Makefile.tem0 >>"{objdir}"Makefile.tem -Else - Echo -n "dq ='" >> "{objdir}"Makefile.tem - Echo -n '"' >> "{objdir}"Makefile.tem - Echo "'" >> "{objdir}"Makefile.tem -End If - -# Append the master set of definitions for the various compilers. - -If "`Exists "{srcdir}"config:mpw-mh-mpw`" != "" - tr-7to8 "{srcdir}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem -Else If "`Exists "{srcroot}"config:mpw-mh-mpw`" != "" - tr-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem -Else - Echo "can't find a host config file!" - Exit 0 -End If - -# Append anything produced by the directory's mpw-config.in. - -If "`Exists "{objdir}"mk.tmp`" != "" - Catenate "{objdir}"mk.tmp >>"{objdir}"Makefile.tem - # An mpw-config.in might change so as not to create this - # anymore, so get rid of it now to be safe. - Delete -i -y "{objdir}"mk.tmp -End If - -# If there are sed scripts to edit the Unix Makefile.in, use them; otherwise -# use an mpw-make.in if present. - -If "`Exists "{srcdir}"mpw-make.sed`" != "" - If "`Exists "{objdir}"hacked_Makefile.in`" != "" - Set MakefileIn "{objdir}"hacked_Makefile.in - Else - Set MakefileIn "{srcdir}"Makefile.in - End If - # Find the generic makefile editing script. - If "`Exists "{srcroot}"config:mpw:g-mpw-make.sed`" != "" - sed -f "{srcroot}"config:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 - Else If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != "" - sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 - Else If "`Exists "{srcdir}"g-mpw-make.sed`" != "" - sed -f "{srcdir}"g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 - Else - Echo Warning: g-mpw-make.sed not found, copying "{MakefileIn}" verbatim... - Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1 - End If - sed -f "{srcdir}"mpw-make.sed "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 - sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' -e 's/^bindir = @bindir@/bindir = {mpw_bindir}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3 - sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}\1/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in - tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem - If "`Exists "{objdir}"mk.sed`" != "" - sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 - Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem - End If - MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile - Delete -i -y "{objdir}"Makefile.tem[12] - If {verify} == 1 - Echo Created Makefile in "`Directory`" - End If -Else If "`Exists "{srcdir}"mpw-make.in`" != "" - sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' "{srcdir}"mpw-make.in >"{objdir}"Makefile.tem1 - sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}}\1/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 - tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem - If "`Exists "{objdir}"mk.sed`" != "" - sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 - Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem - End If - MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile - Delete -i -y "{objdir}"Makefile.tem[12] - If {verify} == 1 - Echo Created Makefile in "`Directory`" - End If -End If - -# Produce a build script if the source is defined. - -If "`Exists "{srcdir}"mpw-build.in`" != "" - Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem - Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem - Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem - Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem - tr-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem - MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build - If {verify} == 1 - Echo Created mpw-build in "`Directory`" - End If -End If - -# Apply ourselves recursively to the list of subdirectories to configure. - -If {recurse} == 1 - For subdir In {configdirs} - Set savedir "`Directory`" - If "`Exists "{srcdir}{subdir}:"`" == "" - If {verify} == 1 - Echo No "{srcdir}{subdir}:" found, skipping - End If - Continue - End If - If {verify} == 1 - Echo Configuring {subdir}... - End If - If "`Exists "{objdir}{subdir}:"`" == "" - NewFolder "{objdir}{subdir}" - End If - SetDirectory "{objdir}{subdir}:" - "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} {enable_options} {disable_options} - SetDirectory "{savedir}" - End For -End If - -SetDirectory "{savedir}" diff --git a/gnu/dist/mpw-install b/gnu/dist/mpw-install deleted file mode 100644 index 04c5aac2a4f4..000000000000 --- a/gnu/dist/mpw-install +++ /dev/null @@ -1,122 +0,0 @@ -# GNU Install script for MPW. - -Set OldExit "{Exit}" -Set Exit 0 - -Set TempUserStartup "{TempFolder}"__temp__UserStartup - -Echo '# UserStartup generated by GNU Install script' > "{TempUserStartup}" -Echo '' >> "{TempUserStartup}" - -# (should) Check that disk space is sufficient for installation. - -# Assume that the install script is where everything else is. - -Set thisdir "`Directory`" - -# Copy the binaries to the desired place. - -Confirm -t "Copy the binaries to somewhere else?" -Set TmpStatus {Status} -If {TmpStatus} == 0 - Set bindest "`GetFileName -d -m "Where to install the binaries?"`" - If {Status} == 0 - If "`Exists "{thisdir}bin"`" != "" - For afile In "{thisdir}"bin:\Option-x - Duplicate -y "{afile}" "{bindest}" - End For - Else - Echo "bin directory not found, exiting" - Exit 1 - End If - Else - Echo "No destination supplied, exiting" - Exit 1 - End If -Else If {TmpStatus} == 4 - # Use the existing directory. - Set bindest "{thisdir}bin:" -Else - # Cancelled from confirmation, escape altogether. - Exit 1 -End If - -# Copy the libraries to the desired place. - -Confirm -t "Copy the libraries to somewhere else?" -Set TmpStatus {Status} -If {TmpStatus} == 0 - Set libdest "`GetFileName -d -m "Where to install the libraries?"`" - If {Status} == 0 - If "`Exists "{thisdir}lib:"`" != "" - For afile In "{thisdir}"lib:\Option-x - Duplicate -y "{afile}" "{libdest}" - End For - Else - Echo "lib directory not found, exiting" - Exit 1 - End If - Else - Echo "No destination supplied, exiting" - Exit 1 - End If -Else If {TmpStatus} == 4 - # Use the existing directory. - Set libdest "{thisdir}lib:" -Else - # Cancelled from confirmation, escape altogether. - Exit 1 -End If - - -# Add the location of the binaries to the command path. - -Echo -n 'Set Commands "' >> "{TempUserStartup}" -Echo -n "{bindest}" >> "{TempUserStartup}" -Echo ',{Commands}"' >> "{TempUserStartup}" -Echo '' >> "{TempUserStartup}" - -# Set up GCC exec prefix. - -Set gcclibdir "{libdest}"gcc-lib: - -Echo -n 'Set GCC_EXEC_PREFIX "' >> "{TempUserStartup}" -Echo -n "{gcclibdir}" >> "{TempUserStartup}" -Echo '"' >> "{TempUserStartup}" -Echo "Export GCC_EXEC_PREFIX" >> "{TempUserStartup}" -Echo '' >> "{TempUserStartup}" - -# Set up path to libgcc.xcoff etc. - -Echo -n 'Set GCCPPCLibraries "' >> "{TempUserStartup}" -Echo -n "{libdest}" >> "{TempUserStartup}" -Echo '"' >> "{TempUserStartup}" -Echo "Export GCCPPCLibraries" >> "{TempUserStartup}" -Echo '' >> "{TempUserStartup}" - -# Display contents of UserStartup, confirm installation. - -Set UserStartupName "UserStartup\Option-8GNU" - -Echo "Contents of" {UserStartupName} "will be:" -Catenate "{TempUserStartup}" - -Confirm "Install {UserStartupName} into the MPW folder {MPW} ?" -If {Status} == 0 - Duplicate "{TempUserStartup}" "{MPW}{UserStartupName}" - Delete -y "{TempUserStartup}" -Else - Echo "{UserStartupName} file not installed" -End If - -# (should) Check HEXA resource, warn if low. - -# (should) Check for spaces in pathnames, warn if found. - -Echo "Installation was successful." -Echo "" -Echo "Be sure to review the usage notes in 'Read Me for MPW' before proceeding!" - -# Restore previous settings. - -Set Exit "{OldExit}" diff --git a/gnu/dist/opcodes/configure.bat b/gnu/dist/opcodes/configure.bat deleted file mode 100644 index 5f2c6d11c230..000000000000 --- a/gnu/dist/opcodes/configure.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off -echo Configuring opcodes for go32 -rem This batch file assumes a unix-type "sed" program - -echo # Makefile generated by "configure.bat"> Makefile - -if exist config.sed del config.sed - -echo "/\.o[ ]*:/ s/config.status// ">> config.sed -echo "s/CC = cc/CC = gcc/ ">> config.sed -echo "s/@BFD_MACHINES@/i386-dis.o/ ">> config.sed -echo "s/@archdefs@/-DARCH_i386/ ">> config.sed -echo "s/@frags@// ">> config.sed -echo "s/@srcdir@// ">> config.sed -echo "s!@prefix@!/usr/local! ">> config.sed -echo "s!@exec_prefix@!/usr/local! ">> config.sed -echo "s/@RANLIB@/ranlib/ ">> config.sed - -echo "s/^[ ]*rm/ -rm/ ">> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile -del config.sed -del config2.sed diff --git a/gnu/dist/opcodes/mpw-config.in b/gnu/dist/opcodes/mpw-config.in deleted file mode 100644 index ff9be9d72f41..000000000000 --- a/gnu/dist/opcodes/mpw-config.in +++ /dev/null @@ -1,27 +0,0 @@ -# Configuration fragment for opcodes. - -Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'` - -Set archname ARCH_{target_arch} - -If "{target_arch}" =~ /m68k/ - Set BFD_MACHINES '"{o}"m68k-dis.c.o "{o}"m68k-opc.c.o' -Else If "{target_arch}" =~ /powerpc/ - Set BFD_MACHINES '"{o}"ppc-dis.c.o "{o}"ppc-opc.c.o' -Else If "{target_arch}" =~ /i386/ - Set BFD_MACHINES '"{o}"i386-dis.c.o' -Else If "{target_arch}" =~ /mips/ - Set BFD_MACHINES '"{o}"mips-dis.c.o "{o}"mips-opc.c.o' -Else If "{target_arch}" =~ /sh/ - Set BFD_MACHINES '"{o}"sh-dis.c.o' -End If - -Echo '# Start from mpw-config.in' > "{o}"mk.tmp -Echo "BFD_MACHINES = " {BFD_MACHINES} >> "{o}"mk.tmp -Echo "ARCHDEFS = -d" {archname} >> "{o}"mk.tmp -Echo '# End from mpw-config.in' >> "{o}"mk.tmp - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new -Echo '#include "mpw.h"' >> "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h diff --git a/gnu/dist/opcodes/mpw-make.sed b/gnu/dist/opcodes/mpw-make.sed deleted file mode 100644 index ee604862de69..000000000000 --- a/gnu/dist/opcodes/mpw-make.sed +++ /dev/null @@ -1,25 +0,0 @@ -# Sed commands to finish translating the opcodes Makefile.in into MPW syntax. - -# Empty HDEFINES. -/HDEFINES/s/@HDEFINES@// - -# Fix pathnames to include directories. -/^INCDIR = /s/^INCDIR = .*$/INCDIR = "{topsrcdir}"include/ -/^CSEARCH = /s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/ - -/BFD_MACHINES/s/@BFD_MACHINES@/{BFD_MACHINES}/ -/archdefs/s/@archdefs@/{ARCHDEFS}/ - -# No PIC foolery in this environment. -/@ALLLIBS@/s/@ALLLIBS@/{TARGETLIB}/ -/@PICLIST@/s/@PICLIST@// -/@PICFLAG@/s/@PICFLAG@// -/^{OFILES} \\Option-f stamp-picdir/,/^$/d - -# Remove the pic trickery from the default build rule. -/^\.c\.o \\Option-f /,/End If/c\ -.c.o \\Option-f .c - -# Remove pic trickery from other rules - aimed at the rule -# for disassemble.o in particular. -/-n "{PICFLAG}"/,/End If/d diff --git a/gnu/dist/readline/doc/history.info b/gnu/dist/readline/doc/history.info deleted file mode 100644 index 9266a5d135b6..000000000000 --- a/gnu/dist/readline/doc/history.info +++ /dev/null @@ -1,785 +0,0 @@ -This is Info file history.info, produced by Makeinfo-1.55 from the -input file /usr/homes/chet/src/bash/readline-2.1/doc/hist.texinfo. - - This document describes the GNU History library, a programming tool -that provides a consistent user interface for recalling lines of -previously typed input. - - Copyright (C) 1988, 1991, 1993, 1995, 1996 Free Software Foundation, -Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice pare -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Foundation. - - -File: history.info, Node: Top, Next: Using History Interactively, Prev: (DIR), Up: (DIR) - -GNU History Library -******************* - - This document describes the GNU History library, a programming tool -that provides a consistent user interface for recalling lines of -previously typed input. - -* Menu: - -* Using History Interactively:: GNU History User's Manual. -* Programming with GNU History:: GNU History Programmer's Manual. -* Concept Index:: Index of concepts described in this manual. -* Function and Variable Index:: Index of externally visible functions - and variables. - - -File: history.info, Node: Using History Interactively, Next: Programming with GNU History, Prev: Top, Up: Top - -Using History Interactively -*************************** - - This chapter describes how to use the GNU History Library -interactively, from a user's standpoint. It should be considered a -user's guide. For information on using the GNU History Library in your -own programs, *note Programming with GNU History::.. - -* Menu: - -* History Interaction:: What it feels like using History as a user. - - -File: history.info, Node: History Interaction, Up: Using History Interactively - -Interactive History Expansion -============================= - - The History library provides a history expansion feature that is -similar to the history expansion provided by `csh'. This section -describes the syntax used to manipulate the history information. - - History expansions introduce words from the history list into the -input stream, making it easy to repeat commands, insert the arguments -to a previous command into the current input line, or fix errors in -previous commands quickly. - - History expansion takes place in two parts. The first is to -determine which line from the previous history should be used during -substitution. The second is to select portions of that line for -inclusion into the current one. The line selected from the previous -history is called the "event", and the portions of that line that are -acted upon are called "words". Various "modifiers" are available to -manipulate the selected words. The line is broken into words in the -same fashion that Bash does, so that several English (or Unix) words -surrounded by quotes are considered as one word. History expansions -are introduced by the appearance of the history expansion character, -which is `!' by default. - -* Menu: - -* Event Designators:: How to specify which history line to use. -* Word Designators:: Specifying which words are of interest. -* Modifiers:: Modifying the results of substitution. - - -File: history.info, Node: Event Designators, Next: Word Designators, Up: History Interaction - -Event Designators ------------------ - - An event designator is a reference to a command line entry in the -history list. - -`!' - Start a history substitution, except when followed by a space, tab, - the end of the line, = or (. - -`!N' - Refer to command line N. - -`!-N' - Refer to the command N lines back. - -`!!' - Refer to the previous command. This is a synonym for `!-1'. - -`!STRING' - Refer to the most recent command starting with STRING. - -`!?STRING[?]' - Refer to the most recent command containing STRING. The trailing - `?' may be omitted if the STRING is followed immediately by a - newline. - -`^STRING1^STRING2^' - Quick Substitution. Repeat the last command, replacing STRING1 - with STRING2. Equivalent to `!!:s/STRING1/STRING2/'. - -`!#' - The entire command line typed so far. - - -File: history.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction - -Word Designators ----------------- - - Word designators are used to select desired words from the event. A -`:' separates the event specification from the word designator. It can -be omitted if the word designator begins with a `^', `$', `*', `-', or -`%'. Words are numbered from the beginning of the line, with the first -word being denoted by 0 (zero). Words are inserted into the current -line separated by single spaces. - -`0 (zero)' - The `0'th word. For many applications, this is the command word. - -`N' - The Nth word. - -`^' - The first argument; that is, word 1. - -`$' - The last argument. - -`%' - The word matched by the most recent `?STRING?' search. - -`X-Y' - A range of words; `-Y' abbreviates `0-Y'. - -`*' - All of the words, except the `0'th. This is a synonym for `1-$'. - It is not an error to use `*' if there is just one word in the - event; the empty string is returned in that case. - -`X*' - Abbreviates `X-$' - -`X-' - Abbreviates `X-$' like `X*', but omits the last word. - - If a word designator is supplied without an event specification, the -previous command is used as the event. - - -File: history.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction - -Modifiers ---------- - - After the optional word designator, you can add a sequence of one or -more of the following modifiers, each preceded by a `:'. - -`h' - Remove a trailing pathname component, leaving only the head. - -`t' - Remove all leading pathname components, leaving the tail. - -`r' - Remove a trailing suffix of the form `.SUFFIX', leaving the - basename. - -`e' - Remove all but the trailing suffix. - -`p' - Print the new command but do not execute it. - -`s/OLD/NEW/' - Substitute NEW for the first occurrence of OLD in the event line. - Any delimiter may be used in place of `/'. The delimiter may be - quoted in OLD and NEW with a single backslash. If `&' appears in - NEW, it is replaced by OLD. A single backslash will quote the - `&'. The final delimiter is optional if it is the last character - on the input line. - -`&' - Repeat the previous substitution. - -`g' - Cause changes to be applied over the entire event line. Used in - conjunction with `s', as in `gs/OLD/NEW/', or with `&'. - - -File: history.info, Node: Programming with GNU History, Next: Concept Index, Prev: Using History Interactively, Up: Top - -Programming with GNU History -**************************** - - This chapter describes how to interface programs that you write with -the GNU History Library. It should be considered a technical guide. -For information on the interactive use of GNU History, *note Using -History Interactively::.. - -* Menu: - -* Introduction to History:: What is the GNU History library for? -* History Storage:: How information is stored. -* History Functions:: Functions that you can use. -* History Variables:: Variables that control behaviour. -* History Programming Example:: Example of using the GNU History Library. - - -File: history.info, Node: Introduction to History, Next: History Storage, Up: Programming with GNU History - -Introduction to History -======================= - - Many programs read input from the user a line at a time. The GNU -History library is able to keep track of those lines, associate -arbitrary data with each line, and utilize information from previous -lines in composing new ones. - - The programmer using the History library has available functions for -remembering lines on a history list, associating arbitrary data with a -line, removing lines from the list, searching through the list for a -line containing an arbitrary text string, and referencing any line in -the list directly. In addition, a history "expansion" function is -available which provides for a consistent user interface across -different programs. - - The user using programs written with the History library has the -benefit of a consistent user interface with a set of well-known -commands for manipulating the text of previous lines and using that text -in new commands. The basic history manipulation commands are similar to -the history substitution provided by `csh'. - - If the programmer desires, he can use the Readline library, which -includes some history manipulation by default, and has the added -advantage of command line editing. - - -File: history.info, Node: History Storage, Next: History Functions, Prev: Introduction to History, Up: Programming with GNU History - -History Storage -=============== - - The history list is an array of history entries. A history entry is -declared as follows: - - typedef struct _hist_entry { - char *line; - char *data; - } HIST_ENTRY; - - The history list itself might therefore be declared as - - HIST_ENTRY **the_history_list; - - The state of the History library is encapsulated into a single -structure: - - /* A structure used to pass the current state of the history stuff around. */ - typedef struct _hist_state { - HIST_ENTRY **entries; /* Pointer to the entries themselves. */ - int offset; /* The location pointer within this array. */ - int length; /* Number of elements within this array. */ - int size; /* Number of slots allocated to this array. */ - int flags; - } HISTORY_STATE; - - If the flags member includes `HS_STIFLED', the history has been -stifled. - - -File: history.info, Node: History Functions, Next: History Variables, Prev: History Storage, Up: Programming with GNU History - -History Functions -================= - - This section describes the calling sequence for the various functions -present in GNU History. - -* Menu: - -* Initializing History and State Management:: Functions to call when you - want to use history in a - program. -* History List Management:: Functions used to manage the list - of history entries. -* Information About the History List:: Functions returning information about - the history list. -* Moving Around the History List:: Functions used to change the position - in the history list. -* Searching the History List:: Functions to search the history list - for entries containing a string. -* Managing the History File:: Functions that read and write a file - containing the history list. -* History Expansion:: Functions to perform csh-like history - expansion. - - -File: history.info, Node: Initializing History and State Management, Next: History List Management, Up: History Functions - -Initializing History and State Management ------------------------------------------ - - This section describes functions used to initialize and manage the -state of the History library when you want to use the history functions -in your program. - - - Function: void using_history () - Begin a session in which the history functions might be used. This - initializes the interactive variables. - - - Function: HISTORY_STATE * history_get_history_state () - Return a structure describing the current state of the input - history. - - - Function: void history_set_history_state (HISTORY_STATE *state) - Set the state of the history list according to STATE. - - -File: history.info, Node: History List Management, Next: Information About the History List, Prev: Initializing History and State Management, Up: History Functions - -History List Management ------------------------ - - These functions manage individual entries on the history list, or set -parameters managing the list itself. - - - Function: void add_history (char *string) - Place STRING at the end of the history list. The associated data - field (if any) is set to `NULL'. - - - Function: HIST_ENTRY * remove_history (int which) - Remove history entry at offset WHICH from the history. The - removed element is returned so you can free the line, data, and - containing structure. - - - Function: HIST_ENTRY * replace_history_entry (int which, char *line, - char *data) - Make the history entry at offset WHICH have LINE and DATA. This - returns the old entry so you can dispose of the data. In the case - of an invalid WHICH, a `NULL' pointer is returned. - - - Function: void clear_history () - Clear the history list by deleting all the entries. - - - Function: void stifle_history (int max) - Stifle the history list, remembering only the last MAX entries. - - - Function: int unstifle_history () - Stop stifling the history. This returns the previous amount the - history was stifled. The value is positive if the history was - stifled, negative if it wasn't. - - - Function: int history_is_stifled () - Returns non-zero if the history is stifled, zero if it is not. - - -File: history.info, Node: Information About the History List, Next: Moving Around the History List, Prev: History List Management, Up: History Functions - -Information About the History List ----------------------------------- - - These functions return information about the entire history list or -individual list entries. - - - Function: HIST_ENTRY ** history_list () - Return a `NULL' terminated array of `HIST_ENTRY' which is the - current input history. Element 0 of this list is the beginning of - time. If there is no history, return `NULL'. - - - Function: int where_history () - Returns the offset of the current history element. - - - Function: HIST_ENTRY * current_history () - Return the history entry at the current position, as determined by - `where_history ()'. If there is no entry there, return a `NULL' - pointer. - - - Function: HIST_ENTRY * history_get (int offset) - Return the history entry at position OFFSET, starting from - `history_base'. If there is no entry there, or if OFFSET is - greater than the history length, return a `NULL' pointer. - - - Function: int history_total_bytes () - Return the number of bytes that the primary history entries are - using. This function returns the sum of the lengths of all the - lines in the history. - - -File: history.info, Node: Moving Around the History List, Next: Searching the History List, Prev: Information About the History List, Up: History Functions - -Moving Around the History List ------------------------------- - - These functions allow the current index into the history list to be -set or changed. - - - Function: int history_set_pos (int pos) - Set the position in the history list to POS, an absolute index - into the list. - - - Function: HIST_ENTRY * previous_history () - Back up the current history offset to the previous history entry, - and return a pointer to that entry. If there is no previous - entry, return a `NULL' pointer. - - - Function: HIST_ENTRY * next_history () - Move the current history offset forward to the next history entry, - and return the a pointer to that entry. If there is no next - entry, return a `NULL' pointer. - - -File: history.info, Node: Searching the History List, Next: Managing the History File, Prev: Moving Around the History List, Up: History Functions - -Searching the History List --------------------------- - - These functions allow searching of the history list for entries -containing a specific string. Searching may be performed both forward -and backward from the current history position. The search may be -"anchored", meaning that the string must match at the beginning of the -history entry. - - - Function: int history_search (char *string, int direction) - Search the history for STRING, starting at the current history - offset. If DIRECTION < 0, then the search is through previous - entries, else through subsequent. If STRING is found, then the - current history index is set to that history entry, and the value - returned is the offset in the line of the entry where STRING was - found. Otherwise, nothing is changed, and a -1 is returned. - - - Function: int history_search_prefix (char *string, int direction) - Search the history for STRING, starting at the current history - offset. The search is anchored: matching lines must begin with - STRING. If DIRECTION < 0, then the search is through previous - entries, else through subsequent. If STRING is found, then the - current history index is set to that entry, and the return value - is 0. Otherwise, nothing is changed, and a -1 is returned. - - - Function: int history_search_pos (char *string, int direction, int - pos) - Search for STRING in the history list, starting at POS, an - absolute index into the list. If DIRECTION is negative, the search - proceeds backward from POS, otherwise forward. Returns the - absolute index of the history element where STRING was found, or - -1 otherwise. - - -File: history.info, Node: Managing the History File, Next: History Expansion, Prev: Searching the History List, Up: History Functions - -Managing the History File -------------------------- - - The History library can read the history from and write it to a file. -This section documents the functions for managing a history file. - - - Function: int read_history (char *filename) - Add the contents of FILENAME to the history list, a line at a - time. If FILENAME is `NULL', then read from `~/.history'. - Returns 0 if successful, or errno if not. - - - Function: int read_history_range (char *filename, int from, int to) - Read a range of lines from FILENAME, adding them to the history - list. Start reading at line FROM and end at TO. If FROM is zero, - start at the beginning. If TO is less than FROM, then read until - the end of the file. If FILENAME is `NULL', then read from - `~/.history'. Returns 0 if successful, or `errno' if not. - - - Function: int write_history (char *filename) - Write the current history to FILENAME, overwriting FILENAME if - necessary. If FILENAME is `NULL', then write the history list to - `~/.history'. Values returned are as in `read_history ()'. - - - Function: int append_history (int nelements, char *filename) - Append the last NELEMENTS of the history list to FILENAME. - - - Function: int history_truncate_file (char *filename, int nlines) - Truncate the history file FILENAME, leaving only the last NLINES - lines. - - -File: history.info, Node: History Expansion, Prev: Managing the History File, Up: History Functions - -History Expansion ------------------ - - These functions implement `csh'-like history expansion. - - - Function: int history_expand (char *string, char **output) - Expand STRING, placing the result into OUTPUT, a pointer to a - string (*note History Interaction::.). Returns: - `0' - If no expansions took place (or, if the only change in the - text was the de-slashifying of the history expansion - character); - - `1' - if expansions did take place; - - `-1' - if there was an error in expansion; - - `2' - if the returned line should only be displayed, but not - executed, as with the `:p' modifier (*note Modifiers::.). - - If an error ocurred in expansion, then OUTPUT contains a - descriptive error message. - - - Function: char * history_arg_extract (int first, int last, char - *string) - Extract a string segment consisting of the FIRST through LAST - arguments present in STRING. Arguments are broken up as in Bash. - - - Function: char * get_history_event (char *string, int *cindex, int - qchar) - Returns the text of the history event beginning at STRING + - *CINDEX. *CINDEX is modified to point to after the event - specifier. At function entry, CINDEX points to the index into - STRING where the history event specification begins. QCHAR is a - character that is allowed to end the event specification in - addition to the "normal" terminating characters. - - - Function: char ** history_tokenize (char *string) - Return an array of tokens parsed out of STRING, much as the shell - might. The tokens are split on white space and on the characters - `()<>;&|$', and shell quoting conventions are obeyed. - - -File: history.info, Node: History Variables, Next: History Programming Example, Prev: History Functions, Up: Programming with GNU History - -History Variables -================= - - This section describes the externally visible variables exported by -the GNU History Library. - - - Variable: int history_base - The logical offset of the first entry in the history list. - - - Variable: int history_length - The number of entries currently stored in the history list. - - - Variable: int max_input_history - The maximum number of history entries. This must be changed using - `stifle_history ()'. - - - Variable: char history_expansion_char - The character that starts a history event. The default is `!'. - - - Variable: char history_subst_char - The character that invokes word substitution if found at the start - of a line. The default is `^'. - - - Variable: char history_comment_char - During tokenization, if this character is seen as the first - character of a word, then it and all subsequent characters up to a - newline are ignored, suppressing history expansion for the - remainder of the line. This is disabled by default. - - - Variable: char * history_no_expand_chars - The list of characters which inhibit history expansion if found - immediately following HISTORY_EXPANSION_CHAR. The default is - whitespace and `='. - - - Variable: char * history_search_delimiter_chars - The list of additional characters which can delimit a history - search string, in addition to whitespace, `:' and `?' in the case - of a substring search. The default is empty. - - - Variable: int history_quotes_inhibit_expansion - If non-zero, single-quoted words are not scanned for the history - expansion character. The default value is 0. - - - Variable: Function * history_inhibit_expansion_function - This should be set to the address of a function that takes two - arguments: a `char *' (STRING) and an integer index into that - string (I). It should return a non-zero value if the history - expansion starting at STRING[I] should not be performed; zero if - the expansion should be done. It is intended for use by - applications like Bash that use the history expansion character - for additional purposes. By default, this variable is set to NULL. - - -File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History - -History Programming Example -=========================== - - The following program demonstrates simple use of the GNU History -Library. - - main () - { - char line[1024], *t; - int len, done = 0; - - line[0] = 0; - - using_history (); - while (!done) - { - printf ("history$ "); - fflush (stdout); - t = fgets (line, sizeof (line) - 1, stdin); - if (t && *t) - { - len = strlen (t); - if (t[len - 1] == '\n') - t[len - 1] = '\0'; - } - - if (!t) - strcpy (line, "quit"); - - if (line[0]) - { - char *expansion; - int result; - - result = history_expand (line, &expansion); - if (result) - fprintf (stderr, "%s\n", expansion); - - if (result < 0 || result == 2) - { - free (expansion); - continue; - } - - add_history (expansion); - strncpy (line, expansion, sizeof (line) - 1); - free (expansion); - } - - if (strcmp (line, "quit") == 0) - done = 1; - else if (strcmp (line, "save") == 0) - write_history ("history_file"); - else if (strcmp (line, "read") == 0) - read_history ("history_file"); - else if (strcmp (line, "list") == 0) - { - register HIST_ENTRY **the_list; - register int i; - - the_list = history_list (); - if (the_list) - for (i = 0; the_list[i]; i++) - printf ("%d: %s\n", i + history_base, the_list[i]->line); - } - else if (strncmp (line, "delete", 6) == 0) - { - int which; - if ((sscanf (line + 6, "%d", &which)) == 1) - { - HIST_ENTRY *entry = remove_history (which); - if (!entry) - fprintf (stderr, "No such entry %d\n", which); - else - { - free (entry->line); - free (entry); - } - } - else - { - fprintf (stderr, "non-numeric arg given to `delete'\n"); - } - } - } - } - - -File: history.info, Node: Concept Index, Next: Function and Variable Index, Prev: Programming with GNU History, Up: Top - -Concept Index -************* - -* Menu: - -* anchored search: Searching the History List. -* event designators: Event Designators. -* history events: Event Designators. -* history expansion: History Interaction. -* History Searching: Searching the History List. - - -File: history.info, Node: Function and Variable Index, Prev: Concept Index, Up: Top - -Function and Variable Index -*************************** - -* Menu: - -* add_history: History List Management. -* append_history: Managing the History File. -* clear_history: History List Management. -* current_history: Information About the History List. -* get_history_event: History Expansion. -* history_arg_extract: History Expansion. -* history_base: History Variables. -* history_comment_char: History Variables. -* history_expand: History Expansion. -* history_expansion_char: History Variables. -* history_get: Information About the History List. -* history_get_history_state: Initializing History and State Management. -* history_inhibit_expansion_function: History Variables. -* history_is_stifled: History List Management. -* history_length: History Variables. -* history_list: Information About the History List. -* history_no_expand_chars: History Variables. -* history_quotes_inhibit_expansion: History Variables. -* history_search: Searching the History List. -* history_search_delimiter_chars: History Variables. -* history_search_pos: Searching the History List. -* history_search_prefix: Searching the History List. -* history_set_history_state: Initializing History and State Management. -* history_set_pos: Moving Around the History List. -* history_subst_char: History Variables. -* history_tokenize: History Expansion. -* history_total_bytes: Information About the History List. -* history_truncate_file: Managing the History File. -* max_input_history: History Variables. -* next_history: Moving Around the History List. -* previous_history: Moving Around the History List. -* read_history: Managing the History File. -* read_history_range: Managing the History File. -* remove_history: History List Management. -* replace_history_entry: History List Management. -* stifle_history: History List Management. -* unstifle_history: History List Management. -* using_history: Initializing History and State Management. -* where_history: Information About the History List. -* write_history: Managing the History File. - - - -Tag Table: -Node: Top1035 -Node: Using History Interactively1629 -Node: History Interaction2137 -Node: Event Designators3614 -Node: Word Designators4537 -Node: Modifiers5786 -Node: Programming with GNU History6924 -Node: Introduction to History7650 -Node: History Storage8971 -Node: History Functions10064 -Node: Initializing History and State Management11035 -Node: History List Management11827 -Node: Information About the History List13348 -Node: Moving Around the History List14654 -Node: Searching the History List15539 -Node: Managing the History File17371 -Node: History Expansion18877 -Node: History Variables20721 -Node: History Programming Example23039 -Node: Concept Index25643 -Node: Function and Variable Index26124 - -End Tag Table diff --git a/gnu/dist/readline/doc/readline.info b/gnu/dist/readline/doc/readline.info deleted file mode 100644 index 3e4446097e35..000000000000 --- a/gnu/dist/readline/doc/readline.info +++ /dev/null @@ -1,2765 +0,0 @@ -This is Info file readline.info, produced by Makeinfo-1.55 from the -input file /usr/homes/chet/src/bash/readline-2.1/doc/rlman.texinfo. - - This document describes the GNU Readline Library, a utility which -aids in the consistency of user interface across discrete programs that -need to provide a command line interface. - - Copyright (C) 1988, 1991 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice pare -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Foundation. - - -File: readline.info, Node: Top, Next: Command Line Editing, Prev: (DIR), Up: (DIR) - -GNU Readline Library -******************** - - This document describes the GNU Readline Library, a utility which -aids in the consistency of user interface across discrete programs that -need to provide a command line interface. - -* Menu: - -* Command Line Editing:: GNU Readline User's Manual. -* Programming with GNU Readline:: GNU Readline Programmer's Manual. -* Concept Index:: Index of concepts described in this manual. -* Function and Variable Index:: Index of externally visible functions - and variables. - - -File: readline.info, Node: Command Line Editing, Next: Programming with GNU Readline, Prev: Top, Up: Top - -Command Line Editing -******************** - - This chapter describes the basic features of the GNU command line -editing interface. - -* Menu: - -* Introduction and Notation:: Notation used in this text. -* Readline Interaction:: The minimum set of commands for editing a line. -* Readline Init File:: Customizing Readline from a user's view. -* Bindable Readline Commands:: A description of most of the Readline commands - available for binding -* Readline vi Mode:: A short description of how to make Readline - behave like the vi editor. - - -File: readline.info, Node: Introduction and Notation, Next: Readline Interaction, Up: Command Line Editing - -Introduction to Line Editing -============================ - - The following paragraphs describe the notation used to represent -keystrokes. - - The text C-k is read as `Control-K' and describes the character -produced when the k key is pressed while the Control key is depressed. - - The text M-k is read as `Meta-K' and describes the character -produced when the meta key (if you have one) is depressed, and the k -key is pressed. If you do not have a meta key, the identical keystroke -can be generated by typing ESC first, and then typing k. Either -process is known as "metafying" the k key. - - The text M-C-k is read as `Meta-Control-k' and describes the -character produced by "metafying" C-k. - - In addition, several keys have their own names. Specifically, DEL, -ESC, LFD, SPC, RET, and TAB all stand for themselves when seen in this -text, or in an init file (*note Readline Init File::.). - - -File: readline.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line Editing - -Readline Interaction -==================== - - Often during an interactive session you type in a long line of text, -only to notice that the first word on the line is misspelled. The -Readline library gives you a set of commands for manipulating the text -as you type it in, allowing you to just fix your typo, and not forcing -you to retype the majority of the line. Using these editing commands, -you move the cursor to the place that needs correction, and delete or -insert the text of the corrections. Then, when you are satisfied with -the line, you simply press RETURN. You do not have to be at the end of -the line to press RETURN; the entire line is accepted regardless of the -location of the cursor within the line. - -* Menu: - -* Readline Bare Essentials:: The least you need to know about Readline. -* Readline Movement Commands:: Moving about the input line. -* Readline Killing Commands:: How to delete text, and how to get it back! -* Readline Arguments:: Giving numeric arguments to commands. -* Searching:: Searching through previous lines. - - -File: readline.info, Node: Readline Bare Essentials, Next: Readline Movement Commands, Up: Readline Interaction - -Readline Bare Essentials ------------------------- - - In order to enter characters into the line, simply type them. The -typed character appears where the cursor was, and then the cursor moves -one space to the right. If you mistype a character, you can use your -erase character to back up and delete the mistyped character. - - Sometimes you may miss typing a character that you wanted to type, -and not notice your error until you have typed several other -characters. In that case, you can type C-b to move the cursor to the -left, and then correct your mistake. Afterwards, you can move the -cursor to the right with C-f. - - When you add text in the middle of a line, you will notice that -characters to the right of the cursor are `pushed over' to make room -for the text that you have inserted. Likewise, when you delete text -behind the cursor, characters to the right of the cursor are `pulled -back' to fill in the blank space created by the removal of the text. A -list of the basic bare essentials for editing the text of an input line -follows. - -C-b - Move back one character. - -C-f - Move forward one character. - -DEL - Delete the character to the left of the cursor. - -C-d - Delete the character underneath the cursor. - -Printing characters - Insert the character into the line at the cursor. - -C-_ - Undo the last thing that you did. You can undo all the way back - to an empty line. - - -File: readline.info, Node: Readline Movement Commands, Next: Readline Killing Commands, Prev: Readline Bare Essentials, Up: Readline Interaction - -Readline Movement Commands --------------------------- - - The above table describes the most basic possible keystrokes that -you need in order to do editing of the input line. For your -convenience, many other commands have been added in addition to C-b, -C-f, C-d, and DEL. Here are some commands for moving more rapidly -about the line. - -C-a - Move to the start of the line. - -C-e - Move to the end of the line. - -M-f - Move forward a word. - -M-b - Move backward a word. - -C-l - Clear the screen, reprinting the current line at the top. - - Notice how C-f moves forward a character, while M-f moves forward a -word. It is a loose convention that control keystrokes operate on -characters while meta keystrokes operate on words. - - -File: readline.info, Node: Readline Killing Commands, Next: Readline Arguments, Prev: Readline Movement Commands, Up: Readline Interaction - -Readline Killing Commands -------------------------- - - "Killing" text means to delete the text from the line, but to save -it away for later use, usually by "yanking" (re-inserting) it back into -the line. If the description for a command says that it `kills' text, -then you can be sure that you can get the text back in a different (or -the same) place later. - - When you use a kill command, the text is saved in a "kill-ring". -Any number of consecutive kills save all of the killed text together, so -that when you yank it back, you get it all. The kill ring is not line -specific; the text that you killed on a previously typed line is -available to be yanked back later, when you are typing another line. - - Here is the list of commands for killing text. - -C-k - Kill the text from the current cursor position to the end of the - line. - -M-d - Kill from the cursor to the end of the current word, or if between - words, to the end of the next word. - -M-DEL - Kill from the cursor the start of the previous word, or if between - words, to the start of the previous word. - -C-w - Kill from the cursor to the previous whitespace. This is - different than M-DEL because the word boundaries differ. - - And, here is how to "yank" the text back into the line. Yanking -means to copy the most-recently-killed text from the kill buffer. - -C-y - Yank the most recently killed text back into the buffer at the - cursor. - -M-y - Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is C-y or M-y. - - -File: readline.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction - -Readline Arguments ------------------- - - You can pass numeric arguments to Readline commands. Sometimes the -argument acts as a repeat count, other times it is the sign of the -argument that is significant. If you pass a negative argument to a -command which normally acts in a forward direction, that command will -act in a backward direction. For example, to kill text back to the -start of the line, you might type `M-- C-k'. - - The general way to pass numeric arguments to a command is to type -meta digits before the command. If the first `digit' you type is a -minus sign (-), then the sign of the argument will be negative. Once -you have typed one meta digit to get the argument started, you can type -the remainder of the digits, and then the command. For example, to give -the C-d command an argument of 10, you could type `M-1 0 C-d'. - - -File: readline.info, Node: Searching, Prev: Readline Arguments, Up: Readline Interaction - -Searching for Commands in the History -------------------------------------- - - Readline provides commands for searching through the command history -for lines containing a specified string. There are two search modes: -iNCREMENTAL and NON-INCREMENTAL. - - Incremental searches begin before the user has finished typing the -search string. As each character of the search string is typed, -readline displays the next entry from the history matching the string -typed so far. An incremental search requires only as many characters -as needed to find the desired history entry. The Escape character is -used to terminate an incremental search. Control-J will also terminate -the search. Control-G will abort an incremental search and restore the -original line. When the search is terminated, the history entry -containing the search string becomes the current line. To find other -matching entries in the history list, type Control-S or Control-R as -appropriate. This will search backward or forward in the history for -the next entry matching the search string typed so far. Any other key -sequence bound to a readline command will terminate the search and -execute that command. For instance, a `newline' will terminate the -search and accept the line, thereby executing the command from the -history list. - - Non-incremental searches read the entire search string before -starting to search for matching history lines. The search string may be -typed by the user or part of the contents of the current line. - - -File: readline.info, Node: Readline Init File, Next: Bindable Readline Commands, Prev: Readline Interaction, Up: Command Line Editing - -Readline Init File -================== - - Although the Readline library comes with a set of `emacs'-like -keybindings installed by default, it is possible that you would like to -use a different set of keybindings. You can customize programs that -use Readline by putting commands in an "inputrc" file in your home -directory. The name of this file is taken from the value of the -environment variable `INPUTRC'. If that variable is unset, the default -is `~/.inputrc'. - - When a program which uses the Readline library starts up, the init -file is read, and the key bindings are set. - - In addition, the `C-x C-r' command re-reads this init file, thus -incorporating any changes that you might have made to it. - -* Menu: - -* Readline Init File Syntax:: Syntax for the commands in the inputrc file. - -* Conditional Init Constructs:: Conditional key bindings in the inputrc file. - -* Sample Init File:: An example inputrc file. - - -File: readline.info, Node: Readline Init File Syntax, Next: Conditional Init Constructs, Up: Readline Init File - -Readline Init File Syntax -------------------------- - - There are only a few basic constructs allowed in the Readline init -file. Blank lines are ignored. Lines beginning with a `#' are -comments. Lines beginning with a `$' indicate conditional constructs -(*note Conditional Init Constructs::.). Other lines denote variable -settings and key bindings. - -Variable Settings - You can change the state of a few variables in Readline by using - the `set' command within the init file. Here is how you would - specify that you wish to use `vi' line editing commands: - - set editing-mode vi - - Right now, there are only a few variables which can be set; so - few, in fact, that we just list them here: - - `bell-style' - Controls what happens when Readline wants to ring the - terminal bell. If set to `none', Readline never rings the - bell. If set to `visible', Readline uses a visible bell if - one is available. If set to `audible' (the default), - Readline attempts to ring the terminal's bell. - - `comment-begin' - The string to insert at the beginning of the line when the - `insert-comment' command is executed. The default value is - `"#"'. - - `completion-query-items' - The number of possible completions that determines when the - user is asked whether he wants to see the list of - possibilities. If the number of possible completions is - greater than this value, Readline will ask the user whether - or not he wishes to view them; otherwise, they are simply - listed. The default limit is `100'. - - `convert-meta' - If set to `on', Readline will convert characters with the - eigth bit set to an ASCII key sequence by stripping the eigth - bit and prepending an ESC character, converting them to a - meta-prefixed key sequence. The default value is `on'. - - `disable-completion' - If set to `On', readline will inhibit word completion. - Completion characters will be inserted into the line as if - they had been mapped to `self-insert'. The default is `off'. - - `editing-mode' - The `editing-mode' variable controls which editing mode you - are using. By default, Readline starts up in Emacs editing - mode, where the keystrokes are most similar to Emacs. This - variable can be set to either `emacs' or `vi'. - - `enable-keypad' - When set to `on', readline will try to enable the application - keypad when it is called. Some systems need this to enable - the arrow keys. The default is `off'. - - `expand-tilde' - If set to `on', tilde expansion is performed when Readline - attempts word completion. The default is `off'. - - `horizontal-scroll-mode' - This variable can be set to either `on' or `off'. Setting it - to `on' means that the text of the lines that you edit will - scroll horizontally on a single screen line when they are - longer than the width of the screen, instead of wrapping onto - a new screen line. By default, this variable is set to `off'. - - `keymap' - Sets Readline's idea of the current keymap for key binding - commands. Acceptable `keymap' names are `emacs', - `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', - `vi-command', and `vi-insert'. `vi' is equivalent to - `vi-command'; `emacs' is equivalent to `emacs-standard'. The - default value is `emacs'. The value of the `editing-mode' - variable also affects the default keymap. - - `mark-directories' - If set to `on', completed directory names have a slash - appended. The default is `on'. - - `mark-modified-lines' - This variable, when set to `on', says to display an asterisk - (`*') at the start of history lines which have been modified. - This variable is `off' by default. - - `input-meta' - If set to `on', Readline will enable eight-bit input (it will - not strip the eighth bit from the characters it reads), - regardless of what the terminal claims it can support. The - default value is `off'. The name `meta-flag' is a synonym - for this variable. - - `output-meta' - If set to `on', Readline will display characters with the - eighth bit set directly rather than as a meta-prefixed escape - sequence. The default is `off'. - - `show-all-if-ambiguous' - This alters the default behavior of the completion functions. - If set to `on', words which have more than one possible - completion cause the matches to be listed immediately instead - of ringing the bell. The default value is `off'. - - `visible-stats' - If set to `on', a character denoting a file's type is - appended to the filename when listing possible completions. - The default is `off'. - -Key Bindings - The syntax for controlling key bindings in the init file is - simple. First you have to know the name of the command that you - want to change. The following pages contain tables of the command - name, the default keybinding, and a short description of what the - command does. - - Once you know the name of the command, simply place the name of - the key you wish to bind the command to, a colon, and then the - name of the command on a line in the init file. The name of the - key can be expressed in different ways, depending on which is most - comfortable for you. - - KEYNAME: FUNCTION-NAME or MACRO - KEYNAME is the name of a key spelled out in English. For - example: - Control-u: universal-argument - Meta-Rubout: backward-kill-word - Control-o: "> output" - - In the above example, `C-u' is bound to the function - `universal-argument', and `C-o' is bound to run the macro - expressed on the right hand side (that is, to insert the text - `> output' into the line). - - "KEYSEQ": FUNCTION-NAME or MACRO - KEYSEQ differs from KEYNAME above in that strings denoting an - entire key sequence can be specified, by placing the key - sequence in double quotes. Some GNU Emacs style key escapes - can be used, as in the following example, but the special - character names are not recognized. - - "\C-u": universal-argument - "\C-x\C-r": re-read-init-file - "\e[11~": "Function Key 1" - - In the above example, `C-u' is bound to the function - `universal-argument' (just as it was in the first example), - `C-x C-r' is bound to the function `re-read-init-file', and - `ESC [ 1 1 ~' is bound to insert the text `Function Key 1'. - The following escape sequences are available when specifying - key sequences: - - ``\C-'' - control prefix - - ``\M-'' - meta prefix - - ``\e'' - an escape character - - ``\\'' - backslash - - ``\"'' - " - - ``\''' - ' - - When entering the text of a macro, single or double quotes - should be used to indicate a macro definition. Unquoted text - is assumed to be a function name. Backslash will quote any - character in the macro text, including `"' and `''. For - example, the following binding will make `C-x \' insert a - single `\' into the line: - "\C-x\\": "\\" - - -File: readline.info, Node: Conditional Init Constructs, Next: Sample Init File, Prev: Readline Init File Syntax, Up: Readline Init File - -Conditional Init Constructs ---------------------------- - - Readline implements a facility similar in spirit to the conditional -compilation features of the C preprocessor which allows key bindings -and variable settings to be performed as the result of tests. There -are three parser directives used. - -`$if' - The `$if' construct allows bindings to be made based on the - editing mode, the terminal being used, or the application using - Readline. The text of the test extends to the end of the line; no - characters are required to isolate it. - - `mode' - The `mode=' form of the `$if' directive is used to test - whether Readline is in `emacs' or `vi' mode. This may be - used in conjunction with the `set keymap' command, for - instance, to set bindings in the `emacs-standard' and - `emacs-ctlx' keymaps only if Readline is starting out in - `emacs' mode. - - `term' - The `term=' form may be used to include terminal-specific key - bindings, perhaps to bind the key sequences output by the - terminal's function keys. The word on the right side of the - `=' is tested against the full name of the terminal and the - portion of the terminal name before the first `-'. This - allows `sun' to match both `sun' and `sun-cmd', for instance. - - `application' - The APPLICATION construct is used to include - application-specific settings. Each program using the - Readline library sets the APPLICATION NAME, and you can test - for it. This could be used to bind key sequences to - functions useful for a specific program. For instance, the - following command adds a key sequence that quotes the current - or previous word in Bash: - $if Bash - # Quote the current or previous word - "\C-xq": "\eb\"\ef\"" - $endif - -`$endif' - This command, as you saw in the previous example, terminates an - `$if' command. - -`$else' - Commands in this branch of the `$if' directive are executed if the - test fails. - - -File: readline.info, Node: Sample Init File, Prev: Conditional Init Constructs, Up: Readline Init File - -Sample Init File ----------------- - - Here is an example of an inputrc file. This illustrates key -binding, variable assignment, and conditional syntax. - - - # This file controls the behaviour of line input editing for - # programs that use the Gnu Readline library. Existing programs - # include FTP, Bash, and Gdb. - # - # You can re-read the inputrc file with C-x C-r. - # Lines beginning with '#' are comments. - # - # Set various bindings for emacs mode. - - set editing-mode emacs - - $if mode=emacs - - Meta-Control-h: backward-kill-word Text after the function name is ignored - - # - # Arrow keys in keypad mode - # - #"\M-OD": backward-char - #"\M-OC": forward-char - #"\M-OA": previous-history - #"\M-OB": next-history - # - # Arrow keys in ANSI mode - # - "\M-[D": backward-char - "\M-[C": forward-char - "\M-[A": previous-history - "\M-[B": next-history - # - # Arrow keys in 8 bit keypad mode - # - #"\M-\C-OD": backward-char - #"\M-\C-OC": forward-char - #"\M-\C-OA": previous-history - #"\M-\C-OB": next-history - # - # Arrow keys in 8 bit ANSI mode - # - #"\M-\C-[D": backward-char - #"\M-\C-[C": forward-char - #"\M-\C-[A": previous-history - #"\M-\C-[B": next-history - - C-q: quoted-insert - - $endif - - # An old-style binding. This happens to be the default. - TAB: complete - - # Macros that are convenient for shell interaction - $if Bash - # edit the path - "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" - # prepare to type a quoted word -- insert open and close double quotes - # and move to just after the open quote - "\C-x\"": "\"\"\C-b" - # insert a backslash (testing backslash escapes in sequences and macros) - "\C-x\\": "\\" - # Quote the current or previous word - "\C-xq": "\eb\"\ef\"" - # Add a binding to refresh the line, which is unbound - "\C-xr": redraw-current-line - # Edit variable on current line. - "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" - $endif - - # use a visible bell if one is available - set bell-style visible - - # don't strip characters to 7 bits when reading - set input-meta on - - # allow iso-latin1 characters to be inserted rather than converted to - # prefix-meta sequences - set convert-meta off - - # display characters with the eighth bit set directly rather than - # as meta-prefixed characters - set output-meta on - - # if there are more than 150 possible completions for a word, ask the - # user if he wants to see all of them - set completion-query-items 150 - - # For FTP - $if Ftp - "\C-xg": "get \M-?" - "\C-xt": "put \M-?" - "\M-.": yank-last-arg - $endif - - -File: readline.info, Node: Bindable Readline Commands, Next: Readline vi Mode, Prev: Readline Init File, Up: Command Line Editing - -Bindable Readline Commands -========================== - -* Menu: - -* Commands For Moving:: Moving about the line. -* Commands For History:: Getting at previous lines. -* Commands For Text:: Commands for changing text. -* Commands For Killing:: Commands for killing and yanking. -* Numeric Arguments:: Specifying numeric arguments, repeat counts. -* Commands For Completion:: Getting Readline to do the typing for you. -* Keyboard Macros:: Saving and re-executing typed characters -* Miscellaneous Commands:: Other miscellaneous commands. - - This section describes Readline commands that may be bound to key -sequences. - - -File: readline.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands - -Commands For Moving -------------------- - -`beginning-of-line (C-a)' - Move to the start of the current line. - -`end-of-line (C-e)' - Move to the end of the line. - -`forward-char (C-f)' - Move forward a character. - -`backward-char (C-b)' - Move back a character. - -`forward-word (M-f)' - Move forward to the end of the next word. Words are composed of - letters and digits. - -`backward-word (M-b)' - Move back to the start of this, or the previous, word. Words are - composed of letters and digits. - -`clear-screen (C-l)' - Clear the screen and redraw the current line, leaving the current - line at the top of the screen. - -`redraw-current-line ()' - Refresh the current line. By default, this is unbound. - - -File: readline.info, Node: Commands For History, Next: Commands For Text, Prev: Commands For Moving, Up: Bindable Readline Commands - -Commands For Manipulating The History -------------------------------------- - -`accept-line (Newline, Return)' - Accept the line regardless of where the cursor is. If this line is - non-empty, add it to the history list. If this line was a history - line, then restore the history line to its original state. - -`previous-history (C-p)' - Move `up' through the history list. - -`next-history (C-n)' - Move `down' through the history list. - -`beginning-of-history (M-<)' - Move to the first line in the history. - -`end-of-history (M->)' - Move to the end of the input history, i.e., the line you are - entering. - -`reverse-search-history (C-r)' - Search backward starting at the current line and moving `up' - through the history as necessary. This is an incremental search. - -`forward-search-history (C-s)' - Search forward starting at the current line and moving `down' - through the the history as necessary. This is an incremental - search. - -`non-incremental-reverse-search-history (M-p)' - Search backward starting at the current line and moving `up' - through the history as necessary using a non-incremental search - for a string supplied by the user. - -`non-incremental-forward-search-history (M-n)' - Search forward starting at the current line and moving `down' - through the the history as necessary using a non-incremental search - for a string supplied by the user. - -`history-search-forward ()' - Search forward through the history for the string of characters - between the start of the current line and the current cursor - position (the `point'). This is a non-incremental search. By - default, this command is unbound. - -`history-search-backward ()' - Search backward through the history for the string of characters - between the start of the current line and the point. This is a - non-incremental search. By default, this command is unbound. - -`yank-nth-arg (M-C-y)' - Insert the first argument to the previous command (usually the - second word on the previous line). With an argument N, insert the - Nth word from the previous command (the words in the previous - command begin with word 0). A negative argument inserts the Nth - word from the end of the previous command. - -`yank-last-arg (M-., M-_)' - Insert last argument to the previous command (the last word of the - previous history entry). With an argument, behave exactly like - `yank-nth-arg'. - - -File: readline.info, Node: Commands For Text, Next: Commands For Killing, Prev: Commands For History, Up: Bindable Readline Commands - -Commands For Changing Text --------------------------- - -`delete-char (C-d)' - Delete the character under the cursor. If the cursor is at the - beginning of the line, there are no characters in the line, and - the last character typed was not `C-d', then return `EOF'. - -`backward-delete-char (Rubout)' - Delete the character behind the cursor. A numeric arg says to kill - the characters instead of deleting them. - -`quoted-insert (C-q, C-v)' - Add the next character that you type to the line verbatim. This is - how to insert key sequences like C-q, for example. - -`tab-insert (M-TAB)' - Insert a tab character. - -`self-insert (a, b, A, 1, !, ...)' - Insert yourself. - -`transpose-chars (C-t)' - Drag the character before the cursor forward over the character at - the cursor, moving the cursor forward as well. If the insertion - point is at the end of the line, then this transposes the last two - characters of the line. Negative argumentss don't work. - -`transpose-words (M-t)' - Drag the word behind the cursor past the word in front of the - cursor moving the cursor over that word as well. - -`upcase-word (M-u)' - Uppercase the current (or following) word. With a negative - argument, do the previous word, but do not move the cursor. - -`downcase-word (M-l)' - Lowercase the current (or following) word. With a negative - argument, do the previous word, but do not move the cursor. - -`capitalize-word (M-c)' - Capitalize the current (or following) word. With a negative - argument, do the previous word, but do not move the cursor. - - -File: readline.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands - -Killing And Yanking -------------------- - -`kill-line (C-k)' - Kill the text from the current cursor position to the end of the - line. - -`backward-kill-line (C-x Rubout)' - Kill backward to the beginning of the line. - -`unix-line-discard (C-u)' - Kill backward from the cursor to the beginning of the current line. - Save the killed text on the kill-ring. - -`kill-whole-line ()' - Kill all characters on the current line, no matter where the - cursor is. By default, this is unbound. - -`kill-word (M-d)' - Kill from the cursor to the end of the current word, or if between - words, to the end of the next word. Word boundaries are the same - as `forward-word'. - -`backward-kill-word (M-DEL)' - Kill the word behind the cursor. Word boundaries are the same as - `backward-word'. - -`unix-word-rubout (C-w)' - Kill the word behind the cursor, using white space as a word - boundary. The killed text is saved on the kill-ring. - -`delete-horizontal-space ()' - Delete all spaces and tabs around point. By default, this is - unbound. - -`kill-region ()' - Kill the text between the point and the *mark* (saved cursor - position. This text is referred to as the REGION. By default, - this command is unbound. - -`copy-region-as-kill ()' - Copy the text in the region to the kill buffer, so you can yank it - right away. By default, this command is unbound. - -`copy-backward-word ()' - Copy the word before point to the kill buffer. By default, this - command is unbound. - -`copy-forward-word ()' - Copy the word following point to the kill buffer. By default, - this command is unbound. - -`yank (C-y)' - Yank the top of the kill ring into the buffer at the current - cursor position. - -`yank-pop (M-y)' - Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is yank or yank-pop. - - -File: readline.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands - -Specifying Numeric Arguments ----------------------------- - -`digit-argument (M-0, M-1, ... M--)' - Add this digit to the argument already accumulating, or start a new - argument. M- starts a negative argument. - -`universal-argument ()' - This is another way to specify an argument. If this command is - followed by one or more digits, optionally with a leading minus - sign, those digits define the argument. If the command is - followed by digits, executing `universal-argument' again ends the - numeric argument, but is otherwise ignored. As a special case, if - this command is immediately followed by a character that is - neither a digit or minus sign, the argument count for the next - command is multiplied by four. The argument count is initially - one, so executing this function the first time makes the argument - count four, a second time makes the argument count sixteen, and so - on. By default, this is not bound to a key. - - -File: readline.info, Node: Commands For Completion, Next: Keyboard Macros, Prev: Numeric Arguments, Up: Bindable Readline Commands - -Letting Readline Type For You ------------------------------ - -`complete (TAB)' - Attempt to do completion on the text before the cursor. This is - application-specific. Generally, if you are typing a filename - argument, you can do filename completion; if you are typing a - command, you can do command completion, if you are typing in a - symbol to GDB, you can do symbol name completion, if you are - typing in a variable to Bash, you can do variable name completion, - and so on. - -`possible-completions (M-?)' - List the possible completions of the text before the cursor. - -`insert-completions (M-*)' - Insert all completions of the text before point that would have - been generated by `possible-completions'. - - -File: readline.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: Commands For Completion, Up: Bindable Readline Commands - -Keyboard Macros ---------------- - -`start-kbd-macro (C-x ()' - Begin saving the characters typed into the current keyboard macro. - -`end-kbd-macro (C-x ))' - Stop saving the characters typed into the current keyboard macro - and save the definition. - -`call-last-kbd-macro (C-x e)' - Re-execute the last keyboard macro defined, by making the - characters in the macro appear as if typed at the keyboard. - - -File: readline.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bindable Readline Commands - -Some Miscellaneous Commands ---------------------------- - -`re-read-init-file (C-x C-r)' - Read in the contents of the inputrc file, and incorporate any - bindings or variable assignments found there. - -`abort (C-g)' - Abort the current editing command and ring the terminal's bell - (subject to the setting of `bell-style'). - -`do-uppercase-version (M-a, M-b, M-X, ...)' - If the metafied character X is lowercase, run the command that is - bound to the corresponding uppercase character. - -`prefix-meta (ESC)' - Make the next character that you type be metafied. This is for - people without a meta key. Typing `ESC f' is equivalent to typing - `M-f'. - -`undo (C-_, C-x C-u)' - Incremental undo, separately remembered for each line. - -`revert-line (M-r)' - Undo all changes made to this line. This is like typing the `undo' - command enough times to get back to the beginning. - -`tilde-expand (M-~)' - Perform tilde expansion on the current word. - -`set-mark (C-@)' - Set the mark to the current point. If a numeric argument is - supplied, the mark is set to that position. - -`exchange-point-and-mark (C-x C-x)' - Swap the point with the mark. The current cursor position is set - to the saved position, and the old cursor position is saved as the - mark. - -`character-search (C-])' - A character is read and point is moved to the next occurrence of - that character. A negative count searches for previous - occurrences. - -`character-search-backward (M-C-])' - A character is read and point is moved to the previous occurrence - of that character. A negative count searches for subsequent - occurrences. - -`insert-comment (M-#)' - The value of the `comment-begin' variable is inserted at the - beginning of the current line, and the line is accepted as if a - newline had been typed. - -`dump-functions ()' - Print all of the functions and their key bindings to the readline - output stream. If a numeric argument is supplied, the output is - formatted in such a way that it can be made part of an INPUTRC - file. This command is unbound by default. - -`dump-variables ()' - Print all of the settable variables and their values to the - readline output stream. If a numeric argument is supplied, the - output is formatted in such a way that it can be made part of an - INPUTRC file. This command is unbound by default. - -`dump-macros ()' - Print all of the readline key sequences bound to macros and the - strings they ouput. If a numeric argument is supplied, the output - is formatted in such a way that it can be made part of an INPUTRC - file. This command is unbound by default. - - -File: readline.info, Node: Readline vi Mode, Prev: Bindable Readline Commands, Up: Command Line Editing - -Readline vi Mode -================ - - While the Readline library does not have a full set of `vi' editing -functions, it does contain enough to allow simple editing of the line. -The Readline `vi' mode behaves as specified in the POSIX 1003.2 -standard. - - In order to switch interactively between `emacs' and `vi' editing -modes, use the command M-C-j (toggle-editing-mode). The Readline -default is `emacs' mode. - - When you enter a line in `vi' mode, you are already placed in -`insertion' mode, as if you had typed an `i'. Pressing ESC switches -you into `command' mode, where you can edit the text of the line with -the standard `vi' movement keys, move to previous history lines with -`k' and subsequent lines with `j', and so forth. - - This document describes the GNU Readline Library, a utility for -aiding in the consitency of user interface across discrete programs -that need to provide a command line interface. - - Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice pare -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Foundation. - - -File: readline.info, Node: Programming with GNU Readline, Next: Concept Index, Prev: Command Line Editing, Up: Top - -Programming with GNU Readline -***************************** - - This chapter describes the interface between the GNU Readline -Library and other programs. If you are a programmer, and you wish to -include the features found in GNU Readline such as completion, line -editing, and interactive history manipulation in your own programs, -this section is for you. - -* Menu: - -* Basic Behavior:: Using the default behavior of Readline. -* Custom Functions:: Adding your own functions to Readline. -* Readline Variables:: Variables accessible to custom - functions. -* Readline Convenience Functions:: Functions which Readline supplies to - aid in writing your own -* Custom Completers:: Supplanting or supplementing Readline's - completion functions. - - -File: readline.info, Node: Basic Behavior, Next: Custom Functions, Up: Programming with GNU Readline - -Basic Behavior -============== - - Many programs provide a command line interface, such as `mail', -`ftp', and `sh'. For such programs, the default behaviour of Readline -is sufficient. This section describes how to use Readline in the -simplest way possible, perhaps to replace calls in your code to -`gets()' or `fgets ()'. - - The function `readline ()' prints a prompt and then reads and returns -a single line of text from the user. The line `readline' returns is -allocated with `malloc ()'; you should `free ()' the line when you are -done with it. The declaration for `readline' in ANSI C is - - `char *readline (char *PROMPT);' - -So, one might say - `char *line = readline ("Enter a line: ");' - -in order to read a line of text from the user. The line returned has -the final newline removed, so only the text remains. - - If `readline' encounters an `EOF' while reading the line, and the -line is empty at that point, then `(char *)NULL' is returned. -Otherwise, the line is ended just as if a newline had been typed. - - If you want the user to be able to get at the line later, (with C-p -for example), you must call `add_history ()' to save the line away in a -"history" list of such lines. - - `add_history (line)'; - -For full details on the GNU History Library, see the associated manual. - - It is preferable to avoid saving empty lines on the history list, -since users rarely have a burning need to reuse a blank line. Here is -a function which usefully replaces the standard `gets ()' library -function, and has the advantage of no static buffer to overflow: - - /* A static variable for holding the line. */ - static char *line_read = (char *)NULL; - - /* Read a string, and return a pointer to it. Returns NULL on EOF. */ - char * - rl_gets () - { - /* If the buffer has already been allocated, return the memory - to the free pool. */ - if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } - - /* Get a line from the user. */ - line_read = readline (""); - - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); - - return (line_read); - } - - This function gives the user the default behaviour of TAB -completion: completion on file names. If you do not want Readline to -complete on filenames, you can change the binding of the TAB key with -`rl_bind_key ()'. - - `int rl_bind_key (int KEY, int (*FUNCTION)());' - - `rl_bind_key ()' takes two arguments: KEY is the character that you -want to bind, and FUNCTION is the address of the function to call when -KEY is pressed. Binding TAB to `rl_insert ()' makes TAB insert itself. -`rl_bind_key ()' returns non-zero if KEY is not a valid ASCII character -code (between 0 and 255). - - Thus, to disable the default TAB behavior, the following suffices: - `rl_bind_key ('\t', rl_insert);' - - This code should be executed once at the start of your program; you -might write a function called `initialize_readline ()' which performs -this and other desired initializations, such as installing custom -completers (*note Custom Completers::.). - - -File: readline.info, Node: Custom Functions, Next: Readline Variables, Prev: Basic Behavior, Up: Programming with GNU Readline - -Custom Functions -================ - - Readline provides many functions for manipulating the text of the -line, but it isn't possible to anticipate the needs of all programs. -This section describes the various functions and variables defined -within the Readline library which allow a user program to add -customized functionality to Readline. - -* Menu: - -* The Function Type:: C declarations to make code readable. -* Function Writing:: Variables and calling conventions. - - -File: readline.info, Node: The Function Type, Next: Function Writing, Up: Custom Functions - -The Function Type ------------------ - - For readabilty, we declare a new type of object, called "Function". -A `Function' is a C function which returns an `int'. The type -declaration for `Function' is: - -`typedef int Function ();' - - The reason for declaring this new type is to make it easier to write -code describing pointers to C functions. Let us say we had a variable -called FUNC which was a pointer to a function. Instead of the classic -C declaration - - `int (*)()func;' - -we may write - - `Function *func;' - -Similarly, there are - - typedef void VFunction (); - typedef char *CPFunction (); and - typedef char **CPPFunction (); - -for functions returning no value, `pointer to char', and `pointer to -pointer to char', respectively. - - -File: readline.info, Node: Function Writing, Prev: The Function Type, Up: Custom Functions - -Writing a New Function ----------------------- - - In order to write new functions for Readline, you need to know the -calling conventions for keyboard-invoked functions, and the names of the -variables that describe the current state of the line read so far. - - The calling sequence for a command `foo' looks like - - `foo (int count, int key)' - -where COUNT is the numeric argument (or 1 if defaulted) and KEY is the -key that invoked this function. - - It is completely up to the function as to what should be done with -the numeric argument. Some functions use it as a repeat count, some as -a flag, and others to choose alternate behavior (refreshing the current -line as opposed to refreshing the screen, for example). Some choose to -ignore it. In general, if a function uses the numeric argument as a -repeat count, it should be able to do something useful with both -negative and positive arguments. At the very least, it should be aware -that it can be passed a negative argument. - - -File: readline.info, Node: Readline Variables, Next: Readline Convenience Functions, Prev: Custom Functions, Up: Programming with GNU Readline - -Readline Variables -================== - - These variables are available to function writers. - - - Variable: char * rl_line_buffer - This is the line gathered so far. You are welcome to modify the - contents of the line, but see *Note Allowing Undoing::. - - - Variable: int rl_point - The offset of the current cursor position in `rl_line_buffer' (the - *point*). - - - Variable: int rl_end - The number of characters present in `rl_line_buffer'. When - `rl_point' is at the end of the line, `rl_point' and `rl_end' are - equal. - - - Variable: int rl_mark - The mark (saved position) in the current line. If set, the mark - and point define a *region*. - - - Variable: int rl_done - Setting this to a non-zero value causes Readline to return the - current line immediately. - - - Variable: int rl_pending_input - Setting this to a value makes it the next keystroke read. This is - a way to stuff a single character into the input stream. - - - Variable: char * rl_prompt - The prompt Readline uses. This is set from the argument to - `readline ()', and should not be assigned to directly. - - - Variable: char * rl_library_version - The version number of this revision of the library. - - - Variable: char * rl_terminal_name - The terminal type, used for initialization. - - - Variable: char * rl_readline_name - This variable is set to a unique name by each application using - Readline. The value allows conditional parsing of the inputrc file - (*note Conditional Init Constructs::.). - - - Variable: FILE * rl_instream - The stdio stream from which Readline reads input. - - - Variable: FILE * rl_outstream - The stdio stream to which Readline performs output. - - - Variable: Function * rl_startup_hook - If non-zero, this is the address of a function to call just before - `readline' prints the first prompt. - - - Variable: Function * rl_event_hook - If non-zero, this is the address of a function to call periodically - when readline is waiting for terminal input. - - - Variable: Function * rl_getc_function - If non-zero, `readline' will call indirectly through this pointer - to get a character from the input stream. By default, it is set to - `rl_getc', the default `readline' character input function (*note - Utility Functions::.). - - - Variable: VFunction * rl_redisplay_function - If non-zero, `readline' will call indirectly through this pointer - to update the display with the current contents of the editing - buffer. By default, it is set to `rl_redisplay', the default - `readline' redisplay function (*note Redisplay::.). - - - Variable: Keymap rl_executing_keymap - This variable is set to the keymap (*note Keymaps::.) in which the - currently executing readline function was found. - - - Variable: Keymap rl_binding_keymap - This variable is set to the keymap (*note Keymaps::.) in which the - last key binding occurred. - - -File: readline.info, Node: Readline Convenience Functions, Next: Custom Completers, Prev: Readline Variables, Up: Programming with GNU Readline - -Readline Convenience Functions -============================== - -* Menu: - -* Function Naming:: How to give a function you write a name. -* Keymaps:: Making keymaps. -* Binding Keys:: Changing Keymaps. -* Associating Function Names and Bindings:: Translate function names to - key sequences. -* Allowing Undoing:: How to make your functions undoable. -* Redisplay:: Functions to control line display. -* Modifying Text:: Functions to modify `rl_line_buffer'. -* Utility Functions:: Generally useful functions and hooks. -* Alternate Interface:: Using Readline in a `callback' fashion. - - -File: readline.info, Node: Function Naming, Next: Keymaps, Up: Readline Convenience Functions - -Naming a Function ------------------ - - The user can dynamically change the bindings of keys while using -Readline. This is done by representing the function with a descriptive -name. The user is able to type the descriptive name when referring to -the function. Thus, in an init file, one might find - - Meta-Rubout: backward-kill-word - - This binds the keystroke Meta-Rubout to the function *descriptively* -named `backward-kill-word'. You, as the programmer, should bind the -functions you write to descriptive names as well. Readline provides a -function for doing that: - - - Function: int rl_add_defun (char *name, Function *function, int key) - Add NAME to the list of named functions. Make FUNCTION be the - function that gets called. If KEY is not -1, then bind it to - FUNCTION using `rl_bind_key ()'. - - Using this function alone is sufficient for most applications. It is -the recommended way to add a few functions to the default functions that -Readline has built in. If you need to do something other than adding a -function to Readline, you may need to use the underlying functions -described below. - - -File: readline.info, Node: Keymaps, Next: Binding Keys, Prev: Function Naming, Up: Readline Convenience Functions - -Selecting a Keymap ------------------- - - Key bindings take place on a "keymap". The keymap is the -association between the keys that the user types and the functions that -get run. You can make your own keymaps, copy existing keymaps, and tell -Readline which keymap to use. - - - Function: Keymap rl_make_bare_keymap () - Returns a new, empty keymap. The space for the keymap is - allocated with `malloc ()'; you should `free ()' it when you are - done. - - - Function: Keymap rl_copy_keymap (Keymap map) - Return a new keymap which is a copy of MAP. - - - Function: Keymap rl_make_keymap () - Return a new keymap with the printing characters bound to - rl_insert, the lowercase Meta characters bound to run their - equivalents, and the Meta digits bound to produce numeric - arguments. - - - Function: void rl_discard_keymap (Keymap keymap) - Free the storage associated with KEYMAP. - - Readline has several internal keymaps. These functions allow you to -change which keymap is active. - - - Function: Keymap rl_get_keymap () - Returns the currently active keymap. - - - Function: void rl_set_keymap (Keymap keymap) - Makes KEYMAP the currently active keymap. - - - Function: Keymap rl_get_keymap_by_name (char *name) - Return the keymap matching NAME. NAME is one which would be - supplied in a `set keymap' inputrc line (*note Readline Init - File::.). - - - Function: char * rl_get_keymap_name (Keymap keymap) - Return the name matching KEYMAP. NAME is one which would be - supplied in a `set keymap' inputrc line (*note Readline Init - File::.). - - -File: readline.info, Node: Binding Keys, Next: Associating Function Names and Bindings, Prev: Keymaps, Up: Readline Convenience Functions - -Binding Keys ------------- - - You associate keys with functions through the keymap. Readline has -several internal keymaps: `emacs_standard_keymap', `emacs_meta_keymap', -`emacs_ctlx_keymap', `vi_movement_keymap', and `vi_insertion_keymap'. -`emacs_standard_keymap' is the default, and the examples in this manual -assume that. - - These functions manage key bindings. - - - Function: int rl_bind_key (int key, Function *function) - Binds KEY to FUNCTION in the currently active keymap. Returns - non-zero in the case of an invalid KEY. - - - Function: int rl_bind_key_in_map (int key, Function *function, - Keymap map) - Bind KEY to FUNCTION in MAP. Returns non-zero in the case of an - invalid KEY. - - - Function: int rl_unbind_key (int key) - Bind KEY to the null function in the currently active keymap. - Returns non-zero in case of error. - - - Function: int rl_unbind_key_in_map (int key, Keymap map) - Bind KEY to the null function in MAP. Returns non-zero in case of - error. - - - Function: int rl_generic_bind (int type, char *keyseq, char *data, - Keymap map) - Bind the key sequence represented by the string KEYSEQ to the - arbitrary pointer DATA. TYPE says what kind of data is pointed to - by DATA; this can be a function (`ISFUNC'), a macro (`ISMACR'), or - a keymap (`ISKMAP'). This makes new keymaps as necessary. The - initial keymap in which to do bindings is MAP. - - - Function: int rl_parse_and_bind (char *line) - Parse LINE as if it had been read from the `inputrc' file and - perform any key bindings and variable assignments found (*note - Readline Init File::.). - - - Function: int rl_read_init_file (char *filename) - Read keybindings and variable assignments from FILENAME (*note - Readline Init File::.). - - -File: readline.info, Node: Associating Function Names and Bindings, Next: Allowing Undoing, Prev: Binding Keys, Up: Readline Convenience Functions - -Associating Function Names and Bindings ---------------------------------------- - - These functions allow you to find out what keys invoke named -functions and the functions invoked by a particular key sequence. - - - Function: Function * rl_named_function (char *name) - Return the function with name NAME. - - - Function: Function * rl_function_of_keyseq (char *keyseq, Keymap - map, int *type) - Return the function invoked by KEYSEQ in keymap MAP. If MAP is - NULL, the current keymap is used. If TYPE is not NULL, the type - of the object is returned in it (one of `ISFUNC', `ISKMAP', or - `ISMACR'). - - - Function: char ** rl_invoking_keyseqs (Function *function) - Return an array of strings representing the key sequences used to - invoke FUNCTION in the current keymap. - - - Function: char ** rl_invoking_keyseqs_in_map (Function *function, - Keymap map) - Return an array of strings representing the key sequences used to - invoke FUNCTION in the keymap MAP. - - - Function: void rl_function_dumper (int readable) - Print the readline function names and the key sequences currently - bound to them to `rl_outstream'. If READABLE is non-zero, the - list is formatted in such a way that it can be made part of an - `inputrc' file and re-read. - - - Function: void rl_list_funmap_names () - Print the names of all bindable Readline functions to - `rl_outstream'. - - -File: readline.info, Node: Allowing Undoing, Next: Redisplay, Prev: Associating Function Names and Bindings, Up: Readline Convenience Functions - -Allowing Undoing ----------------- - - Supporting the undo command is a painless thing, and makes your -functions much more useful. It is certainly easy to try something if -you know you can undo it. I could use an undo function for the stock -market. - - If your function simply inserts text once, or deletes text once, and -uses `rl_insert_text ()' or `rl_delete_text ()' to do it, then undoing -is already done for you automatically. - - If you do multiple insertions or multiple deletions, or any -combination of these operations, you should group them together into -one operation. This is done with `rl_begin_undo_group ()' and -`rl_end_undo_group ()'. - - The types of events that can be undone are: - - enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; - - Notice that `UNDO_DELETE' means to insert some text, and -`UNDO_INSERT' means to delete some text. That is, the undo code tells -undo what to undo, not how to undo it. `UNDO_BEGIN' and `UNDO_END' are -tags added by `rl_begin_undo_group ()' and `rl_end_undo_group ()'. - - - Function: int rl_begin_undo_group () - Begins saving undo information in a group construct. The undo - information usually comes from calls to `rl_insert_text ()' and - `rl_delete_text ()', but could be the result of calls to - `rl_add_undo ()'. - - - Function: int rl_end_undo_group () - Closes the current undo group started with `rl_begin_undo_group - ()'. There should be one call to `rl_end_undo_group ()' for each - call to `rl_begin_undo_group ()'. - - - Function: void rl_add_undo (enum undo_code what, int start, int end, - char *text) - Remember how to undo an event (according to WHAT). The affected - text runs from START to END, and encompasses TEXT. - - - Function: void free_undo_list () - Free the existing undo list. - - - Function: int rl_do_undo () - Undo the first thing on the undo list. Returns `0' if there was - nothing to undo, non-zero if something was undone. - - Finally, if you neither insert nor delete text, but directly modify -the existing text (e.g., change its case), call `rl_modifying ()' once, -just before you modify the text. You must supply the indices of the -text range that you are going to modify. - - - Function: int rl_modifying (int start, int end) - Tell Readline to save the text between START and END as a single - undo unit. It is assumed that you will subsequently modify that - text. - - -File: readline.info, Node: Redisplay, Next: Modifying Text, Prev: Allowing Undoing, Up: Readline Convenience Functions - -Redisplay ---------- - - - Function: void rl_redisplay () - Change what's displayed on the screen to reflect the current - contents of `rl_line_buffer'. - - - Function: int rl_forced_update_display () - Force the line to be updated and redisplayed, whether or not - Readline thinks the screen display is correct. - - - Function: int rl_on_new_line () - Tell the update routines that we have moved onto a new (empty) - line, usually after ouputting a newline. - - - Function: int rl_reset_line_state () - Reset the display state to a clean state and redisplay the current - line starting on a new line. - - - Function: int rl_message (va_alist) - The arguments are a string as would be supplied to `printf'. The - resulting string is displayed in the "echo area". The echo area - is also used to display numeric arguments and search strings. - - - Function: int rl_clear_message () - Clear the message in the echo area. - - -File: readline.info, Node: Modifying Text, Next: Utility Functions, Prev: Redisplay, Up: Readline Convenience Functions - -Modifying Text --------------- - - - Function: int rl_insert_text (char *text) - Insert TEXT into the line at the current cursor position. - - - Function: int rl_delete_text (int start, int end) - Delete the text between START and END in the current line. - - - Function: char * rl_copy_text (int start, int end) - Return a copy of the text between START and END in the current - line. - - - Function: int rl_kill_text (int start, int end) - Copy the text between START and END in the current line to the - kill ring, appending or prepending to the last kill if the last - command was a kill command. The text is deleted. If START is - less than END, the text is appended, otherwise prepended. If the - last command was not a kill, a new kill ring slot is used. - - -File: readline.info, Node: Utility Functions, Next: Alternate Interface, Prev: Modifying Text, Up: Readline Convenience Functions - -Utility Functions ------------------ - - - Function: int rl_read_key () - Return the next character available. This handles input inserted - into the input stream via PENDING INPUT (*note Readline - Variables::.) and `rl_stuff_char ()', macros, and characters read - from the keyboard. - - - Function: int rl_getc (FILE *) - Return the next character available from the keyboard. - - - Function: int rl_stuff_char (int c) - Insert C into the Readline input stream. It will be "read" before - Readline attempts to read characters from the terminal with - `rl_read_key ()'. - - - Function: rl_extend_line_buffer (int len) - Ensure that `rl_line_buffer' has enough space to hold LEN - characters, possibly reallocating it if necessary. - - - Function: int rl_initialize () - Initialize or re-initialize Readline's internal state. - - - Function: int rl_reset_terminal (char *terminal_name) - Reinitialize Readline's idea of the terminal settings using - TERMINAL_NAME as the terminal type (e.g., `vt100'). - - - Function: int alphabetic (int c) - Return 1 if C is an alphabetic character. - - - Function: int numeric (int c) - Return 1 if C is a numeric character. - - - Function: int ding () - Ring the terminal bell, obeying the setting of `bell-style'. - - The following are implemented as macros, defined in `chartypes.h'. - - - Function: int uppercase_p (int c) - Return 1 if C is an uppercase alphabetic character. - - - Function: int lowercase_p (int c) - Return 1 if C is a lowercase alphabetic character. - - - Function: int digit_p (int c) - Return 1 if C is a numeric character. - - - Function: int to_upper (int c) - If C is a lowercase alphabetic character, return the corresponding - uppercase character. - - - Function: int to_lower (int c) - If C is an uppercase alphabetic character, return the corresponding - lowercase character. - - - Function: int digit_value (int c) - If C is a number, return the value it represents. - - -File: readline.info, Node: Alternate Interface, Prev: Utility Functions, Up: Readline Convenience Functions - -Alternate Interface -------------------- - - An alternate interface is available to plain `readline()'. Some -applications need to interleave keyboard I/O with file, device, or -window system I/O, typically by using a main loop to `select()' on -various file descriptors. To accomodate this need, readline can also -be invoked as a `callback' function from an event loop. There are -functions available to make this easy. - - - Function: void rl_callback_handler_install (char *prompt, Vfunction - *lhandler) - Set up the terminal for readline I/O and display the initial - expanded value of PROMPT. Save the value of LHANDLER to use as a - callback when a complete line of input has been entered. - - - Function: void rl_callback_read_char () - Whenever an application determines that keyboard input is - available, it should call `rl_callback_read_char()', which will - read the next character from the current input source. If that - character completes the line, `rl_callback_read_char' will invoke - the LHANDLER function saved by `rl_callback_handler_install' to - process the line. `EOF' is indicated by calling LHANDLER with a - `NULL' line. - - - Function: void rl_callback_handler_remove () - Restore the terminal to its initial state and remove the line - handler. This may be called from within a callback as well as - independently. - -An Example ----------- - - Here is a function which changes lowercase characters to their -uppercase equivalents, and uppercase characters to lowercase. If this -function was bound to `M-c', then typing `M-c' would change the case of -the character under point. Typing `M-1 0 M-c' would change the case of -the following 10 characters, leaving the cursor on the last character -changed. - - /* Invert the case of the COUNT following characters. */ - int - invert_case_line (count, key) - int count, key; - { - register int start, end, i; - - start = rl_point; - - if (rl_point >= rl_end) - return (0); - - if (count < 0) - { - direction = -1; - count = -count; - } - else - direction = 1; - - /* Find the end of the range to modify. */ - end = start + (count * direction); - - /* Force it to be within range. */ - if (end > rl_end) - end = rl_end; - else if (end < 0) - end = 0; - - if (start == end) - return (0); - - if (start > end) - { - int temp = start; - start = end; - end = temp; - } - - /* Tell readline that we are modifying the line, so it will save - the undo information. */ - rl_modifying (start, end); - - for (i = start; i != end; i++) - { - if (uppercase_p (rl_line_buffer[i])) - rl_line_buffer[i] = to_lower (rl_line_buffer[i]); - else if (lowercase_p (rl_line_buffer[i])) - rl_line_buffer[i] = to_upper (rl_line_buffer[i]); - } - /* Move point to on top of the last character changed. */ - rl_point = (direction == 1) ? end - 1 : start; - return (0); - } - - -File: readline.info, Node: Custom Completers, Prev: Readline Convenience Functions, Up: Programming with GNU Readline - -Custom Completers -================= - - Typically, a program that reads commands from the user has a way of -disambiguating commands and data. If your program is one of these, then -it can provide completion for commands, data, or both. The following -sections describe how your program and Readline cooperate to provide -this service. - -* Menu: - -* How Completing Works:: The logic used to do completion. -* Completion Functions:: Functions provided by Readline. -* Completion Variables:: Variables which control completion. -* A Short Completion Example:: An example of writing completer subroutines. - - -File: readline.info, Node: How Completing Works, Next: Completion Functions, Up: Custom Completers - -How Completing Works --------------------- - - In order to complete some text, the full list of possible completions -must be available. That is, it is not possible to accurately expand a -partial word without knowing all of the possible words which make sense -in that context. The Readline library provides the user interface to -completion, and two of the most common completion functions: filename -and username. For completing other types of text, you must write your -own completion function. This section describes exactly what such -functions must do, and provides an example. - - There are three major functions used to perform completion: - - 1. The user-interface function `rl_complete ()'. This function is - called with the same arguments as other Readline functions - intended for interactive use: COUNT and INVOKING_KEY. It - isolates the word to be completed and calls `completion_matches - ()' to generate a list of possible completions. It then either - lists the possible completions, inserts the possible completions, - or actually performs the completion, depending on which behavior - is desired. - - 2. The internal function `completion_matches ()' uses your - "generator" function to generate the list of possible matches, and - then returns the array of these matches. You should place the - address of your generator function in - `rl_completion_entry_function'. - - 3. The generator function is called repeatedly from - `completion_matches ()', returning a string each time. The - arguments to the generator function are TEXT and STATE. TEXT is - the partial word to be completed. STATE is zero the first time - the function is called, allowing the generator to perform any - necessary initialization, and a positive non-zero integer for each - subsequent call. When the generator function returns `(char - *)NULL' this signals `completion_matches ()' that there are no - more possibilities left. Usually the generator function computes - the list of possible completions when STATE is zero, and returns - them one at a time on subsequent calls. Each string the generator - function returns as a match must be allocated with `malloc()'; - Readline frees the strings when it has finished with them. - - - - Function: int rl_complete (int ignore, int invoking_key) - Complete the word at or before point. You have supplied the - function that does the initial simple matching selection algorithm - (see `completion_matches ()'). The default is to do filename - completion. - - - Variable: Function * rl_completion_entry_function - This is a pointer to the generator function for `completion_matches - ()'. If the value of `rl_completion_entry_function' is `(Function - *)NULL' then the default filename generator function, - `filename_completion_function ()', is used. - - -File: readline.info, Node: Completion Functions, Next: Completion Variables, Prev: How Completing Works, Up: Custom Completers - -Completion Functions --------------------- - - Here is the complete list of callable completion functions present in -Readline. - - - Function: int rl_complete_internal (int what_to_do) - Complete the word at or before point. WHAT_TO_DO says what to do - with the completion. A value of `?' means list the possible - completions. `TAB' means do standard completion. `*' means - insert all of the possible completions. `!' means to display all - of the possible completions, if there is more than one, as well as - performing partial completion. - - - Function: int rl_complete (int ignore, int invoking_key) - Complete the word at or before point. You have supplied the - function that does the initial simple matching selection algorithm - (see `completion_matches ()' and `rl_completion_entry_function'). - The default is to do filename completion. This calls - `rl_complete_internal ()' with an argument depending on - INVOKING_KEY. - - - Function: int rl_possible_completions (int count, int invoking_key)) - List the possible completions. See description of `rl_complete - ()'. This calls `rl_complete_internal ()' with an argument of `?'. - - - Function: int rl_insert_completions (int count, int invoking_key)) - Insert the list of possible completions into the line, deleting the - partially-completed word. See description of `rl_complete ()'. - This calls `rl_complete_internal ()' with an argument of `*'. - - - Function: char ** completion_matches (char *text, CPFunction - *entry_func) - Returns an array of `(char *)' which is a list of completions for - TEXT. If there are no completions, returns `(char **)NULL'. The - first entry in the returned array is the substitution for TEXT. - The remaining entries are the possible completions. The array is - terminated with a `NULL' pointer. - - ENTRY_FUNC is a function of two args, and returns a `(char *)'. - The first argument is TEXT. The second is a state argument; it is - zero on the first call, and non-zero on subsequent calls. - eNTRY_FUNC returns a `NULL' pointer to the caller when there are - no more matches. - - - Function: char * filename_completion_function (char *text, int state) - A generator function for filename completion in the general case. - Note that completion in Bash is a little different because of all - the pathnames that must be followed when looking up completions - for a command. The Bash source is a useful reference for writing - custom completion functions. - - - Function: char * username_completion_function (char *text, int state) - A completion generator for usernames. TEXT contains a partial - username preceded by a random character (usually `~'). As with all - completion generators, STATE is zero on the first call and non-zero - for subsequent calls. - - -File: readline.info, Node: Completion Variables, Next: A Short Completion Example, Prev: Completion Functions, Up: Custom Completers - -Completion Variables --------------------- - - - Variable: Function * rl_completion_entry_function - A pointer to the generator function for `completion_matches ()'. - `NULL' means to use `filename_entry_function ()', the default - filename completer. - - - Variable: CPPFunction * rl_attempted_completion_function - A pointer to an alternative function to create matches. The - function is called with TEXT, START, and END. START and END are - indices in `rl_line_buffer' saying what the boundaries of TEXT - are. If this function exists and returns `NULL', or if this - variable is set to `NULL', then `rl_complete ()' will call the - value of `rl_completion_entry_function' to generate matches, - otherwise the array of strings returned will be used. - - - Variable: CPFunction * rl_filename_quoting_function - A pointer to a function that will quote a filename in an - application- specific fashion. This is called if filename - completion is being attempted and one of the characters in - `rl_filename_quote_characters' appears in a completed filename. - The function is called with TEXT, MATCH_TYPE, and QUOTE_POINTER. - The TEXT is the filename to be quoted. The MATCH_TYPE is either - `SINGLE_MATCH', if there is only one completion match, or - `MULT_MATCH'. Some functions use this to decide whether or not to - insert a closing quote character. The QUOTE_POINTER is a pointer - to any opening quote character the user typed. Some functions - choose to reset this character. - - - Variable: CPFunction * rl_filename_dequoting_function - A pointer to a function that will remove application-specific - quoting characters from a filename before completion is attempted, - so those characters do not interfere with matching the text - against names in the filesystem. It is called with TEXT, the text - of the word to be dequoted, and QUOTE_CHAR, which is the quoting - character that delimits the filename (usually `'' or `"'). If - QUOTE_CHAR is zero, the filename was not in an embedded string. - - - Variable: Function * rl_char_is_quoted_p - A pointer to a function to call that determines whether or not a - specific character in the line buffer is quoted, according to - whatever quoting mechanism the program calling readline uses. The - function is called with two arguments: TEXT, the text of the line, - and INDEX, the index of the character in the line. It is used to - decide whether a character found in - `rl_completer_word_break_characters' should be used to break words - for the completer. - - - Variable: int rl_completion_query_items - Up to this many items will be displayed in response to a - possible-completions call. After that, we ask the user if she is - sure she wants to see them all. The default value is 100. - - - Variable: char * rl_basic_word_break_characters - The basic list of characters that signal a break between words for - the completer routine. The default value of this variable is the - characters which break words for completion in Bash, i.e., `" - \t\n\"\\'`@$><=;|&{("'. - - - Variable: char * rl_basic_quote_characters - List of quote characters which can cause a word break. - - - Variable: char * rl_completer_word_break_characters - The list of characters that signal a break between words for - `rl_complete_internal ()'. The default list is the value of - `rl_basic_word_break_characters'. - - - Variable: char * rl_completer_quote_characters - List of characters which can be used to quote a substring of the - line. Completion occurs on the entire substring, and within the - substring `rl_completer_word_break_characters' are treated as any - other character, unless they also appear within this list. - - - Variable: char * rl_filename_quote_characters - A list of characters that cause a filename to be quoted by the - completer when they appear in a completed filename. The default - is empty. - - - Variable: char * rl_special_prefixes - The list of characters that are word break characters, but should - be left in TEXT when it is passed to the completion function. - Programs can use this to help determine what kind of completing to - do. For instance, Bash sets this variable to "$@" so that it can - complete shell variables and hostnames. - - - Variable: int rl_completion_append_character - When a single completion alternative matches at the end of the - command line, this character is appended to the inserted - completion text. The default is a space character (` '). Setting - this to the null character (`\0') prevents anything being appended - automatically. This can be changed in custom completion functions - to provide the "most sensible word separator character" according - to an application-specific command line syntax specification. - - - Variable: int rl_ignore_completion_duplicates - If non-zero, then disallow duplicates in the matches. Default is - 1. - - - Variable: int rl_filename_completion_desired - Non-zero means that the results of the matches are to be treated as - filenames. This is *always* zero on entry, and can only be changed - within a completion entry generator function. If it is set to a - non-zero value, directory names have a slash appended and Readline - attempts to quote completed filenames if they contain any embedded - word break characters. - - - Variable: int rl_filename_quoting_desired - Non-zero means that the results of the matches are to be quoted - using double quotes (or an application-specific quoting mechanism) - if the completed filename contains any characters in - `rl_filename_quote_chars'. This is *always* non-zero on entry, - and can only be changed within a completion entry generator - function. The quoting is effected via a call to the function - pointed to by `rl_filename_quoting_function'. - - - Variable: int rl_inhibit_completion - If this variable is non-zero, completion is inhibit - #include - #include - #include - #include - - #include - #include - - extern char *getwd (); - extern char *xmalloc (); - - /* The names of functions that actually do the manipulation. */ - int com_list (), com_view (), com_rename (), com_stat (), com_pwd (); - int com_delete (), com_help (), com_cd (), com_quit (); - - /* A structure which contains information on the commands this program - can understand. */ - - typedef struct { - char *name; /* User printable name of the function. */ - Function *func; /* Function to call to do the job. */ - char *doc; /* Documentation for this function. */ - } COMMAND; - - COMMAND commands[] = { - { "cd", com_cd, "Change to directory DIR" }, - { "delete", com_delete, "Delete FILE" }, - { "help", com_help, "Display this text" }, - { "?", com_help, "Synonym for `help'" }, - { "list", com_list, "List files in DIR" }, - { "ls", com_list, "Synonym for `list'" }, - { "pwd", com_pwd, "Print the current working directory" }, - { "quit", com_quit, "Quit using Fileman" }, - { "rename", com_rename, "Rename FILE to NEWNAME" }, - { "stat", com_stat, "Print out statistics on FILE" }, - { "view", com_view, "View the contents of FILE" }, - { (char *)NULL, (Function *)NULL, (char *)NULL } - }; - - /* Forward declarations. */ - char *stripwhite (); - COMMAND *find_command (); - - /* The name of this program, as taken from argv[0]. */ - char *progname; - - /* When non-zero, this global means the user is done using this program. */ - int done; - - char * - dupstr (s) - int s; - { - char *r; - - r = xmalloc (strlen (s) + 1); - strcpy (r, s); - return (r); - } - - main (argc, argv) - int argc; - char **argv; - { - char *line, *s; - - progname = argv[0]; - - initialize_readline (); /* Bind our completer. */ - - /* Loop reading and executing lines until the user quits. */ - for ( ; done == 0; ) - { - line = readline ("FileMan: "); - - if (!line) - break; - - /* Remove leading and trailing whitespace from the line. - Then, if there is anything left, add it to the history list - and execute it. */ - s = stripwhite (line); - - if (*s) - { - add_history (s); - execute_line (s); - } - - free (line); - } - exit (0); - } - - /* Execute a command line. */ - int - execute_line (line) - char *line; - { - register int i; - COMMAND *command; - char *word; - - /* Isolate the command word. */ - i = 0; - while (line[i] && whitespace (line[i])) - i++; - word = line + i; - - while (line[i] && !whitespace (line[i])) - i++; - - if (line[i]) - line[i++] = '\0'; - - command = find_command (word); - - if (!command) - { - fprintf (stderr, "%s: No such command for FileMan.\n", word); - return (-1); - } - - /* Get argument to command, if any. */ - while (whitespace (line[i])) - i++; - - word = line + i; - - /* Call the function. */ - return ((*(command->func)) (word)); - } - - /* Look up NAME as the name of a command, and return a pointer to that - command. Return a NULL pointer if NAME isn't a command name. */ - COMMAND * - find_command (name) - char *name; - { - register int i; - - for (i = 0; commands[i].name; i++) - if (strcmp (name, commands[i].name) == 0) - return (&commands[i]); - - return ((COMMAND *)NULL); - } - - /* Strip whitespace from the start and end of STRING. Return a pointer - into STRING. */ - char * - stripwhite (string) - char *string; - { - register char *s, *t; - - for (s = string; whitespace (*s); s++) - ; - - if (*s == 0) - return (s); - - t = s + strlen (s) - 1; - while (t > s && whitespace (*t)) - t--; - *++t = '\0'; - - return s; - } - - /* **************************************************************** */ - /* */ - /* Interface to Readline Completion */ - /* */ - /* **************************************************************** */ - - char *command_generator (); - char **fileman_completion (); - - /* Tell the GNU Readline library how to complete. We want to try to complete - on command names if this is the first word in the line, or on filenames - if not. */ - initialize_readline () - { - /* Allow conditional parsing of the ~/.inputrc file. */ - rl_readline_name = "FileMan"; - - /* Tell the completer that we want a crack first. */ - rl_attempted_completion_function = (CPPFunction *)fileman_completion; - } - - /* Attempt to complete on the contents of TEXT. START and END bound the - region of rl_line_buffer that contains the word to complete. TEXT is - the word to complete. We can use the entire contents of rl_line_buffer - in case we want to do some simple parsing. Return the array of matches, - or NULL if there aren't any. */ - char ** - fileman_completion (text, start, end) - char *text; - int start, end; - { - char **matches; - - matches = (char **)NULL; - - /* If this word is at the start of the line, then it is a command - to complete. Otherwise it is the name of a file in the current - directory. */ - if (start == 0) - matches = completion_matches (text, command_generator); - - return (matches); - } - - /* Generator function for command completion. STATE lets us know whether - to start from scratch; without any state (i.e. STATE == 0), then we - start at the top of the list. */ - char * - command_generator (text, state) - char *text; - int state; - { - static int list_index, len; - char *name; - - /* If this is a new word to complete, initialize now. This includes - saving the length of TEXT for efficiency, and initializing the index - variable to 0. */ - if (!state) - { - list_index = 0; - len = strlen (text); - } - - /* Return the next name which partially matches from the command list. */ - while (name = commands[list_index].name) - { - list_index++; - - if (strncmp (name, text, len) == 0) - return (dupstr(name)); - } - - /* If no names matched, then return NULL. */ - return ((char *)NULL); - } - - /* **************************************************************** */ - /* */ - /* FileMan Commands */ - /* */ - /* **************************************************************** */ - - /* String to pass to system (). This is for the LIST, VIEW and RENAME - commands. */ - static char syscom[1024]; - - /* List the file(s) named in arg. */ - com_list (arg) - char *arg; - { - if (!arg) - arg = ""; - - sprintf (syscom, "ls -FClg %s", arg); - return (system (syscom)); - } - - com_view (arg) - char *arg; - { - if (!valid_argument ("view", arg)) - return 1; - - sprintf (syscom, "more %s", arg); - return (system (syscom)); - } - - com_rename (arg) - char *arg; - { - too_dangerous ("rename"); - return (1); - } - - com_stat (arg) - char *arg; - { - struct stat finfo; - - if (!valid_argument ("stat", arg)) - return (1); - - if (stat (arg, &finfo) == -1) - { - perror (arg); - return (1); - } - - printf ("Statistics for `%s':\n", arg); - - printf ("%s has %d link%s, and is %d byte%s in length.\n", arg, - finfo.st_nlink, - (finfo.st_nlink == 1) ? "" : "s", - finfo.st_size, - (finfo.st_size == 1) ? "" : "s"); - printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime)); - printf (" Last access at: %s", ctime (&finfo.st_atime)); - printf (" Last modified at: %s", ctime (&finfo.st_mtime)); - return (0); - } - - com_delete (arg) - char *arg; - { - too_dangerous ("delete"); - return (1); - } - - /* Print out help for ARG, or for all of the commands if ARG is - not present. */ - com_help (arg) - char *arg; - { - register int i; - int printed = 0; - - for (i = 0; commands[i].name; i++) - { - if (!*arg || (strcmp (arg, commands[i].name) == 0)) - { - printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc); - printed++; - } - } - - if (!printed) - { - printf ("No commands match `%s'. Possibilties are:\n", arg); - - for (i = 0; commands[i].name; i++) - { - /* Print in six columns. */ - if (printed == 6) - { - printed = 0; - printf ("\n"); - } - - printf ("%s\t", commands[i].name); - printed++; - } - - if (printed) - printf ("\n"); - } - return (0); - } - - /* Change to the directory ARG. */ - com_cd (arg) - char *arg; - { - if (chdir (arg) == -1) - { - perror (arg); - return 1; - } - - com_pwd (""); - return (0); - } - - /* Print out the current working directory. */ - com_pwd (ignore) - char *ignore; - { - char dir[1024], *s; - - s = getwd (dir); - if (s == 0) - { - printf ("Error getting pwd: %s\n", dir); - return 1; - } - - printf ("Current directory is %s\n", dir); - return 0; - } - - /* The user wishes to quit using this program. Just set DONE non-zero. */ - com_quit (arg) - char *arg; - { - done = 1; - return (0); - } - - /* Function which tells you that you can't do this. */ - too_dangerous (caller) - char *caller; - { - fprintf (stderr, - "%s: Too dangerous for me to distribute. Write it yourself.\n", - caller); - } - - /* Return non-zero if ARG is a valid argument for CALLER, else print - an error message and return zero. */ - int - valid_argument (caller, arg) - char *caller, *arg; - { - if (!arg || !*arg) - { - fprintf (stderr, "%s: Argument required.\n", caller); - return (0); - } - - return (1); - } - - -File: readline.info, Node: Concept Index, Next: Function and Variable Index, Prev: Programming with GNU Readline, Up: Top - -Concept Index -************* - -* Menu: - -* command editing: Readline Bare Essentials. -* editing command lines: Readline Bare Essentials. -* initialization file, readline: Readline Init File. -* interaction, readline: Readline Interaction. -* kill ring: Readline Killing Commands. -* killing text: Readline Killing Commands. -* notation, readline: Readline Bare Essentials. -* readline, function: Basic Behavior. -* yanking text: Readline Killing Commands. - - -File: readline.info, Node: Function and Variable Index, Prev: Concept Index, Up: Top - -Function and Variable Index -*************************** - -* Menu: - -* (: Utility Functions. -* abort (C-g): Miscellaneous Commands. -* accept-line (Newline, Return): Commands For History. -* alphabetic: Utility Functions. -* backward-char (C-b): Commands For Moving. -* backward-delete-char (Rubout): Commands For Text. -* backward-kill-line (C-x Rubout): Commands For Killing. -* backward-kill-word (M-DEL): Commands For Killing. -* backward-word (M-b): Commands For Moving. -* beginning-of-history (M-<): Commands For History. -* beginning-of-line (C-a): Commands For Moving. -* bell-style: Readline Init File Syntax. -* call-last-kbd-macro (C-x e): Keyboard Macros. -* capitalize-word (M-c): Commands For Text. -* character-search (C-]): Miscellaneous Commands. -* character-search-backward (M-C-]): Miscellaneous Commands. -* clear-screen (C-l): Commands For Moving. -* comment-begin: Readline Init File Syntax. -* complete (TAB): Commands For Completion. -* completion-query-items: Readline Init File Syntax. -* completion_matches: Completion Functions. -* convert-meta: Readline Init File Syntax. -* copy-backward-word (): Commands For Killing. -* copy-forward-word (): Commands For Killing. -* copy-region-as-kill (): Commands For Killing. -* delete-char (C-d): Commands For Text. -* delete-horizontal-space (): Commands For Killing. -* digit-argument (M-0, M-1, ... M-): Numeric Arguments. -* digit_p: Utility Functions. -* digit_value: Utility Functions. -* ding: Utility Functions. -* disable-completion: Readline Init File Syntax. -* do-uppercase-version (M-a, M-b, M-X, ...): Miscellaneous Commands. -* downcase-word (M-l): Commands For Text. -* dump-functions (): Miscellaneous Commands. -* dump-macros (): Miscellaneous Commands. -* dump-variables (): Miscellaneous Commands. -* editing-mode: Readline Init File Syntax. -* enable-keypad: Readline Init File Syntax. -* end-kbd-macro (C-x )): Keyboard Macros. -* end-of-history (M->): Commands For History. -* end-of-line (C-e): Commands For Moving. -* exchange-point-and-mark (C-x C-x): Miscellaneous Commands. -* expand-tilde: Readline Init File Syntax. -* filename_completion_function: Completion Functions. -* forward-char (C-f): Commands For Moving. -* forward-search-history (C-s): Commands For History. -* forward-word (M-f): Commands For Moving. -* free_undo_list: Allowing Undoing. -* history-search-backward (): Commands For History. -* history-search-forward (): Commands For History. -* horizontal-scroll-mode: Readline Init File Syntax. -* input-meta: Readline Init File Syntax. -* insert-comment (M-#): Miscellaneous Commands. -* insert-completions (M-*): Commands For Completion. -* keymap: Readline Init File Syntax. -* kill-line (C-k): Commands For Killing. -* kill-region (): Commands For Killing. -* kill-whole-line (): Commands For Killing. -* kill-word (M-d): Commands For Killing. -* lowercase_p: Utility Functions. -* mark-modified-lines: Readline Init File Syntax. -* meta-flag: Readline Init File Syntax. -* next-history (C-n): Commands For History. -* non-incremental-forward-search-history (M-n): Commands For History. -* non-incremental-reverse-search-history (M-p): Commands For History. -* numeric: Utility Functions. -* output-meta: Readline Init File Syntax. -* possible-completions (M-?): Commands For Completion. -* prefix-meta (ESC): Miscellaneous Commands. -* previous-history (C-p): Commands For History. -* quoted-insert (C-q, C-v): Commands For Text. -* re-read-init-file (C-x C-r): Miscellaneous Commands. -* readline: Basic Behavior. -* redraw-current-line (): Commands For Moving. -* reverse-search-history (C-r): Commands For History. -* revert-line (M-r): Miscellaneous Commands. -* rl_add_defun: Function Naming. -* rl_add_undo: Allowing Undoing. -* rl_attempted_completion_function: Completion Variables. -* rl_basic_quote_characters: Completion Variables. -* rl_basic_word_break_characters: Completion Variables. -* rl_begin_undo_group: Allowing Undoing. -* rl_binding_keymap: Readline Variables. -* rl_bind_key: Binding Keys. -* rl_bind_key_in_map: Binding Keys. -* rl_callback_handler_install: Alternate Interface. -* rl_callback_handler_remove: Alternate Interface. -* rl_callback_read_char: Alternate Interface. -* rl_char_is_quoted_p: Completion Variables. -* rl_clear_message: Redisplay. -* rl_complete: Completion Functions. -* rl_complete: How Completing Works. -* rl_completer_quote_characters: Completion Variables. -* rl_completer_word_break_characters: Completion Variables. -* rl_complete_internal: Completion Functions. -* rl_completion_append_character: Completion Variables. -* rl_completion_entry_function: Completion Variables. -* rl_completion_entry_function: How Completing Works. -* rl_completion_query_items: Completion Variables. -* rl_copy_keymap: Keymaps. -* rl_copy_text: Modifying Text. -* rl_delete_text: Modifying Text. -* rl_directory_completion_hook: Completion Variables. -* rl_discard_keymap: Keymaps. -* rl_done: Readline Variables. -* rl_do_undo: Allowing Undoing. -* rl_end: Readline Variables. -* rl_end_undo_group: Allowing Undoing. -* rl_event_hook: Readline Variables. -* rl_executing_keymap: Readline Variables. -* rl_filename_completion_desired: Completion Variables. -* rl_filename_dequoting_function: Completion Variables. -* rl_filename_quote_characters: Completion Variables. -* rl_filename_quoting_desired: Completion Variables. -* rl_filename_quoting_function: Completion Variables. -* rl_forced_update_display: Redisplay. -* rl_function_dumper: Associating Function Names and Bindings. -* rl_function_of_keyseq: Associating Function Names and Bindings. -* rl_generic_bind: Binding Keys. -* rl_getc: Utility Functions. -* rl_getc_function: Readline Variables. -* rl_get_keymap: Keymaps. -* rl_get_keymap_by_name: Keymaps. -* rl_get_keymap_name: Keymaps. -* rl_ignore_completion_duplicates: Completion Variables. -* rl_ignore_some_completions_function: Completion Variables. -* rl_inhibit_completion: Completion Variables. -* rl_initialize: Utility Functions. -* rl_insert_completions: Completion Functions. -* rl_insert_text: Modifying Text. -* rl_instream: Readline Variables. -* rl_invoking_keyseqs: Associating Function Names and Bindings. -* rl_invoking_keyseqs_in_map: Associating Function Names and Bindings. -* rl_kill_text: Modifying Text. -* rl_library_version: Readline Variables. -* rl_line_buffer: Readline Variables. -* rl_list_funmap_names: Associating Function Names and Bindings. -* rl_make_bare_keymap: Keymaps. -* rl_make_keymap: Keymaps. -* rl_mark: Readline Variables. -* rl_message: Redisplay. -* rl_modifying: Allowing Undoing. -* rl_named_function: Associating Function Names and Bindings. -* rl_on_new_line: Redisplay. -* rl_outstream: Readline Variables. -* rl_parse_and_bind: Binding Keys. -* rl_pending_input: Readline Variables. -* rl_point: Readline Variables. -* rl_possible_completions: Completion Functions. -* rl_prompt: Readline Variables. -* rl_readline_name: Readline Variables. -* rl_read_init_file: Binding Keys. -* rl_read_key: Utility Functions. -* rl_redisplay: Redisplay. -* rl_redisplay_function: Readline Variables. -* rl_reset_line_state: Redisplay. -* rl_reset_terminal: Utility Functions. -* rl_set_keymap: Keymaps. -* rl_special_prefixes: Completion Variables. -* rl_startup_hook: Readline Variables. -* rl_stuff_char: Utility Functions. -* rl_terminal_name: Readline Variables. -* rl_unbind_key: Binding Keys. -* rl_unbind_key_in_map: Binding Keys. -* self-insert (a, b, A, 1, !, ...): Commands For Text. -* set-mark (C-@): Miscellaneous Commands. -* show-all-if-ambiguous: Readline Init File Syntax. -* start-kbd-macro (C-x (): Keyboard Macros. -* tab-insert (M-TAB): Commands For Text. -* tilde-expand (M-~): Miscellaneous Commands. -* to_lower: Utility Functions. -* to_upper: Utility Functions. -* transpose-chars (C-t): Commands For Text. -* transpose-words (M-t): Commands For Text. -* undo (C-_, C-x C-u): Miscellaneous Commands. -* universal-argument (): Numeric Arguments. -* unix-line-discard (C-u): Commands For Killing. -* unix-word-rubout (C-w): Commands For Killing. -* upcase-word (M-u): Commands For Text. -* uppercase_p: Utility Functions. -* username_completion_function: Completion Functions. -* visible-stats: Readline Init File Syntax. -* yank (C-y): Commands For Killing. -* yank-last-arg (M-., M-_): Commands For History. -* yank-nth-arg (M-C-y): Commands For History. -* yank-pop (M-y): Commands For Killing. - - - -Tag Table: -Node: Top1042 -Node: Command Line Editing1655 -Node: Introduction and Notation2306 -Node: Readline Interaction3315 -Node: Readline Bare Essentials4504 -Node: Readline Movement Commands6034 -Node: Readline Killing Commands6925 -Node: Readline Arguments8628 -Node: Searching9602 -Node: Readline Init File11203 -Node: Readline Init File Syntax12266 -Node: Conditional Init Constructs20056 -Node: Sample Init File22338 -Node: Bindable Readline Commands25372 -Node: Commands For Moving26123 -Node: Commands For History26971 -Node: Commands For Text29585 -Node: Commands For Killing31328 -Node: Numeric Arguments33355 -Node: Commands For Completion34480 -Node: Keyboard Macros35364 -Node: Miscellaneous Commands35923 -Node: Readline vi Mode38734 -Node: Programming with GNU Readline40490 -Node: Basic Behavior41359 -Node: Custom Functions44672 -Node: The Function Type45273 -Node: Function Writing46118 -Node: Readline Variables47202 -Node: Readline Convenience Functions50290 -Node: Function Naming51021 -Node: Keymaps52248 -Node: Binding Keys53962 -Node: Associating Function Names and Bindings55906 -Node: Allowing Undoing57484 -Node: Redisplay60069 -Node: Modifying Text61140 -Node: Utility Functions62051 -Node: Alternate Interface64170 -Node: Custom Completers67464 -Node: How Completing Works68185 -Node: Completion Functions71181 -Node: Completion Variables74196 -Node: A Short Completion Example81338 -Node: Concept Index93644 -Node: Function and Variable Index94389 - -End Tag Table diff --git a/gnu/dist/setup.com b/gnu/dist/setup.com deleted file mode 100644 index 553afd55ae1c..000000000000 --- a/gnu/dist/setup.com +++ /dev/null @@ -1,8 +0,0 @@ -$! setup files for openVMS/Alpha -$! -$ define aout [-.INCLUDE.AOUT] -$ define coff [-.INCLUDE.COFF] -$ define elf [-.INCLUDE.ELF] -$ define mpw [-.INCLUDE.MPW] -$ define nlm [-.INCLUDE.NLM] -$ define opcode [-.INCLUDE.OPCODE]