1999-10-08 Ben Elliston <bje@cygnus.com>
[deliverable/binutils-gdb.git] / binutils / binutils.texi
index 535df3f6b8a0f0a16ec7119dd44e407e91e13631..c6f872d88b58b25a870d875c1acd9ed95b3fb0d7 100644 (file)
@@ -5,9 +5,22 @@
 @ifinfo
 @format
 START-INFO-DIR-ENTRY
-* Binutils: (binutils).         The GNU binary utilities "ar", "objcopy",
-                               "objdump", "nm", "nlmconv", "size", "readelf"
-                                "strings", "strip", "ranlib" and "dlltool".
+* Binutils: (binutils).         The GNU binary utilities.
+* ar: (binutils)ar.               Create, modify, and extract from archives
+* nm: (binutils)nm.               List symbols from object files
+* objcopy: (binutils)objcopy.    Copy and translate object files
+* objdump: (binutils)objdump.     Display information from object files
+* ranlib: (binutils)ranlib.       Generate index to archive contents
+* readelf: (binutils)readelf.    Display the contents of ELF format files.
+* size: (binutils)size.           List section sizes and total size
+* strings: (binutils)strings.     List printable strings from files
+* strip: (binutils)strip.         Discard symbols
+* c++filt: (binutils)c++filt.    Filter to demangle encoded C++ symbols
+* cxxfilt: (binutils)c++filt.     MS-DOS name for c++filt
+* addr2line: (binutils)addr2line. Convert addresses to file and line
+* nlmconv: (binutils)nlmconv.     Converts object code into an NLM
+* windres: (binutils)windres.    Manipulate Windows resources
+* dlltool: (binutils)dlltool.    Create files needed to build and use DLLs
 END-INFO-DIR-ENTRY
 @end format
 @end ifinfo
@@ -118,7 +131,8 @@ List printable strings from files
 Discard symbols
 
 @item c++filt
-Demangle encoded C++ symbols
+Demangle encoded C++ symbols (on MS-DOS, this program is named
+@code{cxxfilt})
 
 @item addr2line
 Convert addresses into file names and line numbers
@@ -145,6 +159,7 @@ Create the files needed to build and use Dynamic Link Libraries
 * strings::                     List printable strings from files
 * strip::                       Discard symbols
 * c++filt::                    Filter to demangle encoded C++ symbols
+* cxxfilt: c++filt.             MS-DOS name for c++filt
 * addr2line::                  Convert addresses to file and line
 * nlmconv::                     Converts object code into an NLM
 * windres::                    Manipulate Windows resources
@@ -161,7 +176,7 @@ Create the files needed to build and use Dynamic Link Libraries
 @cindex archives
 @cindex collections of files
 @smallexample
-ar [-]@var{p}[@var{mod} [@var{relpos}]] @var{archive} [@var{member}@dots{}]
+ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
 ar -M [ <mri-script ]
 @end smallexample
 
@@ -219,7 +234,7 @@ program.
 @section Controlling @code{ar} on the command line
 
 @smallexample
-ar [-]@var{p}[@var{mod} [@var{relpos}]] @var{archive} [@var{member}@dots{}]
+ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
 @end smallexample
 
 @cindex Unix compatibility, @code{ar}
@@ -383,12 +398,25 @@ This modifier is accepted but not used.
 @c whaffor ar l modifier??? presumably compat; with
 @c what???---doc@@cygnus.com, 25jan91 
 
+@item N
+Uses the @var{count} parameter.  This is used if there are multiple
+entries in the archive with the same name.  Extract or delete instance
+@var{count} of the given name from the archive.
+
 @item o
 @cindex dates in archive
 Preserve the @emph{original} dates of members when extracting them.  If
 you do not specify this modifier, files extracted from the archive
 are stamped with the time of extraction.
 
+@item P
+Use the full path name when matching names in the archive.  @sc{gnu}
+@code{ar} can not create an archive with a full path name (such archives
+are not POSIX complaint), but other archive creators can.  This option
+will cause @sc{gnu} @code{ar} to match file names using a complete path
+name, which can be convenient when extracting a single file from an
+archive created by another tool.
+
 @item s
 @cindex writing archive index
 Write an object-file index into the archive, or update an existing one,
@@ -613,7 +641,7 @@ nm [ -a | --debug-syms ]  [ -g | --extern-only ]
 @end smallexample
 
 @sc{gnu} @code{nm} lists the symbols from object files @var{objfile}@dots{}.
-If no object files are listed as arguments, @code{nm} assumes
+If no object files are listed as arguments, @code{nm} assumes the file
 @file{a.out}.
 
 For each symbol, @code{nm} shows:
@@ -703,7 +731,7 @@ equivalent.
 @cindex input file name
 @cindex file name
 @cindex source file name
-Precede each symbol by the name of the input file (or archive element)
+Precede each symbol by the name of the input file (or archive member)
 in which it was found, rather than identifying the input file once only,
 before all of its symbols.
 
@@ -880,12 +908,12 @@ the load address of the lowest section copied into the output file.
 When generating an S-record or a raw binary file, it may be helpful to
 use @samp{-S} to remove sections containing debugging information.  In
 some cases @samp{-R} will be useful to remove sections which contain
-information which is not needed by the binary file.
+information that is not needed by the binary file.
 
 @table @code
 @item @var{infile}
 @itemx @var{outfile}
-The source and output files, respectively.
+The input and output files, respectively.
 If you do not specify @var{outfile}, @code{objcopy} creates a
 temporary file and destructively renames the result with
 the name of @var{infile}.
@@ -996,7 +1024,7 @@ done by increasing the size of the last section.  The extra space is
 filled in with the value specified by @samp{--gap-fill} (default zero).
 
 @item --set-start @var{val}
-Set the address of the new file to @var{val}.  Not all object file
+Set the start address of the new file to @var{val}.  Not all object file
 formats support setting the start address.
 
 @item --change-start @var{incr}
@@ -1067,12 +1095,13 @@ if the named section does not exist.
 @item --set-section-flags @var{section}=@var{flags}
 Set the flags for the named section.  The @var{flags} argument is a
 comma separated string of flag names.  The recognized names are
-@samp{alloc}, @samp{contents}, @samp{load}, @samp{readonly},
-@samp{code}, @samp{data}, and @samp{rom}.  You can set the
-@samp{contents} flag for a section which does not have contents, but it
-is not meaningful to clear the @samp{contents} flag of a section which
-does have contents--just remove the section instead.  Not all flags are
-meaningful for all object file formats.
+@samp{alloc}, @samp{contents}, @samp{load}, @samp{noload},
+@samp{readonly}, @samp{code}, @samp{data}, @samp{rom}, @samp{share}, and
+@samp{debug}.  You can set the @samp{contents} flag for a section which
+does not have contents, but it is not meaningful to clear the
+@samp{contents} flag of a section which does have contents--just remove
+the section instead.  Not all flags are meaningful for all object file
+formats.
 
 @item --add-section @var{sectionname}=@var{filename}
 Add a new section named @var{sectionname} while copying the file.  The
@@ -1436,6 +1465,7 @@ The @sc{gnu} @code{ranlib} program is another form of @sc{gnu} @code{ar}; runnin
 @table @code
 @item -v
 @itemx -V
+@itemx --version
 Show the version number of @code{ranlib}.
 @end table
 
@@ -1479,7 +1509,7 @@ Berkeley's.
 Here is an example of the Berkeley (default) format of output from
 @code{size}: 
 @smallexample
-size --format=Berkeley ranlib size
+size --format=Berkeley ranlib size
 text    data    bss     dec     hex     filename
 294880  81920   11592   388392  5ed28   ranlib
 294880  81920   11888   388688  5ee50   size
@@ -1489,7 +1519,7 @@ text    data    bss     dec     hex     filename
 This is the same data, but displayed closer to System V conventions:
 
 @smallexample
-size --format=SysV ranlib size
+size --format=SysV ranlib size
 ranlib  :
 section         size         addr
 .text         294880         8192       
@@ -1707,7 +1737,7 @@ Verbose output: list all object files modified.  In the case of
 archives, @samp{strip -v} lists all members of the archive.
 @end table
 
-@node c++filt
+@node c++filt, addr2line, strip, Top
 @chapter c++filt
 
 @kindex c++filt
@@ -1721,13 +1751,17 @@ c++filt [ -_ | --strip-underscores ]
         [ --help ]  [ --version ]  [ @var{symbol}@dots{} ]
 @end smallexample
 
+@kindex cxxfilt
 The C++ and Java languages provides function overloading, which means
 that you can write many functions with the same name (providing each
 takes parameters of different types).  All C++ and Java function names
 are encoded into a low-level assembly label (this process is known as
-@dfn{mangling}). The @code{c++filt} program does the inverse mapping: it
-decodes (@dfn{demangles}) low-level names into user-level names so that
-the linker can keep these overloaded functions from clashing.
+@dfn{mangling}). The @code{c++filt}
+@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on
+MS-DOS this program is named @code{cxxfilt}.}
+program does the inverse mapping: it decodes (@dfn{demangles}) low-level
+names into user-level names so that the linker can keep these overloaded
+functions from clashing.
 
 Every alphanumeric word (consisting of letters, digits, underscores,
 dollars, or periods) seen in the input is a potential label.  If the
@@ -1826,7 +1860,7 @@ information in the executable to figure out which file name and line
 number are associated with a given address.
 
 The executable to use is specified with the @code{-e} option.  The
-default is @file{a.out}.
+default is the file @file{a.out}.
 
 @code{addr2line} has two modes of operation.
 
@@ -2072,7 +2106,7 @@ option.  @code{windres} will also search this directory when looking for
 files named in the @code{rc} file.
 
 @item -D @var{target}
-@itemx --define @var{sym[=val]}
+@itemx --define @var{sym}[=@var{val}]
 Specify a @code{-D} option to pass to the preprocessor when reading an
 @code{rc} file.
 
@@ -2354,6 +2388,7 @@ readelf [ -a | --all ]
         [ -S | --section-headers | --sections]
         [ -e | --headers]
         [ -s | --syms | --symbols]
+        [ -n | --notes]
         [ -r | --relocs]
         [ -d | --dynamic]
         [ -V | --version-info]
@@ -2382,7 +2417,8 @@ given.
 @itemx --all
 Equivalent to specifiying @samp{--file-header},
 @samp{--program-headers}, @samp{--sections}, @samp{--symbols},
-@samp{--relocs}, @samp{--dynamic} and @samp{--version-info}.
+@samp{--relocs}, @samp{--dynamic}, @samp{--notes} and
+@samp{--version-info}. 
 
 @item -h
 @itemx --file-header
@@ -2415,6 +2451,11 @@ Displays the entries in symbol table section of the file, if it has one.
 @itemx --headers
 Display all the headers in the file.  Equivalent to @samp{-h -l -S}.
 
+@item -n
+@itemx --notes
+@cindex ELF core notes
+Displays the contents of the NOTE segment, if it exists.
+
 @item -r
 @itemx --relocs
 @cindex ELF reloc information
@@ -2511,9 +2552,9 @@ Some sample values are: @samp{a.out-hp300bsd}, @samp{ecoff-littlemips},
 @samp{a.out-sunos-big}.
 
 You can also specify a target using a configuration triplet.  This is
-the same sort of name that is passed to configure to specify a target.
-When you use a configuration triplet as an argument, it must be fully
-canonicalized.  You can see the canonical version of a triplet by
+the same sort of name that is passed to @file{configure} to specify a
+target.  When you use a configuration triplet as an argument, it must be
+fully canonicalized.  You can see the canonical version of a triplet by
 running the shell script @file{config.sub} which is included with the
 sources.
 
@@ -2835,9 +2876,10 @@ and then we might not encounter the bug.
 A complete input file, or set of input files, that will reproduce the
 bug.  If the utility is reading an object file or files, then it is
 generally most helpful to send the actual object files, uuencoded if
-necessary to get them through the mail system.  Making them available
-for anonymous FTP is not as good, but may be the only reasonable choice
-for large object files.
+necessary to get them through the mail system.  Note that
+@samp{bug-gnu-utils@@gnu.org} is a mailing list, so you should avoid
+sending very large files to it.  Making the files available for
+anonymous FTP is OK.
 
 If the source files were produced exclusively using @sc{gnu} programs
 (e.g., @code{gcc}, @code{gas}, and/or the @sc{gnu} @code{ld}), then it
@@ -2856,7 +2898,7 @@ not notice unless it is glaringly wrong.  You might as well not give us
 a chance to make a mistake.
 
 Even if the problem you experience is a fatal signal, you should still
-say so explicitly.  Suppose something strange is going on, such as, your
+say so explicitly.  Suppose something strange is going on, such as your
 copy of the utility is out of synch, or you have encountered a bug in
 the C library on your system.  (This has happened!)  Your copy might
 crash and ours would not.  If you told us to expect a crash, then when
@@ -2868,8 +2910,8 @@ to draw any conclusion from our observations.
 If you wish to suggest changes to the source, send us context diffs, as
 generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p}
 option.  Always send diffs from the old file to the new file.  If you
-even discuss something in the @code{ld} source, refer to it by context,
-not by line number.
+wish to discuss something in the @code{ld} source, refer to it by
+context, not by line number.
 
 The line numbers in our development sources will not match those in your
 sources.  Your line numbers would convey no useful information to us.
This page took 0.031312 seconds and 4 git commands to generate.