* doc/binutils.texi: Include config.texi and @file documentation
[deliverable/binutils-gdb.git] / binutils / doc / binutils.texi
index 6222418b535ed55843592c6f6d06af1950cbf8ad..828eb5d2f39c1325562f64c8556f31d0afa8e42e 100644 (file)
@@ -2,7 +2,9 @@
 @setfilename binutils.info
 @c Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
+@c man begin INCLUDE
 @include config.texi
+@c man end
 
 @ifinfo
 @format
@@ -166,6 +168,7 @@ section entitled "GNU Free Documentation License".
 * nlmconv::                     Converts object code into an NLM
 * windres::                    Manipulate Windows resources
 * dlltool::                    Create files needed to build and use DLLs
+* Common Options::              Command-line options for all utilities
 * Selecting The Target System:: How these utilities determine the target.
 * Reporting Bugs::              Reporting Bugs
 * GNU Free Documentation License::  GNU Free Documentation License
@@ -990,6 +993,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}]
         [@option{--prefix-sections=}@var{string}]
         [@option{--prefix-alloc-sections=}@var{string}]
         [@option{--add-gnu-debuglink=}@var{path-to-file}]
+        [@option{--keep-file-symbols}]
         [@option{--only-keep-debug}]
         [@option{--writable-text}]
         [@option{--readonly-text}]
@@ -1427,6 +1431,11 @@ Prefix all the names of all allocated sections in the output file with
 Creates a .gnu_debuglink section which contains a reference to @var{path-to-file}
 and adds it to the output file.
 
+@item --keep-file-symbols
+When stripping a file, perhaps with @option{--strip-debug} or
+@option{--strip-unneeded}, retain any symbols specifying source file names,
+which would otherwise get stripped.
+
 @item --only-keep-debug
 Strip a file, removing contents of any sections that would not be
 stripped by @option{--strip-debug} and leaving the debugging sections
@@ -1521,6 +1530,7 @@ objdump [@option{-a}|@option{--archive-headers}]
         [@option{-r}|@option{--reloc}]
         [@option{-R}|@option{--dynamic-reloc}]
         [@option{-s}|@option{--full-contents}]
+        [@option{-W}|@option{--dwarf}]
         [@option{-G}|@option{--stabs}]
         [@option{-t}|@option{--syms}]
         [@option{-T}|@option{--dynamic-syms}]
@@ -1712,7 +1722,7 @@ can be placed together into a comma separated list.
 
 If the target is an ARM architecture then this switch can be used to
 select which register name set is used during disassembler.  Specifying
-@option{-M reg-name-std} (the default) will select the register names as
+@option{-M reg-names-std} (the default) will select the register names as
 used in ARM's instruction set documentation, but with register 13 called
 'sp', register 14 called 'lr' and register 15 called 'pc'.  Specifying
 @option{-M reg-names-apcs} will select the name set used by the ARM
@@ -1745,7 +1755,8 @@ suffix could be inferred by the operands.
 
 For PPC, @option{booke}, @option{booke32} and @option{booke64} select
 disassembly of BookE instructions.  @option{32} and @option{64} select
-PowerPC and PowerPC64 disassembly, respectively.
+PowerPC and PowerPC64 disassembly, respectively.  @option{e300} selects
+disassembly for the e300 family.
 
 For MIPS, this option controls the printing of instruction mneumonic
 names and register names in disassembled instructions.  Multiple
@@ -1844,6 +1855,13 @@ in symbolic form.  This is the default except when
 When disassembling instructions, do not print the instruction bytes.
 This is the default when @option{--prefix-addresses} is used.
 
+@item -W
+@itemx --dwarf
+@cindex DWARF
+@cindex debug symbols
+Displays the contents of the DWARF debug sections in the file, if any
+are present.
+
 @item -G
 @itemx --stabs
 @cindex stab
@@ -2213,6 +2231,7 @@ strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}]
       [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}]
       [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}]
       [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}]
+      [@option{--keep-file-symbols}]
       [@option{--only-keep-debug}]
       [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}]
       [@option{--help}] [@option{--info}]
@@ -2321,6 +2340,11 @@ Remove non-global symbols.
 Remove compiler-generated local symbols.
 (These usually start with @samp{L} or @samp{.}.)
 
+@item --keep-file-symbols
+When stripping a file, perhaps with @option{--strip-debug} or
+@option{--strip-unneeded}, retain any symbols specifying source file names,
+which would otherwise get stripped.
+
 @item --only-keep-debug
 Strip a file, removing any sections that would be stripped by
 @option{--strip-debug} and leaving the debugging sections.
@@ -2387,9 +2411,10 @@ the Info entries for @file{binutils}.
 @smallexample
 @c man begin SYNOPSIS cxxfilt
 c++filt [@option{-_}|@option{--strip-underscores}]
-        [@option{-j}|@option{--java}]
         [@option{-n}|@option{--no-strip-underscores}]
         [@option{-p}|@option{--no-params}]
+        [@option{-t}|@option{--types}]
+        [@option{-i}|@option{--no-verbose}]
         [@option{-s} @var{format}|@option{--format=}@var{format}]
         [@option{--help}]  [@option{--version}]  [@var{symbol}@dots{}]
 @c man end
@@ -2398,31 +2423,67 @@ c++filt [@option{-_}|@option{--strip-underscores}]
 @c man begin DESCRIPTION cxxfilt
 
 @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 @command{c++filt}
-@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on
+The C++ and Java languages provide function overloading, which means
+that you can write many functions with the same name, providing that
+each function takes parameters of different types.  In order to be
+able to distinguish these similarly named functions C++ and Java
+encode them into a low-level assembler name which uniquely identifies
+each different version.  This process is known as @dfn{mangling}. The
+@command{c++filt}
+@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on 
 MS-DOS this program is named @command{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.
+names into user-level names so that they can be read.
 
 Every alphanumeric word (consisting of letters, digits, underscores,
-dollars, or periods) seen in the input is a potential label.  If the
-label decodes into a C++ name, the C++ name replaces the low-level
-name in the output.
+dollars, or periods) seen in the input is a potential mangled name.
+If the name decodes into a C++ name, the C++ name replaces the
+low-level name in the output, otherwise the original word is output.
+In this way you can pass an entire assembler source file, containing
+mangled names, through @command{c++filt} and see the same source file
+containing demangled names.
 
-You can use @command{c++filt} to decipher individual symbols:
+You can also use @command{c++filt} to decipher individual symbols by
+passing them on the command line:
 
 @example
 c++filt @var{symbol}
 @end example
 
 If no @var{symbol} arguments are given, @command{c++filt} reads symbol
-names from the standard input and writes the demangled names to the
-standard output.  All results are printed on the standard output.
+names from the standard input instead.  All the results are printed on
+the standard output.  The difference between reading names from the
+command line versus reading names from the standard input is that
+command line arguments are expected to be just mangled names and no
+checking is performed to seperate them from surrounding text.  Thus
+for example:
+
+@smallexample
+c++filt -n _Z1fv
+@end smallexample
+
+will work and demangle the name to ``f()'' whereas:
+
+@smallexample
+c++filt -n _Z1fv,
+@end smallexample
+
+will not work.  (Note the extra comma at the end of the mangled
+name which makes it invalid).  This command however will work:
+
+@smallexample
+echo _Z1fv, | c++filt -n
+@end smallexample
+
+and will display ``f(),'' ie the demangled name followed by a
+trailing comma.  This behaviour is because when the names are read
+from the standard input it is expected that they might be part of an
+assembler source file where there might be extra, extraneous
+characters trailing after a mangled name.  eg:
+
+@smallexample
+    .type   _Z1fv, @@function
+@end smallexample
 
 @c man end
 
@@ -2450,6 +2511,19 @@ Do not remove the initial underscore.
 When demangling the name of a function, do not display the types of
 the function's parameters.
 
+@item -t
+@itemx --types
+Attempt to demangle types as well as function names.  This is disabled
+by default since mangled types are normally only used internally in
+the compiler, and they can be confused with non-mangled names.  eg
+a function called ``a'' treated as a mangled type name would be
+demangled to ``signed char''.
+
+@item -i
+@itemx --no-verbose
+Do not include implementation details (if any) in the demangled
+output.
+
 @item -s @var{format}
 @itemx --format=@var{format}
 @command{c++filt} can decode various methods of mangling, used by
@@ -3264,7 +3338,7 @@ readelf [@option{-a}|@option{--all}]
         [@option{-V}|@option{--version-info}]
         [@option{-A}|@option{--arch-specific}]
         [@option{-D}|@option{--use-dynamic}]
-        [@option{-x} <number>|@option{--hex-dump=}<number>]
+        [@option{-x} <number or name>|@option{--hex-dump=}<number or name>]
         [@option{-w[liaprmfFsoR]}|
          @option{--debug-dump}[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
         [@option{-I}|@option{-histogram}]
@@ -3384,9 +3458,11 @@ When displaying symbols, this option makes @command{readelf} use the
 symbol table in the file's dynamic section, rather than the one in the
 symbols section.
 
-@item -x <number>
-@itemx --hex-dump=<number>
+@item -x <number or name>
+@itemx --hex-dump=<number or name>
 Displays the contents of the indicated section as a hexadecimal dump.
+A number identifies a particular section by index in the section table;
+any other string identifies all sections with that name in the object file.
 
 @item -w[liaprmfFsoR]
 @itemx --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]
@@ -3425,6 +3501,27 @@ objdump(1), and the Info entries for @file{binutils}.
 @c man end
 @end ignore
 
+@node Common Options
+@chapter Common Options
+
+The following command-line options are supported by all of the
+programs described in this manual.
+
+@c man begin OPTIONS
+@table @env
+@include @value{top_srcdir}/../libiberty/at-file.texi
+@c man end
+
+@item --help
+Display the command-line options supported by the program.
+
+@item --version
+Display the version number of the program.
+
+@c man begin OPTIONS
+@end table
+@c man end
+
 @node Selecting The Target System
 @chapter Selecting the Target System
 
This page took 0.025995 seconds and 4 git commands to generate.