home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / docs / binutils / binutils.inf < prev    next >
Encoding:
GNU Info File  |  1993-08-29  |  32.9 KB  |  942 lines

  1. This is Info file binutils.info, produced by Makeinfo-1.52 from the
  2. input file ./binutils.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Binutils: (binutils).        The GNU binary utilities "ar", "ld", "objcopy",
  6.                 "objdump", "nm", "size", "strip", and "ranlib".
  7. END-INFO-DIR-ENTRY
  8.  
  9.    Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the entire resulting derived work is distributed under the terms
  18. of a permission notice identical to this one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions.
  23.  
  24. 
  25. File: binutils.info,  Node: Top,  Next: ar,  Prev: (dir),  Up: (dir)
  26.  
  27. Introduction
  28. ************
  29.  
  30.    This brief manual contains preliminary documentation for the GNU
  31. binary utilities (collectively version 2.2):
  32.  
  33. * Menu:
  34.  
  35. * ar::                          Create, modify, and extract from archives
  36. * objcopy::            Copy and translate object files
  37. * ld:(ld)Overview.              Combine object and archive files
  38. * nm::                          List symbols from object files
  39. * objdump::                     Display information from object files
  40. * ranlib::                      Generate index to archive contents
  41. * size::                        List section sizes and total size
  42. * strip::                       Discard symbols
  43. * cppfilt::            Filter to demangle encoded C++ symbols
  44. * Index::
  45.  
  46. 
  47. File: binutils.info,  Node: ar,  Next: objcopy,  Prev: Top,  Up: Top
  48.  
  49. ar
  50. **
  51.  
  52.      ar [-]PMOD [ MEMBERNAME ] ARCHIVE FILE...
  53.      ar -M [ <mri-script ]
  54.  
  55.    The GNU `ar' program creates, modifies, and extracts from archives.
  56. An "archive" is a single file holding a collection of other files in a
  57. structure that makes it possible to retrieve the original individual
  58. files (called "members" of the archive).
  59.  
  60.    The original files' contents, mode (permissions), timestamp, owner,
  61. and group are preserved in the archive, and can be restored on
  62. extraction.
  63.  
  64.    GNU `ar' can maintain archives whose members have names of any
  65. length; however, depending on how `ar' is configured on your system, a
  66. limit on member-name length may be imposed for compatibility with
  67. archive formats maintained with other tools.  If it exists, the limit
  68. is often 15 characters (typical of formats related to a.out) or 16
  69. characters (typical of formats related to coff).
  70.  
  71.    `ar' is considered a binary utility because archives of this sort
  72. are most often used as "libraries" holding commonly needed subroutines.
  73.  
  74.    `ar' creates an index to the symbols defined in relocatable object
  75. modules in the archive when you specify the modifier `s'.  Once
  76. created, this index is updated in the archive whenever `ar' makes a
  77. change to its contents (save for the `q' update operation).  An archive
  78. with such an index speeds up linking to the library, and allows
  79. routines in the library to call each other without regard to their
  80. placement in the archive.
  81.  
  82.    You may use `nm -s' or `nm --print-armap' to list this index table.
  83. If an archive lacks the table, another form of `ar' called `ranlib' can
  84. be used to add just the table.
  85.  
  86.    GNU `ar' is designed to be compatible with two different facilities.
  87. You can control its activity using command-line options, like the
  88. different varieties of `ar' on Unix systems; or, if you specify the
  89. single command-line option `-M', you can control it with a script
  90. supplied via standard input, like the MRI "librarian" program.
  91.  
  92. * Menu:
  93.  
  94. * ar-cmdline::                  Controlling `ar' on the command line
  95. * ar-scripts::                  Controlling `ar' with a script
  96.  
  97. 
  98. File: binutils.info,  Node: ar-cmdline,  Next: ar-scripts,  Prev: ar,  Up: ar
  99.  
  100. Controlling `ar' on the command line
  101. ====================================
  102.  
  103.      ar [-]PMOD [ MEMBERNAME ] ARCHIVE FILE...
  104.  
  105.    When you use `ar' in the Unix style, `ar' insists on at least two
  106. arguments to execute: one keyletter specifying the *operation*
  107. (optionally accompanied by other keyletters specifying *modifiers*),
  108. and the archive name to act on.
  109.  
  110.    Most operations can also accept further FILE arguments, specifying
  111. particular files to operate on.
  112.  
  113.    GNU `ar' allows you to mix the operation code P and modifier flags
  114. MOD in any order, within the first command-line argument.
  115.  
  116.    If you wish, you may begin the first command-line argument with a
  117. dash.
  118.  
  119.    The P keyletter specifies what operation to execute; it may be any
  120. of the following, but you must specify only one of them:
  121.  
  122. `d'
  123.      *Delete* modules from the archive.  Specify the names of modules to
  124.      be deleted as FILE...; the archive is untouched if you specify no
  125.      files to delete.
  126.  
  127.      If you specify the `v' modifier, `ar' lists each module as it is
  128.      deleted.
  129.  
  130. `m'
  131.      Use this operation to *move* members in an archive.
  132.  
  133.      The ordering of members in an archive can make a difference in how
  134.      programs are linked using the library, if a symbol is defined in
  135.      more than one member.
  136.  
  137.      If no modifiers are used with `m', any members you name in the
  138.      FILE arguments are moved to the *end* of the archive; you can use
  139.      the `a', `b', or `i' modifiers to move them to a specified place
  140.      instead.
  141.  
  142. `p'
  143.      *Print* the specified members of the archive, to the standard
  144.      output file.  If the `v' modifier is specified, show the member
  145.      name before copying its contents to standard output.
  146.  
  147.      If you specify no FILE arguments, all the files in the archive are
  148.      printed.
  149.  
  150. `q'
  151.      *Quick append*; add the files FILE... to the end of ARCHIVE,
  152.      without checking for replacement.
  153.  
  154.      The modifiers `a', `b', and `i' do *not* affect this operation;
  155.      new members are always placed at the end of the archive.
  156.  
  157.      The modifier `v' makes `ar' list each file as it is appended.
  158.  
  159.      Since the point of this operation is speed, the archive's symbol
  160.      table index is not updated, even if it already existed; you can
  161.      use `ar s' or `ranlib' explicitly to update the symbol table index.
  162.  
  163. `r'
  164.      Insert the files FILE... into ARCHIVE (with *replacement*). This
  165.      operation differs from `q' in that any previously existing members
  166.      are deleted if their names match those being added.
  167.  
  168.      If one of the files named in FILE... doesn't exist, `ar' displays
  169.      an error message, and leaves undisturbed any existing members of
  170.      the archive matching that name.
  171.  
  172.      By default, new members are added at the end of the file; but you
  173.      may use one of the modifiers `a', `b', or `i' to request placement
  174.      relative to some existing member.
  175.  
  176.      The modifier `v' used with this operation elicits a line of output
  177.      for each file inserted, along with one of the letters `a' or `r'
  178.      to indicate whether the file was appended (no old member deleted)
  179.      or replaced.
  180.  
  181. `t'
  182.      Display a *table* listing the contents of ARCHIVE, or those of the
  183.      files listed in FILE... that are present in the archive.  Normally
  184.      only the member name is shown; if you also want to see the modes
  185.      (permissions), timestamp, owner, group, and size, you can request
  186.      that by also specifying the `v' modifier.
  187.  
  188.      If you do not specify a FILE, all files in the archive are listed.
  189.  
  190.      If there is more than one file with the same name (say, `fie') in
  191.      an archive (say `b.a'), `ar t b.a fie' lists only the first
  192.      instance; to see them all, you must ask for a complete listing--in
  193.      our example, `ar t b.a'.
  194.  
  195. `x'
  196.      *Extract* members (named FILE) from the archive.  You can use the
  197.      `v' modifier with this operation, to request that `ar' list each
  198.      name as it extracts it.
  199.  
  200.      If you do not specify a FILE, all files in the archive are
  201.      extracted.
  202.  
  203.    A number of modifiers (MOD) may immediately follow the P keyletter,
  204. to specify variations on an operation's behavior:
  205.  
  206. `a'
  207.      Add new files *after* an existing member of the archive.  If you
  208.      use the modifier `a', the name of an existing archive member must
  209.      be present as the MEMBERNAME argument, before the ARCHIVE
  210.      specification.
  211.  
  212. `b'
  213.      Add new files *before* an existing member of the archive.  If you
  214.      use the modifier `b', the name of an existing archive member must
  215.      be present as the MEMBERNAME argument, before the ARCHIVE
  216.      specification.  (same as `i').
  217.  
  218. `c'
  219.      *Create* the archive.  The specified ARCHIVE is always created if
  220.      it didn't exist, when you request an update.  But a warning is
  221.      issued unless you specify in advance that you expect to create it,
  222.      by using this modifier.
  223.  
  224. `i'
  225.      Insert new files *before* an existing member of the archive.  If
  226.      you use the modifier `i', the name of an existing archive member
  227.      must be present as the MEMBERNAME argument, before the ARCHIVE
  228.      specification.  (same as `b').
  229.  
  230. `l'
  231.      This modifier is accepted but not used.
  232.  
  233. `o'
  234.      Preserve the *original* dates of members when extracting them.  If
  235.      you do not specify this modifier, files extracted from the archive
  236.      are stamped with the time of extraction.
  237.  
  238. `s'
  239.      Write an object-file index into the archive, or update an existing
  240.      one, even if no other change is made to the archive.  You may use
  241.      this modifier flag either with any operation, or alone.  Running
  242.      `ar s' on an archive is equivalent to running `ranlib' on it.
  243.  
  244. `u'
  245.      Normally, `ar r'... inserts all files listed into the archive.  If
  246.      you would like to insert *only* those of the files you list that
  247.      are newer than existing members of the same names, use this
  248.      modifier.  The `u' modifier is allowed only for the operation `r'
  249.      (replace).  In particular, the combination `qu' is not allowed,
  250.      since checking the timestamps would lose any speed advantage from
  251.      the operation `q'.
  252.  
  253. `v'
  254.      This modifier requests the *verbose* version of an operation.  Many
  255.      operations display additional information, such as filenames
  256.      processed, when the modifier `v' is appended.
  257.  
  258. `V'
  259.      This modifier shows the version number of `ar'.
  260.  
  261. 
  262. File: binutils.info,  Node: ar-scripts,  Prev: ar-cmdline,  Up: ar
  263.  
  264. Controlling `ar' with a script
  265. ==============================
  266.  
  267.      ar -M [ <SCRIPT ]
  268.  
  269.    If you use the single command-line option `-M' with `ar', you can
  270. control its operation with a rudimentary command language.  This form
  271. of `ar' operates interactively if standard input is coming directly
  272. from a terminal.  During interactive use, `ar' prompts for input (the
  273. prompt is `AR >'), and continues executing even after errors.  If you
  274. redirect standard input to a script file, no prompts are issued, and
  275. `ar' abandons execution (with a nonzero exit code) on any error.
  276.  
  277.    The `ar' command language is *not* designed to be equivalent to the
  278. command-line options; in fact, it provides somewhat less control over
  279. archives.  The only purpose of the command language is to ease the
  280. transition to GNU `ar' for developers who already have scripts written
  281. for the MRI "librarian" program.
  282.  
  283.    The syntax for the `ar' command language is straightforward:
  284.    * commands are recognized in upper or lower case; for example, `LIST'
  285.      is the same as `list'.  In the following descriptions, commands are
  286.      shown in upper case for clarity.
  287.  
  288.    * a single command may appear on each line; it is the first word on
  289.      the line.
  290.  
  291.    * empty lines are allowed, and have no effect.
  292.  
  293.    * comments are allowed; text after either of the characters `*' or
  294.      `;' is ignored.
  295.  
  296.    * Whenever you use a list of names as part of the argument to an `ar'
  297.      command, you can separate the individual names with either commas
  298.      or blanks.  Commas are shown in the explanations below, for
  299.      clarity.
  300.  
  301.    * `+' is used as a line continuation character; if `+' appears at
  302.      the end of a line, the text on the following line is considered
  303.      part of the current command.
  304.  
  305.    Here are the commands you can use in `ar' scripts, or when using
  306. `ar' interactively.  Three of them have special significance:
  307.  
  308.    `OPEN' or `CREATE' specify a "current archive", which is a temporary
  309. file required for most of the other commands.
  310.  
  311.    `SAVE' commits the changes so far specified by the script.  Prior to
  312. `SAVE', commands affect only the temporary copy of the current archive.
  313.  
  314. `ADDLIB ARCHIVE'
  315. `ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)'
  316.      Add all the contents of ARCHIVE (or, if specified, each named
  317.      MODULE from ARCHIVE) to the current archive.
  318.  
  319.      Requires prior use of `OPEN' or `CREATE'.
  320.  
  321. `ADDMOD FILE, FILE, ... FILE'
  322.      Add each named FILE as a module in the current archive.
  323.  
  324.      Requires prior use of `OPEN' or `CREATE'.
  325.  
  326. `CLEAR'
  327.      Discard the contents of the current archive, cancelling the effect
  328.      of any operations since the last `SAVE'.  May be executed (with no
  329.      effect) even if  no current archive is specified.
  330.  
  331. `CREATE ARCHIVE'
  332.      Creates an archive, and makes it the current archive (required for
  333.      many other commands).  The new archive is created with a temporary
  334.      name; it is not actually saved as ARCHIVE until you use `SAVE'.
  335.      You can overwrite existing archives; similarly, the contents of any
  336.      existing file named ARCHIVE will not be destroyed until `SAVE'.
  337.  
  338. `DELETE MODULE, MODULE, ... MODULE'
  339.      Delete each listed MODULE from the current archive; equivalent to
  340.      `ar -d ARCHIVE MODULE ... MODULE'.
  341.  
  342.      Requires prior use of `OPEN' or `CREATE'.
  343.  
  344. `DIRECTORY ARCHIVE (MODULE, ... MODULE)'
  345. `DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE'
  346.      List each named MODULE present in ARCHIVE.  The separate command
  347.      `VERBOSE' specifies the form of the output: when verbose output is
  348.      off, output is like that of `ar -t ARCHIVE MODULE...'.  When
  349.      verbose output is on, the listing is like `ar -tv ARCHIVE
  350.      MODULE...'.
  351.  
  352.      Output normally goes to the standard output stream; however, if you
  353.      specify OUTPUTFILE as a final argument, `ar' directs the output to
  354.      that file.
  355.  
  356. `END'
  357.      Exit from `ar', with a `0' exit code to indicate successful
  358.      completion.  This command does not save the output file; if you
  359.      have changed the current archive since the last `SAVE' command,
  360.      those changes are lost.
  361.  
  362. `EXTRACT MODULE, MODULE, ... MODULE'
  363.      Extract each named MODULE from the current archive, writing them
  364.      into the current directory as separate files.  Equivalent to `ar -x
  365.      ARCHIVE MODULE...'.
  366.  
  367.      Requires prior use of `OPEN' or `CREATE'.
  368.  
  369. `LIST'
  370.      Display full contents of the current archive, in "verbose" style
  371.      regardless of the state of `VERBOSE'.  The effect is like `ar tv
  372.      ARCHIVE').  (This single command is a GNU `ld' enhancement, rather
  373.      than present for MRI compatibility.)
  374.  
  375.      Requires prior use of `OPEN' or `CREATE'.
  376.  
  377. `OPEN ARCHIVE'
  378.      Opens an existing archive for use as the current archive (required
  379.      for many other commands).  Any changes as the result of subsequent
  380.      commands will not actually affect ARCHIVE until you next use
  381.      `SAVE'.
  382.  
  383. `REPLACE MODULE, MODULE, ... MODULE'
  384.      In the current archive, replace each existing MODULE (named in the
  385.      `REPLACE' arguments) from files in the current working directory.
  386.      To execute this command without errors, both the file, and the
  387.      module in the current archive, must exist.
  388.  
  389.      Requires prior use of `OPEN' or `CREATE'.
  390.  
  391. `VERBOSE'
  392.      Toggle an internal flag governing the output from `DIRECTORY'.
  393.      When the flag is on, `DIRECTORY' output matches output from `ar
  394.      -tv '....
  395.  
  396. `SAVE'
  397.      Commit your changes to the current archive, and actually save it
  398.      as a file with the name specified in the last `CREATE' or `OPEN'
  399.      command.
  400.  
  401.      Requires prior use of `OPEN' or `CREATE'.
  402.  
  403. 
  404. File: binutils.info,  Node: objcopy,  Next: nm,  Prev: ar,  Up: Top
  405.  
  406. objcopy
  407. *******
  408.  
  409.      objcopy [ -F FORMAT | --format=FORMAT ]
  410.              [ -I FORMAT | --input-format=FORMAT ]
  411.              [ -O FORMAT | --output-format=FORMAT ]
  412.              [ -S | --strip-all ]  [ -g | --strip-debug ]
  413.              [ -x | --discard-all ]  [ -X | --discard-locals ]
  414.              [ -v | --verbose ]  [ -V | --version ]
  415.              INFILE [OUTFILE]
  416.  
  417.    The GNU `objcopy' utility copies the contents of an object file to
  418. another.  `objcopy' uses the GNU BFD Library to read and write the
  419. object files.  It can write the destination object file in a format
  420. different from that of the source object file.  The exact behavior of
  421. `objcopy' is controlled by command-line options.
  422.  
  423.    `objcopy' creates temporary files to do its translations and deletes
  424. them afterward.  `objcopy' uses BFD to do all its translation work; it
  425. knows about all the formats BFD knows about, and thus is able to
  426. recognize most formats without being told explicitly.  *Note BFD:
  427. (ld.info)BFD the GNU linker.
  428.  
  429. `INFILE'
  430. `OUTFILE'
  431.      The source and output files respectively.  If you do not specify
  432.      OUTFILE, `objcopy' creates a temporary file and destructively
  433.      renames the result with the name of the input file.
  434.  
  435. `-I FORMAT'
  436. `--input-format=FORMAT'
  437.      Consider the source file's object format to be FORMAT, rather than
  438.      attempting to deduce it.
  439.  
  440. `-O FORMAT'
  441. `--output-format=FORMAT'
  442.      Write the output file using the object format FORMAT.
  443.  
  444. `-F FORMAT'
  445. `--format=FORMAT'
  446.      Use FORMAT as the object format for both the input and the output
  447.      file; i.e. simply transfer data from source to destination with no
  448.      translation.
  449.  
  450. `-S'
  451. `--strip-all'
  452.      Do not copy relocation and symbol information from the source file.
  453.  
  454. `-g'
  455. `--strip-debug'
  456.      Do not copy debugging symbols from the source file.
  457.  
  458. `-x'
  459. `--discard-all'
  460.      Do not copy non-global symbols from the source file.
  461.  
  462. `-X'
  463. `--discard-locals'
  464.      Do not copy compiler-generated local symbols.  (These usually
  465.      start with `L' or `.'.)
  466.  
  467. `-V'
  468. `--version'
  469.      Show the version number of `objcopy'.
  470.  
  471. `-v'
  472. `--verbose'
  473.      Verbose output: list all object files modified.  In the case of
  474.      archives, `objcopy -V' lists all members of the archive.
  475.  
  476. 
  477. File: binutils.info,  Node: nm,  Next: objdump,  Prev: objcopy,  Up: Top
  478.  
  479. nm
  480. **
  481.  
  482.      nm [ -a | --debug-syms ]  [ -g | --extern-only ]
  483.         [ -s | --print-armap ]  [ -o | --print-file-name ]
  484.         [ -n | --numeric-sort ]  [ -p | --no-sort ]
  485.         [ -r | --reverse-sort ]  [ -u | --undefined-only ]
  486.         [ --target=BFDNAME ]
  487.         [ OBJFILE... ]
  488.  
  489.    GNU `nm' lists the symbols from object files OBJFILE....
  490.  
  491.    The long and short forms of options, shown here as alternatives, are
  492. equivalent.
  493.  
  494. `OBJFILE...'
  495.      Object files whose symbols are to be listed.  If no object files
  496.      are listed as arguments, `nm' assumes `a.out'.
  497.  
  498. `-a'
  499. `--debug-syms'
  500.      Display debugger-only symbols; normally these are not listed.
  501.  
  502. `-g'
  503. `--extern-only'
  504.      Display only external symbols.
  505.  
  506. `-p'
  507. `--no-sort'
  508.      Don't bother to sort the symbols in any order; just print them in
  509.      the order encountered.
  510.  
  511. `-n'
  512. `--numeric-sort'
  513.      Sort symbols numerically by their addresses, rather than
  514.      alphabetically by their names.
  515.  
  516. `-s'
  517. `--print-armap'
  518.      When listing symbols from archive members, include the index: a
  519.      mapping (stored in the archive by `ar' or `ranlib') of which
  520.      modules contain definitions for which names.
  521.  
  522. `-o'
  523. `--print-file-name'
  524.      Precede each symbol by the name of the input file where it was
  525.      found, rather than identifying the input file once only before all
  526.      of its symbols.
  527.  
  528. `-r'
  529. `--reverse-sort'
  530.      Reverse the order of the sort (whether numeric or alphabetic); let
  531.      the last come first.
  532.  
  533. `--target=BFDNAME'
  534.      Specify an object code format other than your system's default
  535.      format.  *Note objdump::, for information on listing available
  536.      formats.
  537.  
  538. `-u'
  539. `--undefined-only'
  540.      Display only undefined symbols (those external to each object
  541.      file).
  542.  
  543. 
  544. File: binutils.info,  Node: objdump,  Next: ranlib,  Prev: nm,  Up: Top
  545.  
  546. objdump
  547. *******
  548.  
  549.      objdump [ -a ]  [ -b BFDNAME ]  [ -d ]  [ -f ]
  550.              [ -h | --header ]  [ -i ]  [ -j SECTION ]  [ -l ]
  551.              [ -m MACHINE ]  [ -r | --reloc ]  [ -s ]
  552.              [ --stabs ]  [ -t | --syms ]  [ -x ]
  553.              OBJFILE...
  554.  
  555.    `objdump' displays information about one or more object files.  The
  556. options control what particular information to display.  This
  557. information is mostly useful to programmers who are working on the
  558. compilation tools, as opposed to programmers who just want their
  559. program to compile and work.
  560.  
  561.    The long and short forms of options, shown here as alternatives, are
  562. equivalent.
  563.  
  564. `OBJFILE...'
  565.      The object files to be examined.  When you specify archives,
  566.      `objdump' shows information on each of the member object files.
  567.  
  568. `-a'
  569.      If any of the OBJFILE files are archives, display the archive
  570.      header information (in a format similar to `ls -l').  Besides the
  571.      information you could list with `ar tv', `objdump -a' shows the
  572.      object file format of each archive member.
  573.  
  574. `-b BFDNAME'
  575.      Specify that the object-code format for the object files is
  576.      BFDNAME.  This option may not be necessary; OBJDUMP can
  577.      automatically recognize many formats.
  578.  
  579.      For example,
  580.           objdump -b oasys -m vax -h fu.o
  581.  
  582.      displays summary information from the section headers (`-h') of
  583.      `fu.o', which is explicitly identified (`-m') as a VAX object file
  584.      in the format produced by Oasys compilers.  You can list the
  585.      formats available with the `-i' option.
  586.  
  587. `-d'
  588.      Disassemble.  Display the assembler mnemonics for the machine
  589.      instructions from OBJFILE.
  590.  
  591. `-f'
  592.      File header.  Display summary information from the overall header
  593.      of each of the OBJFILE files.
  594.  
  595. `-h'
  596. `--header'
  597.      Header.  Display summary information from the section headers of
  598.      the object file.
  599.  
  600. `-i'
  601.      Display a list showing all architectures and object formats
  602.      available for specification with `-b' or `-m'.
  603.  
  604. `-j NAME'
  605.      Display information only for section NAME.
  606.  
  607. `-l'
  608.      Label the display (using debugging information) with the source
  609.      filename and line numbers corresponding to the object code shown.
  610.  
  611. `-m MACHINE'
  612.      Specify that the object files OBJFILE are for architecture
  613.      MACHINE.  You can list available architectures using the `-i'
  614.      option.
  615.  
  616. `-r'
  617. `--reloc'
  618.      Relocation.  Print the relocation entries of the file.
  619.  
  620. `-s'
  621.      Display the full contents of any sections requested.
  622.  
  623. `--stabs'
  624.      Display the full contents of any sections requested.  Display the
  625.      contents of the .stab and .stab.index and .stab.excl sections from
  626.      an ELF file.  This is only useful on systems (such as Solaris 2.0)
  627.      in which `.stab' debugging symbol-table entries are carried in an
  628.      ELF section.  In most other file formats, debugging symbol-table
  629.      entries are interleaved with linkage symbols, and are visible in
  630.      the `--syms' output.
  631.  
  632. `-t'
  633. `--syms'
  634.      Symbol Table.  Print the symbol table entries of the file.  This
  635.      is similar to the information provided by the `nm' program.
  636.  
  637. `-x'
  638.      Display all available header information, including the symbol
  639.      table and relocation entries.  Using `-x' is equivalent to
  640.      specifying all of `-a -f -h -r -t'.
  641.  
  642. 
  643. File: binutils.info,  Node: ranlib,  Next: size,  Prev: objdump,  Up: Top
  644.  
  645. ranlib
  646. ******
  647.  
  648.      ranlib [-vV] ARCHIVE
  649.  
  650.    `ranlib' generates an index to the contents of an archive and stores
  651. it in the archive.  The index lists each symbol defined by a member of
  652. an archive that is a relocatable object file.
  653.  
  654.    You may use `nm -s' or `nm --print-armap' to list this index.
  655.  
  656.    An archive with such an index speeds up linking to the library and
  657. allows routines in the library to call each other without regard to
  658. their placement in the archive.
  659.  
  660.    The GNU `ranlib' program is another form of GNU `ar'; running
  661. `ranlib' is completely equivalent to executing `ar -s'.  *Note ar::.
  662.  
  663. `-v'
  664. `-V'
  665.      Show the version number of `ranlib'.
  666.  
  667. 
  668. File: binutils.info,  Node: size,  Next: strip,  Prev: ranlib,  Up: Top
  669.  
  670. size
  671. ****
  672.  
  673.      size [ -A | -B | --format=COMPATIBILITY ]
  674.           [ --help ]  [ -d | -o | -x | --radix=NUMBER ]
  675.           [ --target=BFDNAME ]  [ -V | --version ]
  676.           OBJFILE...
  677.  
  678.    The GNU `size' utility lists the section sizes--and the total
  679. size--for each of the object or archive files OBJFILE in its argument
  680. list.  By default, one line of output is generated for each object file
  681. or each module in an archive.
  682.  
  683.    The command line options have the following meanings:
  684. `OBJFILE...'
  685.      The object files to be examined.
  686.  
  687. `-A'
  688. `-B'
  689. `--format=COMPATIBILITY'
  690.      Using one of these options, you can choose whether the output from
  691.      GNU `size' resembles output from System V `size' (using `-A', or
  692.      `--format=sysv'), or Berkeley `size' (using `-B', or
  693.      `--format=berkeley').  The default is the one-line format similar
  694.      to Berkeley's.
  695.  
  696.      Here is an example of the Berkeley (default) format of output from
  697.      `size':
  698.           size --format Berkeley ranlib size
  699.           text    data    bss     dec     hex     filename
  700.           294880  81920   11592   388392  5ed28   ranlib
  701.           294880  81920   11888   388688  5ee50   size
  702.  
  703.      This is the same data, but displayed closer to System V
  704.      conventions:
  705.  
  706.           size --format SysV ranlib size
  707.           ranlib  :
  708.           section         size         addr
  709.           .text         294880         8192
  710.           .data          81920       303104
  711.           .bss           11592       385024
  712.           Total         388392
  713.           
  714.           
  715.           size  :
  716.           section         size         addr
  717.           .text         294880         8192
  718.           .data          81920       303104
  719.           .bss           11888       385024
  720.           Total         388688
  721.  
  722. `--help'
  723.      Show a summary of acceptable arguments and options.
  724.  
  725. `-d'
  726. `-o'
  727. `-x'
  728. `--radix=NUMBER'
  729.      Using one of these options, you can control whether the size of
  730.      each section is given in decimal (`-d', or `--radix=10'); octal
  731.      (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16').
  732.      In `--radix=NUMBER', only the three values (8, 10, 16) are
  733.      supported.  The total size is always given in two radices; decimal
  734.      and hexadecimal for `-d' or `-x' output, or octal and hexadecimal
  735.      if you're using `-o'.
  736.  
  737. `--target=BFDNAME'
  738.      Specify that the object-code format for OBJFILE is BFDNAME.  This
  739.      option may not be necessary; `size' can automatically recognize
  740.      many formats.  *Note objdump::, for information on listing
  741.      available formats.
  742.  
  743. `-V'
  744. `--version'
  745.      Display the version number of `size'.
  746.  
  747. 
  748. File: binutils.info,  Node: strip,  Next: cppfilt,  Prev: size,  Up: Top
  749.  
  750. strip
  751. *****
  752.  
  753.      strip [ -F FORMAT | --format=FORMAT | --target=FORMAT ]
  754.            [ -I FORMAT | --input-format=FORMAT ]
  755.            [ -O FORMAT | --output-format=FORMAT ]
  756.            [ -s | --strip-all ] [ -S | -g | --strip-debug ]
  757.            [ -x | --discard-all ] [ -X | --discard-locals ]
  758.            [ -v | --verbose ]  [ -V | --version ]
  759.            OBJFILE...
  760.  
  761.    GNU `strip' discards all symbols from object files OBJFILE.  The
  762. list of object files may include archives.
  763.  
  764.    `strip' will not execute unless at least one object file is listed.
  765.  
  766.    `strip' modifies the files named in its argument, rather than
  767. writing modified copies under different names.
  768.  
  769. `-I FORMAT'
  770. `--input-format=FORMAT'
  771.      Treat the original OBJFILE as a file with the object code format
  772.      FORMAT.
  773.  
  774. `-O FORMAT'
  775. `--output-format=FORMAT'
  776.      Replace OBJFILE with a file in the output format FORMAT.
  777.  
  778. `-F FORMAT'
  779. `--format=FORMAT'
  780. `--target=FORMAT'
  781.      Treat the original OBJFILE as a file with the object code format
  782.      FORMAT, and rewrite it in the same format.
  783.  
  784. `-s'
  785. `--strip-all'
  786.      Remove all symbols.
  787.  
  788. `-g'
  789. `-S'
  790. `--strip-debug'
  791.      Remove debugging symbols only.
  792.  
  793. `-x'
  794. `--discard-all'
  795.      Remove non-global symbols.
  796.  
  797. `-X'
  798. `--discard-locals'
  799.      Remove compiler-generated local symbols.  (These usually start
  800.      with `L' or `.'.)
  801.  
  802. `-V'
  803. `--version'
  804.      Show the version number for `strip'.
  805.  
  806. `-v'
  807. `--verbose'
  808.      Verbose output: list all object files modified.  In the case of
  809.      archives, `strip -v' lists all members of the archive.
  810.  
  811. 
  812. File: binutils.info,  Node: cppfilt,  Next: Index,  Prev: strip,  Up: Top
  813.  
  814. cppfilt
  815. *******
  816.  
  817.    The C++ language provides function overloading, which means that you
  818. can write many function with the same name (but taking different kinds
  819. of parameters).  So that the linker can keep these overloaded functions
  820. from clashing, all C++ function names are encoded ("mangled") into a
  821. funny-looking low-level assembly label.  The `cppfilt' program does the
  822. inverse mapping:  It decodes ("demangles") low-level names into
  823. user-level names.
  824.  
  825.    When you use `cppfilt' as a filter (which is usually the case), it
  826. reads from standard input.  Every alphanumeric word (consisting of
  827. letters, digits, underscores, dollars, or periods) seen in the input is
  828. a potential label.  If the label decodes into a C++ name.  the C++ name
  829. will replace the low-level name in the output.
  830.  
  831.    A typical use of `cppfilt' is to pipe the output of `nm' though it.
  832.  
  833.    Note that on some systems, both the C and C++ compilers put an
  834. underscore in front of every name.  (I.e. the C name `foo' gets the
  835. low-level name `_foo'.)  On such systems, `cppfilt' removes any initial
  836. underscore of a potential label.
  837.  
  838. 
  839. File: binutils.info,  Node: Index,  Prev: cppfilt,  Up: Top
  840.  
  841. Index
  842. *****
  843.  
  844. * Menu:
  845.  
  846. * .stab:                                objdump.
  847. * ar compatibility:                     ar.
  848. * a.out:                                nm.
  849. * all header information, object file:  objdump.
  850. * ar:                                   ar.
  851. * architecture:                         objdump.
  852. * architectures available:              objdump.
  853. * archive contents:                     ranlib.
  854. * archive headers:                      objdump.
  855. * archives:                             ar.
  856. * collections of files:                 ar.
  857. * compatibility, ar:                    ar.
  858. * contents of archive:                  ar-cmdline.
  859. * cppfilt:                              cppfilt.
  860. * creating archives:                    ar-cmdline.
  861. * dates in archive:                     ar-cmdline.
  862. * debug symbols:                        objdump.
  863. * debugging symbols:                    nm.
  864. * deleting from archive:                ar-cmdline.
  865. * demangling C++ symbols:               cppfilt.
  866. * disassembling object code:            objdump.
  867. * discarding symbols:                   strip.
  868. * ELF object file format:               objdump.
  869. * external symbols:                     nm.
  870. * external symbols:                     nm.
  871. * extract from archive:                 ar-cmdline.
  872. * file name:                            nm.
  873. * header information, all:              objdump.
  874. * input file name:                      nm.
  875. * libraries:                            ar.
  876. * machine instructions:                 objdump.
  877. * moving in archive:                    ar-cmdline.
  878. * MRI compatibility, ar:                ar-scripts.
  879. * name duplication in archive:          ar-cmdline.
  880. * name length:                          ar.
  881. * nm:                                   nm.
  882. * objdump:                              objdump.
  883. * object code format:                   size.
  884. * object code format:                   objdump.
  885. * object code format:                   nm.
  886. * object file header:                   objdump.
  887. * object file information:              objdump.
  888. * object file sections:                 objdump.
  889. * object formats available:             objdump.
  890. * operations on archive:                ar-cmdline.
  891. * printing from archive:                ar-cmdline.
  892. * quick append to archive:              ar-cmdline.
  893. * radix for section sizes:              size.
  894. * ranlib:                               ranlib.
  895. * relative placement in archive:        ar-cmdline.
  896. * relocation entries, in object file:   objdump.
  897. * removing symbols:                     strip.
  898. * repeated names in archive:            ar-cmdline.
  899. * replacement in archive:               ar-cmdline.
  900. * scripts, ar:                          ar-scripts.
  901. * section headers:                      objdump.
  902. * section information:                  objdump.
  903. * section sizes:                        size.
  904. * sections, full contents:              objdump.
  905. * size:                                 size.
  906. * size display format:                  size.
  907. * size number format:                   size.
  908. * sorting symbols:                      nm.
  909. * source file name:                     nm.
  910. * source filenames for object files:    objdump.
  911. * stab:                                 objdump.
  912. * strip:                                strip.
  913. * symbol index:                         ranlib.
  914. * symbol index:                         ar.
  915. * symbol index, listing:                nm.
  916. * symbol table entries, printing:       objdump.
  917. * symbols:                              nm.
  918. * symbols, discarding:                  strip.
  919. * undefined symbols:                    nm.
  920. * Unix compatibility, ar:               ar-cmdline.
  921. * updating an archive:                  ar-cmdline.
  922. * version:                              Top.
  923. * writing archive index:                ar-cmdline.
  924.  
  925.  
  926. 
  927. Tag Table:
  928. Node: Top900
  929. Node: ar1685
  930. Node: ar-cmdline3856
  931. Node: ar-scripts10275
  932. Node: objcopy15948
  933. Node: nm18242
  934. Node: objdump20057
  935. Node: ranlib23424
  936. Node: size24158
  937. Node: strip26842
  938. Node: cppfilt28453
  939. Node: Index29627
  940. 
  941. End Tag Table
  942.