summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd/doc
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-05-28 05:21:37 +0000
committerobrien <obrien@FreeBSD.org>2001-05-28 05:21:37 +0000
commit328e45595b12375b6d16a846069507d25086abdb (patch)
treeae2a6f4f4987889b7bd2af7bdf0b86fa580df011 /contrib/binutils/bfd/doc
parent7fbb72605a1c3bcb81f8b6bb6297ffef30f84335 (diff)
downloadFreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.zip
FreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.tar.gz
Import of GNU Binutils version 2.11.0.
Believe it or not, this is heavily stripped down.
Diffstat (limited to 'contrib/binutils/bfd/doc')
-rw-r--r--contrib/binutils/bfd/doc/ChangeLog31
-rw-r--r--contrib/binutils/bfd/doc/Makefile.in9
-rw-r--r--contrib/binutils/bfd/doc/aoutx.texi2
-rw-r--r--contrib/binutils/bfd/doc/archures.texi161
-rw-r--r--contrib/binutils/bfd/doc/bfd.texinfo409
-rw-r--r--contrib/binutils/bfd/doc/bfdint.texi7
-rw-r--r--contrib/binutils/bfd/doc/bfdt.texi65
-rw-r--r--contrib/binutils/bfd/doc/cache.texi2
-rw-r--r--contrib/binutils/bfd/doc/chew.c1810
-rw-r--r--contrib/binutils/bfd/doc/coffcode.texi12
-rw-r--r--contrib/binutils/bfd/doc/format.texi4
-rw-r--r--contrib/binutils/bfd/doc/hash.texi2
-rw-r--r--contrib/binutils/bfd/doc/libbfd.texi10
-rw-r--r--contrib/binutils/bfd/doc/linker.texi2
-rw-r--r--contrib/binutils/bfd/doc/reloc.texi172
-rw-r--r--contrib/binutils/bfd/doc/section.texi439
-rw-r--r--contrib/binutils/bfd/doc/syms.texi4
-rw-r--r--contrib/binutils/bfd/doc/targets.texi111
18 files changed, 1965 insertions, 1287 deletions
diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog
index def932c..57326a9 100644
--- a/contrib/binutils/bfd/doc/ChangeLog
+++ b/contrib/binutils/bfd/doc/ChangeLog
@@ -1,3 +1,30 @@
+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.
@@ -6,6 +33,10 @@
* bfdint.texi (BFD_JUMP_TABLE macros): Fix typo.
+Fri Apr 7 17:54:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in: Rebuild with current autoconf/automake.
+
Thu Feb 4 23:21:36 1999 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in: Rebuild with current autoconf/automake.
diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in
index acdc9bf..dfc33e1 100644
--- a/contrib/binutils/bfd/doc/Makefile.in
+++ b/contrib/binutils/bfd/doc/Makefile.in
@@ -75,10 +75,14 @@ CC = @CC@
CC_FOR_BUILD = @CC_FOR_BUILD@
COREFILE = @COREFILE@
COREFLAG = @COREFLAG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
@@ -96,14 +100,17 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
+STRIP = @STRIP@
TDEFINES = @TDEFINES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
WIN32LDFLAGS = @WIN32LDFLAGS@
WIN32LIBADD = @WIN32LIBADD@
all_backends = @all_backends@
@@ -187,7 +194,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
diff --git a/contrib/binutils/bfd/doc/aoutx.texi b/contrib/binutils/bfd/doc/aoutx.texi
index d97e96a..d99fd05 100644
--- a/contrib/binutils/bfd/doc/aoutx.texi
+++ b/contrib/binutils/bfd/doc/aoutx.texi
@@ -148,7 +148,7 @@ Swap the information in an internal exec header structure
@example
const bfd_target *aout_@var{size}_some_aout_object_p
(bfd *abfd,
- const bfd_target *(*callback_to_real_object_p)());
+ const bfd_target *(*callback_to_real_object_p) ());
@end example
@strong{Description}@*
Some a.out variant thinks that the file open in @var{abfd}
diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi
index 6ee20e9..b363780 100644
--- a/contrib/binutils/bfd/doc/archures.texi
+++ b/contrib/binutils/bfd/doc/archures.texi
@@ -1,7 +1,7 @@
@section Architectures
BFD keeps one atom in a BFD describing the
architecture of the data attached to the BFD: a pointer to a
-@code{bfd_arch_info_type}.
+@code{bfd_arch_info_type}.
Pointers to structures can be requested independently of a BFD
so that an architecture's information can be interrogated
@@ -11,13 +11,13 @@ The architecture information is provided by each architecture package.
The set of default architectures is selected by the macro
@code{SELECT_ARCHITECTURES}. This is normally set up in the
@file{config/@var{target}.mt} file of your choice. If the name is not
-defined, then all the architectures supported are included.
+defined, then all the architectures supported are included.
When BFD starts up, all the architectures are called with an
initialize method. It is up to the architecture back end to
insert as many items into the list of architectures as it wants to;
generally this would be one for each machine and one for the
-default case (an item with a machine field of 0).
+default case (an item with a machine field of 0).
BFD's idea of an architecture is implemented in @file{archures.c}.
@@ -31,13 +31,13 @@ Another field indicates which processor within
the family is in use. The machine gives a number which
distinguishes different versions of the architecture,
containing, for example, 2 and 3 for Intel i960 KA and i960 KB,
-and 68020 and 68030 for Motorola 68020 and 68030.
+and 68020 and 68030 for Motorola 68020 and 68030.
@example
-enum bfd_architecture
+enum bfd_architecture
@{
- bfd_arch_unknown, /* File arch not known */
- bfd_arch_obscure, /* Arch known, not one of these */
- bfd_arch_m68k, /* Motorola 68xxx */
+ bfd_arch_unknown, /* File arch not known */
+ bfd_arch_obscure, /* Arch known, not one of these */
+ bfd_arch_m68k, /* Motorola 68xxx */
#define bfd_mach_m68000 1
#define bfd_mach_m68008 2
#define bfd_mach_m68010 3
@@ -46,14 +46,14 @@ enum bfd_architecture
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
- bfd_arch_vax, /* DEC Vax */
- bfd_arch_i960, /* Intel 960 */
- /* The order of the following is important.
- lower number indicates a machine type that
+ bfd_arch_vax, /* DEC Vax */
+ bfd_arch_i960, /* Intel 960 */
+ /* The order of the following is important.
+ lower number indicates a machine type that
only accepts a subset of the instructions
available to machines with higher numbers.
The exception is the "ca", which is
- incompatible with all other machines except
+ incompatible with all other machines except
"core". */
#define bfd_mach_i960_core 1
@@ -65,21 +65,24 @@ enum bfd_architecture
#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
- bfd_arch_a29k, /* AMD 29000 */
- bfd_arch_sparc, /* SPARC */
+ bfd_arch_a29k, /* AMD 29000 */
+ bfd_arch_sparc, /* SPARC */
#define bfd_mach_sparc 1
- /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
+/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
#define bfd_mach_sparc_sparclet 2
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
-#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
-#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
- /* Nonzero if MACH has the v9 instruction set. */
+#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */
+#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */
+/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
- ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
- bfd_arch_mips, /* MIPS Rxxxx */
+ ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
+ && (mach) != bfd_mach_sparc_sparclite_le)
+ bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
#define bfd_mach_mips4000 4000
@@ -95,36 +98,66 @@ enum bfd_architecture
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips16 16
- bfd_arch_i386, /* Intel 386 */
+#define bfd_mach_mips32 32
+#define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */
+#define bfd_mach_mips5 5
+#define bfd_mach_mips64 64
+#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
+ bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
#define bfd_mach_i386_i386_intel_syntax 2
- bfd_arch_we32k, /* AT&T WE32xxx */
- bfd_arch_tahoe, /* CCI/Harris Tahoe */
- bfd_arch_i860, /* Intel 860 */
- bfd_arch_i370, /* IBM 360/370 Mainframes */
- bfd_arch_romp, /* IBM ROMP PC/RT */
- bfd_arch_alliant, /* Alliant */
- bfd_arch_convex, /* Convex */
- bfd_arch_m88k, /* Motorola 88xxx */
- bfd_arch_pyramid, /* Pyramid Technology */
- bfd_arch_h8300, /* Hitachi H8/300 */
+#define bfd_mach_x86_64 3
+#define bfd_mach_x86_64_intel_syntax 4
+ bfd_arch_we32k, /* AT&T WE32xxx */
+ bfd_arch_tahoe, /* CCI/Harris Tahoe */
+ bfd_arch_i860, /* Intel 860 */
+ bfd_arch_i370, /* IBM 360/370 Mainframes */
+ bfd_arch_romp, /* IBM ROMP PC/RT */
+ bfd_arch_alliant, /* Alliant */
+ bfd_arch_convex, /* Convex */
+ bfd_arch_m88k, /* Motorola 88xxx */
+ bfd_arch_pyramid, /* Pyramid Technology */
+ bfd_arch_h8300, /* Hitachi H8/300 */
#define bfd_mach_h8300 1
#define bfd_mach_h8300h 2
#define bfd_mach_h8300s 3
- bfd_arch_powerpc, /* PowerPC */
- bfd_arch_rs6000, /* IBM RS/6000 */
- bfd_arch_hppa, /* HP PA RISC */
- bfd_arch_d10v, /* Mitsubishi D10V */
+ bfd_arch_powerpc, /* PowerPC */
+#define bfd_mach_ppc 0
+#define bfd_mach_ppc_403 403
+#define bfd_mach_ppc_403gc 4030
+#define bfd_mach_ppc_505 505
+#define bfd_mach_ppc_601 601
+#define bfd_mach_ppc_602 602
+#define bfd_mach_ppc_603 603
+#define bfd_mach_ppc_ec603e 6031
+#define bfd_mach_ppc_604 604
+#define bfd_mach_ppc_620 620
+#define bfd_mach_ppc_630 630
+#define bfd_mach_ppc_750 750
+#define bfd_mach_ppc_860 860
+#define bfd_mach_ppc_a35 35
+#define bfd_mach_ppc_rs64ii 642
+#define bfd_mach_ppc_rs64iii 643
+#define bfd_mach_ppc_7400 7400
+ bfd_arch_rs6000, /* IBM RS/6000 */
+#define bfd_mach_rs6k 0
+#define bfd_mach_rs6k_rs1 6001
+#define bfd_mach_rs6k_rsc 6003
+#define bfd_mach_rs6k_rs2 6002
+ bfd_arch_hppa, /* HP PA RISC */
+ bfd_arch_d10v, /* Mitsubishi D10V */
#define bfd_mach_d10v 0
#define bfd_mach_d10v_ts2 2
#define bfd_mach_d10v_ts3 3
- bfd_arch_d30v, /* Mitsubishi D30V */
- bfd_arch_z8k, /* Zilog Z8000 */
+ bfd_arch_d30v, /* Mitsubishi D30V */
+ bfd_arch_m68hc11, /* Motorola 68HC11 */
+ bfd_arch_m68hc12, /* Motorola 68HC12 */
+ bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
- bfd_arch_h8500, /* Hitachi H8/500 */
- bfd_arch_sh, /* Hitachi SH */
+ bfd_arch_h8500, /* Hitachi H8/500 */
+ bfd_arch_sh, /* Hitachi SH */
#define bfd_mach_sh 0
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
@@ -132,11 +165,11 @@ enum bfd_architecture
#define bfd_mach_sh3_dsp 0x3d
#define bfd_mach_sh3e 0x3e
#define bfd_mach_sh4 0x40
- bfd_arch_alpha, /* Dec Alpha */
+ bfd_arch_alpha, /* Dec Alpha */
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_alpha_ev6 0x30
- bfd_arch_arm, /* Advanced Risc Machines ARM */
+ bfd_arch_arm, /* Advanced Risc Machines ARM */
#define bfd_mach_arm_2 1
#define bfd_mach_arm_2a 2
#define bfd_mach_arm_3 3
@@ -145,32 +178,43 @@ enum bfd_architecture
#define bfd_mach_arm_4T 6
#define bfd_mach_arm_5 7
#define bfd_mach_arm_5T 8
- bfd_arch_ns32k, /* National Semiconductors ns32000 */
- bfd_arch_w65, /* WDC 65816 */
- bfd_arch_tic30, /* Texas Instruments TMS320C30 */
- bfd_arch_tic80, /* TI TMS320c80 (MVP) */
- bfd_arch_v850, /* NEC V850 */
+#define bfd_mach_arm_5TE 9
+#define bfd_mach_arm_XScale 10
+ bfd_arch_ns32k, /* National Semiconductors ns32000 */
+ bfd_arch_w65, /* WDC 65816 */
+ bfd_arch_tic30, /* Texas Instruments TMS320C30 */
+ bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP) */
+ bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 0
#define bfd_mach_v850e 'E'
#define bfd_mach_v850ea 'A'
- bfd_arch_arc, /* Argonaut RISC Core */
-#define bfd_mach_arc_base 0
- bfd_arch_m32r, /* Mitsubishi M32R/D */
-#define bfd_mach_m32r 0 /* backwards compatibility */
+ bfd_arch_arc, /* ARC Cores */
+#define bfd_mach_arc_5 0
+#define bfd_mach_arc_6 1
+#define bfd_mach_arc_7 2
+#define bfd_mach_arc_8 3
+ bfd_arch_m32r, /* Mitsubishi M32R/D */
+#define bfd_mach_m32r 0 /* backwards compatibility */
#define bfd_mach_m32rx 'x'
- bfd_arch_mn10200, /* Matsushita MN10200 */
- bfd_arch_mn10300, /* Matsushita MN10300 */
+ bfd_arch_mn10200, /* Matsushita MN10200 */
+ bfd_arch_mn10300, /* Matsushita MN10300 */
#define bfd_mach_mn10300 300
#define bfd_mach_am33 330
bfd_arch_fr30,
#define bfd_mach_fr30 0x46523330
bfd_arch_mcore,
+ bfd_arch_ia64, /* HP/Intel ia64 */
+#define bfd_mach_ia64_elf64 0
+#define bfd_mach_ia64_elf32 1
bfd_arch_pj,
- bfd_arch_avr, /* Atmel AVR microcontrollers */
+ bfd_arch_avr, /* Atmel AVR microcontrollers */
#define bfd_mach_avr1 1
#define bfd_mach_avr2 2
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
+#define bfd_mach_avr5 5
+ bfd_arch_cris, /* Axis CRIS */
bfd_arch_last
@};
@end example
@@ -183,7 +227,7 @@ This structure contains information on architectures for use
within BFD.
@example
-typedef struct bfd_arch_info
+typedef struct bfd_arch_info
@{
int bits_per_word;
int bits_per_address;
@@ -193,8 +237,8 @@ typedef struct bfd_arch_info
const char *arch_name;
const char *printable_name;
unsigned int section_align_power;
- /* true if this is the default machine for the architecture */
- boolean the_default;
+ /* True if this is the default machine for the architecture. */
+ boolean the_default;
const struct bfd_arch_info * (*compatible)
PARAMS ((const struct bfd_arch_info *a,
const struct bfd_arch_info *b));
@@ -380,7 +424,7 @@ const char *bfd_printable_arch_mach
@end example
@strong{Description}@*
Return a printable string representing the architecture and
-machine type.
+machine type.
This routine is depreciated.
@@ -404,6 +448,7 @@ unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,
@end example
@strong{Description}@*
See bfd_octets_per_byte.
+
This routine is provided for those cases where a bfd * is not
available
diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo
index a302bcf..9803371 100644
--- a/contrib/binutils/bfd/doc/bfd.texinfo
+++ b/contrib/binutils/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
\input texinfo.tex
@setfilename bfd.info
-@c $Id: bfd.texinfo,v 1.1.1.1 1999/05/03 07:28:58 rth Exp $
+@c $Id: bfd.texinfo,v 1.2 2000/11/15 18:24:49 nickc Exp $
@tex
% NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE
\global\long\def\example{%
@@ -28,11 +28,14 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the BFD library.
-Copyright (C) 1991 Free Software Foundation, Inc.
+Copyright (C) 1991, 2000 Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
+ Permission is granted to copy, 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
@@ -41,14 +44,6 @@ notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, subject to the terms
-of the GNU General Public License, which includes the provision that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
@end ifinfo
@iftex
@c@finalout
@@ -67,7 +62,7 @@ into another language, under the above conditions for modified versions.
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.1.1.1 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.2 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Support\par
\hfill sac\@cygnus.com\par
@@ -80,18 +75,13 @@ into another language, under the above conditions for modified versions.
@vskip 0pt plus 1filll
Copyright @copyright{} 1991 Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
+ Permission is granted to copy, 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".
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, subject to the terms
-of the GNU General Public License, which includes the provision that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
@end titlepage
@end iftex
@@ -104,6 +94,7 @@ This file documents the binary file descriptor library libbfd.
* Overview:: Overview of BFD
* BFD front end:: BFD front end
* BFD back ends:: BFD back ends
+* GNU Free Documentation License:: GNU Free Documentation License
* Index:: Index
@end menu
@@ -298,7 +289,7 @@ structures.
@node Hash Tables, , Linker Functions, BFD front end
@include hash.texi
-@node BFD back ends, Index, BFD front end, Top
+@node BFD back ends, GNU Free Documentation License, BFD front end, Top
@chapter BFD back ends
@menu
* What to Put Where::
@@ -325,7 +316,371 @@ All of BFD lives in one directory.
@c Leave this out until the file has some actual contents...
@c @include elfcode.texi
-@node Index, , BFD back ends , Top
+@node GNU Free Documentation License, Index, BFD back ends, Top
+@chapter GNU Free Documentation License
+@cindex GNU Free Documentation License
+
+ GNU Free Documentation License
+
+ Version 1.1, March 2000
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. 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.
+
+
+1. 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.
+
+
+2. 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.
+
+
+3. 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.
+
+
+4. 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.
+
+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.
+
+
+5. 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."
+
+
+6. 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.
+
+
+7. 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.
+
+
+8. 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.
+
+
+9. 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.
+
+
+10. 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.
+
+
+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
+ Copyright (c) YEAR 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 LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+@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 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.
+
+@node Index, , GNU Free Documentation License , Top
@unnumbered Index
@printindex cp
diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi
index 39eaacf..b0a0182 100644
--- a/contrib/binutils/bfd/doc/bfdint.texi
+++ b/contrib/binutils/bfd/doc/bfdint.texi
@@ -18,8 +18,7 @@
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. It was
-last modified on $Date: 2000/04/30 15:07:52 $.
+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}.
@@ -1607,6 +1606,10 @@ it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER},
macros to create a table mapping the number used to indentify 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
diff --git a/contrib/binutils/bfd/doc/bfdt.texi b/contrib/binutils/bfd/doc/bfdt.texi
index 98269fb..b9e6fb7 100644
--- a/contrib/binutils/bfd/doc/bfdt.texi
+++ b/contrib/binutils/bfd/doc/bfdt.texi
@@ -10,10 +10,10 @@ to the rest of the data.
@example
-struct _bfd
+struct _bfd
@{
/* The filename the application opened the BFD with. */
- CONST char *filename;
+ CONST char *filename;
/* A pointer to the target jump table. */
const struct bfd_target *xvec;
@@ -46,7 +46,7 @@ struct _bfd
/* When a file is closed by the caching routines, BFD retains
state information on the file here: */
- file_ptr where;
+ file_ptr where;
/* and here: (``once'' means at least once) */
@@ -59,7 +59,7 @@ struct _bfd
/* File modified time, if mtime_set is true: */
- long mtime;
+ long mtime;
/* Reserved for an unimplemented file locking extension.*/
@@ -78,13 +78,13 @@ struct _bfd
/* Format_specific flags*/
- flagword flags;
+ flagword flags;
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
origin, with origin set to 0 for non archive files. */
- file_ptr origin;
+ file_ptr origin;
/* Remember when output has begun, to stop strange things
from happening. */
@@ -96,7 +96,7 @@ struct _bfd
/* The number of sections */
unsigned int section_count;
- /* Stuff only useful for object files:
+ /* Stuff only useful for object files:
The start address. */
bfd_vma start_address;
@@ -104,17 +104,17 @@ struct _bfd
unsigned int symcount;
/* Symbol table for output BFD (with symcount entries) */
- struct symbol_cache_entry **outsymbols;
+ struct symbol_cache_entry **outsymbols;
/* Pointer to structure which contains architecture information*/
const struct bfd_arch_info *arch_info;
/* Stuff only useful for archives:*/
- PTR arelt_data;
+ PTR arelt_data;
struct _bfd *my_archive; /* The containing archive BFD. */
struct _bfd *next; /* The next BFD in the archive. */
struct _bfd *archive_head; /* The first BFD in the archive. */
- boolean has_armap;
+ boolean has_armap;
/* A chain of BFD structures involved in a link. */
struct _bfd *link_next;
@@ -125,7 +125,7 @@ struct _bfd
/* Used by the back end to hold private data. */
- union
+ union
@{
struct aout_data_struct *aout_data;
struct artdata *aout_ar_data;
@@ -157,7 +157,7 @@ struct _bfd
struct netbsd_core_struct *netbsd_core_data;
PTR any;
@} tdata;
-
+
/* Used by the application to hold private data*/
PTR usrdata;
@@ -366,6 +366,39 @@ type of file. E.g., an attempt was made to set the @code{D_PAGED} bit
on a BFD format which does not support demand paging.
@end itemize
+@findex bfd_get_arch_size
+@subsubsection @code{bfd_get_arch_size}
+@strong{Synopsis}
+@example
+int bfd_get_arch_size (bfd *abfd);
+@end example
+@strong{Description}@*
+Returns the architecture address size, in bits, as determined
+by the object file's format. For ELF, this information is
+included in the header.
+
+@strong{Returns}@*
+Returns the arch size in bits if known, @code{-1} otherwise.
+
+@findex bfd_get_sign_extend_vma
+@subsubsection @code{bfd_get_sign_extend_vma}
+@strong{Synopsis}
+@example
+int bfd_get_sign_extend_vma (bfd *abfd);
+@end example
+@strong{Description}@*
+Indicates if the target architecture "naturally" sign extends
+an address. Some architectures implicitly sign extend address
+values when they are converted to types larger than the size
+of an address. For instance, bfd_get_start_address() will
+return an address sign extended to fill a bfd_vma when this is
+the case.
+
+@strong{Returns}@*
+Returns @code{1} if the target architecture is known to sign
+extend addresses, @code{0} if the target architecture is known to
+not sign extend addresses, and @code{-1} otherwise.
+
@findex bfd_set_start_address
@subsubsection @code{bfd_set_start_address}
@strong{Synopsis}
@@ -407,7 +440,7 @@ it so that such results were guaranteed.
Instead, we want to ask questions like "is this NNN byte sized
object I'm about to try read from file offset YYY reasonable?"
As as example of where we might do this, some object formats
-use string tables for which the first @code{sizeof(long)} bytes of the
+use string tables for which the first @code{sizeof (long)} bytes of the
table contain the size of the table itself, including the size bytes.
If an application tries to read what it thinks is one of these
string tables, without some way to validate the size, and for
@@ -466,7 +499,7 @@ Overflow is not detected.
boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);
@end example
@strong{Description}@*
-Copy private BFD information from the BFD @var{ibfd} to the
+Copy private BFD information from the BFD @var{ibfd} to the
the BFD @var{obfd}. Return @code{true} on success, @code{false} on error.
Possible error returns are:
@@ -489,7 +522,7 @@ Not enough memory exists to create private data for @var{obfd}.
boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);
@end example
@strong{Description}@*
-Merge private BFD information from the BFD @var{ibfd} to the
+Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return @code{true}
on success, @code{false} on error. Possible error returns are:
@@ -539,7 +572,7 @@ Stuff which should be documented:
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
- /* Do these three do anything useful at all, for any back end? */
+ /* Do these three do anything useful at all, for any back end? */
#define bfd_debug_info_start(abfd) \
BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
diff --git a/contrib/binutils/bfd/doc/cache.texi b/contrib/binutils/bfd/doc/cache.texi
index 4aafb69..56d1f18 100644
--- a/contrib/binutils/bfd/doc/cache.texi
+++ b/contrib/binutils/bfd/doc/cache.texi
@@ -40,7 +40,7 @@ otherwise, it has to perform the complicated lookup function.
@example
#define bfd_cache_lookup(x) \
((x)==bfd_last_cache? \
- (FILE*)(bfd_last_cache->iostream): \
+ (FILE*) (bfd_last_cache->iostream): \
bfd_cache_lookup_worker(x))
@end example
diff --git a/contrib/binutils/bfd/doc/chew.c b/contrib/binutils/bfd/doc/chew.c
index eba69c2..7b98ccf 100644
--- a/contrib/binutils/bfd/doc/chew.c
+++ b/contrib/binutils/bfd/doc/chew.c
@@ -1,5 +1,5 @@
/* chew
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000, 2001
Free Software Foundation, Inc.
Contributed by steve chamberlain @cygnus
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
@@ -81,7 +81,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Foo. */
-
#include <ansidecl.h>
#include "sysdep.h"
#include <assert.h>
@@ -96,16 +95,15 @@ int internal_mode;
int warning;
-/* Here is a string type ... */
+/* Here is a string type ... */
-typedef struct buffer
+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 *);
@@ -121,100 +119,104 @@ static void cattext (string_type *, char *);
static void catstr (string_type *, string_type *);
#endif
-
-static void DEFUN(init_string_with_size,(buffer, size),
- string_type *buffer AND
- unsigned int size )
+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);
+ buffer->write_idx = 0;
+ buffer->size = size;
+ buffer->ptr = malloc (size);
}
-static void DEFUN(init_string,(buffer),
- string_type *buffer)
+static void
+init_string (buffer)
+ string_type *buffer;
{
- init_string_with_size(buffer, DEF_SIZE);
-
+ init_string_with_size (buffer, DEF_SIZE);
}
-static int DEFUN(find, (str, what),
- string_type *str AND
- char *what)
+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++)
+ 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;
+ if (*p == str->ptr[i])
+ p++;
+ else
+ p = what;
}
- return (*p == 0);
-
+ return (*p == 0);
}
-static void DEFUN(write_buffer,(buffer, f),
- string_type *buffer AND
- FILE *f)
+static void
+write_buffer (buffer, f)
+ string_type *buffer;
+ FILE *f;
{
- fwrite(buffer->ptr, buffer->write_idx, 1, f);
+ fwrite (buffer->ptr, buffer->write_idx, 1, f);
}
-
-static void DEFUN(delete_string,(buffer),
- string_type *buffer)
+static void
+delete_string (buffer)
+ string_type *buffer;
{
- free(buffer->ptr);
+ free (buffer->ptr);
}
-
-static char *DEFUN(addr, (buffer, idx),
- string_type *buffer AND
- unsigned int idx)
+static char *
+addr (buffer, idx)
+ string_type *buffer;
+ unsigned int idx;
{
- return buffer->ptr + idx;
+ return buffer->ptr + idx;
}
-static char DEFUN(at,(buffer, pos),
- string_type *buffer AND
- unsigned int pos)
+static char
+at (buffer, pos)
+ string_type *buffer;
+ unsigned int pos;
{
- if (pos >= buffer->write_idx)
+ if (pos >= buffer->write_idx)
return 0;
return buffer->ptr[pos];
}
-static void DEFUN(catchar,(buffer, ch),
- string_type *buffer AND
- int ch)
+static void
+catchar (buffer, ch)
+ string_type *buffer;
+ int ch;
{
- if (buffer->write_idx == buffer->size)
+ if (buffer->write_idx == buffer->size)
{
- buffer->size *=2;
- buffer->ptr = realloc(buffer->ptr, buffer->size);
+ buffer->size *= 2;
+ buffer->ptr = realloc (buffer->ptr, buffer->size);
}
- buffer->ptr[buffer->write_idx ++ ] = ch;
+ buffer->ptr[buffer->write_idx++] = ch;
}
-
-static void DEFUN(overwrite_string,(dst, src),
- string_type *dst AND
- string_type *src)
-{
- free(dst->ptr);
- dst->size = src->size;
- dst->write_idx = src->write_idx;
- dst->ptr = src->ptr;
+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 DEFUN(catbuf,(buffer, buf, len),
- string_type *buffer AND
- char *buf AND
- unsigned int len)
+static void
+catbuf (buffer, buf, len)
+ string_type *buffer;
+ char *buf;
+ unsigned int len;
{
if (buffer->write_idx + len >= buffer->size)
{
@@ -226,41 +228,41 @@ static void DEFUN(catbuf,(buffer, buf, len),
buffer->write_idx += len;
}
-static void DEFUN(cattext,(buffer, string),
- string_type *buffer AND
- char *string)
+static void
+cattext (buffer, string)
+ string_type *buffer;
+ char *string;
{
catbuf (buffer, string, (unsigned int) strlen (string));
}
-static void DEFUN(catstr,(dst, src),
- string_type *dst AND
- string_type *src)
+static void
+catstr (dst, src)
+ string_type *dst;
+ string_type *src;
{
catbuf (dst, src->ptr, src->write_idx);
}
-
-static unsigned int
-DEFUN(skip_white_and_stars,(src, idx),
- string_type *src AND
- unsigned int idx)
+static unsigned int
+skip_white_and_stars (src, idx)
+ string_type *src;
+ unsigned int idx;
{
char c;
- while ((c = at(src,idx)),
+ 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'))
+ && at (src, idx +1) != '/'
+ && at (src, idx -1) != '\n'))
idx++;
return idx;
}
/***********************************************************************/
-
string_type stack[STACK];
string_type *tos;
@@ -275,19 +277,18 @@ 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;
-
+ char *word;
+ struct dict_struct *next;
+ stinst_type *code;
+ int code_length;
+ int code_end;
+ int var;
};
+
typedef struct dict_struct dict_type;
+
#define WORD(x) static void x()
static void
@@ -352,27 +353,28 @@ static void usage (void);
static void chew_exit (void);
#endif
-static void DEFUN(exec,(word),
- dict_type *word)
+static void
+exec (word)
+ dict_type *word;
{
pc = word->code;
- while (*pc)
- (*pc)();
+ while (*pc)
+ (*pc) ();
}
-WORD(call)
-{
- stinst_type *oldpc = pc;
- dict_type *e;
- e = (dict_type *)(pc [1]);
- exec(e);
- pc = oldpc + 2;
-
+
+WORD (call)
+{
+ stinst_type *oldpc = pc;
+ dict_type *e;
+ e = (dict_type *) (pc[1]);
+ exec (e);
+ pc = oldpc + 2;
}
-WORD(remchar)
+WORD (remchar)
{
if (tos->write_idx)
- tos->write_idx--;
+ tos->write_idx--;
pc++;
}
@@ -386,81 +388,80 @@ strip_trailing_newlines ()
pc++;
}
-WORD(push_number)
+WORD (push_number)
{
- isp++;
- icheck_range ();
- pc++;
- *isp = (long)(*pc);
- pc++;
+ isp++;
+ icheck_range ();
+ pc++;
+ *isp = (long) (*pc);
+ pc++;
}
-WORD(push_text)
+WORD (push_text)
{
- tos++;
- check_range ();
- init_string(tos);
- pc++;
- cattext(tos,*((char **)pc));
- pc++;
-
+ 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
-DEFUN(remove_noncomments,(src,dst),
- string_type *src AND
- string_type *dst)
+static void
+remove_noncomments (src, dst)
+ string_type *src;
+ string_type *dst;
{
- unsigned int idx = 0;
-
- while (at(src,idx))
+ 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) == '*')
+ /* 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))
+ 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')
+ 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);
+ /* 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) == '/')
+ else if (at (src, idx) == '*' && at (src, idx + 1) == '/')
{
- idx +=2 ;
- cattext(dst,"\nENDDD\n");
- break;
+ idx += 2;
+ cattext (dst, "\nENDDD\n");
+ break;
}
- else
+ else
{
- catchar(dst, at(src, idx));
- idx++;
+ catchar (dst, at (src, idx));
+ idx++;
}
}
}
- else idx++;
+ else
+ idx++;
}
}
@@ -481,98 +482,103 @@ print_stack_level ()
*/
static void
-DEFUN_VOID(paramstuff)
-{
- unsigned int openp;
- unsigned int fname;
- unsigned int idx;
- string_type out;
- init_string(&out);
-
-
- /* make sure that it's not already param'd or proto'd */
- if(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++)
- ;
+paramstuff (void)
+{
+ unsigned int openp;
+ unsigned int fname;
+ unsigned int idx;
+ unsigned int len;
+ string_type out;
+ init_string (&out);
- fname = openp;
- /* Step back to the fname */
+ /* Make sure that it's not already param'd or proto'd. */
+ if (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)))
- fname --;
- while (fname
- && !isspace((unsigned char) at(tos,fname))
- && at(tos,fname) != '*')
- fname--;
-
- fname++;
-
- for (idx = 0; idx < fname; idx++) /* Output type */
- {
- catchar(&out, at(tos,idx));
- }
-
- cattext(&out, "\n"); /* Insert a newline between type and fnname */
+ while (fname
+ && !isspace ((unsigned char) at (tos,fname))
+ && at (tos,fname) != '*')
+ fname--;
+
+ fname++;
- for (idx = fname; idx < openp; idx++) /* Output fnname */
+ /* Output type, omitting trailing whitespace character(s), if
+ any. */
+ for (len = fname; 0 < len; len--)
{
- catchar(&out, at(tos,idx));
+ if (!isspace ((unsigned char) at (tos, len - 1)))
+ break;
}
+ for (idx = 0; idx < len; idx++)
+ catchar (&out, at (tos, idx));
- cattext(&out," PARAMS (");
+ cattext (&out, "\n"); /* Insert a newline between type and fnname */
- while (at(tos,idx) && at(tos,idx) !=';')
+ /* Output function name, omitting trailing whitespace
+ character(s), if any. */
+ for (len = openp; 0 < len; len--)
{
- catchar(&out, at(tos, idx));
- idx++;
+ if (!isspace ((unsigned char) at (tos, len - 1)))
+ break;
}
- cattext(&out,");\n\n");
- }
- overwrite_string(tos, &out);
- pc++;
-
-}
+ 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 */
-WORD(translatecomments)
+WORD (translatecomments)
{
- unsigned int idx = 0;
- string_type out;
- init_string(&out);
-
- while (at(tos, idx))
+ unsigned int idx = 0;
+ string_type out;
+ init_string (&out);
+
+ while (at (tos, idx))
{
- if (at(tos,idx) == '{' && at(tos,idx+1) =='*')
+ if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
{
- cattext(&out,"/*");
- idx+=2;
+ cattext (&out, "/*");
+ idx += 2;
}
- else if (at(tos,idx) == '*' && at(tos,idx+1) =='}')
+ else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
{
- cattext(&out,"*/");
- idx+=2;
+ cattext (&out, "*/");
+ idx += 2;
}
- else
+ else
{
- catchar(&out, at(tos, idx));
- idx++;
+ catchar (&out, at (tos, idx));
+ idx++;
}
}
+ overwrite_string (tos, &out);
- overwrite_string(tos, &out);
-
- pc++;
-
+ pc++;
}
#if 0
@@ -581,843 +587,822 @@ WORD(translatecomments)
/* turn everything not starting with a . into a comment */
-WORD(manglecomments)
+WORD (manglecomments)
{
- unsigned int idx = 0;
- string_type out;
- init_string(&out);
-
- while (at(tos, idx))
+ unsigned int idx = 0;
+ string_type out;
+ init_string (&out);
+
+ while (at (tos, idx))
{
- if (at(tos,idx) == '\n' && at(tos,idx+1) =='*')
+ if (at (tos, idx) == '\n' && at (tos, idx + 1) == '*')
{
- cattext(&out," /*");
- idx+=2;
+ cattext (&out, " /*");
+ idx += 2;
}
- else if (at(tos,idx) == '*' && at(tos,idx+1) =='}')
+ else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
{
- cattext(&out,"*/");
- idx+=2;
+ cattext (&out, "*/");
+ idx += 2;
}
- else
+ else
{
- catchar(&out, at(tos, idx));
- idx++;
+ catchar (&out, at (tos, idx));
+ idx++;
}
}
+ overwrite_string (tos, &out);
- overwrite_string(tos, &out);
-
- pc++;
-
+ pc++;
}
#endif
/* Mod tos so that only lines with leading dots remain */
static void
-DEFUN_VOID(outputdots)
+outputdots (void)
{
- unsigned int idx = 0;
- string_type out;
- init_string(&out);
-
- while (at(tos, idx))
+ unsigned int idx = 0;
+ string_type out;
+ init_string (&out);
+
+ while (at (tos, idx))
{
- if (at(tos, idx) == '\n' && at(tos, idx+1) == '.')
+ if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.')
{
char c;
idx += 2;
-
- while ((c = at(tos, idx)) && c != '\n')
+
+ while ((c = at (tos, idx)) && c != '\n')
{
- if (c == '{' && at(tos,idx+1) =='*')
+ if (c == '{' && at (tos, idx + 1) == '*')
{
- cattext(&out," /*");
- idx+=2;
+ cattext (&out, "/*");
+ idx += 2;
}
- else if (c == '*' && at(tos,idx+1) =='}')
+ else if (c == '*' && at (tos, idx + 1) == '}')
{
- cattext(&out,"*/");
- idx+=2;
+ cattext (&out, "*/");
+ idx += 2;
}
else
{
- catchar(&out, c);
- idx++;
+ catchar (&out, c);
+ idx++;
}
}
- catchar(&out,'\n');
+ catchar (&out, '\n');
}
- else
+ else
{
- idx++;
+ idx++;
}
- }
+ }
- overwrite_string(tos, &out);
- pc++;
-
+ overwrite_string (tos, &out);
+ pc++;
}
/* Find lines starting with . and | and put example around them on tos */
-WORD(courierize)
-{
- string_type out;
- unsigned int idx = 0;
- int command = 0;
-
- init_string(&out);
-
- while (at(tos, idx))
+WORD (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) == '|'))
+ if (at (tos, idx) == '\n'
+ && (at (tos, idx +1 ) == '.'
+ || at (tos, idx + 1) == '|'))
{
- cattext(&out,"\n@example\n");
- do
+ cattext (&out, "\n@example\n");
+ do
{
- idx += 2;
-
- while (at(tos, idx) && at(tos, idx)!='\n')
+ idx += 2;
+
+ while (at (tos, idx) && at (tos, idx) != '\n')
{
- if (at(tos,idx)=='{' && at(tos,idx+1) =='*')
+ if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
{
- cattext(&out," /*");
- idx+=2;
+ cattext (&out, "/*");
+ idx += 2;
}
- else if (at(tos,idx)=='*' && at(tos,idx+1) =='}')
+ else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
{
- cattext(&out,"*/");
- idx+=2;
+ cattext (&out, "*/");
+ idx += 2;
}
- else if (at(tos,idx) == '{' && !command)
+ else if (at (tos, idx) == '{' && !command)
{
- cattext(&out,"@{");
- idx++;
+ cattext (&out, "@{");
+ idx++;
}
- else if (at(tos,idx) == '}' && !command)
+ else if (at (tos, idx) == '}' && !command)
{
- cattext(&out,"@}");
- idx++;
+ cattext (&out, "@}");
+ idx++;
}
- else
+ else
{
- if (at(tos,idx) == '@')
- command = 1;
- else if (isspace((unsigned char) at(tos,idx))
- || at(tos,idx) == '}')
- command = 0;
- catchar(&out, at(tos, idx));
- idx++;
+ if (at (tos, idx) == '@')
+ command = 1;
+ else if (isspace ((unsigned char) at (tos, idx))
+ || at (tos, idx) == '}')
+ command = 0;
+ 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");
+ 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++;
+ else
+ {
+ catchar (&out, at (tos, idx));
+ idx++;
}
- }
-
- overwrite_string(tos, &out);
- pc++;
+ }
-
+ 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*/
-
-WORD(bulletize)
+WORD (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) == '*')
+ 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;
+ cattext (&out, "*");
+ idx += 2;
}
-
- else
- if (at(tos, idx) == '\n' &&
- at(tos, idx+1) == 'o' &&
- isspace((unsigned char) at(tos, idx +2)))
+ else if (at (tos, idx) == '\n'
+ && at (tos, idx + 1) == 'o'
+ && isspace ((unsigned char) at (tos, idx + 2)))
+ {
+ if (!on)
{
- if (!on)
- {
- cattext(&out,"\n@itemize @bullet\n");
- on = 1;
-
- }
- cattext(&out,"\n@item\n");
- idx+=3;
+ cattext (&out, "\n@itemize @bullet\n");
+ on = 1;
+
}
- else
+ 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')
{
- 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++;
-
+ cattext (&out, "@end itemize");
+ on = 0;
}
+ idx++;
+
}
- if (on)
+ }
+ if (on)
{
- cattext(&out,"@end itemize\n");
- }
+ cattext (&out, "@end itemize\n");
+ }
- delete_string(tos);
- *tos = out;
- pc++;
-
+ delete_string (tos);
+ *tos = out;
+ pc++;
}
/* Turn <<foo>> into @code{foo} in place at TOS*/
-
-WORD(do_fancy_stuff)
+WORD (do_fancy_stuff)
{
- unsigned int idx = 0;
- string_type out;
- init_string(&out);
- while (at(tos, idx))
+ 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)))
+ 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) != '>' )
+ /* This qualifies as a << startup. */
+ idx += 2;
+ cattext (&out, "@code{");
+ while (at (tos, idx)
+ && at (tos, idx) != '>' )
{
- catchar(&out, at(tos, idx));
- idx++;
-
+ catchar (&out, at (tos, idx));
+ idx++;
+
}
- cattext(&out,"}");
- idx+=2;
+ cattext (&out, "}");
+ idx += 2;
}
- else
+ else
{
- catchar(&out, at(tos, idx));
- idx++;
+ 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
-DEFUN( iscommand,(ptr, idx),
- string_type *ptr AND
- 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;
+ delete_string (tos);
+ *tos = out;
+ pc++;
}
+/* A command is all upper case,and alone on a line. */
static int
-DEFUN(copy_past_newline,(ptr, idx, dst),
- string_type *ptr AND
- unsigned int idx AND
- string_type *dst)
+iscommand (ptr, idx)
+ string_type *ptr;
+ unsigned int idx;
{
- int column = 0;
+ 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;
+}
- while (at(ptr, idx) && at(ptr, idx) != '\n')
+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;
+ 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;
}
-WORD(icopy_past_newline)
+WORD (icopy_past_newline)
{
- tos++;
- check_range ();
- init_string(tos);
- idx = copy_past_newline(ptr, idx, tos);
- pc++;
+ 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 */
+ Take the string at the top of the stack, do some prettying. */
-
-WORD(kill_bogus_lines)
+WORD (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')
+ 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++;
+ 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))
+ 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++;
+ idx++;
}
-
- /* find the last non white before the nl */
+
+ /* Find the last non white before the nl. */
+ idx--;
+
+ while (idx && isspace ((unsigned char) at (tos, idx)))
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;
+ idx++;
+
+ /* Copy buffer upto last char, but blank lines before and after
+ dots don't count. */
+ sl = 1;
- while (c < idx)
+ while (c < idx)
{
- if (at(tos,c) == '\n'
- && at(tos,c+1) == '\n'
- && at(tos,c+2) == '.')
+ if (at (tos, c) == '\n'
+ && at (tos, c + 1) == '\n'
+ && at (tos, c + 2) == '.')
{
- /* Ignore two newlines before a dot*/
- c++;
+ /* Ignore two newlines before a dot. */
+ c++;
}
- else if (at(tos,c) == '.' && sl)
+ else if (at (tos, c) == '.' && sl)
{
- /* remember that this line started with a dot */
- dot=2;
+ /* remember that this line started with a dot. */
+ dot = 2;
}
- else if (at(tos,c) == '\n'
- && at(tos,c+1) == '\n'
- && dot)
+ else if (at (tos, c) == '\n'
+ && at (tos, c + 1) == '\n'
+ && dot)
{
- c++;
- /* Ignore two newlines when last line was dot */
+ c++;
+ /* Ignore two newlines when last line was dot. */
}
- catchar(&out, at(tos,c));
- if (at(tos,c) == '\n')
+ catchar (&out, at (tos, c));
+ if (at (tos, c) == '\n')
{
- sl = 1;
-
- if (dot == 2)dot=1;else dot = 0;
+ sl = 1;
+
+ if (dot == 2)
+ dot = 1;
+ else
+ dot = 0;
}
- else
- sl = 0;
-
- c++;
+ else
+ sl = 0;
+
+ c++;
}
-
- /* Append nl*/
- catchar(&out, '\n');
- pc++;
- delete_string(tos);
- *tos = out;
-
-
+
+ /* Append nl. */
+ catchar (&out, '\n');
+ pc++;
+ delete_string (tos);
+ *tos = out;
+
}
-WORD(indent)
+WORD (indent)
{
- string_type out;
- int tab = 0;
- int idx = 0;
- int ol =0;
- init_string(&out);
- while (at(tos,idx)) {
- switch (at(tos,idx))
+ 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))
{
- 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;
+ 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;
+ pc++;
+ delete_string (tos);
+ *tos = out;
}
-
-WORD(get_stuff_in_command)
+WORD (get_stuff_in_command)
{
- tos++;
- check_range ();
- init_string(tos);
+ tos++;
+ check_range ();
+ init_string (tos);
- while (at(ptr, idx)) {
- if (iscommand(ptr, idx)) break;
- idx = copy_past_newline(ptr, idx, tos);
- }
- pc++;
+ while (at (ptr, idx))
+ {
+ if (iscommand (ptr, idx))
+ break;
+ idx = copy_past_newline (ptr, idx, tos);
+ }
+ pc++;
}
-WORD(swap)
+WORD (swap)
{
- string_type t;
-
- t = tos[0];
- tos[0] = tos[-1];
- tos[-1] =t;
- pc++;
-
+ string_type t;
+
+ t = tos[0];
+ tos[0] = tos[-1];
+ tos[-1] = t;
+ pc++;
}
-WORD(other_dup)
+WORD (other_dup)
{
- tos++;
- check_range ();
- init_string(tos);
- catstr(tos, tos-1);
- pc++;
+ tos++;
+ check_range ();
+ init_string (tos);
+ catstr (tos, tos - 1);
+ pc++;
}
-WORD(drop)
+WORD (drop)
{
tos--;
check_range ();
pc++;
}
-WORD(idrop)
+WORD (idrop)
{
isp--;
icheck_range ();
pc++;
}
-WORD(icatstr)
+WORD (icatstr)
{
- tos--;
- check_range ();
- catstr(tos, tos+1);
- delete_string(tos+1);
- pc++;
+ tos--;
+ check_range ();
+ catstr (tos, tos + 1);
+ delete_string (tos + 1);
+ pc++;
}
-WORD(skip_past_newline)
+WORD (skip_past_newline)
{
- while (at(ptr,idx)
- && at(ptr,idx) != '\n')
- idx++;
+ while (at (ptr, idx)
+ && at (ptr, idx) != '\n')
idx++;
- pc++;
+ idx++;
+ pc++;
}
-
-WORD(internalmode)
+WORD (internalmode)
{
- internal_mode = *(isp);
- isp--;
- icheck_range ();
- pc++;
+ internal_mode = *(isp);
+ isp--;
+ icheck_range ();
+ pc++;
}
-WORD(maybecatstr)
+WORD (maybecatstr)
{
- if (internal_wanted == internal_mode)
+ if (internal_wanted == internal_mode)
{
- catstr(tos-1, tos);
+ catstr (tos - 1, tos);
}
- delete_string(tos);
- tos--;
- check_range ();
- pc++;
+ delete_string (tos);
+ tos--;
+ check_range ();
+ pc++;
}
char *
-DEFUN(nextword,(string, word),
- char *string AND
- 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))
+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++;
- length++;
-
+
+ }
+ else
+ {
+ string++;
}
}
-
- *word = malloc(length + 1);
-
- dst = *word;
- src = word_start;
-
+ if (!*string)
+ return 0;
- for (idx= 0; idx < length; idx++)
- {
- if (src[idx] == '\\')
- switch (src[idx+1])
+ word_start = string;
+ if (*string == '"')
+ {
+ do
+ {
+ string++;
+ length++;
+ if (*string == '\\')
{
- case 'n':
- *dst++ = '\n';
- idx++;
- break;
- case '"':
- case '\\':
- *dst++ = src[idx+1];
- idx++;
- break;
- default:
- *dst++ = '\\';
- break;
+ string += 2;
+ length += 2;
}
- else
- *dst++ = src[idx];
+ }
+ while (*string != '"');
}
- *dst++ = 0;
+ 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;
-
+ if (*string)
+ return string + 1;
+ else
+ return 0;
}
+
dict_type *root;
+
dict_type *
-DEFUN(lookup_word,(word),
- char *word)
+lookup_word (word)
+ char *word;
{
dict_type *ptr = root;
- while (ptr) {
- if (strcmp(ptr->word, word) == 0) return ptr;
+ while (ptr)
+ {
+ if (strcmp (ptr->word, word) == 0)
+ return ptr;
ptr = ptr->next;
-
}
if (warning)
- fprintf(stderr,"Can't find %s\n",word);
+ fprintf (stderr, "Can't find %s\n", word);
return 0;
-
-
}
-static void DEFUN_VOID(perform)
+static void
+perform (void)
{
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);
+ while (at (ptr, idx))
+ {
+ /* It's worth looking through the command list. */
+ if (iscommand (ptr, idx))
+ {
+ char *next;
+ dict_type *word;
- word = lookup_word(next);
+ (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 ();
+ }
- if (word)
- {
- exec(word);
}
- else
- {
- if (warning)
- fprintf(stderr,"warning, %s is not recognised\n", next);
- skip_past_newline();
- }
-
- }
- else skip_past_newline();
-
+ else
+ skip_past_newline ();
}
}
dict_type *
-DEFUN(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;
-
+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
-DEFUN(add_to_definition,(entry, word),
- dict_type *entry AND
- stinst_type word)
+add_to_definition (entry, word)
+ dict_type *entry;
+ stinst_type word;
{
- if (entry->code_end == entry->code_length)
+ 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_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++;
-}
-
-
-
-
-
+ entry->code[entry->code_end] = word;
+ return entry->code_end++;
+}
void
-DEFUN(add_intrinsic,(name, func),
- char *name AND
- void (*func)())
+add_intrinsic (name, func)
+ char *name;
+ void (*func) ();
{
- dict_type *new = newentry(name);
- add_to_definition(new, func);
- add_to_definition(new, 0);
+ dict_type *new = newentry (name);
+ add_to_definition (new, func);
+ add_to_definition (new, 0);
}
void
-DEFUN(add_var,(name),
- char *name)
+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);
+ 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
-DEFUN(compile, (string),
- char *string)
+void
+compile (string)
+ char *string;
{
- /* add words to the dictionary */
- char *word;
- string = nextword(string, &word);
- while (string && *string && word[0])
+ /* Add words to the dictionary. */
+ char *word;
+ string = nextword (string, &word);
+ while (string && *string && word[0])
{
- if (strcmp(word,"var")==0)
+ if (strcmp (word, "var") == 0)
{
- string=nextword(string, &word);
-
- add_var(word);
- string=nextword(string, &word);
+ string = nextword (string, &word);
+
+ add_var (word);
+ string = nextword (string, &word);
}
-else
-
- if (word[0] == ':')
+ 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] != ';' )
+ 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);
+ 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);
+ add_to_definition (ptr, 0);
+ string = nextword (string, &word);
}
- else
+ else
{
- fprintf(stderr,"syntax error at %s\n",string-1);
- }
+ fprintf (stderr, "syntax error at %s\n", string - 1);
+ }
}
-
}
-
-static void DEFUN_VOID(bang)
+static void
+bang (void)
{
- *(long *)((isp[0])) = isp[-1];
- isp-=2;
+ *(long *) ((isp[0])) = isp[-1];
+ isp -= 2;
icheck_range ();
pc++;
}
-WORD(atsign)
+WORD (atsign)
{
- isp[0] = *(long *)(isp[0]);
- pc++;
+ isp[0] = *(long *) (isp[0]);
+ pc++;
}
-WORD(hello)
+WORD (hello)
{
- printf("hello\n");
- pc++;
+ printf ("hello\n");
+ pc++;
}
-WORD(stdout_)
+WORD (stdout_)
{
isp++;
icheck_range ();
@@ -1425,7 +1410,7 @@ WORD(stdout_)
pc++;
}
-WORD(stderr_)
+WORD (stderr_)
{
isp++;
icheck_range ();
@@ -1433,7 +1418,7 @@ WORD(stderr_)
pc++;
}
-WORD(print)
+WORD (print)
{
if (*isp == 1)
write_buffer (tos, stdout);
@@ -1448,29 +1433,29 @@ WORD(print)
pc++;
}
-
-static void DEFUN(read_in, (str, file),
- string_type *str AND
- FILE *file)
+static void
+read_in (str, file)
+ string_type *str;
+ FILE *file;
{
- char buff[10000];
- unsigned int r;
- do
+ char buff[10000];
+ unsigned int r;
+ do
{
- r = fread(buff, 1, sizeof(buff), file);
- catbuf(str, buff, r);
+ r = fread (buff, 1, sizeof (buff), file);
+ catbuf (str, buff, r);
}
- while (r);
- buff[0] = 0;
-
- catbuf(str, buff,1);
-}
+ while (r);
+ buff[0] = 0;
+ catbuf (str, buff, 1);
+}
-static void DEFUN_VOID(usage)
+static void
+usage (void)
{
- fprintf(stderr,"usage: -[d|i|g] <file >file\n");
- exit(33);
+ fprintf (stderr, "usage: -[d|i|g] <file >file\n");
+ exit (33);
}
/* There is no reliable way to declare exit. Sometimes it returns
@@ -1484,95 +1469,98 @@ chew_exit ()
exit (0);
}
-int DEFUN(main,(ac,av),
-int ac AND
-char *av[])
+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;
+ 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 );
+
+ 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] == '-')
+ 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][1] == 'f')
- {
- string_type b;
- FILE *f;
- init_string(&b);
-
- f = fopen(av[i+1],"r");
- if (!f)
+ if (av[i][0] == '-')
{
- fprintf(stderr,"Can't open the input file %s\n",av[i+1]);
- return 33;
- }
+ if (av[i][1] == 'f')
+ {
+ string_type b;
+ FILE *f;
+ init_string (&b);
- 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 ();
+ 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);
+ write_buffer (stack + 0, stdout);
if (tos != stack)
{
- fprintf (stderr, "finishing with current stack level %d\n", tos - stack);
+ fprintf (stderr, "finishing with current stack level %d\n",
+ tos - stack);
return 1;
}
return 0;
diff --git a/contrib/binutils/bfd/doc/coffcode.texi b/contrib/binutils/bfd/doc/coffcode.texi
index fcb7e75..8406a04 100644
--- a/contrib/binutils/bfd/doc/coffcode.texi
+++ b/contrib/binutils/bfd/doc/coffcode.texi
@@ -365,6 +365,8 @@ dependent COFF routines:
boolean _bfd_coff_long_filenames;
boolean _bfd_coff_long_section_names;
unsigned int _bfd_coff_default_section_alignment_power;
+ boolean _bfd_coff_force_symnames_in_strings;
+ unsigned int _bfd_coff_debug_string_prefix_length;
void (*_bfd_coff_swap_filehdr_in) PARAMS ((
bfd *abfd,
PTR ext,
@@ -467,12 +469,12 @@ dependent COFF routines:
struct bfd_link_info *info,
bfd *abfd,
const char *name,
- flagword flags,
+ flagword flags,
asection *section,
bfd_vma value,
const char *string,
boolean copy,
- boolean collect,
+ boolean collect,
struct bfd_link_hash_entry **hashp));
boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
@@ -562,6 +564,12 @@ dependent COFF routines:
#define bfd_coff_symname_in_debug(abfd, sym)\
((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
+#define bfd_coff_force_symnames_in_strings(abfd)\
+ (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
+
+#define bfd_coff_debug_string_prefix_length(abfd)\
+ (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
+
#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
((coff_backend_info (abfd)->_bfd_coff_print_aux)\
(abfd, file, base, symbol, aux, indaux))
diff --git a/contrib/binutils/bfd/doc/format.texi b/contrib/binutils/bfd/doc/format.texi
index 3281c36..a181d1c 100644
--- a/contrib/binutils/bfd/doc/format.texi
+++ b/contrib/binutils/bfd/doc/format.texi
@@ -1,6 +1,6 @@
@section File formats
A format is a BFD concept of high level file contents type. The
-formats supported by BFD are:
+formats supported by BFD are:
@itemize @bullet
@@ -43,7 +43,7 @@ matches, it is used. If not, exactly one target must recognize
the file, or an error results.
The function returns @code{true} on success, otherwise @code{false}
-with one of the following error codes:
+with one of the following error codes:
@itemize @bullet
diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi
index 7ddc900..eb87273 100644
--- a/contrib/binutils/bfd/doc/hash.texi
+++ b/contrib/binutils/bfd/doc/hash.texi
@@ -219,7 +219,7 @@ in a linker hash table entry: @code{type}, @code{written} and
@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type
@subsubsection Write other derived routines
You will want to write other routines for your new hash table,
-as well.
+as well.
You will want an initialization routine which calls the
initialization routine of the hash table you are deriving from
diff --git a/contrib/binutils/bfd/doc/libbfd.texi b/contrib/binutils/bfd/doc/libbfd.texi
index d202dc2..b4b0a14 100644
--- a/contrib/binutils/bfd/doc/libbfd.texi
+++ b/contrib/binutils/bfd/doc/libbfd.texi
@@ -40,16 +40,16 @@ To detect calling these with less than a @code{bfd_vma}, use
@code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s.
@example
- /* Byte swapping macros for user section data. */
+/* Byte swapping macros for user section data. */
#define bfd_put_8(abfd, val, ptr) \
- ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
+ ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
#define bfd_put_signed_8 \
bfd_put_8
#define bfd_get_8(abfd, ptr) \
- (*(unsigned char *)(ptr))
+ (*(unsigned char *) (ptr))
#define bfd_get_signed_8(abfd, ptr) \
- ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
+ ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
#define bfd_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
@@ -104,7 +104,7 @@ some object files keep their header records in big endian
order and their data in little endian order.
@example
- /* Byte swapping macros for file header data. */
+/* Byte swapping macros for file header data. */
#define bfd_h_put_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
diff --git a/contrib/binutils/bfd/doc/linker.texi b/contrib/binutils/bfd/doc/linker.texi
index b618156..5105cc7 100644
--- a/contrib/binutils/bfd/doc/linker.texi
+++ b/contrib/binutils/bfd/doc/linker.texi
@@ -30,7 +30,7 @@ ends which have implemented versions of these routines are
a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out
routines are used as examples throughout this section.
-@menu
+@menu
* Creating a Linker Hash Table::
* Adding Symbols to the Hash Table::
* Performing the Final Link::
diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi
index 89811d8..eb31eca 100644
--- a/contrib/binutils/bfd/doc/reloc.texi
+++ b/contrib/binutils/bfd/doc/reloc.texi
@@ -764,6 +764,16 @@ MIPS ELF relocations.
@deffnx {} BFD_RELOC_386_GOTPC
i386/elf relocations
@end deffn
+@deffn {} BFD_RELOC_X86_64_GOT32
+@deffnx {} BFD_RELOC_X86_64_PLT32
+@deffnx {} BFD_RELOC_X86_64_COPY
+@deffnx {} BFD_RELOC_X86_64_GLOB_DAT
+@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT
+@deffnx {} BFD_RELOC_X86_64_RELATIVE
+@deffnx {} BFD_RELOC_X86_64_GOTPCREL
+@deffnx {} BFD_RELOC_X86_64_32S
+x86-64/elf relocations
+@end deffn
@deffn {} BFD_RELOC_NS32K_IMM_8
@deffnx {} BFD_RELOC_NS32K_IMM_16
@deffnx {} BFD_RELOC_NS32K_IMM_32
@@ -830,6 +840,16 @@ It generally does map to one of the other relocation types.
ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
not stored in the instruction.
@end deffn
+@deffn {} BFD_RELOC_ARM_PCREL_BLX
+ARM 26 bit pc-relative branch. The lowest bit must be zero and is
+not stored in the instruction. The 2nd lowest bit comes from a 1 bit
+field in the instruction.
+@end deffn
+@deffn {} BFD_RELOC_THUMB_PCREL_BLX
+Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
+not stored in the instruction. The 2nd lowest bit comes from a 1 bit
+field in the instruction.
+@end deffn
@deffn {} BFD_RELOC_ARM_IMMEDIATE
@deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE
@deffnx {} BFD_RELOC_ARM_OFFSET_IMM
@@ -877,6 +897,13 @@ These relocs are only used within the ARM assembler. They are not
@deffnx {} BFD_RELOC_SH_CODE
@deffnx {} BFD_RELOC_SH_DATA
@deffnx {} BFD_RELOC_SH_LABEL
+@deffnx {} BFD_RELOC_SH_LOOP_START
+@deffnx {} BFD_RELOC_SH_LOOP_END
+@deffnx {} BFD_RELOC_SH_COPY
+@deffnx {} BFD_RELOC_SH_GLOB_DAT
+@deffnx {} BFD_RELOC_SH_JMP_SLOT
+@deffnx {} BFD_RELOC_SH_RELATIVE
+@deffnx {} BFD_RELOC_SH_GOTPC
Hitachi SH relocs. Not all of these appear in object files.
@end deffn
@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9
@@ -886,7 +913,7 @@ Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
be zero and is not stored in the instruction.
@end deffn
@deffn {} BFD_RELOC_ARC_B22_PCREL
-Argonaut RISC Core (ARC) relocs.
+ARC Cores relocs.
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
not stored in the instruction. The high 20 bits are installed in bits 26
through 7 of the instruction.
@@ -1060,6 +1087,29 @@ This is a 8bit DP reloc for the tms320c30, where the most
significant 8 bits of a 24 bit word are placed into the least
significant 8 bits of the opcode.
@end deffn
+@deffn {} BFD_RELOC_TIC54X_PARTLS7
+This is a 7bit reloc for the tms320c54x, where the least
+significant 7 bits of a 16 bit word are placed into the least
+significant 7 bits of the opcode.
+@end deffn
+@deffn {} BFD_RELOC_TIC54X_PARTMS9
+This is a 9bit DP reloc for the tms320c54x, where the most
+significant 9 bits of a 16 bit word are placed into the least
+significant 9 bits of the opcode.
+@end deffn
+@deffn {} BFD_RELOC_TIC54X_23
+This is an extended address 23-bit reloc for the tms320c54x.
+@end deffn
+@deffn {} BFD_RELOC_TIC54X_16_OF_23
+This is a 16-bit reloc for the tms320c54x, where the least
+significant 16 bits of a 23-bit extended address are placed into
+the opcode.
+@end deffn
+@deffn {} BFD_RELOC_TIC54X_MS7_OF_23
+This is a reloc for the tms320c54x, where the most
+significant 7 bits of a 23-bit extended address are placed into
+the opcode.
+@end deffn
@deffn {} BFD_RELOC_FR30_48
This is a 48 bit reloc for the FR30 that stores 32 bits.
@end deffn
@@ -1187,6 +1237,126 @@ describes the entry that is being used. For Rela hosts, this offset
is stored in the reloc's addend. For Rel hosts, we are forced to put
this offset in the reloc's section offset.
@end deffn
+@deffn {} BFD_RELOC_IA64_IMM14
+@deffnx {} BFD_RELOC_IA64_IMM22
+@deffnx {} BFD_RELOC_IA64_IMM64
+@deffnx {} BFD_RELOC_IA64_DIR32MSB
+@deffnx {} BFD_RELOC_IA64_DIR32LSB
+@deffnx {} BFD_RELOC_IA64_DIR64MSB
+@deffnx {} BFD_RELOC_IA64_DIR64LSB
+@deffnx {} BFD_RELOC_IA64_GPREL22
+@deffnx {} BFD_RELOC_IA64_GPREL64I
+@deffnx {} BFD_RELOC_IA64_GPREL32MSB
+@deffnx {} BFD_RELOC_IA64_GPREL32LSB
+@deffnx {} BFD_RELOC_IA64_GPREL64MSB
+@deffnx {} BFD_RELOC_IA64_GPREL64LSB
+@deffnx {} BFD_RELOC_IA64_LTOFF22
+@deffnx {} BFD_RELOC_IA64_LTOFF64I
+@deffnx {} BFD_RELOC_IA64_PLTOFF22
+@deffnx {} BFD_RELOC_IA64_PLTOFF64I
+@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB
+@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB
+@deffnx {} BFD_RELOC_IA64_FPTR64I
+@deffnx {} BFD_RELOC_IA64_FPTR32MSB
+@deffnx {} BFD_RELOC_IA64_FPTR32LSB
+@deffnx {} BFD_RELOC_IA64_FPTR64MSB
+@deffnx {} BFD_RELOC_IA64_FPTR64LSB
+@deffnx {} BFD_RELOC_IA64_PCREL21B
+@deffnx {} BFD_RELOC_IA64_PCREL21BI
+@deffnx {} BFD_RELOC_IA64_PCREL21M
+@deffnx {} BFD_RELOC_IA64_PCREL21F
+@deffnx {} BFD_RELOC_IA64_PCREL22
+@deffnx {} BFD_RELOC_IA64_PCREL60B
+@deffnx {} BFD_RELOC_IA64_PCREL64I
+@deffnx {} BFD_RELOC_IA64_PCREL32MSB
+@deffnx {} BFD_RELOC_IA64_PCREL32LSB
+@deffnx {} BFD_RELOC_IA64_PCREL64MSB
+@deffnx {} BFD_RELOC_IA64_PCREL64LSB
+@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22
+@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I
+@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB
+@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB
+@deffnx {} BFD_RELOC_IA64_SEGREL32MSB
+@deffnx {} BFD_RELOC_IA64_SEGREL32LSB
+@deffnx {} BFD_RELOC_IA64_SEGREL64MSB
+@deffnx {} BFD_RELOC_IA64_SEGREL64LSB
+@deffnx {} BFD_RELOC_IA64_SECREL32MSB
+@deffnx {} BFD_RELOC_IA64_SECREL32LSB
+@deffnx {} BFD_RELOC_IA64_SECREL64MSB
+@deffnx {} BFD_RELOC_IA64_SECREL64LSB
+@deffnx {} BFD_RELOC_IA64_REL32MSB
+@deffnx {} BFD_RELOC_IA64_REL32LSB
+@deffnx {} BFD_RELOC_IA64_REL64MSB
+@deffnx {} BFD_RELOC_IA64_REL64LSB
+@deffnx {} BFD_RELOC_IA64_LTV32MSB
+@deffnx {} BFD_RELOC_IA64_LTV32LSB
+@deffnx {} BFD_RELOC_IA64_LTV64MSB
+@deffnx {} BFD_RELOC_IA64_LTV64LSB
+@deffnx {} BFD_RELOC_IA64_IPLTMSB
+@deffnx {} BFD_RELOC_IA64_IPLTLSB
+@deffnx {} BFD_RELOC_IA64_COPY
+@deffnx {} BFD_RELOC_IA64_TPREL22
+@deffnx {} BFD_RELOC_IA64_TPREL64MSB
+@deffnx {} BFD_RELOC_IA64_TPREL64LSB
+@deffnx {} BFD_RELOC_IA64_LTOFF_TP22
+@deffnx {} BFD_RELOC_IA64_LTOFF22X
+@deffnx {} BFD_RELOC_IA64_LDXMOV
+Intel IA64 Relocations.
+@end deffn
+@deffn {} BFD_RELOC_M68HC11_HI8
+Motorola 68HC11 reloc.
+This is the 8 bits high part of an absolute address.
+@end deffn
+@deffn {} BFD_RELOC_M68HC11_LO8
+Motorola 68HC11 reloc.
+This is the 8 bits low part of an absolute address.
+@end deffn
+@deffn {} BFD_RELOC_M68HC11_3B
+Motorola 68HC11 reloc.
+This is the 3 bits of a value.
+@end deffn
+@deffn {} BFD_RELOC_CRIS_BDISP8
+@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5
+@deffnx {} BFD_RELOC_CRIS_SIGNED_6
+@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6
+@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4
+These relocs are only used within the CRIS assembler. They are not
+(at present) written to any object files.
+@end deffn
+@deffn {} BFD_RELOC_860_COPY
+@deffnx {} BFD_RELOC_860_GLOB_DAT
+@deffnx {} BFD_RELOC_860_JUMP_SLOT
+@deffnx {} BFD_RELOC_860_RELATIVE
+@deffnx {} BFD_RELOC_860_PC26
+@deffnx {} BFD_RELOC_860_PLT26
+@deffnx {} BFD_RELOC_860_PC16
+@deffnx {} BFD_RELOC_860_LOW0
+@deffnx {} BFD_RELOC_860_SPLIT0
+@deffnx {} BFD_RELOC_860_LOW1
+@deffnx {} BFD_RELOC_860_SPLIT1
+@deffnx {} BFD_RELOC_860_LOW2
+@deffnx {} BFD_RELOC_860_SPLIT2
+@deffnx {} BFD_RELOC_860_LOW3
+@deffnx {} BFD_RELOC_860_LOGOT0
+@deffnx {} BFD_RELOC_860_SPGOT0
+@deffnx {} BFD_RELOC_860_LOGOT1
+@deffnx {} BFD_RELOC_860_SPGOT1
+@deffnx {} BFD_RELOC_860_LOGOTOFF0
+@deffnx {} BFD_RELOC_860_SPGOTOFF0
+@deffnx {} BFD_RELOC_860_LOGOTOFF1
+@deffnx {} BFD_RELOC_860_SPGOTOFF1
+@deffnx {} BFD_RELOC_860_LOGOTOFF2
+@deffnx {} BFD_RELOC_860_LOGOTOFF3
+@deffnx {} BFD_RELOC_860_LOPC
+@deffnx {} BFD_RELOC_860_HIGHADJ
+@deffnx {} BFD_RELOC_860_HAGOT
+@deffnx {} BFD_RELOC_860_HAGOTOFF
+@deffnx {} BFD_RELOC_860_HAPC
+@deffnx {} BFD_RELOC_860_HIGH
+@deffnx {} BFD_RELOC_860_HIGOT
+@deffnx {} BFD_RELOC_860_HIGOTOFF
+Intel i860 Relocations.
+@end deffn
@example
diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi
index 2569590..4b0ec017 100644
--- a/contrib/binutils/bfd/doc/section.texi
+++ b/contrib/binutils/bfd/doc/section.texi
@@ -107,10 +107,10 @@ Here is the section structure:
@example
- /* This structure is used for a comdat section, as in PE. A comdat
- section is associated with a particular symbol. When the linker
- sees a comdat section, it keeps only one of the sections with a
- given name and associated with a given symbol. */
+/* This structure is used for a comdat section, as in PE. A comdat
+ section is associated with a particular symbol. When the linker
+ sees a comdat section, it keeps only one of the sections with a
+ given name and associated with a given symbol. */
struct bfd_comdat_info
@{
@@ -122,340 +122,362 @@ struct bfd_comdat_info
specific code; it is not an index into the list returned by
bfd_canonicalize_symtab. */
long symbol;
-
- /* If this section is being discarded, the linker uses this field
- to point to the input section which is being kept. */
- struct sec *sec;
@};
typedef struct sec
@{
- /* The name of the section; the name isn't a copy, the pointer is
- the same as that passed to bfd_make_section. */
+ /* The name of the section; the name isn't a copy, the pointer is
+ the same as that passed to bfd_make_section. */
+
+ const char *name;
+
+ /* A unique sequence number. */
- CONST char *name;
+ int id;
- /* Which section is it; 0..nth. */
+ /* Which section is it; 0..nth. */
- int index;
+ int index;
- /* The next section in the list belonging to the BFD, or NULL. */
+ /* The next section in the list belonging to the BFD, or NULL. */
- struct sec *next;
+ struct sec *next;
- /* The field flags contains attributes of the section. Some
- flags are read in from the object file, and some are
- synthesized from other information. */
+ /* The field flags contains attributes of the section. Some
+ flags are read in from the object file, and some are
+ synthesized from other information. */
- flagword flags;
+ flagword flags;
#define SEC_NO_FLAGS 0x000
- /* Tells the OS to allocate space for this section when loading.
- This is clear for a section containing debug information
- only. */
+ /* Tells the OS to allocate space for this section when loading.
+ This is clear for a section containing debug information only. */
#define SEC_ALLOC 0x001
- /* Tells the OS to load the section from the file when loading.
- This is clear for a .bss section. */
+ /* Tells the OS to load the section from the file when loading.
+ This is clear for a .bss section. */
#define SEC_LOAD 0x002
- /* The section contains data still to be relocated, so there is
- some relocation information too. */
+ /* The section contains data still to be relocated, so there is
+ some relocation information too. */
#define SEC_RELOC 0x004
#if 0 /* Obsolete ? */
#define SEC_BALIGN 0x008
#endif
- /* A signal to the OS that the section contains read only
- data. */
+ /* A signal to the OS that the section contains read only data. */
#define SEC_READONLY 0x010
- /* The section contains code only. */
+ /* The section contains code only. */
#define SEC_CODE 0x020
- /* The section contains data only. */
+ /* The section contains data only. */
#define SEC_DATA 0x040
- /* The section will reside in ROM. */
+ /* The section will reside in ROM. */
#define SEC_ROM 0x080
- /* The section contains constructor information. This section
- type is used by the linker to create lists of constructors and
- destructors used by @code{g++}. When a back end sees a symbol
- which should be used in a constructor list, it creates a new
- section for the type of name (e.g., @code{__CTOR_LIST__}), attaches
- the symbol to it, and builds a relocation. To build the lists
- of constructors, all the linker has to do is catenate all the
- sections called @code{__CTOR_LIST__} and relocate the data
- contained within - exactly the operations it would peform on
- standard data. */
+ /* The section contains constructor information. This section
+ type is used by the linker to create lists of constructors and
+ destructors used by @code{g++}. When a back end sees a symbol
+ which should be used in a constructor list, it creates a new
+ section for the type of name (e.g., @code{__CTOR_LIST__}), attaches
+ the symbol to it, and builds a relocation. To build the lists
+ of constructors, all the linker has to do is catenate all the
+ sections called @code{__CTOR_LIST__} and relocate the data
+ contained within - exactly the operations it would peform on
+ standard data. */
#define SEC_CONSTRUCTOR 0x100
- /* The section is a constructor, and should be placed at the
- end of the text, data, or bss section(?). */
+ /* The section is a constructor, and should be placed at the
+ end of the text, data, or bss section(?). */
#define SEC_CONSTRUCTOR_TEXT 0x1100
#define SEC_CONSTRUCTOR_DATA 0x2100
#define SEC_CONSTRUCTOR_BSS 0x3100
- /* The section has contents - a data section could be
- @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be
- @code{SEC_HAS_CONTENTS} */
+ /* The section has contents - a data section could be
+ @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be
+ @code{SEC_HAS_CONTENTS} */
#define SEC_HAS_CONTENTS 0x200
- /* An instruction to the linker to not output the section
- even if it has information which would normally be written. */
+ /* An instruction to the linker to not output the section
+ even if it has information which would normally be written. */
#define SEC_NEVER_LOAD 0x400
- /* The section is a COFF shared library section. This flag is
- only for the linker. If this type of section appears in
- the input file, the linker must copy it to the output file
- without changing the vma or size. FIXME: Although this
- was originally intended to be general, it really is COFF
- specific (and the flag was renamed to indicate this). It
- might be cleaner to have some more general mechanism to
- allow the back end to control what the linker does with
- sections. */
+ /* The section is a COFF shared library section. This flag is
+ only for the linker. If this type of section appears in
+ the input file, the linker must copy it to the output file
+ without changing the vma or size. FIXME: Although this
+ was originally intended to be general, it really is COFF
+ specific (and the flag was renamed to indicate this). It
+ might be cleaner to have some more general mechanism to
+ allow the back end to control what the linker does with
+ sections. */
#define SEC_COFF_SHARED_LIBRARY 0x800
- /* The section contains common symbols (symbols may be defined
- multiple times, the value of a symbol is the amount of
- space it requires, and the largest symbol value is the one
- used). Most targets have exactly one of these (which we
- translate to bfd_com_section_ptr), but ECOFF has two. */
+ /* The section has GOT references. This flag is only for the
+ linker, and is currently only used by the elf32-hppa back end.
+ It will be set if global offset table references were detected
+ in this section, which indicate to the linker that the section
+ contains PIC code, and must be handled specially when doing a
+ static link. */
+#define SEC_HAS_GOT_REF 0x4000
+
+ /* The section contains common symbols (symbols may be defined
+ multiple times, the value of a symbol is the amount of
+ space it requires, and the largest symbol value is the one
+ used). Most targets have exactly one of these (which we
+ translate to bfd_com_section_ptr), but ECOFF has two. */
#define SEC_IS_COMMON 0x8000
- /* The section contains only debugging information. For
- example, this is set for ELF .debug and .stab sections.
- strip tests this flag to see if a section can be
- discarded. */
+ /* The section contains only debugging information. For
+ example, this is set for ELF .debug and .stab sections.
+ strip tests this flag to see if a section can be
+ discarded. */
#define SEC_DEBUGGING 0x10000
- /* The contents of this section are held in memory pointed to
- by the contents field. This is checked by
- bfd_get_section_contents, and the data is retrieved from
- memory if appropriate. */
+ /* The contents of this section are held in memory pointed to
+ by the contents field. This is checked by bfd_get_section_contents,
+ and the data is retrieved from memory if appropriate. */
#define SEC_IN_MEMORY 0x20000
- /* The contents of this section are to be excluded by the
- linker for executable and shared objects unless those
- objects are to be further relocated. */
+ /* The contents of this section are to be excluded by the
+ linker for executable and shared objects unless those
+ objects are to be further relocated. */
#define SEC_EXCLUDE 0x40000
- /* The contents of this section are to be sorted by the
- based on the address specified in the associated symbol
- table. */
+ /* The contents of this section are to be sorted by the
+ based on the address specified in the associated symbol
+ table. */
#define SEC_SORT_ENTRIES 0x80000
- /* When linking, duplicate sections of the same name should be
- discarded, rather than being combined into a single section as
- is usually done. This is similar to how common symbols are
- handled. See SEC_LINK_DUPLICATES below. */
+ /* When linking, duplicate sections of the same name should be
+ discarded, rather than being combined into a single section as
+ is usually done. This is similar to how common symbols are
+ handled. See SEC_LINK_DUPLICATES below. */
#define SEC_LINK_ONCE 0x100000
- /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
- should handle duplicate sections. */
+ /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
+ should handle duplicate sections. */
#define SEC_LINK_DUPLICATES 0x600000
- /* This value for SEC_LINK_DUPLICATES means that duplicate
- sections with the same name should simply be discarded. */
+ /* This value for SEC_LINK_DUPLICATES means that duplicate
+ sections with the same name should simply be discarded. */
#define SEC_LINK_DUPLICATES_DISCARD 0x0
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if there are any duplicate sections, although
- it should still only link one copy. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if there are any duplicate sections, although
+ it should still only link one copy. */
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections are a different size. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections are a different size. */
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections contain different
- contents. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections contain different
+ contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
- /* This section was created by the linker as part of dynamic
- relocation or other arcane processing. It is skipped when
- going through the first-pass output, trusting that someone
- else up the line will take care of it later. */
+ /* This section was created by the linker as part of dynamic
+ relocation or other arcane processing. It is skipped when
+ going through the first-pass output, trusting that someone
+ else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x800000
- /* This section should not be subject to garbage collection. */
+ /* This section should not be subject to garbage collection. */
#define SEC_KEEP 0x1000000
- /* This section contains "short" data, and should be placed
- "near" the GP. */
+ /* This section contains "short" data, and should be placed
+ "near" the GP. */
#define SEC_SMALL_DATA 0x2000000
- /* This section contains data which may be shared with other
- executables or shared objects. */
+ /* This section contains data which may be shared with other
+ executables or shared objects. */
#define SEC_SHARED 0x4000000
- /* End of section flags. */
+ /* When a section with this flag is being linked, then if the size of
+ the input section is less than a page, it should not cross a page
+ boundary. If the size of the input section is one page or more, it
+ should be aligned on a page boundary. */
+#define SEC_BLOCK 0x8000000
+
+ /* Conditionally link this section; do not link if there are no
+ references found to any symbol in the section. */
+#define SEC_CLINK 0x10000000
+
+ /* End of section flags. */
+
+ /* Some internal packed boolean fields. */
- /* Some internal packed boolean fields. */
+ /* See the vma field. */
+ unsigned int user_set_vma : 1;
- /* See the vma field. */
- unsigned int user_set_vma : 1;
+ /* Whether relocations have been processed. */
+ unsigned int reloc_done : 1;
- /* Whether relocations have been processed. */
- unsigned int reloc_done : 1;
+ /* A mark flag used by some of the linker backends. */
+ unsigned int linker_mark : 1;
- /* A mark flag used by some of the linker backends. */
- unsigned int linker_mark : 1;
+ /* A mark flag used by some linker backends for garbage collection. */
+ unsigned int gc_mark : 1;
- /* A mark flag used by some linker backends for garbage collection. */
- unsigned int gc_mark : 1;
+ /* Used by the ELF code to mark sections which have been allocated to segments. */
+ unsigned int segment_mark : 1;
- /* End of internal packed boolean fields. */
+ /* End of internal packed boolean fields. */
- /* The virtual memory address of the section - where it will be
- at run time. The symbols are relocated against this. The
- user_set_vma flag is maintained by bfd; if it's not set, the
- backend can assign addresses (for example, in @code{a.out}, where
- the default address for @code{.data} is dependent on the specific
- target and various flags). */
+ /* The virtual memory address of the section - where it will be
+ at run time. The symbols are relocated against this. The
+ user_set_vma flag is maintained by bfd; if it's not set, the
+ backend can assign addresses (for example, in @code{a.out}, where
+ the default address for @code{.data} is dependent on the specific
+ target and various flags). */
- bfd_vma vma;
+ bfd_vma vma;
- /* The load address of the section - where it would be in a
- rom image; really only used for writing section header
- information. */
+ /* The load address of the section - where it would be in a
+ rom image; really only used for writing section header
+ information. */
- bfd_vma lma;
+ bfd_vma lma;
- /* The size of the section in octets, as it will be output.
- Contains a value even if the section has no contents (e.g., the
- size of @code{.bss}). This will be filled in after relocation. */
+ /* The size of the section in octets, as it will be output.
+ Contains a value even if the section has no contents (e.g., the
+ size of @code{.bss}). This will be filled in after relocation. */
- bfd_size_type _cooked_size;
+ bfd_size_type _cooked_size;
- /* The original size on disk of the section, in octets. Normally this
- value is the same as the size, but if some relaxing has
- been done, then this value will be bigger. */
+ /* The original size on disk of the section, in octets. Normally this
+ value is the same as the size, but if some relaxing has
+ been done, then this value will be bigger. */
- bfd_size_type _raw_size;
+ bfd_size_type _raw_size;
- /* If this section is going to be output, then this value is the
- offset in *bytes* into the output section of the first byte in the
- input section (byte ==> smallest addressable unit on the
- target). In most cases, if this was going to start at the
- 100th octet (8-bit quantity) in the output section, this value
- would be 100. However, if the target byte size is 16 bits
- (bfd_octets_per_byte is "2"), this value would be 50. */
+ /* If this section is going to be output, then this value is the
+ offset in *bytes* into the output section of the first byte in the
+ input section (byte ==> smallest addressable unit on the
+ target). In most cases, if this was going to start at the
+ 100th octet (8-bit quantity) in the output section, this value
+ would be 100. However, if the target byte size is 16 bits
+ (bfd_octets_per_byte is "2"), this value would be 50. */
- bfd_vma output_offset;
+ bfd_vma output_offset;
- /* The output section through which to map on output. */
+ /* The output section through which to map on output. */
- struct sec *output_section;
+ struct sec *output_section;
- /* The alignment requirement of the section, as an exponent of 2 -
- e.g., 3 aligns to 2^3 (or 8). */
+ /* The alignment requirement of the section, as an exponent of 2 -
+ e.g., 3 aligns to 2^3 (or 8). */
- unsigned int alignment_power;
+ unsigned int alignment_power;
- /* If an input section, a pointer to a vector of relocation
- records for the data in this section. */
+ /* If an input section, a pointer to a vector of relocation
+ records for the data in this section. */
- struct reloc_cache_entry *relocation;
+ struct reloc_cache_entry *relocation;
- /* If an output section, a pointer to a vector of pointers to
- relocation records for the data in this section. */
+ /* If an output section, a pointer to a vector of pointers to
+ relocation records for the data in this section. */
- struct reloc_cache_entry **orelocation;
+ struct reloc_cache_entry **orelocation;
- /* The number of relocation records in one of the above */
+ /* The number of relocation records in one of the above */
- unsigned reloc_count;
+ unsigned reloc_count;
- /* Information below is back end specific - and not always used
- or updated. */
+ /* Information below is back end specific - and not always used
+ or updated. */
- /* File position of section data */
+ /* File position of section data. */
- file_ptr filepos;
+ file_ptr filepos;
- /* File position of relocation info */
+ /* File position of relocation info. */
- file_ptr rel_filepos;
+ file_ptr rel_filepos;
- /* File position of line data */
+ /* File position of line data. */
- file_ptr line_filepos;
+ file_ptr line_filepos;
- /* Pointer to data for applications */
+ /* Pointer to data for applications. */
- PTR userdata;
+ PTR userdata;
- /* If the SEC_IN_MEMORY flag is set, this points to the actual
- contents. */
- unsigned char *contents;
+ /* If the SEC_IN_MEMORY flag is set, this points to the actual
+ contents. */
+ unsigned char *contents;
- /* Attached line number information */
+ /* Attached line number information. */
- alent *lineno;
+ alent *lineno;
- /* Number of line number records */
+ /* Number of line number records. */
- unsigned int lineno_count;
+ unsigned int lineno_count;
- /* Optional information about a COMDAT entry; NULL if not COMDAT */
+ /* Optional information about a COMDAT entry; NULL if not COMDAT. */
- struct bfd_comdat_info *comdat;
+ struct bfd_comdat_info *comdat;
- /* When a section is being output, this value changes as more
- linenumbers are written out */
+ /* Points to the kept section if this section is a link-once section,
+ and is discarded. */
+ struct sec *kept_section;
- file_ptr moving_line_filepos;
+ /* When a section is being output, this value changes as more
+ linenumbers are written out. */
- /* What the section number is in the target world */
+ file_ptr moving_line_filepos;
- int target_index;
+ /* What the section number is in the target world. */
- PTR used_by_bfd;
+ int target_index;
- /* If this is a constructor section then here is a list of the
- relocations created to relocate items within it. */
+ PTR used_by_bfd;
- struct relent_chain *constructor_chain;
+ /* If this is a constructor section then here is a list of the
+ relocations created to relocate items within it. */
- /* The BFD which owns the section. */
+ struct relent_chain *constructor_chain;
- bfd *owner;
+ /* The BFD which owns the section. */
- /* A symbol which points at this section only */
- struct symbol_cache_entry *symbol;
- struct symbol_cache_entry **symbol_ptr_ptr;
+ bfd *owner;
- struct bfd_link_order *link_order_head;
- struct bfd_link_order *link_order_tail;
+ /* A symbol which points at this section only */
+ struct symbol_cache_entry *symbol;
+ struct symbol_cache_entry **symbol_ptr_ptr;
+
+ struct bfd_link_order *link_order_head;
+ struct bfd_link_order *link_order_tail;
@} asection ;
- /* These sections are global, and are managed by BFD. The application
- and target back end are not permitted to change the values in
- these sections. New code should use the section_ptr macros rather
- than referring directly to the const sections. The const sections
- may eventually vanish. */
+/* These sections are global, and are managed by BFD. The application
+ and target back end are not permitted to change the values in
+ these sections. New code should use the section_ptr macros rather
+ than referring directly to the const sections. The const sections
+ may eventually vanish. */
#define BFD_ABS_SECTION_NAME "*ABS*"
#define BFD_UND_SECTION_NAME "*UND*"
#define BFD_COM_SECTION_NAME "*COM*"
#define BFD_IND_SECTION_NAME "*IND*"
- /* the absolute section */
+/* the absolute section */
extern const asection bfd_abs_section;
#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
- /* Pointer to the undefined section */
+/* Pointer to the undefined section */
extern const asection bfd_und_section;
#define bfd_und_section_ptr ((asection *) &bfd_und_section)
#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
- /* Pointer to the common section */
+/* Pointer to the common section */
extern const asection bfd_com_section;
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
- /* Pointer to the indirect section */
+/* Pointer to the indirect section */
extern const asection bfd_ind_section;
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
@@ -480,7 +502,7 @@ These are the functions exported by the section handling part of BFD.
@subsubsection @code{bfd_get_section_by_name}
@strong{Synopsis}
@example
-asection *bfd_get_section_by_name(bfd *abfd, CONST char *name);
+asection *bfd_get_section_by_name(bfd *abfd, const char *name);
@end example
@strong{Description}@*
Run through @var{abfd} and return the one of the
@@ -492,11 +514,26 @@ all sections of a given name is to use @code{bfd_map_over_sections} and
@code{strcmp} on the name (or better yet, base it on the section flags
or something else) for each section.
+@findex bfd_get_unique_section_name
+@subsubsection @code{bfd_get_unique_section_name}
+@strong{Synopsis}
+@example
+char *bfd_get_unique_section_name(bfd *abfd,
+ const char *templat,
+ int *count);
+@end example
+@strong{Description}@*
+Invent a section name that is unique in @var{abfd} by tacking
+a dot and a digit suffix onto the original @var{templat}. If
+@var{count} is non-NULL, then it specifies the first number
+tried as a suffix to generate a unique name. The value
+pointed to by @var{count} will be incremented in this case.
+
@findex bfd_make_section_old_way
@subsubsection @code{bfd_make_section_old_way}
@strong{Synopsis}
@example
-asection *bfd_make_section_old_way(bfd *abfd, CONST char *name);
+asection *bfd_make_section_old_way(bfd *abfd, const char *name);
@end example
@strong{Description}@*
Create a new empty section called @var{name}
@@ -523,7 +560,7 @@ If memory allocation fails.
@subsubsection @code{bfd_make_section_anyway}
@strong{Synopsis}
@example
-asection *bfd_make_section_anyway(bfd *abfd, CONST char *name);
+asection *bfd_make_section_anyway(bfd *abfd, const char *name);
@end example
@strong{Description}@*
Create a new empty section called @var{name} and attach it to the end of
@@ -543,7 +580,7 @@ Return @code{NULL} and set @code{bfd_error} on error; possible errors are:
@subsubsection @code{bfd_make_section}
@strong{Synopsis}
@example
-asection *bfd_make_section(bfd *, CONST char *name);
+asection *bfd_make_section(bfd *, const char *name);
@end example
@strong{Description}@*
Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling
@@ -576,7 +613,7 @@ have the @code{SEC_HAS_CONTENTS} field set.
@strong{Synopsis}
@example
void bfd_map_over_sections(bfd *abfd,
- void (*func)(bfd *abfd,
+ void (*func) (bfd *abfd,
asection *sect,
PTR obj),
PTR obj);
diff --git a/contrib/binutils/bfd/doc/syms.texi b/contrib/binutils/bfd/doc/syms.texi
index 74c151b..400a106 100644
--- a/contrib/binutils/bfd/doc/syms.texi
+++ b/contrib/binutils/bfd/doc/syms.texi
@@ -376,8 +376,8 @@ class of @var{symbol}, or '?' for an unknown class.
@example
int bfd_decode_symclass(asymbol *symbol);
@end example
-@findex bfd_is_undefined_symclass
-@subsubsection @code{bfd_is_undefined_symclass }
+@findex bfd_is_undefined_symclass
+@subsubsection @code{bfd_is_undefined_symclass}
@strong{Description}@*
Returns non-zero if the class symbol returned by
bfd_decode_symclass represents an undefined symbol.
diff --git a/contrib/binutils/bfd/doc/targets.texi b/contrib/binutils/bfd/doc/targets.texi
index 50086c4..0526faf 100644
--- a/contrib/binutils/bfd/doc/targets.texi
+++ b/contrib/binutils/bfd/doc/targets.texi
@@ -7,7 +7,7 @@ of a target back end. All the back end provides to the root
part of BFD is a structure containing pointers to functions
which perform certain low level operations on files. BFD
translates the applications's requests through a pointer into
-calls to the back end routines.
+calls to the back end routines.
When a file is opened with @code{bfd_openr}, its format and
target are unknown. BFD uses various mechanisms to determine
@@ -18,12 +18,12 @@ how to interpret the file. The operations performed are:
@item
Create a BFD by calling the internal routine
@code{_bfd_new_bfd}, then call @code{bfd_find_target} with the
-target string supplied to @code{bfd_openr} and the new BFD pointer.
+target string supplied to @code{bfd_openr} and the new BFD pointer.
@item
If a null target string was provided to @code{bfd_find_target},
look up the environment variable @code{GNUTARGET} and use
-that as the target string.
+that as the target string.
@item
If the target string is still @code{NULL}, or the target string is
@@ -35,7 +35,7 @@ cause @code{bfd_check_format} to loop through all the targets.
@item
Otherwise, inspect the elements in the target vector
one by one, until a match on target name is found. When found,
-use it.
+use it.
@item
Otherwise return the error @code{bfd_error_invalid_target} to
@@ -47,7 +47,7 @@ Otherwise return the error @code{bfd_error_invalid_target} to
@end itemize
Once the BFD has been opened and the target selected, the file
format may be determined. This is done by calling
-@code{bfd_check_format} on the BFD with a suggested format.
+@code{bfd_check_format} on the BFD with a suggested format.
If @code{target_defaulted} has been set, each possible target
type is tried to see if it recognizes the specified format.
@code{bfd_check_format} returns @code{true} when the caller guesses right.
@@ -63,17 +63,17 @@ type is tried to see if it recognizes the specified format.
@strong{Description}@*
This structure contains everything that BFD knows about a
target. It includes things like its byte order, name, and which
-routines to call to do various operations.
+routines to call to do various operations.
Every BFD points to a target structure with its @code{xvec}
-member.
+member.
The macros below are used to dispatch to functions through the
@code{bfd_target} vector. They are used in a number of macros further
down in @file{bfd.h}, and are also used when calling various
routines by hand inside the BFD implementation. The @var{arglist}
argument must be parenthesized; it contains all the arguments
-to the called function.
+to the called function.
They make the documentation (more) unpleasant to read, so if
someone wants to fix this and not break the above, please do.
@@ -92,13 +92,13 @@ someone wants to fix this and not break the above, please do.
For operations which index on the BFD format:
@example
#define BFD_SEND_FMT(bfd, message, arglist) \
- (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
+ (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND_FMT
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
- (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \
+ (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
@end example
@@ -109,13 +109,14 @@ defines one of these.
FIXME, these names should be rationalised with the names of
the entry points which call them. Too bad we can't have one
-macro to define them both!
+macro to define them both!
@example
enum bfd_flavour @{
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
+ bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
@@ -133,7 +134,7 @@ enum bfd_flavour @{
enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @};
- /* Forward declaration. */
+/* Forward declaration. */
typedef struct bfd_link_info _bfd_link_info;
typedef struct bfd_target
@@ -159,21 +160,21 @@ The order of bytes within the header parts of a file.
A mask of all the flags which an executable may have set -
from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}.
@example
- flagword object_flags;
+ flagword object_flags;
@end example
A mask of all the flags which a section may have set - from
the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}.
@example
flagword section_flags;
@end example
-The character normally found at the front of a symbol
+The character normally found at the front of a symbol
(if any), perhaps `_'.
@example
char symbol_leading_char;
@end example
The pad character for file names within an archive header.
@example
- char ar_pad_char;
+ char ar_pad_char;
@end example
The maximum number of characters in an archive header.
@example
@@ -208,15 +209,15 @@ Byte swapping for the headers
Format dependent routines: these are vectors of entry points
within the target vector structure, one for each format to check.
-Check the format of a file being read. Return a @code{bfd_target *} or zero.
+Check the format of a file being read. Return a @code{bfd_target *} or zero.
@example
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
@end example
-Set the format of a file being written.
+Set the format of a file being written.
@example
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
@end example
-Write cached information into a file being written, at @code{bfd_close}.
+Write cached information into a file being written, at @code{bfd_close}.
@example
boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
@end example
@@ -224,7 +225,7 @@ The general target vector. These vectors are initialized using the
BFD_JUMP_TABLE macros.
@example
- /* Generic entry points. */
+ /* Generic entry points. */
#define BFD_JUMP_TABLE_GENERIC(NAME)\
CAT(NAME,_close_and_cleanup),\
CAT(NAME,_bfd_free_cached_info),\
@@ -232,20 +233,20 @@ CAT(NAME,_new_section_hook),\
CAT(NAME,_get_section_contents),\
CAT(NAME,_get_section_contents_in_window)
- /* Called when the BFD is being closed to do any necessary cleanup. */
+ /* Called when the BFD is being closed to do any necessary cleanup. */
boolean (*_close_and_cleanup) PARAMS ((bfd *));
- /* Ask the BFD to free all cached information. */
+ /* Ask the BFD to free all cached information. */
boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
- /* Called when a new section is created. */
+ /* Called when a new section is created. */
boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
- /* Read the contents of a section. */
- boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
+ /* Read the contents of a section. */
+ boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
file_ptr, bfd_size_type));
boolean (*_bfd_get_section_contents_in_window)
PARAMS ((bfd *, sec_ptr, bfd_window *,
file_ptr, bfd_size_type));
- /* Entry points to copy private data. */
+ /* Entry points to copy private data. */
#define BFD_JUMP_TABLE_COPY(NAME)\
CAT(NAME,_bfd_copy_private_bfd_data),\
CAT(NAME,_bfd_merge_private_bfd_data),\
@@ -253,27 +254,27 @@ CAT(NAME,_bfd_copy_private_section_data),\
CAT(NAME,_bfd_copy_private_symbol_data),\
CAT(NAME,_bfd_set_private_flags),\
CAT(NAME,_bfd_print_private_bfd_data)\
- /* Called to copy BFD general private data from one object file
+ /* Called to copy BFD general private data from one object file
to another. */
boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
- /* Called to merge BFD general private data from one object file
+ /* Called to merge BFD general private data from one object file
to a common output file when linking. */
boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
- /* Called to copy BFD private section data from one object file
+ /* Called to copy BFD private section data from one object file
to another. */
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
bfd *, sec_ptr));
- /* Called to copy BFD private symbol data from one symbol
+ /* Called to copy BFD private symbol data from one symbol
to another. */
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
bfd *, asymbol *));
- /* Called to set private backend flags */
+ /* Called to set private backend flags */
boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
- /* Called to print private BFD data */
+ /* Called to print private BFD data */
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
- /* Core file entry points. */
+ /* Core file entry points. */
#define BFD_JUMP_TABLE_CORE(NAME)\
CAT(NAME,_core_file_failing_command),\
CAT(NAME,_core_file_failing_signal),\
@@ -282,7 +283,7 @@ CAT(NAME,_core_file_matches_executable_p)
int (*_core_file_failing_signal) PARAMS ((bfd *));
boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
- /* Archive entry points. */
+ /* Archive entry points. */
#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
CAT(NAME,_slurp_armap),\
CAT(NAME,_slurp_extended_name_table),\
@@ -299,10 +300,10 @@ CAT(NAME,_update_armap_timestamp)
boolean (*_bfd_construct_extended_name_table)
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
- boolean (*write_armap) PARAMS ((bfd *arch,
+ boolean (*write_armap) PARAMS ((bfd *arch,
unsigned int elength,
struct orl *map,
- unsigned int orl_count,
+ unsigned int orl_count,
int stridx));
PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
@@ -311,7 +312,7 @@ CAT(NAME,_update_armap_timestamp)
int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
- /* Entry points used for symbols. */
+ /* Entry points used for symbols. */
#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
CAT(NAME,_get_symtab_upper_bound),\
CAT(NAME,_get_symtab),\
@@ -344,7 +345,7 @@ CAT(NAME,_minisymbol_to_symbol)
struct sec *section, struct symbol_cache_entry **symbols,
bfd_vma offset, CONST char **file, CONST char **func,
unsigned int *line));
- /* Back-door to allow format-aware applications to create debug symbols
+ /* Back-door to allow format-aware applications to create debug symbols
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
asymbol * (*_bfd_make_debug_symbol) PARAMS ((
@@ -360,7 +361,7 @@ CAT(NAME,_minisymbol_to_symbol)
asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
asymbol *));
- /* Routines for relocs. */
+ /* Routines for relocs. */
#define BFD_JUMP_TABLE_RELOCS(NAME)\
CAT(NAME,_get_reloc_upper_bound),\
CAT(NAME,_canonicalize_reloc),\
@@ -368,12 +369,12 @@ CAT(NAME,_bfd_reloc_type_lookup)
long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
struct symbol_cache_entry **));
- /* See documentation on reloc types. */
+ /* See documentation on reloc types. */
reloc_howto_type *
(*reloc_type_lookup) PARAMS ((bfd *abfd,
bfd_reloc_code_real_type code));
- /* Routines used when writing an object file. */
+ /* Routines used when writing an object file. */
#define BFD_JUMP_TABLE_WRITE(NAME)\
CAT(NAME,_set_arch_mach),\
CAT(NAME,_set_section_contents)
@@ -382,7 +383,7 @@ CAT(NAME,_set_section_contents)
boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
file_ptr, bfd_size_type));
- /* Routines used by the linker. */
+ /* Routines used by the linker. */
#define BFD_JUMP_TABLE_LINK(NAME)\
CAT(NAME,_sizeof_headers),\
CAT(NAME,_bfd_get_relocated_section_contents),\
@@ -401,37 +402,37 @@ CAT(NAME,_bfd_gc_sections)
boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
struct bfd_link_info *, boolean *again));
- /* Create a hash table for the linker. Different backends store
+ /* Create a hash table for the linker. Different backends store
different information in this table. */
struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
- /* Add symbols from this object file into the hash table. */
+ /* Add symbols from this object file into the hash table. */
boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
- /* Do a link based on the link_order structures attached to each
+ /* Do a link based on the link_order structures attached to each
section of the BFD. */
boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
- /* Should this section be split up into smaller pieces during linking. */
+ /* Should this section be split up into smaller pieces during linking. */
boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
- /* Remove sections that are not referenced from the output. */
+ /* Remove sections that are not referenced from the output. */
boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
- /* Routines to handle dynamic symbols and relocs. */
+ /* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
CAT(NAME,_get_dynamic_symtab_upper_bound),\
CAT(NAME,_canonicalize_dynamic_symtab),\
CAT(NAME,_get_dynamic_reloc_upper_bound),\
CAT(NAME,_canonicalize_dynamic_reloc)
- /* Get the amount of memory required to hold the dynamic symbols. */
+ /* Get the amount of memory required to hold the dynamic symbols. */
long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
- /* Read in the dynamic symbols. */
+ /* Read in the dynamic symbols. */
long (*_bfd_canonicalize_dynamic_symtab)
PARAMS ((bfd *, struct symbol_cache_entry **));
- /* Get the amount of memory required to hold the dynamic relocs. */
+ /* Get the amount of memory required to hold the dynamic relocs. */
long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
- /* Read in the dynamic relocs. */
+ /* Read in the dynamic relocs. */
long (*_bfd_canonicalize_dynamic_reloc)
PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
@@ -442,15 +443,15 @@ and little endian code, and target chosen by the linker has the wrong
endianness. The function open_output() in ld/ldlang.c uses this field
to find an alternative output format that is suitable.
@example
- /* Opposite endian version of this target. */
+ /* Opposite endian version of this target. */
const struct bfd_target * alternative_target;
-
+
@end example
Data for use by back-end routines, which isn't generic enough to belong
in this structure.
@example
PTR backend_data;
-
+
@} bfd_target;
@end example
@@ -497,7 +498,7 @@ modify the names.
@subsubsection @code{bfd_seach_for_target}
@strong{Synopsis}
@example
-const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *);
+const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);
@end example
@strong{Description}@*
Return a pointer to the first transfer vector in the list of
OpenPOWER on IntegriCloud