diff options
Diffstat (limited to 'bfd/doc')
-rw-r--r-- | bfd/doc/ChangeLog | 126 | ||||
-rw-r--r-- | bfd/doc/ChangeLog-9103 | 594 | ||||
-rw-r--r-- | bfd/doc/Makefile.am | 314 | ||||
-rw-r--r-- | bfd/doc/Makefile.in | 789 | ||||
-rw-r--r-- | bfd/doc/bfd.texinfo | 337 | ||||
-rw-r--r-- | bfd/doc/bfdint.texi | 1873 | ||||
-rw-r--r-- | bfd/doc/bfdsumm.texi | 148 | ||||
-rw-r--r-- | bfd/doc/chew.c | 1567 | ||||
-rw-r--r-- | bfd/doc/doc.str | 158 | ||||
-rw-r--r-- | bfd/doc/fdl.texi | 366 | ||||
-rw-r--r-- | bfd/doc/header.sed | 13 | ||||
-rw-r--r-- | bfd/doc/makefile.vms | 5 | ||||
-rw-r--r-- | bfd/doc/proto.str | 135 |
13 files changed, 0 insertions, 6425 deletions
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog deleted file mode 100644 index e41ddf5..0000000 --- a/bfd/doc/ChangeLog +++ /dev/null @@ -1,126 +0,0 @@ -2006-07-24 Ralk Wildenhues <Ralf.Wildenhues@gmx.de> - - * bfd..texinfo: Fix spelling mistakes. - * bfdint.texinfo: Likewise. - -2006-07-18 Nigel Stephens <nigel@mips.com> - - * bfd.texinfo: Add @section for "What to Put Where". - -2006-06-07 Joseph S. Myers <joseph@codesourcery.com> - - * bfd.texinfo: Remove local @tex code. - -2006-06-05 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2006-05-11 Carlos O'Donell <carlos@codesourcery.com> - - * bfd.texinfo: Rename "Index" to "BFD Index" - -2006-04-06 Carlos O'Donell <carlos@codesourcery.com> - - * Makefile.am: Add install-html and install-html-am targets. - Define datarootdir, docdir and htmldir. - * Makefile.in: Regenerate. - -2006-02-27 Carlos O'Donell <carlos@codesourcery.com> - - * Makefile.am: Add html target. - * Makefile.in: Regenerate. - -2005-07-24 Daniel Jacobowitz <dan@codesourcery.com> - - * chew.c: Include <string.h>. - -2005-07-22 DJ Delorie <dj@redhat.com> - - * chew.c: Include stdlib.h. - -2005-07-22 Kazu Hirata <kazu@codesourcery.com> - - * chew.c: Don't include sysdep.h. - -2005-05-09 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.am: Use a temporary file to build chew. - * Makefile.in: Regenerated. - -2005-05-04 Nick Clifton <nickc@redhat.com> - - * chew.c: Update the address and phone number of the FSF - organization in the GPL notice. - -2005-05-05 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.am (INCLUDES): Remove -D_GNU_SOURCE. - * Makefile.in: Regenerate. - -2005-04-29 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.am: Remove stamp rules. Depend on chew.c - instead of $(MKDOC). - * Makefile.in: Regnerated. - -2005-04-21 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.am (INCLUDES): New. Add -D_GNU_SOURCE. - (chew.o): Use it. - * Makefile.in: Regenerate. - -2005-04-14 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2005-04-12 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2005-02-21 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2005-02-13 Maciej W. Rozycki <macro@linux-mips.org> - - * Makefile.am: Use CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD for - building chew. - * Makefile.in: Regenerate. - -2005-02-01 Ben Elliston <bje@au.ibm.com> - - * chew.c: Remove #if 0'd code throughout. Similarly, collapse #if - 1'd code. - -2004-12-20 Ian Lance Taylor <ian@c2microsystems.com> - - * Makefile.am: Use $(SHELL) whenever we run move-if-change. - * Makefile.in: Rebuild. - -2004-09-19 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9. - (bfd.info): Rename the target to ... - ($(srcdir)/bfd.info): This. - * Makefile.in: Regenerated. - -2004-09-17 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2004-03-27 Alan Modra <amodra@bigpond.net.au> - - * bfdint.texi: Remove all mention of elflink.h. - -2004-03-19 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -For older changes see ChangeLog-9103 - -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: diff --git a/bfd/doc/ChangeLog-9103 b/bfd/doc/ChangeLog-9103 deleted file mode 100644 index 3636ed8..0000000 --- a/bfd/doc/ChangeLog-9103 +++ /dev/null @@ -1,594 +0,0 @@ -2003-10-15 Andrew Cagney <cagney@redhat.com> - - * bfdint.texi (BFD target vector symbols): Rename _get_symtab to - _canonicalize_symtab. - -2003-10-08 David Taylor <dtaylor@emc.com> - - * bfd.texinfo: Remove spurious backslash. - -2003-07-04 Josh Baratz <baratz@intersystems.com> - - * Makefile.am (MKDOC rule): Add $(CFLAGS) in case it contains - CC_FOR_BUILD specific switches. - * Makefile.in: Regenerate. - -2003-06-29 Alan Modra <amodra@bigpond.net.au> - - * chew.c (paramstuff): Don't emit PARAMS. - -2003-02-12 Bob Wilson <bob.wilson@acm.org> - - * bfd.texinfo: Fix quotes for texinfo. Make section title - capitalization more consistent. Use @example instead of @lisp. - Replace FDL appendix with include of fdl.texi. - * fdl.texi: New file. - -2002-11-18 Klee Dienes <kdienes@apple.com> - - * Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi. - (PROTOS): Add bfdio.p, bfdwin.p. - (SRCDOC): Add bfdio.c, bfdwin.c. - (SRCPROT): Add bfdio.c, bfdwin.c. - (SRCIPROT): Add bfdio.c, bfdwin.c. - (LIBBFD_H_DEP): Add bfdio.c, bfdwin.c. - (BFD_H_DEP): Add bfdio.c, bfdwin.c. - Add rules for bfdio.texi, bfdwin.text. - * bfd.texinfo: Include bfdio.texi. - -2002-10-14 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2002-10-11 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in: Regenerated. - -2002-08-29 John David Anglin <dave@hiauly1.hia.nrc.ca> - - * chew.c (paramstuff, outputdots, perform, bang and usage): Remove - void from function definitions. - -2002-08-13 Alan Modra <amodra@bigpond.net.au> - - * header.sed: Strip tabs. - -2002-06-08 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am: Fix quote style in last change. - * Makefile.in: Regenerate. - -2002-06-07 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (libbfd.h): Don't use "echo -n". - (libcoff.h, bfd.h): Likewise. - * Makefile.in: Regenerate. - -2002-06-06 Lars Brinkhoff <lars@nocrew.org> - - * bfdint.texi: Change registry@sco.com to registry@caldera.com. - -2002-06-05 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (libbfd.h): Add "Extracted from.." comment. - (libcoff.h, bfd.h): Likewise. - * Makefile.in: Regenerate. - -2002-05-25 Alan Modra <amodra@bigpond.net.au> - - * chew.c: Use #include "" instead of <> for local header files. - -2002-04-20 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2002-02-11 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2002-02-01 Alan Modra <amodra@bigpond.net.au> - - * chew.c (WORD): Eliminate. - -2002-01-31 Ivan Guzvinec <ivang@opencores.org> - - * Makefile.in: Regenerate. - -2002-01-31 Alan Modra <amodra@bigpond.net.au> - - * chew.c (courierize): Don't modify @command params. - -2002-01-30 Nick Clifton <nickc@cambridge.redhat.com> - - * proto.str (ENUMDOC): Place two spaces between the end of - the text and the closing comment marker. - -2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> - - * bfdint.texi (BFD target vector miscellaneous): Add - bfd_target_mmo_flavour. - * bfd.texinfo (BFD back ends): Add entry for mmo. - * Makefile.am (DOCFILES): Add mmo.texi. - (SRCDOC): Add mmo.c. - (s-mmo, mmo.texi): New rules. - -2001-10-29 Kazu Hirata <kazu@hxi.com> - - * bfdsumm.texi: Fix a typo. - -2001-10-26 Nick Clifton <nickc@cambridge.redhat.com> - - * bfd.texinfo: Change footer to refer to FSF. Change subtitle - to refer to original creation date. - -2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> - - * Makefile.am (install): Depend on install-info. - * Makefile.in: Regenerate. - -2001-10-03 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (BFD_H_DEP): Add ../version.h. - * Makefile.in: Regenerate. - -2001-10-02 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2001-10-01 Alan Modra <amodra@bigpond.net.au> - - * header.sed: New file, adds header to generated files. - * Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and - bfd.h, using above. Add missing elf.c dependecy for libbfd.h. - * Makefile.in: Regenerate. - -2001-09-21 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2001-09-18 Alan Modra <amodra@bigpond.net.au> - - * bfdint.texi: Replace reference to bfd_read with bfd_bread. - Likewise for bfd_write. - -2001-07-24 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2001-06-21 Hans-Peter Nilsson <hp@axis.com> - - * bfdint.texi (BFD relocation functions) <different formats>: - Mention that the GNU linker is aware of input-output format - restrictions when generating relocatable output. Make new - paragraph for final-link case. - (BFD target vector swap): Fix typo. - -2001-01-25 Kazu Hirata <kazu@hxi.com> - - * chew.c: Do not output trailing whitespaces in type and - functionname. Update copyright. - -2001-01-24 Kazu Hirata <kazu@hxi.com> - - * chew.c: Do not output a trailing whitespace. - -2000-11-06 Nick Clifton <nickc@redhat.com> - - * bfd.texinfo: Add GNU Free Documentation License. - -2000-07-09 Alan Modra <alan@linuxcare.com.au> - - * Makefile.in: Regenerate. - -2000-07-08 Alan Modra <alan@linuxcare.com.au> - - * chew.c (outputdots): Don't add a space before `/*'. - (courierize): Likewise. - -Wed May 24 12:03:25 2000 Hans-Peter Nilsson <hp@axis.com> - - * bfdint.texi (BFD ELF processor required): Add paragraph about - target necessities for readelf. - -2000-04-30 Ben Elliston <bje@redhat.com> - - * bfdint.texi (BFD generated files): Fix another typo. - -2000-04-17 Ben Elliston <bje@redhat.com> - - * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. - -2000-04-07 Andrew Cagney <cagney@b1.cygnus.com> - - * Makefile.in: Rebuild with current autoconf/automake. - -1999-02-04 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in: Rebuild with current autoconf/automake. - -1998-07-23 Nick Clifton <nickc@cygnus.com> - - * bfdint.texi (BFD ELF processor required): Add paragraph - describing the necessity to create "include/elf/CPU.h". - -1998-05-07 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (chew.o): Add -I options for intl srcdir and - objdir. - * Makefile.in: Rebuild. - -1998-04-27 Ian Lance Taylor <ian@cygnus.com> - - * bfdint.texi: New file. - * Makefile.am (noinst_TEXINFOS): New variable. - * Makefile.in: Rebuild. - -1998-04-13 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in: Rebuild. - -1998-04-06 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (STAGESTUFF): Remove variable. - (CLEANFILES): Don't remove $(STAGESTUFF). - (DISTCLEANFILES, MAINTAINERCLEANFILES): New variables. - * Makefile.in: Rebuild. - -1998-03-27 Ian Lance Taylor <ian@cygnus.com> - - * chew.c (skip_white_and_starts): Remove unused declaration. - (skip_white_and_stars): Add casts to avoid warnings. - (skip_trailing_newlines, paramstuff, courierize): Likewise. - (bulletize, do_fancy_stuff, iscommand): Likewise. - (kill_bogus_lines, nextword, main): Likewise. - (manglecomments): Comment out. - (outputdots, kill_bogus_lines): Remove unused local variables. - (perform, compile): Likewise. - (courierize): Fully parenthesize expression. - (copy_past_newline): Declare return value. - (print): Change printf format string. - (main): Call usage for an unrecognized option. - -1998-02-13 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (AUTOMAKE_OPTIONS): Define. - * Makefile.in: Rebuild. - -1998-01-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * doc.str (bodytext): Don't output @* at the end. - * chew.c (kill_bogus_lines): Make sure that a period at the - beginning is recognized. - (indent): Don't put indentation at the end. - (copy_past_newline): Expand tabs. - * Makefile.am (s-reloc, s-syms): Depend on doc.str. - * Makefile.in: Rebuild. - -1997-10-01 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or - elfcode.h as input files; they don't contribute anything. - * Makefile.in: Rebuild. - -1997-08-15 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC). - * Makefile.in: Rebuild. - -1997-08-01 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (CC_FOR_BUILD): Don't set explicitly. - * Makefile.in: Rebuild. - -1997-07-31 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am: New file, based on old Makefile.in. - * Makefile.in: Now built with automake. - -1997-07-22 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE> - - * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi - rather than bfd.texi. - (DOCFILES): Change bfd.texi to bfdt.texi. - * bfd.texinfo: Include bfdt.texi, not bfd.texi. - -1997-06-16 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (CC, CFLAGS): Substitute from configure script. - From Jeff Makey <jeff@cts.com>. - -1997-04-15 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install-info): Use mkinstalldirs to build - $(infodir). - -1997-04-08 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install-info): Permit info files to be in srcdir. - (stamp-*): Add a stamp-X target for each X.texi target. - (*.texi): Just depend upon stamp-X. - (clean): Remove stamp-*. - (distclean): Depend upon mostlyclean. Remove stamp-*. Don't - remove $(DOCFILES). - -1997-04-07 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (distclean): Don't remove *.info files. - -1997-02-13 Klaus Kaempf (kkaempf@progis.de) - - * makefile.vms: New file. - -1996-06-18 Ian Lance Taylor <ian@cygnus.com> - - * chew.c (kill_bogus_lines): Reset sl when not at the start of a - line. From Uwe Ohse <uwe@tirka.gun.de>. - -1996-01-30 Ian Lance Taylor <ian@cygnus.com> - - From Ronald F. Guilmette <rfg@monkeys.com>: - * Makefile.in (libbfd.h): Depend upon proto.str. - (libcoff.h, bfd.h): Likewise. - -1995-11-03 Fred Fish <fnf@cygnus.com> - - * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, - renamed from core.c. - -1995-11-01 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> - - * chew.c: Include <ctype.h>. - -1995-10-06 Ken Raeburn <raeburn@cygnus.com> - - Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * Makefile.in (Makefile): Only remake this Makefile. - -1995-10-04 Ken Raeburn <raeburn@cygnus.com> - - * chew.c: Include <stdio.h>. - -1995-09-12 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (maintainer-clean): New target. - -1995-08-31 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (bfd.h): Add additional #endif at end of bfd.h if - __cplusplus is defined. - -1994-11-29 Doug Evans <dje@canuck.cygnus.com> - - * chew.c (write_buffer): New argument `f', all callers changed. - (stdout, stderr, print, drop, idrop): New forth words. - * proto.str (COMMENT): New command. - * doc.str (COMMENT): Likewise. - -1994-09-12 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (DOCFILES): Remove ctor.texi. - (IPROTOS): Remove ctor.ip. - (SRCIPROT): Remove $(srcdir)/../ctor.c. - (ctor.texi): Remove target. - (libbfd.h): Remove dependency on $(srcdir)/../ctor.c. Remove - $(MKDOC) run on $(srcdir)/../ctor.c. - * bfd.texinfo (Constructors): Remove section. - -1994-09-02 Ken Raeburn (raeburn@cujo.cygnus.com) - - * chew.c: Include assert.h. Added prototypes for most functions. - Changed most uses of int to long. Do bounds checking on the - stacks. Added comment at the beginning documenting most of the - intrinsics. Lots of whitespace changes. Re-ordered some - functions. - (die, check_range, icheck_range): New functions. - (strip_trailing_newlines, print_stack_level): New functions. - (translatecomments): Don't insert tab before "/*". - (iscommand): Minimum command length is now 4. - (nextword): Handle some \-sequences. - (push_addr): Deleted. - (main): Add new intrinsics strip_trailing_newlines and - print_stack_level. Complain at end if stack contains more than - one element, or less. - (remchar): Make sure the string is not empty before chopping off a - character. - - * doc.str, proto.str: Handle new commands SENUM, ENUM, ENUMX, - ENUMEQ, ENUMEQX, ENUMDOC. - -1994-01-12 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.texinfo: Added Linker Functions node. - * Makefile.in (DOCFILES): Added linker.texi. - (SRCDOC): Added linker.c. - (linker.texi): New target. - -1994-01-04 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * chew.c: Don't rely on a correct declaration of exit. - (chew_exit): New function which just calls exit. - (main): Use it. - -1994-01-03 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.texinfo: Added Hash Tables node. - * Makefile.in (DOCFILES): Added hash.texi. - (SRCDOC): Added hash.c. - (hash.texi): New target. - -1993-12-30 Ken Raeburn (raeburn@cujo.cygnus.com) - - * Makefile.in: Delete all references to seclet.c, since it's just - been deleted. Don't mention hash.c, linker.c, or genlink.h yet, - since they don't contain documentation yet (hint, hint!). - -1993-11-05 David J. Mackenzie (djm@thepub.cygnus.com) - - * bfd.texinfo: Small cleanups. - -1993-11-19 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (archures.texi): Depends on $(MKDOC). - -1993-08-10 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * bfd.texinfo (BFD back end): Don't include elfcode.texi, since - it's empty now and that triggers a makeinfo bug. - -1993-08-09 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * bfd.texinfo (BFD back end): New section on ELF, includes - elf.texi and elfcode.texi. - * Makefile.in (DOCFILES): Include elf.texi, elfcode.texi. - (SRCDOC): Include elfcode.h, elf.c. - (elf.texi, elfcode.texi): New intermediate targets. - -1993-06-24 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in (.c.o, chew.o): Put CFLAGS last. - * bfdsumm.texi: New file, broken out of bfd.texinfo, to share - with ld.texinfo. - -1993-06-14 david d `zoo' zuhn (zoo at rtl.cygnus.com) - - * Makefile.in (install-info): remove parentdir cruft, - -1993-06-09 Jim Kingdon (kingdon@cygnus.com) - - * Makefile.in (mostlyclean): Remove chew.o. - -1993-05-25 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (libbfd.h): Use elfcode.h, not elf32.c. - -1993-05-24 Ken Raeburn (raeburn@cygnus.com) - - * chew.c (compile): Add a couple of missing casts. - -1993-05-12 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC). - (chew.o, $(MKDOC)): Build using CC_FOR_BUILD rather than CC, since - it must run on the build machine. - -1993-04-07 John Gilmore (gnu@cygnus.com) - - * Makefile.in (chew): Don't compile from .c to executable in a - single step; it puts a temporary .o filename into the executable, - which makes multi-stage comparisons fail. Compile chew.c to - chew.o, and link that, which makes identical executables every time. - -1993-03-24 david d `zoo' zuhn (zoo at poseidon.cygnus.com) - - * Makefile.in: fix typo (bfd.texinfo not bfd.texino) - -1993-03-19 Ken Raeburn (raeburn@kr-pc.cygnus.com) - - * bfd.texinfo: Since BFD version number has been bumped, do same - to "version number" on title page, and elsewhere. Should be - fixed to extract real version number. - -1993-03-16 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Add *clean rules. - -1993-01-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c. - Added seclet.c. - (bfd.h): Added dependency on bfd.c and seclet.c. Added seclet.c - to build. - -1992-12-17 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: added dvi target, define and use $(TEXI2DVI) - -1992-12-03 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (TEXIDIR): New variable. - (bfd.dvi): Look for bfd.texinfo in $(srcdir). Generate index. - - * bfd.texinfo: Minor doc fixes. - -1992-11-05 John Gilmore (gnu@cygnus.com) - - Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. - - * chew.c (exfunstuff): Eliminate. - (paramstuff): Replace exfunstuff with function to generate PARAMS. - * proto.str: Use paramstuff rather than exfunstuff. - -1992-08-17 Steve Chamberlain (sac@thepub.cygnus.com) - - * chew.c: various patches provided by Howard Chu. - -1992-06-19 John Gilmore (gnu at cygnus.com) - - * Makefile.in (libbfd.h): Add elf.c as a source of prototypes. - -1992-05-11 John Gilmore (gnu at cygnus.com) - - * chew.c: exit() should be declared by config files, not by - portable source code. Its type could be int or void function. - -1992-05-04 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: another CFLAGS correction. - -1992-04-28 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: Do the CFLAGS thing. - -1992-04-11 Fred Fish (fnf@cygnus.com) - - * Makefile.in (MINUS_G): Add macro and default to -g. - -1992-03-06 Steve Chamberlain (sac@thepub.cygnus.com) - - * chew.c: now has -w switch turn on warnings - -1992-02-26 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in, configure.in: removed traces of namesubdir, - -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced - copyrights to '92, changed some from Cygnus to FSF. - -1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: build chew into the current directory. Complete - the MKDOC macro transition. - -1991-12-10 Steve Chamberlain (sac at rtl.cygnus.com) - - * chew.c: don't core dump when can't open file - * Makefile.in: get proto.str from the right place when built in - odd directories - -1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: infodir belongs in datadir. - -1991-12-07 Steve Chamberlain (sac at rtl.cygnus.com) - - * chew.c: Much modified - * proto.str, doc.str: New files for extracting to product - prototypes and documents respectively. - - -1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: added standards.text support, host/site/target - inclusion hooks, install using INSTALL_DATA rather than cp, - don't echo on install. - -1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: idestdir and ddestdir go away. Added copyrights - and shift gpl to v2. Added ChangeLog if it didn't exist. docdir - and mandir now keyed off datadir by default. - - -Local Variables: -version-control: never -End: diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am deleted file mode 100644 index 6d221fa..0000000 --- a/bfd/doc/Makefile.am +++ /dev/null @@ -1,314 +0,0 @@ -## Process this file with automake to generate Makefile.in - -AUTOMAKE_OPTIONS = 1.9 cygnus - -DOCFILES = aoutx.texi archive.texi archures.texi \ - bfdt.texi cache.texi coffcode.texi \ - core.texi elf.texi elfcode.texi format.texi \ - libbfd.texi bfdwin.texi bfdio.texi \ - opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi - -PROTOS = archive.p archures.p bfd.p \ - core.p format.p \ - bfdio.p bfdwin.p \ - libbfd.p opncls.p reloc.p \ - section.p syms.p targets.p \ - format.p core.p init.p - -IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip - -# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction -# between VPATH and suffix rules. If you use GNU Make, perhaps other Makes, -# you don't need these three: -SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ - $(srcdir)/../archures.c $(srcdir)/../bfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ - $(srcdir)/../corefile.c $(srcdir)/../elf.c \ - $(srcdir)/../elfcode.h $(srcdir)/../format.c \ - $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ - $(srcdir)/../reloc.c $(srcdir)/../section.c \ - $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c \ - $(srcdir)/../mmo.c - -SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ - $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ - $(srcdir)/../format.c $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ - $(srcdir)/../section.c $(srcdir)/../syms.c \ - $(srcdir)/../targets.c $(srcdir)/../init.c - -SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ - $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ - $(srcdir)/../init.c - -TEXIDIR = $(srcdir)/../../texinfo/fsf - -info_TEXINFOS = bfd.texinfo - -MKDOC = chew$(EXEEXT_FOR_BUILD) - -INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \ - -I$(srcdir)/../../intl -I../../intl - -$(MKDOC): $(srcdir)/chew.c - $(CC_FOR_BUILD) -o chew.$$$$ $(srcdir)/chew.c \ - $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) \ - $(INCLUDES); \ - $(SHELL) $(srcdir)/../../move-if-change chew.$$$$ $(MKDOC) - -chew.o: chew.c - $(CC_FOR_BUILD) -c $(INCLUDES) $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c - -protos: libbfd.h libcoff.h bfd.h - -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - -# We can't replace these rules with an implicit rule, because -# makes without VPATH support couldn't find the .h files in `..'. - -# We do not depend on chew directly so that we can distribute the info -# files, and permit people to rebuild them, without requiring the makeinfo -# program. If somebody tries to rebuild info, but none of the .texi files -# have changed, then nothing will be rebuilt. - -aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp - $(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi - -archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp - $(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi - -archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp - $(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi - -# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with -# bfd.texinfo on an 8.3 filesystem. -bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp - $(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi - -cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp - $(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi - -coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp - $(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi - -core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp - $(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi - -elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp - $(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi - -elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp - $(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi - -mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp - $(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi - -format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp - $(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi - -libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp - $(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi - -bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp - $(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi - -bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp - $(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi - -opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp - $(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi - -reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp - $(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi - -section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp - $(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi - -syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp - $(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi - -targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp - $(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi - -init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp - $(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi - -hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp - $(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi - -linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp - $(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi - -LIBBFD_H_DEP = \ - $(srcdir)/../libbfd-in.h \ - $(srcdir)/../init.c \ - $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c \ - $(srcdir)/../bfdwin.c \ - $(srcdir)/../cache.c \ - $(srcdir)/../reloc.c \ - $(srcdir)/../archures.c \ - $(srcdir)/../elf.c \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(MKDOC) - -libbfd.h: $(LIBBFD_H_DEP) - echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(LIBBFD_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - -LIBCOFF_H_DEP = \ - $(srcdir)/../libcoff-in.h \ - $(srcdir)/../coffcode.h \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(MKDOC) - -libcoff.h: $(LIBCOFF_H_DEP) - echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(LIBCOFF_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - -BFD_H_DEP = \ - $(srcdir)/../bfd-in.h \ - $(srcdir)/../init.c \ - $(srcdir)/../opncls.c \ - $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c \ - $(srcdir)/../bfdwin.c \ - $(srcdir)/../section.c \ - $(srcdir)/../archures.c \ - $(srcdir)/../reloc.c \ - $(srcdir)/../syms.c \ - $(srcdir)/../bfd.c \ - $(srcdir)/../archive.c \ - $(srcdir)/../corefile.c \ - $(srcdir)/../targets.c \ - $(srcdir)/../format.c \ - $(srcdir)/../linker.c \ - $(srcdir)/../simple.c \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(srcdir)/../version.h \ - $(MKDOC) - -bfd.h: $(BFD_H_DEP) - echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(BFD_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - echo "#ifdef __cplusplus" >> $@ - echo "}" >> $@ - echo "#endif" >> $@ - echo "#endif" >> $@ - -noinst_TEXINFOS = bfdint.texi - -MOSTLYCLEANFILES = $(MKDOC) *.o - -CLEANFILES = *.p *.ip - -DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log - -MAINTAINERCLEANFILES = $(DOCFILES) - -# We want install to imply install-info as per GNU standards, despite the -# cygnus option. -install: install-info - -html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; - -install-html: install-html-am - -install-html-am: $(HTMLS) - @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)" - @list='$(HTMLS)'; for p in $$list; do \ - if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \ - f=$(html__strip_dir) \ - if test -d "$$d$$p"; then \ - echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \ - $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ - echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ - else \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ - fi; \ - done - - - - diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in deleted file mode 100644 index 54becb7..0000000 --- a/bfd/doc/Makefile.in +++ /dev/null @@ -1,789 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 \ - $(top_srcdir)/../config/gettext-sister.m4 \ - $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ - $(top_srcdir)/../config/progtest.m4 \ - $(top_srcdir)/../bfd/bfd.m4 $(top_srcdir)/../bfd/warning.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -depcomp = -am__depfiles_maybe = -SOURCES = -INFO_DEPS = $(srcdir)/bfd.info -TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex -am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo -DVIS = bfd.dvi -PDFS = bfd.pdf -PSS = bfd.ps -HTMLS = bfd.html -TEXINFOS = bfd.texinfo -TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \ - echo $(top_srcdir)/../texinfo/util/texi2dvi; \ - else \ - echo texi2dvi; \ - fi` -TEXI2PDF = $(TEXI2DVI) --pdf --batch -MAKEINFOHTML = $(MAKEINFO) --html -AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) -DVIPS = dvips -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@ -BFD_HOST_64_BIT = @BFD_HOST_64_BIT@ -BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@ -BFD_HOST_LONG_LONG = @BFD_HOST_LONG_LONG@ -BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@ -CATALOGS = @CATALOGS@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ -CFLAGS = @CFLAGS@ -COREFILE = @COREFILE@ -COREFLAG = @COREFLAG@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATADIRNAME = @DATADIRNAME@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GENCAT = @GENCAT@ -GMSGFMT = @GMSGFMT@ -HDEFINES = @HDEFINES@ -INCINTL = @INCINTL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@ -INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -LDFLAGS = @LDFLAGS@ -LIBINTL = @LIBINTL@ -LIBINTL_DEP = @LIBINTL_DEP@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -MSGFMT = @MSGFMT@ -MSGMERGE = @MSGMERGE@ -NO_WERROR = @NO_WERROR@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TDEFINES = @TDEFINES@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -WIN32LDFLAGS = @WIN32LDFLAGS@ -WIN32LIBADD = @WIN32LIBADD@ -XGETTEXT = @XGETTEXT@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -all_backends = @all_backends@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bfd_backends = @bfd_backends@ -bfd_default_target_size = @bfd_default_target_size@ -bfd_file_ptr = @bfd_file_ptr@ -bfd_libs = @bfd_libs@ -bfd_machines = @bfd_machines@ -bfd_ufile_ptr = @bfd_ufile_ptr@ -bfdincludedir = @bfdincludedir@ -bfdlibdir = @bfdlibdir@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_noncanonical = @host_noncanonical@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_noncanonical = @target_noncanonical@ -target_os = @target_os@ -target_vendor = @target_vendor@ -tdefaults = @tdefaults@ -wordsize = @wordsize@ -AUTOMAKE_OPTIONS = 1.9 cygnus -DOCFILES = aoutx.texi archive.texi archures.texi \ - bfdt.texi cache.texi coffcode.texi \ - core.texi elf.texi elfcode.texi format.texi \ - libbfd.texi bfdwin.texi bfdio.texi \ - opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi - -PROTOS = archive.p archures.p bfd.p \ - core.p format.p \ - bfdio.p bfdwin.p \ - libbfd.p opncls.p reloc.p \ - section.p syms.p targets.p \ - format.p core.p init.p - -IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip - -# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction -# between VPATH and suffix rules. If you use GNU Make, perhaps other Makes, -# you don't need these three: -SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ - $(srcdir)/../archures.c $(srcdir)/../bfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ - $(srcdir)/../corefile.c $(srcdir)/../elf.c \ - $(srcdir)/../elfcode.h $(srcdir)/../format.c \ - $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ - $(srcdir)/../reloc.c $(srcdir)/../section.c \ - $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c \ - $(srcdir)/../mmo.c - -SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ - $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ - $(srcdir)/../format.c $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ - $(srcdir)/../section.c $(srcdir)/../syms.c \ - $(srcdir)/../targets.c $(srcdir)/../init.c - -SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ - $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ - $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ - $(srcdir)/../init.c - -TEXIDIR = $(srcdir)/../../texinfo/fsf -info_TEXINFOS = bfd.texinfo -MKDOC = chew$(EXEEXT_FOR_BUILD) -INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \ - -I$(srcdir)/../../intl -I../../intl - -LIBBFD_H_DEP = \ - $(srcdir)/../libbfd-in.h \ - $(srcdir)/../init.c \ - $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c \ - $(srcdir)/../bfdwin.c \ - $(srcdir)/../cache.c \ - $(srcdir)/../reloc.c \ - $(srcdir)/../archures.c \ - $(srcdir)/../elf.c \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(MKDOC) - -LIBCOFF_H_DEP = \ - $(srcdir)/../libcoff-in.h \ - $(srcdir)/../coffcode.h \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(MKDOC) - -BFD_H_DEP = \ - $(srcdir)/../bfd-in.h \ - $(srcdir)/../init.c \ - $(srcdir)/../opncls.c \ - $(srcdir)/../libbfd.c \ - $(srcdir)/../bfdio.c \ - $(srcdir)/../bfdwin.c \ - $(srcdir)/../section.c \ - $(srcdir)/../archures.c \ - $(srcdir)/../reloc.c \ - $(srcdir)/../syms.c \ - $(srcdir)/../bfd.c \ - $(srcdir)/../archive.c \ - $(srcdir)/../corefile.c \ - $(srcdir)/../targets.c \ - $(srcdir)/../format.c \ - $(srcdir)/../linker.c \ - $(srcdir)/../simple.c \ - $(srcdir)/header.sed \ - $(srcdir)/proto.str \ - $(srcdir)/../version.h \ - $(MKDOC) - -noinst_TEXINFOS = bfdint.texi -MOSTLYCLEANFILES = $(MKDOC) *.o -CLEANFILES = *.p *.ip -DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log -MAINTAINERCLEANFILES = $(DOCFILES) -html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -all: all-am - -.SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texinfo -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool - -.texinfo.info: - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - else :; fi && \ - cd "$$am__cwd"; \ - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ - then \ - rc=0; \ - cd $(srcdir); \ - else \ - rc=$$?; \ - cd $(srcdir) && \ - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ - fi; \ - rm -rf $$backupdir; exit $$rc - -.texinfo.dvi: - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< - -.texinfo.pdf: - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< - -.texinfo.html: - rm -rf $(@:.html=.htp) - if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ - then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ - else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ - fi -$(srcdir)/bfd.info: bfd.texinfo -bfd.dvi: bfd.texinfo -bfd.pdf: bfd.texinfo -bfd.html: bfd.texinfo -.dvi.ps: - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - $(DVIPS) -o $@ $< - -uninstall-info-am: - @$(PRE_UNINSTALL) - @if (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ - install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ - done; \ - else :; fi - @$(NORMAL_UNINSTALL) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ - (if cd "$(DESTDIR)$(infodir)"; then \ - echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ - rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ - else :; fi); \ - done - -dist-info: $(INFO_DEPS) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; \ - for base in $$list; do \ - case $$base in \ - $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ - esac; \ - if test -f $$base; then d=.; else d=$(srcdir); fi; \ - for file in $$d/$$base*; do \ - relfile=`expr "$$file" : "$$d/\(.*\)"`; \ - test -f $(distdir)/$$relfile || \ - cp -p $$file $(distdir)/$$relfile; \ - done; \ - done - -mostlyclean-aminfo: - -rm -rf bfd.aux bfd.cp bfd.cps bfd.fn bfd.ky bfd.kys bfd.log bfd.pg bfd.pgs \ - bfd.tmp bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs bfd.dvi \ - bfd.pdf bfd.ps bfd.html - -maintainer-clean-aminfo: - @list='$(INFO_DEPS)'; for i in $$list; do \ - i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ - echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ - rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ - done - -clean-info: mostlyclean-aminfo -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - -check-am: -check: check-am -all-am: Makefile -installdirs: -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: $(DVIS) - -html: html-am - -html-am: $(HTMLS) - -info: info-am - -info-am: $(INFO_DEPS) - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - esac; \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ - for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ - $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ - if test -f $$ifile; then \ - relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ - echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ - $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ - install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ - done; \ - else : ; fi -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-aminfo \ - maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: $(PDFS) - -ps: ps-am - -ps-am: $(PSS) - -uninstall-am: - -.PHONY: all all-am check check-am clean clean-generic clean-info \ - clean-libtool dist-info distclean distclean-generic \ - distclean-libtool dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-aminfo \ - maintainer-clean-generic mostlyclean mostlyclean-aminfo \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-info-am - - -$(MKDOC): $(srcdir)/chew.c - $(CC_FOR_BUILD) -o chew.$$$$ $(srcdir)/chew.c \ - $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) \ - $(INCLUDES); \ - $(SHELL) $(srcdir)/../../move-if-change chew.$$$$ $(MKDOC) - -chew.o: chew.c - $(CC_FOR_BUILD) -c $(INCLUDES) $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c - -protos: libbfd.h libcoff.h bfd.h - -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - -# We can't replace these rules with an implicit rule, because -# makes without VPATH support couldn't find the .h files in `..'. - -# We do not depend on chew directly so that we can distribute the info -# files, and permit people to rebuild them, without requiring the makeinfo -# program. If somebody tries to rebuild info, but none of the .texi files -# have changed, then nothing will be rebuilt. - -aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp - $(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi - -archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp - $(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi - -archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp - $(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi - -# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with -# bfd.texinfo on an 8.3 filesystem. -bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp - $(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi - -cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp - $(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi - -coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp - $(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi - -core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp - $(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi - -elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp - $(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi - -elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp - $(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi - -mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp - $(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi - -format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp - $(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi - -libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp - $(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi - -bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp - $(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi - -bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp - $(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi - -opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp - $(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi - -reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp - $(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi - -section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp - $(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi - -syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp - $(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi - -targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp - $(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi - -init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp - $(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi - -hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp - $(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi - -linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str - $(MAKE) $(MKDOC) - ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp - $(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi - -libbfd.h: $(LIBBFD_H_DEP) - echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(LIBBFD_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - -libcoff.h: $(LIBCOFF_H_DEP) - echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(LIBCOFF_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - -bfd.h: $(BFD_H_DEP) - echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ - for file in $(BFD_H_DEP); do \ - case $$file in \ - *-in.h) cat $$file >> $@ ;; \ - */header.sed) break ;; \ - *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ - -e 's,$$,. */,' >> $@ ; \ - ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ - esac; \ - done - echo "#ifdef __cplusplus" >> $@ - echo "}" >> $@ - echo "#endif" >> $@ - echo "#endif" >> $@ - -# We want install to imply install-info as per GNU standards, despite the -# cygnus option. -install: install-info - -install-html: install-html-am - -install-html-am: $(HTMLS) - @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)" - @list='$(HTMLS)'; for p in $$list; do \ - if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \ - f=$(html__strip_dir) \ - if test -d "$$d$$p"; then \ - echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \ - $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ - echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ - else \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ - fi; \ - done -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo deleted file mode 100644 index dfcebb1..0000000 --- a/bfd/doc/bfd.texinfo +++ /dev/null @@ -1,337 +0,0 @@ -\input texinfo.tex -@setfilename bfd.info -@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, -@c 2001, 2002, 2003, 2006 -@c Free Software Foundation, Inc. -@c -@synindex fn cp - -@ifinfo -@format -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@ifinfo -This file documents the BFD library. - -Copyright (C) 1991, 2000, 2001, 2003, 2006 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled ``GNU Free Documentation License''. - -@ignore -Permission is granted to process this file through Tex and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -@end ifinfo -@iftex -@c@finalout -@setchapternewpage on -@c@setchapternewpage odd -@settitle LIB BFD, the Binary File Descriptor Library -@titlepage -@title{libbfd} -@subtitle{The Binary File Descriptor Library} -@sp 1 -@subtitle First Edition---BFD version < 3.0 % Since no product is stable before version 3.0 :-) -@subtitle Original Document Created: April 1991 -@author {Steve Chamberlain} -@author {Cygnus Support} -@page - -@tex -\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{1.5} % For use in headers, footers too -{\parskip=0pt -\hfill Free Software Foundation\par -\hfill sac\@www.gnu.org\par -\hfill {\it BFD}, \manvers\par -\hfill \TeX{}info \texinfoversion\par -} -\global\parindent=0pt % Steve likes it this way -@end tex - -@vskip 0pt plus 1filll -Copyright @copyright{} 1991, 2001, 2003, 2006 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled ``GNU Free Documentation License''. - -@end titlepage -@end iftex - -@node Top, Overview, (dir), (dir) -@ifinfo -This file documents the binary file descriptor library libbfd. -@end ifinfo - -@menu -* Overview:: Overview of BFD -* BFD front end:: BFD front end -* BFD back ends:: BFD back ends -* GNU Free Documentation License:: GNU Free Documentation License -* BFD Index:: BFD Index -@end menu - -@node Overview, BFD front end, Top, Top -@chapter Introduction -@cindex BFD -@cindex what is it? -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). -@itemize @bullet -@item 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. -@item 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. -@end itemize -@menu -* History:: History -* How It Works:: How It Works -* What BFD Version 2 Can Do:: What BFD Version 2 Can Do -@end menu - -@node History, How It Works, Overview, Overview -@section 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 (@code{sac@@cygnus.com}), John Gilmore -(@code{gnu@@cygnus.com}), K. Richard Pixley (@code{rich@@cygnus.com}) -and David Henkel-Wallace (@code{gumby@@cygnus.com}). - - - -@node How It Works, What BFD Version 2 Can Do, History, Overview -@section How To Use BFD - -To use the library, include @file{bfd.h} and link with @file{libbfd.a}. - -BFD provides a common interface to the parts of an object file -for a calling application. - -When an application successfully opens a target file (object, archive, or -whatever), a pointer to an internal structure is returned. This pointer -points to a structure called @code{bfd}, described in -@file{bfd.h}. Our convention is to call this pointer a BFD, and -instances of it within code @code{abfd}. All operations on -the target object file are applied as methods to the BFD. The mapping is -defined within @code{bfd.h} in a set of macros, all beginning -with @samp{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 -@code{abfd}. - -@example -@c @cartouche -#include "bfd.h" - -unsigned int number_of_sections (abfd) -bfd *abfd; -@{ - return bfd_count_sections (abfd); -@} -@c @end cartouche -@end example - -The abstraction used within BFD is that an object file has: - -@itemize @bullet -@item -a header, -@item -a number of sections containing raw data (@pxref{Sections}), -@item -a set of relocations (@pxref{Relocations}), and -@item -some symbol information (@pxref{Symbols}). -@end itemize -@noindent -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. - -@node What BFD Version 2 Can Do, , How It Works, Overview -@section What BFD Version 2 Can Do -@include bfdsumm.texi - -@node BFD front end, BFD back ends, Overview, Top -@chapter BFD Front End -@include bfdt.texi -@include bfdio.texi - -@menu -* Memory Usage:: -* Initialization:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architectures:: -* Opening and Closing:: -* Internal:: -* File Caching:: -* Linker Functions:: -* Hash Tables:: -@end menu - -@node Memory Usage, Initialization, BFD front end, BFD front end -@section 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 -@code{bfd} structures become invalid on a @code{bfd_close}; for example, -after a @code{bfd_close} the vector passed to -@code{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 (@code{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. - -@node Initialization, Sections, Memory Usage, BFD front end -@include init.texi - -@node Sections, Symbols, Initialization, BFD front end -@include section.texi - -@node Symbols, Archives, Sections, BFD front end -@include syms.texi - -@node Archives, Formats, Symbols, BFD front end -@include archive.texi - -@node Formats, Relocations, Archives, BFD front end -@include format.texi - -@node Relocations, Core Files, Formats, BFD front end -@include reloc.texi - -@node Core Files, Targets, Relocations, BFD front end -@include core.texi - -@node Targets, Architectures, Core Files, BFD front end -@include targets.texi - -@node Architectures, Opening and Closing, Targets, BFD front end -@include archures.texi - -@node Opening and Closing, Internal, Architectures, BFD front end -@include opncls.texi - -@node Internal, File Caching, Opening and Closing, BFD front end -@include libbfd.texi - -@node File Caching, Linker Functions, Internal, BFD front end -@include cache.texi - -@node Linker Functions, Hash Tables, File Caching, BFD front end -@include linker.texi - -@node Hash Tables, , Linker Functions, BFD front end -@include hash.texi - -@node BFD back ends, GNU Free Documentation License, BFD front end, Top -@chapter BFD back ends -@menu -* What to Put Where:: -* aout :: a.out backends -* coff :: coff backends -* elf :: elf backends -* mmo :: mmo backend -@ignore -* oasys :: oasys backends -* ieee :: ieee backend -* srecord :: s-record backend -@end ignore -@end menu -@node What to Put Where, aout, BFD back ends, BFD back ends -@section What to Put Where -All of BFD lives in one directory. - -@node aout, coff, What to Put Where, BFD back ends -@include aoutx.texi - -@node coff, elf, aout, BFD back ends -@include coffcode.texi - -@node elf, mmo, coff, BFD back ends -@include elf.texi -@c Leave this out until the file has some actual contents... -@c @include elfcode.texi - -@node mmo, , elf, BFD back ends -@include mmo.texi - -@node GNU Free Documentation License, BFD Index, BFD back ends, Top -@include fdl.texi - -@node BFD Index, , GNU Free Documentation License, Top -@unnumbered BFD Index -@printindex cp - -@tex -% I think something like @colophon should be in texinfo. In the -% meantime: -\long\def\colophon{\hbox to0pt{}\vfill -\centerline{The body of this manual is set in} -\centerline{\fontname\tenrm,} -\centerline{with headings in {\bf\fontname\tenbf}} -\centerline{and examples in {\tt\fontname\tentt}.} -\centerline{{\it\fontname\tenit\/} and} -\centerline{{\sl\fontname\tensl\/}} -\centerline{are used for emphasis.}\vfill} -\page\colophon -% Blame: doc@cygnus.com, 28mar91. -@end tex - -@contents -@bye diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi deleted file mode 100644 index 15a763c..0000000 --- a/bfd/doc/bfdint.texi +++ /dev/null @@ -1,1873 +0,0 @@ -\input texinfo -@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000, 2001, 2002, 2003, 2004, 2006 -@c Free Software Foundation, Inc. -@setfilename bfdint.info - -@settitle BFD Internals -@iftex -@titlepage -@title{BFD Internals} -@author{Ian Lance Taylor} -@author{Cygnus Solutions} -@page -@end iftex - -@node Top -@top BFD Internals -@raisesections -@cindex bfd internals - -This document describes some BFD internal information which may be -helpful when working on BFD. It is very incomplete. - -This document is not updated regularly, and may be out of date. - -The initial version of this document was written by Ian Lance Taylor -@email{ian@@cygnus.com}. - -@menu -* BFD overview:: BFD overview -* BFD guidelines:: BFD programming guidelines -* BFD target vector:: BFD target vector -* BFD generated files:: BFD generated files -* BFD multiple compilations:: Files compiled multiple times in BFD -* BFD relocation handling:: BFD relocation handling -* BFD ELF support:: BFD ELF support -* BFD glossary:: Glossary -* Index:: Index -@end menu - -@node BFD overview -@section BFD overview - -BFD is a library which provides a single interface to read and write -object files, executables, archive files, and core files in any format. - -@menu -* BFD library interfaces:: BFD library interfaces -* BFD library users:: BFD library users -* BFD view:: The BFD view of a file -* BFD blindness:: BFD loses information -@end menu - -@node BFD library interfaces -@subsection BFD library interfaces - -One way to look at the BFD library is to divide it into four parts by -type of interface. - -The first interface is the set of generic functions which programs using -the BFD library will call. These generic function normally translate -directly or indirectly into calls to routines which are specific to a -particular object file format. Many of these generic functions are -actually defined as macros in @file{bfd.h}. These functions comprise -the official BFD interface. - -The second interface is the set of functions which appear in the target -vectors. This is the bulk of the code in BFD. A target vector is a set -of function pointers specific to a particular object file format. The -target vector is used to implement the generic BFD functions. These -functions are always called through the target vector, and are never -called directly. The target vector is described in detail in @ref{BFD -target vector}. The set of functions which appear in a particular -target vector is often referred to as a BFD backend. - -The third interface is a set of oddball functions which are typically -specific to a particular object file format, are not generic functions, -and are called from outside of the BFD library. These are used as hooks -by the linker and the assembler when a particular object file format -requires some action which the BFD generic interface does not provide. -These functions are typically declared in @file{bfd.h}, but in many -cases they are only provided when BFD is configured with support for a -particular object file format. These functions live in a grey area, and -are not really part of the official BFD interface. - -The fourth interface is the set of BFD support functions which are -called by the other BFD functions. These manage issues like memory -allocation, error handling, file access, hash tables, swapping, and the -like. These functions are never called from outside of the BFD library. - -@node BFD library users -@subsection BFD library users - -Another way to look at the BFD library is to divide it into three parts -by the manner in which it is used. - -The first use is to read an object file. The object file readers are -programs like @samp{gdb}, @samp{nm}, @samp{objdump}, and @samp{objcopy}. -These programs use BFD to view an object file in a generic form. The -official BFD interface is normally fully adequate for these programs. - -The second use is to write an object file. The object file writers are -programs like @samp{gas} and @samp{objcopy}. These programs use BFD to -create an object file. The official BFD interface is normally adequate -for these programs, but for some object file formats the assembler needs -some additional hooks in order to set particular flags or other -information. The official BFD interface includes functions to copy -private information from one object file to another, and these functions -are used by @samp{objcopy} to avoid information loss. - -The third use is to link object files. There is only one object file -linker, @samp{ld}. Originally, @samp{ld} was an object file reader and -an object file writer, and it did the link operation using the generic -BFD structures. However, this turned out to be too slow and too memory -intensive. - -The official BFD linker functions were written to permit specific BFD -backends to perform the link without translating through the generic -structures, in the normal case where all the input files and output file -have the same object file format. Not all of the backends currently -implement the new interface, and there are default linking functions -within BFD which use the generic structures and which work with all -backends. - -For several object file formats the linker needs additional hooks which -are not provided by the official BFD interface, particularly for dynamic -linking support. These functions are typically called from the linker -emulation template. - -@node BFD view -@subsection The BFD view of a file - -BFD uses generic structures to manage information. It translates data -into the generic form when reading files, and out of the generic form -when writing files. - -BFD describes a file as a pointer to the @samp{bfd} type. A @samp{bfd} -is composed of the following elements. The BFD information can be -displayed using the @samp{objdump} program with various options. - -@table @asis -@item general information -The object file format, a few general flags, the start address. -@item architecture -The architecture, including both a general processor type (m68k, MIPS -etc.) and a specific machine number (m68000, R4000, etc.). -@item sections -A list of sections. -@item symbols -A symbol table. -@end table - -BFD represents a section as a pointer to the @samp{asection} type. Each -section has a name and a size. Most sections also have an associated -block of data, known as the section contents. Sections also have -associated flags, a virtual memory address, a load memory address, a -required alignment, a list of relocations, and other miscellaneous -information. - -BFD represents a relocation as a pointer to the @samp{arelent} type. A -relocation describes an action which the linker must take to modify the -section contents. Relocations have a symbol, an address, an addend, and -a pointer to a howto structure which describes how to perform the -relocation. For more information, see @ref{BFD relocation handling}. - -BFD represents a symbol as a pointer to the @samp{asymbol} type. A -symbol has a name, a pointer to a section, an offset within that -section, and some flags. - -Archive files do not have any sections or symbols. Instead, BFD -represents an archive file as a file which contains a list of -@samp{bfd}s. BFD also provides access to the archive symbol map, as a -list of symbol names. BFD provides a function to return the @samp{bfd} -within the archive which corresponds to a particular entry in the -archive symbol map. - -@node BFD blindness -@subsection BFD loses information - -Most object file formats have information which BFD can not represent in -its generic form, at least as currently defined. - -There is often explicit information which BFD can not represent. For -example, the COFF version stamp, or the ELF program segments. BFD -provides special hooks to handle this information when copying, -printing, or linking an object file. The BFD support for a particular -object file format will normally store this information in private data -and handle it using the special hooks. - -In some cases there is also implicit information which BFD can not -represent. For example, the MIPS processor distinguishes small and -large symbols, and requires that all small symbols be within 32K of the -GP register. This means that the MIPS assembler must be able to mark -variables as either small or large, and the MIPS linker must know to put -small symbols within range of the GP register. Since BFD can not -represent this information, this means that the assembler and linker -must have information that is specific to a particular object file -format which is outside of the BFD library. - -This loss of information indicates areas where the BFD paradigm breaks -down. It is not actually possible to represent the myriad differences -among object file formats using a single generic interface, at least not -in the manner which BFD does it today. - -Nevertheless, the BFD library does greatly simplify the task of dealing -with object files, and particular problems caused by information loss -can normally be solved using some sort of relatively constrained hook -into the library. - - - -@node BFD guidelines -@section BFD programming guidelines -@cindex bfd programming guidelines -@cindex programming guidelines for bfd -@cindex guidelines, bfd programming - -There is a lot of poorly written and confusing code in BFD. New BFD -code should be written to a higher standard. Merely because some BFD -code is written in a particular manner does not mean that you should -emulate it. - -Here are some general BFD programming guidelines: - -@itemize @bullet -@item -Follow the GNU coding standards. - -@item -Avoid global variables. We ideally want BFD to be fully reentrant, so -that it can be used in multiple threads. All uses of global or static -variables interfere with that. Initialized constant variables are OK, -and they should be explicitly marked with @samp{const}. Instead of global -variables, use data attached to a BFD or to a linker hash table. - -@item -All externally visible functions should have names which start with -@samp{bfd_}. All such functions should be declared in some header file, -typically @file{bfd.h}. See, for example, the various declarations near -the end of @file{bfd-in.h}, which mostly declare functions required by -specific linker emulations. - -@item -All functions which need to be visible from one file to another within -BFD, but should not be visible outside of BFD, should start with -@samp{_bfd_}. Although external names beginning with @samp{_} are -prohibited by the ANSI standard, in practice this usage will always -work, and it is required by the GNU coding standards. - -@item -Always remember that people can compile using @samp{--enable-targets} to -build several, or all, targets at once. It must be possible to link -together the files for all targets. - -@item -BFD code should compile with few or no warnings using @samp{gcc -Wall}. -Some warnings are OK, like the absence of certain function declarations -which may or may not be declared in system header files. Warnings about -ambiguous expressions and the like should always be fixed. -@end itemize - -@node BFD target vector -@section BFD target vector -@cindex bfd target vector -@cindex target vector in bfd - -BFD supports multiple object file formats by using the @dfn{target -vector}. This is simply a set of function pointers which implement -behaviour that is specific to a particular object file format. - -In this section I list all of the entries in the target vector and -describe what they do. - -@menu -* BFD target vector miscellaneous:: Miscellaneous constants -* BFD target vector swap:: Swapping functions -* BFD target vector format:: Format type dependent functions -* BFD_JUMP_TABLE macros:: BFD_JUMP_TABLE macros -* BFD target vector generic:: Generic functions -* BFD target vector copy:: Copy functions -* BFD target vector core:: Core file support functions -* BFD target vector archive:: Archive functions -* BFD target vector symbols:: Symbol table functions -* BFD target vector relocs:: Relocation support -* BFD target vector write:: Output functions -* BFD target vector link:: Linker functions -* BFD target vector dynamic:: Dynamic linking information functions -@end menu - -@node BFD target vector miscellaneous -@subsection Miscellaneous constants - -The target vector starts with a set of constants. - -@table @samp -@item name -The name of the target vector. This is an arbitrary string. This is -how the target vector is named in command line options for tools which -use BFD, such as the @samp{--oformat} linker option. - -@item flavour -A general description of the type of target. The following flavours are -currently defined: - -@table @samp -@item bfd_target_unknown_flavour -Undefined or unknown. -@item bfd_target_aout_flavour -a.out. -@item bfd_target_coff_flavour -COFF. -@item bfd_target_ecoff_flavour -ECOFF. -@item bfd_target_elf_flavour -ELF. -@item bfd_target_ieee_flavour -IEEE-695. -@item bfd_target_nlm_flavour -NLM. -@item bfd_target_oasys_flavour -OASYS. -@item bfd_target_tekhex_flavour -Tektronix hex format. -@item bfd_target_srec_flavour -Motorola S-record format. -@item bfd_target_ihex_flavour -Intel hex format. -@item bfd_target_som_flavour -SOM (used on HP/UX). -@item bfd_target_os9k_flavour -os9000. -@item bfd_target_versados_flavour -VERSAdos. -@item bfd_target_msdos_flavour -MS-DOS. -@item bfd_target_evax_flavour -openVMS. -@item bfd_target_mmo_flavour -Donald Knuth's MMIXware object format. -@end table - -@item byteorder -The byte order of data in the object file. One of -@samp{BFD_ENDIAN_BIG}, @samp{BFD_ENDIAN_LITTLE}, or -@samp{BFD_ENDIAN_UNKNOWN}. The latter would be used for a format such -as S-records which do not record the architecture of the data. - -@item header_byteorder -The byte order of header information in the object file. Normally the -same as the @samp{byteorder} field, but there are certain cases where it -may be different. - -@item object_flags -Flags which may appear in the @samp{flags} field of a BFD with this -format. - -@item section_flags -Flags which may appear in the @samp{flags} field of a section within a -BFD with this format. - -@item symbol_leading_char -A character which the C compiler normally puts before a symbol. For -example, an a.out compiler will typically generate the symbol -@samp{_foo} for a function named @samp{foo} in the C source, in which -case this field would be @samp{_}. If there is no such character, this -field will be @samp{0}. - -@item ar_pad_char -The padding character to use at the end of an archive name. Normally -@samp{/}. - -@item ar_max_namelen -The maximum length of a short name in an archive. Normally @samp{14}. - -@item backend_data -A pointer to constant backend data. This is used by backends to store -whatever additional information they need to distinguish similar target -vectors which use the same sets of functions. -@end table - -@node BFD target vector swap -@subsection Swapping functions - -Every target vector has function pointers used for swapping information -in and out of the target representation. There are two sets of -functions: one for data information, and one for header information. -Each set has three sizes: 64-bit, 32-bit, and 16-bit. Each size has -three actual functions: put, get unsigned, and get signed. - -These 18 functions are used to convert data between the host and target -representations. - -@node BFD target vector format -@subsection Format type dependent functions - -Every target vector has three arrays of function pointers which are -indexed by the BFD format type. The BFD format types are as follows: - -@table @samp -@item bfd_unknown -Unknown format. Not used for anything useful. -@item bfd_object -Object file. -@item bfd_archive -Archive file. -@item bfd_core -Core file. -@end table - -The three arrays of function pointers are as follows: - -@table @samp -@item bfd_check_format -Check whether the BFD is of a particular format (object file, archive -file, or core file) corresponding to this target vector. This is called -by the @samp{bfd_check_format} function when examining an existing BFD. -If the BFD matches the desired format, this function will initialize any -format specific information such as the @samp{tdata} field of the BFD. -This function must be called before any other BFD target vector function -on a file opened for reading. - -@item bfd_set_format -Set the format of a BFD which was created for output. This is called by -the @samp{bfd_set_format} function after creating the BFD with a -function such as @samp{bfd_openw}. This function will initialize format -specific information required to write out an object file or whatever of -the given format. This function must be called before any other BFD -target vector function on a file opened for writing. - -@item bfd_write_contents -Write out the contents of the BFD in the given format. This is called -by @samp{bfd_close} function for a BFD opened for writing. This really -should not be an array selected by format type, as the -@samp{bfd_set_format} function provides all the required information. -In fact, BFD will fail if a different format is used when calling -through the @samp{bfd_set_format} and the @samp{bfd_write_contents} -arrays; fortunately, since @samp{bfd_close} gets it right, this is a -difficult error to make. -@end table - -@node BFD_JUMP_TABLE macros -@subsection @samp{BFD_JUMP_TABLE} macros -@cindex @samp{BFD_JUMP_TABLE} - -Most target vectors are defined using @samp{BFD_JUMP_TABLE} macros. -These macros take a single argument, which is a prefix applied to a set -of functions. The macros are then used to initialize the fields in the -target vector. - -For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines three -functions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc}, -and @samp{_bfd_reloc_type_lookup}. A reference like -@samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functions -prefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc. The -@samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those three -functions initialize the appropriate fields in the BFD target vector. - -This is done because it turns out that many different target vectors can -share certain classes of functions. For example, archives are similar -on most platforms, so most target vectors can use the same archive -functions. Those target vectors all use @samp{BFD_JUMP_TABLE_ARCHIVE} -with the same argument, calling a set of functions which is defined in -@file{archive.c}. - -Each of the @samp{BFD_JUMP_TABLE} macros is mentioned below along with -the description of the function pointers which it defines. The function -pointers will be described using the name without the prefix which the -@samp{BFD_JUMP_TABLE} macro defines. This name is normally the same as -the name of the field in the target vector structure. Any differences -will be noted. - -@node BFD target vector generic -@subsection Generic functions -@cindex @samp{BFD_JUMP_TABLE_GENERIC} - -The @samp{BFD_JUMP_TABLE_GENERIC} macro is used for some catch all -functions which don't easily fit into other categories. - -@table @samp -@item _close_and_cleanup -Free any target specific information associated with the BFD. This is -called when any BFD is closed (the @samp{bfd_write_contents} function -mentioned earlier is only called for a BFD opened for writing). Most -targets use @samp{bfd_alloc} to allocate all target specific -information, and therefore don't have to do anything in this function. -This function pointer is typically set to -@samp{_bfd_generic_close_and_cleanup}, which simply returns true. - -@item _bfd_free_cached_info -Free any cached information associated with the BFD which can be -recreated later if necessary. This is used to reduce the memory -consumption required by programs using BFD. This is normally called via -the @samp{bfd_free_cached_info} macro. It is used by the default -archive routines when computing the archive map. Most targets do not -do anything special for this entry point, and just set it to -@samp{_bfd_generic_free_cached_info}, which simply returns true. - -@item _new_section_hook -This is called from @samp{bfd_make_section_anyway} whenever a new -section is created. Most targets use it to initialize section specific -information. This function is called whether or not the section -corresponds to an actual section in an actual BFD. - -@item _get_section_contents -Get the contents of a section. This is called from -@samp{bfd_get_section_contents}. Most targets set this to -@samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek} -based on the section's @samp{filepos} field and a @samp{bfd_bread}. The -corresponding field in the target vector is named -@samp{_bfd_get_section_contents}. - -@item _get_section_contents_in_window -Set a @samp{bfd_window} to hold the contents of a section. This is -called from @samp{bfd_get_section_contents_in_window}. The -@samp{bfd_window} idea never really caught on, and I don't think this is -ever called. Pretty much all targets implement this as -@samp{bfd_generic_get_section_contents_in_window}, which uses -@samp{bfd_get_section_contents} to do the right thing. The -corresponding field in the target vector is named -@samp{_bfd_get_section_contents_in_window}. -@end table - -@node BFD target vector copy -@subsection Copy functions -@cindex @samp{BFD_JUMP_TABLE_COPY} - -The @samp{BFD_JUMP_TABLE_COPY} macro is used for functions which are -called when copying BFDs, and for a couple of functions which deal with -internal BFD information. - -@table @samp -@item _bfd_copy_private_bfd_data -This is called when copying a BFD, via @samp{bfd_copy_private_bfd_data}. -If the input and output BFDs have the same format, this will copy any -private information over. This is called after all the section contents -have been written to the output file. Only a few targets do anything in -this function. - -@item _bfd_merge_private_bfd_data -This is called when linking, via @samp{bfd_merge_private_bfd_data}. It -gives the backend linker code a chance to set any special flags in the -output file based on the contents of the input file. Only a few targets -do anything in this function. - -@item _bfd_copy_private_section_data -This is similar to @samp{_bfd_copy_private_bfd_data}, but it is called -for each section, via @samp{bfd_copy_private_section_data}. This -function is called before any section contents have been written. Only -a few targets do anything in this function. - -@item _bfd_copy_private_symbol_data -This is called via @samp{bfd_copy_private_symbol_data}, but I don't -think anything actually calls it. If it were defined, it could be used -to copy private symbol data from one BFD to another. However, most BFDs -store extra symbol information by allocating space which is larger than -the @samp{asymbol} structure and storing private information in the -extra space. Since @samp{objcopy} and other programs copy symbol -information by copying pointers to @samp{asymbol} structures, the -private symbol information is automatically copied as well. Most -targets do not do anything in this function. - -@item _bfd_set_private_flags -This is called via @samp{bfd_set_private_flags}. It is basically a hook -for the assembler to set magic information. For example, the PowerPC -ELF assembler uses it to set flags which appear in the e_flags field of -the ELF header. Most targets do not do anything in this function. - -@item _bfd_print_private_bfd_data -This is called by @samp{objdump} when the @samp{-p} option is used. It -is called via @samp{bfd_print_private_data}. It prints any interesting -information about the BFD which can not be otherwise represented by BFD -and thus can not be printed by @samp{objdump}. Most targets do not do -anything in this function. -@end table - -@node BFD target vector core -@subsection Core file support functions -@cindex @samp{BFD_JUMP_TABLE_CORE} - -The @samp{BFD_JUMP_TABLE_CORE} macro is used for functions which deal -with core files. Obviously, these functions only do something -interesting for targets which have core file support. - -@table @samp -@item _core_file_failing_command -Given a core file, this returns the command which was run to produce the -core file. - -@item _core_file_failing_signal -Given a core file, this returns the signal number which produced the -core file. - -@item _core_file_matches_executable_p -Given a core file and a BFD for an executable, this returns whether the -core file was generated by the executable. -@end table - -@node BFD target vector archive -@subsection Archive functions -@cindex @samp{BFD_JUMP_TABLE_ARCHIVE} - -The @samp{BFD_JUMP_TABLE_ARCHIVE} macro is used for functions which deal -with archive files. Most targets use COFF style archive files -(including ELF targets), and these use @samp{_bfd_archive_coff} as the -argument to @samp{BFD_JUMP_TABLE_ARCHIVE}. Some targets use BSD/a.out -style archives, and these use @samp{_bfd_archive_bsd}. (The main -difference between BSD and COFF archives is the format of the archive -symbol table). Targets with no archive support use -@samp{_bfd_noarchive}. Finally, a few targets have unusual archive -handling. - -@table @samp -@item _slurp_armap -Read in the archive symbol table, storing it in private BFD data. This -is normally called from the archive @samp{check_format} routine. The -corresponding field in the target vector is named -@samp{_bfd_slurp_armap}. - -@item _slurp_extended_name_table -Read in the extended name table from the archive, if there is one, -storing it in private BFD data. This is normally called from the -archive @samp{check_format} routine. The corresponding field in the -target vector is named @samp{_bfd_slurp_extended_name_table}. - -@item construct_extended_name_table -Build and return an extended name table if one is needed to write out -the archive. This also adjusts the archive headers to refer to the -extended name table appropriately. This is normally called from the -archive @samp{write_contents} routine. The corresponding field in the -target vector is named @samp{_bfd_construct_extended_name_table}. - -@item _truncate_arname -This copies a file name into an archive header, truncating it as -required. It is normally called from the archive @samp{write_contents} -routine. This function is more interesting in targets which do not -support extended name tables, but I think the GNU @samp{ar} program -always uses extended name tables anyhow. The corresponding field in the -target vector is named @samp{_bfd_truncate_arname}. - -@item _write_armap -Write out the archive symbol table using calls to @samp{bfd_bwrite}. -This is normally called from the archive @samp{write_contents} routine. -The corresponding field in the target vector is named @samp{write_armap} -(no leading underscore). - -@item _read_ar_hdr -Read and parse an archive header. This handles expanding the archive -header name into the real file name using the extended name table. This -is called by routines which read the archive symbol table or the archive -itself. The corresponding field in the target vector is named -@samp{_bfd_read_ar_hdr_fn}. - -@item _openr_next_archived_file -Given an archive and a BFD representing a file stored within the -archive, return a BFD for the next file in the archive. This is called -via @samp{bfd_openr_next_archived_file}. The corresponding field in the -target vector is named @samp{openr_next_archived_file} (no leading -underscore). - -@item _get_elt_at_index -Given an archive and an index, return a BFD for the file in the archive -corresponding to that entry in the archive symbol table. This is called -via @samp{bfd_get_elt_at_index}. The corresponding field in the target -vector is named @samp{_bfd_get_elt_at_index}. - -@item _generic_stat_arch_elt -Do a stat on an element of an archive, returning information read from -the archive header (modification time, uid, gid, file mode, size). This -is called via @samp{bfd_stat_arch_elt}. The corresponding field in the -target vector is named @samp{_bfd_stat_arch_elt}. - -@item _update_armap_timestamp -After the entire contents of an archive have been written out, update -the timestamp of the archive symbol table to be newer than that of the -file. This is required for a.out style archives. This is normally -called by the archive @samp{write_contents} routine. The corresponding -field in the target vector is named @samp{_bfd_update_armap_timestamp}. -@end table - -@node BFD target vector symbols -@subsection Symbol table functions -@cindex @samp{BFD_JUMP_TABLE_SYMBOLS} - -The @samp{BFD_JUMP_TABLE_SYMBOLS} macro is used for functions which deal -with symbols. - -@table @samp -@item _get_symtab_upper_bound -Return a sensible upper bound on the amount of memory which will be -required to read the symbol table. In practice most targets return the -amount of memory required to hold @samp{asymbol} pointers for all the -symbols plus a trailing @samp{NULL} entry, and store the actual symbol -information in BFD private data. This is called via -@samp{bfd_get_symtab_upper_bound}. The corresponding field in the -target vector is named @samp{_bfd_get_symtab_upper_bound}. - -@item _canonicalize_symtab -Read in the symbol table. This is called via -@samp{bfd_canonicalize_symtab}. The corresponding field in the target -vector is named @samp{_bfd_canonicalize_symtab}. - -@item _make_empty_symbol -Create an empty symbol for the BFD. This is needed because most targets -store extra information with each symbol by allocating a structure -larger than an @samp{asymbol} and storing the extra information at the -end. This function will allocate the right amount of memory, and return -what looks like a pointer to an empty @samp{asymbol}. This is called -via @samp{bfd_make_empty_symbol}. The corresponding field in the target -vector is named @samp{_bfd_make_empty_symbol}. - -@item _print_symbol -Print information about the symbol. This is called via -@samp{bfd_print_symbol}. One of the arguments indicates what sort of -information should be printed: - -@table @samp -@item bfd_print_symbol_name -Just print the symbol name. -@item bfd_print_symbol_more -Print the symbol name and some interesting flags. I don't think -anything actually uses this. -@item bfd_print_symbol_all -Print all information about the symbol. This is used by @samp{objdump} -when run with the @samp{-t} option. -@end table -The corresponding field in the target vector is named -@samp{_bfd_print_symbol}. - -@item _get_symbol_info -Return a standard set of information about the symbol. This is called -via @samp{bfd_symbol_info}. The corresponding field in the target -vector is named @samp{_bfd_get_symbol_info}. - -@item _bfd_is_local_label_name -Return whether the given string would normally represent the name of a -local label. This is called via @samp{bfd_is_local_label} and -@samp{bfd_is_local_label_name}. Local labels are normally discarded by -the assembler. In the linker, this defines the difference between the -@samp{-x} and @samp{-X} options. - -@item _get_lineno -Return line number information for a symbol. This is only meaningful -for a COFF target. This is called when writing out COFF line numbers. - -@item _find_nearest_line -Given an address within a section, use the debugging information to find -the matching file name, function name, and line number, if any. This is -called via @samp{bfd_find_nearest_line}. The corresponding field in the -target vector is named @samp{_bfd_find_nearest_line}. - -@item _bfd_make_debug_symbol -Make a debugging symbol. This is only meaningful for a COFF target, -where it simply returns a symbol which will be placed in the -@samp{N_DEBUG} section when it is written out. This is called via -@samp{bfd_make_debug_symbol}. - -@item _read_minisymbols -Minisymbols are used to reduce the memory requirements of programs like -@samp{nm}. A minisymbol is a cookie pointing to internal symbol -information which the caller can use to extract complete symbol -information. This permits BFD to not convert all the symbols into -generic form, but to instead convert them one at a time. This is called -via @samp{bfd_read_minisymbols}. Most targets do not implement this, -and just use generic support which is based on using standard -@samp{asymbol} structures. - -@item _minisymbol_to_symbol -Convert a minisymbol to a standard @samp{asymbol}. This is called via -@samp{bfd_minisymbol_to_symbol}. -@end table - -@node BFD target vector relocs -@subsection Relocation support -@cindex @samp{BFD_JUMP_TABLE_RELOCS} - -The @samp{BFD_JUMP_TABLE_RELOCS} macro is used for functions which deal -with relocations. - -@table @samp -@item _get_reloc_upper_bound -Return a sensible upper bound on the amount of memory which will be -required to read the relocations for a section. In practice most -targets return the amount of memory required to hold @samp{arelent} -pointers for all the relocations plus a trailing @samp{NULL} entry, and -store the actual relocation information in BFD private data. This is -called via @samp{bfd_get_reloc_upper_bound}. - -@item _canonicalize_reloc -Return the relocation information for a section. This is called via -@samp{bfd_canonicalize_reloc}. The corresponding field in the target -vector is named @samp{_bfd_canonicalize_reloc}. - -@item _bfd_reloc_type_lookup -Given a relocation code, return the corresponding howto structure -(@pxref{BFD relocation codes}). This is called via -@samp{bfd_reloc_type_lookup}. The corresponding field in the target -vector is named @samp{reloc_type_lookup}. -@end table - -@node BFD target vector write -@subsection Output functions -@cindex @samp{BFD_JUMP_TABLE_WRITE} - -The @samp{BFD_JUMP_TABLE_WRITE} macro is used for functions which deal -with writing out a BFD. - -@table @samp -@item _set_arch_mach -Set the architecture and machine number for a BFD. This is called via -@samp{bfd_set_arch_mach}. Most targets implement this by calling -@samp{bfd_default_set_arch_mach}. The corresponding field in the target -vector is named @samp{_bfd_set_arch_mach}. - -@item _set_section_contents -Write out the contents of a section. This is called via -@samp{bfd_set_section_contents}. The corresponding field in the target -vector is named @samp{_bfd_set_section_contents}. -@end table - -@node BFD target vector link -@subsection Linker functions -@cindex @samp{BFD_JUMP_TABLE_LINK} - -The @samp{BFD_JUMP_TABLE_LINK} macro is used for functions called by the -linker. - -@table @samp -@item _sizeof_headers -Return the size of the header information required for a BFD. This is -used to implement the @samp{SIZEOF_HEADERS} linker script function. It -is normally used to align the first section at an efficient position on -the page. This is called via @samp{bfd_sizeof_headers}. The -corresponding field in the target vector is named -@samp{_bfd_sizeof_headers}. - -@item _bfd_get_relocated_section_contents -Read the contents of a section and apply the relocation information. -This handles both a final link and a relocatable link; in the latter -case, it adjust the relocation information as well. This is called via -@samp{bfd_get_relocated_section_contents}. Most targets implement it by -calling @samp{bfd_generic_get_relocated_section_contents}. - -@item _bfd_relax_section -Try to use relaxation to shrink the size of a section. This is called -by the linker when the @samp{-relax} option is used. This is called via -@samp{bfd_relax_section}. Most targets do not support any sort of -relaxation. - -@item _bfd_link_hash_table_create -Create the symbol hash table to use for the linker. This linker hook -permits the backend to control the size and information of the elements -in the linker symbol hash table. This is called via -@samp{bfd_link_hash_table_create}. - -@item _bfd_link_add_symbols -Given an object file or an archive, add all symbols into the linker -symbol hash table. Use callbacks to the linker to include archive -elements in the link. This is called via @samp{bfd_link_add_symbols}. - -@item _bfd_final_link -Finish the linking process. The linker calls this hook after all of the -input files have been read, when it is ready to finish the link and -generate the output file. This is called via @samp{bfd_final_link}. - -@item _bfd_link_split_section -I don't know what this is for. Nothing seems to call it. The only -non-trivial definition is in @file{som.c}. -@end table - -@node BFD target vector dynamic -@subsection Dynamic linking information functions -@cindex @samp{BFD_JUMP_TABLE_DYNAMIC} - -The @samp{BFD_JUMP_TABLE_DYNAMIC} macro is used for functions which read -dynamic linking information. - -@table @samp -@item _get_dynamic_symtab_upper_bound -Return a sensible upper bound on the amount of memory which will be -required to read the dynamic symbol table. In practice most targets -return the amount of memory required to hold @samp{asymbol} pointers for -all the symbols plus a trailing @samp{NULL} entry, and store the actual -symbol information in BFD private data. This is called via -@samp{bfd_get_dynamic_symtab_upper_bound}. The corresponding field in -the target vector is named @samp{_bfd_get_dynamic_symtab_upper_bound}. - -@item _canonicalize_dynamic_symtab -Read the dynamic symbol table. This is called via -@samp{bfd_canonicalize_dynamic_symtab}. The corresponding field in the -target vector is named @samp{_bfd_canonicalize_dynamic_symtab}. - -@item _get_dynamic_reloc_upper_bound -Return a sensible upper bound on the amount of memory which will be -required to read the dynamic relocations. In practice most targets -return the amount of memory required to hold @samp{arelent} pointers for -all the relocations plus a trailing @samp{NULL} entry, and store the -actual relocation information in BFD private data. This is called via -@samp{bfd_get_dynamic_reloc_upper_bound}. The corresponding field in -the target vector is named @samp{_bfd_get_dynamic_reloc_upper_bound}. - -@item _canonicalize_dynamic_reloc -Read the dynamic relocations. This is called via -@samp{bfd_canonicalize_dynamic_reloc}. The corresponding field in the -target vector is named @samp{_bfd_canonicalize_dynamic_reloc}. -@end table - -@node BFD generated files -@section BFD generated files -@cindex generated files in bfd -@cindex bfd generated files - -BFD contains several automatically generated files. This section -describes them. Some files are created at configure time, when you -configure BFD. Some files are created at make time, when you build -BFD. Some files are automatically rebuilt at make time, but only if -you configure with the @samp{--enable-maintainer-mode} option. Some -files live in the object directory---the directory from which you run -configure---and some live in the source directory. All files that live -in the source directory are checked into the CVS repository. - -@table @file -@item bfd.h -@cindex @file{bfd.h} -@cindex @file{bfd-in3.h} -Lives in the object directory. Created at make time from -@file{bfd-in2.h} via @file{bfd-in3.h}. @file{bfd-in3.h} is created at -configure time from @file{bfd-in2.h}. There are automatic dependencies -to rebuild @file{bfd-in3.h} and hence @file{bfd.h} if @file{bfd-in2.h} -changes, so you can normally ignore @file{bfd-in3.h}, and just think -about @file{bfd-in2.h} and @file{bfd.h}. - -@file{bfd.h} is built by replacing a few strings in @file{bfd-in2.h}. -To see them, search for @samp{@@} in @file{bfd-in2.h}. They mainly -control whether BFD is built for a 32 bit target or a 64 bit target. - -@item bfd-in2.h -@cindex @file{bfd-in2.h} -Lives in the source directory. Created from @file{bfd-in.h} and several -other BFD source files. If you configure with the -@samp{--enable-maintainer-mode} option, @file{bfd-in2.h} is rebuilt -automatically when a source file changes. - -@item elf32-target.h -@itemx elf64-target.h -@cindex @file{elf32-target.h} -@cindex @file{elf64-target.h} -Live in the object directory. Created from @file{elfxx-target.h}. -These files are versions of @file{elfxx-target.h} customized for either -a 32 bit ELF target or a 64 bit ELF target. - -@item libbfd.h -@cindex @file{libbfd.h} -Lives in the source directory. Created from @file{libbfd-in.h} and -several other BFD source files. If you configure with the -@samp{--enable-maintainer-mode} option, @file{libbfd.h} is rebuilt -automatically when a source file changes. - -@item libcoff.h -@cindex @file{libcoff.h} -Lives in the source directory. Created from @file{libcoff-in.h} and -@file{coffcode.h}. If you configure with the -@samp{--enable-maintainer-mode} option, @file{libcoff.h} is rebuilt -automatically when a source file changes. - -@item targmatch.h -@cindex @file{targmatch.h} -Lives in the object directory. Created at make time from -@file{config.bfd}. This file is used to map configuration triplets into -BFD target vector variable names at run time. -@end table - -@node BFD multiple compilations -@section Files compiled multiple times in BFD -Several files in BFD are compiled multiple times. By this I mean that -there are header files which contain function definitions. These header -files are included by other files, and thus the functions are compiled -once per file which includes them. - -Preprocessor macros are used to control the compilation, so that each -time the files are compiled the resulting functions are slightly -different. Naturally, if they weren't different, there would be no -reason to compile them multiple times. - -This is a not a particularly good programming technique, and future BFD -work should avoid it. - -@itemize @bullet -@item -Since this technique is rarely used, even experienced C programmers find -it confusing. - -@item -It is difficult to debug programs which use BFD, since there is no way -to describe which version of a particular function you are looking at. - -@item -Programs which use BFD wind up incorporating two or more slightly -different versions of the same function, which wastes space in the -executable. - -@item -This technique is never required nor is it especially efficient. It is -always possible to use statically initialized structures holding -function pointers and magic constants instead. -@end itemize - -The following is a list of the files which are compiled multiple times. - -@table @file -@item aout-target.h -@cindex @file{aout-target.h} -Describes a few functions and the target vector for a.out targets. This -is used by individual a.out targets with different definitions of -@samp{N_TXTADDR} and similar a.out macros. - -@item aoutf1.h -@cindex @file{aoutf1.h} -Implements standard SunOS a.out files. In principle it supports 64 bit -a.out targets based on the preprocessor macro @samp{ARCH_SIZE}, but -since all known a.out targets are 32 bits, this code may or may not -work. This file is only included by a few other files, and it is -difficult to justify its existence. - -@item aoutx.h -@cindex @file{aoutx.h} -Implements basic a.out support routines. This file can be compiled for -either 32 or 64 bit support. Since all known a.out targets are 32 bits, -the 64 bit support may or may not work. I believe the original -intention was that this file would only be included by @samp{aout32.c} -and @samp{aout64.c}, and that other a.out targets would simply refer to -the functions it defined. Unfortunately, some other a.out targets -started including it directly, leading to a somewhat confused state of -affairs. - -@item coffcode.h -@cindex @file{coffcode.h} -Implements basic COFF support routines. This file is included by every -COFF target. It implements code which handles COFF magic numbers as -well as various hook functions called by the generic COFF functions in -@file{coffgen.c}. This file is controlled by a number of different -macros, and more are added regularly. - -@item coffswap.h -@cindex @file{coffswap.h} -Implements COFF swapping routines. This file is included by -@file{coffcode.h}, and thus by every COFF target. It implements the -routines which swap COFF structures between internal and external -format. The main control for this file is the external structure -definitions in the files in the @file{include/coff} directory. A COFF -target file will include one of those files before including -@file{coffcode.h} and thus @file{coffswap.h}. There are a few other -macros which affect @file{coffswap.h} as well, mostly describing whether -certain fields are present in the external structures. - -@item ecoffswap.h -@cindex @file{ecoffswap.h} -Implements ECOFF swapping routines. This is like @file{coffswap.h}, but -for ECOFF. It is included by the ECOFF target files (of which there are -only two). The control is the preprocessor macro @samp{ECOFF_32} or -@samp{ECOFF_64}. - -@item elfcode.h -@cindex @file{elfcode.h} -Implements ELF functions that use external structure definitions. This -file is included by two other files: @file{elf32.c} and @file{elf64.c}. -It is controlled by the @samp{ARCH_SIZE} macro which is defined to be -@samp{32} or @samp{64} before including it. The @samp{NAME} macro is -used internally to give the functions different names for the two target -sizes. - -@item elfcore.h -@cindex @file{elfcore.h} -Like @file{elfcode.h}, but for functions that are specific to ELF core -files. This is included only by @file{elfcode.h}. - -@item elfxx-target.h -@cindex @file{elfxx-target.h} -This file is the source for the generated files @file{elf32-target.h} -and @file{elf64-target.h}, one of which is included by every ELF target. -It defines the ELF target vector. - -@item freebsd.h -@cindex @file{freebsd.h} -Presumably intended to be included by all FreeBSD targets, but in fact -there is only one such target, @samp{i386-freebsd}. This defines a -function used to set the right magic number for FreeBSD, as well as -various macros, and includes @file{aout-target.h}. - -@item netbsd.h -@cindex @file{netbsd.h} -Like @file{freebsd.h}, except that there are several files which include -it. - -@item nlm-target.h -@cindex @file{nlm-target.h} -Defines the target vector for a standard NLM target. - -@item nlmcode.h -@cindex @file{nlmcode.h} -Like @file{elfcode.h}, but for NLM targets. This is only included by -@file{nlm32.c} and @file{nlm64.c}, both of which define the macro -@samp{ARCH_SIZE} to an appropriate value. There are no 64 bit NLM -targets anyhow, so this is sort of useless. - -@item nlmswap.h -@cindex @file{nlmswap.h} -Like @file{coffswap.h}, but for NLM targets. This is included by each -NLM target, but I think it winds up compiling to the exact same code for -every target, and as such is fairly useless. - -@item peicode.h -@cindex @file{peicode.h} -Provides swapping routines and other hooks for PE targets. -@file{coffcode.h} will include this rather than @file{coffswap.h} for a -PE target. This defines PE specific versions of the COFF swapping -routines, and also defines some macros which control @file{coffcode.h} -itself. -@end table - -@node BFD relocation handling -@section BFD relocation handling -@cindex bfd relocation handling -@cindex relocations in bfd - -The handling of relocations is one of the more confusing aspects of BFD. -Relocation handling has been implemented in various different ways, all -somewhat incompatible, none perfect. - -@menu -* BFD relocation concepts:: BFD relocation concepts -* BFD relocation functions:: BFD relocation functions -* BFD relocation codes:: BFD relocation codes -* BFD relocation future:: BFD relocation future -@end menu - -@node BFD relocation concepts -@subsection BFD relocation concepts - -A relocation is an action which the linker must take when linking. It -describes a change to the contents of a section. The change is normally -based on the final value of one or more symbols. Relocations are -created by the assembler when it creates an object file. - -Most relocations are simple. A typical simple relocation is to set 32 -bits at a given offset in a section to the value of a symbol. This type -of relocation would be generated for code like @code{int *p = &i;} where -@samp{p} and @samp{i} are global variables. A relocation for the symbol -@samp{i} would be generated such that the linker would initialize the -area of memory which holds the value of @samp{p} to the value of the -symbol @samp{i}. - -Slightly more complex relocations may include an addend, which is a -constant to add to the symbol value before using it. In some cases a -relocation will require adding the symbol value to the existing contents -of the section in the object file. In others the relocation will simply -replace the contents of the section with the symbol value. Some -relocations are PC relative, so that the value to be stored in the -section is the difference between the value of a symbol and the final -address of the section contents. - -In general, relocations can be arbitrarily complex. For example, -relocations used in dynamic linking systems often require the linker to -allocate space in a different section and use the offset within that -section as the value to store. In the IEEE object file format, -relocations may involve arbitrary expressions. - -When doing a relocatable link, the linker may or may not have to do -anything with a relocation, depending upon the definition of the -relocation. Simple relocations generally do not require any special -action. - -@node BFD relocation functions -@subsection BFD relocation functions - -In BFD, each section has an array of @samp{arelent} structures. Each -structure has a pointer to a symbol, an address within the section, an -addend, and a pointer to a @samp{reloc_howto_struct} structure. The -howto structure has a bunch of fields describing the reloc, including a -type field. The type field is specific to the object file format -backend; none of the generic code in BFD examines it. - -Originally, the function @samp{bfd_perform_relocation} was supposed to -handle all relocations. In theory, many relocations would be simple -enough to be described by the fields in the howto structure. For those -that weren't, the howto structure included a @samp{special_function} -field to use as an escape. - -While this seems plausible, a look at @samp{bfd_perform_relocation} -shows that it failed. The function has odd special cases. Some of the -fields in the howto structure, such as @samp{pcrel_offset}, were not -adequately documented. - -The linker uses @samp{bfd_perform_relocation} to do all relocations when -the input and output file have different formats (e.g., when generating -S-records). The generic linker code, which is used by all targets which -do not define their own special purpose linker, uses -@samp{bfd_get_relocated_section_contents}, which for most targets turns -into a call to @samp{bfd_generic_get_relocated_section_contents}, which -calls @samp{bfd_perform_relocation}. So @samp{bfd_perform_relocation} -is still widely used, which makes it difficult to change, since it is -difficult to test all possible cases. - -The assembler used @samp{bfd_perform_relocation} for a while. This -turned out to be the wrong thing to do, since -@samp{bfd_perform_relocation} was written to handle relocations on an -existing object file, while the assembler needed to create relocations -in a new object file. The assembler was changed to use the new function -@samp{bfd_install_relocation} instead, and @samp{bfd_install_relocation} -was created as a copy of @samp{bfd_perform_relocation}. - -Unfortunately, the work did not progress any farther, so -@samp{bfd_install_relocation} remains a simple copy of -@samp{bfd_perform_relocation}, with all the odd special cases and -confusing code. This again is difficult to change, because again any -change can affect any assembler target, and so is difficult to test. - -The new linker, when using the same object file format for all input -files and the output file, does not convert relocations into -@samp{arelent} structures, so it can not use -@samp{bfd_perform_relocation} at all. Instead, users of the new linker -are expected to write a @samp{relocate_section} function which will -handle relocations in a target specific fashion. - -There are two helper functions for target specific relocation: -@samp{_bfd_final_link_relocate} and @samp{_bfd_relocate_contents}. -These functions use a howto structure, but they @emph{do not} use the -@samp{special_function} field. Since the functions are normally called -from target specific code, the @samp{special_function} field adds -little; any relocations which require special handling can be handled -without calling those functions. - -So, if you want to add a new target, or add a new relocation to an -existing target, you need to do the following: - -@itemize @bullet -@item -Make sure you clearly understand what the contents of the section should -look like after assembly, after a relocatable link, and after a final -link. Make sure you clearly understand the operations the linker must -perform during a relocatable link and during a final link. - -@item -Write a howto structure for the relocation. The howto structure is -flexible enough to represent any relocation which should be handled by -setting a contiguous bitfield in the destination to the value of a -symbol, possibly with an addend, possibly adding the symbol value to the -value already present in the destination. - -@item -Change the assembler to generate your relocation. The assembler will -call @samp{bfd_install_relocation}, so your howto structure has to be -able to handle that. You may need to set the @samp{special_function} -field to handle assembly correctly. Be careful to ensure that any code -you write to handle the assembler will also work correctly when doing a -relocatable link. For example, see @samp{bfd_elf_generic_reloc}. - -@item -Test the assembler. Consider the cases of relocation against an -undefined symbol, a common symbol, a symbol defined in the object file -in the same section, and a symbol defined in the object file in a -different section. These cases may not all be applicable for your -reloc. - -@item -If your target uses the new linker, which is recommended, add any -required handling to the target specific relocation function. In simple -cases this will just involve a call to @samp{_bfd_final_link_relocate} -or @samp{_bfd_relocate_contents}, depending upon the definition of the -relocation and whether the link is relocatable or not. - -@item -Test the linker. Test the case of a final link. If the relocation can -overflow, use a linker script to force an overflow and make sure the -error is reported correctly. Test a relocatable link, whether the -symbol is defined or undefined in the relocatable output. For both the -final and relocatable link, test the case when the symbol is a common -symbol, when the symbol looked like a common symbol but became a defined -symbol, when the symbol is defined in a different object file, and when -the symbol is defined in the same object file. - -@item -In order for linking to another object file format, such as S-records, -to work correctly, @samp{bfd_perform_relocation} has to do the right -thing for the relocation. You may need to set the -@samp{special_function} field to handle this correctly. Test this by -doing a link in which the output object file format is S-records. - -@item -Using the linker to generate relocatable output in a different object -file format is impossible in the general case, so you generally don't -have to worry about that. The GNU linker makes sure to stop that from -happening when an input file in a different format has relocations. - -Linking input files of different object file formats together is quite -unusual, but if you're really dedicated you may want to consider testing -this case, both when the output object file format is the same as your -format, and when it is different. -@end itemize - -@node BFD relocation codes -@subsection BFD relocation codes - -BFD has another way of describing relocations besides the howto -structures described above: the enum @samp{bfd_reloc_code_real_type}. - -Every known relocation type can be described as a value in this -enumeration. The enumeration contains many target specific relocations, -but where two or more targets have the same relocation, a single code is -used. For example, the single value @samp{BFD_RELOC_32} is used for all -simple 32 bit relocation types. - -The main purpose of this relocation code is to give the assembler some -mechanism to create @samp{arelent} structures. In order for the -assembler to create an @samp{arelent} structure, it has to be able to -obtain a howto structure. The function @samp{bfd_reloc_type_lookup}, -which simply calls the target vector entry point -@samp{reloc_type_lookup}, takes a relocation code and returns a howto -structure. - -The function @samp{bfd_get_reloc_code_name} returns the name of a -relocation code. This is mainly used in error messages. - -Using both howto structures and relocation codes can be somewhat -confusing. There are many processor specific relocation codes. -However, the relocation is only fully defined by the howto structure. -The same relocation code will map to different howto structures in -different object file formats. For example, the addend handling may be -different. - -Most of the relocation codes are not really general. The assembler can -not use them without already understanding what sorts of relocations can -be used for a particular target. It might be possible to replace the -relocation codes with something simpler. - -@node BFD relocation future -@subsection BFD relocation future - -Clearly the current BFD relocation support is in bad shape. A -wholescale rewrite would be very difficult, because it would require -thorough testing of every BFD target. So some sort of incremental -change is required. - -My vague thoughts on this would involve defining a new, clearly defined, -howto structure. Some mechanism would be used to determine which type -of howto structure was being used by a particular format. - -The new howto structure would clearly define the relocation behaviour in -the case of an assembly, a relocatable link, and a final link. At -least one special function would be defined as an escape, and it might -make sense to define more. - -One or more generic functions similar to @samp{bfd_perform_relocation} -would be written to handle the new howto structure. - -This should make it possible to write a generic version of the relocate -section functions used by the new linker. The target specific code -would provide some mechanism (a function pointer or an initial -conversion) to convert target specific relocations into howto -structures. - -Ideally it would be possible to use this generic relocate section -function for the generic linker as well. That is, it would replace the -@samp{bfd_generic_get_relocated_section_contents} function which is -currently normally used. - -For the special case of ELF dynamic linking, more consideration needs to -be given to writing ELF specific but ELF target generic code to handle -special relocation types such as GOT and PLT. - -@node BFD ELF support -@section BFD ELF support -@cindex elf support in bfd -@cindex bfd elf support - -The ELF object file format is defined in two parts: a generic ABI and a -processor specific supplement. The ELF support in BFD is split in a -similar fashion. The processor specific support is largely kept within -a single file. The generic support is provided by several other files. -The processor specific support provides a set of function pointers and -constants used by the generic support. - -@menu -* BFD ELF sections and segments:: ELF sections and segments -* BFD ELF generic support:: BFD ELF generic support -* BFD ELF processor specific support:: BFD ELF processor specific support -* BFD ELF core files:: BFD ELF core files -* BFD ELF future:: BFD ELF future -@end menu - -@node BFD ELF sections and segments -@subsection ELF sections and segments - -The ELF ABI permits a file to have either sections or segments or both. -Relocatable object files conventionally have only sections. -Executables conventionally have both. Core files conventionally have -only program segments. - -ELF sections are similar to sections in other object file formats: they -have a name, a VMA, file contents, flags, and other miscellaneous -information. ELF relocations are stored in sections of a particular -type; BFD automatically converts these sections into internal relocation -information. - -ELF program segments are intended for fast interpretation by a system -loader. They have a type, a VMA, an LMA, file contents, and a couple of -other fields. When an ELF executable is run on a Unix system, the -system loader will examine the program segments to decide how to load -it. The loader will ignore the section information. Loadable program -segments (type @samp{PT_LOAD}) are directly loaded into memory. Other -program segments are interpreted by the loader, and generally provide -dynamic linking information. - -When an ELF file has both program segments and sections, an ELF program -segment may encompass one or more ELF sections, in the sense that the -portion of the file which corresponds to the program segment may include -the portions of the file corresponding to one or more sections. When -there is more than one section in a loadable program segment, the -relative positions of the section contents in the file must correspond -to the relative positions they should hold when the program segment is -loaded. This requirement should be obvious if you consider that the -system loader will load an entire program segment at a time. - -On a system which supports dynamic paging, such as any native Unix -system, the contents of a loadable program segment must be at the same -offset in the file as in memory, modulo the memory page size used on the -system. This is because the system loader will map the file into memory -starting at the start of a page. The system loader can easily remap -entire pages to the correct load address. However, if the contents of -the file were not correctly aligned within the page, the system loader -would have to shift the contents around within the page, which is too -expensive. For example, if the LMA of a loadable program segment is -@samp{0x40080} and the page size is @samp{0x1000}, then the position of -the segment contents within the file must equal @samp{0x80} modulo -@samp{0x1000}. - -BFD has only a single set of sections. It does not provide any generic -way to examine both sections and segments. When BFD is used to open an -object file or executable, the BFD sections will represent ELF sections. -When BFD is used to open a core file, the BFD sections will represent -ELF program segments. - -When BFD is used to examine an object file or executable, any program -segments will be read to set the LMA of the sections. This is because -ELF sections only have a VMA, while ELF program segments have both a VMA -and an LMA. Any program segments will be copied by the -@samp{copy_private} entry points. They will be printed by the -@samp{print_private} entry point. Otherwise, the program segments are -ignored. In particular, programs which use BFD currently have no direct -access to the program segments. - -When BFD is used to create an executable, the program segments will be -created automatically based on the section information. This is done in -the function @samp{assign_file_positions_for_segments} in @file{elf.c}. -This function has been tweaked many times, and probably still has -problems that arise in particular cases. - -There is a hook which may be used to explicitly define the program -segments when creating an executable: the @samp{bfd_record_phdr} -function in @file{bfd.c}. If this function is called, BFD will not -create program segments itself, but will only create the program -segments specified by the caller. The linker uses this function to -implement the @samp{PHDRS} linker script command. - -@node BFD ELF generic support -@subsection BFD ELF generic support - -In general, functions which do not read external data from the ELF file -are found in @file{elf.c}. They operate on the internal forms of the -ELF structures, which are defined in @file{include/elf/internal.h}. The -internal structures are defined in terms of @samp{bfd_vma}, and so may -be used for both 32 bit and 64 bit ELF targets. - -The file @file{elfcode.h} contains functions which operate on the -external data. @file{elfcode.h} is compiled twice, once via -@file{elf32.c} with @samp{ARCH_SIZE} defined as @samp{32}, and once via -@file{elf64.c} with @samp{ARCH_SIZE} defined as @samp{64}. -@file{elfcode.h} includes functions to swap the ELF structures in and -out of external form, as well as a few more complex functions. - -Linker support is found in @file{elflink.c}. The -linker support is only used if the processor specific file defines -@samp{elf_backend_relocate_section}, which is required to relocate the -section contents. If that macro is not defined, the generic linker code -is used, and relocations are handled via @samp{bfd_perform_relocation}. - -The core file support is in @file{elfcore.h}, which is compiled twice, -for both 32 and 64 bit support. The more interesting cases of core file -support only work on a native system which has the @file{sys/procfs.h} -header file. Without that file, the core file support does little more -than read the ELF program segments as BFD sections. - -The BFD internal header file @file{elf-bfd.h} is used for communication -among these files and the processor specific files. - -The default entries for the BFD ELF target vector are found mainly in -@file{elf.c}. Some functions are found in @file{elfcode.h}. - -The processor specific files may override particular entries in the -target vector, but most do not, with one exception: the -@samp{bfd_reloc_type_lookup} entry point is always processor specific. - -@node BFD ELF processor specific support -@subsection BFD ELF processor specific support - -By convention, the processor specific support for a particular processor -will be found in @file{elf@var{nn}-@var{cpu}.c}, where @var{nn} is -either 32 or 64, and @var{cpu} is the name of the processor. - -@menu -* BFD ELF processor required:: Required processor specific support -* BFD ELF processor linker:: Processor specific linker support -* BFD ELF processor other:: Other processor specific support options -@end menu - -@node BFD ELF processor required -@subsubsection Required processor specific support - -When writing a @file{elf@var{nn}-@var{cpu}.c} file, you must do the -following: - -@itemize @bullet -@item -Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or -both, to a unique C name to use for the target vector. This name should -appear in the list of target vectors in @file{targets.c}, and will also -have to appear in @file{config.bfd} and @file{configure.in}. Define -@samp{TARGET_BIG_SYM} for a big-endian processor, -@samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both -for a bi-endian processor. -@item -Define either @samp{TARGET_BIG_NAME} or @samp{TARGET_LITTLE_NAME}, or -both, to a string used as the name of the target vector. This is the -name which a user of the BFD tool would use to specify the object file -format. It would normally appear in a linker emulation parameters -file. -@item -Define @samp{ELF_ARCH} to the BFD architecture (an element of the -@samp{bfd_architecture} enum, typically @samp{bfd_arch_@var{cpu}}). -@item -Define @samp{ELF_MACHINE_CODE} to the magic number which should appear -in the @samp{e_machine} field of the ELF header. As of this writing, -these magic numbers are assigned by Caldera; if you want to get a magic -number for a particular processor, try sending a note to -@email{registry@@caldera.com}. In the BFD sources, the magic numbers are -found in @file{include/elf/common.h}; they have names beginning with -@samp{EM_}. -@item -Define @samp{ELF_MAXPAGESIZE} to the maximum size of a virtual page in -memory. This can normally be found at the start of chapter 5 in the -processor specific supplement. For a processor which will only be used -in an embedded system, or which has no memory management hardware, this -can simply be @samp{1}. -@item -If the format should use @samp{Rel} rather than @samp{Rela} relocations, -define @samp{USE_REL}. This is normally defined in chapter 4 of the -processor specific supplement. - -In the absence of a supplement, it's easier to work with @samp{Rela} -relocations. @samp{Rela} relocations will require more space in object -files (but not in executables, except when using dynamic linking). -However, this is outweighed by the simplicity of addend handling when -using @samp{Rela} relocations. With @samp{Rel} relocations, the addend -must be stored in the section contents, which makes relocatable links -more complex. - -For example, consider C code like @code{i = a[1000];} where @samp{a} is -a global array. The instructions which load the value of @samp{a[1000]} -will most likely use a relocation which refers to the symbol -representing @samp{a}, with an addend that gives the offset from the -start of @samp{a} to element @samp{1000}. When using @samp{Rel} -relocations, that addend must be stored in the instructions themselves. -If you are adding support for a RISC chip which uses two or more -instructions to load an address, then the addend may not fit in a single -instruction, and will have to be somehow split among the instructions. -This makes linking awkward, particularly when doing a relocatable link -in which the addend may have to be updated. It can be done---the MIPS -ELF support does it---but it should be avoided when possible. - -It is possible, though somewhat awkward, to support both @samp{Rel} and -@samp{Rela} relocations for a single target; @file{elf64-mips.c} does it -by overriding the relocation reading and writing routines. -@item -Define howto structures for all the relocation types. -@item -Define a @samp{bfd_reloc_type_lookup} routine. This must be named -@samp{bfd_elf@var{nn}_bfd_reloc_type_lookup}, and may be either a -function or a macro. It must translate a BFD relocation code into a -howto structure. This is normally a table lookup or a simple switch. -@item -If using @samp{Rel} relocations, define @samp{elf_info_to_howto_rel}. -If using @samp{Rela} relocations, define @samp{elf_info_to_howto}. -Either way, this is a macro defined as the name of a function which -takes an @samp{arelent} and a @samp{Rel} or @samp{Rela} structure, and -sets the @samp{howto} field of the @samp{arelent} based on the -@samp{Rel} or @samp{Rela} structure. This is normally uses -@samp{ELF@var{nn}_R_TYPE} to get the ELF relocation type and uses it as -an index into a table of howto structures. -@end itemize - -You must also add the magic number for this processor to the -@samp{prep_headers} function in @file{elf.c}. - -You must also create a header file in the @file{include/elf} directory -called @file{@var{cpu}.h}. This file should define any target specific -information which may be needed outside of the BFD code. In particular -it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, -@samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS} -macros to create a table mapping the number used to identify a -relocation to a name describing that relocation. - -While not a BFD component, you probably also want to make the binutils -program @samp{readelf} parse your ELF objects. For this, you need to add -code for @code{EM_@var{cpu}} as appropriate in @file{binutils/readelf.c}. - -@node BFD ELF processor linker -@subsubsection Processor specific linker support - -The linker will be much more efficient if you define a relocate section -function. This will permit BFD to use the ELF specific linker support. - -If you do not define a relocate section function, BFD must use the -generic linker support, which requires converting all symbols and -relocations into BFD @samp{asymbol} and @samp{arelent} structures. In -this case, relocations will be handled by calling -@samp{bfd_perform_relocation}, which will use the howto structures you -have defined. @xref{BFD relocation handling}. - -In order to support linking into a different object file format, such as -S-records, @samp{bfd_perform_relocation} must work correctly with your -howto structures, so you can't skip that step. However, if you define -the relocate section function, then in the normal case of linking into -an ELF file the linker will not need to convert symbols and relocations, -and will be much more efficient. - -To use a relocation section function, define the macro -@samp{elf_backend_relocate_section} as the name of a function which will -take the contents of a section, as well as relocation, symbol, and other -information, and modify the section contents according to the relocation -information. In simple cases, this is little more than a loop over the -relocations which computes the value of each relocation and calls -@samp{_bfd_final_link_relocate}. The function must check for a -relocatable link, and in that case normally needs to do nothing other -than adjust the addend for relocations against a section symbol. - -The complex cases generally have to do with dynamic linker support. GOT -and PLT relocations must be handled specially, and the linker normally -arranges to set up the GOT and PLT sections while handling relocations. -When generating a shared library, random relocations must normally be -copied into the shared library, or converted to RELATIVE relocations -when possible. - -@node BFD ELF processor other -@subsubsection Other processor specific support options - -There are many other macros which may be defined in -@file{elf@var{nn}-@var{cpu}.c}. These macros may be found in -@file{elfxx-target.h}. - -Macros may be used to override some of the generic ELF target vector -functions. - -Several processor specific hook functions which may be defined as -macros. These functions are found as function pointers in the -@samp{elf_backend_data} structure defined in @file{elf-bfd.h}. In -general, a hook function is set by defining a macro -@samp{elf_backend_@var{name}}. - -There are a few processor specific constants which may also be defined. -These are again found in the @samp{elf_backend_data} structure. - -I will not define the various functions and constants here; see the -comments in @file{elf-bfd.h}. - -Normally any odd characteristic of a particular ELF processor is handled -via a hook function. For example, the special @samp{SHN_MIPS_SCOMMON} -section number found in MIPS ELF is handled via the hooks -@samp{section_from_bfd_section}, @samp{symbol_processing}, -@samp{add_symbol_hook}, and @samp{output_symbol_hook}. - -Dynamic linking support, which involves processor specific relocations -requiring special handling, is also implemented via hook functions. - -@node BFD ELF core files -@subsection BFD ELF core files -@cindex elf core files - -On native ELF Unix systems, core files are generated without any -sections. Instead, they only have program segments. - -When BFD is used to read an ELF core file, the BFD sections will -actually represent program segments. Since ELF program segments do not -have names, BFD will invent names like @samp{segment@var{n}} where -@var{n} is a number. - -A single ELF program segment may include both an initialized part and an -uninitialized part. The size of the initialized part is given by the -@samp{p_filesz} field. The total size of the segment is given by the -@samp{p_memsz} field. If @samp{p_memsz} is larger than @samp{p_filesz}, -then the extra space is uninitialized, or, more precisely, initialized -to zero. - -BFD will represent such a program segment as two different sections. -The first, named @samp{segment@var{n}a}, will represent the initialized -part of the program segment. The second, named @samp{segment@var{n}b}, -will represent the uninitialized part. - -ELF core files store special information such as register values in -program segments with the type @samp{PT_NOTE}. BFD will attempt to -interpret the information in these segments, and will create additional -sections holding the information. Some of this interpretation requires -information found in the host header file @file{sys/procfs.h}, and so -will only work when BFD is built on a native system. - -BFD does not currently provide any way to create an ELF core file. In -general, BFD does not provide a way to create core files. The way to -implement this would be to write @samp{bfd_set_format} and -@samp{bfd_write_contents} routines for the @samp{bfd_core} type; see -@ref{BFD target vector format}. - -@node BFD ELF future -@subsection BFD ELF future - -The current dynamic linking support has too much code duplication. -While each processor has particular differences, much of the dynamic -linking support is quite similar for each processor. The GOT and PLT -are handled in fairly similar ways, the details of -Bsymbolic linking -are generally similar, etc. This code should be reworked to use more -generic functions, eliminating the duplication. - -Similarly, the relocation handling has too much duplication. Many of -the @samp{reloc_type_lookup} and @samp{info_to_howto} functions are -quite similar. The relocate section functions are also often quite -similar, both in the standard linker handling and the dynamic linker -handling. Many of the COFF processor specific backends share a single -relocate section function (@samp{_bfd_coff_generic_relocate_section}), -and it should be possible to do something like this for the ELF targets -as well. - -The appearance of the processor specific magic number in -@samp{prep_headers} in @file{elf.c} is somewhat bogus. It should be -possible to add support for a new processor without changing the generic -support. - -The processor function hooks and constants are ad hoc and need better -documentation. - -@node BFD glossary -@section BFD glossary -@cindex glossary for bfd -@cindex bfd glossary - -This is a short glossary of some BFD terms. - -@table @asis -@item a.out -The a.out object file format. The original Unix object file format. -Still used on SunOS, though not Solaris. Supports only three sections. - -@item archive -A collection of object files produced and manipulated by the @samp{ar} -program. - -@item backend -The implementation within BFD of a particular object file format. The -set of functions which appear in a particular target vector. - -@item BFD -The BFD library itself. Also, each object file, archive, or executable -opened by the BFD library has the type @samp{bfd *}, and is sometimes -referred to as a bfd. - -@item COFF -The Common Object File Format. Used on Unix SVR3. Used by some -embedded targets, although ELF is normally better. - -@item DLL -A shared library on Windows. - -@item dynamic linker -When a program linked against a shared library is run, the dynamic -linker will locate the appropriate shared library and arrange to somehow -include it in the running image. - -@item dynamic object -Another name for an ELF shared library. - -@item ECOFF -The Extended Common Object File Format. Used on Alpha Digital Unix -(formerly OSF/1), as well as Ultrix and Irix 4. A variant of COFF. - -@item ELF -The Executable and Linking Format. The object file format used on most -modern Unix systems, including GNU/Linux, Solaris, Irix, and SVR4. Also -used on many embedded systems. - -@item executable -A program, with instructions and symbols, and perhaps dynamic linking -information. Normally produced by a linker. - -@item LMA -Load Memory Address. This is the address at which a section will be -loaded. Compare with VMA, below. - -@item NLM -NetWare Loadable Module. Used to describe the format of an object which -be loaded into NetWare, which is some kind of PC based network server -program. - -@item object file -A binary file including machine instructions, symbols, and relocation -information. Normally produced by an assembler. - -@item object file format -The format of an object file. Typically object files and executables -for a particular system are in the same format, although executables -will not contain any relocation information. - -@item PE -The Portable Executable format. This is the object file format used for -Windows (specifically, Win32) object files. It is based closely on -COFF, but has a few significant differences. - -@item PEI -The Portable Executable Image format. This is the object file format -used for Windows (specifically, Win32) executables. It is very similar -to PE, but includes some additional header information. - -@item relocations -Information used by the linker to adjust section contents. Also called -relocs. - -@item section -Object files and executable are composed of sections. Sections have -optional data and optional relocation information. - -@item shared library -A library of functions which may be used by many executables without -actually being linked into each executable. There are several different -implementations of shared libraries, each having slightly different -features. - -@item symbol -Each object file and executable may have a list of symbols, often -referred to as the symbol table. A symbol is basically a name and an -address. There may also be some additional information like the type of -symbol, although the type of a symbol is normally something simple like -function or object, and should be confused with the more complex C -notion of type. Typically every global function and variable in a C -program will have an associated symbol. - -@item target vector -A set of functions which implement support for a particular object file -format. The @samp{bfd_target} structure. - -@item Win32 -The current Windows API, implemented by Windows 95 and later and Windows -NT 3.51 and later, but not by Windows 3.1. - -@item XCOFF -The eXtended Common Object File Format. Used on AIX. A variant of -COFF, with a completely different symbol table implementation. - -@item VMA -Virtual Memory Address. This is the address a section will have when -an executable is run. Compare with LMA, above. -@end table - -@node Index -@unnumberedsec Index -@printindex cp - -@contents -@bye diff --git a/bfd/doc/bfdsumm.texi b/bfd/doc/bfdsumm.texi deleted file mode 100644 index 77a5f09..0000000 --- a/bfd/doc/bfdsumm.texi +++ /dev/null @@ -1,148 +0,0 @@ -@c This summary of BFD is shared by the BFD and LD docs. -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 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 -@end menu - -@node BFD information loss -@subsection Information Loss - -@emph{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 -@code{b.out}. There is nowhere in an @code{a.out} format file to store -alignment information on the contained data, so when a file is linked -from @code{b.out} and an @code{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., -@code{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. - -@emph{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 @code{a.out} to -@code{b.out}. When a mixture of formats is linked, the information is -only lost from the files whose format differs from the destination. - -@node Canonical format -@subsection 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. -@cindex BFD canonical format -@cindex internal object-file format - -@table @emph -@item 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 @code{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. - -@item 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. - -@item 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. @code{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 @code{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. - -@item 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. - -@item 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). -@end table diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c deleted file mode 100644 index 542fc2f..0000000 --- a/bfd/doc/chew.c +++ /dev/null @@ -1,1567 +0,0 @@ -/* chew - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002, 2003, 2005 - Free Software Foundation, Inc. - Contributed by steve chamberlain @cygnus - -This file is part of BFD, the Binary File Descriptor library. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Yet another way of extracting documentation from source. - No, I haven't finished it yet, but I hope you people like it better - than the old way - - sac - - Basically, this is a sort of string forth, maybe we should call it - struth? - - You define new words thus: - : <newword> <oldwords> ; - -*/ - -/* Primitives provided by the program: - - Two stacks are provided, a string stack and an integer stack. - - Internal state variables: - internal_wanted - indicates whether `-i' was passed - internal_mode - user-settable - - Commands: - push_text - ! - pop top of integer stack for address, pop next for value; store - @ - treat value on integer stack as the address of an integer; push - that integer on the integer stack after popping the "address" - hello - print "hello\n" to stdout - stdout - put stdout marker on TOS - stderr - put stderr marker on TOS - print - print TOS-1 on TOS (eg: "hello\n" stdout print) - skip_past_newline - catstr - fn icatstr - copy_past_newline - append input, up to and including newline into TOS - dup - fn other_dup - drop - discard TOS - idrop - ditto - remchar - delete last character from TOS - get_stuff_in_command - do_fancy_stuff - translate <<foo>> to @code{foo} in TOS - bulletize - if "o" lines found, prepend @itemize @bullet to TOS - and @item to each "o" line; append @end itemize - courierize - put @example around . and | lines, translate {* *} { } - exit - fn chew_exit - swap - outputdots - strip out lines without leading dots - paramstuff - convert full declaration into "PARAMS" form if not already - maybecatstr - do catstr if internal_mode == internal_wanted, discard - value in any case - translatecomments - turn {* and *} into comment delimiters - kill_bogus_lines - get rid of extra newlines - indent - internalmode - pop from integer stack, set `internalmode' to that value - print_stack_level - print current stack depth to stderr - strip_trailing_newlines - go ahead, guess... - [quoted string] - push string onto string stack - [word starting with digit] - push atol(str) onto integer stack - - A command must be all upper-case, and alone on a line. - - Foo. */ - -#include "ansidecl.h" -#include <assert.h> -#include <stdio.h> -#include <ctype.h> -#include <stdlib.h> -#include <string.h> - -#define DEF_SIZE 5000 -#define STACK 50 - -int internal_wanted; -int internal_mode; - -int warning; - -/* Here is a string type ... */ - -typedef struct buffer -{ - char *ptr; - unsigned long write_idx; - unsigned long size; -} string_type; - -#ifdef __STDC__ -static void init_string_with_size (string_type *, unsigned int); -static void init_string (string_type *); -static int find (string_type *, char *); -static void write_buffer (string_type *, FILE *); -static void delete_string (string_type *); -static char *addr (string_type *, unsigned int); -static char at (string_type *, unsigned int); -static void catchar (string_type *, int); -static void overwrite_string (string_type *, string_type *); -static void catbuf (string_type *, char *, unsigned int); -static void cattext (string_type *, char *); -static void catstr (string_type *, string_type *); -#endif - -static void -init_string_with_size (buffer, size) - string_type *buffer; - unsigned int size; -{ - buffer->write_idx = 0; - buffer->size = size; - buffer->ptr = malloc (size); -} - -static void -init_string (buffer) - string_type *buffer; -{ - init_string_with_size (buffer, DEF_SIZE); -} - -static int -find (str, what) - string_type *str; - char *what; -{ - unsigned int i; - char *p; - p = what; - for (i = 0; i < str->write_idx && *p; i++) - { - if (*p == str->ptr[i]) - p++; - else - p = what; - } - return (*p == 0); -} - -static void -write_buffer (buffer, f) - string_type *buffer; - FILE *f; -{ - fwrite (buffer->ptr, buffer->write_idx, 1, f); -} - -static void -delete_string (buffer) - string_type *buffer; -{ - free (buffer->ptr); -} - -static char * -addr (buffer, idx) - string_type *buffer; - unsigned int idx; -{ - return buffer->ptr + idx; -} - -static char -at (buffer, pos) - string_type *buffer; - unsigned int pos; -{ - if (pos >= buffer->write_idx) - return 0; - return buffer->ptr[pos]; -} - -static void -catchar (buffer, ch) - string_type *buffer; - int ch; -{ - if (buffer->write_idx == buffer->size) - { - buffer->size *= 2; - buffer->ptr = realloc (buffer->ptr, buffer->size); - } - - buffer->ptr[buffer->write_idx++] = ch; -} - -static void -overwrite_string (dst, src) - string_type *dst; - string_type *src; -{ - free (dst->ptr); - dst->size = src->size; - dst->write_idx = src->write_idx; - dst->ptr = src->ptr; -} - -static void -catbuf (buffer, buf, len) - string_type *buffer; - char *buf; - unsigned int len; -{ - if (buffer->write_idx + len >= buffer->size) - { - while (buffer->write_idx + len >= buffer->size) - buffer->size *= 2; - buffer->ptr = realloc (buffer->ptr, buffer->size); - } - memcpy (buffer->ptr + buffer->write_idx, buf, len); - buffer->write_idx += len; -} - -static void -cattext (buffer, string) - string_type *buffer; - char *string; -{ - catbuf (buffer, string, (unsigned int) strlen (string)); -} - -static void -catstr (dst, src) - string_type *dst; - string_type *src; -{ - catbuf (dst, src->ptr, src->write_idx); -} - -static unsigned int -skip_white_and_stars (src, idx) - string_type *src; - unsigned int idx; -{ - char c; - while ((c = at (src, idx)), - isspace ((unsigned char) c) - || (c == '*' - /* Don't skip past end-of-comment or star as first - character on its line. */ - && at (src, idx +1) != '/' - && at (src, idx -1) != '\n')) - idx++; - return idx; -} - -/***********************************************************************/ - -string_type stack[STACK]; -string_type *tos; - -unsigned int idx = 0; /* Pos in input buffer */ -string_type *ptr; /* and the buffer */ -typedef void (*stinst_type)(); -stinst_type *pc; -stinst_type sstack[STACK]; -stinst_type *ssp = &sstack[0]; -long istack[STACK]; -long *isp = &istack[0]; - -typedef int *word_type; - -struct dict_struct -{ - char *word; - struct dict_struct *next; - stinst_type *code; - int code_length; - int code_end; - int var; -}; - -typedef struct dict_struct dict_type; - -static void -die (msg) - char *msg; -{ - fprintf (stderr, "%s\n", msg); - exit (1); -} - -static void -check_range () -{ - if (tos < stack) - die ("underflow in string stack"); - if (tos >= stack + STACK) - die ("overflow in string stack"); -} - -static void -icheck_range () -{ - if (isp < istack) - die ("underflow in integer stack"); - if (isp >= istack + STACK) - die ("overflow in integer stack"); -} - -#ifdef __STDC__ -static void exec (dict_type *); -static void call (void); -static void remchar (void), strip_trailing_newlines (void), push_number (void); -static void push_text (void); -static void remove_noncomments (string_type *, string_type *); -static void print_stack_level (void); -static void paramstuff (void), translatecomments (void); -static void outputdots (void), courierize (void), bulletize (void); -static void do_fancy_stuff (void); -static int iscommand (string_type *, unsigned int); -static int copy_past_newline (string_type *, unsigned int, string_type *); -static void icopy_past_newline (void), kill_bogus_lines (void), indent (void); -static void get_stuff_in_command (void), swap (void), other_dup (void); -static void drop (void), idrop (void); -static void icatstr (void), skip_past_newline (void), internalmode (void); -static void maybecatstr (void); -static char *nextword (char *, char **); -dict_type *lookup_word (char *); -static void perform (void); -dict_type *newentry (char *); -unsigned int add_to_definition (dict_type *, stinst_type); -void add_intrinsic (char *, void (*)()); -void add_var (char *); -void compile (char *); -static void bang (void); -static void atsign (void); -static void hello (void); -static void stdout_ (void); -static void stderr_ (void); -static void print (void); -static void read_in (string_type *, FILE *); -static void usage (void); -static void chew_exit (void); -#endif - -static void -exec (word) - dict_type *word; -{ - pc = word->code; - while (*pc) - (*pc) (); -} - -static void -call () -{ - stinst_type *oldpc = pc; - dict_type *e; - e = (dict_type *) (pc[1]); - exec (e); - pc = oldpc + 2; -} - -static void -remchar () -{ - if (tos->write_idx) - tos->write_idx--; - pc++; -} - -static void -strip_trailing_newlines () -{ - while ((isspace ((unsigned char) at (tos, tos->write_idx - 1)) - || at (tos, tos->write_idx - 1) == '\n') - && tos->write_idx > 0) - tos->write_idx--; - pc++; -} - -static void -push_number () -{ - isp++; - icheck_range (); - pc++; - *isp = (long) (*pc); - pc++; -} - -static void -push_text () -{ - tos++; - check_range (); - init_string (tos); - pc++; - cattext (tos, *((char **) pc)); - pc++; -} - -/* This function removes everything not inside comments starting on - the first char of the line from the string, also when copying - comments, removes blank space and leading *'s. - Blank lines are turned into one blank line. */ - -static void -remove_noncomments (src, dst) - string_type *src; - string_type *dst; -{ - unsigned int idx = 0; - - while (at (src, idx)) - { - /* Now see if we have a comment at the start of the line. */ - if (at (src, idx) == '\n' - && at (src, idx + 1) == '/' - && at (src, idx + 2) == '*') - { - idx += 3; - - idx = skip_white_and_stars (src, idx); - - /* Remove leading dot */ - if (at (src, idx) == '.') - idx++; - - /* Copy to the end of the line, or till the end of the - comment. */ - while (at (src, idx)) - { - if (at (src, idx) == '\n') - { - /* end of line, echo and scrape of leading blanks */ - if (at (src, idx + 1) == '\n') - catchar (dst, '\n'); - catchar (dst, '\n'); - idx++; - idx = skip_white_and_stars (src, idx); - } - else if (at (src, idx) == '*' && at (src, idx + 1) == '/') - { - idx += 2; - cattext (dst, "\nENDDD\n"); - break; - } - else - { - catchar (dst, at (src, idx)); - idx++; - } - } - } - else - idx++; - } -} - -static void -print_stack_level () -{ - fprintf (stderr, "current string stack depth = %d, ", tos - stack); - fprintf (stderr, "current integer stack depth = %d\n", isp - istack); - pc++; -} - -/* turn: - foobar name(stuff); - into: - foobar - name PARAMS ((stuff)); - and a blank line. - */ - -static void -paramstuff () -{ - unsigned int openp; - unsigned int fname; - unsigned int idx; - unsigned int len; - string_type out; - init_string (&out); - -#define NO_PARAMS 1 - - /* Make sure that it's not already param'd or proto'd. */ - if (NO_PARAMS - || find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "(")) - { - catstr (&out, tos); - } - else - { - /* Find the open paren. */ - for (openp = 0; at (tos, openp) != '(' && at (tos, openp); openp++) - ; - - fname = openp; - /* Step back to the fname. */ - fname--; - while (fname && isspace ((unsigned char) at (tos, fname))) - fname--; - while (fname - && !isspace ((unsigned char) at (tos,fname)) - && at (tos,fname) != '*') - fname--; - - fname++; - - /* Output type, omitting trailing whitespace character(s), if - any. */ - for (len = fname; 0 < len; len--) - { - if (!isspace ((unsigned char) at (tos, len - 1))) - break; - } - for (idx = 0; idx < len; idx++) - catchar (&out, at (tos, idx)); - - cattext (&out, "\n"); /* Insert a newline between type and fnname */ - - /* Output function name, omitting trailing whitespace - character(s), if any. */ - for (len = openp; 0 < len; len--) - { - if (!isspace ((unsigned char) at (tos, len - 1))) - break; - } - for (idx = fname; idx < len; idx++) - catchar (&out, at (tos, idx)); - - cattext (&out, " PARAMS ("); - - for (idx = openp; at (tos, idx) && at (tos, idx) != ';'; idx++) - catchar (&out, at (tos, idx)); - - cattext (&out, ");\n\n"); - } - overwrite_string (tos, &out); - pc++; - -} - -/* turn {* - and *} into comments */ - -static void -translatecomments () -{ - unsigned int idx = 0; - string_type out; - init_string (&out); - - while (at (tos, idx)) - { - if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') - { - cattext (&out, "/*"); - idx += 2; - } - else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') - { - cattext (&out, "*/"); - idx += 2; - } - else - { - catchar (&out, at (tos, idx)); - idx++; - } - } - - overwrite_string (tos, &out); - - pc++; -} - -/* Mod tos so that only lines with leading dots remain */ -static void -outputdots () -{ - unsigned int idx = 0; - string_type out; - init_string (&out); - - while (at (tos, idx)) - { - if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.') - { - char c; - idx += 2; - - while ((c = at (tos, idx)) && c != '\n') - { - if (c == '{' && at (tos, idx + 1) == '*') - { - cattext (&out, "/*"); - idx += 2; - } - else if (c == '*' && at (tos, idx + 1) == '}') - { - cattext (&out, "*/"); - idx += 2; - } - else - { - catchar (&out, c); - idx++; - } - } - catchar (&out, '\n'); - } - else - { - idx++; - } - } - - overwrite_string (tos, &out); - pc++; -} - -/* Find lines starting with . and | and put example around them on tos */ -static void -courierize () -{ - string_type out; - unsigned int idx = 0; - int command = 0; - - init_string (&out); - - while (at (tos, idx)) - { - if (at (tos, idx) == '\n' - && (at (tos, idx +1 ) == '.' - || at (tos, idx + 1) == '|')) - { - cattext (&out, "\n@example\n"); - do - { - idx += 2; - - while (at (tos, idx) && at (tos, idx) != '\n') - { - if (command > 1) - { - /* We are inside {} parameters of some command; - Just pass through until matching brace. */ - if (at (tos, idx) == '{') - ++command; - else if (at (tos, idx) == '}') - --command; - } - else if (command != 0) - { - if (at (tos, idx) == '{') - ++command; - else if (!islower ((unsigned char) at (tos, idx))) - --command; - } - else if (at (tos, idx) == '@' - && islower ((unsigned char) at (tos, idx + 1))) - { - ++command; - } - else if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') - { - cattext (&out, "/*"); - idx += 2; - continue; - } - else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') - { - cattext (&out, "*/"); - idx += 2; - continue; - } - else if (at (tos, idx) == '{' - || at (tos, idx) == '}') - { - catchar (&out, '@'); - } - - catchar (&out, at (tos, idx)); - idx++; - } - catchar (&out, '\n'); - } - while (at (tos, idx) == '\n' - && ((at (tos, idx + 1) == '.') - || (at (tos, idx + 1) == '|'))) - ; - cattext (&out, "@end example"); - } - else - { - catchar (&out, at (tos, idx)); - idx++; - } - } - - overwrite_string (tos, &out); - pc++; -} - -/* Finds any lines starting with "o ", if there are any, then turns - on @itemize @bullet, and @items each of them. Then ends with @end - itemize, inplace at TOS*/ - -static void -bulletize () -{ - unsigned int idx = 0; - int on = 0; - string_type out; - init_string (&out); - - while (at (tos, idx)) - { - if (at (tos, idx) == '@' - && at (tos, idx + 1) == '*') - { - cattext (&out, "*"); - idx += 2; - } - else if (at (tos, idx) == '\n' - && at (tos, idx + 1) == 'o' - && isspace ((unsigned char) at (tos, idx + 2))) - { - if (!on) - { - cattext (&out, "\n@itemize @bullet\n"); - on = 1; - - } - cattext (&out, "\n@item\n"); - idx += 3; - } - else - { - catchar (&out, at (tos, idx)); - if (on && at (tos, idx) == '\n' - && at (tos, idx + 1) == '\n' - && at (tos, idx + 2) != 'o') - { - cattext (&out, "@end itemize"); - on = 0; - } - idx++; - - } - } - if (on) - { - cattext (&out, "@end itemize\n"); - } - - delete_string (tos); - *tos = out; - pc++; -} - -/* Turn <<foo>> into @code{foo} in place at TOS*/ - -static void -do_fancy_stuff () -{ - unsigned int idx = 0; - string_type out; - init_string (&out); - while (at (tos, idx)) - { - if (at (tos, idx) == '<' - && at (tos, idx + 1) == '<' - && !isspace ((unsigned char) at (tos, idx + 2))) - { - /* This qualifies as a << startup. */ - idx += 2; - cattext (&out, "@code{"); - while (at (tos, idx) - && at (tos, idx) != '>' ) - { - catchar (&out, at (tos, idx)); - idx++; - - } - cattext (&out, "}"); - idx += 2; - } - else - { - catchar (&out, at (tos, idx)); - idx++; - } - } - delete_string (tos); - *tos = out; - pc++; - -} - -/* A command is all upper case,and alone on a line. */ - -static int -iscommand (ptr, idx) - string_type *ptr; - unsigned int idx; -{ - unsigned int len = 0; - while (at (ptr, idx)) - { - if (isupper ((unsigned char) at (ptr, idx)) - || at (ptr, idx) == ' ' || at (ptr, idx) == '_') - { - len++; - idx++; - } - else if (at (ptr, idx) == '\n') - { - if (len > 3) - return 1; - return 0; - } - else - return 0; - } - return 0; -} - -static int -copy_past_newline (ptr, idx, dst) - string_type *ptr; - unsigned int idx; - string_type *dst; -{ - int column = 0; - - while (at (ptr, idx) && at (ptr, idx) != '\n') - { - if (at (ptr, idx) == '\t') - { - /* Expand tabs. Neither makeinfo nor TeX can cope well with - them. */ - do - catchar (dst, ' '); - while (++column & 7); - } - else - { - catchar (dst, at (ptr, idx)); - column++; - } - idx++; - - } - catchar (dst, at (ptr, idx)); - idx++; - return idx; - -} - -static void -icopy_past_newline () -{ - tos++; - check_range (); - init_string (tos); - idx = copy_past_newline (ptr, idx, tos); - pc++; -} - -/* indent - Take the string at the top of the stack, do some prettying. */ - -static void -kill_bogus_lines () -{ - int sl; - - int idx = 0; - int c; - int dot = 0; - - string_type out; - init_string (&out); - /* Drop leading nl. */ - while (at (tos, idx) == '\n') - { - idx++; - } - c = idx; - - /* If the first char is a '.' prepend a newline so that it is - recognized properly later. */ - if (at (tos, idx) == '.') - catchar (&out, '\n'); - - /* Find the last char. */ - while (at (tos, idx)) - { - idx++; - } - - /* Find the last non white before the nl. */ - idx--; - - while (idx && isspace ((unsigned char) at (tos, idx))) - idx--; - idx++; - - /* Copy buffer upto last char, but blank lines before and after - dots don't count. */ - sl = 1; - - while (c < idx) - { - if (at (tos, c) == '\n' - && at (tos, c + 1) == '\n' - && at (tos, c + 2) == '.') - { - /* Ignore two newlines before a dot. */ - c++; - } - else if (at (tos, c) == '.' && sl) - { - /* remember that this line started with a dot. */ - dot = 2; - } - else if (at (tos, c) == '\n' - && at (tos, c + 1) == '\n' - && dot) - { - c++; - /* Ignore two newlines when last line was dot. */ - } - - catchar (&out, at (tos, c)); - if (at (tos, c) == '\n') - { - sl = 1; - - if (dot == 2) - dot = 1; - else - dot = 0; - } - else - sl = 0; - - c++; - - } - - /* Append nl. */ - catchar (&out, '\n'); - pc++; - delete_string (tos); - *tos = out; - -} - -static void -indent () -{ - string_type out; - int tab = 0; - int idx = 0; - int ol = 0; - init_string (&out); - while (at (tos, idx)) - { - switch (at (tos, idx)) - { - case '\n': - cattext (&out, "\n"); - idx++; - if (tab && at (tos, idx)) - { - cattext (&out, " "); - } - ol = 0; - break; - case '(': - tab++; - if (ol == 0) - cattext (&out, " "); - idx++; - cattext (&out, "("); - ol = 1; - break; - case ')': - tab--; - cattext (&out, ")"); - idx++; - ol = 1; - - break; - default: - catchar (&out, at (tos, idx)); - ol = 1; - - idx++; - break; - } - } - - pc++; - delete_string (tos); - *tos = out; - -} - -static void -get_stuff_in_command () -{ - tos++; - check_range (); - init_string (tos); - - while (at (ptr, idx)) - { - if (iscommand (ptr, idx)) - break; - idx = copy_past_newline (ptr, idx, tos); - } - pc++; -} - -static void -swap () -{ - string_type t; - - t = tos[0]; - tos[0] = tos[-1]; - tos[-1] = t; - pc++; -} - -static void -other_dup () -{ - tos++; - check_range (); - init_string (tos); - catstr (tos, tos - 1); - pc++; -} - -static void -drop () -{ - tos--; - check_range (); - pc++; -} - -static void -idrop () -{ - isp--; - icheck_range (); - pc++; -} - -static void -icatstr () -{ - tos--; - check_range (); - catstr (tos, tos + 1); - delete_string (tos + 1); - pc++; -} - -static void -skip_past_newline () -{ - while (at (ptr, idx) - && at (ptr, idx) != '\n') - idx++; - idx++; - pc++; -} - -static void -internalmode () -{ - internal_mode = *(isp); - isp--; - icheck_range (); - pc++; -} - -static void -maybecatstr () -{ - if (internal_wanted == internal_mode) - { - catstr (tos - 1, tos); - } - delete_string (tos); - tos--; - check_range (); - pc++; -} - -char * -nextword (string, word) - char *string; - char **word; -{ - char *word_start; - int idx; - char *dst; - char *src; - - int length = 0; - - while (isspace ((unsigned char) *string) || *string == '-') - { - if (*string == '-') - { - while (*string && *string != '\n') - string++; - - } - else - { - string++; - } - } - if (!*string) - return 0; - - word_start = string; - if (*string == '"') - { - do - { - string++; - length++; - if (*string == '\\') - { - string += 2; - length += 2; - } - } - while (*string != '"'); - } - else - { - while (!isspace ((unsigned char) *string)) - { - string++; - length++; - - } - } - - *word = malloc (length + 1); - - dst = *word; - src = word_start; - - for (idx = 0; idx < length; idx++) - { - if (src[idx] == '\\') - switch (src[idx + 1]) - { - case 'n': - *dst++ = '\n'; - idx++; - break; - case '"': - case '\\': - *dst++ = src[idx + 1]; - idx++; - break; - default: - *dst++ = '\\'; - break; - } - else - *dst++ = src[idx]; - } - *dst++ = 0; - - if (*string) - return string + 1; - else - return 0; -} - -dict_type *root; - -dict_type * -lookup_word (word) - char *word; -{ - dict_type *ptr = root; - while (ptr) - { - if (strcmp (ptr->word, word) == 0) - return ptr; - ptr = ptr->next; - } - if (warning) - fprintf (stderr, "Can't find %s\n", word); - return 0; -} - -static void -perform () -{ - tos = stack; - - while (at (ptr, idx)) - { - /* It's worth looking through the command list. */ - if (iscommand (ptr, idx)) - { - char *next; - dict_type *word; - - (void) nextword (addr (ptr, idx), &next); - - word = lookup_word (next); - - if (word) - { - exec (word); - } - else - { - if (warning) - fprintf (stderr, "warning, %s is not recognised\n", next); - skip_past_newline (); - } - - } - else - skip_past_newline (); - } -} - -dict_type * -newentry (word) - char *word; -{ - dict_type *new = (dict_type *) malloc (sizeof (dict_type)); - new->word = word; - new->next = root; - root = new; - new->code = (stinst_type *) malloc (sizeof (stinst_type)); - new->code_length = 1; - new->code_end = 0; - return new; -} - -unsigned int -add_to_definition (entry, word) - dict_type *entry; - stinst_type word; -{ - if (entry->code_end == entry->code_length) - { - entry->code_length += 2; - entry->code = - (stinst_type *) realloc ((char *) (entry->code), - entry->code_length * sizeof (word_type)); - } - entry->code[entry->code_end] = word; - - return entry->code_end++; -} - -void -add_intrinsic (name, func) - char *name; - void (*func) (); -{ - dict_type *new = newentry (name); - add_to_definition (new, func); - add_to_definition (new, 0); -} - -void -add_var (name) - char *name; -{ - dict_type *new = newentry (name); - add_to_definition (new, push_number); - add_to_definition (new, (stinst_type) (&(new->var))); - add_to_definition (new, 0); -} - -void -compile (string) - char *string; -{ - /* Add words to the dictionary. */ - char *word; - string = nextword (string, &word); - while (string && *string && word[0]) - { - if (strcmp (word, "var") == 0) - { - string = nextword (string, &word); - - add_var (word); - string = nextword (string, &word); - } - else if (word[0] == ':') - { - dict_type *ptr; - /* Compile a word and add to dictionary. */ - string = nextword (string, &word); - - ptr = newentry (word); - string = nextword (string, &word); - while (word[0] != ';') - { - switch (word[0]) - { - case '"': - /* got a string, embed magic push string - function */ - add_to_definition (ptr, push_text); - add_to_definition (ptr, (stinst_type) (word + 1)); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* Got a number, embedd the magic push number - function */ - add_to_definition (ptr, push_number); - add_to_definition (ptr, (stinst_type) atol (word)); - break; - default: - add_to_definition (ptr, call); - add_to_definition (ptr, (stinst_type) lookup_word (word)); - } - - string = nextword (string, &word); - } - add_to_definition (ptr, 0); - string = nextword (string, &word); - } - else - { - fprintf (stderr, "syntax error at %s\n", string - 1); - } - } -} - -static void -bang () -{ - *(long *) ((isp[0])) = isp[-1]; - isp -= 2; - icheck_range (); - pc++; -} - -static void -atsign () -{ - isp[0] = *(long *) (isp[0]); - pc++; -} - -static void -hello () -{ - printf ("hello\n"); - pc++; -} - -static void -stdout_ () -{ - isp++; - icheck_range (); - *isp = 1; - pc++; -} - -static void -stderr_ () -{ - isp++; - icheck_range (); - *isp = 2; - pc++; -} - -static void -print () -{ - if (*isp == 1) - write_buffer (tos, stdout); - else if (*isp == 2) - write_buffer (tos, stderr); - else - fprintf (stderr, "print: illegal print destination `%ld'\n", *isp); - isp--; - tos--; - icheck_range (); - check_range (); - pc++; -} - -static void -read_in (str, file) - string_type *str; - FILE *file; -{ - char buff[10000]; - unsigned int r; - do - { - r = fread (buff, 1, sizeof (buff), file); - catbuf (str, buff, r); - } - while (r); - buff[0] = 0; - - catbuf (str, buff, 1); -} - -static void -usage () -{ - fprintf (stderr, "usage: -[d|i|g] <file >file\n"); - exit (33); -} - -/* There is no reliable way to declare exit. Sometimes it returns - int, and sometimes it returns void. Sometimes it changes between - OS releases. Trying to get it declared correctly in the hosts file - is a pointless waste of time. */ - -static void -chew_exit () -{ - exit (0); -} - -int -main (ac, av) - int ac; - char *av[]; -{ - unsigned int i; - string_type buffer; - string_type pptr; - - init_string (&buffer); - init_string (&pptr); - init_string (stack + 0); - tos = stack + 1; - ptr = &pptr; - - add_intrinsic ("push_text", push_text); - add_intrinsic ("!", bang); - add_intrinsic ("@", atsign); - add_intrinsic ("hello", hello); - add_intrinsic ("stdout", stdout_); - add_intrinsic ("stderr", stderr_); - add_intrinsic ("print", print); - add_intrinsic ("skip_past_newline", skip_past_newline); - add_intrinsic ("catstr", icatstr); - add_intrinsic ("copy_past_newline", icopy_past_newline); - add_intrinsic ("dup", other_dup); - add_intrinsic ("drop", drop); - add_intrinsic ("idrop", idrop); - add_intrinsic ("remchar", remchar); - add_intrinsic ("get_stuff_in_command", get_stuff_in_command); - add_intrinsic ("do_fancy_stuff", do_fancy_stuff); - add_intrinsic ("bulletize", bulletize); - add_intrinsic ("courierize", courierize); - /* If the following line gives an error, exit() is not declared in the - ../hosts/foo.h file for this host. Fix it there, not here! */ - /* No, don't fix it anywhere; see comment on chew_exit--Ian Taylor. */ - add_intrinsic ("exit", chew_exit); - add_intrinsic ("swap", swap); - add_intrinsic ("outputdots", outputdots); - add_intrinsic ("paramstuff", paramstuff); - add_intrinsic ("maybecatstr", maybecatstr); - add_intrinsic ("translatecomments", translatecomments); - add_intrinsic ("kill_bogus_lines", kill_bogus_lines); - add_intrinsic ("indent", indent); - add_intrinsic ("internalmode", internalmode); - add_intrinsic ("print_stack_level", print_stack_level); - add_intrinsic ("strip_trailing_newlines", strip_trailing_newlines); - - /* Put a nl at the start. */ - catchar (&buffer, '\n'); - - read_in (&buffer, stdin); - remove_noncomments (&buffer, ptr); - for (i = 1; i < (unsigned int) ac; i++) - { - if (av[i][0] == '-') - { - if (av[i][1] == 'f') - { - string_type b; - FILE *f; - init_string (&b); - - f = fopen (av[i + 1], "r"); - if (!f) - { - fprintf (stderr, "Can't open the input file %s\n", - av[i + 1]); - return 33; - } - - read_in (&b, f); - compile (b.ptr); - perform (); - } - else if (av[i][1] == 'i') - { - internal_wanted = 1; - } - else if (av[i][1] == 'w') - { - warning = 1; - } - else - usage (); - } - } - write_buffer (stack + 0, stdout); - if (tos != stack) - { - fprintf (stderr, "finishing with current stack level %d\n", - tos - stack); - return 1; - } - return 0; -} diff --git a/bfd/doc/doc.str b/bfd/doc/doc.str deleted file mode 100644 index 7a276fe..0000000 --- a/bfd/doc/doc.str +++ /dev/null @@ -1,158 +0,0 @@ -: DOCDD - skip_past_newline - get_stuff_in_command kill_bogus_lines catstr - ; - -: ENDDD - skip_past_newline - ; - -: EXAMPLE - skip_past_newline - get_stuff_in_command kill_bogus_lines do_fancy_stuff translatecomments - courierize catstr - - ; - -: INODE - "@node " catstr skip_past_newline copy_past_newline catstr - ; - -: CODE_FRAGMENT - EXAMPLE - ; - -: COMMENT - skip_past_newline - get_stuff_in_command - drop - ; - -: SYNOPSIS - skip_past_newline - "@strong{Synopsis}\n" catstr - "@example\n" catstr - get_stuff_in_command - kill_bogus_lines - indent - catstr - "@end example\n" catstr - - ; - -: func - "@findex " - a - skip_past_newline - copy_past_newline - dup - a x x - "@subsubsection @code{" - a x x b - swap - remchar - "}\n" - a x b x c - catstr catstr catstr catstr catstr - ; - -: FUNCTION - "@findex " - a - skip_past_newline - copy_past_newline - dup - a x x - "@subsubsection @code{" - a x x b - swap - remchar - "}\n" - a x b x c - catstr catstr catstr catstr catstr - ; - -: bodytext - get_stuff_in_command - bulletize - kill_bogus_lines - do_fancy_stuff - courierize - catstr - "\n" catstr - ; - -: asection - skip_past_newline - catstr - copy_past_newline - do_fancy_stuff catstr - bodytext - ; - -: SECTION - "@section " asection ; - -: SUBSECTION - "@subsection " asection ; - -: SUBSUBSECTION - "@subsubsection " asection ; - -: subhead - skip_past_newline - bodytext - ; - - - - -: DESCRIPTION - "@strong{Description}@*\n" catstr subhead ; - -: RETURNS - "@strong{Returns}@*\n" catstr subhead ; - -: INTERNAL_FUNCTION - func ; - - -: INTERNAL_DEFINITION - func ; - - -: INTERNAL - func ; - -: TYPEDEF - FUNCTION ; - -: SENUM - skip_past_newline - "Here are the possible values for @code{enum " - copy_past_newline remchar catstr - "}:\n\n" catstr catstr - ; -: ENUM - skip_past_newline - "@deffn {} " - copy_past_newline catstr catstr - ; -: ENUMX - skip_past_newline - "@deffnx {} " - copy_past_newline catstr - catstr - ; -: ENUMEQ - skip_past_newline - "@deffn {} " - copy_past_newline catstr catstr - skip_past_newline - ; -: ENUMEQX - skip_past_newline - "@deffnx {} " - copy_past_newline catstr - catstr - skip_past_newline - ; -: ENUMDOC - skip_past_newline - get_stuff_in_command - strip_trailing_newlines - catstr - "\n@end deffn\n" catstr - ; diff --git a/bfd/doc/fdl.texi b/bfd/doc/fdl.texi deleted file mode 100644 index a83ecf7..0000000 --- a/bfd/doc/fdl.texi +++ /dev/null @@ -1,366 +0,0 @@ -@c -*-texinfo-*- -@appendix GNU Free Documentation License -@center Version 1.1, March 2000 - -@display -Copyright (C) 2000, 2003 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -@end display -@sp 1 -@enumerate 0 -@item -PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -written document ``free'' in the sense of freedom: to assure everyone -the effective freedom to copy and redistribute it, with or without -modifying it, either commercially or noncommercially. Secondarily, -this License preserves for the author and publisher a way to get -credit for their work, while not being considered responsible for -modifications made by others. - -This License is a kind of ``copyleft'', which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - -@sp 1 -@item -APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work that contains a -notice placed by the copyright holder saying it can be distributed -under the terms of this License. The ``Document'', below, refers to any -such manual or work. Any member of the public is a licensee, and is -addressed as ``you.'' - -A ``Modified Version'' of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A ``Secondary Section'' is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (For example, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The ``Invariant Sections'' are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. - -The ``Cover Texts'' are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. - -A ``Transparent'' copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, whose contents can be viewed and edited directly and -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup has been designed to thwart or discourage -subsequent modification by readers is not Transparent. A copy that is -not ``Transparent'' is called ``Opaque.'' - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML designed for human modification. Opaque formats include -PostScript, PDF, proprietary formats that can be read and edited only -by proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML produced by some word processors for output -purposes only. - -The ``Title Page'' means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, ``Title Page'' means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. -@sp 1 -@item -VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. -@sp 1 -@item -COPYING IN QUANTITY - -If you publish printed copies of the Document numbering more than 100, -and the Document's license notice requires Cover Texts, you must enclose -the copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a publicly-accessible computer-network location containing a complete -Transparent copy of the Document, free of added material, which the -general network-using public has access to download anonymously at no -charge using public-standard network protocols. If you use the latter -option, you must take reasonably prudent steps, when you begin -distribution of Opaque copies in quantity, to ensure that this -Transparent copy will remain thus accessible at the stated location -until at least one year after the last time you distribute an Opaque -copy (directly or through your agents or retailers) of that edition to -the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. -@sp 1 -@item -MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission.@* -B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has less than five).@* -C. State on the Title page the name of the publisher of the - Modified Version, as the publisher.@* -D. Preserve all the copyright notices of the Document.@* -E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices.@* -F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below.@* -G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice.@* -H. Include an unaltered copy of this License.@* -I. Preserve the section entitled ``History'', and its title, and add to - it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section entitled ``History'' in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence.@* -J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the ``History'' section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission.@* -K. In any section entitled ``Acknowledgements'' or ``Dedications'', - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein.@* -L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles.@* -M. Delete any section entitled ``Endorsements.'' Such a section - may not be included in the Modified Version.@* -N. Do not retitle any existing section as ``Endorsements'' - or to conflict in title with any Invariant Section.@* -@sp 1 -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section entitled ``Endorsements'', provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. -@sp 1 -@item -COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections entitled ``History'' -in the various original documents, forming one section entitled -``History''; likewise combine any sections entitled ``Acknowledgements'', -and any sections entitled ``Dedications.'' You must delete all sections -entitled ``Endorsements.'' -@sp 1 -@item -COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. -@sp 1 -@item -AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, does not as a whole count as a Modified Version -of the Document, provided no compilation copyright is claimed for the -compilation. Such a compilation is called an ``aggregate'', and this -License does not apply to the other self-contained works thus compiled -with the Document, on account of their being thus compiled, if they -are not themselves derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one quarter -of the entire aggregate, the Document's Cover Texts may be placed on -covers that surround only the Document within the aggregate. -Otherwise they must appear on covers around the whole aggregate. -@sp 1 -@item -TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License provided that you also include the -original English version of this License. In case of a disagreement -between the translation and the original English version of this -License, the original English version will prevail. -@sp 1 -@item -TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. -@sp 1 -@item -FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License ``or any later version'' applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - -@end enumerate - -@unnumberedsec ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@smallexample -@group -Copyright (C) @var{year} @var{your name}. -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with the Invariant Sections being @var{list their titles}, with the -Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. -A copy of the license is included in the section entitled "GNU -Free Documentation License." -@end group -@end smallexample - -If you have no Invariant Sections, write ``with no Invariant Sections'' -instead of saying which ones are invariant. If you have no -Front-Cover Texts, write ``no Front-Cover Texts'' instead of -``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. diff --git a/bfd/doc/header.sed b/bfd/doc/header.sed deleted file mode 100644 index c58dc60..0000000 --- a/bfd/doc/header.sed +++ /dev/null @@ -1,13 +0,0 @@ -s|[ ][ ]*| |g -s|\(.*\) [^ ]*header.sed.*|\1| -s|[^ ]*/||g -s|^ *|"| -s| |", "|g -s|$|"| -s|, \([^ ]*\)$| and \1| -s|^|/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from | -s|\(.\{60\}[^ ]* \)|\1\ - |g -s|$|.\ - Run "make headers" in your build bfd/ to regenerate. */\ -| diff --git a/bfd/doc/makefile.vms b/bfd/doc/makefile.vms deleted file mode 100644 index a0857c0..0000000 --- a/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/bfd/doc/proto.str b/bfd/doc/proto.str deleted file mode 100644 index 702d9f5..0000000 --- a/bfd/doc/proto.str +++ /dev/null @@ -1,135 +0,0 @@ - -: SYNOPSIS - skip_past_newline - get_stuff_in_command - paramstuff - indent - maybecatstr -; - -: ignore - skip_past_newline - get_stuff_in_command - outputdots - maybecatstr - ; - -: CODE_FRAGMENT - ignore ; - -: external - 0 internalmode ignore ; - -: internal - 1 internalmode ignore ; - -- input stack { a b } output b if internal, a if external -: ifinternal - "" swap 1 internalmode maybecatstr - swap - "" swap 0 internalmode maybecatstr - catstr - ; - -- Put note in output string, regardless of internal mode. -: COMMENT - skip_past_newline - get_stuff_in_command - translatecomments - catstr - ; - -- SENUM enum-type-name -- ENUM enum-name -- ENUMX addl-enum-name -- ENUMDOC doc for preceding enums -- ENDSENUM max-enum-name - -: make_enum_header - dup - "enum " swap catstr - " {\n" catstr - swap " _dummy_first_" swap catstr catstr - ",\n" catstr - ; -: make_string_table_header - dup - "#ifdef _BFD_MAKE_TABLE_" swap catstr swap - "\n\nstatic const char *const " swap catstr catstr - "_names[] = { \"@@uninitialized@@\",\n" catstr - ; -: SENUM - skip_past_newline - copy_past_newline - remchar - dup - make_enum_header - swap - make_string_table_header - ifinternal - catstr - get_stuff_in_command catstr - translatecomments ; -: ENDSENUM - skip_past_newline - copy_past_newline strip_trailing_newlines - dup - " " swap catstr " };\n" catstr swap - " \"@@overflow: " swap catstr "@@\",\n};\n#endif\n\n" catstr - ifinternal - catstr - ; -: make_enumerator - " " swap catstr - ",\n" catstr - ; -: make_enumerator_string - " \"" swap catstr - "\",\n" catstr - ; -: ENUM - skip_past_newline - copy_past_newline - remchar - dup - make_enumerator - swap - make_enumerator_string - ifinternal - ; -: ENUMX ENUM catstr ; -: ENUMEQ - skip_past_newline - "#define " - copy_past_newline remchar - catstr - " " - catstr - copy_past_newline - catstr - "" swap 0 internalmode maybecatstr - ; -: ENUMEQX ENUMEQ catstr ; -: ENUMDOC - skip_past_newline - get_stuff_in_command - strip_trailing_newlines - "\n{* " swap catstr " *}\n" catstr - translatecomments - - discard it if we're doing internal mode - "" swap 0 internalmode maybecatstr - swap - catstr catstr - ; -: ENDDD external ; -: SECTION ignore ; -: SUBSECTION ignore ; -: SUBSUBSECTION ignore ; -: INTERNAL_DEFINITION internal ; -: DESCRIPTION ignore ; -: FUNCTION external ; -: RETURNS ignore ; -: TYPEDEF external ; -: INTERNAL_FUNCTION internal ; -: INTERNAL internal ; -: INODE ignore ; |