1 This is ../../../src/binutils/doc/binutils.info, produced by makeinfo
2 version 4.2 from ../../../src/binutils/doc/binutils.texi.
5 * Binutils: (binutils). The GNU binary utilities.
6 * ar: (binutils)ar. Create, modify, and extract from archives
7 * nm: (binutils)nm. List symbols from object files
8 * objcopy: (binutils)objcopy. Copy and translate object files
9 * objdump: (binutils)objdump. Display information from object files
10 * ranlib: (binutils)ranlib. Generate index to archive contents
11 * readelf: (binutils)readelf. Display the contents of ELF format files.
12 * size: (binutils)size. List section sizes and total size
13 * strings: (binutils)strings. List printable strings from files
14 * strip: (binutils)strip. Discard symbols
15 * c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols
16 * cxxfilt: (binutils)c++filt. MS-DOS name for c++filt
17 * addr2line: (binutils)addr2line. Convert addresses to file and line
18 * nlmconv: (binutils)nlmconv. Converts object code into an NLM
19 * windres: (binutils)windres. Manipulate Windows resources
20 * dlltool: (binutils)dlltool. Create files needed to build and use DLLs
23 Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
24 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
26 Permission is granted to copy, distribute and/or modify this document
27 under the terms of the GNU Free Documentation License, Version 1.1 or
28 any later version published by the Free Software Foundation; with no
29 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
30 Texts. A copy of the license is included in the section entitled "GNU
31 Free Documentation License".
34 File: binutils.info, Node: Top, Next: ar, Up: (dir)
39 This brief manual contains documentation for the GNU binary
40 utilities (collectively version 2.16.91):
42 This document is distributed under the terms of the GNU Free
43 Documentation License. A copy of the license is included in the
44 section entitled "GNU Free Documentation License".
48 * ar:: Create, modify, and extract from archives
49 * nm:: List symbols from object files
50 * objcopy:: Copy and translate object files
51 * objdump:: Display information from object files
52 * ranlib:: Generate index to archive contents
53 * readelf:: Display the contents of ELF format files.
54 * size:: List section sizes and total size
55 * strings:: List printable strings from files
56 * strip:: Discard symbols
57 * c++filt:: Filter to demangle encoded C++ symbols
58 * cxxfilt: c++filt. MS-DOS name for c++filt
59 * addr2line:: Convert addresses to file and line
60 * nlmconv:: Converts object code into an NLM
61 * windres:: Manipulate Windows resources
62 * dlltool:: Create files needed to build and use DLLs
63 * Common Options:: Command-line options for all utilities
64 * Selecting The Target System:: How these utilities determine the target.
65 * Reporting Bugs:: Reporting Bugs
66 * GNU Free Documentation License:: GNU Free Documentation License
70 File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top
75 ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
78 The GNU `ar' program creates, modifies, and extracts from archives.
79 An "archive" is a single file holding a collection of other files in a
80 structure that makes it possible to retrieve the original individual
81 files (called "members" of the archive).
83 The original files' contents, mode (permissions), timestamp, owner,
84 and group are preserved in the archive, and can be restored on
87 GNU `ar' can maintain archives whose members have names of any
88 length; however, depending on how `ar' is configured on your system, a
89 limit on member-name length may be imposed for compatibility with
90 archive formats maintained with other tools. If it exists, the limit
91 is often 15 characters (typical of formats related to a.out) or 16
92 characters (typical of formats related to coff).
94 `ar' is considered a binary utility because archives of this sort
95 are most often used as "libraries" holding commonly needed subroutines.
97 `ar' creates an index to the symbols defined in relocatable object
98 modules in the archive when you specify the modifier `s'. Once
99 created, this index is updated in the archive whenever `ar' makes a
100 change to its contents (save for the `q' update operation). An archive
101 with such an index speeds up linking to the library, and allows
102 routines in the library to call each other without regard to their
103 placement in the archive.
105 You may use `nm -s' or `nm --print-armap' to list this index table.
106 If an archive lacks the table, another form of `ar' called `ranlib' can
107 be used to add just the table.
109 GNU `ar' is designed to be compatible with two different facilities.
110 You can control its activity using command-line options, like the
111 different varieties of `ar' on Unix systems; or, if you specify the
112 single command-line option `-M', you can control it with a script
113 supplied via standard input, like the MRI "librarian" program.
117 * ar cmdline:: Controlling `ar' on the command line
118 * ar scripts:: Controlling `ar' with a script
121 File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar
123 Controlling `ar' on the Command Line
124 ====================================
126 ar [`-X32_64'] [`-']P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
128 When you use `ar' in the Unix style, `ar' insists on at least two
129 arguments to execute: one keyletter specifying the _operation_
130 (optionally accompanied by other keyletters specifying _modifiers_),
131 and the archive name to act on.
133 Most operations can also accept further MEMBER arguments, specifying
134 particular files to operate on.
136 GNU `ar' allows you to mix the operation code P and modifier flags
137 MOD in any order, within the first command-line argument.
139 If you wish, you may begin the first command-line argument with a
142 The P keyletter specifies what operation to execute; it may be any
143 of the following, but you must specify only one of them:
146 _Delete_ modules from the archive. Specify the names of modules to
147 be deleted as MEMBER...; the archive is untouched if you specify
150 If you specify the `v' modifier, `ar' lists each module as it is
154 Use this operation to _move_ members in an archive.
156 The ordering of members in an archive can make a difference in how
157 programs are linked using the library, if a symbol is defined in
158 more than one member.
160 If no modifiers are used with `m', any members you name in the
161 MEMBER arguments are moved to the _end_ of the archive; you can
162 use the `a', `b', or `i' modifiers to move them to a specified
166 _Print_ the specified members of the archive, to the standard
167 output file. If the `v' modifier is specified, show the member
168 name before copying its contents to standard output.
170 If you specify no MEMBER arguments, all the files in the archive
174 _Quick append_; Historically, add the files MEMBER... to the end of
175 ARCHIVE, without checking for replacement.
177 The modifiers `a', `b', and `i' do _not_ affect this operation;
178 new members are always placed at the end of the archive.
180 The modifier `v' makes `ar' list each file as it is appended.
182 Since the point of this operation is speed, the archive's symbol
183 table index is not updated, even if it already existed; you can
184 use `ar s' or `ranlib' explicitly to update the symbol table index.
186 However, too many different systems assume quick append rebuilds
187 the index, so GNU `ar' implements `q' as a synonym for `r'.
190 Insert the files MEMBER... into ARCHIVE (with _replacement_). This
191 operation differs from `q' in that any previously existing members
192 are deleted if their names match those being added.
194 If one of the files named in MEMBER... does not exist, `ar'
195 displays an error message, and leaves undisturbed any existing
196 members of the archive matching that name.
198 By default, new members are added at the end of the file; but you
199 may use one of the modifiers `a', `b', or `i' to request placement
200 relative to some existing member.
202 The modifier `v' used with this operation elicits a line of output
203 for each file inserted, along with one of the letters `a' or `r'
204 to indicate whether the file was appended (no old member deleted)
208 Display a _table_ listing the contents of ARCHIVE, or those of the
209 files listed in MEMBER... that are present in the archive.
210 Normally only the member name is shown; if you also want to see
211 the modes (permissions), timestamp, owner, group, and size, you can
212 request that by also specifying the `v' modifier.
214 If you do not specify a MEMBER, all files in the archive are
217 If there is more than one file with the same name (say, `fie') in
218 an archive (say `b.a'), `ar t b.a fie' lists only the first
219 instance; to see them all, you must ask for a complete listing--in
220 our example, `ar t b.a'.
223 _Extract_ members (named MEMBER) from the archive. You can use
224 the `v' modifier with this operation, to request that `ar' list
225 each name as it extracts it.
227 If you do not specify a MEMBER, all files in the archive are
230 A number of modifiers (MOD) may immediately follow the P keyletter,
231 to specify variations on an operation's behavior:
234 Add new files _after_ an existing member of the archive. If you
235 use the modifier `a', the name of an existing archive member must
236 be present as the RELPOS argument, before the ARCHIVE
240 Add new files _before_ an existing member of the archive. If you
241 use the modifier `b', the name of an existing archive member must
242 be present as the RELPOS argument, before the ARCHIVE
243 specification. (same as `i').
246 _Create_ the archive. The specified ARCHIVE is always created if
247 it did not exist, when you request an update. But a warning is
248 issued unless you specify in advance that you expect to create it,
249 by using this modifier.
252 Truncate names in the archive. GNU `ar' will normally permit file
253 names of any length. This will cause it to create archives which
254 are not compatible with the native `ar' program on some systems.
255 If this is a concern, the `f' modifier may be used to truncate file
256 names when putting them in the archive.
259 Insert new files _before_ an existing member of the archive. If
260 you use the modifier `i', the name of an existing archive member
261 must be present as the RELPOS argument, before the ARCHIVE
262 specification. (same as `b').
265 This modifier is accepted but not used.
268 Uses the COUNT parameter. This is used if there are multiple
269 entries in the archive with the same name. Extract or delete
270 instance COUNT of the given name from the archive.
273 Preserve the _original_ dates of members when extracting them. If
274 you do not specify this modifier, files extracted from the archive
275 are stamped with the time of extraction.
278 Use the full path name when matching names in the archive. GNU
279 `ar' can not create an archive with a full path name (such archives
280 are not POSIX complaint), but other archive creators can. This
281 option will cause GNU `ar' to match file names using a complete
282 path name, which can be convenient when extracting a single file
283 from an archive created by another tool.
286 Write an object-file index into the archive, or update an existing
287 one, even if no other change is made to the archive. You may use
288 this modifier flag either with any operation, or alone. Running
289 `ar s' on an archive is equivalent to running `ranlib' on it.
292 Do not generate an archive symbol table. This can speed up
293 building a large library in several steps. The resulting archive
294 can not be used with the linker. In order to build a symbol
295 table, you must omit the `S' modifier on the last execution of
296 `ar', or you must run `ranlib' on the archive.
299 Normally, `ar r'... inserts all files listed into the archive. If
300 you would like to insert _only_ those of the files you list that
301 are newer than existing members of the same names, use this
302 modifier. The `u' modifier is allowed only for the operation `r'
303 (replace). In particular, the combination `qu' is not allowed,
304 since checking the timestamps would lose any speed advantage from
308 This modifier requests the _verbose_ version of an operation. Many
309 operations display additional information, such as filenames
310 processed, when the modifier `v' is appended.
313 This modifier shows the version number of `ar'.
315 `ar' ignores an initial option spelt `-X32_64', for compatibility
316 with AIX. The behaviour produced by this option is the default for GNU
317 `ar'. `ar' does not support any of the other `-X' options; in
318 particular, it does not support `-X32' which is the default for AIX
322 File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar
324 Controlling `ar' with a Script
325 ==============================
329 If you use the single command-line option `-M' with `ar', you can
330 control its operation with a rudimentary command language. This form
331 of `ar' operates interactively if standard input is coming directly
332 from a terminal. During interactive use, `ar' prompts for input (the
333 prompt is `AR >'), and continues executing even after errors. If you
334 redirect standard input to a script file, no prompts are issued, and
335 `ar' abandons execution (with a nonzero exit code) on any error.
337 The `ar' command language is _not_ designed to be equivalent to the
338 command-line options; in fact, it provides somewhat less control over
339 archives. The only purpose of the command language is to ease the
340 transition to GNU `ar' for developers who already have scripts written
341 for the MRI "librarian" program.
343 The syntax for the `ar' command language is straightforward:
344 * commands are recognized in upper or lower case; for example, `LIST'
345 is the same as `list'. In the following descriptions, commands are
346 shown in upper case for clarity.
348 * a single command may appear on each line; it is the first word on
351 * empty lines are allowed, and have no effect.
353 * comments are allowed; text after either of the characters `*' or
356 * Whenever you use a list of names as part of the argument to an `ar'
357 command, you can separate the individual names with either commas
358 or blanks. Commas are shown in the explanations below, for
361 * `+' is used as a line continuation character; if `+' appears at
362 the end of a line, the text on the following line is considered
363 part of the current command.
365 Here are the commands you can use in `ar' scripts, or when using
366 `ar' interactively. Three of them have special significance:
368 `OPEN' or `CREATE' specify a "current archive", which is a temporary
369 file required for most of the other commands.
371 `SAVE' commits the changes so far specified by the script. Prior to
372 `SAVE', commands affect only the temporary copy of the current archive.
375 `ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)'
376 Add all the contents of ARCHIVE (or, if specified, each named
377 MODULE from ARCHIVE) to the current archive.
379 Requires prior use of `OPEN' or `CREATE'.
381 `ADDMOD MEMBER, MEMBER, ... MEMBER'
382 Add each named MEMBER as a module in the current archive.
384 Requires prior use of `OPEN' or `CREATE'.
387 Discard the contents of the current archive, canceling the effect
388 of any operations since the last `SAVE'. May be executed (with no
389 effect) even if no current archive is specified.
392 Creates an archive, and makes it the current archive (required for
393 many other commands). The new archive is created with a temporary
394 name; it is not actually saved as ARCHIVE until you use `SAVE'.
395 You can overwrite existing archives; similarly, the contents of any
396 existing file named ARCHIVE will not be destroyed until `SAVE'.
398 `DELETE MODULE, MODULE, ... MODULE'
399 Delete each listed MODULE from the current archive; equivalent to
400 `ar -d ARCHIVE MODULE ... MODULE'.
402 Requires prior use of `OPEN' or `CREATE'.
404 `DIRECTORY ARCHIVE (MODULE, ... MODULE)'
405 `DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE'
406 List each named MODULE present in ARCHIVE. The separate command
407 `VERBOSE' specifies the form of the output: when verbose output is
408 off, output is like that of `ar -t ARCHIVE MODULE...'. When
409 verbose output is on, the listing is like `ar -tv ARCHIVE
412 Output normally goes to the standard output stream; however, if you
413 specify OUTPUTFILE as a final argument, `ar' directs the output to
417 Exit from `ar', with a `0' exit code to indicate successful
418 completion. This command does not save the output file; if you
419 have changed the current archive since the last `SAVE' command,
420 those changes are lost.
422 `EXTRACT MODULE, MODULE, ... MODULE'
423 Extract each named MODULE from the current archive, writing them
424 into the current directory as separate files. Equivalent to `ar -x
427 Requires prior use of `OPEN' or `CREATE'.
430 Display full contents of the current archive, in "verbose" style
431 regardless of the state of `VERBOSE'. The effect is like `ar tv
432 ARCHIVE'. (This single command is a GNU `ar' enhancement, rather
433 than present for MRI compatibility.)
435 Requires prior use of `OPEN' or `CREATE'.
438 Opens an existing archive for use as the current archive (required
439 for many other commands). Any changes as the result of subsequent
440 commands will not actually affect ARCHIVE until you next use
443 `REPLACE MODULE, MODULE, ... MODULE'
444 In the current archive, replace each existing MODULE (named in the
445 `REPLACE' arguments) from files in the current working directory.
446 To execute this command without errors, both the file, and the
447 module in the current archive, must exist.
449 Requires prior use of `OPEN' or `CREATE'.
452 Toggle an internal flag governing the output from `DIRECTORY'.
453 When the flag is on, `DIRECTORY' output matches output from `ar
457 Commit your changes to the current archive, and actually save it
458 as a file with the name specified in the last `CREATE' or `OPEN'
461 Requires prior use of `OPEN' or `CREATE'.
464 File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top
469 nm [`-a'|`--debug-syms'] [`-g'|`--extern-only']
470 [`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic']
471 [`-S'|`--print-size'] [`-s'|`--print-armap']
472 [`-A'|`-o'|`--print-file-name'][`--special-syms']
473 [`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort']
474 [`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only']
475 [`-t' RADIX|`--radix='RADIX] [`-P'|`--portability']
476 [`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT]
477 [`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle']
478 [`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...]
480 GNU `nm' lists the symbols from object files OBJFILE.... If no
481 object files are listed as arguments, `nm' assumes the file `a.out'.
483 For each symbol, `nm' shows:
485 * The symbol value, in the radix selected by options (see below), or
486 hexadecimal by default.
488 * The symbol type. At least the following types are used; others
489 are, as well, depending on the object file format. If lowercase,
490 the symbol is local; if uppercase, the symbol is global (external).
493 The symbol's value is absolute, and will not be changed by
497 The symbol is in the uninitialized data section (known as
501 The symbol is common. Common symbols are uninitialized data.
502 When linking, multiple common symbols may appear with the
503 same name. If the symbol is defined anywhere, the common
504 symbols are treated as undefined references. For more
505 details on common symbols, see the discussion of -warn-common
506 in *Note Linker options: (ld.info)Options.
509 The symbol is in the initialized data section.
512 The symbol is in an initialized data section for small
513 objects. Some object file formats permit more efficient
514 access to small data objects, such as a global int variable
515 as opposed to a large global array.
518 The symbol is an indirect reference to another symbol. This
519 is a GNU extension to the a.out object file format which is
523 The symbol is a debugging symbol.
526 The symbol is in a read only data section.
529 The symbol is in an uninitialized data section for small
533 The symbol is in the text (code) section.
536 The symbol is undefined.
539 The symbol is a weak object. When a weak defined symbol is
540 linked with a normal defined symbol, the normal defined
541 symbol is used with no error. When a weak undefined symbol
542 is linked and the symbol is not defined, the value of the
543 weak symbol becomes zero with no error.
546 The symbol is a weak symbol that has not been specifically
547 tagged as a weak object symbol. When a weak defined symbol
548 is linked with a normal defined symbol, the normal defined
549 symbol is used with no error. When a weak undefined symbol
550 is linked and the symbol is not defined, the value of the
551 symbol is determined in a system-specific manner without
552 error. On some systems, uppercase indicates that a default
553 value has been specified.
556 The symbol is a stabs symbol in an a.out object file. In
557 this case, the next values printed are the stabs other field,
558 the stabs desc field, and the stab type. Stabs symbols are
559 used to hold debugging information. For more information,
560 see *Note Stabs: (stabs.info)Top.
563 The symbol type is unknown, or object file format specific.
567 The long and short forms of options, shown here as alternatives, are
573 Precede each symbol by the name of the input file (or archive
574 member) in which it was found, rather than identifying the input
575 file once only, before all of its symbols.
579 Display all symbols, even debugger-only symbols; normally these
583 The same as `--format=bsd' (for compatibility with the MIPS `nm').
587 Decode ("demangle") low-level symbol names into user-level names.
588 Besides removing any initial underscore prepended by the system,
589 this makes C++ function names readable. Different compilers have
590 different mangling styles. The optional demangling style argument
591 can be used to choose an appropriate demangling style for your
592 compiler. *Note c++filt::, for more information on demangling.
595 Do not demangle low-level symbol names. This is the default.
599 Display the dynamic symbols rather than the normal symbols. This
600 is only meaningful for dynamic objects, such as certain types of
605 Use the output format FORMAT, which can be `bsd', `sysv', or
606 `posix'. The default is `bsd'. Only the first character of
607 FORMAT is significant; it can be either upper or lower case.
611 Display only external symbols.
615 For each symbol, use debugging information to try to find a
616 filename and line number. For a defined symbol, look for the line
617 number of the address of the symbol. For an undefined symbol,
618 look for the line number of a relocation entry which refers to the
619 symbol. If line number information can be found, print it after
620 the other symbol information.
625 Sort symbols numerically by their addresses, rather than
626 alphabetically by their names.
630 Do not bother to sort the symbols in any order; print them in the
635 Use the POSIX.2 standard output format instead of the default
636 format. Equivalent to `-f posix'.
640 Print size, not the value, of defined symbols for the `bsd' output
645 When listing symbols from archive members, include the index: a
646 mapping (stored in the archive by `ar' or `ranlib') of which
647 modules contain definitions for which names.
651 Reverse the order of the sort (whether numeric or alphabetic); let
655 Sort symbols by size. The size is computed as the difference
656 between the value of the symbol and the value of the symbol with
657 the next higher value. If the `bsd' output format is used the
658 size of the symbol is printed, rather than the value, and `-S'
659 must be used in order both size and value to be printed.
662 Display symbols which have a target-specific special meaning.
663 These symbols are usually used by the target for some special
664 processing and are not normally helpful when included included in
665 the normal symbol lists. For example for ARM targets this option
666 would skip the mapping symbols used to mark transistions between
667 ARM code, THUMB code and data.
671 Use RADIX as the radix for printing the symbol values. It must be
672 `d' for decimal, `o' for octal, or `x' for hexadecimal.
675 Specify an object code format other than your system's default
676 format. *Note Target Selection::, for more information.
680 Display only undefined symbols (those external to each object
684 Display only defined symbols for each object file.
688 Show the version number of `nm' and exit.
691 This option is ignored for compatibility with the AIX version of
692 `nm'. It takes one parameter which must be the string `32_64'.
693 The default mode of AIX `nm' corresponds to `-X 32', which is not
694 supported by GNU `nm'.
697 Show a summary of the options to `nm' and exit.
700 File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top
705 objcopy [`-F' BFDNAME|`--target='BFDNAME]
706 [`-I' BFDNAME|`--input-target='BFDNAME]
707 [`-O' BFDNAME|`--output-target='BFDNAME]
708 [`-B' BFDARCH|`--binary-architecture='BFDARCH]
710 [`-g'|`--strip-debug']
711 [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME]
712 [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME]
713 [`--strip-unneeded-symbol='SYMBOLNAME]
714 [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME]
715 [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME]
716 [`--globalize-symbol='SYMBOLNAME]
717 [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME]
719 [`-x'|`--discard-all']
720 [`-X'|`--discard-locals']
721 [`-b' BYTE|`--byte='BYTE]
722 [`-i' INTERLEAVE|`--interleave='INTERLEAVE]
723 [`-j' SECTIONNAME|`--only-section='SECTIONNAME]
724 [`-R' SECTIONNAME|`--remove-section='SECTIONNAME]
725 [`-p'|`--preserve-dates']
730 [`--adjust-start='INCR]
731 [`--change-addresses='INCR]
732 [`--change-section-address' SECTION{=,+,-}VAL]
733 [`--change-section-lma' SECTION{=,+,-}VAL]
734 [`--change-section-vma' SECTION{=,+,-}VAL]
735 [`--change-warnings'] [`--no-change-warnings']
736 [`--set-section-flags' SECTION=FLAGS]
737 [`--add-section' SECTIONNAME=FILENAME]
738 [`--rename-section' OLDNAME=NEWNAME[,FLAGS]]
739 [`--change-leading-char'] [`--remove-leading-char']
740 [`--srec-len='IVAL] [`--srec-forceS3']
741 [`--redefine-sym' OLD=NEW]
742 [`--redefine-syms='FILENAME]
744 [`--keep-symbols='FILENAME]
745 [`--strip-symbols='FILENAME]
746 [`--strip-unneeded-symbols='FILENAME]
747 [`--keep-global-symbols='FILENAME]
748 [`--localize-symbols='FILENAME]
749 [`--globalize-symbols='FILENAME]
750 [`--weaken-symbols='FILENAME]
751 [`--alt-machine-code='INDEX]
752 [`--prefix-symbols='STRING]
753 [`--prefix-sections='STRING]
754 [`--prefix-alloc-sections='STRING]
755 [`--add-gnu-debuglink='PATH-TO-FILE]
756 [`--keep-file-symbols']
757 [`--only-keep-debug']
764 [`--help'] [`--info']
767 The GNU `objcopy' utility copies the contents of an object file to
768 another. `objcopy' uses the GNU BFD Library to read and write the
769 object files. It can write the destination object file in a format
770 different from that of the source object file. The exact behavior of
771 `objcopy' is controlled by command-line options. Note that `objcopy'
772 should be able to copy a fully linked file between any two formats.
773 However, copying a relocatable object file between any two formats may
774 not work as expected.
776 `objcopy' creates temporary files to do its translations and deletes
777 them afterward. `objcopy' uses BFD to do all its translation work; it
778 has access to all the formats described in BFD and thus is able to
779 recognize most formats without being told explicitly. *Note BFD:
782 `objcopy' can be used to generate S-records by using an output
783 target of `srec' (e.g., use `-O srec').
785 `objcopy' can be used to generate a raw binary file by using an
786 output target of `binary' (e.g., use `-O binary'). When `objcopy'
787 generates a raw binary file, it will essentially produce a memory dump
788 of the contents of the input object file. All symbols and relocation
789 information will be discarded. The memory dump will start at the load
790 address of the lowest section copied into the output file.
792 When generating an S-record or a raw binary file, it may be helpful
793 to use `-S' to remove sections containing debugging information. In
794 some cases `-R' will be useful to remove sections which contain
795 information that is not needed by the binary file.
797 Note--`objcopy' is not able to change the endianness of its input
798 files. If the input format has an endianness (some formats do not),
799 `objcopy' can only copy the inputs into file formats that have the same
800 endianness or which have no endianness (e.g., `srec').
804 The input and output files, respectively. If you do not specify
805 OUTFILE, `objcopy' creates a temporary file and destructively
806 renames the result with the name of INFILE.
809 `--input-target=BFDNAME'
810 Consider the source file's object format to be BFDNAME, rather than
811 attempting to deduce it. *Note Target Selection::, for more
815 `--output-target=BFDNAME'
816 Write the output file using the object format BFDNAME. *Note
817 Target Selection::, for more information.
821 Use BFDNAME as the object format for both the input and the output
822 file; i.e., simply transfer data from source to destination with no
823 translation. *Note Target Selection::, for more information.
826 `--binary-architecture=BFDARCH'
827 Useful when transforming a raw binary input file into an object
828 file. In this case the output architecture can be set to BFDARCH.
829 This option will be ignored if the input file has a known BFDARCH.
830 You can access this binary data inside a program by referencing
831 the special symbols that are created by the conversion process.
832 These symbols are called _binary_OBJFILE_start,
833 _binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can
834 transform a picture file into an object file and then access it in
835 your code using these symbols.
838 `--only-section=SECTIONNAME'
839 Copy only the named section from the input file to the output file.
840 This option may be given more than once. Note that using this
841 option inappropriately may make the output file unusable.
844 `--remove-section=SECTIONNAME'
845 Remove any section named SECTIONNAME from the output file. This
846 option may be given more than once. Note that using this option
847 inappropriately may make the output file unusable.
851 Do not copy relocation and symbol information from the source file.
855 Do not copy debugging symbols or sections from the source file.
858 Strip all symbols that are not needed for relocation processing.
861 `--keep-symbol=SYMBOLNAME'
862 When stripping symbols, keep symbol SYMBOLNAME even if it would
863 normally be stripped. This option may be given more than once.
866 `--strip-symbol=SYMBOLNAME'
867 Do not copy symbol SYMBOLNAME from the source file. This option
868 may be given more than once.
870 `--strip-unneeded-symbol=SYMBOLNAME'
871 Do not copy symbol SYMBOLNAME from the source file unless it is
872 needed by a relocation. This option may be given more than once.
875 `--keep-global-symbol=SYMBOLNAME'
876 Keep only symbol SYMBOLNAME global. Make all other symbols local
877 to the file, so that they are not visible externally. This option
878 may be given more than once.
881 `--localize-symbol=SYMBOLNAME'
882 Make symbol SYMBOLNAME local to the file, so that it is not
883 visible externally. This option may be given more than once.
886 `--weaken-symbol=SYMBOLNAME'
887 Make symbol SYMBOLNAME weak. This option may be given more than
890 `--globalize-symbol=SYMBOLNAME'
891 Give symbol SYMBOLNAME global scoping so that it is visible
892 outside of the file in which it is defined. This option may be
893 given more than once.
897 Permit regular expressions in SYMBOLNAMEs used in other command
898 line options. The question mark (?), asterisk (*), backslash (\)
899 and square brackets ([]) operators can be used anywhere in the
900 symbol name. If the first character of the symbol name is the
901 exclamation point (!) then the sense of the switch is reversed for
902 that symbol. For example:
906 would cause objcopy to weaken all symbols that start with "fo"
907 except for the symbol "foo".
911 Do not copy non-global symbols from the source file.
915 Do not copy compiler-generated local symbols. (These usually
916 start with `L' or `.'.)
920 Keep only every BYTEth byte of the input file (header data is not
921 affected). BYTE can be in the range from 0 to INTERLEAVE-1, where
922 INTERLEAVE is given by the `-i' or `--interleave' option, or the
923 default of 4. This option is useful for creating files to program
924 ROM. It is typically used with an `srec' output target.
927 `--interleave=INTERLEAVE'
928 Only copy one out of every INTERLEAVE bytes. Select which byte to
929 copy with the `-b' or `--byte' option. The default is 4.
930 `objcopy' ignores this option if you do not specify either `-b' or
935 Set the access and modification dates of the output file to be the
936 same as those of the input file.
939 Convert debugging information, if possible. This is not the
940 default because only certain debugging formats are supported, and
941 the conversion process can be time consuming.
944 Fill gaps between sections with VAL. This operation applies to
945 the _load address_ (LMA) of the sections. It is done by increasing
946 the size of the section with the lower address, and filling in the
947 extra space created with VAL.
950 Pad the output file up to the load address ADDRESS. This is done
951 by increasing the size of the last section. The extra space is
952 filled in with the value specified by `--gap-fill' (default zero).
955 Set the start address of the new file to VAL. Not all object file
956 formats support setting the start address.
958 `--change-start INCR'
959 `--adjust-start INCR'
960 Change the start address by adding INCR. Not all object file
961 formats support setting the start address.
963 `--change-addresses INCR'
965 Change the VMA and LMA addresses of all sections, as well as the
966 start address, by adding INCR. Some object file formats do not
967 permit section addresses to be changed arbitrarily. Note that
968 this does not relocate the sections; if the program expects
969 sections to be loaded at a certain address, and this option is
970 used to change the sections such that they are loaded at a
971 different address, the program may fail.
973 `--change-section-address SECTION{=,+,-}VAL'
974 `--adjust-section-vma SECTION{=,+,-}VAL'
975 Set or change both the VMA address and the LMA address of the named
976 SECTION. If `=' is used, the section address is set to VAL.
977 Otherwise, VAL is added to or subtracted from the section address.
978 See the comments under `--change-addresses', above. If SECTION
979 does not exist in the input file, a warning will be issued, unless
980 `--no-change-warnings' is used.
982 `--change-section-lma SECTION{=,+,-}VAL'
983 Set or change the LMA address of the named SECTION. The LMA
984 address is the address where the section will be loaded into
985 memory at program load time. Normally this is the same as the VMA
986 address, which is the address of the section at program run time,
987 but on some systems, especially those where a program is held in
988 ROM, the two can be different. If `=' is used, the section
989 address is set to VAL. Otherwise, VAL is added to or subtracted
990 from the section address. See the comments under
991 `--change-addresses', above. If SECTION does not exist in the
992 input file, a warning will be issued, unless
993 `--no-change-warnings' is used.
995 `--change-section-vma SECTION{=,+,-}VAL'
996 Set or change the VMA address of the named SECTION. The VMA
997 address is the address where the section will be located once the
998 program has started executing. Normally this is the same as the
999 LMA address, which is the address where the section will be loaded
1000 into memory, but on some systems, especially those where a program
1001 is held in ROM, the two can be different. If `=' is used, the
1002 section address is set to VAL. Otherwise, VAL is added to or
1003 subtracted from the section address. See the comments under
1004 `--change-addresses', above. If SECTION does not exist in the
1005 input file, a warning will be issued, unless
1006 `--no-change-warnings' is used.
1010 If `--change-section-address' or `--change-section-lma' or
1011 `--change-section-vma' is used, and the named section does not
1012 exist, issue a warning. This is the default.
1014 `--no-change-warnings'
1015 `--no-adjust-warnings'
1016 Do not issue a warning if `--change-section-address' or
1017 `--adjust-section-lma' or `--adjust-section-vma' is used, even if
1018 the named section does not exist.
1020 `--set-section-flags SECTION=FLAGS'
1021 Set the flags for the named section. The FLAGS argument is a
1022 comma separated string of flag names. The recognized names are
1023 `alloc', `contents', `load', `noload', `readonly', `code', `data',
1024 `rom', `share', and `debug'. You can set the `contents' flag for
1025 a section which does not have contents, but it is not meaningful
1026 to clear the `contents' flag of a section which does have
1027 contents-just remove the section instead. Not all flags are
1028 meaningful for all object file formats.
1030 `--add-section SECTIONNAME=FILENAME'
1031 Add a new section named SECTIONNAME while copying the file. The
1032 contents of the new section are taken from the file FILENAME. The
1033 size of the section will be the size of the file. This option only
1034 works on file formats which can support sections with arbitrary
1037 `--rename-section OLDNAME=NEWNAME[,FLAGS]'
1038 Rename a section from OLDNAME to NEWNAME, optionally changing the
1039 section's flags to FLAGS in the process. This has the advantage
1040 over usng a linker script to perform the rename in that the output
1041 stays as an object file and does not become a linked executable.
1043 This option is particularly helpful when the input format is
1044 binary, since this will always create a section called .data. If
1045 for example, you wanted instead to create a section called .rodata
1046 containing binary data you could use the following command line to
1049 objcopy -I binary -O <output_format> -B <architecture> \
1050 --rename-section .data=.rodata,alloc,load,readonly,data,contents \
1051 <input_binary_file> <output_object_file>
1053 `--change-leading-char'
1054 Some object file formats use special characters at the start of
1055 symbols. The most common such character is underscore, which
1056 compilers often add before every symbol. This option tells
1057 `objcopy' to change the leading character of every symbol when it
1058 converts between object file formats. If the object file formats
1059 use the same leading character, this option has no effect.
1060 Otherwise, it will add a character, or remove a character, or
1061 change a character, as appropriate.
1063 `--remove-leading-char'
1064 If the first character of a global symbol is a special symbol
1065 leading character used by the object file format, remove the
1066 character. The most common symbol leading character is
1067 underscore. This option will remove a leading underscore from all
1068 global symbols. This can be useful if you want to link together
1069 objects of different file formats with different conventions for
1070 symbol names. This is different from `--change-leading-char'
1071 because it always changes the symbol name when appropriate,
1072 regardless of the object file format of the output file.
1075 Meaningful only for srec output. Set the maximum length of the
1076 Srecords being produced to IVAL. This length covers both address,
1077 data and crc fields.
1080 Meaningful only for srec output. Avoid generation of S1/S2
1081 records, creating S3-only record format.
1083 `--redefine-sym OLD=NEW'
1084 Change the name of a symbol OLD, to NEW. This can be useful when
1085 one is trying link two things together for which you have no
1086 source, and there are name collisions.
1088 `--redefine-syms=FILENAME'
1089 Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the
1090 file FILENAME. FILENAME is simply a flat file, with one symbol
1091 pair per line. Line comments may be introduced by the hash
1092 character. This option may be given more than once.
1095 Change all global symbols in the file to be weak. This can be
1096 useful when building an object which will be linked against other
1097 objects using the `-R' option to the linker. This option is only
1098 effective when using an object file format which supports weak
1101 `--keep-symbols=FILENAME'
1102 Apply `--keep-symbol' option to each symbol listed in the file
1103 FILENAME. FILENAME is simply a flat file, with one symbol name
1104 per line. Line comments may be introduced by the hash character.
1105 This option may be given more than once.
1107 `--strip-symbols=FILENAME'
1108 Apply `--strip-symbol' option to each symbol listed in the file
1109 FILENAME. FILENAME is simply a flat file, with one symbol name
1110 per line. Line comments may be introduced by the hash character.
1111 This option may be given more than once.
1113 `--strip-unneeded-symbols=FILENAME'
1114 Apply `--strip-unneeded-symbol' option to each symbol listed in
1115 the file FILENAME. FILENAME is simply a flat file, with one
1116 symbol name per line. Line comments may be introduced by the hash
1117 character. This option may be given more than once.
1119 `--keep-global-symbols=FILENAME'
1120 Apply `--keep-global-symbol' option to each symbol listed in the
1121 file FILENAME. FILENAME is simply a flat file, with one symbol
1122 name per line. Line comments may be introduced by the hash
1123 character. This option may be given more than once.
1125 `--localize-symbols=FILENAME'
1126 Apply `--localize-symbol' option to each symbol listed in the file
1127 FILENAME. FILENAME is simply a flat file, with one symbol name
1128 per line. Line comments may be introduced by the hash character.
1129 This option may be given more than once.
1131 `--globalize-symbols=FILENAME'
1132 Apply `--globalize-symbol' option to each symbol listed in the file
1133 FILENAME. FILENAME is simply a flat file, with one symbol name
1134 per line. Line comments may be introduced by the hash character.
1135 This option may be given more than once.
1137 `--weaken-symbols=FILENAME'
1138 Apply `--weaken-symbol' option to each symbol listed in the file
1139 FILENAME. FILENAME is simply a flat file, with one symbol name
1140 per line. Line comments may be introduced by the hash character.
1141 This option may be given more than once.
1143 `--alt-machine-code=INDEX'
1144 If the output architecture has alternate machine codes, use the
1145 INDEXth code instead of the default one. This is useful in case a
1146 machine is assigned an official code and the tool-chain adopts the
1147 new code, but other applications still depend on the original code
1151 Mark the output text as writable. This option isn't meaningful
1152 for all object file formats.
1155 Make the output text write protected. This option isn't
1156 meaningful for all object file formats.
1159 Mark the output file as demand paged. This option isn't
1160 meaningful for all object file formats.
1163 Mark the output file as impure. This option isn't meaningful for
1164 all object file formats.
1166 `--prefix-symbols=STRING'
1167 Prefix all symbols in the output file with STRING.
1169 `--prefix-sections=STRING'
1170 Prefix all section names in the output file with STRING.
1172 `--prefix-alloc-sections=STRING'
1173 Prefix all the names of all allocated sections in the output file
1176 `--add-gnu-debuglink=PATH-TO-FILE'
1177 Creates a .gnu_debuglink section which contains a reference to
1178 PATH-TO-FILE and adds it to the output file.
1180 `--keep-file-symbols'
1181 When stripping a file, perhaps with `--strip-debug' or
1182 `--strip-unneeded', retain any symbols specifying source file
1183 names, which would otherwise get stripped.
1186 Strip a file, removing contents of any sections that would not be
1187 stripped by `--strip-debug' and leaving the debugging sections
1190 The intention is that this option will be used in conjunction with
1191 `--add-gnu-debuglink' to create a two part executable. One a
1192 stripped binary which will occupy less space in RAM and in a
1193 distribution and the second a debugging information file which is
1194 only needed if debugging abilities are required. The suggested
1195 procedure to create these files is as follows:
1197 1. Link the executable as normal. Assuming that is is called
1200 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file
1201 containing the debugging info.
1203 3. Run `objcopy --strip-debug foo' to create a stripped
1206 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link
1207 to the debugging info into the stripped executable.
1209 Note - the choice of `.dbg' as an extension for the debug info
1210 file is arbitrary. Also the `--only-keep-debug' step is optional.
1211 You could instead do this:
1213 1. Link the executable as normal.
1215 2. Copy `foo' to `foo.full'
1217 3. Run `objcopy --strip-debug foo'
1219 4. Run `objcopy --add-gnu-debuglink=foo.full foo'
1221 i.e. the file pointed to by the `--add-gnu-debuglink' can be the
1222 full executable. It does not have to be a file created by the
1223 `--only-keep-debug' switch.
1227 Show the version number of `objcopy'.
1231 Verbose output: list all object files modified. In the case of
1232 archives, `objcopy -V' lists all members of the archive.
1235 Show a summary of the options to `objcopy'.
1238 Display a list showing all architectures and object formats
1242 File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top
1247 objdump [`-a'|`--archive-headers']
1248 [`-b' BFDNAME|`--target=BFDNAME']
1249 [`-C'|`--demangle'[=STYLE] ]
1250 [`-d'|`--disassemble']
1251 [`-D'|`--disassemble-all']
1252 [`-z'|`--disassemble-zeroes']
1253 [`-EB'|`-EL'|`--endian='{big | little }]
1254 [`-f'|`--file-headers']
1255 [`--file-start-context']
1256 [`-g'|`--debugging']
1257 [`-e'|`--debugging-tags']
1258 [`-h'|`--section-headers'|`--headers']
1260 [`-j' SECTION|`--section='SECTION]
1261 [`-l'|`--line-numbers']
1263 [`-m' MACHINE|`--architecture='MACHINE]
1264 [`-M' OPTIONS|`--disassembler-options='OPTIONS]
1265 [`-p'|`--private-headers']
1267 [`-R'|`--dynamic-reloc']
1268 [`-s'|`--full-contents']
1272 [`-T'|`--dynamic-syms']
1273 [`-x'|`--all-headers']
1275 [`--start-address='ADDRESS]
1276 [`--stop-address='ADDRESS]
1277 [`--prefix-addresses']
1278 [`--[no-]show-raw-insn']
1279 [`--adjust-vma='OFFSET]
1285 `objdump' displays information about one or more object files. The
1286 options control what particular information to display. This
1287 information is mostly useful to programmers who are working on the
1288 compilation tools, as opposed to programmers who just want their
1289 program to compile and work.
1291 OBJFILE... are the object files to be examined. When you specify
1292 archives, `objdump' shows information on each of the member object
1295 The long and short forms of options, shown here as alternatives, are
1296 equivalent. At least one option from the list
1297 `-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x' must be given.
1301 If any of the OBJFILE files are archives, display the archive
1302 header information (in a format similar to `ls -l'). Besides the
1303 information you could list with `ar tv', `objdump -a' shows the
1304 object file format of each archive member.
1306 `--adjust-vma=OFFSET'
1307 When dumping information, first add OFFSET to all the section
1308 addresses. This is useful if the section addresses do not
1309 correspond to the symbol table, which can happen when putting
1310 sections at particular addresses when using a format which can not
1311 represent section addresses, such as a.out.
1315 Specify that the object-code format for the object files is
1316 BFDNAME. This option may not be necessary; OBJDUMP can
1317 automatically recognize many formats.
1320 objdump -b oasys -m vax -h fu.o
1322 displays summary information from the section headers (`-h') of
1323 `fu.o', which is explicitly identified (`-m') as a VAX object file
1324 in the format produced by Oasys compilers. You can list the
1325 formats available with the `-i' option. *Note Target Selection::,
1326 for more information.
1329 `--demangle[=STYLE]'
1330 Decode ("demangle") low-level symbol names into user-level names.
1331 Besides removing any initial underscore prepended by the system,
1332 this makes C++ function names readable. Different compilers have
1333 different mangling styles. The optional demangling style argument
1334 can be used to choose an appropriate demangling style for your
1335 compiler. *Note c++filt::, for more information on demangling.
1339 Display debugging information. This attempts to parse debugging
1340 information stored in the file and print it out using a C like
1341 syntax. Only certain types of debugging information have been
1342 implemented. Some other types are supported by `readelf -w'.
1347 Like `-g', but the information is generated in a format compatible
1352 Display the assembler mnemonics for the machine instructions from
1353 OBJFILE. This option only disassembles those sections which are
1354 expected to contain instructions.
1358 Like `-d', but disassemble the contents of all sections, not just
1359 those expected to contain instructions.
1361 `--prefix-addresses'
1362 When disassembling, print the complete address on each line. This
1363 is the older disassembly format.
1367 `--endian={big|little}'
1368 Specify the endianness of the object files. This only affects
1369 disassembly. This can be useful when disassembling a file format
1370 which does not describe endianness information, such as S-records.
1374 Display summary information from the overall header of each of the
1377 `--file-start-context'
1378 Specify that when displaying interlisted source code/disassembly
1379 (assumes `-S') from a file that has not yet been displayed, extend
1380 the context to the start of the file.
1385 Display summary information from the section headers of the object
1388 File segments may be relocated to nonstandard addresses, for
1389 example by using the `-Ttext', `-Tdata', or `-Tbss' options to
1390 `ld'. However, some object file formats, such as a.out, do not
1391 store the starting address of the file segments. In those
1392 situations, although `ld' relocates the sections correctly, using
1393 `objdump -h' to list the file section headers cannot show the
1394 correct addresses. Instead, it shows the usual addresses, which
1395 are implicit for the target.
1399 Print a summary of the options to `objdump' and exit.
1403 Display a list showing all architectures and object formats
1404 available for specification with `-b' or `-m'.
1408 Display information only for section NAME.
1412 Label the display (using debugging information) with the filename
1413 and source line numbers corresponding to the object code or relocs
1414 shown. Only useful with `-d', `-D', or `-r'.
1417 `--architecture=MACHINE'
1418 Specify the architecture to use when disassembling object files.
1419 This can be useful when disassembling object files which do not
1420 describe architecture information, such as S-records. You can
1421 list the available architectures with the `-i' option.
1424 `--disassembler-options=OPTIONS'
1425 Pass target specific information to the disassembler. Only
1426 supported on some targets. If it is necessary to specify more
1427 than one disassembler option then multiple `-M' options can be
1428 used or can be placed together into a comma separated list.
1430 If the target is an ARM architecture then this switch can be used
1431 to select which register name set is used during disassembler.
1432 Specifying `-M reg-names-std' (the default) will select the
1433 register names as used in ARM's instruction set documentation, but
1434 with register 13 called 'sp', register 14 called 'lr' and register
1435 15 called 'pc'. Specifying `-M reg-names-apcs' will select the
1436 name set used by the ARM Procedure Call Standard, whilst
1437 specifying `-M reg-names-raw' will just use `r' followed by the
1440 There are also two variants on the APCS register naming scheme
1441 enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs'
1442 which use the ARM/Thumb Procedure Call Standard naming
1443 conventions. (Either with the normal register names or the
1444 special register names).
1446 This option can also be used for ARM architectures to force the
1447 disassembler to interpret all instructions as Thumb instructions by
1448 using the switch `--disassembler-options=force-thumb'. This can be
1449 useful when attempting to disassemble thumb code produced by other
1452 For the x86, some of the options duplicate functions of the `-m'
1453 switch, but allow finer grained control. Multiple selections from
1454 the following may be specified as a comma separated string.
1455 `x86-64', `i386' and `i8086' select disassembly for the given
1456 architecture. `intel' and `att' select between intel syntax mode
1457 and AT&T syntax mode. `addr32', `addr16', `data32' and `data16'
1458 specify the default address size and operand size. These four
1459 options will be overridden if `x86-64', `i386' or `i8086' appear
1460 later in the option string. Lastly, `suffix', when in AT&T mode,
1461 instructs the disassembler to print a mnemonic suffix even when the
1462 suffix could be inferred by the operands.
1464 For PPC, `booke', `booke32' and `booke64' select disassembly of
1465 BookE instructions. `32' and `64' select PowerPC and PowerPC64
1466 disassembly, respectively. `e300' selects disassembly for the
1469 For MIPS, this option controls the printing of instruction
1470 mneumonic names and register names in disassembled instructions.
1471 Multiple selections from the following may be specified as a comma
1472 separated string, and invalid options are ignored:
1475 Print the 'raw' instruction mneumonic instead of some pseudo
1476 instruction mneumonic. I.E. print 'daddu' or 'or' instead of
1477 'move', 'sll' instead of 'nop', etc.
1480 Print GPR (general-purpose register) names as appropriate for
1481 the specified ABI. By default, GPR names are selected
1482 according to the ABI of the binary being disassembled.
1485 Print FPR (floating-point register) names as appropriate for
1486 the specified ABI. By default, FPR numbers are printed
1490 Print CP0 (system control coprocessor; coprocessor 0)
1491 register names as appropriate for the CPU or architecture
1492 specified by ARCH. By default, CP0 register names are
1493 selected according to the architecture and CPU of the binary
1497 Print HWR (hardware register, used by the `rdhwr'
1498 instruction) names as appropriate for the CPU or architecture
1499 specified by ARCH. By default, HWR names are selected
1500 according to the architecture and CPU of the binary being
1504 Print GPR and FPR names as appropriate for the selected ABI.
1507 Print CPU-specific register names (CP0 register and HWR names)
1508 as appropriate for the selected CPU or architecture.
1510 For any of the options listed above, ABI or ARCH may be specified
1511 as `numeric' to have numbers printed rather than names, for the
1512 selected types of registers. You can list the available values of
1513 ABI and ARCH using the `--help' option.
1515 For VAX, you can specify function entry addresses with `-M
1516 entry:0xf00ba'. You can use this multiple times to properly
1517 disassemble VAX binary files that don't contain symbol tables (like
1518 ROM dumps). In these cases, the function entry mask would
1519 otherwise be decoded as VAX instructions, which would probably
1520 lead the the rest of the function being wrongly disassembled.
1524 Print information that is specific to the object file format. The
1525 exact information printed depends upon the object file format.
1526 For some object file formats, no additional information is printed.
1530 Print the relocation entries of the file. If used with `-d' or
1531 `-D', the relocations are printed interspersed with the
1536 Print the dynamic relocation entries of the file. This is only
1537 meaningful for dynamic objects, such as certain types of shared
1542 Display the full contents of any sections requested. By default
1543 all non-empty sections are displayed.
1547 Display source code intermixed with disassembly, if possible.
1551 When disassembling instructions, print the instruction in hex as
1552 well as in symbolic form. This is the default except when
1553 `--prefix-addresses' is used.
1555 `--no-show-raw-insn'
1556 When disassembling instructions, do not print the instruction
1557 bytes. This is the default when `--prefix-addresses' is used.
1561 Displays the contents of the DWARF debug sections in the file, if
1566 Display the full contents of any sections requested. Display the
1567 contents of the .stab and .stab.index and .stab.excl sections from
1568 an ELF file. This is only useful on systems (such as Solaris 2.0)
1569 in which `.stab' debugging symbol-table entries are carried in an
1570 ELF section. In most other file formats, debugging symbol-table
1571 entries are interleaved with linkage symbols, and are visible in
1572 the `--syms' output. For more information on stabs symbols, see
1573 *Note Stabs: (stabs.info)Top.
1575 `--start-address=ADDRESS'
1576 Start displaying data at the specified address. This affects the
1577 output of the `-d', `-r' and `-s' options.
1579 `--stop-address=ADDRESS'
1580 Stop displaying data at the specified address. This affects the
1581 output of the `-d', `-r' and `-s' options.
1585 Print the symbol table entries of the file. This is similar to
1586 the information provided by the `nm' program.
1590 Print the dynamic symbol table entries of the file. This is only
1591 meaningful for dynamic objects, such as certain types of shared
1592 libraries. This is similar to the information provided by the `nm'
1593 program when given the `-D' (`--dynamic') option.
1596 When displaying symbols include those which the target considers
1597 to be special in some way and which would not normally be of
1598 interest to the user.
1602 Print the version number of `objdump' and exit.
1606 Display all available header information, including the symbol
1607 table and relocation entries. Using `-x' is equivalent to
1608 specifying all of `-a -f -h -p -r -t'.
1612 Format some lines for output devices that have more than 80
1613 columns. Also do not truncate symbol names when they are
1617 `--disassemble-zeroes'
1618 Normally the disassembly output will skip blocks of zeroes. This
1619 option directs the disassembler to disassemble those blocks, just
1620 like any other data.
1623 File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top
1628 ranlib [`-vV'] ARCHIVE
1630 `ranlib' generates an index to the contents of an archive and stores
1631 it in the archive. The index lists each symbol defined by a member of
1632 an archive that is a relocatable object file.
1634 You may use `nm -s' or `nm --print-armap' to list this index.
1636 An archive with such an index speeds up linking to the library and
1637 allows routines in the library to call each other without regard to
1638 their placement in the archive.
1640 The GNU `ranlib' program is another form of GNU `ar'; running
1641 `ranlib' is completely equivalent to executing `ar -s'. *Note ar::.
1646 Show the version number of `ranlib'.
1649 File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top
1654 size [`-A'|`-B'|`--format='COMPATIBILITY]
1656 [`-d'|`-o'|`-x'|`--radix='NUMBER]
1658 [`--target='BFDNAME] [`-V'|`--version']
1661 The GNU `size' utility lists the section sizes--and the total
1662 size--for each of the object or archive files OBJFILE in its argument
1663 list. By default, one line of output is generated for each object file
1664 or each module in an archive.
1666 OBJFILE... are the object files to be examined. If none are
1667 specified, the file `a.out' will be used.
1669 The command line options have the following meanings:
1673 `--format=COMPATIBILITY'
1674 Using one of these options, you can choose whether the output from
1675 GNU `size' resembles output from System V `size' (using `-A', or
1676 `--format=sysv'), or Berkeley `size' (using `-B', or
1677 `--format=berkeley'). The default is the one-line format similar
1680 Here is an example of the Berkeley (default) format of output from
1682 $ size --format=Berkeley ranlib size
1683 text data bss dec hex filename
1684 294880 81920 11592 388392 5ed28 ranlib
1685 294880 81920 11888 388688 5ee50 size
1687 This is the same data, but displayed closer to System V
1690 $ size --format=SysV ranlib size
1707 Show a summary of acceptable arguments and options.
1713 Using one of these options, you can control whether the size of
1714 each section is given in decimal (`-d', or `--radix=10'); octal
1715 (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16').
1716 In `--radix=NUMBER', only the three values (8, 10, 16) are
1717 supported. The total size is always given in two radices; decimal
1718 and hexadecimal for `-d' or `-x' output, or octal and hexadecimal
1719 if you're using `-o'.
1723 Show totals of all objects listed (Berkeley format listing mode
1727 Specify that the object-code format for OBJFILE is BFDNAME. This
1728 option may not be necessary; `size' can automatically recognize
1729 many formats. *Note Target Selection::, for more information.
1733 Display the version number of `size'.
1736 File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top
1741 strings [`-afov'] [`-'MIN-LEN]
1742 [`-n' MIN-LEN] [`--bytes='MIN-LEN]
1743 [`-t' RADIX] [`--radix='RADIX]
1744 [`-e' ENCODING] [`--encoding='ENCODING]
1745 [`-'] [`--all'] [`--print-file-name']
1746 [`--target='BFDNAME]
1747 [`--help'] [`--version'] FILE...
1749 For each FILE given, GNU `strings' prints the printable character
1750 sequences that are at least 4 characters long (or the number given with
1751 the options below) and are followed by an unprintable character. By
1752 default, it only prints the strings from the initialized and loaded
1753 sections of object files; for other types of files, it prints the
1754 strings from the whole file.
1756 `strings' is mainly useful for determining the contents of non-text
1762 Do not scan only the initialized and loaded sections of object
1763 files; scan the whole files.
1767 Print the name of the file before each string.
1770 Print a summary of the program usage on the standard output and
1776 Print sequences of characters that are at least MIN-LEN characters
1777 long, instead of the default 4.
1780 Like `-t o'. Some other versions of `strings' have `-o' act like
1781 `-t d' instead. Since we can not be compatible with both ways, we
1786 Print the offset within the file before each string. The single
1787 character argument specifies the radix of the offset--`o' for
1788 octal, `x' for hexadecimal, or `d' for decimal.
1791 `--encoding=ENCODING'
1792 Select the character encoding of the strings that are to be found.
1793 Possible values for ENCODING are: `s' = single-7-bit-byte
1794 characters (ASCII, ISO 8859, etc., default), `S' =
1795 single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit
1796 littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian.
1797 Useful for finding wide character strings.
1800 Specify an object code format other than your system's default
1801 format. *Note Target Selection::, for more information.
1805 Print the program version number on the standard output and exit.
1808 File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top
1813 strip [`-F' BFDNAME |`--target='BFDNAME]
1814 [`-I' BFDNAME |`--input-target='BFDNAME]
1815 [`-O' BFDNAME |`--output-target='BFDNAME]
1816 [`-s'|`--strip-all']
1817 [`-S'|`-g'|`-d'|`--strip-debug']
1818 [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME]
1819 [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME]
1821 [`-x'|`--discard-all'] [`-X' |`--discard-locals']
1822 [`-R' SECTIONNAME |`--remove-section='SECTIONNAME]
1823 [`-o' FILE] [`-p'|`--preserve-dates']
1824 [`--keep-file-symbols']
1825 [`--only-keep-debug']
1826 [`-v' |`--verbose'] [`-V'|`--version']
1827 [`--help'] [`--info']
1830 GNU `strip' discards all symbols from object files OBJFILE. The
1831 list of object files may include archives. At least one object file
1834 `strip' modifies the files named in its argument, rather than
1835 writing modified copies under different names.
1839 Treat the original OBJFILE as a file with the object code format
1840 BFDNAME, and rewrite it in the same format. *Note Target
1841 Selection::, for more information.
1844 Show a summary of the options to `strip' and exit.
1847 Display a list showing all architectures and object formats
1851 `--input-target=BFDNAME'
1852 Treat the original OBJFILE as a file with the object code format
1853 BFDNAME. *Note Target Selection::, for more information.
1856 `--output-target=BFDNAME'
1857 Replace OBJFILE with a file in the output format BFDNAME. *Note
1858 Target Selection::, for more information.
1861 `--remove-section=SECTIONNAME'
1862 Remove any section named SECTIONNAME from the output file. This
1863 option may be given more than once. Note that using this option
1864 inappropriately may make the output file unusable.
1874 Remove debugging symbols only.
1877 Remove all symbols that are not needed for relocation processing.
1880 `--keep-symbol=SYMBOLNAME'
1881 When stripping symbols, keep symbol SYMBOLNAME even if it would
1882 normally be stripped. This option may be given more than once.
1885 `--strip-symbol=SYMBOLNAME'
1886 Remove symbol SYMBOLNAME from the source file. This option may be
1887 given more than once, and may be combined with strip options other
1891 Put the stripped output in FILE, rather than replacing the
1892 existing file. When this argument is used, only one OBJFILE
1893 argument may be specified.
1897 Preserve the access and modification dates of the file.
1901 Permit regular expressions in SYMBOLNAMEs used in other command
1902 line options. The question mark (?), asterisk (*), backslash (\)
1903 and square brackets ([]) operators can be used anywhere in the
1904 symbol name. If the first character of the symbol name is the
1905 exclamation point (!) then the sense of the switch is reversed for
1906 that symbol. For example:
1910 would cause strip to only keep symbols that start with the letters
1911 "fo", but to discard the symbol "foo".
1915 Remove non-global symbols.
1919 Remove compiler-generated local symbols. (These usually start
1922 `--keep-file-symbols'
1923 When stripping a file, perhaps with `--strip-debug' or
1924 `--strip-unneeded', retain any symbols specifying source file
1925 names, which would otherwise get stripped.
1928 Strip a file, removing any sections that would be stripped by
1929 `--strip-debug' and leaving the debugging sections.
1931 The intention is that this option will be used in conjunction with
1932 `--add-gnu-debuglink' to create a two part executable. One a
1933 stripped binary which will occupy less space in RAM and in a
1934 distribution and the second a debugging information file which is
1935 only needed if debugging abilities are required. The suggested
1936 procedure to create these files is as follows:
1938 1. Link the executable as normal. Assuming that is is called
1941 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file
1942 containing the debugging info.
1944 3. Run `objcopy --strip-debug foo' to create a stripped
1947 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link
1948 to the debugging info into the stripped executable.
1950 Note - the choice of `.dbg' as an extension for the debug info
1951 file is arbitrary. Also the `--only-keep-debug' step is optional.
1952 You could instead do this:
1954 1. Link the executable as normal.
1956 2. Copy `foo' to `foo.full'
1958 3. Run `strip --strip-debug foo'
1960 4. Run `objcopy --add-gnu-debuglink=foo.full foo'
1962 ie the file pointed to by the `--add-gnu-debuglink' can be the
1963 full executable. It does not have to be a file created by the
1964 `--only-keep-debug' switch.
1968 Show the version number for `strip'.
1972 Verbose output: list all object files modified. In the case of
1973 archives, `strip -v' lists all members of the archive.
1976 File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top
1981 c++filt [`-_'|`--strip-underscores']
1982 [`-n'|`--no-strip-underscores']
1983 [`-p'|`--no-params']
1985 [`-i'|`--no-verbose']
1986 [`-s' FORMAT|`--format='FORMAT]
1987 [`--help'] [`--version'] [SYMBOL...]
1989 The C++ and Java languages provide function overloading, which means
1990 that you can write many functions with the same name, providing that
1991 each function takes parameters of different types. In order to be able
1992 to distinguish these similarly named functions C++ and Java encode them
1993 into a low-level assembler name which uniquely identifies each
1994 different version. This process is known as "mangling". The `c++filt'
1995 (1) program does the inverse mapping: it decodes ("demangles") low-level
1996 names into user-level names so that they can be read.
1998 Every alphanumeric word (consisting of letters, digits, underscores,
1999 dollars, or periods) seen in the input is a potential mangled name. If
2000 the name decodes into a C++ name, the C++ name replaces the low-level
2001 name in the output, otherwise the original word is output. In this way
2002 you can pass an entire assembler source file, containing mangled names,
2003 through `c++filt' and see the same source file containing demangled
2006 You can also use `c++filt' to decipher individual symbols by passing
2007 them on the command line:
2011 If no SYMBOL arguments are given, `c++filt' reads symbol names from
2012 the standard input instead. All the results are printed on the
2013 standard output. The difference between reading names from the command
2014 line versus reading names from the standard input is that command line
2015 arguments are expected to be just mangled names and no checking is
2016 performed to seperate them from surrounding text. Thus for example:
2020 will work and demangle the name to "f()" whereas:
2024 will not work. (Note the extra comma at the end of the mangled name
2025 which makes it invalid). This command however will work:
2027 echo _Z1fv, | c++filt -n
2029 and will display "f()," ie the demangled name followed by a trailing
2030 comma. This behaviour is because when the names are read from the
2031 standard input it is expected that they might be part of an assembler
2032 source file where there might be extra, extraneous characters trailing
2033 after a mangled name. eg:
2035 .type _Z1fv, @function
2038 `--strip-underscores'
2039 On some systems, both the C and C++ compilers put an underscore in
2040 front of every name. For example, the C name `foo' gets the
2041 low-level name `_foo'. This option removes the initial
2042 underscore. Whether `c++filt' removes the underscore by default
2043 is target dependent.
2047 Prints demangled names using Java syntax. The default is to use
2051 `--no-strip-underscores'
2052 Do not remove the initial underscore.
2056 When demangling the name of a function, do not display the types of
2057 the function's parameters.
2061 Attempt to demangle types as well as function names. This is
2062 disabled by default since mangled types are normally only used
2063 internally in the compiler, and they can be confused with
2064 non-mangled names. eg a function called "a" treated as a mangled
2065 type name would be demangled to "signed char".
2069 Do not include implementation details (if any) in the demangled
2074 `c++filt' can decode various methods of mangling, used by
2075 different compilers. The argument to this option selects which
2079 Automatic selection based on executable (the default method)
2082 the one used by the GNU C++ compiler (g++)
2085 the one used by the Lucid compiler (lcc)
2088 the one specified by the C++ Annotated Reference Manual
2091 the one used by the HP compiler (aCC)
2094 the one used by the EDG compiler
2097 the one used by the GNU C++ compiler (g++) with the V3 ABI.
2100 the one used by the GNU Java compiler (gcj)
2103 the one used by the GNU Ada compiler (GNAT).
2106 Print a summary of the options to `c++filt' and exit.
2109 Print the version number of `c++filt' and exit.
2111 _Warning:_ `c++filt' is a new utility, and the details of its user
2112 interface are subject to change in future releases. In particular,
2113 a command-line option may be required in the the future to decode
2114 a name passed as an argument on the command line; in other words,
2118 may in a future release become
2120 c++filt OPTION SYMBOL
2122 ---------- Footnotes ----------
2124 (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS
2125 this program is named `CXXFILT'.
2128 File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top
2133 addr2line [`-b' BFDNAME|`--target='BFDNAME]
2134 [`-C'|`--demangle'[=STYLE]]
2135 [`-e' FILENAME|`--exe='FILENAME]
2136 [`-f'|`--functions'] [`-s'|`--basename']
2138 [`-H'|`--help'] [`-V'|`--version']
2141 `addr2line' translates program addresses into file names and line
2142 numbers. Given an address and an executable, it uses the debugging
2143 information in the executable to figure out which file name and line
2144 number are associated with a given address.
2146 The executable to use is specified with the `-e' option. The
2147 default is the file `a.out'.
2149 `addr2line' has two modes of operation.
2151 In the first, hexadecimal addresses are specified on the command
2152 line, and `addr2line' displays the file name and line number for each
2155 In the second, `addr2line' reads hexadecimal addresses from standard
2156 input, and prints the file name and line number for each address on
2157 standard output. In this mode, `addr2line' may be used in a pipe to
2158 convert dynamically chosen addresses.
2160 The format of the output is `FILENAME:LINENO'. The file name and
2161 line number for each address is printed on a separate line. If the
2162 `-f' option is used, then each `FILENAME:LINENO' line is preceded by a
2163 `FUNCTIONNAME' line which is the name of the function containing the
2166 If the file name or function name can not be determined, `addr2line'
2167 will print two question marks in their place. If the line number can
2168 not be determined, `addr2line' will print 0.
2170 The long and short forms of options, shown here as alternatives, are
2175 Specify that the object-code format for the object files is
2179 `--demangle[=STYLE]'
2180 Decode ("demangle") low-level symbol names into user-level names.
2181 Besides removing any initial underscore prepended by the system,
2182 this makes C++ function names readable. Different compilers have
2183 different mangling styles. The optional demangling style argument
2184 can be used to choose an appropriate demangling style for your
2185 compiler. *Note c++filt::, for more information on demangling.
2189 Specify the name of the executable for which addresses should be
2190 translated. The default file is `a.out'.
2194 Display function names as well as file and line number information.
2198 Display only the base of each file name.
2202 If the address belongs to a function that was inlined, the source
2203 information for all enclosing scopes back to the first non-inlined
2204 function will also be printed. For example, if `main' inlines
2205 `callee1' which inlines `callee2', and address is from `callee2',
2206 the source information for `callee1' and `main' will also be
2210 File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top
2215 `nlmconv' converts a relocatable object file into a NetWare Loadable
2218 _Warning:_ `nlmconv' is not always built as part of the binary
2219 utilities, since it is only useful for NLM targets.
2221 nlmconv [`-I' BFDNAME|`--input-target='BFDNAME]
2222 [`-O' BFDNAME|`--output-target='BFDNAME]
2223 [`-T' HEADERFILE|`--header-file='HEADERFILE]
2224 [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER]
2225 [`-h'|`--help'] [`-V'|`--version']
2228 `nlmconv' converts the relocatable `i386' object file INFILE into
2229 the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for
2230 NLM header information. For instructions on writing the NLM command
2231 file language used in header files, see the `linkers' section,
2232 `NLMLINK' in particular, of the `NLM Development and Tools Overview',
2233 which is part of the NLM Software Developer's Kit ("NLM SDK"),
2234 available from Novell, Inc. `nlmconv' uses the GNU Binary File
2235 Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for
2238 `nlmconv' can perform a link step. In other words, you can list
2239 more than one object file for input if you list them in the definitions
2240 file (rather than simply specifying one input file on the command line).
2241 In this case, `nlmconv' calls the linker for you.
2244 `--input-target=BFDNAME'
2245 Object format of the input file. `nlmconv' can usually determine
2246 the format of a given file (so no default is necessary). *Note
2247 Target Selection::, for more information.
2250 `--output-target=BFDNAME'
2251 Object format of the output file. `nlmconv' infers the output
2252 format based on the input format, e.g. for a `i386' input file the
2253 output format is `nlm32-i386'. *Note Target Selection::, for more
2257 `--header-file=HEADERFILE'
2258 Reads HEADERFILE for NLM header information. For instructions on
2259 writing the NLM command file language used in header files, see
2260 see the `linkers' section, of the `NLM Development and Tools
2261 Overview', which is part of the NLM Software Developer's Kit,
2262 available from Novell, Inc.
2266 Displays (on standard error) the linker command line used by
2271 Use LINKER for any linking. LINKER can be an absolute or a
2276 Prints a usage summary.
2280 Prints the version number for `nlmconv'.
2283 File: binutils.info, Node: windres, Next: dlltool, Prev: nlmconv, Up: Top
2288 `windres' may be used to manipulate Windows resources.
2290 _Warning:_ `windres' is not always built as part of the binary
2291 utilities, since it is only useful for Windows targets.
2293 windres [options] [input-file] [output-file]
2295 `windres' reads resources from an input file and copies them into an
2296 output file. Either file may be in one of three formats:
2299 A text format read by the Resource Compiler.
2302 A binary format generated by the Resource Compiler.
2305 A COFF object or executable.
2307 The exact description of these different formats is available in
2308 documentation from Microsoft.
2310 When `windres' converts from the `rc' format to the `res' format, it
2311 is acting like the Windows Resource Compiler. When `windres' converts
2312 from the `res' format to the `coff' format, it is acting like the
2313 Windows `CVTRES' program.
2315 When `windres' generates an `rc' file, the output is similar but not
2316 identical to the format expected for the input. When an input `rc'
2317 file refers to an external filename, an output `rc' file will instead
2318 include the file contents.
2320 If the input or output format is not specified, `windres' will guess
2321 based on the file name, or, for the input file, the file contents. A
2322 file with an extension of `.rc' will be treated as an `rc' file, a file
2323 with an extension of `.res' will be treated as a `res' file, and a file
2324 with an extension of `.o' or `.exe' will be treated as a `coff' file.
2326 If no output file is specified, `windres' will print the resources
2327 in `rc' format to standard output.
2329 The normal use is for you to write an `rc' file, use `windres' to
2330 convert it to a COFF object file, and then link the COFF file into your
2331 application. This will make the resources described in the `rc' file
2332 available to Windows.
2336 The name of the input file. If this option is not used, then
2337 `windres' will use the first non-option argument as the input file
2338 name. If there are no non-option arguments, then `windres' will
2339 read from standard input. `windres' can not read a COFF file from
2344 The name of the output file. If this option is not used, then
2345 `windres' will use the first non-option argument, after any used
2346 for the input file name, as the output file name. If there is no
2347 non-option argument, then `windres' will write to standard output.
2348 `windres' can not write a COFF file to standard output. Note, for
2349 compatability with `rc' the option `-fo' is also accepted, but its
2350 use is not recommended.
2353 `--input-format FORMAT'
2354 The input format to read. FORMAT may be `res', `rc', or `coff'.
2355 If no input format is specified, `windres' will guess, as
2359 `--output-format FORMAT'
2360 The output format to generate. FORMAT may be `res', `rc', or
2361 `coff'. If no output format is specified, `windres' will guess,
2366 Specify the BFD format to use for a COFF file as input or output.
2367 This is a BFD target name; you can use the `--help' option to see
2368 a list of supported targets. Normally `windres' will use the
2369 default format, which is the first one listed by the `--help'
2370 option. *Note Target Selection::.
2372 `--preprocessor PROGRAM'
2373 When `windres' reads an `rc' file, it runs it through the C
2374 preprocessor first. This option may be used to specify the
2375 preprocessor to use, including any leading arguments. The default
2376 preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'.
2379 `--include-dir DIRECTORY'
2380 Specify an include directory to use when reading an `rc' file.
2381 `windres' will pass this to the preprocessor as an `-I' option.
2382 `windres' will also search this directory when looking for files
2383 named in the `rc' file. If the argument passed to this command
2384 matches any of the supported FORMATS (as descrived in the `-J'
2385 option), it will issue a deprecation warning, and behave just like
2386 the `-J' option. New programs should not use this behaviour. If a
2387 directory happens to match a FORMAT, simple prefix it with `./' to
2388 disable the backward compatibility.
2391 `--define SYM[=VAL]'
2392 Specify a `-D' option to pass to the preprocessor when reading an
2397 Specify a `-U' option to pass to the preprocessor when reading an
2401 Ignored for compatibility with rc.
2404 Enable verbose mode. This tells you what the preprocessor is if
2405 you didn't specify one.
2410 Specify the default language to use when reading an `rc' file.
2411 VAL should be a hexadecimal language code. The low eight bits are
2412 the language, and the high eight bits are the sublanguage.
2415 Use a temporary file to instead of using popen to read the output
2416 of the preprocessor. Use this option if the popen implementation
2417 is buggy on the host (eg., certain non-English language versions
2418 of Windows 95 and Windows 98 are known to have buggy popen where
2419 the output will instead go the console).
2421 `--no-use-temp-file'
2422 Use popen, not a temporary file, to read the output of the
2423 preprocessor. This is the default behaviour.
2428 Prints a usage summary.
2433 Prints the version number for `windres'.
2436 If `windres' is compiled with `YYDEBUG' defined as `1', this will
2437 turn on parser debugging.
2440 File: binutils.info, Node: dlltool, Next: Common Options, Prev: windres, Up: Top
2445 `dlltool' is used to create the files needed to create dynamic link
2446 libraries (DLLs) on systems which understand PE format image files such
2447 as Windows. A DLL contains an export table which contains information
2448 that the runtime loader needs to resolve references from a referencing
2451 The export table is generated by this program by reading in a `.def'
2452 file or scanning the `.a' and `.o' files which will be in the DLL. A
2453 `.o' file can contain information in special `.drectve' sections with
2456 _Note:_ `dlltool' is not always built as part of the binary
2457 utilities, since it is only useful for those targets which support
2460 dlltool [`-d'|`--input-def' DEF-FILE-NAME]
2461 [`-b'|`--base-file' BASE-FILE-NAME]
2462 [`-e'|`--output-exp' EXPORTS-FILE-NAME]
2463 [`-z'|`--output-def' DEF-FILE-NAME]
2464 [`-l'|`--output-lib' LIBRARY-FILE-NAME]
2465 [`--export-all-symbols'] [`--no-export-all-symbols']
2466 [`--exclude-symbols' LIST]
2467 [`--no-default-excludes']
2468 [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS]
2469 [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE]
2470 [`-a'|`--add-indirect'] [`-U'|`--add-underscore'] [`-k'|`--kill-at']
2471 [`-A'|`--add-stdcall-alias']
2472 [`-p'|`--ext-prefix-alias' PREFIX]
2473 [`-x'|`--no-idata4'] [`-c'|`--no-idata5'] [`-i'|`--interwork']
2474 [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX]
2476 [`-h'|`--help'] [`-V'|`--version']
2479 `dlltool' reads its inputs, which can come from the `-d' and `-b'
2480 options as well as object files specified on the command line. It then
2481 processes these inputs and if the `-e' option has been specified it
2482 creates a exports file. If the `-l' option has been specified it
2483 creates a library file and if the `-z' option has been specified it
2484 creates a def file. Any or all of the `-e', `-l' and `-z' options can
2485 be present in one invocation of dlltool.
2487 When creating a DLL, along with the source for the DLL, it is
2488 necessary to have three other files. `dlltool' can help with the
2489 creation of these files.
2491 The first file is a `.def' file which specifies which functions are
2492 exported from the DLL, which functions the DLL imports, and so on. This
2493 is a text file and can be created by hand, or `dlltool' can be used to
2494 create it using the `-z' option. In this case `dlltool' will scan the
2495 object files specified on its command line looking for those functions
2496 which have been specially marked as being exported and put entries for
2497 them in the `.def' file it creates.
2499 In order to mark a function as being exported from a DLL, it needs to
2500 have an `-export:<name_of_function>' entry in the `.drectve' section of
2501 the object file. This can be done in C by using the asm() operator:
2503 asm (".section .drectve");
2504 asm (".ascii \"-export:my_func\"");
2506 int my_func (void) { ... }
2508 The second file needed for DLL creation is an exports file. This
2509 file is linked with the object files that make up the body of the DLL
2510 and it handles the interface between the DLL and the outside world.
2511 This is a binary file and it can be created by giving the `-e' option to
2512 `dlltool' when it is creating or reading in a `.def' file.
2514 The third file needed for DLL creation is the library file that
2515 programs will link with in order to access the functions in the DLL.
2516 This file can be created by giving the `-l' option to dlltool when it
2517 is creating or reading in a `.def' file.
2519 `dlltool' builds the library file by hand, but it builds the exports
2520 file by creating temporary files containing assembler statements and
2521 then assembling these. The `-S' command line option can be used to
2522 specify the path to the assembler that dlltool will use, and the `-f'
2523 option can be used to pass specific flags to that assembler. The `-n'
2524 can be used to prevent dlltool from deleting these temporary assembler
2525 files when it is done, and if `-n' is specified twice then this will
2526 prevent dlltool from deleting the temporary object files it used to
2529 Here is an example of creating a DLL from a source file `dll.c' and
2530 also creating a program (from an object file called `program.o') that
2534 dlltool -e exports.o -l dll.lib dll.o
2535 gcc dll.o exports.o -o dll.dll
2536 gcc program.o dll.lib -o program
2538 The command line options have the following meanings:
2541 `--input-def FILENAME'
2542 Specifies the name of a `.def' file to be read in and processed.
2545 `--base-file FILENAME'
2546 Specifies the name of a base file to be read in and processed. The
2547 contents of this file will be added to the relocation section in
2548 the exports file generated by dlltool.
2551 `--output-exp FILENAME'
2552 Specifies the name of the export file to be created by dlltool.
2555 `--output-def FILENAME'
2556 Specifies the name of the `.def' file to be created by dlltool.
2559 `--output-lib FILENAME'
2560 Specifies the name of the library file to be created by dlltool.
2562 `--export-all-symbols'
2563 Treat all global and weak defined symbols found in the input object
2564 files as symbols to be exported. There is a small list of symbols
2565 which are not exported by default; see the `--no-default-excludes'
2566 option. You may add to the list of symbols to not export by using
2567 the `--exclude-symbols' option.
2569 `--no-export-all-symbols'
2570 Only export symbols explicitly listed in an input `.def' file or in
2571 `.drectve' sections in the input object files. This is the default
2572 behaviour. The `.drectve' sections are created by `dllexport'
2573 attributes in the source code.
2575 `--exclude-symbols LIST'
2576 Do not export the symbols in LIST. This is a list of symbol names
2577 separated by comma or colon characters. The symbol names should
2578 not contain a leading underscore. This is only meaningful when
2579 `--export-all-symbols' is used.
2581 `--no-default-excludes'
2582 When `--export-all-symbols' is used, it will by default avoid
2583 exporting certain special symbols. The current list of symbols to
2584 avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'.
2585 You may use the `--no-default-excludes' option to go ahead and
2586 export these special symbols. This is only meaningful when
2587 `--export-all-symbols' is used.
2591 Specifies the path, including the filename, of the assembler to be
2592 used to create the exports file.
2595 `--as-flags OPTIONS'
2596 Specifies any specific command line options to be passed to the
2597 assembler when building the exports file. This option will work
2598 even if the `-S' option is not used. This option only takes one
2599 argument, and if it occurs more than once on the command line,
2600 then later occurrences will override earlier occurrences. So if
2601 it is necessary to pass multiple options to the assembler they
2602 should be enclosed in double quotes.
2606 Specifies the name to be stored in the `.def' file as the name of
2607 the DLL when the `-e' option is used. If this option is not
2608 present, then the filename given to the `-e' option will be used
2609 as the name of the DLL.
2613 Specifies the type of machine for which the library file should be
2614 built. `dlltool' has a built in default type, depending upon how
2615 it was created, but this option can be used to override that.
2616 This is normally only useful when creating DLLs for an ARM
2617 processor, when the contents of the DLL are actually encode using
2622 Specifies that when `dlltool' is creating the exports file it
2623 should add a section which allows the exported functions to be
2624 referenced without using the import library. Whatever the hell
2629 Specifies that when `dlltool' is creating the exports file it
2630 should prepend an underscore to the names of the exported
2635 Specifies that when `dlltool' is creating the exports file it
2636 should not append the string `@ <number>'. These numbers are
2637 called ordinal numbers and they represent another way of accessing
2638 the function in a DLL, other than by name.
2641 `--add-stdcall-alias'
2642 Specifies that when `dlltool' is creating the exports file it
2643 should add aliases for stdcall symbols without `@ <number>' in
2644 addition to the symbols with `@ <number>'.
2647 `--ext-prefix-alias PREFIX'
2648 Causes `dlltool' to create external aliases for all DLL imports
2649 with the specified prefix. The aliases are created for both
2650 external and import symbols with no leading underscore.
2654 Specifies that when `dlltool' is creating the exports and library
2655 files it should omit the `.idata4' section. This is for
2656 compatibility with certain operating systems.
2660 Specifies that when `dlltool' is creating the exports and library
2661 files it should omit the `.idata5' section. This is for
2662 compatibility with certain operating systems.
2666 Specifies that `dlltool' should mark the objects in the library
2667 file and exports file that it produces as supporting interworking
2668 between ARM and Thumb code.
2672 Makes `dlltool' preserve the temporary assembler files it used to
2673 create the exports file. If this option is repeated then dlltool
2674 will also preserve the temporary object files it uses to create
2678 `--temp-prefix PREFIX'
2679 Makes `dlltool' use PREFIX when constructing the names of
2680 temporary assembler and object files. By default, the temp file
2681 prefix is generated from the pid.
2685 Make dlltool describe what it is doing.
2689 Displays a list of command line options and then exits.
2693 Displays dlltool's version number and then exits.
2697 * def file format:: The format of the dlltool `.def' file
2700 File: binutils.info, Node: def file format, Up: dlltool
2702 The format of the `dlltool' `.def' file
2703 =======================================
2705 A `.def' file contains any number of the following commands:
2707 `NAME' NAME `[ ,' BASE `]'
2708 The result is going to be named NAME`.exe'.
2710 `LIBRARY' NAME `[ ,' BASE `]'
2711 The result is going to be named NAME`.dll'.
2713 `EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) )'
2715 `[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *'
2716 Declares NAME1 as an exported symbol from the DLL, with optional
2717 ordinal number INTEGER, or declares NAME1 as an alias (forward) of
2718 the function EXTERNAL-NAME in the DLL MODULE-NAME.
2720 `IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) ) *'
2721 Declares that EXTERNAL-NAME or the exported function whose ordinal
2722 number is INTEGER is to be imported from the file MODULE-NAME. If
2723 INTERNAL-NAME is specified then this is the name that the imported
2724 function will be referred to in the body of the DLL.
2726 `DESCRIPTION' STRING
2727 Puts STRING into the output `.exp' file in the `.rdata' section.
2729 `STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]'
2731 `HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]'
2732 Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in
2733 the output `.drectve' section. The linker will see this and act
2740 `SECTIONS (' SECTION-NAME ATTR` + ) *'
2741 Generates `--attr' SECTION-NAME ATTR in the output `.drectve'
2742 section, where ATTR is one of `READ', `WRITE', `EXECUTE' or
2743 `SHARED'. The linker will see this and act upon it.
2746 File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top
2751 readelf [`-a'|`--all']
2752 [`-h'|`--file-header']
2753 [`-l'|`--program-headers'|`--segments']
2754 [`-S'|`--section-headers'|`--sections']
2755 [`-g'|`--section-groups']
2756 [`-t'|`--section-details']
2758 [`-s'|`--syms'|`--symbols']
2763 [`-V'|`--version-info']
2764 [`-A'|`--arch-specific']
2765 [`-D'|`--use-dynamic']
2766 [`-x' <number or name>|`--hex-dump='<number or name>]
2768 `--debug-dump'[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
2775 `readelf' displays information about one or more ELF format object
2776 files. The options control what particular information to display.
2778 ELFFILE... are the object files to be examined. 32-bit and 64-bit
2779 ELF files are supported, as are archives containing ELF files.
2781 This program performs a similar function to `objdump' but it goes
2782 into more detail and it exists independently of the BFD library, so if
2783 there is a bug in BFD then readelf will not be affected.
2785 The long and short forms of options, shown here as alternatives, are
2786 equivalent. At least one option besides `-v' or `-H' must be given.
2790 Equivalent to specifiying `--file-header', `--program-headers',
2791 `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and
2796 Displays the information contained in the ELF header at the start
2802 Displays the information contained in the file's segment headers,
2808 Displays the information contained in the file's section headers,
2813 Displays the information contained in the file's section groups,
2818 Displays the detailed section information. Implies `-S'.
2823 Displays the entries in symbol table section of the file, if it
2828 Display all the headers in the file. Equivalent to `-h -l -S'.
2832 Displays the contents of the NOTE segments and/or sections, if any.
2836 Displays the contents of the file's relocation section, if it has
2841 Displays the contents of the file's unwind section, if it has one.
2842 Only the unwind sections for IA64 ELF files are currently
2847 Displays the contents of the file's dynamic section, if it has one.
2851 Displays the contents of the version sections in the file, it they
2856 Displays architecture-specific information in the file, if there
2861 When displaying symbols, this option makes `readelf' use the
2862 symbol table in the file's dynamic section, rather than the one in
2863 the symbols section.
2865 `-x <number or name>'
2866 `--hex-dump=<number or name>'
2867 Displays the contents of the indicated section as a hexadecimal
2868 dump. A number identifies a particular section by index in the
2869 section table; any other string identifies all sections with that
2870 name in the object file.
2873 `--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]'
2874 Displays the contents of the debug sections in the file, if any are
2875 present. If one of the optional letters or words follows the
2876 switch then only data found in those specific sections will be
2881 Display a histogram of bucket list lengths when displaying the
2882 contents of the symbol tables.
2886 Display the version number of readelf.
2890 Don't break output lines to fit into 80 columns. By default
2891 `readelf' breaks section header and segment listing lines for
2892 64-bit ELF files, so that they fit into 80 columns. This option
2893 causes `readelf' to print each section header resp. each segment
2894 one a single line, which is far more readable on terminals wider
2899 Display the command line options understood by `readelf'.
2902 File: binutils.info, Node: Common Options, Next: Selecting The Target System, Prev: dlltool, Up: Top
2907 The following command-line options are supported by all of the
2908 programs described in this manual.
2911 Read command-line options from FILE. The options read are
2912 inserted in place of the original @FILE option. If FILE does not
2913 exist, or cannot be read, then the option will be treated
2914 literally, and not removed.
2916 Options in FILE are separated by whitespace. A whitespace
2917 character may be included in an option by surrounding the entire
2918 option in either single or double quotes. Any character
2919 (including a backslash) may be included by prefixing the character
2920 to be included with a backslash. The FILE may itself contain
2921 additional @FILE options; any such options will be processed
2925 Display the command-line options supported by the program.
2928 Display the version number of the program.
2931 File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top
2933 Selecting the Target System
2934 ***************************
2936 You can specify two aspects of the target system to the GNU binary
2937 file utilities, each in several ways:
2943 In the following summaries, the lists of ways to specify values are
2944 in order of decreasing precedence. The ways listed first override those
2947 The commands to list valid values only list the values for which the
2948 programs you are running were configured. If they were configured with
2949 `--enable-targets=all', the commands list most of the available values,
2950 but a few are left out; not all targets can be configured in at once
2951 because some of them can only be configured "native" (on hosts with the
2952 same type as the target system).
2956 * Target Selection::
2957 * Architecture Selection::
2960 File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System
2965 A "target" is an object file format. A given target may be
2966 supported for multiple architectures (*note Architecture Selection::).
2967 A target selection may also have variations for different operating
2968 systems or architectures.
2970 The command to list valid target values is `objdump -i' (the first
2971 column of output contains the relevant information).
2973 Some sample values are: `a.out-hp300bsd', `ecoff-littlemips',
2976 You can also specify a target using a configuration triplet. This is
2977 the same sort of name that is passed to `configure' to specify a
2978 target. When you use a configuration triplet as an argument, it must be
2979 fully canonicalized. You can see the canonical version of a triplet by
2980 running the shell script `config.sub' which is included with the
2983 Some sample configuration triplets are: `m68k-hp-bsd',
2984 `mips-dec-ultrix', `sparc-sun-sunos'.
2991 1. command line option: `-b' or `--target'
2993 2. environment variable `GNUTARGET'
2995 3. deduced from the input file
2997 `objcopy' and `strip' Input Target
2998 ----------------------------------
3002 1. command line options: `-I' or `--input-target', or `-F' or
3005 2. environment variable `GNUTARGET'
3007 3. deduced from the input file
3009 `objcopy' and `strip' Output Target
3010 -----------------------------------
3014 1. command line options: `-O' or `--output-target', or `-F' or
3017 2. the input target (see "`objcopy' and `strip' Input Target" above)
3019 3. environment variable `GNUTARGET'
3021 4. deduced from the input file
3023 `nm', `size', and `strings' Target
3024 ----------------------------------
3028 1. command line option: `--target'
3030 2. environment variable `GNUTARGET'
3032 3. deduced from the input file
3035 File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting The Target System
3037 Architecture Selection
3038 ======================
3040 An "architecture" is a type of CPU on which an object file is to
3041 run. Its name may contain a colon, separating the name of the
3042 processor family from the name of the particular CPU.
3044 The command to list valid architecture values is `objdump -i' (the
3045 second column contains the relevant information).
3047 Sample values: `m68k:68020', `mips:3000', `sparc'.
3049 `objdump' Architecture
3050 ----------------------
3054 1. command line option: `-m' or `--architecture'
3056 2. deduced from the input file
3058 `objcopy', `nm', `size', `strings' Architecture
3059 -----------------------------------------------
3063 1. deduced from the input file
3066 File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top
3071 Your bug reports play an essential role in making the binary
3074 Reporting a bug may help you by bringing a solution to your problem,
3075 or it may not. But in any case the principal function of a bug report
3076 is to help the entire community by making the next version of the binary
3077 utilities work better. Bug reports are your contribution to their
3080 In order for a bug report to serve its purpose, you must include the
3081 information that enables us to fix the bug.
3085 * Bug Criteria:: Have you found a bug?
3086 * Bug Reporting:: How to report bugs
3089 File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
3091 Have You Found a Bug?
3092 =====================
3094 If you are not sure whether you have found a bug, here are some
3097 * If a binary utility gets a fatal signal, for any input whatever,
3098 that is a bug. Reliable utilities never crash.
3100 * If a binary utility produces an error message for valid input,
3103 * If you are an experienced user of binary utilities, your
3104 suggestions for improvement are welcome in any case.
3107 File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
3112 A number of companies and individuals offer support for GNU
3113 products. If you obtained the binary utilities from a support
3114 organization, we recommend you contact that organization first.
3116 You can find contact information for many support companies and
3117 individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
3119 In any event, we also recommend that you send bug reports for the
3120 binary utilities to `bug-binutils@gnu.org'.
3122 The fundamental principle of reporting bugs usefully is this:
3123 *report all the facts*. If you are not sure whether to state a fact or
3124 leave it out, state it!
3126 Often people omit facts because they think they know what causes the
3127 problem and assume that some details do not matter. Thus, you might
3128 assume that the name of a file you use in an example does not matter.
3129 Well, probably it does not, but one cannot be sure. Perhaps the bug is
3130 a stray memory reference which happens to fetch from the location where
3131 that pathname is stored in memory; perhaps, if the pathname were
3132 different, the contents of that location would fool the utility into
3133 doing the right thing despite the bug. Play it safe and give a
3134 specific, complete example. That is the easiest thing for you to do,
3135 and the most helpful.
3137 Keep in mind that the purpose of a bug report is to enable us to fix
3138 the bug if it is new to us. Therefore, always write your bug reports
3139 on the assumption that the bug has not been reported previously.
3141 Sometimes people give a few sketchy facts and ask, "Does this ring a
3142 bell?" This cannot help us fix a bug, so it is basically useless. We
3143 respond by asking for enough details to enable us to investigate. You
3144 might as well expedite matters by sending them to begin with.
3146 To enable us to fix the bug, you should include all these things:
3148 * The version of the utility. Each utility announces it if you
3149 start it with the `--version' argument.
3151 Without this, we will not know whether there is any point in
3152 looking for the bug in the current version of the binary utilities.
3154 * Any patches you may have applied to the source, including any
3155 patches made to the `BFD' library.
3157 * The type of machine you are using, and the operating system name
3160 * What compiler (and its version) was used to compile the
3161 utilities--e.g. "`gcc-2.7'".
3163 * The command arguments you gave the utility to observe the bug. To
3164 guarantee you will not omit something important, list them all. A
3165 copy of the Makefile (or the output from make) is sufficient.
3167 If we were to try to guess the arguments, we would probably guess
3168 wrong and then we might not encounter the bug.
3170 * A complete input file, or set of input files, that will reproduce
3171 the bug. If the utility is reading an object file or files, then
3172 it is generally most helpful to send the actual object files,
3173 uuencoded if necessary to get them through the mail system. Note
3174 that `bug-binutils@gnu.org' is a mailing list, so you should avoid
3175 sending very large files to it. Making the files available for
3176 anonymous FTP is OK.
3178 If the source files were produced exclusively using GNU programs
3179 (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to
3180 send the source files rather than the object files. In this case,
3181 be sure to say exactly what version of `gcc', or whatever, was
3182 used to produce the object files. Also say how `gcc', or
3183 whatever, was configured.
3185 * A description of what behavior you observe that you believe is
3186 incorrect. For example, "It gets a fatal signal."
3188 Of course, if the bug is that the utility gets a fatal signal,
3189 then we will certainly notice it. But if the bug is incorrect
3190 output, we might not notice unless it is glaringly wrong. You
3191 might as well not give us a chance to make a mistake.
3193 Even if the problem you experience is a fatal signal, you should
3194 still say so explicitly. Suppose something strange is going on,
3195 such as your copy of the utility is out of synch, or you have
3196 encountered a bug in the C library on your system. (This has
3197 happened!) Your copy might crash and ours would not. If you told
3198 us to expect a crash, then when ours fails to crash, we would know
3199 that the bug was not happening for us. If you had not told us to
3200 expect a crash, then we would not be able to draw any conclusion
3201 from our observations.
3203 * If you wish to suggest changes to the source, send us context
3204 diffs, as generated by `diff' with the `-u', `-c', or `-p' option.
3205 Always send diffs from the old file to the new file. If you wish
3206 to discuss something in the `ld' source, refer to it by context,
3209 The line numbers in our development sources will not match those
3210 in your sources. Your line numbers would convey no useful
3213 Here are some things that are not necessary:
3215 * A description of the envelope of the bug.
3217 Often people who encounter a bug spend a lot of time investigating
3218 which changes to the input file will make the bug go away and which
3219 changes will not affect it.
3221 This is often time consuming and not very useful, because the way
3222 we will find the bug is by running a single example under the
3223 debugger with breakpoints, not by pure deduction from a series of
3224 examples. We recommend that you save your time for something else.
3226 Of course, if you can find a simpler example to report _instead_
3227 of the original one, that is a convenience for us. Errors in the
3228 output will be easier to spot, running under the debugger will take
3229 less time, and so on.
3231 However, simplification is not vital; if you do not want to do
3232 this, report the bug anyway and send us the entire test case you
3235 * A patch for the bug.
3237 A patch for the bug does help us if it is a good one. But do not
3238 omit the necessary information, such as the test case, on the
3239 assumption that a patch is all we need. We might see problems
3240 with your patch and decide to fix the problem another way, or we
3241 might not understand it at all.
3243 Sometimes with programs as complicated as the binary utilities it
3244 is very hard to construct an example that will make the program
3245 follow a certain path through the code. If you do not send us the
3246 example, we will not be able to construct one, so we will not be
3247 able to verify that the bug is fixed.
3249 And if we cannot understand what bug you are trying to fix, or why
3250 your patch should be an improvement, we will not install it. A
3251 test case will help us to understand.
3253 * A guess about what the bug is or what it depends on.
3255 Such guesses are usually wrong. Even we cannot guess right about
3256 such things without first using the debugger to find the facts.
3259 File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top
3261 GNU Free Documentation License
3262 ******************************
3264 Version 1.1, March 2000
3265 Copyright (C) 2000, 2003 Free Software Foundation, Inc.
3266 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
3268 Everyone is permitted to copy and distribute verbatim copies
3269 of this license document, but changing it is not allowed.
3274 The purpose of this License is to make a manual, textbook, or other
3275 written document "free" in the sense of freedom: to assure everyone
3276 the effective freedom to copy and redistribute it, with or without
3277 modifying it, either commercially or noncommercially. Secondarily,
3278 this License preserves for the author and publisher a way to get
3279 credit for their work, while not being considered responsible for
3280 modifications made by others.
3282 This License is a kind of "copyleft", which means that derivative
3283 works of the document must themselves be free in the same sense.
3284 It complements the GNU General Public License, which is a copyleft
3285 license designed for free software.
3287 We have designed this License in order to use it for manuals for
3288 free software, because free software needs free documentation: a
3289 free program should come with manuals providing the same freedoms
3290 that the software does. But this License is not limited to
3291 software manuals; it can be used for any textual work, regardless
3292 of subject matter or whether it is published as a printed book.
3293 We recommend this License principally for works whose purpose is
3294 instruction or reference.
3297 1. APPLICABILITY AND DEFINITIONS
3299 This License applies to any manual or other work that contains a
3300 notice placed by the copyright holder saying it can be distributed
3301 under the terms of this License. The "Document", below, refers to
3302 any such manual or work. Any member of the public is a licensee,
3303 and is addressed as "you."
3305 A "Modified Version" of the Document means any work containing the
3306 Document or a portion of it, either copied verbatim, or with
3307 modifications and/or translated into another language.
3309 A "Secondary Section" is a named appendix or a front-matter
3310 section of the Document that deals exclusively with the
3311 relationship of the publishers or authors of the Document to the
3312 Document's overall subject (or to related matters) and contains
3313 nothing that could fall directly within that overall subject.
3314 (For example, if the Document is in part a textbook of
3315 mathematics, a Secondary Section may not explain any mathematics.)
3316 The relationship could be a matter of historical connection with
3317 the subject or with related matters, or of legal, commercial,
3318 philosophical, ethical or political position regarding them.
3320 The "Invariant Sections" are certain Secondary Sections whose
3321 titles are designated, as being those of Invariant Sections, in
3322 the notice that says that the Document is released under this
3325 The "Cover Texts" are certain short passages of text that are
3326 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
3327 that says that the Document is released under this License.
3329 A "Transparent" copy of the Document means a machine-readable copy,
3330 represented in a format whose specification is available to the
3331 general public, whose contents can be viewed and edited directly
3332 and straightforwardly with generic text editors or (for images
3333 composed of pixels) generic paint programs or (for drawings) some
3334 widely available drawing editor, and that is suitable for input to
3335 text formatters or for automatic translation to a variety of
3336 formats suitable for input to text formatters. A copy made in an
3337 otherwise Transparent file format whose markup has been designed
3338 to thwart or discourage subsequent modification by readers is not
3339 Transparent. A copy that is not "Transparent" is called "Opaque."
3341 Examples of suitable formats for Transparent copies include plain
3342 ASCII without markup, Texinfo input format, LaTeX input format,
3343 SGML or XML using a publicly available DTD, and
3344 standard-conforming simple HTML designed for human modification.
3345 Opaque formats include PostScript, PDF, proprietary formats that
3346 can be read and edited only by proprietary word processors, SGML
3347 or XML for which the DTD and/or processing tools are not generally
3348 available, and the machine-generated HTML produced by some word
3349 processors for output purposes only.
3351 The "Title Page" means, for a printed book, the title page itself,
3352 plus such following pages as are needed to hold, legibly, the
3353 material this License requires to appear in the title page. For
3354 works in formats which do not have any title page as such, "Title
3355 Page" means the text near the most prominent appearance of the
3356 work's title, preceding the beginning of the body of the text.
3360 You may copy and distribute the Document in any medium, either
3361 commercially or noncommercially, provided that this License, the
3362 copyright notices, and the license notice saying this License
3363 applies to the Document are reproduced in all copies, and that you
3364 add no other conditions whatsoever to those of this License. You
3365 may not use technical measures to obstruct or control the reading
3366 or further copying of the copies you make or distribute. However,
3367 you may accept compensation in exchange for copies. If you
3368 distribute a large enough number of copies you must also follow
3369 the conditions in section 3.
3371 You may also lend copies, under the same conditions stated above,
3372 and you may publicly display copies.
3374 3. COPYING IN QUANTITY
3376 If you publish printed copies of the Document numbering more than
3377 100, and the Document's license notice requires Cover Texts, you
3378 must enclose the copies in covers that carry, clearly and legibly,
3379 all these Cover Texts: Front-Cover Texts on the front cover, and
3380 Back-Cover Texts on the back cover. Both covers must also clearly
3381 and legibly identify you as the publisher of these copies. The
3382 front cover must present the full title with all words of the
3383 title equally prominent and visible. You may add other material
3384 on the covers in addition. Copying with changes limited to the
3385 covers, as long as they preserve the title of the Document and
3386 satisfy these conditions, can be treated as verbatim copying in
3389 If the required texts for either cover are too voluminous to fit
3390 legibly, you should put the first ones listed (as many as fit
3391 reasonably) on the actual cover, and continue the rest onto
3394 If you publish or distribute Opaque copies of the Document
3395 numbering more than 100, you must either include a
3396 machine-readable Transparent copy along with each Opaque copy, or
3397 state in or with each Opaque copy a publicly-accessible
3398 computer-network location containing a complete Transparent copy
3399 of the Document, free of added material, which the general
3400 network-using public has access to download anonymously at no
3401 charge using public-standard network protocols. If you use the
3402 latter option, you must take reasonably prudent steps, when you
3403 begin distribution of Opaque copies in quantity, to ensure that
3404 this Transparent copy will remain thus accessible at the stated
3405 location until at least one year after the last time you
3406 distribute an Opaque copy (directly or through your agents or
3407 retailers) of that edition to the public.
3409 It is requested, but not required, that you contact the authors of
3410 the Document well before redistributing any large number of
3411 copies, to give them a chance to provide you with an updated
3412 version of the Document.
3416 You may copy and distribute a Modified Version of the Document
3417 under the conditions of sections 2 and 3 above, provided that you
3418 release the Modified Version under precisely this License, with
3419 the Modified Version filling the role of the Document, thus
3420 licensing distribution and modification of the Modified Version to
3421 whoever possesses a copy of it. In addition, you must do these
3422 things in the Modified Version:
3424 A. Use in the Title Page (and on the covers, if any) a title
3425 distinct from that of the Document, and from those of previous
3426 versions (which should, if there were any, be listed in the
3427 History section of the Document). You may use the same title
3428 as a previous version if the original publisher of that version
3430 B. List on the Title Page, as authors, one or more persons or
3431 entities responsible for authorship of the modifications in the
3432 Modified Version, together with at least five of the principal
3433 authors of the Document (all of its principal authors, if it
3434 has less than five).
3435 C. State on the Title page the name of the publisher of the
3436 Modified Version, as the publisher.
3437 D. Preserve all the copyright notices of the Document.
3438 E. Add an appropriate copyright notice for your modifications
3439 adjacent to the other copyright notices.
3440 F. Include, immediately after the copyright notices, a license
3441 notice giving the public permission to use the Modified Version
3442 under the terms of this License, in the form shown in the
3444 G. Preserve in that license notice the full lists of Invariant
3445 Sections and required Cover Texts given in the Document's
3447 H. Include an unaltered copy of this License.
3448 I. Preserve the section entitled "History", and its title, and add
3449 to it an item stating at least the title, year, new authors, and
3450 publisher of the Modified Version as given on the Title Page.
3451 If there is no section entitled "History" in the Document,
3452 create one stating the title, year, authors, and publisher of
3453 the Document as given on its Title Page, then add an item
3454 describing the Modified Version as stated in the previous
3456 J. Preserve the network location, if any, given in the Document for
3457 public access to a Transparent copy of the Document, and
3458 likewise the network locations given in the Document for
3459 previous versions it was based on. These may be placed in the
3460 "History" section. You may omit a network location for a work
3461 that was published at least four years before the Document
3462 itself, or if the original publisher of the version it refers
3463 to gives permission.
3464 K. In any section entitled "Acknowledgements" or "Dedications",
3465 preserve the section's title, and preserve in the section all the
3466 substance and tone of each of the contributor acknowledgements
3467 and/or dedications given therein.
3468 L. Preserve all the Invariant Sections of the Document,
3469 unaltered in their text and in their titles. Section numbers
3470 or the equivalent are not considered part of the section titles.
3471 M. Delete any section entitled "Endorsements." Such a section
3472 may not be included in the Modified Version.
3473 N. Do not retitle any existing section as "Endorsements" or to
3474 conflict in title with any Invariant Section.
3476 If the Modified Version includes new front-matter sections or
3477 appendices that qualify as Secondary Sections and contain no
3478 material copied from the Document, you may at your option
3479 designate some or all of these sections as invariant. To do this,
3480 add their titles to the list of Invariant Sections in the Modified
3481 Version's license notice. These titles must be distinct from any
3482 other section titles.
3484 You may add a section entitled "Endorsements", provided it contains
3485 nothing but endorsements of your Modified Version by various
3486 parties-for example, statements of peer review or that the text has
3487 been approved by an organization as the authoritative definition
3490 You may add a passage of up to five words as a Front-Cover Text,
3491 and a passage of up to 25 words as a Back-Cover Text, to the end
3492 of the list of Cover Texts in the Modified Version. Only one
3493 passage of Front-Cover Text and one of Back-Cover Text may be
3494 added by (or through arrangements made by) any one entity. If the
3495 Document already includes a cover text for the same cover,
3496 previously added by you or by arrangement made by the same entity
3497 you are acting on behalf of, you may not add another; but you may
3498 replace the old one, on explicit permission from the previous
3499 publisher that added the old one.
3501 The author(s) and publisher(s) of the Document do not by this
3502 License give permission to use their names for publicity for or to
3503 assert or imply endorsement of any Modified Version.
3505 5. COMBINING DOCUMENTS
3507 You may combine the Document with other documents released under
3508 this License, under the terms defined in section 4 above for
3509 modified versions, provided that you include in the combination
3510 all of the Invariant Sections of all of the original documents,
3511 unmodified, and list them all as Invariant Sections of your
3512 combined work in its license notice.
3514 The combined work need only contain one copy of this License, and
3515 multiple identical Invariant Sections may be replaced with a single
3516 copy. If there are multiple Invariant Sections with the same name
3517 but different contents, make the title of each such section unique
3518 by adding at the end of it, in parentheses, the name of the
3519 original author or publisher of that section if known, or else a
3520 unique number. Make the same adjustment to the section titles in
3521 the list of Invariant Sections in the license notice of the
3524 In the combination, you must combine any sections entitled
3525 "History" in the various original documents, forming one section
3526 entitled "History"; likewise combine any sections entitled
3527 "Acknowledgements", and any sections entitled "Dedications." You
3528 must delete all sections entitled "Endorsements."
3530 6. COLLECTIONS OF DOCUMENTS
3532 You may make a collection consisting of the Document and other
3533 documents released under this License, and replace the individual
3534 copies of this License in the various documents with a single copy
3535 that is included in the collection, provided that you follow the
3536 rules of this License for verbatim copying of each of the
3537 documents in all other respects.
3539 You may extract a single document from such a collection, and
3540 distribute it individually under this License, provided you insert
3541 a copy of this License into the extracted document, and follow
3542 this License in all other respects regarding verbatim copying of
3545 7. AGGREGATION WITH INDEPENDENT WORKS
3547 A compilation of the Document or its derivatives with other
3548 separate and independent documents or works, in or on a volume of
3549 a storage or distribution medium, does not as a whole count as a
3550 Modified Version of the Document, provided no compilation
3551 copyright is claimed for the compilation. Such a compilation is
3552 called an "aggregate", and this License does not apply to the
3553 other self-contained works thus compiled with the Document, on
3554 account of their being thus compiled, if they are not themselves
3555 derivative works of the Document.
3557 If the Cover Text requirement of section 3 is applicable to these
3558 copies of the Document, then if the Document is less than one
3559 quarter of the entire aggregate, the Document's Cover Texts may be
3560 placed on covers that surround only the Document within the
3561 aggregate. Otherwise they must appear on covers around the whole
3566 Translation is considered a kind of modification, so you may
3567 distribute translations of the Document under the terms of section
3568 4. Replacing Invariant Sections with translations requires special
3569 permission from their copyright holders, but you may include
3570 translations of some or all Invariant Sections in addition to the
3571 original versions of these Invariant Sections. You may include a
3572 translation of this License provided that you also include the
3573 original English version of this License. In case of a
3574 disagreement between the translation and the original English
3575 version of this License, the original English version will prevail.
3579 You may not copy, modify, sublicense, or distribute the Document
3580 except as expressly provided for under this License. Any other
3581 attempt to copy, modify, sublicense or distribute the Document is
3582 void, and will automatically terminate your rights under this
3583 License. However, parties who have received copies, or rights,
3584 from you under this License will not have their licenses
3585 terminated so long as such parties remain in full compliance.
3587 10. FUTURE REVISIONS OF THIS LICENSE
3589 The Free Software Foundation may publish new, revised versions of
3590 the GNU Free Documentation License from time to time. Such new
3591 versions will be similar in spirit to the present version, but may
3592 differ in detail to address new problems or concerns. See
3593 http://www.gnu.org/copyleft/.
3595 Each version of the License is given a distinguishing version
3596 number. If the Document specifies that a particular numbered
3597 version of this License "or any later version" applies to it, you
3598 have the option of following the terms and conditions either of
3599 that specified version or of any later version that has been
3600 published (not as a draft) by the Free Software Foundation. If
3601 the Document does not specify a version number of this License,
3602 you may choose any version ever published (not as a draft) by the
3603 Free Software Foundation.
3606 ADDENDUM: How to use this License for your documents
3607 ====================================================
3609 To use this License in a document you have written, include a copy of
3610 the License in the document and put the following copyright and license
3611 notices just after the title page:
3613 Copyright (C) YEAR YOUR NAME.
3614 Permission is granted to copy, distribute and/or modify this document
3615 under the terms of the GNU Free Documentation License, Version 1.1
3616 or any later version published by the Free Software Foundation;
3617 with the Invariant Sections being LIST THEIR TITLES, with the
3618 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
3619 A copy of the license is included in the section entitled "GNU
3620 Free Documentation License."
3622 If you have no Invariant Sections, write "with no Invariant Sections"
3623 instead of saying which ones are invariant. If you have no Front-Cover
3624 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being
3625 LIST"; likewise for Back-Cover Texts.
3627 If your document contains nontrivial examples of program code, we
3628 recommend releasing these examples in parallel under your choice of
3629 free software license, such as the GNU General Public License, to
3630 permit their use in free software.
3633 File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top
3641 * addr2line: addr2line.
3642 * address to file name and line number: addr2line.
3643 * all header information, object file: objdump.
3645 * ar compatibility: ar.
3646 * architecture: objdump.
3647 * architectures available: objdump.
3648 * archive contents: ranlib.
3649 * archive headers: objdump.
3651 * base files: dlltool.
3652 * bug criteria: Bug Criteria.
3653 * bug reports: Bug Reporting.
3654 * bugs: Reporting Bugs.
3655 * bugs, reporting: Bug Reporting.
3657 * changing object addresses: objcopy.
3658 * changing section address: objcopy.
3659 * changing section LMA: objcopy.
3660 * changing section VMA: objcopy.
3661 * changing start address: objcopy.
3662 * collections of files: ar.
3663 * compatibility, ar: ar.
3664 * contents of archive: ar cmdline.
3665 * crash: Bug Criteria.
3666 * creating archives: ar cmdline.
3668 * dates in archive: ar cmdline.
3669 * debug symbols: objdump.
3670 * debugging symbols: nm.
3671 * deleting from archive: ar cmdline.
3672 * demangling C++ symbols: c++filt.
3673 * demangling in nm: nm.
3674 * demangling in objdump <1>: addr2line.
3675 * demangling in objdump: objdump.
3676 * disassembling object code: objdump.
3677 * disassembly architecture: objdump.
3678 * disassembly endianness: objdump.
3679 * disassembly, with source: objdump.
3680 * discarding symbols: strip.
3684 * dynamic relocation entries, in object file: objdump.
3685 * dynamic symbol table entries, printing: objdump.
3686 * dynamic symbols: nm.
3687 * ELF dynamic section information: readelf.
3688 * ELF file header information: readelf.
3689 * ELF file information: readelf.
3690 * ELF notes: readelf.
3691 * ELF object file format: objdump.
3692 * ELF program header information: readelf.
3693 * ELF reloc information: readelf.
3694 * ELF section group information: readelf.
3695 * ELF section information: readelf.
3696 * ELF segment information: readelf.
3697 * ELF symbol table information: readelf.
3698 * ELF version sections informations: readelf.
3699 * endianness: objdump.
3700 * error on valid input: Bug Criteria.
3701 * external symbols: nm.
3702 * extract from archive: ar cmdline.
3703 * fatal signal: Bug Criteria.
3705 * header information, all: objdump.
3706 * input .def file: dlltool.
3707 * input file name: nm.
3709 * listings strings: strings.
3710 * machine instructions: objdump.
3711 * moving in archive: ar cmdline.
3712 * MRI compatibility, ar: ar scripts.
3713 * name duplication in archive: ar cmdline.
3716 * nm compatibility: nm.
3718 * not writing archive index: ar cmdline.
3720 * object code format <1>: objdump.
3721 * object code format <2>: strings.
3722 * object code format <3>: size.
3723 * object code format <4>: nm.
3724 * object code format: addr2line.
3725 * object file header: objdump.
3726 * object file information: objdump.
3727 * object file sections: objdump.
3728 * object formats available: objdump.
3729 * operations on archive: ar cmdline.
3730 * printing from archive: ar cmdline.
3731 * printing strings: strings.
3732 * quick append to archive: ar cmdline.
3733 * radix for section sizes: size.
3736 * relative placement in archive: ar cmdline.
3737 * relocation entries, in object file: objdump.
3738 * removing symbols: strip.
3739 * repeated names in archive: ar cmdline.
3740 * replacement in archive: ar cmdline.
3741 * reporting bugs: Reporting Bugs.
3742 * scripts, ar: ar scripts.
3743 * section addresses in objdump: objdump.
3744 * section headers: objdump.
3745 * section information: objdump.
3746 * section sizes: size.
3747 * sections, full contents: objdump.
3749 * size display format: size.
3750 * size number format: size.
3751 * sorting symbols: nm.
3752 * source code context: objdump.
3753 * source disassembly: objdump.
3754 * source file name: nm.
3755 * source filenames for object files: objdump.
3757 * start-address: objdump.
3758 * stop-address: objdump.
3760 * strings, printing: strings.
3762 * symbol index <1>: ar.
3763 * symbol index: ranlib.
3764 * symbol index, listing: nm.
3765 * symbol line numbers: nm.
3766 * symbol table entries, printing: objdump.
3768 * symbols, discarding: strip.
3769 * undefined symbols: nm.
3770 * Unix compatibility, ar: ar cmdline.
3771 * unwind information: readelf.
3772 * updating an archive: ar cmdline.
3774 * VMA in objdump: objdump.
3775 * wide output, printing: objdump.
3776 * writing archive index: ar cmdline.