<HTML> <HEAD> <!-- This HTML file has been created by texi2html 1.51 from /SourceCache/gdb/gdb-113/gdb/binutils/binutils.texi on 23 August 1998 --> <TITLE>gnu Binary Utilities</TITLE> </HEAD> <BODY> <H1>The GNU Binary Utilities</H1> <H2>Version 2.8</H2> <H2>May 1993</H2> <ADDRESS>Roland H. Pesch</ADDRESS> <ADDRESS>Jeffrey M. Osier</ADDRESS> <ADDRESS>Cygnus Support</ADDRESS> <P> <P><HR><P> <H1><A NAME="SEC1" HREF="binutils_toc.html#TOC1">ar</A></H1> <P> <A NAME="IDX1"></A> <A NAME="IDX2"></A> <A NAME="IDX3"></A> <PRE> ar [-]<VAR>p</VAR>[<VAR>mod</VAR> [<VAR>relpos</VAR>]] <VAR>archive</VAR> [<VAR>member</VAR>...] ar -M [ <mri-script ] </PRE> <P> The GNU <CODE>ar</CODE> program creates, modifies, and extracts from archives. An <STRONG>archive</STRONG> is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called <STRONG>members</STRONG> of the archive). </P> <P> The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction. </P> <P> <A NAME="IDX4"></A> GNU <CODE>ar</CODE> can maintain archives whose members have names of any length; however, depending on how <CODE>ar</CODE> is configured on your system, a limit on member-name length may be imposed for compatibility with archive formats maintained with other tools. If it exists, the limit is often 15 characters (typical of formats related to a.out) or 16 characters (typical of formats related to coff). </P> <P> <A NAME="IDX5"></A> <CODE>ar</CODE> is considered a binary utility because archives of this sort are most often used as <STRONG>libraries</STRONG> holding commonly needed subroutines. </P> <P> <A NAME="IDX6"></A> <CODE>ar</CODE> creates an index to the symbols defined in relocatable object modules in the archive when you specify the modifier <SAMP>`s'</SAMP>. Once created, this index is updated in the archive whenever <CODE>ar</CODE> makes a change to its contents (save for the <SAMP>`q'</SAMP> update operation). An archive with such an index speeds up linking to the library, and allows routines in the library to call each other without regard to their placement in the archive. </P> <P> You may use <SAMP>`nm -s'</SAMP> or <SAMP>`nm --print-armap'</SAMP> to list this index table. If an archive lacks the table, another form of <CODE>ar</CODE> called <CODE>ranlib</CODE> can be used to add just the table. </P> <P> <A NAME="IDX7"></A> <A NAME="IDX8"></A> GNU <CODE>ar</CODE> is designed to be compatible with two different facilities. You can control its activity using command-line options, like the different varieties of <CODE>ar</CODE> on Unix systems; or, if you specify the single command-line option <SAMP>`-M'</SAMP>, you can control it with a script supplied via standard input, like the MRI "librarian" program. </P> <H2><A NAME="SEC2" HREF="binutils_toc.html#TOC2">Controlling <CODE>ar</CODE> on the command line</A></H2> <PRE> ar [-]<VAR>p</VAR>[<VAR>mod</VAR> [<VAR>relpos</VAR>]] <VAR>archive</VAR> [<VAR>member</VAR>...] </PRE> <P> <A NAME="IDX9"></A> When you use <CODE>ar</CODE> in the Unix style, <CODE>ar</CODE> insists on at least two arguments to execute: one keyletter specifying the <EM>operation</EM> (optionally accompanied by other keyletters specifying <EM>modifiers</EM>), and the archive name to act on. </P> <P> Most operations can also accept further <VAR>member</VAR> arguments, specifying particular files to operate on. </P> <P> GNU <CODE>ar</CODE> allows you to mix the operation code <VAR>p</VAR> and modifier flags <VAR>mod</VAR> in any order, within the first command-line argument. </P> <P> If you wish, you may begin the first command-line argument with a dash. </P> <P> <A NAME="IDX10"></A> The <VAR>p</VAR> keyletter specifies what operation to execute; it may be any of the following, but you must specify only one of them: </P> <DL COMPACT> <DT><CODE>d</CODE> <DD> <A NAME="IDX11"></A> <EM>Delete</EM> modules from the archive. Specify the names of modules to be deleted as <VAR>member</VAR>...; the archive is untouched if you specify no files to delete. If you specify the <SAMP>`v'</SAMP> modifier, <CODE>ar</CODE> lists each module as it is deleted. <DT><CODE>m</CODE> <DD> <A NAME="IDX12"></A> Use this operation to <EM>move</EM> members in an archive. The ordering of members in an archive can make a difference in how programs are linked using the library, if a symbol is defined in more than one member. If no modifiers are used with <CODE>m</CODE>, any members you name in the <VAR>member</VAR> arguments are moved to the <EM>end</EM> of the archive; you can use the <SAMP>`a'</SAMP>, <SAMP>`b'</SAMP>, or <SAMP>`i'</SAMP> modifiers to move them to a specified place instead. <DT><CODE>p</CODE> <DD> <A NAME="IDX13"></A> <EM>Print</EM> the specified members of the archive, to the standard output file. If the <SAMP>`v'</SAMP> modifier is specified, show the member name before copying its contents to standard output. If you specify no <VAR>member</VAR> arguments, all the files in the archive are printed. <DT><CODE>q</CODE> <DD> <A NAME="IDX14"></A> <EM>Quick append</EM>; add the files <VAR>member</VAR>... to the end of <VAR>archive</VAR>, without checking for replacement. The modifiers <SAMP>`a'</SAMP>, <SAMP>`b'</SAMP>, and <SAMP>`i'</SAMP> do <EM>not</EM> affect this operation; new members are always placed at the end of the archive. The modifier <SAMP>`v'</SAMP> makes <CODE>ar</CODE> list each file as it is appended. Since the point of this operation is speed, the archive's symbol table index is not updated, even if it already existed; you can use <SAMP>`ar s'</SAMP> or <CODE>ranlib</CODE> explicitly to update the symbol table index. <DT><CODE>r</CODE> <DD> <A NAME="IDX15"></A> Insert the files <VAR>member</VAR>... into <VAR>archive</VAR> (with <EM>replacement</EM>). This operation differs from <SAMP>`q'</SAMP> in that any previously existing members are deleted if their names match those being added. If one of the files named in <VAR>member</VAR>... does not exist, <CODE>ar</CODE> displays an error message, and leaves undisturbed any existing members of the archive matching that name. By default, new members are added at the end of the file; but you may use one of the modifiers <SAMP>`a'</SAMP>, <SAMP>`b'</SAMP>, or <SAMP>`i'</SAMP> to request placement relative to some existing member. The modifier <SAMP>`v'</SAMP> used with this operation elicits a line of output for each file inserted, along with one of the letters <SAMP>`a'</SAMP> or <SAMP>`r'</SAMP> to indicate whether the file was appended (no old member deleted) or replaced. <DT><CODE>t</CODE> <DD> <A NAME="IDX16"></A> Display a <EM>table</EM> listing the contents of <VAR>archive</VAR>, or those of the files listed in <VAR>member</VAR>... that are present in the archive. Normally only the member name is shown; if you also want to see the modes (permissions), timestamp, owner, group, and size, you can request that by also specifying the <SAMP>`v'</SAMP> modifier. If you do not specify a <VAR>member</VAR>, all files in the archive are listed. <A NAME="IDX17"></A> <A NAME="IDX18"></A> If there is more than one file with the same name (say, <SAMP>`fie'</SAMP>) in an archive (say <SAMP>`b.a'</SAMP>), <SAMP>`ar t b.a fie'</SAMP> lists only the first instance; to see them all, you must ask for a complete listing--in our example, <SAMP>`ar t b.a'</SAMP>. <DT><CODE>x</CODE> <DD> <A NAME="IDX19"></A> <EM>Extract</EM> members (named <VAR>member</VAR>) from the archive. You can use the <SAMP>`v'</SAMP> modifier with this operation, to request that <CODE>ar</CODE> list each name as it extracts it. If you do not specify a <VAR>member</VAR>, all files in the archive are extracted. </DL> <P> A number of modifiers (<VAR>mod</VAR>) may immediately follow the <VAR>p</VAR> keyletter, to specify variations on an operation's behavior: </P> <DL COMPACT> <DT><CODE>a</CODE> <DD> <A NAME="IDX20"></A> Add new files <EM>after</EM> an existing member of the archive. If you use the modifier <SAMP>`a'</SAMP>, the name of an existing archive member must be present as the <VAR>relpos</VAR> argument, before the <VAR>archive</VAR> specification. <DT><CODE>b</CODE> <DD> Add new files <EM>before</EM> an existing member of the archive. If you use the modifier <SAMP>`b'</SAMP>, the name of an existing archive member must be present as the <VAR>relpos</VAR> argument, before the <VAR>archive</VAR> specification. (same as <SAMP>`i'</SAMP>). <DT><CODE>c</CODE> <DD> <A NAME="IDX21"></A> <EM>Create</EM> the archive. The specified <VAR>archive</VAR> is always created if it did not exist, when you request an update. But a warning is issued unless you specify in advance that you expect to create it, by using this modifier. <DT><CODE>f</CODE> <DD> Truncate names in the archive. GNU <CODE>ar</CODE> will normally permit file names of any length. This will cause it to create archives which are not compatible with the native <CODE>ar</CODE> program on some systems. If this is a concern, the <SAMP>`f'</SAMP> modifier may be used to truncate file names when putting them in the archive. <DT><CODE>i</CODE> <DD> Insert new files <EM>before</EM> an existing member of the archive. If you use the modifier <SAMP>`i'</SAMP>, the name of an existing archive member must be present as the <VAR>relpos</VAR> argument, before the <VAR>archive</VAR> specification. (same as <SAMP>`b'</SAMP>). <DT><CODE>l</CODE> <DD> This modifier is accepted but not used. <DT><CODE>o</CODE> <DD> <A NAME="IDX22"></A> Preserve the <EM>original</EM> 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. <DT><CODE>s</CODE> <DD> <A NAME="IDX23"></A> Write an object-file index into the archive, or update an existing one, even if no other change is made to the archive. You may use this modifier flag either with any operation, or alone. Running <SAMP>`ar s'</SAMP> on an archive is equivalent to running <SAMP>`ranlib'</SAMP> on it. <DT><CODE>u</CODE> <DD> <A NAME="IDX24"></A> Normally, <SAMP>`ar r'</SAMP>... inserts all files listed into the archive. If you would like to insert <EM>only</EM> those of the files you list that are newer than existing members of the same names, use this modifier. The <SAMP>`u'</SAMP> modifier is allowed only for the operation <SAMP>`r'</SAMP> (replace). In particular, the combination <SAMP>`qu'</SAMP> is not allowed, since checking the timestamps would lose any speed advantage from the operation <SAMP>`q'</SAMP>. <DT><CODE>v</CODE> <DD> This modifier requests the <EM>verbose</EM> version of an operation. Many operations display additional information, such as filenames processed, when the modifier <SAMP>`v'</SAMP> is appended. <DT><CODE>V</CODE> <DD> This modifier shows the version number of <CODE>ar</CODE>. </DL> <H2><A NAME="SEC3" HREF="binutils_toc.html#TOC3">Controlling <CODE>ar</CODE> with a script</A></H2> <PRE> ar -M [ <<VAR>script</VAR> ] </PRE> <P> <A NAME="IDX25"></A> <A NAME="IDX26"></A> If you use the single command-line option <SAMP>`-M'</SAMP> with <CODE>ar</CODE>, you can control its operation with a rudimentary command language. This form of <CODE>ar</CODE> operates interactively if standard input is coming directly from a terminal. During interactive use, <CODE>ar</CODE> prompts for input (the prompt is <SAMP>`AR >'</SAMP>), and continues executing even after errors. If you redirect standard input to a script file, no prompts are issued, and <CODE>ar</CODE> abandons execution (with a nonzero exit code) on any error. </P> <P> The <CODE>ar</CODE> command language is <EM>not</EM> designed to be equivalent to the command-line options; in fact, it provides somewhat less control over archives. The only purpose of the command language is to ease the transition to GNU <CODE>ar</CODE> for developers who already have scripts written for the MRI "librarian" program. </P> <P> The syntax for the <CODE>ar</CODE> command language is straightforward: <UL> <LI> commands are recognized in upper or lower case; for example, <CODE>LIST</CODE> is the same as <CODE>list</CODE>. In the following descriptions, commands are shown in upper case for clarity. <LI> a single command may appear on each line; it is the first word on the line. <LI> empty lines are allowed, and have no effect. <LI> comments are allowed; text after either of the characters <SAMP>`*'</SAMP> or <SAMP>`;'</SAMP> is ignored. <LI> Whenever you use a list of names as part of the argument to an <CODE>ar</CODE> command, you can separate the individual names with either commas or blanks. Commas are shown in the explanations below, for clarity. <LI> <SAMP>`+'</SAMP> is used as a line continuation character; if <SAMP>`+'</SAMP> appears at the end of a line, the text on the following line is considered part of the current command. </UL> <P> Here are the commands you can use in <CODE>ar</CODE> scripts, or when using <CODE>ar</CODE> interactively. Three of them have special significance: </P> <P> <CODE>OPEN</CODE> or <CODE>CREATE</CODE> specify a <STRONG>current archive</STRONG>, which is a temporary file required for most of the other commands. </P> <P> <CODE>SAVE</CODE> commits the changes so far specified by the script. Prior to <CODE>SAVE</CODE>, commands affect only the temporary copy of the current archive. </P> <DL COMPACT> <DT><CODE>ADDLIB <VAR>archive</VAR></CODE> <DD> <DT><CODE>ADDLIB <VAR>archive</VAR> (<VAR>module</VAR>, <VAR>module</VAR>, ... <VAR>module</VAR>)</CODE> <DD> Add all the contents of <VAR>archive</VAR> (or, if specified, each named <VAR>module</VAR> from <VAR>archive</VAR>) to the current archive. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>ADDMOD <VAR>member</VAR>, <VAR>member</VAR>, ... <VAR>member</VAR></CODE> <DD> Add each named <VAR>member</VAR> as a module in the current archive. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>CLEAR</CODE> <DD> Discard the contents of the current archive, cancelling the effect of any operations since the last <CODE>SAVE</CODE>. May be executed (with no effect) even if no current archive is specified. <DT><CODE>CREATE <VAR>archive</VAR></CODE> <DD> Creates an archive, and makes it the current archive (required for many other commands). The new archive is created with a temporary name; it is not actually saved as <VAR>archive</VAR> until you use <CODE>SAVE</CODE>. You can overwrite existing archives; similarly, the contents of any existing file named <VAR>archive</VAR> will not be destroyed until <CODE>SAVE</CODE>. <DT><CODE>DELETE <VAR>module</VAR>, <VAR>module</VAR>, ... <VAR>module</VAR></CODE> <DD> Delete each listed <VAR>module</VAR> from the current archive; equivalent to <SAMP>`ar -d <VAR>archive</VAR> <VAR>module</VAR> ... <VAR>module</VAR>'</SAMP>. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>DIRECTORY <VAR>archive</VAR> (<VAR>module</VAR>, ... <VAR>module</VAR>)</CODE> <DD> <DT><CODE>DIRECTORY <VAR>archive</VAR> (<VAR>module</VAR>, ... <VAR>module</VAR>) <VAR>outputfile</VAR></CODE> <DD> List each named <VAR>module</VAR> present in <VAR>archive</VAR>. The separate command <CODE>VERBOSE</CODE> specifies the form of the output: when verbose output is off, output is like that of <SAMP>`ar -t <VAR>archive</VAR> <VAR>module</VAR>...'</SAMP>. When verbose output is on, the listing is like <SAMP>`ar -tv <VAR>archive</VAR> <VAR>module</VAR>...'</SAMP>. Output normally goes to the standard output stream; however, if you specify <VAR>outputfile</VAR> as a final argument, <CODE>ar</CODE> directs the output to that file. <DT><CODE>END</CODE> <DD> Exit from <CODE>ar</CODE>, with a <CODE>0</CODE> exit code to indicate successful completion. This command does not save the output file; if you have changed the current archive since the last <CODE>SAVE</CODE> command, those changes are lost. <DT><CODE>EXTRACT <VAR>module</VAR>, <VAR>module</VAR>, ... <VAR>module</VAR></CODE> <DD> Extract each named <VAR>module</VAR> from the current archive, writing them into the current directory as separate files. Equivalent to <SAMP>`ar -x <VAR>archive</VAR> <VAR>module</VAR>...'</SAMP>. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>LIST</CODE> <DD> Display full contents of the current archive, in "verbose" style regardless of the state of <CODE>VERBOSE</CODE>. The effect is like <SAMP>`ar tv <VAR>archive</VAR>'</SAMP>). (This single command is a GNU <CODE>ld</CODE> enhancement, rather than present for MRI compatibility.) Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>OPEN <VAR>archive</VAR></CODE> <DD> Opens an existing archive for use as the current archive (required for many other commands). Any changes as the result of subsequent commands will not actually affect <VAR>archive</VAR> until you next use <CODE>SAVE</CODE>. <DT><CODE>REPLACE <VAR>module</VAR>, <VAR>module</VAR>, ... <VAR>module</VAR></CODE> <DD> In the current archive, replace each existing <VAR>module</VAR> (named in the <CODE>REPLACE</CODE> arguments) from files in the current working directory. To execute this command without errors, both the file, and the module in the current archive, must exist. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. <DT><CODE>VERBOSE</CODE> <DD> Toggle an internal flag governing the output from <CODE>DIRECTORY</CODE>. When the flag is on, <CODE>DIRECTORY</CODE> output matches output from <SAMP>`ar -tv '</SAMP>.... <DT><CODE>SAVE</CODE> <DD> Commit your changes to the current archive, and actually save it as a file with the name specified in the last <CODE>CREATE</CODE> or <CODE>OPEN</CODE> command. Requires prior use of <CODE>OPEN</CODE> or <CODE>CREATE</CODE>. </DL> <H1><A NAME="SEC4" HREF="binutils_toc.html#TOC4">ld</A></H1> <P> <A NAME="IDX27"></A> <A NAME="IDX28"></A> The GNU linker <CODE>ld</CODE> is now described in a separate manual. See section `Overview' in <CITE>Using LD: the GNU linker</CITE>. </P> <H1><A NAME="SEC5" HREF="binutils_toc.html#TOC5">nm</A></H1> <P> <A NAME="IDX29"></A> <A NAME="IDX30"></A> </P> <PRE> nm [ -a | --debug-syms ] [ -g | --extern-only ] [ -B ] [ -C | --demangle ] [ -D | --dynamic ] [ -s | --print-armap ] [ -A | -o | --print-file-name ] [ -n | -v | --numeric-sort ] [ -p | --no-sort ] [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] [ -t <VAR>radix</VAR> | --radix=<VAR>radix</VAR> ] [ -P | --portability ] [ --target=<VAR>bfdname</VAR> ] [ -f <VAR>format</VAR> | --format=<VAR>format</VAR> ] [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] [ -V | --version ] [ --help ] [ <VAR>objfile</VAR>... ] </PRE> <P> GNU <CODE>nm</CODE> lists the symbols from object files <VAR>objfile</VAR>.... If no object files are listed as arguments, <CODE>nm</CODE> assumes <TT>`a.out'</TT>. </P> <P> For each symbol, <CODE>nm</CODE> shows: </P> <UL> <LI> The symbol value, in the radix selected by options (see below), or hexadecimal by default. <LI> The symbol type. At least the following types are used; others are, as well, depending on the object file format. If lowercase, the symbol is local; if uppercase, the symbol is global (external). <DL COMPACT> <DT><CODE>A</CODE> <DD> The symbol's value is absolute, and will not be changed by further linking. <DT><CODE>B</CODE> <DD> The symbol is in the uninitialized data section (known as BSS). <DT><CODE>C</CODE> <DD> The symbol is common. Common symbols are uninitialized data. When linking, multiple common symbols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references. For more details on common symbols, see the discussion of --warn-common in section `Linker options' in <CITE>The GNU linker</CITE>. <DT><CODE>D</CODE> <DD> The symbol is in the initialized data section. <DT><CODE>G</CODE> <DD> The symbol is in an initialized data section for small objects. Some object file formats permit more efficient access to small data objects, such as a global int variable as opposed to a large global array. <DT><CODE>I</CODE> <DD> The symbol is an indirect reference to another symbol. This is a GNU extension to the a.out object file format which is rarely used. <DT><CODE>N</CODE> <DD> The symbol is a debugging symbol. <DT><CODE>R</CODE> <DD> The symbol is in a read only data section. <DT><CODE>S</CODE> <DD> The symbol is in an uninitialized data section for small objects. <DT><CODE>T</CODE> <DD> The symbol is in the text (code) section. <DT><CODE>U</CODE> <DD> The symbol is undefined. <DT><CODE>W</CODE> <DD> The symbol is weak. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the weak symbol becomes zero with no error. <DT><CODE>-</CODE> <DD> The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and the stab type. Stabs symbols are used to hold debugging information; for more information, see section `Stabs Overview' in <CITE>The "stabs" debug format</CITE>. <DT><CODE>?</CODE> <DD> The symbol type is unknown, or object file format specific. </DL> <LI> The symbol name. </UL> <P> The long and short forms of options, shown here as alternatives, are equivalent. </P> <DL COMPACT> <DT><CODE>-A</CODE> <DD> <DT><CODE>-o</CODE> <DD> <DT><CODE>--print-file-name</CODE> <DD> <A NAME="IDX31"></A> <A NAME="IDX32"></A> <A NAME="IDX33"></A> Precede each symbol by the name of the input file (or archive element) in which it was found, rather than identifying the input file once only, before all of its symbols. <DT><CODE>-a</CODE> <DD> <DT><CODE>--debug-syms</CODE> <DD> <A NAME="IDX34"></A> Display all symbols, even debugger-only symbols; normally these are not listed. <DT><CODE>-B</CODE> <DD> <A NAME="IDX35"></A> <A NAME="IDX36"></A> The same as <SAMP>`--format=bsd'</SAMP> (for compatibility with the MIPS <CODE>nm</CODE>). <DT><CODE>-C</CODE> <DD> <DT><CODE>--demangle</CODE> <DD> <A NAME="IDX37"></A> Decode (<STRONG>demangle</STRONG>) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. See section <A HREF="binutils.html#SEC12">c++filt</A>, for more information on demangling. <DT><CODE>--no-demangle</CODE> <DD> Do not demangle low-level symbol names. This is the default. <DT><CODE>-D</CODE> <DD> <DT><CODE>--dynamic</CODE> <DD> <A NAME="IDX38"></A> Display the dynamic symbols rather than the normal symbols. This is only meaningful for dynamic objects, such as certain types of shared libraries. <DT><CODE>-f <VAR>format</VAR></CODE> <DD> <DT><CODE>--format=<VAR>format</VAR></CODE> <DD> <A NAME="IDX39"></A> <A NAME="IDX40"></A> Use the output format <VAR>format</VAR>, which can be <CODE>bsd</CODE>, <CODE>sysv</CODE>, or <CODE>posix</CODE>. The default is <CODE>bsd</CODE>. Only the first character of <VAR>format</VAR> is significant; it can be either upper or lower case. <DT><CODE>-g</CODE> <DD> <DT><CODE>--extern-only</CODE> <DD> <A NAME="IDX41"></A> Display only external symbols. <DT><CODE>-l</CODE> <DD> <DT><CODE>--line-numbers</CODE> <DD> <A NAME="IDX42"></A> For each symbol, use debugging information to try to find a filename and line number. For a defined symbol, look for the line number of the address of the symbol. For an undefined symbol, look for the line number of a relocation entry which refers to the symbol. If line number information can be found, print it after the other symbol information. <DT><CODE>-n</CODE> <DD> <DT><CODE>-v</CODE> <DD> <DT><CODE>--numeric-sort</CODE> <DD> Sort symbols numerically by their addresses, rather than alphabetically by their names. <DT><CODE>-p</CODE> <DD> <DT><CODE>--no-sort</CODE> <DD> <A NAME="IDX43"></A> Do not bother to sort the symbols in any order; print them in the order encountered. <DT><CODE>-P</CODE> <DD> <DT><CODE>--portability</CODE> <DD> Use the POSIX.2 standard output format instead of the default format. Equivalent to <SAMP>`-f posix'</SAMP>. <DT><CODE>-s</CODE> <DD> <DT><CODE>--print-armap</CODE> <DD> <A NAME="IDX44"></A> When listing symbols from archive members, include the index: a mapping (stored in the archive by <CODE>ar</CODE> or <CODE>ranlib</CODE>) of which modules contain definitions for which names. <DT><CODE>-r</CODE> <DD> <DT><CODE>--reverse-sort</CODE> <DD> Reverse the order of the sort (whether numeric or alphabetic); let the last come first. <DT><CODE>--size-sort</CODE> <DD> Sort symbols by size. The size is computed as the difference between the value of the symbol and the value of the symbol with the next higher value. The size of the symbol is printed, rather than the value. <DT><CODE>-t <VAR>radix</VAR></CODE> <DD> <DT><CODE>--radix=<VAR>radix</VAR></CODE> <DD> Use <VAR>radix</VAR> as the radix for printing the symbol values. It must be <SAMP>`d'</SAMP> for decimal, <SAMP>`o'</SAMP> for octal, or <SAMP>`x'</SAMP> for hexadecimal. <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> <A NAME="IDX45"></A> Specify an object code format other than your system's default format. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-u</CODE> <DD> <DT><CODE>--undefined-only</CODE> <DD> <A NAME="IDX46"></A> <A NAME="IDX47"></A> Display only undefined symbols (those external to each object file). <DT><CODE>--defined-only</CODE> <DD> <A NAME="IDX48"></A> <A NAME="IDX49"></A> Display only defined symbols for each object file. <DT><CODE>-V</CODE> <DD> <DT><CODE>--version</CODE> <DD> Show the version number of <CODE>nm</CODE> and exit. <DT><CODE>--help</CODE> <DD> Show a summary of the options to <CODE>nm</CODE> and exit. </DL> <H1><A NAME="SEC6" HREF="binutils_toc.html#TOC6">objcopy</A></H1> <PRE> objcopy [ -F <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ -I <VAR>bfdname</VAR> | --input-target=<VAR>bfdname</VAR> ] [ -O <VAR>bfdname</VAR> | --output-target=<VAR>bfdname</VAR> ] [ -S | --strip-all ] [ -g | --strip-debug ] [ -K <VAR>symbolname</VAR> | --keep-symbol=<VAR>symbolname</VAR> ] [ -N <VAR>symbolname</VAR> | --strip-symbol=<VAR>symbolname</VAR> ] [ -x | --discard-all ] [ -X | --discard-locals ] [ -b <VAR>byte</VAR> | --byte=<VAR>byte</VAR> ] [ -i <VAR>interleave</VAR> | --interleave=<VAR>interleave</VAR> ] [ -R <VAR>sectionname</VAR> | --remove-section=<VAR>sectionname</VAR> ] [ -p | --preserve-dates ] [ --debugging ] [ --gap-fill=<VAR>val</VAR> ] [ --pad-to=<VAR>address</VAR> ] [ --set-start=<VAR>val</VAR> ] [ --adjust-start=<VAR>incr</VAR> ] [ --adjust-vma=<VAR>incr</VAR> ] [ --adjust-section-vma=<VAR>section</VAR>{=,+,-}<VAR>val</VAR> ] [ --adjust-warnings ] [ --no-adjust-warnings ] [ --set-section-flags=<VAR>section</VAR>=<VAR>flags</VAR> ] [ --add-section=<VAR>sectionname</VAR>=<VAR>filename</VAR> ] [ --change-leading-char ] [ --remove-leading-char ] [ --weaken ] [ -v | --verbose ] [ -V | --version ] [ --help ] <VAR>infile</VAR> [<VAR>outfile</VAR>] </PRE> <P> The GNU <CODE>objcopy</CODE> utility copies the contents of an object file to another. <CODE>objcopy</CODE> uses the GNU BFD Library to read and write the object files. It can write the destination object file in a format different from that of the source object file. The exact behavior of <CODE>objcopy</CODE> is controlled by command-line options. </P> <P> <CODE>objcopy</CODE> creates temporary files to do its translations and deletes them afterward. <CODE>objcopy</CODE> uses BFD to do all its translation work; it has access to all the formats described in BFD and thus is able to recognize most formats without being told explicitly. See section `BFD' in <CITE>Using LD</CITE>. </P> <P> <CODE>objcopy</CODE> can be used to generate S-records by using an output target of <SAMP>`srec'</SAMP> (e.g., use <SAMP>`-O srec'</SAMP>). </P> <P> <CODE>objcopy</CODE> can be used to generate a raw binary file by using an output target of <SAMP>`binary'</SAMP> (e.g., use <SAMP>`-O binary'</SAMP>). When <CODE>objcopy</CODE> generates a raw binary file, it will essentially produce a memory dump of the contents of the input object file. All symbols and relocation information will be discarded. The memory dump will start at the load address of the lowest section copied into the output file. </P> <P> When generating an S-record or a raw binary file, it may be helpful to use <SAMP>`-S'</SAMP> to remove sections containing debugging information. In some cases <SAMP>`-R'</SAMP> will be useful to remove sections which contain information which is not needed by the binary file. </P> <DL COMPACT> <DT><CODE><VAR>infile</VAR></CODE> <DD> <DT><CODE><VAR>outfile</VAR></CODE> <DD> The source and output files, respectively. If you do not specify <VAR>outfile</VAR>, <CODE>objcopy</CODE> creates a temporary file and destructively renames the result with the name of <VAR>infile</VAR>. <DT><CODE>-I <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--input-target=<VAR>bfdname</VAR></CODE> <DD> Consider the source file's object format to be <VAR>bfdname</VAR>, rather than attempting to deduce it. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-O <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--output-target=<VAR>bfdname</VAR></CODE> <DD> Write the output file using the object format <VAR>bfdname</VAR>. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-F <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> Use <VAR>bfdname</VAR> as the object format for both the input and the output file; i.e., simply transfer data from source to destination with no translation. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-R <VAR>sectionname</VAR></CODE> <DD> <DT><CODE>--remove-section=<VAR>sectionname</VAR></CODE> <DD> Remove any section named <VAR>sectionname</VAR> from the output file. This option may be given more than once. Note that using this option inappropriately may make the output file unusable. <DT><CODE>-S</CODE> <DD> <DT><CODE>--strip-all</CODE> <DD> Do not copy relocation and symbol information from the source file. <DT><CODE>-g</CODE> <DD> <DT><CODE>--strip-debug</CODE> <DD> Do not copy debugging symbols from the source file. <DT><CODE>--strip-unneeded</CODE> <DD> Strip all symbols that are not needed for relocation processing. <DT><CODE>-K <VAR>symbolname</VAR></CODE> <DD> <DT><CODE>--keep-symbol=<VAR>symbolname</VAR></CODE> <DD> Copy only symbol <VAR>symbolname</VAR> from the source file. This option may be given more than once. <DT><CODE>-N <VAR>symbolname</VAR></CODE> <DD> <DT><CODE>--strip-symbol=<VAR>symbolname</VAR></CODE> <DD> Do not copy symbol <VAR>symbolname</VAR> from the source file. This option may be given more than once, and may be combined with strip options other than <CODE>-K</CODE>. <DT><CODE>-x</CODE> <DD> <DT><CODE>--discard-all</CODE> <DD> Do not copy non-global symbols from the source file. <DT><CODE>-X</CODE> <DD> <DT><CODE>--discard-locals</CODE> <DD> Do not copy compiler-generated local symbols. (These usually start with <SAMP>`L'</SAMP> or <SAMP>`.'</SAMP>.) <DT><CODE>-b <VAR>byte</VAR></CODE> <DD> <DT><CODE>--byte=<VAR>byte</VAR></CODE> <DD> Keep only every <VAR>byte</VAR>th byte of the input file (header data is not affected). <VAR>byte</VAR> can be in the range from 0 to <VAR>interleave</VAR>-1, where <VAR>interleave</VAR> is given by the <SAMP>`-i'</SAMP> or <SAMP>`--interleave'</SAMP> option, or the default of 4. This option is useful for creating files to program ROM. It is typically used with an <CODE>srec</CODE> output target. <DT><CODE>-i <VAR>interleave</VAR></CODE> <DD> <DT><CODE>--interleave=<VAR>interleave</VAR></CODE> <DD> Only copy one out of every <VAR>interleave</VAR> bytes. Select which byte to copy with the <VAR>-b</VAR> or <SAMP>`--byte'</SAMP> option. The default is 4. <CODE>objcopy</CODE> ignores this option if you do not specify either <SAMP>`-b'</SAMP> or <SAMP>`--byte'</SAMP>. <DT><CODE>-p</CODE> <DD> <DT><CODE>--preserve-dates</CODE> <DD> Set the access and modification dates of the output file to be the same as those of the input file. <DT><CODE>--debugging</CODE> <DD> Convert debugging information, if possible. This is not the default because only certain debugging formats are supported, and the conversion process can be time consuming. <DT><CODE>--gap-fill <VAR>val</VAR></CODE> <DD> Fill gaps between sections with <VAR>val</VAR>. This is done by increasing the size of the section with the lower address, and filling in the extra space created with <VAR>val</VAR>. <DT><CODE>--pad-to <VAR>address</VAR></CODE> <DD> Pad the output file up to the virtual address <VAR>address</VAR>. This is done by increasing the size of the last section. The extra space is filled in with the value specified by <SAMP>`--gap-fill'</SAMP> (default zero). <DT><CODE>--set-start <VAR>val</VAR></CODE> <DD> Set the address of the new file to <VAR>val</VAR>. Not all object file formats support setting the start address. <DT><CODE>--adjust-start <VAR>incr</VAR></CODE> <DD> Adjust the start address by adding <VAR>incr</VAR>. Not all object file formats support setting the start address. <DT><CODE>--adjust-vma <VAR>incr</VAR></CODE> <DD> Adjust the address of all sections, as well as the start address, by adding <VAR>incr</VAR>. Some object file formats do not permit section addresses to be changed arbitrarily. Note that this does not relocate the sections; if the program expects sections to be loaded at a certain address, and this option is used to change the sections such that they are loaded at a different address, the program may fail. <DT><CODE>--adjust-section-vma <VAR>section</VAR>{=,+,-}<VAR>val</VAR></CODE> <DD> Set or adjust the address of the named <VAR>section</VAR>. If <SAMP>`='</SAMP> is used, the section address is set to <VAR>val</VAR>. Otherwise, <VAR>val</VAR> is added to or subtracted from the section address. See the comments under <SAMP>`--adjust-vma'</SAMP>, above. If <VAR>section</VAR> does not exist in the input file, a warning will be issued, unless <SAMP>`--no-adjust-warnings'</SAMP> is used. <DT><CODE>--adjust-warnings</CODE> <DD> If <SAMP>`--adjust-section-vma'</SAMP> is used, and the named section does not exist, issue a warning. This is the default. <DT><CODE>--no-adjust-warnings</CODE> <DD> Do not issue a warning if <SAMP>`--adjust-section-vma'</SAMP> is used, even if the named section does not exist. <DT><CODE>--set-section-flags <VAR>section</VAR>=<VAR>flags</VAR></CODE> <DD> Set the flags for the named section. The <VAR>flags</VAR> argument is a comma separated string of flag names. The recognized names are <SAMP>`alloc'</SAMP>, <SAMP>`load'</SAMP>, <SAMP>`readonly'</SAMP>, <SAMP>`code'</SAMP>, <SAMP>`data'</SAMP>, and <SAMP>`rom'</SAMP>. Not all flags are meaningful for all object file formats. <DT><CODE>--add-section <VAR>sectionname</VAR>=<VAR>filename</VAR></CODE> <DD> Add a new section named <VAR>sectionname</VAR> while copying the file. The contents of the new section are taken from the file <VAR>filename</VAR>. The size of the section will be the size of the file. This option only works on file formats which can support sections with arbitrary names. <DT><CODE>--change-leading-char</CODE> <DD> Some object file formats use special characters at the start of symbols. The most common such character is underscore, which compilers often add before every symbol. This option tells <CODE>objcopy</CODE> to change the leading character of every symbol when it converts between object file formats. If the object file formats use the same leading character, this option has no effect. Otherwise, it will add a character, or remove a character, or change a character, as appropriate. <DT><CODE>--remove-leading-char</CODE> <DD> If the first character of a global symbol is a special symbol leading character used by the object file format, remove the character. The most common symbol leading character is underscore. This option will remove a leading underscore from all global symbols. This can be useful if you want to link together objects of different file formats with different conventions for symbol names. This is different from <CODE>--change-leading-char</CODE> because it always changes the symbol name when appropriate, regardless of the object file format of the output file. <DT><CODE>--weaken</CODE> <DD> Change all global symbols in the file to be weak. This can be useful when building an object which will be linked against other objects using the <CODE>-R</CODE> option to the linker. This option is only effective when using an object file format which supports weak symbols. <DT><CODE>-V</CODE> <DD> <DT><CODE>--version</CODE> <DD> Show the version number of <CODE>objcopy</CODE>. <DT><CODE>-v</CODE> <DD> <DT><CODE>--verbose</CODE> <DD> Verbose output: list all object files modified. In the case of archives, <SAMP>`objcopy -V'</SAMP> lists all members of the archive. <DT><CODE>--help</CODE> <DD> Show a summary of the options to <CODE>objcopy</CODE>. </DL> <H1><A NAME="SEC7" HREF="binutils_toc.html#TOC7">objdump</A></H1> <P> <A NAME="IDX50"></A> <A NAME="IDX51"></A> </P> <PRE> objdump [ -a | --archive-headers ] [ -b <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ --debugging ] [ -C | --demangle ] [ -d | --disassemble ] [ -D | --disassemble-all ] [ --disassemble-zeroes ] [ -EB | -EL | --endian={big | little } ] [ -f | --file-headers ] [ -h | --section-headers | --headers ] [ -i | --info ] [ -j <VAR>section</VAR> | --section=<VAR>section</VAR> ] [ -l | --line-numbers ] [ -S | --source ] [ -m <VAR>machine</VAR> | --architecture=<VAR>machine</VAR> ] [ -r | --reloc ] [ -R | --dynamic-reloc ] [ -s | --full-contents ] [ --stabs ] [ -t | --syms ] [ -T | --dynamic-syms ] [ -x | --all-headers ] [ -w | --wide ] [ --start-address=<VAR>address</VAR> ] [ --stop-address=<VAR>address</VAR> ] [ --prefix-addresses] [ --[no-]show-raw-insn ] [ --adjust-vma=<VAR>offset</VAR> ] [ --version ] [ --help ] <VAR>objfile</VAR>... </PRE> <P> <CODE>objdump</CODE> displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work. </P> <P> <VAR>objfile</VAR>... are the object files to be examined. When you specify archives, <CODE>objdump</CODE> shows information on each of the member object files. </P> <P> The long and short forms of options, shown here as alternatives, are equivalent. At least one option besides <SAMP>`-l'</SAMP> must be given. </P> <DL COMPACT> <DT><CODE>-a</CODE> <DD> <DT><CODE>--archive-header</CODE> <DD> <A NAME="IDX52"></A> If any of the <VAR>objfile</VAR> files are archives, display the archive header information (in a format similar to <SAMP>`ls -l'</SAMP>). Besides the information you could list with <SAMP>`ar tv'</SAMP>, <SAMP>`objdump -a'</SAMP> shows the object file format of each archive member. <DT><CODE>--adjust-vma=<VAR>offset</VAR></CODE> <DD> <A NAME="IDX53"></A> <A NAME="IDX54"></A> When dumping information, first add <VAR>offset</VAR> to all the section addresses. This is useful if the section addresses do not correspond to the symbol table, which can happen when putting sections at particular addresses when using a format which can not represent section addresses, such as a.out. <DT><CODE>-b <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> <A NAME="IDX55"></A> Specify that the object-code format for the object files is <VAR>bfdname</VAR>. This option may not be necessary; <VAR>objdump</VAR> can automatically recognize many formats. For example, <PRE> objdump -b oasys -m vax -h fu.o </PRE> displays summary information from the section headers (<SAMP>`-h'</SAMP>) of <TT>`fu.o'</TT>, which is explicitly identified (<SAMP>`-m'</SAMP>) as a VAX object file in the format produced by Oasys compilers. You can list the formats available with the <SAMP>`-i'</SAMP> option. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-C</CODE> <DD> <DT><CODE>--demangle</CODE> <DD> <A NAME="IDX56"></A> Decode (<STRONG>demangle</STRONG>) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. See section <A HREF="binutils.html#SEC12">c++filt</A>, for more information on demangling. <DT><CODE>--debugging</CODE> <DD> Display debugging information. This attempts to parse debugging information stored in the file and print it out using a C like syntax. Only certain types of debugging information have been implemented. <DT><CODE>-d</CODE> <DD> <DT><CODE>--disassemble</CODE> <DD> <A NAME="IDX57"></A> <A NAME="IDX58"></A> Display the assembler mnemonics for the machine instructions from <VAR>objfile</VAR>. This option only disassembles those sections which are expected to contain instructions. <DT><CODE>-D</CODE> <DD> <DT><CODE>--disassemble-all</CODE> <DD> Like <SAMP>`-d'</SAMP>, but disassemble the contents of all sections, not just those expected to contain instructions. <DT><CODE>--prefix-addresses</CODE> <DD> When disassembling, print the complete address on each line. This is the older disassembly format. <DT><CODE>--disassemble-zeroes</CODE> <DD> Normally the disassembly output will skip blocks of zeroes. This option directs the disassembler to disassemble those blocks, just like any other data. <DT><CODE>-EB</CODE> <DD> <DT><CODE>-EL</CODE> <DD> <DT><CODE>--endian={big|little}</CODE> <DD> <A NAME="IDX59"></A> <A NAME="IDX60"></A> Specify the endianness of the object files. This only affects disassembly. This can be useful when disassembling a file format which does not describe endianness information, such as S-records. <DT><CODE>-f</CODE> <DD> <DT><CODE>--file-header</CODE> <DD> <A NAME="IDX61"></A> Display summary information from the overall header of each of the <VAR>objfile</VAR> files. <DT><CODE>-h</CODE> <DD> <DT><CODE>--section-header</CODE> <DD> <DT><CODE>--header</CODE> <DD> <A NAME="IDX62"></A> Display summary information from the section headers of the object file. File segments may be relocated to nonstandard addresses, for example by using the <SAMP>`-Ttext'</SAMP>, <SAMP>`-Tdata'</SAMP>, or <SAMP>`-Tbss'</SAMP> options to <CODE>ld</CODE>. However, some object file formats, such as a.out, do not store the starting address of the file segments. In those situations, although <CODE>ld</CODE> relocates the sections correctly, using <SAMP>`objdump -h'</SAMP> to list the file section headers cannot show the correct addresses. Instead, it shows the usual addresses, which are implicit for the target. <DT><CODE>--help</CODE> <DD> Print a summary of the options to <CODE>objdump</CODE> and exit. <DT><CODE>-i</CODE> <DD> <DT><CODE>--info</CODE> <DD> <A NAME="IDX63"></A> <A NAME="IDX64"></A> Display a list showing all architectures and object formats available for specification with <SAMP>`-b'</SAMP> or <SAMP>`-m'</SAMP>. <DT><CODE>-j <VAR>name</VAR></CODE> <DD> <DT><CODE>--section=<VAR>name</VAR></CODE> <DD> <A NAME="IDX65"></A> Display information only for section <VAR>name</VAR>. <DT><CODE>-l</CODE> <DD> <DT><CODE>--line-numbers</CODE> <DD> <A NAME="IDX66"></A> Label the display (using debugging information) with the filename and source line numbers corresponding to the object code or relocs shown. Only useful with <SAMP>`-d'</SAMP>, <SAMP>`-D'</SAMP>, or <SAMP>`-r'</SAMP>. <DT><CODE>-m <VAR>machine</VAR></CODE> <DD> <DT><CODE>--architecture=<VAR>machine</VAR></CODE> <DD> <A NAME="IDX67"></A> <A NAME="IDX68"></A> Specify the architecture to use when disassembling object files. This can be useful when disasembling object files which do not describe architecture information, such as S-records. You can list the available architectures with the <SAMP>`-i'</SAMP> option. <DT><CODE>-r</CODE> <DD> <DT><CODE>--reloc</CODE> <DD> <A NAME="IDX69"></A> Print the relocation entries of the file. If used with <SAMP>`-d'</SAMP> or <SAMP>`-D'</SAMP>, the relocations are printed interspersed with the disassembly. <DT><CODE>-R</CODE> <DD> <DT><CODE>--dynamic-reloc</CODE> <DD> <A NAME="IDX70"></A> Print the dynamic relocation entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. <DT><CODE>-s</CODE> <DD> <DT><CODE>--full-contents</CODE> <DD> <A NAME="IDX71"></A> <A NAME="IDX72"></A> Display the full contents of any sections requested. <DT><CODE>-S</CODE> <DD> <DT><CODE>--source</CODE> <DD> <A NAME="IDX73"></A> <A NAME="IDX74"></A> Display source code intermixed with disassembly, if possible. Implies <SAMP>`-d'</SAMP>. <DT><CODE>--show-raw-insn</CODE> <DD> When disassembling instructions, print the instruction in hex as well as in symbolic form. This is the default except when <CODE>--prefix-addresses</CODE> is used. <DT><CODE>--no-show-raw-insn</CODE> <DD> When disassembling instructions, do not print the instruction bytes. This is the default when <CODE>--prefix-addresses</CODE> is used. <DT><CODE>--stabs</CODE> <DD> <A NAME="IDX75"></A> <A NAME="IDX76"></A> <A NAME="IDX77"></A> <A NAME="IDX78"></A> Display the full contents of any sections requested. Display the contents of the .stab and .stab.index and .stab.excl sections from an ELF file. This is only useful on systems (such as Solaris 2.0) in which <CODE>.stab</CODE> debugging symbol-table entries are carried in an ELF section. In most other file formats, debugging symbol-table entries are interleaved with linkage symbols, and are visible in the <SAMP>`--syms'</SAMP> output. For more information on stabs symbols, see section `Stabs Overview' in <CITE>The "stabs" debug format</CITE>. <DT><CODE>--start-address=<VAR>address</VAR></CODE> <DD> <A NAME="IDX79"></A> Start displaying data at the specified address. This affects the output of the <CODE>-d</CODE>, <CODE>-r</CODE> and <CODE>-s</CODE> options. <DT><CODE>--stop-address=<VAR>address</VAR></CODE> <DD> <A NAME="IDX80"></A> Stop displaying data at the specified address. This affects the output of the <CODE>-d</CODE>, <CODE>-r</CODE> and <CODE>-s</CODE> options. <DT><CODE>-t</CODE> <DD> <DT><CODE>--syms</CODE> <DD> <A NAME="IDX81"></A> Print the symbol table entries of the file. This is similar to the information provided by the <SAMP>`nm'</SAMP> program. <DT><CODE>-T</CODE> <DD> <DT><CODE>--dynamic-syms</CODE> <DD> <A NAME="IDX82"></A> Print the dynamic symbol table entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the <SAMP>`nm'</SAMP> program when given the <SAMP>`-D'</SAMP> (<SAMP>`--dynamic'</SAMP>) option. <DT><CODE>--version</CODE> <DD> Print the version number of <CODE>objdump</CODE> and exit. <DT><CODE>-x</CODE> <DD> <DT><CODE>--all-header</CODE> <DD> <A NAME="IDX83"></A> <A NAME="IDX84"></A> Display all available header information, including the symbol table and relocation entries. Using <SAMP>`-x'</SAMP> is equivalent to specifying all of <SAMP>`-a -f -h -r -t'</SAMP>. <DT><CODE>-w</CODE> <DD> <DT><CODE>--wide</CODE> <DD> <A NAME="IDX85"></A> Format some lines for output devices that have more than 80 columns. </DL> <H1><A NAME="SEC8" HREF="binutils_toc.html#TOC8">ranlib</A></H1> <P> <A NAME="IDX86"></A> <A NAME="IDX87"></A> <A NAME="IDX88"></A> </P> <PRE> ranlib [-vV] <VAR>archive</VAR> </PRE> <P> <CODE>ranlib</CODE> generates an index to the contents of an archive and stores it in the archive. The index lists each symbol defined by a member of an archive that is a relocatable object file. </P> <P> You may use <SAMP>`nm -s'</SAMP> or <SAMP>`nm --print-armap'</SAMP> to list this index. </P> <P> An archive with such an index speeds up linking to the library and allows routines in the library to call each other without regard to their placement in the archive. </P> <P> The GNU <CODE>ranlib</CODE> program is another form of GNU <CODE>ar</CODE>; running <CODE>ranlib</CODE> is completely equivalent to executing <SAMP>`ar -s'</SAMP>. See section <A HREF="binutils.html#SEC1">ar</A>. </P> <DL COMPACT> <DT><CODE>-v</CODE> <DD> <DT><CODE>-V</CODE> <DD> Show the version number of <CODE>ranlib</CODE>. </DL> <H1><A NAME="SEC9" HREF="binutils_toc.html#TOC9">size</A></H1> <P> <A NAME="IDX89"></A> <A NAME="IDX90"></A> </P> <PRE> size [ -A | -B | --format=<VAR>compatibility</VAR> ] [ --help ] [ -d | -o | -x | --radix=<VAR>number</VAR> ] [ --target=<VAR>bfdname</VAR> ] [ -V | --version ] <VAR>objfile</VAR>... </PRE> <P> The GNU <CODE>size</CODE> utility lists the section sizes--and the total size--for each of the object or archive files <VAR>objfile</VAR> in its argument list. By default, one line of output is generated for each object file or each module in an archive. </P> <P> <VAR>objfile</VAR>... are the object files to be examined. </P> <P> The command line options have the following meanings: </P> <DL COMPACT> <DT><CODE>-A</CODE> <DD> <DT><CODE>-B</CODE> <DD> <DT><CODE>--format=<VAR>compatibility</VAR></CODE> <DD> <A NAME="IDX91"></A> Using one of these options, you can choose whether the output from GNU <CODE>size</CODE> resembles output from System V <CODE>size</CODE> (using <SAMP>`-A'</SAMP>, or <SAMP>`--format=sysv'</SAMP>), or Berkeley <CODE>size</CODE> (using <SAMP>`-B'</SAMP>, or <SAMP>`--format=berkeley'</SAMP>). The default is the one-line format similar to Berkeley's. Here is an example of the Berkeley (default) format of output from <CODE>size</CODE>: <PRE> size --format=Berkeley ranlib size text data bss dec hex filename 294880 81920 11592 388392 5ed28 ranlib 294880 81920 11888 388688 5ee50 size </PRE> This is the same data, but displayed closer to System V conventions: <PRE> size --format=SysV ranlib size ranlib : section size addr .text 294880 8192 .data 81920 303104 .bss 11592 385024 Total 388392 size : section size addr .text 294880 8192 .data 81920 303104 .bss 11888 385024 Total 388688 </PRE> <DT><CODE>--help</CODE> <DD> Show a summary of acceptable arguments and options. <DT><CODE>-d</CODE> <DD> <DT><CODE>-o</CODE> <DD> <DT><CODE>-x</CODE> <DD> <DT><CODE>--radix=<VAR>number</VAR></CODE> <DD> <A NAME="IDX92"></A> <A NAME="IDX93"></A> Using one of these options, you can control whether the size of each section is given in decimal (<SAMP>`-d'</SAMP>, or <SAMP>`--radix=10'</SAMP>); octal (<SAMP>`-o'</SAMP>, or <SAMP>`--radix=8'</SAMP>); or hexadecimal (<SAMP>`-x'</SAMP>, or <SAMP>`--radix=16'</SAMP>). In <SAMP>`--radix=<VAR>number</VAR>'</SAMP>, only the three values (8, 10, 16) are supported. The total size is always given in two radices; decimal and hexadecimal for <SAMP>`-d'</SAMP> or <SAMP>`-x'</SAMP> output, or octal and hexadecimal if you're using <SAMP>`-o'</SAMP>. <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> <A NAME="IDX94"></A> Specify that the object-code format for <VAR>objfile</VAR> is <VAR>bfdname</VAR>. This option may not be necessary; <CODE>size</CODE> can automatically recognize many formats. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-V</CODE> <DD> <DT><CODE>--version</CODE> <DD> Display the version number of <CODE>size</CODE>. </DL> <H1><A NAME="SEC10" HREF="binutils_toc.html#TOC10">strings</A></H1> <P> <A NAME="IDX95"></A> <A NAME="IDX96"></A> <A NAME="IDX97"></A> <A NAME="IDX98"></A> </P> <PRE> strings [-afov] [-<VAR>min-len</VAR>] [-n <VAR>min-len</VAR>] [-t <VAR>radix</VAR>] [-] [--all] [--print-file-name] [--bytes=<VAR>min-len</VAR>] [--radix=<VAR>radix</VAR>] [--target=<VAR>bfdname</VAR>] [--help] [--version] <VAR>file</VAR>... </PRE> <P> For each <VAR>file</VAR> given, GNU <CODE>strings</CODE> prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files; for other types of files, it prints the strings from the whole file. </P> <P> <CODE>strings</CODE> is mainly useful for determining the contents of non-text files. </P> <DL COMPACT> <DT><CODE>-a</CODE> <DD> <DT><CODE>--all</CODE> <DD> <DT><CODE>-</CODE> <DD> Do not scan only the initialized and loaded sections of object files; scan the whole files. <DT><CODE>-f</CODE> <DD> <DT><CODE>--print-file-name</CODE> <DD> Print the name of the file before each string. <DT><CODE>--help</CODE> <DD> Print a summary of the program usage on the standard output and exit. <DT><CODE>-<VAR>min-len</VAR></CODE> <DD> <DT><CODE>-n <VAR>min-len</VAR></CODE> <DD> <DT><CODE>--bytes=<VAR>min-len</VAR></CODE> <DD> Print sequences of characters that are at least <VAR>min-len</VAR> characters long, instead of the default 4. <DT><CODE>-o</CODE> <DD> Like <SAMP>`-t o'</SAMP>. Some other versions of <CODE>strings</CODE> have <SAMP>`-o'</SAMP> act like <SAMP>`-t d'</SAMP> instead. Since we can not be compatible with both ways, we simply chose one. <DT><CODE>-t <VAR>radix</VAR></CODE> <DD> <DT><CODE>--radix=<VAR>radix</VAR></CODE> <DD> Print the offset within the file before each string. The single character argument specifies the radix of the offset---<SAMP>`o'</SAMP> for octal, <SAMP>`x'</SAMP> for hexadecimal, or <SAMP>`d'</SAMP> for decimal. <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> <A NAME="IDX99"></A> Specify an object code format other than your system's default format. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-v</CODE> <DD> <DT><CODE>--version</CODE> <DD> Print the program version number on the standard output and exit. </DL> <H1><A NAME="SEC11" HREF="binutils_toc.html#TOC11">strip</A></H1> <P> <A NAME="IDX100"></A> <A NAME="IDX101"></A> <A NAME="IDX102"></A> <A NAME="IDX103"></A> </P> <PRE> strip [ -F <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ -I <VAR>bfdname</VAR> | --input-target=<VAR>bfdname</VAR> ] [ -O <VAR>bfdname</VAR> | --output-target=<VAR>bfdname</VAR> ] [ -s | --strip-all ] [ -S | -g | --strip-debug ] [ -K <VAR>symbolname</VAR> | --keep-symbol=<VAR>symbolname</VAR> ] [ -N <VAR>symbolname</VAR> | --strip-symbol=<VAR>symbolname</VAR> ] [ -x | --discard-all ] [ -X | --discard-locals ] [ -R <VAR>sectionname</VAR> | --remove-section=<VAR>sectionname</VAR> ] [ -o <VAR>file</VAR> ] [ -p | --preserve-dates ] [ -v | --verbose ] [ -V | --version ] [ --help ] <VAR>objfile</VAR>... </PRE> <P> GNU <CODE>strip</CODE> discards all symbols from object files <VAR>objfile</VAR>. The list of object files may include archives. At least one object file must be given. </P> <P> <CODE>strip</CODE> modifies the files named in its argument, rather than writing modified copies under different names. </P> <DL COMPACT> <DT><CODE>-F <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> Treat the original <VAR>objfile</VAR> as a file with the object code format <VAR>bfdname</VAR>, and rewrite it in the same format. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>--help</CODE> <DD> Show a summary of the options to <CODE>strip</CODE> and exit. <DT><CODE>-I <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--input-target=<VAR>bfdname</VAR></CODE> <DD> Treat the original <VAR>objfile</VAR> as a file with the object code format <VAR>bfdname</VAR>. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-O <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--output-target=<VAR>bfdname</VAR></CODE> <DD> Replace <VAR>objfile</VAR> with a file in the output format <VAR>bfdname</VAR>. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-R <VAR>sectionname</VAR></CODE> <DD> <DT><CODE>--remove-section=<VAR>sectionname</VAR></CODE> <DD> Remove any section named <VAR>sectionname</VAR> from the output file. This option may be given more than once. Note that using this option inappropriately may make the output file unusable. <DT><CODE>-s</CODE> <DD> <DT><CODE>--strip-all</CODE> <DD> Remove all symbols. <DT><CODE>-g</CODE> <DD> <DT><CODE>-S</CODE> <DD> <DT><CODE>--strip-debug</CODE> <DD> Remove debugging symbols only. <DT><CODE>--strip-unneeded</CODE> <DD> Remove all symbols that are not needed for relocation processing. <DT><CODE>-K <VAR>symbolname</VAR></CODE> <DD> <DT><CODE>--keep-symbol=<VAR>symbolname</VAR></CODE> <DD> Keep only symbol <VAR>symbolname</VAR> from the source file. This option may be given more than once. <DT><CODE>-N <VAR>symbolname</VAR></CODE> <DD> <DT><CODE>--strip-symbol=<VAR>symbolname</VAR></CODE> <DD> Remove symbol <VAR>symbolname</VAR> from the source file. This option may be given more than once, and may be combined with strip options other than <CODE>-K</CODE>. <DT><CODE>-o <VAR>file</VAR></CODE> <DD> Put the stripped output in <VAR>file</VAR>, rather than replacing the existing file. When this argument is used, only one <VAR>objfile</VAR> argument may be specified. <DT><CODE>-p</CODE> <DD> <DT><CODE>--preserve-dates</CODE> <DD> Preserve the access and modification dates of the file. <DT><CODE>-x</CODE> <DD> <DT><CODE>--discard-all</CODE> <DD> Remove non-global symbols. <DT><CODE>-X</CODE> <DD> <DT><CODE>--discard-locals</CODE> <DD> Remove compiler-generated local symbols. (These usually start with <SAMP>`L'</SAMP> or <SAMP>`.'</SAMP>.) <DT><CODE>-V</CODE> <DD> <DT><CODE>--version</CODE> <DD> Show the version number for <CODE>strip</CODE>. <DT><CODE>-v</CODE> <DD> <DT><CODE>--verbose</CODE> <DD> Verbose output: list all object files modified. In the case of archives, <SAMP>`strip -v'</SAMP> lists all members of the archive. </DL> <H1><A NAME="SEC12" HREF="binutils_toc.html#TOC12">c++filt</A></H1> <P> <A NAME="IDX104"></A> <A NAME="IDX105"></A> </P> <PRE> c++filt [ -_ | --strip-underscores ] [ -n | --no-strip-underscores ] [ -s <VAR>format</VAR> | --format=<VAR>format</VAR> ] [ --help ] [ --version ] [ <VAR>symbol</VAR>... ] </PRE> <P> The C++ language provides function overloading, which means that you can write many functions with the same name (providing each takes parameters of different types). All C++ function names are encoded into a low-level assembly label (this process is known as <STRONG>mangling</STRONG>). The <CODE>c++filt</CODE> program does the inverse mapping: it decodes (<STRONG>demangles</STRONG>) low-level names into user-level names so that the linker can keep these overloaded functions from clashing. </P> <P> 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. </P> <P> You can use <CODE>c++filt</CODE> to decipher individual symbols: </P> <PRE> c++filt <VAR>symbol</VAR> </PRE> <P> If no <VAR>symbol</VAR> arguments are given, <CODE>c++filt</CODE> reads symbol names from the standard input and writes the demangled names to the standard output. All results are printed on the standard output. </P> <DL COMPACT> <DT><CODE>-_</CODE> <DD> <DT><CODE>--strip-underscores</CODE> <DD> On some systems, both the C and C++ compilers put an underscore in front of every name. For example, the C name <CODE>foo</CODE> gets the low-level name <CODE>_foo</CODE>. This option removes the initial underscore. Whether <CODE>c++filt</CODE> removes the underscore by default is target dependent. <DT><CODE>-n</CODE> <DD> <DT><CODE>--no-strip-underscores</CODE> <DD> Do not remove the initial underscore. <DT><CODE>-s <VAR>format</VAR></CODE> <DD> <DT><CODE>--format=<VAR>format</VAR></CODE> <DD> GNU <CODE>nm</CODE> can decode three different methods of mangling, used by different C++ compilers. The argument to this option selects which method it uses: <DL COMPACT> <DT><CODE>gnu</CODE> <DD> the one used by the GNU compiler (the default method) <DT><CODE>lucid</CODE> <DD> the one used by the Lucid compiler <DT><CODE>arm</CODE> <DD> the one specified by the C++ Annotated Reference Manual </DL> <DT><CODE>--help</CODE> <DD> Print a summary of the options to <CODE>c++filt</CODE> and exit. <DT><CODE>--version</CODE> <DD> Print the version number of <CODE>c++filt</CODE> and exit. </DL> <BLOCKQUOTE> <P> <EM>Warning:</EM> <CODE>c++filt</CODE> is a new utility, and the details of its user interface are subject to change in future releases. In particular, a command-line option may be required in the the future to decode a name passed as an argument on the command line; in other words, </P> <PRE> c++filt <VAR>symbol</VAR> </PRE> <P> may in a future release become </P> <PRE> c++filt <VAR>option</VAR> <VAR>symbol</VAR> </PRE> </BLOCKQUOTE> <H1><A NAME="SEC13" HREF="binutils_toc.html#TOC13">addr2line</A></H1> <P> <A NAME="IDX106"></A> <A NAME="IDX107"></A> </P> <PRE> addr2line [ -b <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ -C | --demangle ] [ -e <VAR>filename</VAR> | --exe=<VAR>filename</VAR> ] [ -f | --functions ] [ -s | --basename ] [ -H | --help ] [ -V | --version ] [ addr addr ... ] </PRE> <P> <CODE>addr2line</CODE> translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address. </P> <P> The executable to use is specified with the <CODE>-e</CODE> option. The default is <TT>`a.out'</TT>. </P> <P> <CODE>addr2line</CODE> has two modes of operation. </P> <P> In the first, hexadecimal addresses are specified on the command line, and <CODE>addr2line</CODE> displays the file name and line number for each address. </P> <P> In the second, <CODE>addr2line</CODE> reads hexadecimal addresses from standard input, and prints the file name and line number for each address on standard output. In this mode, <CODE>addr2line</CODE> may be used in a pipe to convert dynamically chosen addresses. </P> <P> The format of the output is <SAMP>`FILENAME:LINENO'</SAMP>. The file name and line number for each address is printed on a separate line. If the <CODE>-f</CODE> option is used, then each <SAMP>`FILENAME:LINENO'</SAMP> line is preceded by a <SAMP>`FUNCTIONNAME'</SAMP> line which is the name of the function containing the address. </P> <P> If the file name or function name can not be determined, <CODE>addr2line</CODE> will print two question marks in their place. If the line number can not be determined, <CODE>addr2line</CODE> will print 0. </P> <P> The long and short forms of options, shown here as alternatives, are equivalent. </P> <DL COMPACT> <DT><CODE>-b <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--target=<VAR>bfdname</VAR></CODE> <DD> <A NAME="IDX108"></A> Specify that the object-code format for the object files is <VAR>bfdname</VAR>. <DT><CODE>-C</CODE> <DD> <DT><CODE>--demangle</CODE> <DD> <A NAME="IDX109"></A> Decode (<STRONG>demangle</STRONG>) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. See section <A HREF="binutils.html#SEC12">c++filt</A>, for more information on demangling. <DT><CODE>-e <VAR>filename</VAR></CODE> <DD> <DT><CODE>--exe=<VAR>filename</VAR></CODE> <DD> Specify the name of the executable for which addresses should be translated. The default file is <TT>`a.out'</TT>. <DT><CODE>-f</CODE> <DD> <DT><CODE>--functions</CODE> <DD> Display function names as well as file and line number information. <DT><CODE>-s</CODE> <DD> <DT><CODE>--basenames</CODE> <DD> Display only the base of each file name. </DL> <H1><A NAME="SEC14" HREF="binutils_toc.html#TOC14">nlmconv</A></H1> <P> <CODE>nlmconv</CODE> converts a relocatable object file into a NetWare Loadable Module. </P> <BLOCKQUOTE> <P> <EM>Warning:</EM> <CODE>nlmconv</CODE> is not always built as part of the binary utilities, since it is only useful for NLM targets. </BLOCKQUOTE> <PRE> nlmconv [ -I <VAR>bfdname</VAR> | --input-target=<VAR>bfdname</VAR> ] [ -O <VAR>bfdname</VAR> | --output-target=<VAR>bfdname</VAR> ] [ -T <VAR>headerfile</VAR> | --header-file=<VAR>headerfile</VAR> ] [ -d | --debug] [ -l <VAR>linker</VAR> | --linker=<VAR>linker</VAR> ] [ -h | --help ] [ -V | --version ] <VAR>infile</VAR> <VAR>outfile</VAR> </PRE> <P> <CODE>nlmconv</CODE> converts the relocatable <SAMP>`i386'</SAMP> object file <VAR>infile</VAR> into the NetWare Loadable Module <VAR>outfile</VAR>, optionally reading <VAR>headerfile</VAR> for NLM header information. For instructions on writing the NLM command file language used in header files, see the <SAMP>`linkers'</SAMP> section, <SAMP>`NLMLINK'</SAMP> in particular, of the <CITE>NLM Development and Tools Overview</CITE>, which is part of the NLM Software Developer's Kit ("NLM SDK"), available from Novell, Inc. <CODE>nlmconv</CODE> uses the GNU Binary File Descriptor library to read <VAR>infile</VAR>; see section `BFD' in <CITE>Using LD</CITE>, for more information. </P> <P> <CODE>nlmconv</CODE> can perform a link step. In other words, you can list more than one object file for input if you list them in the definitions file (rather than simply specifying one input file on the command line). In this case, <CODE>nlmconv</CODE> calls the linker for you. </P> <DL COMPACT> <DT><CODE>-I <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--input-target=<VAR>bfdname</VAR></CODE> <DD> Object format of the input file. <CODE>nlmconv</CODE> can usually determine the format of a given file (so no default is necessary). See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-O <VAR>bfdname</VAR></CODE> <DD> <DT><CODE>--output-target=<VAR>bfdname</VAR></CODE> <DD> Object format of the output file. <CODE>nlmconv</CODE> infers the output format based on the input format, e.g. for a <SAMP>`i386'</SAMP> input file the output format is <SAMP>`nlm32-i386'</SAMP>. See section <A HREF="binutils.html#SEC16">Target Selection</A>, for more information. <DT><CODE>-T <VAR>headerfile</VAR></CODE> <DD> <DT><CODE>--header-file=<VAR>headerfile</VAR></CODE> <DD> Reads <VAR>headerfile</VAR> for NLM header information. For instructions on writing the NLM command file language used in header files, see see the <SAMP>`linkers'</SAMP> section, of the <CITE>NLM Development and Tools Overview</CITE>, which is part of the NLM Software Developer's Kit, available from Novell, Inc. <DT><CODE>-d</CODE> <DD> <DT><CODE>--debug</CODE> <DD> Displays (on standard error) the linker command line used by <CODE>nlmconv</CODE>. <DT><CODE>-l <VAR>linker</VAR></CODE> <DD> <DT><CODE>--linker=<VAR>linker</VAR></CODE> <DD> Use <VAR>linker</VAR> for any linking. <VAR>linker</VAR> can be an abosolute or a relative pathname. <DT><CODE>-h</CODE> <DD> <DT><CODE>--help</CODE> <DD> Prints a usage summary. <DT><CODE>-V</CODE> <DD> <DT><CODE>--version</CODE> <DD> Prints the version number for <CODE>nlmconv</CODE>. </DL> <H1><A NAME="SEC15" HREF="binutils_toc.html#TOC15">Selecting the target system</A></H1> <P> You can specify three aspects of the target system to the GNU binary file utilities, each in several ways: </P> <UL> <LI> the target <LI> the architecture <LI> the linker emulation (which applies to the linker only) </UL> <P> In the following summaries, the lists of ways to specify values are in order of decreasing precedence. The ways listed first override those listed later. </P> <P> The commands to list valid values only list the values for which the programs you are running were configured. If they were configured with <SAMP>`--enable-targets=all'</SAMP>, the commands list most of the available values, but a few are left out; not all targets can be configured in at once because some of them can only be configured <STRONG>native</STRONG> (on hosts with the same type as the target system). </P> <H2><A NAME="SEC16" HREF="binutils_toc.html#TOC16">Target Selection</A></H2> <P> A <STRONG>target</STRONG> is an object file format. A given target may be supported for multiple architectures (see section <A HREF="binutils.html#SEC17">Architecture selection</A>). A target selection may also have variations for different operating systems or architectures. </P> <P> The command to list valid target values is <SAMP>`objdump -i'</SAMP> (the first column of output contains the relevant information). </P> <P> Some sample values are: <SAMP>`a.out-hp300bsd'</SAMP>, <SAMP>`ecoff-littlemips'</SAMP>, <SAMP>`a.out-sunos-big'</SAMP>. </P> <P> 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 running the shell script <TT>`config.sub'</TT> which is included with the sources. </P> <P> Some sample configuration triplets are: <SAMP>`m68k-hp-bsd'</SAMP>, <SAMP>`mips-dec-ultrix'</SAMP>, <SAMP>`sparc-sun-sunos'</SAMP>. </P> <H3><CODE>objdump</CODE> Target</H3> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`-b'</SAMP> or <SAMP>`--target'</SAMP> <LI> environment variable <CODE>GNUTARGET</CODE> <LI> deduced from the input file </OL> <H3><CODE>objcopy</CODE> and <CODE>strip</CODE> Input Target</H3> <P> Ways to specify: </P> <OL> <LI> command line options: <SAMP>`-I'</SAMP> or <SAMP>`--input-target'</SAMP>, or <SAMP>`-F'</SAMP> or <SAMP>`--target'</SAMP> <LI> environment variable <CODE>GNUTARGET</CODE> <LI> deduced from the input file </OL> <H3><CODE>objcopy</CODE> and <CODE>strip</CODE> Output Target</H3> <P> Ways to specify: </P> <OL> <LI> command line options: <SAMP>`-O'</SAMP> or <SAMP>`--output-target'</SAMP>, or <SAMP>`-F'</SAMP> or <SAMP>`--target'</SAMP> <LI> the input target (see "<CODE>objcopy</CODE> and <CODE>strip</CODE> Input Target" above) <LI> environment variable <CODE>GNUTARGET</CODE> <LI> deduced from the input file </OL> <H3><CODE>nm</CODE>, <CODE>size</CODE>, and <CODE>strings</CODE> Target</H3> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`--target'</SAMP> <LI> environment variable <CODE>GNUTARGET</CODE> <LI> deduced from the input file </OL> <H3>Linker Input Target</H3> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`-b'</SAMP> or <SAMP>`--format'</SAMP> (see section `Options' in <CITE>Using LD</CITE>) <LI> script command <CODE>TARGET</CODE> (see section `Option Commands' in <CITE>Using LD</CITE>) <LI> environment variable <CODE>GNUTARGET</CODE> (see section `Environment' in <CITE>Using LD</CITE>) <LI> the default target of the selected linker emulation (see section <A HREF="binutils.html#SEC18">Linker emulation selection</A>) </OL> <H3>Linker Output Target</H3> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`-oformat'</SAMP> (see section `Options' in <CITE>Using LD</CITE>) <LI> script command <CODE>OUTPUT_FORMAT</CODE> (see section `Option Commands' in <CITE>Using LD</CITE>) <LI> the linker input target (see "Linker Input Target" above) </OL> <H2><A NAME="SEC17" HREF="binutils_toc.html#TOC17">Architecture selection</A></H2> <P> An <STRONG>architecture</STRONG> is a type of CPU on which an object file is to run. Its name may contain a colon, separating the name of the processor family from the name of the particular CPU. </P> <P> The command to list valid architecture values is <SAMP>`objdump -i'</SAMP> (the second column contains the relevant information). </P> <P> Sample values: <SAMP>`m68k:68020'</SAMP>, <SAMP>`mips:3000'</SAMP>, <SAMP>`sparc'</SAMP>. </P> <H3><CODE>objdump</CODE> Architecture</H3> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`-m'</SAMP> or <SAMP>`--architecture'</SAMP> <LI> deduced from the input file </OL> <H3><CODE>objcopy</CODE>, <CODE>nm</CODE>, <CODE>size</CODE>, <CODE>strings</CODE> Architecture</H3> <P> Ways to specify: </P> <OL> <LI> deduced from the input file </OL> <H3>Linker Input Architecture</H3> <P> Ways to specify: </P> <OL> <LI> deduced from the input file </OL> <H3>Linker Output Architecture</H3> <P> Ways to specify: </P> <OL> <LI> script command <CODE>OUTPUT_ARCH</CODE> (see section `Option Commands' in <CITE>Using LD</CITE>) <LI> the default architecture from the linker output target (see section <A HREF="binutils.html#SEC16">Target Selection</A>) </OL> <H2><A NAME="SEC18" HREF="binutils_toc.html#TOC18">Linker emulation selection</A></H2> <P> A linker <STRONG>emulation</STRONG> is a "personality" of the linker, which gives the linker default values for the other aspects of the target system. In particular, it consists of </P> <UL> <LI> the linker script <LI> the target <LI> several "hook" functions that are run at certain stages of the linking process to do special things that some targets require </UL> <P> The command to list valid linker emulation values is <SAMP>`ld -V'</SAMP>. </P> <P> Sample values: <SAMP>`hp300bsd'</SAMP>, <SAMP>`mipslit'</SAMP>, <SAMP>`sun4'</SAMP>. </P> <P> Ways to specify: </P> <OL> <LI> command line option: <SAMP>`-m'</SAMP> (see section `Options' in <CITE>Using LD</CITE>) <LI> environment variable <CODE>LDEMULATION</CODE> <LI> compiled-in <CODE>DEFAULT_EMULATION</CODE> from <TT>`Makefile'</TT>, which comes from <CODE>EMUL</CODE> in <TT>`config/<VAR>target</VAR>.mt'</TT> </OL> <H1><A NAME="SEC19" HREF="binutils_toc.html#TOC19">Reporting Bugs</A></H1> <P> <A NAME="IDX110"></A> <A NAME="IDX111"></A> </P> <P> Your bug reports play an essential role in making the binary utilities reliable. </P> <P> Reporting a bug may help you by bringing a solution to your problem, or it may not. But in any case the principal function of a bug report is to help the entire community by making the next version of the binary utilities work better. Bug reports are your contribution to their maintenance. </P> <P> In order for a bug report to serve its purpose, you must include the information that enables us to fix the bug. </P> <H2><A NAME="SEC20" HREF="binutils_toc.html#TOC20">Have you found a bug?</A></H2> <P> <A NAME="IDX112"></A> </P> <P> If you are not sure whether you have found a bug, here are some guidelines: </P> <UL> <LI> <A NAME="IDX113"></A> <A NAME="IDX114"></A> If a binary utility gets a fatal signal, for any input whatever, that is a bug. Reliable utilities never crash. <A NAME="IDX115"></A> <LI> If a binary utility produces an error message for valid input, that is a bug. <LI> If you are an experienced user of binary utilities, your suggestions for improvement are welcome in any case. </UL> <H2><A NAME="SEC21" HREF="binutils_toc.html#TOC21">How to report bugs</A></H2> <P> <A NAME="IDX116"></A> <A NAME="IDX117"></A> </P> <P> A number of companies and individuals offer support for GNU products. If you obtained the binary utilities from a support organization, we recommend you contact that organization first. </P> <P> You can find contact information for many support companies and individuals in the file <TT>`etc/SERVICE'</TT> in the GNU Emacs distribution. </P> <P> In any event, we also recommend that you send bug reports for the binary utilities to <SAMP>`bug-gnu-utils@prep.ai.mit.edu'</SAMP>. </P> <P> The fundamental principle of reporting bugs usefully is this: <STRONG>report all the facts</STRONG>. If you are not sure whether to state a fact or leave it out, state it! </P> <P> Often people omit facts because they think they know what causes the problem and assume that some details do not matter. Thus, you might assume that the name of a file you use in an example does not matter. Well, probably it does not, but one cannot be sure. Perhaps the bug is a stray memory reference which happens to fetch from the location where that pathname is stored in memory; perhaps, if the pathname were different, the contents of that location would fool the utility into doing the right thing despite the bug. Play it safe and give a specific, complete example. That is the easiest thing for you to do, and the most helpful. </P> <P> Keep in mind that the purpose of a bug report is to enable us to fix the bug if it is new to us. Therefore, always write your bug reports on the assumption that the bug has not been reported previously. </P> <P> Sometimes people give a few sketchy facts and ask, "Does this ring a bell?" Those bug reports are useless, and we urge everyone to <EM>refuse to respond to them</EM> except to chide the sender to report bugs properly. </P> <P> To enable us to fix the bug, you should include all these things: </P> <UL> <LI> The version of the utility. Each utility announces it if you start it with the <SAMP>`--version'</SAMP> argument. Without this, we will not know whether there is any point in looking for the bug in the current version of the binary utilities. <LI> Any patches you may have applied to the source, including any patches made to the <CODE>BFD</CODE> library. <LI> The type of machine you are using, and the operating system name and version number. <LI> What compiler (and its version) was used to compile the utilities--e.g. "<CODE>gcc-2.7</CODE>". <LI> The command arguments you gave the utility to observe the bug. To guarantee you will not omit something important, list them all. A copy of the Makefile (or the output from make) is sufficient. If we were to try to guess the arguments, we would probably guess wrong and then we might not encounter the bug. <LI> 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. If the source files were produced exclusively using GNU programs (e.g., <CODE>gcc</CODE>, <CODE>gas</CODE>, and/or the GNU <CODE>ld</CODE>), then it may be OK to send the source files rather than the object files. In this case, be sure to say exactly what version of <CODE>gcc</CODE>, or whatever, was used to produce the object files. Also say how <CODE>gcc</CODE>, or whatever, was configured. <LI> A description of what behavior you observe that you believe is incorrect. For example, "It gets a fatal signal." Of course, if the bug is that the utility gets a fatal signal, then we will certainly notice it. But if the bug is incorrect output, we might 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 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 ours fails to crash, we would know that the bug was not happening for us. If you had not told us to expect a crash, then we would not be able to draw any conclusion from our observations. <LI> If you wish to suggest changes to the source, send us context diffs, as generated by <CODE>diff</CODE> with the <SAMP>`-u'</SAMP>, <SAMP>`-c'</SAMP>, or <SAMP>`-p'</SAMP> option. Always send diffs from the old file to the new file. If you even discuss something in the <CODE>ld</CODE> 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. </UL> <P> Here are some things that are not necessary: </P> <UL> <LI> A description of the envelope of the bug. Often people who encounter a bug spend a lot of time investigating which changes to the input file will make the bug go away and which changes will not affect it. This is often time consuming and not very useful, because the way we will find the bug is by running a single example under the debugger with breakpoints, not by pure deduction from a series of examples. We recommend that you save your time for something else. Of course, if you can find a simpler example to report <EM>instead</EM> of the original one, that is a convenience for us. Errors in the output will be easier to spot, running under the debugger will take less time, and so on. However, simplification is not vital; if you do not want to do this, report the bug anyway and send us the entire test case you used. <LI> A patch for the bug. A patch for the bug does help us if it is a good one. But do not omit the necessary information, such as the test case, on the assumption that a patch is all we need. We might see problems with your patch and decide to fix the problem another way, or we might not understand it at all. Sometimes with programs as complicated as the binary utilities it is very hard to construct an example that will make the program follow a certain path through the code. If you do not send us the example, we will not be able to construct one, so we will not be able to verify that the bug is fixed. And if we cannot understand what bug you are trying to fix, or why your patch should be an improvement, we will not install it. A test case will help us to understand. <LI> A guess about what the bug is or what it depends on. Such guesses are usually wrong. Even we cannot guess right about such things without first using the debugger to find the facts. </UL> <H1><A NAME="SEC22" HREF="binutils_toc.html#TOC22">Index</A></H1> <P> <H2>.</H2> <DIR> <LI><A HREF="binutils.html#IDX76">.stab</A> </DIR> <H2>a</H2> <DIR> <LI><A HREF="binutils.html#IDX106">addr2line</A> <LI><A HREF="binutils.html#IDX107">address to file name and line number</A> <LI><A HREF="binutils.html#IDX83">all header information, object file</A> <LI><A HREF="binutils.html#IDX1">ar</A> <LI><A HREF="binutils.html#IDX8"><CODE>ar</CODE> compatibility</A> <LI><A HREF="binutils.html#IDX67">architecture</A> <LI><A HREF="binutils.html#IDX63">architectures available</A> <LI><A HREF="binutils.html#IDX87">archive contents</A> <LI><A HREF="binutils.html#IDX52">archive headers</A> <LI><A HREF="binutils.html#IDX2">archives</A> </DIR> <H2>b</H2> <DIR> <LI><A HREF="binutils.html#IDX112">bug criteria</A> <LI><A HREF="binutils.html#IDX116">bug reports</A> <LI><A HREF="binutils.html#IDX110">bugs</A> <LI><A HREF="binutils.html#IDX117">bugs, reporting</A> </DIR> <H2>c</H2> <DIR> <LI><A HREF="binutils.html#IDX104">c++filt</A> <LI><A HREF="binutils.html#IDX3">collections of files</A> <LI><A HREF="binutils.html#IDX7">compatibility, <CODE>ar</CODE></A> <LI><A HREF="binutils.html#IDX16">contents of archive</A> <LI><A HREF="binutils.html#IDX114">crash</A> <LI><A HREF="binutils.html#IDX21">creating archives</A> </DIR> <H2>d</H2> <DIR> <LI><A HREF="binutils.html#IDX22">dates in archive</A> <LI><A HREF="binutils.html#IDX77">debug symbols</A> <LI><A HREF="binutils.html#IDX34">debugging symbols</A> <LI><A HREF="binutils.html#IDX11">deleting from archive</A> <LI><A HREF="binutils.html#IDX105">demangling C++ symbols</A> <LI><A HREF="binutils.html#IDX37">demangling in nm</A> <LI><A HREF="binutils.html#IDX56">demangling in objdump</A>, <A HREF="binutils.html#IDX109">demangling in objdump</A> <LI><A HREF="binutils.html#IDX57">disassembling object code</A> <LI><A HREF="binutils.html#IDX68">disassembly architecture</A> <LI><A HREF="binutils.html#IDX60">disassembly endianness</A> <LI><A HREF="binutils.html#IDX74">disassembly, with source</A> <LI><A HREF="binutils.html#IDX102">discarding symbols</A> <LI><A HREF="binutils.html#IDX70">dynamic relocation entries, in object file</A> <LI><A HREF="binutils.html#IDX82">dynamic symbol table entries, printing</A> <LI><A HREF="binutils.html#IDX38">dynamic symbols</A> </DIR> <H2>e</H2> <DIR> <LI><A HREF="binutils.html#IDX78">ELF object file format</A> <LI><A HREF="binutils.html#IDX59">endianness</A> <LI><A HREF="binutils.html#IDX115">error on valid input</A> <LI><A HREF="binutils.html#IDX41">external symbols</A>, <A HREF="binutils.html#IDX46">external symbols</A>, <A HREF="binutils.html#IDX48">external symbols</A> <LI><A HREF="binutils.html#IDX19">extract from archive</A> </DIR> <H2>f</H2> <DIR> <LI><A HREF="binutils.html#IDX113">fatal signal</A> <LI><A HREF="binutils.html#IDX32">file name</A> </DIR> <H2>h</H2> <DIR> <LI><A HREF="binutils.html#IDX84">header information, all</A> </DIR> <H2>i</H2> <DIR> <LI><A HREF="binutils.html#IDX31">input file name</A> </DIR> <H2>l</H2> <DIR> <LI><A HREF="binutils.html#IDX28">ld</A> <LI><A HREF="binutils.html#IDX5">libraries</A> <LI><A HREF="binutils.html#IDX27">linker</A> <LI><A HREF="binutils.html#IDX96">listings strings</A> </DIR> <H2>m</H2> <DIR> <LI><A HREF="binutils.html#IDX58">machine instructions</A> <LI><A HREF="binutils.html#IDX12">moving in archive</A> <LI><A HREF="binutils.html#IDX25">MRI compatibility, <CODE>ar</CODE></A> </DIR> <H2>n</H2> <DIR> <LI><A HREF="binutils.html#IDX18">name duplication in archive</A> <LI><A HREF="binutils.html#IDX4">name length</A> <LI><A HREF="binutils.html#IDX30">nm</A> <LI><A HREF="binutils.html#IDX36"><CODE>nm</CODE> compatibility</A>, <A HREF="binutils.html#IDX40"><CODE>nm</CODE> compatibility</A> <LI><A HREF="binutils.html#IDX35"><CODE>nm</CODE> format</A>, <A HREF="binutils.html#IDX39"><CODE>nm</CODE> format</A> </DIR> <H2>o</H2> <DIR> <LI><A HREF="binutils.html#IDX51">objdump</A> <LI><A HREF="binutils.html#IDX45">object code format</A>, <A HREF="binutils.html#IDX55">object code format</A>, <A HREF="binutils.html#IDX94">object code format</A>, <A HREF="binutils.html#IDX99">object code format</A>, <A HREF="binutils.html#IDX108">object code format</A> <LI><A HREF="binutils.html#IDX61">object file header</A> <LI><A HREF="binutils.html#IDX50">object file information</A> <LI><A HREF="binutils.html#IDX72">object file sections</A> <LI><A HREF="binutils.html#IDX64">object formats available</A> <LI><A HREF="binutils.html#IDX10">operations on archive</A> </DIR> <H2>p</H2> <DIR> <LI><A HREF="binutils.html#IDX13">printing from archive</A> <LI><A HREF="binutils.html#IDX97">printing strings</A> </DIR> <H2>q</H2> <DIR> <LI><A HREF="binutils.html#IDX14">quick append to archive</A> </DIR> <H2>r</H2> <DIR> <LI><A HREF="binutils.html#IDX93">radix for section sizes</A> <LI><A HREF="binutils.html#IDX86">ranlib</A> <LI><A HREF="binutils.html#IDX20">relative placement in archive</A> <LI><A HREF="binutils.html#IDX69">relocation entries, in object file</A> <LI><A HREF="binutils.html#IDX101">removing symbols</A> <LI><A HREF="binutils.html#IDX17">repeated names in archive</A> <LI><A HREF="binutils.html#IDX15">replacement in archive</A> <LI><A HREF="binutils.html#IDX111">reporting bugs</A> </DIR> <H2>s</H2> <DIR> <LI><A HREF="binutils.html#IDX26">scripts, <CODE>ar</CODE></A> <LI><A HREF="binutils.html#IDX53">section addresses in objdump</A> <LI><A HREF="binutils.html#IDX62">section headers</A> <LI><A HREF="binutils.html#IDX65">section information</A> <LI><A HREF="binutils.html#IDX90">section sizes</A> <LI><A HREF="binutils.html#IDX71">sections, full contents</A> <LI><A HREF="binutils.html#IDX89">size</A> <LI><A HREF="binutils.html#IDX91"><CODE>size</CODE> display format</A> <LI><A HREF="binutils.html#IDX92"><CODE>size</CODE> number format</A> <LI><A HREF="binutils.html#IDX43">sorting symbols</A> <LI><A HREF="binutils.html#IDX73">source disassembly</A> <LI><A HREF="binutils.html#IDX33">source file name</A> <LI><A HREF="binutils.html#IDX66">source filenames for object files</A> <LI><A HREF="binutils.html#IDX75">stab</A> <LI><A HREF="binutils.html#IDX79">start-address</A> <LI><A HREF="binutils.html#IDX80">stop-address</A> <LI><A HREF="binutils.html#IDX95">strings</A> <LI><A HREF="binutils.html#IDX98">strings, printing</A> <LI><A HREF="binutils.html#IDX100">strip</A> <LI><A HREF="binutils.html#IDX6">symbol index</A>, <A HREF="binutils.html#IDX88">symbol index</A> <LI><A HREF="binutils.html#IDX44">symbol index, listing</A> <LI><A HREF="binutils.html#IDX42">symbol line numbers</A> <LI><A HREF="binutils.html#IDX81">symbol table entries, printing</A> <LI><A HREF="binutils.html#IDX29">symbols</A> <LI><A HREF="binutils.html#IDX103">symbols, discarding</A> </DIR> <H2>u</H2> <DIR> <LI><A HREF="binutils.html#IDX47">undefined symbols</A>, <A HREF="binutils.html#IDX49">undefined symbols</A> <LI><A HREF="binutils.html#IDX9">Unix compatibility, <CODE>ar</CODE></A> <LI><A HREF="binutils.html#IDX24">updating an archive</A> </DIR> <H2>v</H2> <DIR> <LI><A HREF="binutils.html#IDX54">VMA in objdump</A> </DIR> <H2>w</H2> <DIR> <LI><A HREF="binutils.html#IDX85">wide output, printing</A> <LI><A HREF="binutils.html#IDX23">writing archive index</A> </DIR> </P> <P><HR><P> This document was generated on 23 August 1998 using the <A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A> translator version 1.51.</P> </BODY> </HTML>