1 \input texinfo @c -*- Texinfo -*-
2 @setfilename binutils.info
3 @settitle @sc{gnu} Binary Utilities
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1991-2022 Free Software Foundation, Inc.
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.3
17 or any later version published by the Free Software Foundation;
18 with no Invariant Sections, with no Front-Cover Texts, and with no
19 Back-Cover Texts. A copy of the license is included in the
20 section entitled ``GNU Free Documentation License''.
25 @dircategory Software development
27 * Binutils: (binutils). The GNU binary utilities.
30 @dircategory Individual utilities
32 * addr2line: (binutils)addr2line. Convert addresses to file and line.
33 * ar: (binutils)ar. Create, modify, and extract from archives.
34 * c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols.
35 * cxxfilt: (binutils)c++filt. MS-DOS name for c++filt.
36 * dlltool: (binutils)dlltool. Create files needed to build and use DLLs.
37 * nm: (binutils)nm. List symbols from object files.
38 * objcopy: (binutils)objcopy. Copy and translate object files.
39 * objdump: (binutils)objdump. Display information from object files.
40 * ranlib: (binutils)ranlib. Generate index to archive contents.
41 * readelf: (binutils)readelf. Display the contents of ELF format files.
42 * size: (binutils)size. List section sizes and total size.
43 * strings: (binutils)strings. List printable strings from files.
44 * strip: (binutils)strip. Discard symbols.
45 * elfedit: (binutils)elfedit. Update ELF header and property of ELF files.
46 * windmc: (binutils)windmc. Generator for Windows message resources.
47 * windres: (binutils)windres. Manipulate Windows resources.
51 @title The @sc{gnu} Binary Utilities
52 @ifset VERSION_PACKAGE
53 @subtitle @value{VERSION_PACKAGE}
55 @subtitle Version @value{VERSION}
57 @subtitle @value{UPDATED}
58 @author Roland H. Pesch
59 @author Jeffrey M. Osier
60 @author Cygnus Support
64 {\parskip=0pt \hfill Cygnus Support\par \hfill
65 Texinfo \texinfoversion\par }
68 @vskip 0pt plus 1filll
77 This brief manual contains documentation for the @sc{gnu} binary
79 @ifset VERSION_PACKAGE
80 @value{VERSION_PACKAGE}
82 version @value{VERSION}:
87 Create, modify, and extract from archives
90 List symbols from object files
93 Copy and translate object files
96 Display information from object files
99 Generate index to archive contents
102 Display the contents of ELF format files.
105 List file section sizes and total size
108 List printable strings from files
114 Update the ELF header and program property of ELF files.
117 Demangle encoded C++ symbols (on MS-DOS, this program is named
121 Convert addresses into file names and line numbers
124 Manipulate Windows resources
127 Generator for Windows message resources
130 Create the files needed to build and use Dynamic Link Libraries
134 This document is distributed under the terms of the GNU Free
135 Documentation License version 1.3. A copy of the license is included
136 in the section entitled ``GNU Free Documentation License''.
139 * ar:: Create, modify, and extract from archives
140 * nm:: List symbols from object files
141 * objcopy:: Copy and translate object files
142 * objdump:: Display information from object files
143 * ranlib:: Generate index to archive contents
144 * size:: List section sizes and total size
145 * strings:: List printable strings from files
146 * strip:: Discard symbols
147 * c++filt:: Filter to demangle encoded C++ symbols
148 * cxxfilt: c++filt. MS-DOS name for c++filt
149 * addr2line:: Convert addresses to file and line
150 * windmc:: Generator for Windows message resources
151 * windres:: Manipulate Windows resources
152 * dlltool:: Create files needed to build and use DLLs
153 * readelf:: Display the contents of ELF format files
154 * elfedit:: Update ELF header and property of ELF files
155 * Common Options:: Command-line options for all utilities
156 * Selecting the Target System:: How these utilities determine the target
157 * debuginfod:: Using binutils with debuginfod
158 * Reporting Bugs:: Reporting Bugs
159 * GNU Free Documentation License:: GNU Free Documentation License
160 * Binutils Index:: Binutils Index
168 @cindex collections of files
170 @c man title ar create, modify, and extract from archives
173 ar [-]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@option{--output} @var{dirname}] [@option{--record-libdeps} @var{libdeps}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}]
174 ar -M [ <mri-script ]
177 @c man begin DESCRIPTION ar
179 The @sc{gnu} @command{ar} program creates, modifies, and extracts from
180 archives. An @dfn{archive} is a single file holding a collection of
181 other files in a structure that makes it possible to retrieve
182 the original individual files (called @dfn{members} of the archive).
184 The original files' contents, mode (permissions), timestamp, owner, and
185 group are preserved in the archive, and can be restored on
189 @sc{gnu} @command{ar} can maintain archives whose members have names of any
190 length; however, depending on how @command{ar} is configured on your
191 system, a limit on member-name length may be imposed for compatibility
192 with archive formats maintained with other tools. If it exists, the
193 limit is often 15 characters (typical of formats related to a.out) or 16
194 characters (typical of formats related to coff).
197 @command{ar} is considered a binary utility because archives of this sort
198 are most often used as @dfn{libraries} holding commonly needed
199 subroutines. Since libraries often will depend on other libraries,
200 @command{ar} can also record the dependencies of a library when the
201 @option{--record-libdeps} option is specified.
204 @command{ar} creates an index to the symbols defined in relocatable
205 object modules in the archive when you specify the modifier @samp{s}.
206 Once created, this index is updated in the archive whenever @command{ar}
207 makes a change to its contents (save for the @samp{q} update operation).
208 An archive with such an index speeds up linking to the library, and
209 allows routines in the library to call each other without regard to
210 their placement in the archive.
212 You may use @samp{nm -s} or @samp{nm --print-armap} to list this index
213 table. If an archive lacks the table, another form of @command{ar} called
214 @command{ranlib} can be used to add just the table.
216 @cindex thin archives
217 @sc{gnu} @command{ar} can optionally create a @emph{thin} archive,
218 which contains a symbol index and references to the original copies
219 of the member files of the archive. This is useful for building
220 libraries for use within a local build tree, where the relocatable
221 objects are expected to remain available, and copying the contents of
222 each object would only waste time and space.
224 An archive can either be @emph{thin} or it can be normal. It cannot
225 be both at the same time. Once an archive is created its format
226 cannot be changed without first deleting it and then creating a new
227 archive in its place.
229 Thin archives are also @emph{flattened}, so that adding one thin
230 archive to another thin archive does not nest it, as would happen with
231 a normal archive. Instead the elements of the first archive are added
232 individually to the second archive.
234 The paths to the elements of the archive are stored relative to the
237 @cindex compatibility, @command{ar}
238 @cindex @command{ar} compatibility
239 @sc{gnu} @command{ar} is designed to be compatible with two different
240 facilities. You can control its activity using command-line options,
241 like the different varieties of @command{ar} on Unix systems; or, if you
242 specify the single command-line option @option{-M}, you can control it
243 with a script supplied via standard input, like the MRI ``librarian''
249 * ar cmdline:: Controlling @command{ar} on the command line
250 * ar scripts:: Controlling @command{ar} with a script
255 @section Controlling @command{ar} on the Command Line
258 @c man begin SYNOPSIS ar
259 ar [@option{-X32_64}] [@option{-}]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@option{--output} @var{dirname}] [@option{--record-libdeps} @var{libdeps}] [@option{--thin}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}]
263 @cindex Unix compatibility, @command{ar}
264 When you use @command{ar} in the Unix style, @command{ar} insists on at least two
265 arguments to execute: one keyletter specifying the @emph{operation}
266 (optionally accompanied by other keyletters specifying
267 @emph{modifiers}), and the archive name to act on.
269 Most operations can also accept further @var{member} arguments,
270 specifying particular files to operate on.
272 @c man begin OPTIONS ar
274 @sc{gnu} @command{ar} allows you to mix the operation code @var{p} and modifier
275 flags @var{mod} in any order, within the first command-line argument.
277 If you wish, you may begin the first command-line argument with a
280 @cindex operations on archive
281 The @var{p} keyletter specifies what operation to execute; it may be
282 any of the following, but you must specify only one of them:
286 @cindex deleting from archive
287 @emph{Delete} modules from the archive. Specify the names of modules to
288 be deleted as @var{member}@dots{}; the archive is untouched if you
289 specify no files to delete.
291 If you specify the @samp{v} modifier, @command{ar} lists each module
295 @cindex moving in archive
296 Use this operation to @emph{move} members in an archive.
298 The ordering of members in an archive can make a difference in how
299 programs are linked using the library, if a symbol is defined in more
302 If no modifiers are used with @code{m}, any members you name in the
303 @var{member} arguments are moved to the @emph{end} of the archive;
304 you can use the @samp{a}, @samp{b}, or @samp{i} modifiers to move them to a
305 specified place instead.
308 @cindex printing from archive
309 @emph{Print} the specified members of the archive, to the standard
310 output file. If the @samp{v} modifier is specified, show the member
311 name before copying its contents to standard output.
313 If you specify no @var{member} arguments, all the files in the archive are
317 @cindex quick append to archive
318 @emph{Quick append}; Historically, add the files @var{member}@dots{} to the end of
319 @var{archive}, without checking for replacement.
321 The modifiers @samp{a}, @samp{b}, and @samp{i} do @emph{not} affect this
322 operation; new members are always placed at the end of the archive.
324 The modifier @samp{v} makes @command{ar} list each file as it is appended.
326 Since the point of this operation is speed, implementations of
327 @command{ar} have the option of not updating the archive's symbol
328 table if one exists. Too many different systems however assume that
329 symbol tables are always up-to-date, so @sc{gnu} @command{ar} will
330 rebuild the table even with a quick append.
332 Note - @sc{gnu} @command{ar} treats the command @samp{qs} as a
333 synonym for @samp{r} - replacing already existing files in the
334 archive and appending new ones at the end.
337 @cindex replacement in archive
338 Insert the files @var{member}@dots{} into @var{archive} (with
339 @emph{replacement}). This operation differs from @samp{q} in that any
340 previously existing members are deleted if their names match those being
343 If one of the files named in @var{member}@dots{} does not exist, @command{ar}
344 displays an error message, and leaves undisturbed any existing members
345 of the archive matching that name.
347 By default, new members are added at the end of the file; but you may
348 use one of the modifiers @samp{a}, @samp{b}, or @samp{i} to request
349 placement relative to some existing member.
351 The modifier @samp{v} used with this operation elicits a line of
352 output for each file inserted, along with one of the letters @samp{a} or
353 @samp{r} to indicate whether the file was appended (no old member
354 deleted) or replaced.
358 Add an index to the archive, or update it if it already exists. Note
359 this command is an exception to the rule that there can only be one
360 command letter, as it is possible to use it as either a command or a
361 modifier. In either case it does the same thing.
364 @cindex contents of archive
365 Display a @emph{table} listing the contents of @var{archive}, or those
366 of the files listed in @var{member}@dots{} that are present in the
367 archive. Normally only the member name is shown, but if the modifier
368 @samp{O} is specified, then the corresponding offset of the member is also
369 displayed. Finally, in order to see the modes (permissions), timestamp,
370 owner, group, and size the @samp{v} modifier should be included.
372 If you do not specify a @var{member}, all files in the archive
375 @cindex repeated names in archive
376 @cindex name duplication in archive
377 If there is more than one file with the same name (say, @samp{fie}) in
378 an archive (say @samp{b.a}), @samp{ar t b.a fie} lists only the
379 first instance; to see them all, you must ask for a complete
380 listing---in our example, @samp{ar t b.a}.
381 @c WRS only; per Gumby, this is implementation-dependent, and in a more
382 @c recent case in fact works the other way.
385 @cindex extract from archive
386 @emph{Extract} members (named @var{member}) from the archive. You can
387 use the @samp{v} modifier with this operation, to request that
388 @command{ar} list each name as it extracts it.
390 If you do not specify a @var{member}, all files in the archive
393 Files cannot be extracted from a thin archive, and there are
394 restrictions on extracting from archives created with @option{P}: The
395 paths must not be absolute, may not contain @code{..}, and any
396 subdirectories in the paths must exist. If it is desired to avoid
397 these restrictions then used the @option{--output} option to specify
401 A number of modifiers (@var{mod}) may immediately follow the @var{p}
402 keyletter, to specify variations on an operation's behavior:
406 @cindex relative placement in archive
407 Add new files @emph{after} an existing member of the
408 archive. If you use the modifier @samp{a}, the name of an existing archive
409 member must be present as the @var{relpos} argument, before the
410 @var{archive} specification.
413 Add new files @emph{before} an existing member of the
414 archive. If you use the modifier @samp{b}, the name of an existing archive
415 member must be present as the @var{relpos} argument, before the
416 @var{archive} specification. (same as @samp{i}).
419 @cindex creating archives
420 @emph{Create} the archive. The specified @var{archive} is always
421 created if it did not exist, when you request an update. But a warning is
422 issued unless you specify in advance that you expect to create it, by
426 @cindex deterministic archives
427 @kindex --enable-deterministic-archives
428 Operate in @emph{deterministic} mode. When adding files and the archive
429 index use zero for UIDs, GIDs, timestamps, and use consistent file modes
430 for all files. When this option is used, if @command{ar} is used with
431 identical options and identical input files, multiple runs will create
432 identical output files regardless of the input files' owners, groups,
433 file modes, or modification times.
435 If @file{binutils} was configured with
436 @option{--enable-deterministic-archives}, then this mode is on by default.
437 It can be disabled with the @samp{U} modifier, below.
440 Truncate names in the archive. @sc{gnu} @command{ar} will normally permit file
441 names of any length. This will cause it to create archives which are
442 not compatible with the native @command{ar} program on some systems. If
443 this is a concern, the @samp{f} modifier may be used to truncate file
444 names when putting them in the archive.
447 Insert new files @emph{before} an existing member of the
448 archive. If you use the modifier @samp{i}, the name of an existing archive
449 member must be present as the @var{relpos} argument, before the
450 @var{archive} specification. (same as @samp{b}).
453 @c This modifier was accepted but not used.
454 @c whaffor ar l modifier??? presumably compat; with
455 @c what???---doc@@cygnus.com, 25jan91
456 Specify dependencies of this library. The dependencies must immediately
457 follow this option character, must use the same syntax as the linker
458 command line, and must be specified within a single argument. I.e., if
459 multiple items are needed, they must be quoted to form a single command
460 line argument. For example @samp{L "-L/usr/local/lib -lmydep1 -lmydep2"}
463 Uses the @var{count} parameter. This is used if there are multiple
464 entries in the archive with the same name. Extract or delete instance
465 @var{count} of the given name from the archive.
468 @cindex dates in archive
469 Preserve the @emph{original} dates of members when extracting them. If
470 you do not specify this modifier, files extracted from the archive
471 are stamped with the time of extraction.
474 @cindex offsets of files
475 Display member offsets inside the archive. Use together with the @samp{t}
479 Use the full path name when matching or storing names in the archive.
480 Archives created with full path names are not POSIX compliant, and
481 thus may not work with tools other than up to date @sc{gnu} tools.
482 Modifying such archives with @sc{gnu} @command{ar} without using
483 @option{P} will remove the full path names unless the archive is a
484 thin archive. Note that @option{P} may be useful when adding files to
485 a thin archive since @option{r} without @option{P} ignores the path
486 when choosing which element to replace. Thus
488 ar rcST archive.a subdir/file1 subdir/file2 file1
490 will result in the first @code{subdir/file1} being replaced with
491 @code{file1} from the current directory. Adding @option{P} will
492 prevent this replacement.
495 @cindex writing archive index
496 Write an object-file index into the archive, or update an existing one,
497 even if no other change is made to the archive. You may use this modifier
498 flag either with any operation, or alone. Running @samp{ar s} on an
499 archive is equivalent to running @samp{ranlib} on it.
502 @cindex not writing archive index
503 Do not generate an archive symbol table. This can speed up building a
504 large library in several steps. The resulting archive can not be used
505 with the linker. In order to build a symbol table, you must omit the
506 @samp{S} modifier on the last execution of @samp{ar}, or you must run
507 @samp{ranlib} on the archive.
510 Deprecated alias for @option{--thin}. @option{T} is not recommended because in
511 many ar implementations @option{T} has a different meaning, as specified by
512 X/Open System Interface.
515 @cindex updating an archive
516 Normally, @samp{ar r}@dots{} inserts all files
517 listed into the archive. If you would like to insert @emph{only} those
518 of the files you list that are newer than existing members of the same
519 names, use this modifier. The @samp{u} modifier is allowed only for the
520 operation @samp{r} (replace). In particular, the combination @samp{qu} is
521 not allowed, since checking the timestamps would lose any speed
522 advantage from the operation @samp{q}.
525 @cindex deterministic archives
526 @kindex --enable-deterministic-archives
527 Do @emph{not} operate in @emph{deterministic} mode. This is the inverse
528 of the @samp{D} modifier, above: added files and the archive index will
529 get their actual UID, GID, timestamp, and file mode values.
531 This is the default unless @file{binutils} was configured with
532 @option{--enable-deterministic-archives}.
535 This modifier requests the @emph{verbose} version of an operation. Many
536 operations display additional information, such as filenames processed,
537 when the modifier @samp{v} is appended.
540 This modifier shows the version number of @command{ar}.
543 The @command{ar} program also supports some command-line options which
544 are neither modifiers nor actions, but which do change its behaviour
549 Displays the list of command-line options supported by @command{ar}
553 Displays the version information of @command{ar} and then exits.
556 @command{ar} ignores an initial option spelled @samp{-X32_64}, for
557 compatibility with AIX. The behaviour produced by this option is the
558 default for @sc{gnu} @command{ar}. @command{ar} does not support any
559 of the other @samp{-X} options; in particular, it does not support
560 @option{-X32} which is the default for AIX @command{ar}.
562 @item --plugin @var{name}
564 The optional command-line switch @option{--plugin @var{name}} causes
565 @command{ar} to load the plugin called @var{name} which adds support
566 for more file formats, including object files with link-time
567 optimization information.
569 This option is only available if the toolchain has been built with
570 plugin support enabled.
572 If @option{--plugin} is not provided, but plugin support has been
573 enabled then @command{ar} iterates over the files in
574 @file{$@{libdir@}/bfd-plugins} in alphabetic order and the first
575 plugin that claims the object in question is used.
577 Please note that this plugin search directory is @emph{not} the one
578 used by @command{ld}'s @option{-plugin} option. In order to make
579 @command{ar} use the linker plugin it must be copied into the
580 @file{$@{libdir@}/bfd-plugins} directory. For GCC based compilations
581 the linker plugin is called @file{liblto_plugin.so.0.0.0}. For Clang
582 based compilations it is called @file{LLVMgold.so}. The GCC plugin
583 is always backwards compatible with earlier versions, so it is
584 sufficient to just copy the newest one.
586 @item --target @var{target}
587 The optional command-line switch @option{--target @var{bfdname}}
588 specifies that the archive members are in an object code format
589 different from your system's default format. See
590 @xref{Target Selection}, for more information.
592 @item --output @var{dirname}
593 The @option{--output} option can be used to specify a path to a
594 directory into which archive members should be extracted. If this
595 option is not specified then the current directory will be used.
597 Note - although the presence of this option does imply a @option{x}
598 extraction operation that option must still be included on the command
601 @item --record-libdeps @var{libdeps}
602 The @option{--record-libdeps} option is identical to the @option{l} modifier,
603 just handled in long form.
606 @cindex creating thin archive
607 Make the specified @var{archive} a @emph{thin} archive. If it already
608 exists and is a regular archive, the existing members must be present
609 in the same directory as @var{archive}.
615 @c man begin SEEALSO ar
616 nm(1), ranlib(1), and the Info entries for @file{binutils}.
621 @section Controlling @command{ar} with a Script
624 ar -M [ <@var{script} ]
627 @cindex MRI compatibility, @command{ar}
628 @cindex scripts, @command{ar}
629 If you use the single command-line option @samp{-M} with @command{ar}, you
630 can control its operation with a rudimentary command language. This
631 form of @command{ar} operates interactively if standard input is coming
632 directly from a terminal. During interactive use, @command{ar} prompts for
633 input (the prompt is @samp{AR >}), and continues executing even after
634 errors. If you redirect standard input to a script file, no prompts are
635 issued, and @command{ar} abandons execution (with a nonzero exit code)
638 The @command{ar} command language is @emph{not} designed to be equivalent
639 to the command-line options; in fact, it provides somewhat less control
640 over archives. The only purpose of the command language is to ease the
641 transition to @sc{gnu} @command{ar} for developers who already have scripts
642 written for the MRI ``librarian'' program.
644 The syntax for the @command{ar} command language is straightforward:
647 commands are recognized in upper or lower case; for example, @code{LIST}
648 is the same as @code{list}. In the following descriptions, commands are
649 shown in upper case for clarity.
652 a single command may appear on each line; it is the first word on the
656 empty lines are allowed, and have no effect.
659 comments are allowed; text after either of the characters @samp{*}
660 or @samp{;} is ignored.
663 Whenever you use a list of names as part of the argument to an @command{ar}
664 command, you can separate the individual names with either commas or
665 blanks. Commas are shown in the explanations below, for clarity.
668 @samp{+} is used as a line continuation character; if @samp{+} appears
669 at the end of a line, the text on the following line is considered part
670 of the current command.
673 Here are the commands you can use in @command{ar} scripts, or when using
674 @command{ar} interactively. Three of them have special significance:
676 @code{OPEN} or @code{CREATE} specify a @dfn{current archive}, which is
677 a temporary file required for most of the other commands.
679 @code{SAVE} commits the changes so far specified by the script. Prior
680 to @code{SAVE}, commands affect only the temporary copy of the current
684 @item ADDLIB @var{archive}
685 @itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module})
686 Add all the contents of @var{archive} (or, if specified, each named
687 @var{module} from @var{archive}) to the current archive.
689 Requires prior use of @code{OPEN} or @code{CREATE}.
691 @item ADDMOD @var{member}, @var{member}, @dots{} @var{member}
692 @c FIXME! w/Replacement?? If so, like "ar r @var{archive} @var{names}"
693 @c else like "ar q..."
694 Add each named @var{member} as a module in the current archive.
696 Requires prior use of @code{OPEN} or @code{CREATE}.
699 Discard the contents of the current archive, canceling the effect of
700 any operations since the last @code{SAVE}. May be executed (with no
701 effect) even if no current archive is specified.
703 @item CREATE @var{archive}
704 Creates an archive, and makes it the current archive (required for many
705 other commands). The new archive is created with a temporary name; it
706 is not actually saved as @var{archive} until you use @code{SAVE}.
707 You can overwrite existing archives; similarly, the contents of any
708 existing file named @var{archive} will not be destroyed until @code{SAVE}.
710 @item DELETE @var{module}, @var{module}, @dots{} @var{module}
711 Delete each listed @var{module} from the current archive; equivalent to
712 @samp{ar -d @var{archive} @var{module} @dots{} @var{module}}.
714 Requires prior use of @code{OPEN} or @code{CREATE}.
716 @item DIRECTORY @var{archive} (@var{module}, @dots{} @var{module})
717 @itemx DIRECTORY @var{archive} (@var{module}, @dots{} @var{module}) @var{outputfile}
718 List each named @var{module} present in @var{archive}. The separate
719 command @code{VERBOSE} specifies the form of the output: when verbose
720 output is off, output is like that of @samp{ar -t @var{archive}
721 @var{module}@dots{}}. When verbose output is on, the listing is like
722 @samp{ar -tv @var{archive} @var{module}@dots{}}.
724 Output normally goes to the standard output stream; however, if you
725 specify @var{outputfile} as a final argument, @command{ar} directs the
729 Exit from @command{ar}, with a @code{0} exit code to indicate successful
730 completion. This command does not save the output file; if you have
731 changed the current archive since the last @code{SAVE} command, those
734 @item EXTRACT @var{module}, @var{module}, @dots{} @var{module}
735 Extract each named @var{module} from the current archive, writing them
736 into the current directory as separate files. Equivalent to @samp{ar -x
737 @var{archive} @var{module}@dots{}}.
739 Requires prior use of @code{OPEN} or @code{CREATE}.
742 @c FIXME Tokens but no commands???
749 Display full contents of the current archive, in ``verbose'' style
750 regardless of the state of @code{VERBOSE}. The effect is like @samp{ar
751 tv @var{archive}}. (This single command is a @sc{gnu} @command{ar}
752 enhancement, rather than present for MRI compatibility.)
754 Requires prior use of @code{OPEN} or @code{CREATE}.
756 @item OPEN @var{archive}
757 Opens an existing archive for use as the current archive (required for
758 many other commands). Any changes as the result of subsequent commands
759 will not actually affect @var{archive} until you next use @code{SAVE}.
761 @item REPLACE @var{module}, @var{module}, @dots{} @var{module}
762 In the current archive, replace each existing @var{module} (named in
763 the @code{REPLACE} arguments) from files in the current working directory.
764 To execute this command without errors, both the file, and the module in
765 the current archive, must exist.
767 Requires prior use of @code{OPEN} or @code{CREATE}.
770 Toggle an internal flag governing the output from @code{DIRECTORY}.
771 When the flag is on, @code{DIRECTORY} output matches output from
772 @samp{ar -tv }@dots{}.
775 Commit your changes to the current archive, and actually save it as a
776 file with the name specified in the last @code{CREATE} or @code{OPEN}
779 Requires prior use of @code{OPEN} or @code{CREATE}.
788 The @sc{gnu} linker @command{ld} is now described in a separate manual.
789 @xref{Top,, Overview,, Using LD: the @sc{gnu} linker}.
797 @c man title nm list symbols from object files
800 @c man begin SYNOPSIS nm
801 nm [@option{-A}|@option{-o}|@option{--print-file-name}]
802 [@option{-a}|@option{--debug-syms}]
803 [@option{-B}|@option{--format=bsd}]
804 [@option{-C}|@option{--demangle}[=@var{style}]]
805 [@option{-D}|@option{--dynamic}]
806 [@option{-f}@var{format}|@option{--format=}@var{format}]
807 [@option{-g}|@option{--extern-only}]
808 [@option{-h}|@option{--help}]
809 [@option{--ifunc-chars=@var{CHARS}}]
810 [@option{-j}|@option{--format=just-symbols}]
811 [@option{-l}|@option{--line-numbers}] [@option{--inlines}]
812 [@option{-n}|@option{-v}|@option{--numeric-sort}]
813 [@option{-P}|@option{--portability}]
814 [@option{-p}|@option{--no-sort}]
815 [@option{-r}|@option{--reverse-sort}]
816 [@option{-S}|@option{--print-size}]
817 [@option{-s}|@option{--print-armap}]
818 [@option{-t} @var{radix}|@option{--radix=}@var{radix}]
819 [@option{-u}|@option{--undefined-only}]
820 [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
821 [@option{-V}|@option{--version}]
823 [@option{--defined-only}]
824 [@option{--no-demangle}]
825 [@option{--no-recurse-limit}|@option{--recurse-limit}]]
826 [@option{--plugin} @var{name}]
827 [@option{--size-sort}]
828 [@option{--special-syms}]
829 [@option{--synthetic}]
830 [@option{--target=}@var{bfdname}]
831 [@option{--with-symbol-versions}]
832 [@option{--without-symbol-versions}]
833 [@var{objfile}@dots{}]
837 @c man begin DESCRIPTION nm
838 @sc{gnu} @command{nm} lists the symbols from object files @var{objfile}@dots{}.
839 If no object files are listed as arguments, @command{nm} assumes the file
842 For each symbol, @command{nm} shows:
846 The symbol value, in the radix selected by options (see below), or
847 hexadecimal by default.
850 The symbol type. At least the following types are used; others are, as
851 well, depending on the object file format. If lowercase, the symbol is
852 usually local; if uppercase, the symbol is global (external). There
853 are however a few lowercase symbols that are shown for special global
854 symbols (@code{u}, @code{v} and @code{w}).
856 @c Some more detail on exactly what these symbol types are used for
860 The symbol's value is absolute, and will not be changed by further
865 The symbol is in the BSS data section. This section typically
866 contains zero-initialized or uninitialized data, although the exact
867 behavior is system dependent.
871 The symbol is common. Common symbols are uninitialized data. When
872 linking, multiple common symbols may appear with the same name. If the
873 symbol is defined anywhere, the common symbols are treated as undefined
876 For more details on common symbols, see the discussion of
877 --warn-common in @ref{Options,,Linker options,ld.info,The GNU linker}.
879 The lower case @var{c} character is used when the symbol is in a
880 special section for small commons.
884 The symbol is in the initialized data section.
888 The symbol is in an initialized data section for small objects. Some
889 object file formats permit more efficient access to small data objects,
890 such as a global int variable as opposed to a large global array.
893 For PE format files this indicates that the symbol is in a section
894 specific to the implementation of DLLs.
896 For ELF format files this indicates that the symbol is an indirect
897 function. This is a GNU extension to the standard set of ELF symbol
898 types. It indicates a symbol which if referenced by a relocation does
899 not evaluate to its address, but instead must be invoked at runtime.
900 The runtime execution will then return the value to be used in the
903 Note - the actual symbols display for GNU indirect symbols is
904 controlled by the @option{--ifunc-chars} command line option. If this
905 option has been provided then the first character in the string will
906 be used for global indirect function symbols. If the string contains
907 a second character then that will be used for local indirect function
911 The symbol is an indirect reference to another symbol.
914 The symbol is a debugging symbol.
917 The symbol is in the read-only data section.
920 The symbol is in a stack unwind section.
924 The symbol is in a read only data section.
928 The symbol is in an uninitialized or zero-initialized data section
933 The symbol is in the text (code) section.
936 The symbol is undefined.
939 The symbol is a unique global symbol. This is a GNU extension to the
940 standard set of ELF symbol bindings. For such a symbol the dynamic linker
941 will make sure that in the entire process there is just one symbol with
942 this name and type in use.
946 The symbol is a weak object. When a weak defined symbol is linked with
947 a normal defined symbol, the normal defined symbol is used with no error.
948 When a weak undefined symbol is linked and the symbol is not defined,
949 the value of the weak symbol becomes zero with no error. On some
950 systems, uppercase indicates that a default value has been specified.
954 The symbol is a weak symbol that has not been specifically tagged as a
955 weak object symbol. When a weak defined symbol is linked with a normal
956 defined symbol, the normal defined symbol is used with no error.
957 When a weak undefined symbol is linked and the symbol is not defined,
958 the value of the symbol is determined in a system-specific manner without
959 error. On some systems, uppercase indicates that a default value has been
963 The symbol is a stabs symbol in an a.out object file. In this case, the
964 next values printed are the stabs other field, the stabs desc field, and
965 the stab type. Stabs symbols are used to hold debugging information.
968 The symbol type is unknown, or object file format specific.
972 The symbol name. If a symbol has version information associated with it,
973 then the version information is displayed as well. If the versioned
974 symbol is undefined or hidden from linker, the version string is displayed
975 as a suffix to the symbol name, preceded by an @@ character. For example
976 @samp{foo@@VER_1}. If the version is the default version to be used when
977 resolving unversioned references to the symbol, then it is displayed as a
978 suffix preceded by two @@ characters. For example @samp{foo@@@@VER_2}.
983 @c man begin OPTIONS nm
984 The long and short forms of options, shown here as alternatives, are
990 @itemx --print-file-name
991 @cindex input file name
993 @cindex source file name
994 Precede each symbol by the name of the input file (or archive member)
995 in which it was found, rather than identifying the input file once only,
996 before all of its symbols.
1000 @cindex debugging symbols
1001 Display all symbols, even debugger-only symbols; normally these are not
1005 @cindex @command{nm} format
1006 @cindex @command{nm} compatibility
1007 The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}).
1010 @itemx --demangle[=@var{style}]
1011 @cindex demangling in nm
1012 Decode (@dfn{demangle}) low-level symbol names into user-level names.
1013 Besides removing any initial underscore prepended by the system, this
1014 makes C++ function names readable. Different compilers have different
1015 mangling styles. The optional demangling style argument can be used to
1016 choose an appropriate demangling style for your compiler. @xref{c++filt},
1017 for more information on demangling.
1020 Do not demangle low-level symbol names. This is the default.
1022 @item --recurse-limit
1023 @itemx --no-recurse-limit
1024 @itemx --recursion-limit
1025 @itemx --no-recursion-limit
1026 Enables or disables a limit on the amount of recursion performed
1027 whilst demangling strings. Since the name mangling formats allow for
1028 an infinite level of recursion it is possible to create strings whose
1029 decoding will exhaust the amount of stack space available on the host
1030 machine, triggering a memory fault. The limit tries to prevent this
1031 from happening by restricting recursion to 2048 levels of nesting.
1033 The default is for this limit to be enabled, but disabling it may be
1034 necessary in order to demangle truly complicated names. Note however
1035 that if the recursion limit is disabled then stack exhaustion is
1036 possible and any bug reports about such an event will be rejected.
1040 @cindex dynamic symbols
1041 Display the dynamic symbols rather than the normal symbols. This is
1042 only meaningful for dynamic objects, such as certain types of shared
1045 @item -f @var{format}
1046 @itemx --format=@var{format}
1047 @cindex @command{nm} format
1048 @cindex @command{nm} compatibility
1049 Use the output format @var{format}, which can be @code{bsd},
1050 @code{sysv}, @code{posix} or @code{just-symbols}. The default is @code{bsd}.
1051 Only the first character of @var{format} is significant; it can be
1052 either upper or lower case.
1055 @itemx --extern-only
1056 @cindex external symbols
1057 Display only external symbols.
1061 Show a summary of the options to @command{nm} and exit.
1063 @item --ifunc-chars=@var{CHARS}
1064 When display GNU indirect function symbols @command{nm} will default
1065 to using the @code{i} character for both local indirect functions and
1066 global indirect functions. The @option{--ifunc-chars} option allows
1067 the user to specify a string containing one or two characters. The
1068 first character will be used for global indirect function symbols and
1069 the second character, if present, will be used for local indirect
1073 The same as @option{--format=just-symbols}.
1076 @itemx --line-numbers
1077 @cindex symbol line numbers
1078 For each symbol, use debugging information to try to find a filename and
1079 line number. For a defined symbol, look for the line number of the
1080 address of the symbol. For an undefined symbol, look for the line
1081 number of a relocation entry which refers to the symbol. If line number
1082 information can be found, print it after the other symbol information.
1085 @cindex objdump inlines
1086 When option @option{-l} is active, if the address belongs to a
1087 function that was inlined, then this option causes the source
1088 information for all enclosing scopes back to the first non-inlined
1089 function to be printed as well. For example, if @code{main} inlines
1090 @code{callee1} which inlines @code{callee2}, and address is from
1091 @code{callee2}, the source information for @code{callee1} and @code{main}
1092 will also be printed.
1096 @itemx --numeric-sort
1097 Sort symbols numerically by their addresses, rather than alphabetically
1102 @cindex sorting symbols
1103 Do not bother to sort the symbols in any order; print them in the order
1107 @itemx --portability
1108 Use the POSIX.2 standard output format instead of the default format.
1109 Equivalent to @samp{-f posix}.
1112 @itemx --reverse-sort
1113 Reverse the order of the sort (whether numeric or alphabetic); let the
1118 Print both value and size of defined symbols for the @code{bsd} output style.
1119 This option has no effect for object formats that do not record symbol
1120 sizes, unless @samp{--size-sort} is also used in which case a
1121 calculated size is displayed.
1124 @itemx --print-armap
1125 @cindex symbol index, listing
1126 When listing symbols from archive members, include the index: a mapping
1127 (stored in the archive by @command{ar} or @command{ranlib}) of which modules
1128 contain definitions for which names.
1130 @item -t @var{radix}
1131 @itemx --radix=@var{radix}
1132 Use @var{radix} as the radix for printing the symbol values. It must be
1133 @samp{d} for decimal, @samp{o} for octal, or @samp{x} for hexadecimal.
1136 @itemx --undefined-only
1137 @cindex external symbols
1138 @cindex undefined symbols
1139 Display only undefined symbols (those external to each object file).
1141 @item -U @var{[d|i|l|e|x|h]}
1142 @itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
1143 Controls the display of UTF-8 encoded multibyte characters in strings.
1144 The default (@option{--unicode=default}) is to give them no special
1145 treatment. The @option{--unicode=locale} option displays the sequence
1146 in the current locale, which may or may not support them. The options
1147 @option{--unicode=hex} and @option{--unicode=invalid} display them as
1148 hex byte sequences enclosed by either angle brackets or curly braces.
1150 The @option{--unicode=escape} option displays them as escape sequences
1151 (@var{\uxxxx}) and the @option{--unicode=highlight} option displays
1152 them as escape sequences highlighted in red (if supported by the
1153 output device). The colouring is intended to draw attention to the
1154 presence of unicode sequences where they might not be expected.
1158 Show the version number of @command{nm} and exit.
1161 This option is ignored for compatibility with the AIX version of
1162 @command{nm}. It takes one parameter which must be the string
1163 @option{32_64}. The default mode of AIX @command{nm} corresponds
1164 to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}.
1166 @item --defined-only
1167 @cindex external symbols
1168 @cindex undefined symbols
1169 Display only defined symbols for each object file.
1171 @item --plugin @var{name}
1173 Load the plugin called @var{name} to add support for extra target
1174 types. This option is only available if the toolchain has been built
1175 with plugin support enabled.
1177 If @option{--plugin} is not provided, but plugin support has been
1178 enabled then @command{nm} iterates over the files in
1179 @file{$@{libdir@}/bfd-plugins} in alphabetic order and the first
1180 plugin that claims the object in question is used.
1182 Please note that this plugin search directory is @emph{not} the one
1183 used by @command{ld}'s @option{-plugin} option. In order to make
1184 @command{nm} use the linker plugin it must be copied into the
1185 @file{$@{libdir@}/bfd-plugins} directory. For GCC based compilations
1186 the linker plugin is called @file{liblto_plugin.so.0.0.0}. For Clang
1187 based compilations it is called @file{LLVMgold.so}. The GCC plugin
1188 is always backwards compatible with earlier versions, so it is
1189 sufficient to just copy the newest one.
1192 Sort symbols by size. For ELF objects symbol sizes are read from the
1193 ELF, for other object types the symbol sizes are computed as the
1194 difference between the value of the symbol and the value of the symbol
1195 with the next higher value. If the @code{bsd} output format is used
1196 the size of the symbol is printed, rather than the value, and
1197 @samp{-S} must be used in order both size and value to be printed.
1199 @item --special-syms
1200 Display symbols which have a target-specific special meaning. These
1201 symbols are usually used by the target for some special processing and
1202 are not normally helpful when included in the normal symbol lists.
1203 For example for ARM targets this option would skip the mapping symbols
1204 used to mark transitions between ARM code, THUMB code and data.
1207 Include synthetic symbols in the output. These are special symbols
1208 created by the linker for various purposes. They are not shown by
1209 default since they are not part of the binary's original source code.
1211 @item --with-symbol-versions
1212 @item --without-symbol-versions
1213 Enables or disables the display of symbol version information. The
1214 version string is displayed as a suffix to the symbol name, preceded
1215 by an @@ character. For example @samp{foo@@VER_1}. If the version is
1216 the default version to be used when resolving unversioned references
1217 to the symbol then it is displayed as a suffix preceded by two @@
1218 characters. For example @samp{foo@@@@VER_2}. By default, symbol
1219 version information is displayed.
1221 @item --target=@var{bfdname}
1222 @cindex object code format
1223 Specify an object code format other than your system's default format.
1224 @xref{Target Selection}, for more information.
1231 @c man begin SEEALSO nm
1232 ar(1), objdump(1), ranlib(1), and the Info entries for @file{binutils}.
1239 @c man title objcopy copy and translate object files
1242 @c man begin SYNOPSIS objcopy
1243 objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}]
1244 [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}]
1245 [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}]
1246 [@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}]
1247 [@option{-S}|@option{--strip-all}]
1248 [@option{-g}|@option{--strip-debug}]
1249 [@option{--strip-unneeded}]
1250 [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}]
1251 [@option{--keep-file-symbols}]
1252 [@option{--keep-section-symbols}]
1253 [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}]
1254 [@option{--strip-unneeded-symbol=}@var{symbolname}]
1255 [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}]
1256 [@option{--localize-hidden}]
1257 [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}]
1258 [@option{--globalize-symbol=}@var{symbolname}]
1259 [@option{--globalize-symbols=}@var{filename}]
1260 [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}]
1261 [@option{-w}|@option{--wildcard}]
1262 [@option{-x}|@option{--discard-all}]
1263 [@option{-X}|@option{--discard-locals}]
1264 [@option{-b} @var{byte}|@option{--byte=}@var{byte}]
1265 [@option{-i} [@var{breadth}]|@option{--interleave}[=@var{breadth}]]
1266 [@option{--interleave-width=}@var{width}]
1267 [@option{-j} @var{sectionpattern}|@option{--only-section=}@var{sectionpattern}]
1268 [@option{-R} @var{sectionpattern}|@option{--remove-section=}@var{sectionpattern}]
1269 [@option{--keep-section=}@var{sectionpattern}]
1270 [@option{--remove-relocations=}@var{sectionpattern}]
1271 [@option{-p}|@option{--preserve-dates}]
1272 [@option{-D}|@option{--enable-deterministic-archives}]
1273 [@option{-U}|@option{--disable-deterministic-archives}]
1274 [@option{--debugging}]
1275 [@option{--gap-fill=}@var{val}]
1276 [@option{--pad-to=}@var{address}]
1277 [@option{--set-start=}@var{val}]
1278 [@option{--adjust-start=}@var{incr}]
1279 [@option{--change-addresses=}@var{incr}]
1280 [@option{--change-section-address} @var{sectionpattern}@{=,+,-@}@var{val}]
1281 [@option{--change-section-lma} @var{sectionpattern}@{=,+,-@}@var{val}]
1282 [@option{--change-section-vma} @var{sectionpattern}@{=,+,-@}@var{val}]
1283 [@option{--change-warnings}] [@option{--no-change-warnings}]
1284 [@option{--set-section-flags} @var{sectionpattern}=@var{flags}]
1285 [@option{--set-section-alignment} @var{sectionpattern}=@var{align}]
1286 [@option{--add-section} @var{sectionname}=@var{filename}]
1287 [@option{--dump-section} @var{sectionname}=@var{filename}]
1288 [@option{--update-section} @var{sectionname}=@var{filename}]
1289 [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]]
1290 [@option{--long-section-names} @{enable,disable,keep@}]
1291 [@option{--change-leading-char}] [@option{--remove-leading-char}]
1292 [@option{--reverse-bytes=}@var{num}]
1293 [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}]
1294 [@option{--redefine-sym} @var{old}=@var{new}]
1295 [@option{--redefine-syms=}@var{filename}]
1297 [@option{--keep-symbols=}@var{filename}]
1298 [@option{--strip-symbols=}@var{filename}]
1299 [@option{--strip-unneeded-symbols=}@var{filename}]
1300 [@option{--keep-global-symbols=}@var{filename}]
1301 [@option{--localize-symbols=}@var{filename}]
1302 [@option{--weaken-symbols=}@var{filename}]
1303 [@option{--add-symbol} @var{name}=[@var{section}:]@var{value}[,@var{flags}]]
1304 [@option{--alt-machine-code=}@var{index}]
1305 [@option{--prefix-symbols=}@var{string}]
1306 [@option{--prefix-sections=}@var{string}]
1307 [@option{--prefix-alloc-sections=}@var{string}]
1308 [@option{--add-gnu-debuglink=}@var{path-to-file}]
1309 [@option{--only-keep-debug}]
1310 [@option{--strip-dwo}]
1311 [@option{--extract-dwo}]
1312 [@option{--extract-symbol}]
1313 [@option{--writable-text}]
1314 [@option{--readonly-text}]
1317 [@option{--file-alignment=}@var{num}]
1318 [@option{--heap=}@var{size}]
1319 [@option{--image-base=}@var{address}]
1320 [@option{--section-alignment=}@var{num}]
1321 [@option{--stack=}@var{size}]
1322 [@option{--subsystem=}@var{which}:@var{major}.@var{minor}]
1323 [@option{--compress-debug-sections}]
1324 [@option{--decompress-debug-sections}]
1325 [@option{--elf-stt-common=@var{val}}]
1326 [@option{--merge-notes}]
1327 [@option{--no-merge-notes}]
1328 [@option{--verilog-data-width=@var{val}}]
1329 [@option{-v}|@option{--verbose}]
1330 [@option{-V}|@option{--version}]
1331 [@option{--help}] [@option{--info}]
1332 @var{infile} [@var{outfile}]
1336 @c man begin DESCRIPTION objcopy
1337 The @sc{gnu} @command{objcopy} utility copies the contents of an object
1338 file to another. @command{objcopy} uses the @sc{gnu} @sc{bfd} Library to
1339 read and write the object files. It can write the destination object
1340 file in a format different from that of the source object file. The
1341 exact behavior of @command{objcopy} is controlled by command-line options.
1342 Note that @command{objcopy} should be able to copy a fully linked file
1343 between any two formats. However, copying a relocatable object file
1344 between any two formats may not work as expected.
1346 @command{objcopy} creates temporary files to do its translations and
1347 deletes them afterward. @command{objcopy} uses @sc{bfd} to do all its
1348 translation work; it has access to all the formats described in @sc{bfd}
1349 and thus is able to recognize most formats without being told
1350 explicitly. @xref{BFD,,BFD,ld.info,Using LD}.
1352 @command{objcopy} can be used to generate S-records by using an output
1353 target of @samp{srec} (e.g., use @samp{-O srec}).
1355 @command{objcopy} can be used to generate a raw binary file by using an
1356 output target of @samp{binary} (e.g., use @option{-O binary}). When
1357 @command{objcopy} generates a raw binary file, it will essentially produce
1358 a memory dump of the contents of the input object file. All symbols and
1359 relocation information will be discarded. The memory dump will start at
1360 the load address of the lowest section copied into the output file.
1362 When generating an S-record or a raw binary file, it may be helpful to
1363 use @option{-S} to remove sections containing debugging information. In
1364 some cases @option{-R} will be useful to remove sections which contain
1365 information that is not needed by the binary file.
1367 Note---@command{objcopy} is not able to change the endianness of its input
1368 files. If the input format has an endianness (some formats do not),
1369 @command{objcopy} can only copy the inputs into file formats that have the
1370 same endianness or which have no endianness (e.g., @samp{srec}).
1371 (However, see the @option{--reverse-bytes} option.)
1375 @c man begin OPTIONS objcopy
1379 @itemx @var{outfile}
1380 The input and output files, respectively.
1381 If you do not specify @var{outfile}, @command{objcopy} creates a
1382 temporary file and destructively renames the result with
1383 the name of @var{infile}.
1385 @item -I @var{bfdname}
1386 @itemx --input-target=@var{bfdname}
1387 Consider the source file's object format to be @var{bfdname}, rather than
1388 attempting to deduce it. @xref{Target Selection}, for more information.
1390 @item -O @var{bfdname}
1391 @itemx --output-target=@var{bfdname}
1392 Write the output file using the object format @var{bfdname}.
1393 @xref{Target Selection}, for more information.
1395 @item -F @var{bfdname}
1396 @itemx --target=@var{bfdname}
1397 Use @var{bfdname} as the object format for both the input and the output
1398 file; i.e., simply transfer data from source to destination with no
1399 translation. @xref{Target Selection}, for more information.
1401 @item -B @var{bfdarch}
1402 @itemx --binary-architecture=@var{bfdarch}
1403 Useful when transforming a architecture-less input file into an object file.
1404 In this case the output architecture can be set to @var{bfdarch}. This
1405 option will be ignored if the input file has a known @var{bfdarch}. You
1406 can access this binary data inside a program by referencing the special
1407 symbols that are created by the conversion process. These symbols are
1408 called _binary_@var{objfile}_start, _binary_@var{objfile}_end and
1409 _binary_@var{objfile}_size. e.g. you can transform a picture file into
1410 an object file and then access it in your code using these symbols.
1412 @item -j @var{sectionpattern}
1413 @itemx --only-section=@var{sectionpattern}
1414 Copy only the indicated sections from the input file to the output file.
1415 This option may be given more than once. Note that using this option
1416 inappropriately may make the output file unusable. Wildcard
1417 characters are accepted in @var{sectionpattern}.
1419 If the first character of @var{sectionpattern} is the exclamation
1420 point (!) then matching sections will not be copied, even if earlier
1421 use of @option{--only-section} on the same command line would
1422 otherwise copy it. For example:
1425 --only-section=.text.* --only-section=!.text.foo
1428 will copy all sectinos matching '.text.*' but not the section
1431 @item -R @var{sectionpattern}
1432 @itemx --remove-section=@var{sectionpattern}
1433 Remove any section matching @var{sectionpattern} from the output file.
1434 This option may be given more than once. Note that using this option
1435 inappropriately may make the output file unusable. Wildcard
1436 characters are accepted in @var{sectionpattern}. Using both the
1437 @option{-j} and @option{-R} options together results in undefined
1440 If the first character of @var{sectionpattern} is the exclamation
1441 point (!) then matching sections will not be removed even if an
1442 earlier use of @option{--remove-section} on the same command line
1443 would otherwise remove it. For example:
1446 --remove-section=.text.* --remove-section=!.text.foo
1449 will remove all sections matching the pattern '.text.*', but will not
1450 remove the section '.text.foo'.
1452 @item --keep-section=@var{sectionpattern}
1453 When removing sections from the output file, keep sections that match
1454 @var{sectionpattern}.
1456 @item --remove-relocations=@var{sectionpattern}
1457 Remove non-dynamic relocations from the output file for any section
1458 matching @var{sectionpattern}. This option may be given more than
1459 once. Note that using this option inappropriately may make the output
1460 file unusable, and attempting to remove a dynamic relocation section
1461 such as @samp{.rela.plt} from an executable or shared library with
1462 @option{--remove-relocations=.plt} will not work. Wildcard characters
1463 are accepted in @var{sectionpattern}.
1467 --remove-relocations=.text.*
1470 will remove the relocations for all sections matching the pattern
1473 If the first character of @var{sectionpattern} is the exclamation
1474 point (!) then matching sections will not have their relocation
1475 removed even if an earlier use of @option{--remove-relocations} on the
1476 same command line would otherwise cause the relocations to be removed.
1480 --remove-relocations=.text.* --remove-relocations=!.text.foo
1483 will remove all relocations for sections matching the pattern
1484 '.text.*', but will not remove relocations for the section
1489 Do not copy relocation and symbol information from the source file.
1490 Also deletes debug sections.
1493 @itemx --strip-debug
1494 Do not copy debugging symbols or sections from the source file.
1496 @item --strip-unneeded
1497 Remove all symbols that are not needed for relocation processing in
1498 addition to debugging symbols and sections stripped by
1499 @option{--strip-debug}.
1501 @item -K @var{symbolname}
1502 @itemx --keep-symbol=@var{symbolname}
1503 When stripping symbols, keep symbol @var{symbolname} even if it would
1504 normally be stripped. This option may be given more than once.
1506 @item -N @var{symbolname}
1507 @itemx --strip-symbol=@var{symbolname}
1508 Do not copy symbol @var{symbolname} from the source file. This option
1509 may be given more than once.
1511 @item --strip-unneeded-symbol=@var{symbolname}
1512 Do not copy symbol @var{symbolname} from the source file unless it is needed
1513 by a relocation. This option may be given more than once.
1515 @item -G @var{symbolname}
1516 @itemx --keep-global-symbol=@var{symbolname}
1517 Keep only symbol @var{symbolname} global. Make all other symbols local
1518 to the file, so that they are not visible externally. This option may
1519 be given more than once. Note: this option cannot be used in
1520 conjunction with the @option{--globalize-symbol} or
1521 @option{--globalize-symbols} options.
1523 @item --localize-hidden
1524 In an ELF object, mark all symbols that have hidden or internal visibility
1525 as local. This option applies on top of symbol-specific localization options
1526 such as @option{-L}.
1528 @item -L @var{symbolname}
1529 @itemx --localize-symbol=@var{symbolname}
1530 Convert a global or weak symbol called @var{symbolname} into a local
1531 symbol, so that it is not visible externally. This option may be
1532 given more than once. Note - unique symbols are not converted.
1534 @item -W @var{symbolname}
1535 @itemx --weaken-symbol=@var{symbolname}
1536 Make symbol @var{symbolname} weak. This option may be given more than once.
1538 @item --globalize-symbol=@var{symbolname}
1539 Give symbol @var{symbolname} global scoping so that it is visible
1540 outside of the file in which it is defined. This option may be given
1541 more than once. Note: this option cannot be used in conjunction with
1542 the @option{-G} or @option{--keep-global-symbol} options.
1546 Permit regular expressions in @var{symbolname}s used in other command
1547 line options. The question mark (?), asterisk (*), backslash (\) and
1548 square brackets ([]) operators can be used anywhere in the symbol
1549 name. If the first character of the symbol name is the exclamation
1550 point (!) then the sense of the switch is reversed for that symbol.
1557 would cause objcopy to weaken all symbols that start with ``fo''
1558 except for the symbol ``foo''.
1561 @itemx --discard-all
1562 Do not copy non-global symbols from the source file.
1563 @c FIXME any reason to prefer "non-global" to "local" here?
1566 @itemx --discard-locals
1567 Do not copy compiler-generated local symbols.
1568 (These usually start with @samp{L} or @samp{.}.)
1571 @itemx --byte=@var{byte}
1572 If interleaving has been enabled via the @option{--interleave} option
1573 then start the range of bytes to keep at the @var{byte}th byte.
1574 @var{byte} can be in the range from 0 to @var{breadth}-1, where
1575 @var{breadth} is the value given by the @option{--interleave} option.
1577 @item -i [@var{breadth}]
1578 @itemx --interleave[=@var{breadth}]
1579 Only copy a range out of every @var{breadth} bytes. (Header data is
1580 not affected). Select which byte in the range begins the copy with
1581 the @option{--byte} option. Select the width of the range with the
1582 @option{--interleave-width} option.
1584 This option is useful for creating files to program @sc{rom}. It is
1585 typically used with an @code{srec} output target. Note that
1586 @command{objcopy} will complain if you do not specify the
1587 @option{--byte} option as well.
1589 The default interleave breadth is 4, so with @option{--byte} set to 0,
1590 @command{objcopy} would copy the first byte out of every four bytes
1591 from the input to the output.
1593 @item --interleave-width=@var{width}
1594 When used with the @option{--interleave} option, copy @var{width}
1595 bytes at a time. The start of the range of bytes to be copied is set
1596 by the @option{--byte} option, and the extent of the range is set with
1597 the @option{--interleave} option.
1599 The default value for this option is 1. The value of @var{width} plus
1600 the @var{byte} value set by the @option{--byte} option must not exceed
1601 the interleave breadth set by the @option{--interleave} option.
1603 This option can be used to create images for two 16-bit flashes interleaved
1604 in a 32-bit bus by passing @option{-b 0 -i 4 --interleave-width=2}
1605 and @option{-b 2 -i 4 --interleave-width=2} to two @command{objcopy}
1606 commands. If the input was '12345678' then the outputs would be
1607 '1256' and '3478' respectively.
1610 @itemx --preserve-dates
1611 Set the access and modification dates of the output file to be the same
1612 as those of the input file.
1615 @itemx --enable-deterministic-archives
1616 @cindex deterministic archives
1617 @kindex --enable-deterministic-archives
1618 Operate in @emph{deterministic} mode. When copying archive members
1619 and writing the archive index, use zero for UIDs, GIDs, timestamps,
1620 and use consistent file modes for all files.
1622 If @file{binutils} was configured with
1623 @option{--enable-deterministic-archives}, then this mode is on by default.
1624 It can be disabled with the @samp{-U} option, below.
1627 @itemx --disable-deterministic-archives
1628 @cindex deterministic archives
1629 @kindex --enable-deterministic-archives
1630 Do @emph{not} operate in @emph{deterministic} mode. This is the
1631 inverse of the @option{-D} option, above: when copying archive members
1632 and writing the archive index, use their actual UID, GID, timestamp,
1633 and file mode values.
1635 This is the default unless @file{binutils} was configured with
1636 @option{--enable-deterministic-archives}.
1639 Convert debugging information, if possible. This is not the default
1640 because only certain debugging formats are supported, and the
1641 conversion process can be time consuming.
1643 @item --gap-fill @var{val}
1644 Fill gaps between sections with @var{val}. This operation applies to
1645 the @emph{load address} (LMA) of the sections. It is done by increasing
1646 the size of the section with the lower address, and filling in the extra
1647 space created with @var{val}.
1649 @item --pad-to @var{address}
1650 Pad the output file up to the load address @var{address}. This is
1651 done by increasing the size of the last section. The extra space is
1652 filled in with the value specified by @option{--gap-fill} (default zero).
1654 @item --set-start @var{val}
1655 Set the start address (also known as the entry address) of the new
1656 file to @var{val}. Not all object file formats support setting the
1659 @item --change-start @var{incr}
1660 @itemx --adjust-start @var{incr}
1661 @cindex changing start address
1662 Change the start address (also known as the entry address) by adding
1663 @var{incr}. Not all object file formats support setting the start
1666 @item --change-addresses @var{incr}
1667 @itemx --adjust-vma @var{incr}
1668 @cindex changing object addresses
1669 Change the VMA and LMA addresses of all sections, as well as the start
1670 address, by adding @var{incr}. Some object file formats do not permit
1671 section addresses to be changed arbitrarily. Note that this does not
1672 relocate the sections; if the program expects sections to be loaded at a
1673 certain address, and this option is used to change the sections such
1674 that they are loaded at a different address, the program may fail.
1676 @item --change-section-address @var{sectionpattern}@{=,+,-@}@var{val}
1677 @itemx --adjust-section-vma @var{sectionpattern}@{=,+,-@}@var{val}
1678 @cindex changing section address
1679 Set or change both the VMA address and the LMA address of any section
1680 matching @var{sectionpattern}. If @samp{=} is used, the section
1681 address is set to @var{val}. Otherwise, @var{val} is added to or
1682 subtracted from the section address. See the comments under
1683 @option{--change-addresses}, above. If @var{sectionpattern} does not
1684 match any sections in the input file, a warning will be issued, unless
1685 @option{--no-change-warnings} is used.
1687 @item --change-section-lma @var{sectionpattern}@{=,+,-@}@var{val}
1688 @cindex changing section LMA
1689 Set or change the LMA address of any sections matching
1690 @var{sectionpattern}. The LMA address is the address where the
1691 section will be loaded into memory at program load time. Normally
1692 this is the same as the VMA address, which is the address of the
1693 section at program run time, but on some systems, especially those
1694 where a program is held in ROM, the two can be different. If @samp{=}
1695 is used, the section address is set to @var{val}. Otherwise,
1696 @var{val} is added to or subtracted from the section address. See the
1697 comments under @option{--change-addresses}, above. If
1698 @var{sectionpattern} does not match any sections in the input file, a
1699 warning will be issued, unless @option{--no-change-warnings} is used.
1701 @item --change-section-vma @var{sectionpattern}@{=,+,-@}@var{val}
1702 @cindex changing section VMA
1703 Set or change the VMA address of any section matching
1704 @var{sectionpattern}. The VMA address is the address where the
1705 section will be located once the program has started executing.
1706 Normally this is the same as the LMA address, which is the address
1707 where the section will be loaded into memory, but on some systems,
1708 especially those where a program is held in ROM, the two can be
1709 different. If @samp{=} is used, the section address is set to
1710 @var{val}. Otherwise, @var{val} is added to or subtracted from the
1711 section address. See the comments under @option{--change-addresses},
1712 above. If @var{sectionpattern} does not match any sections in the
1713 input file, a warning will be issued, unless
1714 @option{--no-change-warnings} is used.
1716 @item --change-warnings
1717 @itemx --adjust-warnings
1718 If @option{--change-section-address} or @option{--change-section-lma} or
1719 @option{--change-section-vma} is used, and the section pattern does not
1720 match any sections, issue a warning. This is the default.
1722 @item --no-change-warnings
1723 @itemx --no-adjust-warnings
1724 Do not issue a warning if @option{--change-section-address} or
1725 @option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even
1726 if the section pattern does not match any sections.
1728 @item --set-section-flags @var{sectionpattern}=@var{flags}
1729 Set the flags for any sections matching @var{sectionpattern}. The
1730 @var{flags} argument is a comma separated string of flag names. The
1731 recognized names are @samp{alloc}, @samp{contents}, @samp{load},
1732 @samp{noload}, @samp{readonly}, @samp{code}, @samp{data}, @samp{rom},
1733 @samp{exclude}, @samp{share}, and @samp{debug}. You can set the
1734 @samp{contents} flag for a section which does not have contents, but it
1735 is not meaningful to clear the @samp{contents} flag of a section which
1736 does have contents--just remove the section instead. Not all flags are
1737 meaningful for all object file formats. In particular the
1738 @samp{share} flag is only meaningful for COFF format files and not for
1741 @item --set-section-alignment @var{sectionpattern}=@var{align}
1742 Set the alignment for any sections matching @var{sectionpattern}.
1743 @var{align} specifies the alignment in bytes and must be a power of
1744 two, i.e. 1, 2, 4, 8@dots{}.
1746 @item --add-section @var{sectionname}=@var{filename}
1747 Add a new section named @var{sectionname} while copying the file. The
1748 contents of the new section are taken from the file @var{filename}. The
1749 size of the section will be the size of the file. This option only
1750 works on file formats which can support sections with arbitrary names.
1751 Note - it may be necessary to use the @option{--set-section-flags}
1752 option to set the attributes of the newly created section.
1754 @item --dump-section @var{sectionname}=@var{filename}
1755 Place the contents of section named @var{sectionname} into the file
1756 @var{filename}, overwriting any contents that may have been there
1757 previously. This option is the inverse of @option{--add-section}.
1758 This option is similar to the @option{--only-section} option except
1759 that it does not create a formatted file, it just dumps the contents
1760 as raw binary data, without applying any relocations. The option can
1761 be specified more than once.
1763 @item --update-section @var{sectionname}=@var{filename}
1764 Replace the existing contents of a section named @var{sectionname}
1765 with the contents of file @var{filename}. The size of the section
1766 will be adjusted to the size of the file. The section flags for
1767 @var{sectionname} will be unchanged. For ELF format files the section
1768 to segment mapping will also remain unchanged, something which is not
1769 possible using @option{--remove-section} followed by
1770 @option{--add-section}. The option can be specified more than once.
1772 Note - it is possible to use @option{--rename-section} and
1773 @option{--update-section} to both update and rename a section from one
1774 command line. In this case, pass the original section name to
1775 @option{--update-section}, and the original and new section names to
1776 @option{--rename-section}.
1778 @item --add-symbol @var{name}=[@var{section}:]@var{value}[,@var{flags}]
1779 Add a new symbol named @var{name} while copying the file. This option may be
1780 specified multiple times. If the @var{section} is given, the symbol will be
1781 associated with and relative to that section, otherwise it will be an ABS
1782 symbol. Specifying an undefined section will result in a fatal error. There
1783 is no check for the value, it will be taken as specified. Symbol flags can
1784 be specified and not all flags will be meaningful for all object file
1785 formats. By default, the symbol will be global. The special flag
1786 'before=@var{othersym}' will insert the new symbol in front of the specified
1787 @var{othersym}, otherwise the symbol(s) will be added at the end of the
1788 symbol table in the order they appear.
1790 @item --rename-section @var{oldname}=@var{newname}[,@var{flags}]
1791 Rename a section from @var{oldname} to @var{newname}, optionally
1792 changing the section's flags to @var{flags} in the process. This has
1793 the advantage over using a linker script to perform the rename in that
1794 the output stays as an object file and does not become a linked
1795 executable. This option accepts the same set of flags as the
1796 @option{--sect-section-flags} option.
1798 This option is particularly helpful when the input format is binary,
1799 since this will always create a section called .data. If for example,
1800 you wanted instead to create a section called .rodata containing binary
1801 data you could use the following command line to achieve it:
1804 objcopy -I binary -O <output_format> -B <architecture> \
1805 --rename-section .data=.rodata,alloc,load,readonly,data,contents \
1806 <input_binary_file> <output_object_file>
1809 @item --long-section-names @{enable,disable,keep@}
1810 Controls the handling of long section names when processing @code{COFF}
1811 and @code{PE-COFF} object formats. The default behaviour, @samp{keep},
1812 is to preserve long section names if any are present in the input file.
1813 The @samp{enable} and @samp{disable} options forcibly enable or disable
1814 the use of long section names in the output object; when @samp{disable}
1815 is in effect, any long section names in the input object will be truncated.
1816 The @samp{enable} option will only emit long section names if any are
1817 present in the inputs; this is mostly the same as @samp{keep}, but it
1818 is left undefined whether the @samp{enable} option might force the
1819 creation of an empty string table in the output file.
1821 @item --change-leading-char
1822 Some object file formats use special characters at the start of
1823 symbols. The most common such character is underscore, which compilers
1824 often add before every symbol. This option tells @command{objcopy} to
1825 change the leading character of every symbol when it converts between
1826 object file formats. If the object file formats use the same leading
1827 character, this option has no effect. Otherwise, it will add a
1828 character, or remove a character, or change a character, as
1831 @item --remove-leading-char
1832 If the first character of a global symbol is a special symbol leading
1833 character used by the object file format, remove the character. The
1834 most common symbol leading character is underscore. This option will
1835 remove a leading underscore from all global symbols. This can be useful
1836 if you want to link together objects of different file formats with
1837 different conventions for symbol names. This is different from
1838 @option{--change-leading-char} because it always changes the symbol name
1839 when appropriate, regardless of the object file format of the output
1842 @item --reverse-bytes=@var{num}
1843 Reverse the bytes in a section with output contents. A section length must
1844 be evenly divisible by the value given in order for the swap to be able to
1845 take place. Reversing takes place before the interleaving is performed.
1847 This option is used typically in generating ROM images for problematic
1848 target systems. For example, on some target boards, the 32-bit words
1849 fetched from 8-bit ROMs are re-assembled in little-endian byte order
1850 regardless of the CPU byte order. Depending on the programming model, the
1851 endianness of the ROM may need to be modified.
1853 Consider a simple file with a section containing the following eight
1854 bytes: @code{12345678}.
1856 Using @samp{--reverse-bytes=2} for the above example, the bytes in the
1857 output file would be ordered @code{21436587}.
1859 Using @samp{--reverse-bytes=4} for the above example, the bytes in the
1860 output file would be ordered @code{43218765}.
1862 By using @samp{--reverse-bytes=2} for the above example, followed by
1863 @samp{--reverse-bytes=4} on the output file, the bytes in the second
1864 output file would be ordered @code{34127856}.
1866 @item --srec-len=@var{ival}
1867 Meaningful only for srec output. Set the maximum length of the Srecords
1868 being produced to @var{ival}. This length covers both address, data and
1871 @item --srec-forceS3
1872 Meaningful only for srec output. Avoid generation of S1/S2 records,
1873 creating S3-only record format.
1875 @item --redefine-sym @var{old}=@var{new}
1876 Change the name of a symbol @var{old}, to @var{new}. This can be useful
1877 when one is trying link two things together for which you have no
1878 source, and there are name collisions.
1880 @item --redefine-syms=@var{filename}
1881 Apply @option{--redefine-sym} to each symbol pair "@var{old} @var{new}"
1882 listed in the file @var{filename}. @var{filename} is simply a flat file,
1883 with one symbol pair per line. Line comments may be introduced by the hash
1884 character. This option may be given more than once.
1887 Change all global symbols in the file to be weak. This can be useful
1888 when building an object which will be linked against other objects using
1889 the @option{-R} option to the linker. This option is only effective when
1890 using an object file format which supports weak symbols.
1892 @item --keep-symbols=@var{filename}
1893 Apply @option{--keep-symbol} option to each symbol listed in the file
1894 @var{filename}. @var{filename} is simply a flat file, with one symbol
1895 name per line. Line comments may be introduced by the hash character.
1896 This option may be given more than once.
1898 @item --strip-symbols=@var{filename}
1899 Apply @option{--strip-symbol} option to each symbol listed in the file
1900 @var{filename}. @var{filename} is simply a flat file, with one symbol
1901 name per line. Line comments may be introduced by the hash character.
1902 This option may be given more than once.
1904 @item --strip-unneeded-symbols=@var{filename}
1905 Apply @option{--strip-unneeded-symbol} option to each symbol listed in
1906 the file @var{filename}. @var{filename} is simply a flat file, with one
1907 symbol name per line. Line comments may be introduced by the hash
1908 character. This option may be given more than once.
1910 @item --keep-global-symbols=@var{filename}
1911 Apply @option{--keep-global-symbol} option to each symbol listed in the
1912 file @var{filename}. @var{filename} is simply a flat file, with one
1913 symbol name per line. Line comments may be introduced by the hash
1914 character. This option may be given more than once.
1916 @item --localize-symbols=@var{filename}
1917 Apply @option{--localize-symbol} option to each symbol listed in the file
1918 @var{filename}. @var{filename} is simply a flat file, with one symbol
1919 name per line. Line comments may be introduced by the hash character.
1920 This option may be given more than once.
1922 @item --globalize-symbols=@var{filename}
1923 Apply @option{--globalize-symbol} option to each symbol listed in the file
1924 @var{filename}. @var{filename} is simply a flat file, with one symbol
1925 name per line. Line comments may be introduced by the hash character.
1926 This option may be given more than once. Note: this option cannot be
1927 used in conjunction with the @option{-G} or @option{--keep-global-symbol}
1930 @item --weaken-symbols=@var{filename}
1931 Apply @option{--weaken-symbol} option to each symbol listed in the file
1932 @var{filename}. @var{filename} is simply a flat file, with one symbol
1933 name per line. Line comments may be introduced by the hash character.
1934 This option may be given more than once.
1936 @item --alt-machine-code=@var{index}
1937 If the output architecture has alternate machine codes, use the
1938 @var{index}th code instead of the default one. This is useful in case
1939 a machine is assigned an official code and the tool-chain adopts the
1940 new code, but other applications still depend on the original code
1941 being used. For ELF based architectures if the @var{index}
1942 alternative does not exist then the value is treated as an absolute
1943 number to be stored in the e_machine field of the ELF header.
1945 @item --writable-text
1946 Mark the output text as writable. This option isn't meaningful for all
1947 object file formats.
1949 @item --readonly-text
1950 Make the output text write protected. This option isn't meaningful for all
1951 object file formats.
1954 Mark the output file as demand paged. This option isn't meaningful for all
1955 object file formats.
1958 Mark the output file as impure. This option isn't meaningful for all
1959 object file formats.
1961 @item --prefix-symbols=@var{string}
1962 Prefix all symbols in the output file with @var{string}.
1964 @item --prefix-sections=@var{string}
1965 Prefix all section names in the output file with @var{string}.
1967 @item --prefix-alloc-sections=@var{string}
1968 Prefix all the names of all allocated sections in the output file with
1971 @item --add-gnu-debuglink=@var{path-to-file}
1972 Creates a .gnu_debuglink section which contains a reference to
1973 @var{path-to-file} and adds it to the output file. Note: the file at
1974 @var{path-to-file} must exist. Part of the process of adding the
1975 .gnu_debuglink section involves embedding a checksum of the contents
1976 of the debug info file into the section.
1978 If the debug info file is built in one location but it is going to be
1979 installed at a later time into a different location then do not use
1980 the path to the installed location. The @option{--add-gnu-debuglink}
1981 option will fail because the installed file does not exist yet.
1982 Instead put the debug info file in the current directory and use the
1983 @option{--add-gnu-debuglink} option without any directory components,
1987 objcopy --add-gnu-debuglink=foo.debug
1990 At debug time the debugger will attempt to look for the separate debug
1991 info file in a set of known locations. The exact set of these
1992 locations varies depending upon the distribution being used, but it
1997 @item * The same directory as the executable.
1999 @item * A sub-directory of the directory containing the executable
2002 @item * A global debug directory such as /usr/lib/debug.
2005 As long as the debug info file has been installed into one of these
2006 locations before the debugger is run everything should work
2009 @item --keep-section-symbils
2010 When stripping a file, perhaps with @option{--strip-debug} or
2011 @option{--strip-unneeded}, retain any symbols specifying section names,
2012 which would otherwise get stripped.
2014 @item --keep-file-symbols
2015 When stripping a file, perhaps with @option{--strip-debug} or
2016 @option{--strip-unneeded}, retain any symbols specifying source file names,
2017 which would otherwise get stripped.
2019 @item --only-keep-debug
2020 Strip a file, removing contents of any sections that would not be
2021 stripped by @option{--strip-debug} and leaving the debugging sections
2022 intact. In ELF files, this preserves all note sections in the output.
2024 Note - the section headers of the stripped sections are preserved,
2025 including their sizes, but the contents of the section are discarded.
2026 The section headers are preserved so that other tools can match up the
2027 debuginfo file with the real executable, even if that executable has
2028 been relocated to a different address space.
2030 The intention is that this option will be used in conjunction with
2031 @option{--add-gnu-debuglink} to create a two part executable. One a
2032 stripped binary which will occupy less space in RAM and in a
2033 distribution and the second a debugging information file which is only
2034 needed if debugging abilities are required. The suggested procedure
2035 to create these files is as follows:
2038 @item Link the executable as normal. Assuming that it is called
2040 @item Run @code{objcopy --only-keep-debug foo foo.dbg} to
2041 create a file containing the debugging info.
2042 @item Run @code{objcopy --strip-debug foo} to create a
2043 stripped executable.
2044 @item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo}
2045 to add a link to the debugging info into the stripped executable.
2048 Note---the choice of @code{.dbg} as an extension for the debug info
2049 file is arbitrary. Also the @code{--only-keep-debug} step is
2050 optional. You could instead do this:
2053 @item Link the executable as normal.
2054 @item Copy @code{foo} to @code{foo.full}
2055 @item Run @code{objcopy --strip-debug foo}
2056 @item Run @code{objcopy --add-gnu-debuglink=foo.full foo}
2059 i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the
2060 full executable. It does not have to be a file created by the
2061 @option{--only-keep-debug} switch.
2063 Note---this switch is only intended for use on fully linked files. It
2064 does not make sense to use it on object files where the debugging
2065 information may be incomplete. Besides the gnu_debuglink feature
2066 currently only supports the presence of one filename containing
2067 debugging information, not multiple filenames on a one-per-object-file
2071 Remove the contents of all DWARF .dwo sections, leaving the
2072 remaining debugging sections and all symbols intact.
2073 This option is intended for use by the compiler as part of
2074 the @option{-gsplit-dwarf} option, which splits debug information
2075 between the .o file and a separate .dwo file. The compiler
2076 generates all debug information in the same file, then uses
2077 the @option{--extract-dwo} option to copy the .dwo sections to
2078 the .dwo file, then the @option{--strip-dwo} option to remove
2079 those sections from the original .o file.
2082 Extract the contents of all DWARF .dwo sections. See the
2083 @option{--strip-dwo} option for more information.
2085 @item --file-alignment @var{num}
2086 Specify the file alignment. Sections in the file will always begin at
2087 file offsets which are multiples of this number. This defaults to
2089 [This option is specific to PE targets.]
2091 @item --heap @var{reserve}
2092 @itemx --heap @var{reserve},@var{commit}
2093 Specify the number of bytes of memory to reserve (and optionally commit)
2094 to be used as heap for this program.
2095 [This option is specific to PE targets.]
2097 @item --image-base @var{value}
2098 Use @var{value} as the base address of your program or dll. This is
2099 the lowest memory location that will be used when your program or dll
2100 is loaded. To reduce the need to relocate and improve performance of
2101 your dlls, each should have a unique base address and not overlap any
2102 other dlls. The default is 0x400000 for executables, and 0x10000000
2104 [This option is specific to PE targets.]
2106 @item --section-alignment @var{num}
2107 Sets the section alignment field in the PE header. Sections in memory
2108 will always begin at addresses which are a multiple of this number.
2110 [This option is specific to PE targets.]
2112 @item --stack @var{reserve}
2113 @itemx --stack @var{reserve},@var{commit}
2114 Specify the number of bytes of memory to reserve (and optionally commit)
2115 to be used as stack for this program.
2116 [This option is specific to PE targets.]
2118 @item --subsystem @var{which}
2119 @itemx --subsystem @var{which}:@var{major}
2120 @itemx --subsystem @var{which}:@var{major}.@var{minor}
2121 Specifies the subsystem under which your program will execute. The
2122 legal values for @var{which} are @code{native}, @code{windows},
2123 @code{console}, @code{posix}, @code{efi-app}, @code{efi-bsd},
2124 @code{efi-rtd}, @code{sal-rtd}, and @code{xbox}. You may optionally set
2125 the subsystem version also. Numeric values are also accepted for
2127 [This option is specific to PE targets.]
2129 @item --extract-symbol
2130 Keep the file's section flags and symbols but remove all section data.
2131 Specifically, the option:
2134 @item removes the contents of all sections;
2135 @item sets the size of every section to zero; and
2136 @item sets the file's start address to zero.
2139 This option is used to build a @file{.sym} file for a VxWorks kernel.
2140 It can also be a useful way of reducing the size of a @option{--just-symbols}
2143 @item --compress-debug-sections
2144 Compress DWARF debug sections using zlib with SHF_COMPRESSED from the
2145 ELF ABI. Note - if compression would actually make a section
2146 @emph{larger}, then it is not compressed.
2148 @item --compress-debug-sections=none
2149 @itemx --compress-debug-sections=zlib
2150 @itemx --compress-debug-sections=zlib-gnu
2151 @itemx --compress-debug-sections=zlib-gabi
2152 For ELF files, these options control how DWARF debug sections are
2153 compressed. @option{--compress-debug-sections=none} is equivalent
2154 to @option{--decompress-debug-sections}.
2155 @option{--compress-debug-sections=zlib} and
2156 @option{--compress-debug-sections=zlib-gabi} are equivalent to
2157 @option{--compress-debug-sections}.
2158 @option{--compress-debug-sections=zlib-gnu} compresses DWARF debug
2159 sections using zlib. The debug sections are renamed to begin with
2160 @samp{.zdebug} instead of @samp{.debug}. Note - if compression would
2161 actually make a section @emph{larger}, then it is not compressed nor
2164 @item --decompress-debug-sections
2165 Decompress DWARF debug sections using zlib. The original section
2166 names of the compressed sections are restored.
2168 @item --elf-stt-common=yes
2169 @itemx --elf-stt-common=no
2170 For ELF files, these options control whether common symbols should be
2171 converted to the @code{STT_COMMON} or @code{STT_OBJECT} type.
2172 @option{--elf-stt-common=yes} converts common symbol type to
2173 @code{STT_COMMON}. @option{--elf-stt-common=no} converts common symbol
2174 type to @code{STT_OBJECT}.
2177 @itemx --no-merge-notes
2178 For ELF files, attempt (or do not attempt) to reduce the size of any
2179 SHT_NOTE type sections by removing duplicate notes.
2183 Show the version number of @command{objcopy}.
2185 @item --verilog-data-width=@var{bytes}
2186 For Verilog output, this options controls the number of bytes
2187 converted for each output data element. The input target controls the
2188 endianness of the conversion.
2192 Verbose output: list all object files modified. In the case of
2193 archives, @samp{objcopy -V} lists all members of the archive.
2196 Show a summary of the options to @command{objcopy}.
2199 Display a list showing all architectures and object formats available.
2205 @c man begin SEEALSO objcopy
2206 ld(1), objdump(1), and the Info entries for @file{binutils}.
2213 @cindex object file information
2216 @c man title objdump display information from object files
2219 @c man begin SYNOPSIS objdump
2220 objdump [@option{-a}|@option{--archive-headers}]
2221 [@option{-b} @var{bfdname}|@option{--target=@var{bfdname}}]
2222 [@option{-C}|@option{--demangle}[=@var{style}] ]
2223 [@option{-d}|@option{--disassemble}[=@var{symbol}]]
2224 [@option{-D}|@option{--disassemble-all}]
2225 [@option{-z}|@option{--disassemble-zeroes}]
2226 [@option{-EB}|@option{-EL}|@option{--endian=}@{big | little @}]
2227 [@option{-f}|@option{--file-headers}]
2228 [@option{-F}|@option{--file-offsets}]
2229 [@option{--file-start-context}]
2230 [@option{-g}|@option{--debugging}]
2231 [@option{-e}|@option{--debugging-tags}]
2232 [@option{-h}|@option{--section-headers}|@option{--headers}]
2233 [@option{-i}|@option{--info}]
2234 [@option{-j} @var{section}|@option{--section=}@var{section}]
2235 [@option{-l}|@option{--line-numbers}]
2236 [@option{-S}|@option{--source}]
2237 [@option{--source-comment}[=@var{text}]]
2238 [@option{-m} @var{machine}|@option{--architecture=}@var{machine}]
2239 [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}]
2240 [@option{-p}|@option{--private-headers}]
2241 [@option{-P} @var{options}|@option{--private=}@var{options}]
2242 [@option{-r}|@option{--reloc}]
2243 [@option{-R}|@option{--dynamic-reloc}]
2244 [@option{-s}|@option{--full-contents}]
2245 [@option{-W[lLiaprmfFsoORtUuTgAck]}|
2246 @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]]
2247 [@option{-WK}|@option{--dwarf=follow-links}]
2248 [@option{-WN}|@option{--dwarf=no-follow-links}]
2249 [@option{-L}|@option{--process-links}]
2250 [@option{--ctf=}@var{section}]
2251 [@option{-G}|@option{--stabs}]
2252 [@option{-t}|@option{--syms}]
2253 [@option{-T}|@option{--dynamic-syms}]
2254 [@option{-x}|@option{--all-headers}]
2255 [@option{-w}|@option{--wide}]
2256 [@option{--start-address=}@var{address}]
2257 [@option{--stop-address=}@var{address}]
2258 [@option{--no-addresses}]
2259 [@option{--prefix-addresses}]
2260 [@option{--[no-]show-raw-insn}]
2261 [@option{--adjust-vma=}@var{offset}]
2262 [@option{--dwarf-depth=@var{n}}]
2263 [@option{--dwarf-start=@var{n}}]
2264 [@option{--ctf-parent=}@var{section}]
2265 [@option{--no-recurse-limit}|@option{--recurse-limit}]
2266 [@option{--special-syms}]
2267 [@option{--prefix=}@var{prefix}]
2268 [@option{--prefix-strip=}@var{level}]
2269 [@option{--insn-width=}@var{width}]
2270 [@option{--visualize-jumps[=color|=extended-color|=off]}
2271 [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
2272 [@option{-V}|@option{--version}]
2273 [@option{-H}|@option{--help}]
2274 @var{objfile}@dots{}
2278 @c man begin DESCRIPTION objdump
2280 @command{objdump} displays information about one or more object files.
2281 The options control what particular information to display. This
2282 information is mostly useful to programmers who are working on the
2283 compilation tools, as opposed to programmers who just want their
2284 program to compile and work.
2286 @var{objfile}@dots{} are the object files to be examined. When you
2287 specify archives, @command{objdump} shows information on each of the member
2292 @c man begin OPTIONS objdump
2294 The long and short forms of options, shown here as alternatives, are
2295 equivalent. At least one option from the list
2296 @option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x} must be given.
2300 @itemx --archive-header
2301 @cindex archive headers
2302 If any of the @var{objfile} files are archives, display the archive
2303 header information (in a format similar to @samp{ls -l}). Besides the
2304 information you could list with @samp{ar tv}, @samp{objdump -a} shows
2305 the object file format of each archive member.
2307 @item --adjust-vma=@var{offset}
2308 @cindex section addresses in objdump
2309 @cindex VMA in objdump
2310 When dumping information, first add @var{offset} to all the section
2311 addresses. This is useful if the section addresses do not correspond to
2312 the symbol table, which can happen when putting sections at particular
2313 addresses when using a format which can not represent section addresses,
2316 @item -b @var{bfdname}
2317 @itemx --target=@var{bfdname}
2318 @cindex object code format
2319 Specify that the object-code format for the object files is
2320 @var{bfdname}. This option may not be necessary; @var{objdump} can
2321 automatically recognize many formats.
2325 objdump -b oasys -m vax -h fu.o
2328 displays summary information from the section headers (@option{-h}) of
2329 @file{fu.o}, which is explicitly identified (@option{-m}) as a VAX object
2330 file in the format produced by Oasys compilers. You can list the
2331 formats available with the @option{-i} option.
2332 @xref{Target Selection}, for more information.
2335 @itemx --demangle[=@var{style}]
2336 @cindex demangling in objdump
2337 Decode (@dfn{demangle}) low-level symbol names into user-level names.
2338 Besides removing any initial underscore prepended by the system, this
2339 makes C++ function names readable. Different compilers have different
2340 mangling styles. The optional demangling style argument can be used to
2341 choose an appropriate demangling style for your compiler. @xref{c++filt},
2342 for more information on demangling.
2344 @item --recurse-limit
2345 @itemx --no-recurse-limit
2346 @itemx --recursion-limit
2347 @itemx --no-recursion-limit
2348 Enables or disables a limit on the amount of recursion performed
2349 whilst demangling strings. Since the name mangling formats allow for
2350 an infinite level of recursion it is possible to create strings whose
2351 decoding will exhaust the amount of stack space available on the host
2352 machine, triggering a memory fault. The limit tries to prevent this
2353 from happening by restricting recursion to 2048 levels of nesting.
2355 The default is for this limit to be enabled, but disabling it may be
2356 necessary in order to demangle truly complicated names. Note however
2357 that if the recursion limit is disabled then stack exhaustion is
2358 possible and any bug reports about such an event will be rejected.
2362 Display debugging information. This attempts to parse STABS
2363 debugging format information stored in the file and print it out using
2364 a C like syntax. If no STABS debugging was found this option
2365 falls back on the @option{-W} option to print any DWARF information in
2369 @itemx --debugging-tags
2370 Like @option{-g}, but the information is generated in a format compatible
2374 @itemx --disassemble
2375 @itemx --disassemble=@var{symbol}
2376 @cindex disassembling object code
2377 @cindex machine instructions
2378 Display the assembler mnemonics for the machine instructions from the
2379 input file. This option only disassembles those sections which are
2380 expected to contain instructions. If the optional @var{symbol}
2381 argument is given, then display the assembler mnemonics starting at
2382 @var{symbol}. If @var{symbol} is a function name then disassembly
2383 will stop at the end of the function, otherwise it will stop when the
2384 next symbol is encountered. If there are no matches for @var{symbol}
2385 then nothing will be displayed.
2387 Note if the @option{--dwarf=follow-links} option is enabled
2388 then any symbol tables in linked debug info files will be read in and
2389 used when disassembling.
2392 @itemx --disassemble-all
2393 Like @option{-d}, but disassemble the contents of all sections, not just
2394 those expected to contain instructions.
2396 This option also has a subtle effect on the disassembly of
2397 instructions in code sections. When option @option{-d} is in effect
2398 objdump will assume that any symbols present in a code section occur
2399 on the boundary between instructions and it will refuse to disassemble
2400 across such a boundary. When option @option{-D} is in effect however
2401 this assumption is supressed. This means that it is possible for the
2402 output of @option{-d} and @option{-D} to differ if, for example, data
2403 is stored in code sections.
2405 If the target is an ARM architecture this switch also has the effect
2406 of forcing the disassembler to decode pieces of data found in code
2407 sections as if they were instructions.
2409 Note if the @option{--dwarf=follow-links} option is enabled
2410 then any symbol tables in linked debug info files will be read in and
2411 used when disassembling.
2413 @item --no-addresses
2414 When disassembling, don't print addresses on each line or for symbols
2415 and relocation offsets. In combination with @option{--no-show-raw-insn}
2416 this may be useful for comparing compiler output.
2418 @item --prefix-addresses
2419 When disassembling, print the complete address on each line. This is
2420 the older disassembly format.
2424 @itemx --endian=@{big|little@}
2426 @cindex disassembly endianness
2427 Specify the endianness of the object files. This only affects
2428 disassembly. This can be useful when disassembling a file format which
2429 does not describe endianness information, such as S-records.
2432 @itemx --file-headers
2433 @cindex object file header
2434 Display summary information from the overall header of
2435 each of the @var{objfile} files.
2438 @itemx --file-offsets
2439 @cindex object file offsets
2440 When disassembling sections, whenever a symbol is displayed, also
2441 display the file offset of the region of data that is about to be
2442 dumped. If zeroes are being skipped, then when disassembly resumes,
2443 tell the user how many zeroes were skipped and the file offset of the
2444 location from where the disassembly resumes. When dumping sections,
2445 display the file offset of the location from where the dump starts.
2447 @item --file-start-context
2448 @cindex source code context
2449 Specify that when displaying interlisted source code/disassembly
2450 (assumes @option{-S}) from a file that has not yet been displayed, extend the
2451 context to the start of the file.
2454 @itemx --section-headers
2456 @cindex section headers
2457 Display summary information from the section headers of the
2460 File segments may be relocated to nonstandard addresses, for example by
2461 using the @option{-Ttext}, @option{-Tdata}, or @option{-Tbss} options to
2462 @command{ld}. However, some object file formats, such as a.out, do not
2463 store the starting address of the file segments. In those situations,
2464 although @command{ld} relocates the sections correctly, using @samp{objdump
2465 -h} to list the file section headers cannot show the correct addresses.
2466 Instead, it shows the usual addresses, which are implicit for the
2469 Note, in some cases it is possible for a section to have both the
2470 READONLY and the NOREAD attributes set. In such cases the NOREAD
2471 attribute takes precedence, but @command{objdump} will report both
2472 since the exact setting of the flag bits might be important.
2476 Print a summary of the options to @command{objdump} and exit.
2480 @cindex architectures available
2481 @cindex object formats available
2482 Display a list showing all architectures and object formats available
2483 for specification with @option{-b} or @option{-m}.
2486 @itemx --section=@var{name}
2487 @cindex section information
2488 Display information only for section @var{name}.
2491 @itemx --process-links
2492 Display the contents of non-debug sections found in separate debuginfo
2493 files that are linked to the main file. This option automatically
2494 implies the @option{-WK} option, and only sections requested by other
2495 command line options will be displayed.
2498 @itemx --line-numbers
2499 @cindex source filenames for object files
2500 Label the display (using debugging information) with the filename and
2501 source line numbers corresponding to the object code or relocs shown.
2502 Only useful with @option{-d}, @option{-D}, or @option{-r}.
2504 @item -m @var{machine}
2505 @itemx --architecture=@var{machine}
2506 @cindex architecture
2507 @cindex disassembly architecture
2508 Specify the architecture to use when disassembling object files. This
2509 can be useful when disassembling object files which do not describe
2510 architecture information, such as S-records. You can list the available
2511 architectures with the @option{-i} option.
2513 If the target is an ARM architecture then this switch has an
2514 additional effect. It restricts the disassembly to only those
2515 instructions supported by the architecture specified by @var{machine}.
2516 If it is necessary to use this switch because the input file does not
2517 contain any architecture information, but it is also desired to
2518 disassemble all the instructions use @option{-marm}.
2520 @item -M @var{options}
2521 @itemx --disassembler-options=@var{options}
2522 Pass target specific information to the disassembler. Only supported on
2523 some targets. If it is necessary to specify more than one
2524 disassembler option then multiple @option{-M} options can be used or
2525 can be placed together into a comma separated list.
2527 For ARC, @option{dsp} controls the printing of DSP instructions,
2528 @option{spfp} selects the printing of FPX single precision FP
2529 instructions, @option{dpfp} selects the printing of FPX double
2530 precision FP instructions, @option{quarkse_em} selects the printing of
2531 special QuarkSE-EM instructions, @option{fpuda} selects the printing
2532 of double precision assist instructions, @option{fpus} selects the
2533 printing of FPU single precision FP instructions, while @option{fpud}
2534 selects the printing of FPU double precision FP instructions.
2535 Additionally, one can choose to have all the immediates printed in
2536 hexadecimal using @option{hex}. By default, the short immediates are
2537 printed using the decimal representation, while the long immediate
2538 values are printed as hexadecimal.
2540 @option{cpu=...} allows one to enforce a particular ISA when disassembling
2541 instructions, overriding the @option{-m} value or whatever is in the ELF file.
2542 This might be useful to select ARC EM or HS ISA, because architecture is same
2543 for those and disassembler relies on private ELF header data to decide if code
2544 is for EM or HS. This option might be specified multiple times - only the
2545 latest value will be used. Valid values are same as for the assembler
2546 @option{-mcpu=...} option.
2548 If the target is an ARM architecture then this switch can be used to
2549 select which register name set is used during disassembler. Specifying
2550 @option{-M reg-names-std} (the default) will select the register names as
2551 used in ARM's instruction set documentation, but with register 13 called
2552 'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying
2553 @option{-M reg-names-apcs} will select the name set used by the ARM
2554 Procedure Call Standard, whilst specifying @option{-M reg-names-raw} will
2555 just use @samp{r} followed by the register number.
2557 There are also two variants on the APCS register naming scheme enabled
2558 by @option{-M reg-names-atpcs} and @option{-M reg-names-special-atpcs} which
2559 use the ARM/Thumb Procedure Call Standard naming conventions. (Either
2560 with the normal register names or the special register names).
2562 This option can also be used for ARM architectures to force the
2563 disassembler to interpret all instructions as Thumb instructions by
2564 using the switch @option{--disassembler-options=force-thumb}. This can be
2565 useful when attempting to disassemble thumb code produced by other
2568 For AArch64 targets this switch can be used to set whether instructions are
2569 disassembled as the most general instruction using the @option{-M no-aliases}
2570 option or whether instruction notes should be generated as comments in the
2571 disasssembly using @option{-M notes}.
2573 For the x86, some of the options duplicate functions of the @option{-m}
2574 switch, but allow finer grained control.
2579 Select disassembly for the given architecture.
2583 Select between intel syntax mode and AT&T syntax mode.
2587 Select between AMD64 ISA and Intel64 ISA.
2589 @item intel-mnemonic
2591 Select between intel mnemonic mode and AT&T mnemonic mode.
2592 Note: @code{intel-mnemonic} implies @code{intel} and
2593 @code{att-mnemonic} implies @code{att}.
2600 Specify the default address size and operand size. These five options
2601 will be overridden if @code{x86-64}, @code{i386} or @code{i8086}
2602 appear later in the option string.
2605 When in AT&T mode and also for a limited set of instructions when in Intel
2606 mode, instructs the disassembler to print a mnemonic suffix even when the
2607 suffix could be inferred by the operands or, for certain instructions, the
2608 execution mode's defaults.
2611 For PowerPC, the @option{-M} argument @option{raw} selects
2612 disasssembly of hardware insns rather than aliases. For example, you
2613 will see @code{rlwinm} rather than @code{clrlwi}, and @code{addi}
2614 rather than @code{li}. All of the @option{-m} arguments for
2615 @command{gas} that select a CPU are supported. These are:
2616 @option{403}, @option{405}, @option{440}, @option{464}, @option{476},
2617 @option{601}, @option{603}, @option{604}, @option{620}, @option{7400},
2618 @option{7410}, @option{7450}, @option{7455}, @option{750cl},
2619 @option{821}, @option{850}, @option{860}, @option{a2}, @option{booke},
2620 @option{booke32}, @option{cell}, @option{com}, @option{e200z4},
2621 @option{e300}, @option{e500}, @option{e500mc}, @option{e500mc64},
2622 @option{e500x2}, @option{e5500}, @option{e6500}, @option{efs},
2623 @option{power4}, @option{power5}, @option{power6}, @option{power7},
2624 @option{power8}, @option{power9}, @option{power10}, @option{ppc},
2625 @option{ppc32}, @option{ppc64}, @option{ppc64bridge}, @option{ppcps},
2626 @option{pwr}, @option{pwr2}, @option{pwr4}, @option{pwr5}, @option{pwr5x},
2627 @option{pwr6}, @option{pwr7}, @option{pwr8}, @option{pwr9}, @option{pwr10},
2628 @option{pwrx}, @option{titan}, and @option{vle}.
2629 @option{32} and @option{64} modify the default or a prior CPU
2630 selection, disabling and enabling 64-bit insns respectively. In
2631 addition, @option{altivec}, @option{any}, @option{htm}, @option{vsx},
2632 and @option{spe} add capabilities to a previous @emph{or later} CPU
2633 selection. @option{any} will disassemble any opcode known to
2634 binutils, but in cases where an opcode has two different meanings or
2635 different arguments, you may not see the disassembly you expect.
2636 If you disassemble without giving a CPU selection, a default will be
2637 chosen from information gleaned by BFD from the object files headers,
2638 but the result again may not be as you expect.
2640 For MIPS, this option controls the printing of instruction mnemonic
2641 names and register names in disassembled instructions. Multiple
2642 selections from the following may be specified as a comma separated
2643 string, and invalid options are ignored:
2647 Print the 'raw' instruction mnemonic instead of some pseudo
2648 instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move',
2649 'sll' instead of 'nop', etc.
2652 Disassemble MSA instructions.
2655 Disassemble the virtualization ASE instructions.
2658 Disassemble the eXtended Physical Address (XPA) ASE instructions.
2660 @item gpr-names=@var{ABI}
2661 Print GPR (general-purpose register) names as appropriate
2662 for the specified ABI. By default, GPR names are selected according to
2663 the ABI of the binary being disassembled.
2665 @item fpr-names=@var{ABI}
2666 Print FPR (floating-point register) names as
2667 appropriate for the specified ABI. By default, FPR numbers are printed
2670 @item cp0-names=@var{ARCH}
2671 Print CP0 (system control coprocessor; coprocessor 0) register names
2672 as appropriate for the CPU or architecture specified by
2673 @var{ARCH}. By default, CP0 register names are selected according to
2674 the architecture and CPU of the binary being disassembled.
2676 @item hwr-names=@var{ARCH}
2677 Print HWR (hardware register, used by the @code{rdhwr} instruction) names
2678 as appropriate for the CPU or architecture specified by
2679 @var{ARCH}. By default, HWR names are selected according to
2680 the architecture and CPU of the binary being disassembled.
2682 @item reg-names=@var{ABI}
2683 Print GPR and FPR names as appropriate for the selected ABI.
2685 @item reg-names=@var{ARCH}
2686 Print CPU-specific register names (CP0 register and HWR names)
2687 as appropriate for the selected CPU or architecture.
2690 For any of the options listed above, @var{ABI} or
2691 @var{ARCH} may be specified as @samp{numeric} to have numbers printed
2692 rather than names, for the selected types of registers.
2693 You can list the available values of @var{ABI} and @var{ARCH} using
2694 the @option{--help} option.
2696 For VAX, you can specify function entry addresses with @option{-M
2697 entry:0xf00ba}. You can use this multiple times to properly
2698 disassemble VAX binary files that don't contain symbol tables (like
2699 ROM dumps). In these cases, the function entry mask would otherwise
2700 be decoded as VAX instructions, which would probably lead the rest
2701 of the function being wrongly disassembled.
2704 @itemx --private-headers
2705 Print information that is specific to the object file format. The exact
2706 information printed depends upon the object file format. For some
2707 object file formats, no additional information is printed.
2709 @item -P @var{options}
2710 @itemx --private=@var{options}
2711 Print information that is specific to the object file format. The
2712 argument @var{options} is a comma separated list that depends on the
2713 format (the lists of options is displayed with the help).
2715 For XCOFF, the available options are:
2731 Not all object formats support this option. In particular the ELF
2732 format does not use it.
2736 @cindex relocation entries, in object file
2737 Print the relocation entries of the file. If used with @option{-d} or
2738 @option{-D}, the relocations are printed interspersed with the
2742 @itemx --dynamic-reloc
2743 @cindex dynamic relocation entries, in object file
2744 Print the dynamic relocation entries of the file. This is only
2745 meaningful for dynamic objects, such as certain types of shared
2746 libraries. As for @option{-r}, if used with @option{-d} or
2747 @option{-D}, the relocations are printed interspersed with the
2751 @itemx --full-contents
2752 @cindex sections, full contents
2753 @cindex object file sections
2754 Display the full contents of any sections requested. By default all
2755 non-empty sections are displayed.
2759 @cindex source disassembly
2760 @cindex disassembly, with source
2761 Display source code intermixed with disassembly, if possible. Implies
2764 @item --source-comment[=@var{txt}]
2765 @cindex source disassembly
2766 @cindex disassembly, with source
2767 Like the @option{-S} option, but all source code lines are displayed
2768 with a prefix of @var{txt}. Typically @var{txt} will be a comment
2769 string which can be used to distinguish the assembler code from the
2770 source code. If @var{txt} is not provided then a default string of
2771 @var{``# ``} (hash followed by a space), will be used.
2773 @item --prefix=@var{prefix}
2774 @cindex Add prefix to absolute paths
2775 Specify @var{prefix} to add to the absolute paths when used with
2778 @item --prefix-strip=@var{level}
2779 @cindex Strip absolute paths
2780 Indicate how many initial directory names to strip off the hardwired
2781 absolute paths. It has no effect without @option{--prefix=}@var{prefix}.
2783 @item --show-raw-insn
2784 When disassembling instructions, print the instruction in hex as well as
2785 in symbolic form. This is the default except when
2786 @option{--prefix-addresses} is used.
2788 @item --no-show-raw-insn
2789 When disassembling instructions, do not print the instruction bytes.
2790 This is the default when @option{--prefix-addresses} is used.
2792 @item --insn-width=@var{width}
2793 @cindex Instruction width
2794 Display @var{width} bytes on a single line when disassembling
2797 @item --visualize-jumps[=color|=extended-color|=off]
2798 Visualize jumps that stay inside a function by drawing ASCII art between
2799 the start and target addresses. The optional @option{=color} argument
2800 adds color to the output using simple terminal colors. Alternatively
2801 the @option{=extended-color} argument will add color using 8bit
2802 colors, but these might not work on all terminals.
2804 If it is necessary to disable the @option{visualize-jumps} option
2805 after it has previously been enabled then use
2806 @option{visualize-jumps=off}.
2808 @item -W[lLiaprmfFsoORtUuTgAckK]
2809 @itemx --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]
2810 @include debug.options.texi
2813 Enable additional checks for consistency of Dwarf information.
2815 @include ctf.options.texi
2821 @cindex debug symbols
2822 @cindex ELF object file format
2823 Display the full contents of any sections requested. Display the
2824 contents of the .stab and .stab.index and .stab.excl sections from an
2825 ELF file. This is only useful on systems (such as Solaris 2.0) in which
2826 @code{.stab} debugging symbol-table entries are carried in an ELF
2827 section. In most other file formats, debugging symbol-table entries are
2828 interleaved with linkage symbols, and are visible in the @option{--syms}
2831 @item --start-address=@var{address}
2832 @cindex start-address
2833 Start displaying data at the specified address. This affects the output
2834 of the @option{-d}, @option{-r} and @option{-s} options.
2836 @item --stop-address=@var{address}
2837 @cindex stop-address
2838 Stop displaying data at the specified address. This affects the output
2839 of the @option{-d}, @option{-r} and @option{-s} options.
2843 @cindex symbol table entries, printing
2844 Print the symbol table entries of the file.
2845 This is similar to the information provided by the @samp{nm} program,
2846 although the display format is different. The format of the output
2847 depends upon the format of the file being dumped, but there are two main
2848 types. One looks like this:
2851 [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
2852 [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred
2855 where the number inside the square brackets is the number of the entry
2856 in the symbol table, the @var{sec} number is the section number, the
2857 @var{fl} value are the symbol's flag bits, the @var{ty} number is the
2858 symbol's type, the @var{scl} number is the symbol's storage class and
2859 the @var{nx} value is the number of auxiliary entries associated with
2860 the symbol. The last two fields are the symbol's value and its name.
2862 The other common output format, usually seen with ELF based files,
2866 00000000 l d .bss 00000000 .bss
2867 00000000 g .text 00000000 fred
2870 Here the first number is the symbol's value (sometimes referred to as
2871 its address). The next field is actually a set of characters and
2872 spaces indicating the flag bits that are set on the symbol. These
2873 characters are described below. Next is the section with which the
2874 symbol is associated or @emph{*ABS*} if the section is absolute (ie
2875 not connected with any section), or @emph{*UND*} if the section is
2876 referenced in the file being dumped, but not defined there.
2878 After the section name comes another field, a number, which for common
2879 symbols is the alignment and for other symbol is the size. Finally
2880 the symbol's name is displayed.
2882 The flag characters are divided into 7 groups as follows:
2888 The symbol is a local (l), global (g), unique global (u), neither
2889 global nor local (a space) or both global and local (!). A
2890 symbol can be neither local or global for a variety of reasons, e.g.,
2891 because it is used for debugging, but it is probably an indication of
2892 a bug if it is ever both local and global. Unique global symbols are
2893 a GNU extension to the standard set of ELF symbol bindings. For such
2894 a symbol the dynamic linker will make sure that in the entire process
2895 there is just one symbol with this name and type in use.
2898 The symbol is weak (w) or strong (a space).
2901 The symbol denotes a constructor (C) or an ordinary symbol (a space).
2904 The symbol is a warning (W) or a normal symbol (a space). A warning
2905 symbol's name is a message to be displayed if the symbol following the
2906 warning symbol is ever referenced.
2910 The symbol is an indirect reference to another symbol (I), a function
2911 to be evaluated during reloc processing (i) or a normal symbol (a
2916 The symbol is a debugging symbol (d) or a dynamic symbol (D) or a
2917 normal symbol (a space).
2922 The symbol is the name of a function (F) or a file (f) or an object
2923 (O) or just a normal symbol (a space).
2927 @itemx --dynamic-syms
2928 @cindex dynamic symbol table entries, printing
2929 Print the dynamic symbol table entries of the file. This is only
2930 meaningful for dynamic objects, such as certain types of shared
2931 libraries. This is similar to the information provided by the @samp{nm}
2932 program when given the @option{-D} (@option{--dynamic}) option.
2934 The output format is similar to that produced by the @option{--syms}
2935 option, except that an extra field is inserted before the symbol's
2936 name, giving the version information associated with the symbol.
2937 If the version is the default version to be used when resolving
2938 unversioned references to the symbol then it's displayed as is,
2939 otherwise it's put into parentheses.
2941 @item --special-syms
2942 When displaying symbols include those which the target considers to be
2943 special in some way and which would not normally be of interest to the
2946 @item -U @var{[d|i|l|e|x|h]}
2947 @itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
2948 Controls the display of UTF-8 encoded multibyte characters in strings.
2949 The default (@option{--unicode=default}) is to give them no special
2950 treatment. The @option{--unicode=locale} option displays the sequence
2951 in the current locale, which may or may not support them. The options
2952 @option{--unicode=hex} and @option{--unicode=invalid} display them as
2953 hex byte sequences enclosed by either angle brackets or curly braces.
2955 The @option{--unicode=escape} option displays them as escape sequences
2956 (@var{\uxxxx}) and the @option{--unicode=highlight} option displays
2957 them as escape sequences highlighted in red (if supported by the
2958 output device). The colouring is intended to draw attention to the
2959 presence of unicode sequences where they might not be expected.
2963 Print the version number of @command{objdump} and exit.
2966 @itemx --all-headers
2967 @cindex all header information, object file
2968 @cindex header information, all
2969 Display all available header information, including the symbol table and
2970 relocation entries. Using @option{-x} is equivalent to specifying all of
2971 @option{-a -f -h -p -r -t}.
2975 @cindex wide output, printing
2976 Format some lines for output devices that have more than 80 columns.
2977 Also do not truncate symbol names when they are displayed.
2980 @itemx --disassemble-zeroes
2981 Normally the disassembly output will skip blocks of zeroes. This
2982 option directs the disassembler to disassemble those blocks, just like
2989 @c man begin SEEALSO objdump
2990 nm(1), readelf(1), and the Info entries for @file{binutils}.
2998 @cindex archive contents
2999 @cindex symbol index
3001 @c man title ranlib generate an index to an archive
3004 @c man begin SYNOPSIS ranlib
3005 ranlib [@option{--plugin} @var{name}] [@option{-DhHvVt}] @var{archive}
3009 @c man begin DESCRIPTION ranlib
3011 @command{ranlib} generates an index to the contents of an archive and
3012 stores it in the archive. The index lists each symbol defined by a
3013 member of an archive that is a relocatable object file.
3015 You may use @samp{nm -s} or @samp{nm --print-armap} to list this index.
3017 An archive with such an index speeds up linking to the library and
3018 allows routines in the library to call each other without regard to
3019 their placement in the archive.
3021 The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; running
3022 @command{ranlib} is completely equivalent to executing @samp{ar -s}.
3027 @c man begin OPTIONS ranlib
3033 Show usage information for @command{ranlib}.
3038 Show the version number of @command{ranlib}.
3041 @cindex deterministic archives
3042 @kindex --enable-deterministic-archives
3043 Operate in @emph{deterministic} mode. The symbol map archive member's
3044 header will show zero for the UID, GID, and timestamp. When this
3045 option is used, multiple runs will produce identical output files.
3047 If @file{binutils} was configured with
3048 @option{--enable-deterministic-archives}, then this mode is on by
3049 default. It can be disabled with the @samp{-U} option, described
3053 Update the timestamp of the symbol map of an archive.
3056 @cindex deterministic archives
3057 @kindex --enable-deterministic-archives
3058 Do @emph{not} operate in @emph{deterministic} mode. This is the
3059 inverse of the @samp{-D} option, above: the archive index will get
3060 actual UID, GID, timestamp, and file mode values.
3062 If @file{binutils} was configured @emph{without}
3063 @option{--enable-deterministic-archives}, then this mode is on by
3071 @c man begin SEEALSO ranlib
3072 ar(1), nm(1), and the Info entries for @file{binutils}.
3080 @cindex section sizes
3082 @c man title size list section sizes and total size of binary files
3085 @c man begin SYNOPSIS size
3086 size [@option{-A}|@option{-B}|@option{-G}|@option{--format=}@var{compatibility}]
3088 [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}]
3090 [@option{-t}|@option{--totals}]
3091 [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}]
3092 [@var{objfile}@dots{}]
3096 @c man begin DESCRIPTION size
3098 The @sc{gnu} @command{size} utility lists the section sizes and the total
3099 size for each of the binary files @var{objfile} on its argument list.
3100 By default, one line of output is generated for each file or each
3101 module if the file is an archive.
3103 @var{objfile}@dots{} are the files to be examined. If none are
3104 specified, the file @code{a.out} will be used instead.
3108 @c man begin OPTIONS size
3110 The command-line options have the following meanings:
3116 @itemx --format=@var{compatibility}
3117 @cindex @command{size} display format
3118 Using one of these options, you can choose whether the output from @sc{gnu}
3119 @command{size} resembles output from System V @command{size} (using @option{-A},
3120 or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or
3121 @option{--format=berkeley}). The default is the one-line format similar to
3122 Berkeley's. Alternatively, you can choose the GNU format output
3123 (using @option{-G}, or @option{--format=gnu}), this is similar to
3124 Berkeley's output format, but sizes are counted differently.
3125 @c Bonus for doc-source readers: you can also say --format=strange (or
3126 @c anything else that starts with 's') for sysv, and --format=boring (or
3127 @c anything else that starts with 'b') for Berkeley.
3129 Here is an example of the Berkeley (default) format of output from
3132 $ size --format=Berkeley ranlib size
3133 text data bss dec hex filename
3134 294880 81920 11592 388392 5ed28 ranlib
3135 294880 81920 11888 388688 5ee50 size
3138 The Berkeley style output counts read only data in the @code{text}
3139 column, not in the @code{data} column, the @code{dec} and @code{hex}
3140 columns both display the sum of the @code{text}, @code{data}, and
3141 @code{bss} columns in decimal and hexadecimal respectively.
3143 The GNU format counts read only data in the @code{data} column, not
3144 the @code{text} column, and only displays the sum of the @code{text},
3145 @code{data}, and @code{bss} columns once, in the @code{total} column.
3146 The @option{--radix} option can be used to change the number base for
3147 all columns. Here is the same data displayed with GNU conventions:
3150 $ size --format=GNU ranlib size
3151 text data bss total filename
3152 279880 96920 11592 388392 ranlib
3153 279880 96920 11888 388688 size
3157 This is the same data, but displayed closer to System V conventions:
3160 $ size --format=SysV ranlib size
3178 Show a summary of acceptable arguments and options.
3183 @itemx --radix=@var{number}
3184 @cindex @command{size} number format
3185 @cindex radix for section sizes
3186 Using one of these options, you can control whether the size of each
3187 section is given in decimal (@option{-d}, or @option{--radix=10}); octal
3188 (@option{-o}, or @option{--radix=8}); or hexadecimal (@option{-x}, or
3189 @option{--radix=16}). In @option{--radix=@var{number}}, only the three
3190 values (8, 10, 16) are supported. The total size is always given in two
3191 radices; decimal and hexadecimal for @option{-d} or @option{-x} output, or
3192 octal and hexadecimal if you're using @option{-o}.
3195 Print total size of common symbols in each file. When using Berkeley
3196 or GNU format these are included in the bss size.
3200 Show totals of all objects listed (Berkeley or GNU format mode only).
3202 @item --target=@var{bfdname}
3203 @cindex object code format
3204 Specify that the object-code format for @var{objfile} is
3205 @var{bfdname}. This option may not be necessary; @command{size} can
3206 automatically recognize many formats.
3207 @xref{Target Selection}, for more information.
3211 Display the version number of @command{size}.
3217 @c man begin SEEALSO size
3218 ar(1), objdump(1), readelf(1), and the Info entries for @file{binutils}.
3225 @cindex listings strings
3226 @cindex printing strings
3227 @cindex strings, printing
3229 @c man title strings print the sequences of printable characters in files
3232 @c man begin SYNOPSIS strings
3233 strings [@option{-afovV}] [@option{-}@var{min-len}]
3234 [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}]
3235 [@option{-t} @var{radix}] [@option{--radix=}@var{radix}]
3236 [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}]
3237 [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
3238 [@option{-}] [@option{--all}] [@option{--print-file-name}]
3239 [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}]
3240 [@option{-w}] [@option{--include-all-whitespace}]
3241 [@option{-s}] [@option{--output-separator} @var{sep_string}]
3242 [@option{--help}] [@option{--version}] @var{file}@dots{}
3246 @c man begin DESCRIPTION strings
3248 For each @var{file} given, @sc{gnu} @command{strings} prints the
3249 printable character sequences that are at least 4 characters long (or
3250 the number given with the options below) and are followed by an
3251 unprintable character.
3253 Depending upon how the strings program was configured it will default
3254 to either displaying all the printable sequences that it can find in
3255 each file, or only those sequences that are in loadable, initialized
3256 data sections. If the file type is unrecognizable, or if strings is
3257 reading from stdin then it will always display all of the printable
3258 sequences that it can find.
3260 For backwards compatibility any file that occurs after a command-line
3261 option of just @option{-} will also be scanned in full, regardless of
3262 the presence of any @option{-d} option.
3264 @command{strings} is mainly useful for determining the contents of
3269 @c man begin OPTIONS strings
3275 Scan the whole file, regardless of what sections it contains or
3276 whether those sections are loaded or initialized. Normally this is
3277 the default behaviour, but strings can be configured so that the
3278 @option{-d} is the default instead.
3280 The @option{-} option is position dependent and forces strings to
3281 perform full scans of any file that is mentioned after the @option{-}
3282 on the command line, even if the @option{-d} option has been
3287 Only print strings from initialized, loaded data sections in the
3288 file. This may reduce the amount of garbage in the output, but it
3289 also exposes the strings program to any security flaws that may be
3290 present in the BFD library used to scan and load sections. Strings
3291 can be configured so that this option is the default behaviour. In
3292 such cases the @option{-a} option can be used to avoid using the BFD
3293 library and instead just print all of the strings found in the file.
3296 @itemx --print-file-name
3297 Print the name of the file before each string.
3300 Print a summary of the program usage on the standard output and exit.
3302 @item -@var{min-len}
3303 @itemx -n @var{min-len}
3304 @itemx --bytes=@var{min-len}
3305 Print sequences of displayable characters that are at least
3306 @var{min-len} characters long. If not specified a default minimum
3307 length of 4 is used. The distinction between displayable and
3308 non-displayable characters depends upon the setting of the
3309 @option{-e} and @option{-U} options. Sequences are always terminated
3310 at control characters such as new-line and carriage-return, but not
3314 Like @samp{-t o}. Some other versions of @command{strings} have @option{-o}
3315 act like @samp{-t d} instead. Since we can not be compatible with both
3316 ways, we simply chose one.
3318 @item -t @var{radix}
3319 @itemx --radix=@var{radix}
3320 Print the offset within the file before each string. The single
3321 character argument specifies the radix of the offset---@samp{o} for
3322 octal, @samp{x} for hexadecimal, or @samp{d} for decimal.
3324 @item -e @var{encoding}
3325 @itemx --encoding=@var{encoding}
3326 Select the character encoding of the strings that are to be found.
3327 Possible values for @var{encoding} are: @samp{s} = single-7-bit-byte
3328 characters (ASCII, ISO 8859, etc., default), @samp{S} =
3329 single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} =
3330 16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit
3331 littleendian. Useful for finding wide character strings. (@samp{l}
3332 and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings).
3334 @item -U @var{[d|i|l|e|x|h]}
3335 @itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
3336 Controls the display of UTF-8 encoded multibyte characters in strings.
3337 The default (@option{--unicode=default}) is to give them no special
3338 treatment, and instead rely upon the setting of the
3339 @option{--encoding} option. The other values for this option
3340 automatically enable @option{--encoding=S}.
3342 The @option{--unicode=invalid} option treats them as non-graphic
3343 characters and hence not part of a valid string. All the remaining
3344 options treat them as valid string characters.
3346 The @option{--unicode=locale} option displays them in the current
3347 locale, which may or may not support UTF-8 encoding. The
3348 @option{--unicode=hex} option displays them as hex byte sequences
3349 enclosed between @var{<>} characters. The @option{--unicode=escape}
3350 option displays them as escape sequences (@var{\uxxxx}) and the
3351 @option{--unicode=highlight} option displays them as escape sequences
3352 highlighted in red (if supported by the output device). The colouring
3353 is intended to draw attention to the presence of unicode sequences
3354 where they might not be expected.
3356 @item -T @var{bfdname}
3357 @itemx --target=@var{bfdname}
3358 @cindex object code format
3359 Specify an object code format other than your system's default format.
3360 @xref{Target Selection}, for more information.
3365 Print the program version number on the standard output and exit.
3368 @itemx --include-all-whitespace
3369 By default tab and space characters are included in the strings that
3370 are displayed, but other whitespace characters, such a newlines and
3371 carriage returns, are not. The @option{-w} option changes this so
3372 that all whitespace characters are considered to be part of a string.
3375 @itemx --output-separator
3376 By default, output strings are delimited by a new-line. This option
3377 allows you to supply any string to be used as the output record
3378 separator. Useful with --include-all-whitespace where strings
3379 may contain new-lines internally.
3385 @c man begin SEEALSO strings
3386 ar(1), nm(1), objdump(1), ranlib(1), readelf(1)
3387 and the Info entries for @file{binutils}.
3395 @cindex removing symbols
3396 @cindex discarding symbols
3397 @cindex symbols, discarding
3399 @c man title strip discard symbols and other data from object files
3402 @c man begin SYNOPSIS strip
3403 strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}]
3404 [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname}]
3405 [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname}]
3406 [@option{-s}|@option{--strip-all}]
3407 [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}]
3408 [@option{--strip-dwo}]
3409 [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}]
3410 [@option{-M}|@option{--merge-notes}][@option{--no-merge-notes}]
3411 [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname}]
3412 [@option{-w}|@option{--wildcard}]
3413 [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}]
3414 [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}]
3415 [@option{--keep-section=}@var{sectionpattern}]
3416 [@option{--remove-relocations=}@var{sectionpattern}]
3417 [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}]
3418 [@option{-D}|@option{--enable-deterministic-archives}]
3419 [@option{-U}|@option{--disable-deterministic-archives}]
3420 [@option{--keep-section-symbols}]
3421 [@option{--keep-file-symbols}]
3422 [@option{--only-keep-debug}]
3423 [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}]
3424 [@option{--help}] [@option{--info}]
3425 @var{objfile}@dots{}
3429 @c man begin DESCRIPTION strip
3431 @sc{gnu} @command{strip} discards all symbols from object files
3432 @var{objfile}. The list of object files may include archives.
3433 At least one object file must be given.
3435 @command{strip} modifies the files named in its argument,
3436 rather than writing modified copies under different names.
3440 @c man begin OPTIONS strip
3443 @item -F @var{bfdname}
3444 @itemx --target=@var{bfdname}
3445 Treat the original @var{objfile} as a file with the object
3446 code format @var{bfdname}, and rewrite it in the same format.
3447 @xref{Target Selection}, for more information.
3450 Show a summary of the options to @command{strip} and exit.
3453 Display a list showing all architectures and object formats available.
3455 @item -I @var{bfdname}
3456 @itemx --input-target=@var{bfdname}
3457 Treat the original @var{objfile} as a file with the object
3458 code format @var{bfdname}.
3459 @xref{Target Selection}, for more information.
3461 @item -O @var{bfdname}
3462 @itemx --output-target=@var{bfdname}
3463 Replace @var{objfile} with a file in the output format @var{bfdname}.
3464 @xref{Target Selection}, for more information.
3466 @item -R @var{sectionname}
3467 @itemx --remove-section=@var{sectionname}
3468 Remove any section named @var{sectionname} from the output file, in
3469 addition to whatever sections would otherwise be removed. This
3470 option may be given more than once. Note that using this option
3471 inappropriately may make the output file unusable. The wildcard
3472 character @samp{*} may be given at the end of @var{sectionname}. If
3473 so, then any section starting with @var{sectionname} will be removed.
3475 If the first character of @var{sectionpattern} is the exclamation
3476 point (!) then matching sections will not be removed even if an
3477 earlier use of @option{--remove-section} on the same command line
3478 would otherwise remove it. For example:
3481 --remove-section=.text.* --remove-section=!.text.foo
3484 will remove all sections matching the pattern '.text.*', but will not
3485 remove the section '.text.foo'.
3487 @item --keep-section=@var{sectionpattern}
3488 When removing sections from the output file, keep sections that match
3489 @var{sectionpattern}.
3491 @item --remove-relocations=@var{sectionpattern}
3492 Remove relocations from the output file for any section matching
3493 @var{sectionpattern}. This option may be given more than once. Note
3494 that using this option inappropriately may make the output file
3495 unusable. Wildcard characters are accepted in @var{sectionpattern}.
3499 --remove-relocations=.text.*
3502 will remove the relocations for all sections matching the patter
3505 If the first character of @var{sectionpattern} is the exclamation
3506 point (!) then matching sections will not have their relocation
3507 removed even if an earlier use of @option{--remove-relocations} on the
3508 same command line would otherwise cause the relocations to be removed.
3512 --remove-relocations=.text.* --remove-relocations=!.text.foo
3515 will remove all relocations for sections matching the pattern
3516 '.text.*', but will not remove relocations for the section
3526 @itemx --strip-debug
3527 Remove debugging symbols only.
3530 Remove the contents of all DWARF .dwo sections, leaving the
3531 remaining debugging sections and all symbols intact.
3532 See the description of this option in the @command{objcopy} section
3533 for more information.
3535 @item --strip-unneeded
3536 Remove all symbols that are not needed for relocation processing in
3537 addition to debugging symbols and sections stripped by
3538 @option{--strip-debug}.
3540 @item -K @var{symbolname}
3541 @itemx --keep-symbol=@var{symbolname}
3542 When stripping symbols, keep symbol @var{symbolname} even if it would
3543 normally be stripped. This option may be given more than once.
3546 @itemx --merge-notes
3547 @itemx --no-merge-notes
3548 For ELF files, attempt (or do not attempt) to reduce the size of any
3549 SHT_NOTE type sections by removing duplicate notes. The default is to
3550 attempt this reduction unless stripping debug or DWO information.
3552 @item -N @var{symbolname}
3553 @itemx --strip-symbol=@var{symbolname}
3554 Remove symbol @var{symbolname} from the source file. This option may be
3555 given more than once, and may be combined with strip options other than
3559 Put the stripped output in @var{file}, rather than replacing the
3560 existing file. When this argument is used, only one @var{objfile}
3561 argument may be specified.
3564 @itemx --preserve-dates
3565 Preserve the access and modification dates of the file.
3568 @itemx --enable-deterministic-archives
3569 @cindex deterministic archives
3570 @kindex --enable-deterministic-archives
3571 Operate in @emph{deterministic} mode. When copying archive members
3572 and writing the archive index, use zero for UIDs, GIDs, timestamps,
3573 and use consistent file modes for all files.
3575 If @file{binutils} was configured with
3576 @option{--enable-deterministic-archives}, then this mode is on by default.
3577 It can be disabled with the @samp{-U} option, below.
3580 @itemx --disable-deterministic-archives
3581 @cindex deterministic archives
3582 @kindex --enable-deterministic-archives
3583 Do @emph{not} operate in @emph{deterministic} mode. This is the
3584 inverse of the @option{-D} option, above: when copying archive members
3585 and writing the archive index, use their actual UID, GID, timestamp,
3586 and file mode values.
3588 This is the default unless @file{binutils} was configured with
3589 @option{--enable-deterministic-archives}.
3593 Permit regular expressions in @var{symbolname}s used in other command
3594 line options. The question mark (?), asterisk (*), backslash (\) and
3595 square brackets ([]) operators can be used anywhere in the symbol
3596 name. If the first character of the symbol name is the exclamation
3597 point (!) then the sense of the switch is reversed for that symbol.
3604 would cause strip to only keep symbols that start with the letters
3605 ``fo'', but to discard the symbol ``foo''.
3608 @itemx --discard-all
3609 Remove non-global symbols.
3612 @itemx --discard-locals
3613 Remove compiler-generated local symbols.
3614 (These usually start with @samp{L} or @samp{.}.)
3616 @item --keep-section-symbols
3617 When stripping a file, perhaps with @option{--strip-debug} or
3618 @option{--strip-unneeded}, retain any symbols specifying section names,
3619 which would otherwise get stripped.
3621 @item --keep-file-symbols
3622 When stripping a file, perhaps with @option{--strip-debug} or
3623 @option{--strip-unneeded}, retain any symbols specifying source file names,
3624 which would otherwise get stripped.
3626 @item --only-keep-debug
3627 Strip a file, emptying the contents of any sections that would not be
3628 stripped by @option{--strip-debug} and leaving the debugging sections
3629 intact. In ELF files, this preserves all the note sections in the
3632 Note - the section headers of the stripped sections are preserved,
3633 including their sizes, but the contents of the section are discarded.
3634 The section headers are preserved so that other tools can match up the
3635 debuginfo file with the real executable, even if that executable has
3636 been relocated to a different address space.
3638 The intention is that this option will be used in conjunction with
3639 @option{--add-gnu-debuglink} to create a two part executable. One a
3640 stripped binary which will occupy less space in RAM and in a
3641 distribution and the second a debugging information file which is only
3642 needed if debugging abilities are required. The suggested procedure
3643 to create these files is as follows:
3646 @item Link the executable as normal. Assuming that it is called
3648 @item Run @code{objcopy --only-keep-debug foo foo.dbg} to
3649 create a file containing the debugging info.
3650 @item Run @code{objcopy --strip-debug foo} to create a
3651 stripped executable.
3652 @item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo}
3653 to add a link to the debugging info into the stripped executable.
3656 Note---the choice of @code{.dbg} as an extension for the debug info
3657 file is arbitrary. Also the @code{--only-keep-debug} step is
3658 optional. You could instead do this:
3661 @item Link the executable as normal.
3662 @item Copy @code{foo} to @code{foo.full}
3663 @item Run @code{strip --strip-debug foo}
3664 @item Run @code{objcopy --add-gnu-debuglink=foo.full foo}
3667 i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the
3668 full executable. It does not have to be a file created by the
3669 @option{--only-keep-debug} switch.
3671 Note---this switch is only intended for use on fully linked files. It
3672 does not make sense to use it on object files where the debugging
3673 information may be incomplete. Besides the gnu_debuglink feature
3674 currently only supports the presence of one filename containing
3675 debugging information, not multiple filenames on a one-per-object-file
3680 Show the version number for @command{strip}.
3684 Verbose output: list all object files modified. In the case of
3685 archives, @samp{strip -v} lists all members of the archive.
3691 @c man begin SEEALSO strip
3692 the Info entries for @file{binutils}.
3696 @node c++filt, addr2line, strip, Top
3700 @cindex demangling C++ symbols
3702 @c man title cxxfilt demangle C++ and Java symbols
3705 @c man begin SYNOPSIS cxxfilt
3706 c++filt [@option{-_}|@option{--strip-underscore}]
3707 [@option{-n}|@option{--no-strip-underscore}]
3708 [@option{-p}|@option{--no-params}]
3709 [@option{-t}|@option{--types}]
3710 [@option{-i}|@option{--no-verbose}]
3711 [@option{-r}|@option{--no-recurse-limit}]
3712 [@option{-R}|@option{--recurse-limit}]
3713 [@option{-s} @var{format}|@option{--format=}@var{format}]
3714 [@option{--help}] [@option{--version}] [@var{symbol}@dots{}]
3718 @c man begin DESCRIPTION cxxfilt
3721 The C++ and Java languages provide function overloading, which means
3722 that you can write many functions with the same name, providing that
3723 each function takes parameters of different types. In order to be
3724 able to distinguish these similarly named functions C++ and Java
3725 encode them into a low-level assembler name which uniquely identifies
3726 each different version. This process is known as @dfn{mangling}. The
3728 @footnote{MS-DOS does not allow @kbd{+} characters in file names, so on
3729 MS-DOS this program is named @command{CXXFILT}.}
3730 program does the inverse mapping: it decodes (@dfn{demangles}) low-level
3731 names into user-level names so that they can be read.
3733 Every alphanumeric word (consisting of letters, digits, underscores,
3734 dollars, or periods) seen in the input is a potential mangled name.
3735 If the name decodes into a C++ name, the C++ name replaces the
3736 low-level name in the output, otherwise the original word is output.
3737 In this way you can pass an entire assembler source file, containing
3738 mangled names, through @command{c++filt} and see the same source file
3739 containing demangled names.
3741 You can also use @command{c++filt} to decipher individual symbols by
3742 passing them on the command line:
3745 c++filt @var{symbol}
3748 If no @var{symbol} arguments are given, @command{c++filt} reads symbol
3749 names from the standard input instead. All the results are printed on
3750 the standard output. The difference between reading names from the
3751 command line versus reading names from the standard input is that
3752 command-line arguments are expected to be just mangled names and no
3753 checking is performed to separate them from surrounding text. Thus
3760 will work and demangle the name to ``f()'' whereas:
3766 will not work. (Note the extra comma at the end of the mangled
3767 name which makes it invalid). This command however will work:
3770 echo _Z1fv, | c++filt -n
3773 and will display ``f(),'', i.e., the demangled name followed by a
3774 trailing comma. This behaviour is because when the names are read
3775 from the standard input it is expected that they might be part of an
3776 assembler source file where there might be extra, extraneous
3777 characters trailing after a mangled name. For example:
3780 .type _Z1fv, @@function
3785 @c man begin OPTIONS cxxfilt
3789 @itemx --strip-underscore
3790 On some systems, both the C and C++ compilers put an underscore in front
3791 of every name. For example, the C name @code{foo} gets the low-level
3792 name @code{_foo}. This option removes the initial underscore. Whether
3793 @command{c++filt} removes the underscore by default is target dependent.
3796 @itemx --no-strip-underscore
3797 Do not remove the initial underscore.
3801 When demangling the name of a function, do not display the types of
3802 the function's parameters.
3806 Attempt to demangle types as well as function names. This is disabled
3807 by default since mangled types are normally only used internally in
3808 the compiler, and they can be confused with non-mangled names. For example,
3809 a function called ``a'' treated as a mangled type name would be
3810 demangled to ``signed char''.
3814 Do not include implementation details (if any) in the demangled
3819 @itemx --recurse-limit
3820 @itemx --no-recurse-limit
3821 @itemx --recursion-limit
3822 @itemx --no-recursion-limit
3823 Enables or disables a limit on the amount of recursion performed
3824 whilst demangling strings. Since the name mangling formats allow for
3825 an infinite level of recursion it is possible to create strings whose
3826 decoding will exhaust the amount of stack space available on the host
3827 machine, triggering a memory fault. The limit tries to prevent this
3828 from happening by restricting recursion to 2048 levels of nesting.
3830 The default is for this limit to be enabled, but disabling it may be
3831 necessary in order to demangle truly complicated names. Note however
3832 that if the recursion limit is disabled then stack exhaustion is
3833 possible and any bug reports about such an event will be rejected.
3835 The @option{-r} option is a synonym for the
3836 @option{--no-recurse-limit} option. The @option{-R} option is a
3837 synonym for the @option{--recurse-limit} option.
3839 @item -s @var{format}
3840 @itemx --format=@var{format}
3841 @command{c++filt} can decode various methods of mangling, used by
3842 different compilers. The argument to this option selects which
3847 Automatic selection based on executable (the default method)
3849 the one used by the @sc{gnu} C++ compiler (g++)
3851 the one used by the Lucid compiler (lcc)
3853 the one specified by the C++ Annotated Reference Manual
3855 the one used by the HP compiler (aCC)
3857 the one used by the EDG compiler
3859 the one used by the @sc{gnu} C++ compiler (g++) with the V3 ABI.
3861 the one used by the @sc{gnu} Java compiler (gcj)
3863 the one used by the @sc{gnu} Ada compiler (GNAT).
3867 Print a summary of the options to @command{c++filt} and exit.
3870 Print the version number of @command{c++filt} and exit.
3876 @c man begin SEEALSO cxxfilt
3877 the Info entries for @file{binutils}.
3882 @emph{Warning:} @command{c++filt} is a new utility, and the details of its
3883 user interface are subject to change in future releases. In particular,
3884 a command-line option may be required in the future to decode a name
3885 passed as an argument on the command line; in other words,
3888 c++filt @var{symbol}
3892 may in a future release become
3895 c++filt @var{option} @var{symbol}
3903 @cindex address to file name and line number
3905 @c man title addr2line convert addresses into file names and line numbers
3908 @c man begin SYNOPSIS addr2line
3909 addr2line [@option{-a}|@option{--addresses}]
3910 [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}]
3911 [@option{-C}|@option{--demangle}[=@var{style}]]
3912 [@option{-r}|@option{--no-recurse-limit}]
3913 [@option{-R}|@option{--recurse-limit}]
3914 [@option{-e} @var{filename}|@option{--exe=}@var{filename}]
3915 [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}]
3916 [@option{-i}|@option{--inlines}]
3917 [@option{-p}|@option{--pretty-print}]
3918 [@option{-j}|@option{--section=}@var{name}]
3919 [@option{-H}|@option{--help}] [@option{-V}|@option{--version}]
3924 @c man begin DESCRIPTION addr2line
3926 @command{addr2line} translates addresses into file names and line numbers.
3927 Given an address in an executable or an offset in a section of a relocatable
3928 object, it uses the debugging information to figure out which file name and
3929 line number are associated with it.
3931 The executable or relocatable object to use is specified with the @option{-e}
3932 option. The default is the file @file{a.out}. The section in the relocatable
3933 object to use is specified with the @option{-j} option.
3935 @command{addr2line} has two modes of operation.
3937 In the first, hexadecimal addresses are specified on the command line,
3938 and @command{addr2line} displays the file name and line number for each
3941 In the second, @command{addr2line} reads hexadecimal addresses from
3942 standard input, and prints the file name and line number for each
3943 address on standard output. In this mode, @command{addr2line} may be used
3944 in a pipe to convert dynamically chosen addresses.
3946 The format of the output is @samp{FILENAME:LINENO}. By default
3947 each input address generates one line of output.
3949 Two options can generate additional lines before each
3950 @samp{FILENAME:LINENO} line (in that order).
3952 If the @option{-a} option is used then a line with the input address
3955 If the @option{-f} option is used, then a line with the
3956 @samp{FUNCTIONNAME} is displayed. This is the name of the function
3957 containing the address.
3959 One option can generate additional lines after the
3960 @samp{FILENAME:LINENO} line.
3962 If the @option{-i} option is used and the code at the given address is
3963 present there because of inlining by the compiler then additional
3964 lines are displayed afterwards. One or two extra lines (if the
3965 @option{-f} option is used) are displayed for each inlined function.
3967 Alternatively if the @option{-p} option is used then each input
3968 address generates a single, long, output line containing the address,
3969 the function name, the file name and the line number. If the
3970 @option{-i} option has also been used then any inlined functions will
3971 be displayed in the same manner, but on separate lines, and prefixed
3972 by the text @samp{(inlined by)}.
3974 If the file name or function name can not be determined,
3975 @command{addr2line} will print two question marks in their place. If the
3976 line number can not be determined, @command{addr2line} will print 0.
3980 @c man begin OPTIONS addr2line
3982 The long and short forms of options, shown here as alternatives, are
3988 Display the address before the function name, file and line number
3989 information. The address is printed with a @samp{0x} prefix to easily
3992 @item -b @var{bfdname}
3993 @itemx --target=@var{bfdname}
3994 @cindex object code format
3995 Specify that the object-code format for the object files is
3999 @itemx --demangle[=@var{style}]
4000 @cindex demangling in objdump
4001 Decode (@dfn{demangle}) low-level symbol names into user-level names.
4002 Besides removing any initial underscore prepended by the system, this
4003 makes C++ function names readable. Different compilers have different
4004 mangling styles. The optional demangling style argument can be used to
4005 choose an appropriate demangling style for your compiler. @xref{c++filt},
4006 for more information on demangling.
4008 @item -e @var{filename}
4009 @itemx --exe=@var{filename}
4010 Specify the name of the executable for which addresses should be
4011 translated. The default file is @file{a.out}.
4015 Display function names as well as file and line number information.
4019 Display only the base of each file name.
4023 If the address belongs to a function that was inlined, the source
4024 information for all enclosing scopes back to the first non-inlined
4025 function will also be printed. For example, if @code{main} inlines
4026 @code{callee1} which inlines @code{callee2}, and address is from
4027 @code{callee2}, the source information for @code{callee1} and @code{main}
4028 will also be printed.
4032 Read offsets relative to the specified section instead of absolute addresses.
4035 @itemx --pretty-print
4036 Make the output more human friendly: each location are printed on one line.
4037 If option @option{-i} is specified, lines for all enclosing scopes are
4038 prefixed with @samp{(inlined by)}.
4042 @itemx --recurse-limit
4043 @itemx --no-recurse-limit
4044 @itemx --recursion-limit
4045 @itemx --no-recursion-limit
4046 Enables or disables a limit on the amount of recursion performed
4047 whilst demangling strings. Since the name mangling formats allow for
4048 an infinite level of recursion it is possible to create strings whose
4049 decoding will exhaust the amount of stack space available on the host
4050 machine, triggering a memory fault. The limit tries to prevent this
4051 from happening by restricting recursion to 2048 levels of nesting.
4053 The default is for this limit to be enabled, but disabling it may be
4054 necessary in order to demangle truly complicated names. Note however
4055 that if the recursion limit is disabled then stack exhaustion is
4056 possible and any bug reports about such an event will be rejected.
4058 The @option{-r} option is a synonym for the
4059 @option{--no-recurse-limit} option. The @option{-R} option is a
4060 synonym for the @option{--recurse-limit} option.
4062 Note this option is only effective if the @option{-C} or
4063 @option{--demangle} option has been enabled.
4070 @c man begin SEEALSO addr2line
4071 Info entries for @file{binutils}.
4078 @command{windmc} may be used to generator Windows message resources.
4081 @emph{Warning:} @command{windmc} is not always built as part of the binary
4082 utilities, since it is only useful for Windows targets.
4085 @c man title windmc generates Windows message resources
4088 @c man begin SYNOPSIS windmc
4089 windmc [options] input-file
4093 @c man begin DESCRIPTION windmc
4095 @command{windmc} reads message definitions from an input file (.mc) and
4096 translate them into a set of output files. The output files may be of
4101 A C header file containing the message definitions.
4104 A resource file compilable by the @command{windres} tool.
4107 One or more binary files containing the resource data for a specific
4111 A C include file that maps message id's to their symbolic name.
4114 The exact description of these different formats is available in
4115 documentation from Microsoft.
4117 When @command{windmc} converts from the @code{mc} format to the @code{bin}
4118 format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the
4119 Windows Message Compiler.
4123 @c man begin OPTIONS windmc
4128 Specifies that the input file specified is ASCII. This is the default
4133 Specifies that messages in the output @code{bin} files should be in ASCII
4138 Specifies that @code{bin} filenames should have to be prefixed by the
4139 basename of the source file.
4143 Sets the customer bit in all message id's.
4145 @item -C @var{codepage}
4146 @itemx --codepage_in @var{codepage}
4147 Sets the default codepage to be used to convert input file to UTF16. The
4148 default is ocdepage 1252.
4151 @itemx --decimal_values
4152 Outputs the constants in the header file in decimal. Default is using
4156 @itemx --extension @var{ext}
4157 The extension for the header file. The default is .h extension.
4159 @item -F @var{target}
4160 @itemx --target @var{target}
4161 Specify the BFD format to use for a bin file as output. This
4162 is a BFD target name; you can use the @option{--help} option to see a list
4163 of supported targets. Normally @command{windmc} will use the default
4164 format, which is the first one listed by the @option{--help} option.
4166 @ref{Target Selection}.
4170 @itemx --headerdir @var{path}
4171 The target directory of the generated header file. The default is the
4176 Displays a list of command-line options and then exits.
4178 @item -m @var{characters}
4179 @itemx --maxlength @var{characters}
4180 Instructs @command{windmc} to generate a warning if the length
4181 of any message exceeds the number specified.
4184 @itemx --nullterminate
4185 Terminate message text in @code{bin} files by zero. By default they are
4186 terminated by CR/LF.
4189 @itemx --hresult_use
4190 Not yet implemented. Instructs @code{windmc} to generate an OLE2 header
4191 file, using HRESULT definitions. Status codes are used if the flag is not
4194 @item -O @var{codepage}
4195 @itemx --codepage_out @var{codepage}
4196 Sets the default codepage to be used to output text files. The default
4200 @itemx --rcdir @var{path}
4201 The target directory for the generated @code{rc} script and the generated
4202 @code{bin} files that the resource compiler script includes. The default
4203 is the current directory.
4207 Specifies that the input file is UTF16.
4210 @itemx --unicode_out
4211 Specifies that messages in the output @code{bin} file should be in UTF16
4212 format. This is the default behaviour.
4216 Enable verbose mode.
4220 Prints the version number for @command{windmc}.
4223 @itemx --xdgb @var{path}
4224 The path of the @code{dbg} C include file that maps message id's to the
4225 symbolic name. No such file is generated without specifying the switch.
4231 @c man begin SEEALSO windmc
4232 the Info entries for @file{binutils}.
4239 @command{windres} may be used to manipulate Windows resources.
4242 @emph{Warning:} @command{windres} is not always built as part of the binary
4243 utilities, since it is only useful for Windows targets.
4246 @c man title windres manipulate Windows resources
4249 @c man begin SYNOPSIS windres
4250 windres [options] [input-file] [output-file]
4254 @c man begin DESCRIPTION windres
4256 @command{windres} reads resources from an input file and copies them into
4257 an output file. Either file may be in one of three formats:
4261 A text format read by the Resource Compiler.
4264 A binary format generated by the Resource Compiler.
4267 A COFF object or executable.
4270 The exact description of these different formats is available in
4271 documentation from Microsoft.
4273 When @command{windres} converts from the @code{rc} format to the @code{res}
4274 format, it is acting like the Windows Resource Compiler. When
4275 @command{windres} converts from the @code{res} format to the @code{coff}
4276 format, it is acting like the Windows @code{CVTRES} program.
4278 When @command{windres} generates an @code{rc} file, the output is similar
4279 but not identical to the format expected for the input. When an input
4280 @code{rc} file refers to an external filename, an output @code{rc} file
4281 will instead include the file contents.
4283 If the input or output format is not specified, @command{windres} will
4284 guess based on the file name, or, for the input file, the file contents.
4285 A file with an extension of @file{.rc} will be treated as an @code{rc}
4286 file, a file with an extension of @file{.res} will be treated as a
4287 @code{res} file, and a file with an extension of @file{.o} or
4288 @file{.exe} will be treated as a @code{coff} file.
4290 If no output file is specified, @command{windres} will print the resources
4291 in @code{rc} format to standard output.
4293 The normal use is for you to write an @code{rc} file, use @command{windres}
4294 to convert it to a COFF object file, and then link the COFF file into
4295 your application. This will make the resources described in the
4296 @code{rc} file available to Windows.
4300 @c man begin OPTIONS windres
4303 @item -i @var{filename}
4304 @itemx --input @var{filename}
4305 The name of the input file. If this option is not used, then
4306 @command{windres} will use the first non-option argument as the input file
4307 name. If there are no non-option arguments, then @command{windres} will
4308 read from standard input. @command{windres} can not read a COFF file from
4311 @item -o @var{filename}
4312 @itemx --output @var{filename}
4313 The name of the output file. If this option is not used, then
4314 @command{windres} will use the first non-option argument, after any used
4315 for the input file name, as the output file name. If there is no
4316 non-option argument, then @command{windres} will write to standard output.
4317 @command{windres} can not write a COFF file to standard output. Note,
4318 for compatibility with @command{rc} the option @option{-fo} is also
4319 accepted, but its use is not recommended.
4321 @item -J @var{format}
4322 @itemx --input-format @var{format}
4323 The input format to read. @var{format} may be @samp{res}, @samp{rc}, or
4324 @samp{coff}. If no input format is specified, @command{windres} will
4325 guess, as described above.
4327 @item -O @var{format}
4328 @itemx --output-format @var{format}
4329 The output format to generate. @var{format} may be @samp{res},
4330 @samp{rc}, or @samp{coff}. If no output format is specified,
4331 @command{windres} will guess, as described above.
4333 @item -F @var{target}
4334 @itemx --target @var{target}
4335 Specify the BFD format to use for a COFF file as input or output. This
4336 is a BFD target name; you can use the @option{--help} option to see a list
4337 of supported targets. Normally @command{windres} will use the default
4338 format, which is the first one listed by the @option{--help} option.
4340 @ref{Target Selection}.
4343 @item --preprocessor @var{program}
4344 When @command{windres} reads an @code{rc} file, it runs it through the C
4345 preprocessor first. This option may be used to specify the preprocessor
4346 to use. The default preprocessor is @code{gcc}.
4348 @item --preprocessor-arg @var{option}
4349 When @command{windres} reads an @code{rc} file, it runs it through
4350 the C preprocessor first. This option may be used to specify additional
4351 text to be passed to preprocessor on its command line.
4352 This option can be used multiple times to add multiple options to the
4353 preprocessor command line.
4354 If the @option{--preprocessor} option has not been specified then a
4355 default set of preprocessor arguments will be used, with any
4356 @option{--preprocessor-arg} options being placed after them on the
4357 command line. These default arguments are @code{-E},
4358 @code{-xc-header} and @code{-DRC_INVOKED}.
4360 @item -I @var{directory}
4361 @itemx --include-dir @var{directory}
4362 Specify an include directory to use when reading an @code{rc} file.
4363 @command{windres} will pass this to the preprocessor as an @option{-I}
4364 option. @command{windres} will also search this directory when looking for
4365 files named in the @code{rc} file. If the argument passed to this command
4366 matches any of the supported @var{formats} (as described in the @option{-J}
4367 option), it will issue a deprecation warning, and behave just like the
4368 @option{-J} option. New programs should not use this behaviour. If a
4369 directory happens to match a @var{format}, simple prefix it with @samp{./}
4370 to disable the backward compatibility.
4372 @item -D @var{target}
4373 @itemx --define @var{sym}[=@var{val}]
4374 Specify a @option{-D} option to pass to the preprocessor when reading an
4377 @item -U @var{target}
4378 @itemx --undefine @var{sym}
4379 Specify a @option{-U} option to pass to the preprocessor when reading an
4383 Ignored for compatibility with rc.
4386 Enable verbose mode. This tells you what the preprocessor is if you
4390 @item --codepage @var{val}
4391 Specify the default codepage to use when reading an @code{rc} file.
4392 @var{val} should be a hexadecimal prefixed by @samp{0x} or decimal
4393 codepage code. The valid range is from zero up to 0xffff, but the
4394 validity of the codepage is host and configuration dependent.
4397 @item --language @var{val}
4398 Specify the default language to use when reading an @code{rc} file.
4399 @var{val} should be a hexadecimal language code. The low eight bits are
4400 the language, and the high eight bits are the sublanguage.
4402 @item --use-temp-file
4403 Use a temporary file to instead of using popen to read the output of
4404 the preprocessor. Use this option if the popen implementation is buggy
4405 on the host (eg., certain non-English language versions of Windows 95 and
4406 Windows 98 are known to have buggy popen where the output will instead
4409 @item --no-use-temp-file
4410 Use popen, not a temporary file, to read the output of the preprocessor.
4411 This is the default behaviour.
4415 Prints a usage summary.
4419 Prints the version number for @command{windres}.
4422 If @command{windres} is compiled with @code{YYDEBUG} defined as @code{1},
4423 this will turn on parser debugging.
4429 @c man begin SEEALSO windres
4430 the Info entries for @file{binutils}.
4439 @command{dlltool} is used to create the files needed to create dynamic
4440 link libraries (DLLs) on systems which understand PE format image
4441 files such as Windows. A DLL contains an export table which contains
4442 information that the runtime loader needs to resolve references from a
4443 referencing program.
4445 The export table is generated by this program by reading in a
4446 @file{.def} file or scanning the @file{.a} and @file{.o} files which
4447 will be in the DLL. A @file{.o} file can contain information in
4448 special @samp{.drectve} sections with export information.
4451 @emph{Note:} @command{dlltool} is not always built as part of the
4452 binary utilities, since it is only useful for those targets which
4456 @c man title dlltool create files needed to build and use DLLs
4459 @c man begin SYNOPSIS dlltool
4460 dlltool [@option{-d}|@option{--input-def} @var{def-file-name}]
4461 [@option{-b}|@option{--base-file} @var{base-file-name}]
4462 [@option{-e}|@option{--output-exp} @var{exports-file-name}]
4463 [@option{-z}|@option{--output-def} @var{def-file-name}]
4464 [@option{-l}|@option{--output-lib} @var{library-file-name}]
4465 [@option{-y}|@option{--output-delaylib} @var{library-file-name}]
4466 [@option{--export-all-symbols}] [@option{--no-export-all-symbols}]
4467 [@option{--exclude-symbols} @var{list}]
4468 [@option{--no-default-excludes}]
4469 [@option{-S}|@option{--as} @var{path-to-assembler}] [@option{-f}|@option{--as-flags} @var{options}]
4470 [@option{-D}|@option{--dllname} @var{name}] [@option{-m}|@option{--machine} @var{machine}]
4471 [@option{-a}|@option{--add-indirect}]
4472 [@option{-U}|@option{--add-underscore}] [@option{--add-stdcall-underscore}]
4473 [@option{-k}|@option{--kill-at}] [@option{-A}|@option{--add-stdcall-alias}]
4474 [@option{-p}|@option{--ext-prefix-alias} @var{prefix}]
4475 [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}]
4476 [@option{--use-nul-prefixed-import-tables}]
4477 [@option{-I}|@option{--identify} @var{library-file-name}] [@option{--identify-strict}]
4478 [@option{-i}|@option{--interwork}]
4479 [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}]
4480 [@option{-v}|@option{--verbose}]
4481 [@option{-h}|@option{--help}] [@option{-V}|@option{--version}]
4482 [@option{--no-leading-underscore}] [@option{--leading-underscore}]
4483 [object-file @dots{}]
4487 @c man begin DESCRIPTION dlltool
4489 @command{dlltool} reads its inputs, which can come from the @option{-d} and
4490 @option{-b} options as well as object files specified on the command
4491 line. It then processes these inputs and if the @option{-e} option has
4492 been specified it creates a exports file. If the @option{-l} option
4493 has been specified it creates a library file and if the @option{-z} option
4494 has been specified it creates a def file. Any or all of the @option{-e},
4495 @option{-l} and @option{-z} options can be present in one invocation of
4498 When creating a DLL, along with the source for the DLL, it is necessary
4499 to have three other files. @command{dlltool} can help with the creation of
4502 The first file is a @file{.def} file which specifies which functions are
4503 exported from the DLL, which functions the DLL imports, and so on. This
4504 is a text file and can be created by hand, or @command{dlltool} can be used
4505 to create it using the @option{-z} option. In this case @command{dlltool}
4506 will scan the object files specified on its command line looking for
4507 those functions which have been specially marked as being exported and
4508 put entries for them in the @file{.def} file it creates.
4510 In order to mark a function as being exported from a DLL, it needs to
4511 have an @option{-export:<name_of_function>} entry in the @samp{.drectve}
4512 section of the object file. This can be done in C by using the
4516 asm (".section .drectve");
4517 asm (".ascii \"-export:my_func\"");
4519 int my_func (void) @{ @dots{} @}
4522 The second file needed for DLL creation is an exports file. This file
4523 is linked with the object files that make up the body of the DLL and it
4524 handles the interface between the DLL and the outside world. This is a
4525 binary file and it can be created by giving the @option{-e} option to
4526 @command{dlltool} when it is creating or reading in a @file{.def} file.
4528 The third file needed for DLL creation is the library file that programs
4529 will link with in order to access the functions in the DLL (an `import
4530 library'). This file can be created by giving the @option{-l} option to
4531 dlltool when it is creating or reading in a @file{.def} file.
4533 If the @option{-y} option is specified, dlltool generates a delay-import
4534 library that can be used instead of the normal import library to allow
4535 a program to link to the dll only as soon as an imported function is
4536 called for the first time. The resulting executable will need to be
4537 linked to the static delayimp library containing __delayLoadHelper2(),
4538 which in turn will import LoadLibraryA and GetProcAddress from kernel32.
4540 @command{dlltool} builds the library file by hand, but it builds the
4541 exports file by creating temporary files containing assembler statements
4542 and then assembling these. The @option{-S} command-line option can be
4543 used to specify the path to the assembler that dlltool will use,
4544 and the @option{-f} option can be used to pass specific flags to that
4545 assembler. The @option{-n} can be used to prevent dlltool from deleting
4546 these temporary assembler files when it is done, and if @option{-n} is
4547 specified twice then this will prevent dlltool from deleting the
4548 temporary object files it used to build the library.
4550 Here is an example of creating a DLL from a source file @samp{dll.c} and
4551 also creating a program (from an object file called @samp{program.o})
4556 dlltool -e exports.o -l dll.lib dll.o
4557 gcc dll.o exports.o -o dll.dll
4558 gcc program.o dll.lib -o program
4562 @command{dlltool} may also be used to query an existing import library
4563 to determine the name of the DLL to which it is associated. See the
4564 description of the @option{-I} or @option{--identify} option.
4568 @c man begin OPTIONS dlltool
4570 The command-line options have the following meanings:
4574 @item -d @var{filename}
4575 @itemx --input-def @var{filename}
4576 @cindex input .def file
4577 Specifies the name of a @file{.def} file to be read in and processed.
4579 @item -b @var{filename}
4580 @itemx --base-file @var{filename}
4582 Specifies the name of a base file to be read in and processed. The
4583 contents of this file will be added to the relocation section in the
4584 exports file generated by dlltool.
4586 @item -e @var{filename}
4587 @itemx --output-exp @var{filename}
4588 Specifies the name of the export file to be created by dlltool.
4590 @item -z @var{filename}
4591 @itemx --output-def @var{filename}
4592 Specifies the name of the @file{.def} file to be created by dlltool.
4594 @item -l @var{filename}
4595 @itemx --output-lib @var{filename}
4596 Specifies the name of the library file to be created by dlltool.
4598 @item -y @var{filename}
4599 @itemx --output-delaylib @var{filename}
4600 Specifies the name of the delay-import library file to be created by dlltool.
4602 @item --export-all-symbols
4603 Treat all global and weak defined symbols found in the input object
4604 files as symbols to be exported. There is a small list of symbols which
4605 are not exported by default; see the @option{--no-default-excludes}
4606 option. You may add to the list of symbols to not export by using the
4607 @option{--exclude-symbols} option.
4609 @item --no-export-all-symbols
4610 Only export symbols explicitly listed in an input @file{.def} file or in
4611 @samp{.drectve} sections in the input object files. This is the default
4612 behaviour. The @samp{.drectve} sections are created by @samp{dllexport}
4613 attributes in the source code.
4615 @item --exclude-symbols @var{list}
4616 Do not export the symbols in @var{list}. This is a list of symbol names
4617 separated by comma or colon characters. The symbol names should not
4618 contain a leading underscore. This is only meaningful when
4619 @option{--export-all-symbols} is used.
4621 @item --no-default-excludes
4622 When @option{--export-all-symbols} is used, it will by default avoid
4623 exporting certain special symbols. The current list of symbols to avoid
4624 exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0},
4625 @samp{impure_ptr}. You may use the @option{--no-default-excludes} option
4626 to go ahead and export these special symbols. This is only meaningful
4627 when @option{--export-all-symbols} is used.
4630 @itemx --as @var{path}
4631 Specifies the path, including the filename, of the assembler to be used
4632 to create the exports file.
4634 @item -f @var{options}
4635 @itemx --as-flags @var{options}
4636 Specifies any specific command-line options to be passed to the
4637 assembler when building the exports file. This option will work even if
4638 the @option{-S} option is not used. This option only takes one argument,
4639 and if it occurs more than once on the command line, then later
4640 occurrences will override earlier occurrences. So if it is necessary to
4641 pass multiple options to the assembler they should be enclosed in
4645 @itemx --dll-name @var{name}
4646 Specifies the name to be stored in the @file{.def} file as the name of
4647 the DLL when the @option{-e} option is used. If this option is not
4648 present, then the filename given to the @option{-e} option will be
4649 used as the name of the DLL.
4651 @item -m @var{machine}
4652 @itemx -machine @var{machine}
4653 Specifies the type of machine for which the library file should be
4654 built. @command{dlltool} has a built in default type, depending upon how
4655 it was created, but this option can be used to override that. This is
4656 normally only useful when creating DLLs for an ARM processor, when the
4657 contents of the DLL are actually encode using Thumb instructions.
4660 @itemx --add-indirect
4661 Specifies that when @command{dlltool} is creating the exports file it
4662 should add a section which allows the exported functions to be
4663 referenced without using the import library. Whatever the hell that
4667 @itemx --add-underscore
4668 Specifies that when @command{dlltool} is creating the exports file it
4669 should prepend an underscore to the names of @emph{all} exported symbols.
4671 @item --no-leading-underscore
4672 @item --leading-underscore
4673 Specifies whether standard symbol should be forced to be prefixed, or
4676 @item --add-stdcall-underscore
4677 Specifies that when @command{dlltool} is creating the exports file it
4678 should prepend an underscore to the names of exported @emph{stdcall}
4679 functions. Variable names and non-stdcall function names are not modified.
4680 This option is useful when creating GNU-compatible import libs for third
4681 party DLLs that were built with MS-Windows tools.
4685 Specifies that @samp{@@<number>} suffixes should be omitted from the names
4686 of stdcall functions that will be imported from the DLL. This is
4687 useful when creating an import library for a DLL which exports stdcall
4688 functions but without the usual @samp{@@<number>} symbol name suffix.
4690 This does not change the naming of symbols provided by the import library
4691 to programs linked against it, but only the entries in the import table
4692 (ie the .idata section).
4695 @itemx --add-stdcall-alias
4696 Specifies that when @command{dlltool} is creating the exports file it
4697 should add aliases for stdcall symbols without @samp{@@ <number>}
4698 in addition to the symbols with @samp{@@ <number>}.
4701 @itemx --ext-prefix-alias @var{prefix}
4702 Causes @command{dlltool} to create external aliases for all DLL
4703 imports with the specified prefix. The aliases are created for both
4704 external and import symbols with no leading underscore.
4708 Specifies that when @command{dlltool} is creating the exports and library
4709 files it should omit the @code{.idata4} section. This is for compatibility
4710 with certain operating systems.
4712 @item --use-nul-prefixed-import-tables
4713 Specifies that when @command{dlltool} is creating the exports and library
4714 files it should prefix the @code{.idata4} and @code{.idata5} by zero an
4715 element. This emulates old gnu import library generation of
4716 @code{dlltool}. By default this option is turned off.
4720 Specifies that when @command{dlltool} is creating the exports and library
4721 files it should omit the @code{.idata5} section. This is for compatibility
4722 with certain operating systems.
4724 @item -I @var{filename}
4725 @itemx --identify @var{filename}
4726 Specifies that @command{dlltool} should inspect the import library
4727 indicated by @var{filename} and report, on @code{stdout}, the name(s)
4728 of the associated DLL(s). This can be performed in addition to any
4729 other operations indicated by the other options and arguments.
4730 @command{dlltool} fails if the import library does not exist or is not
4731 actually an import library. See also @option{--identify-strict}.
4733 @item --identify-strict
4734 Modifies the behavior of the @option{--identify} option, such
4735 that an error is reported if @var{filename} is associated with
4740 Specifies that @command{dlltool} should mark the objects in the library
4741 file and exports file that it produces as supporting interworking
4742 between ARM and Thumb code.
4746 Makes @command{dlltool} preserve the temporary assembler files it used to
4747 create the exports file. If this option is repeated then dlltool will
4748 also preserve the temporary object files it uses to create the library
4751 @item -t @var{prefix}
4752 @itemx --temp-prefix @var{prefix}
4753 Makes @command{dlltool} use @var{prefix} when constructing the names of
4754 temporary assembler and object files. By default, the temp file prefix
4755 is generated from the pid.
4759 Make dlltool describe what it is doing.
4763 Displays a list of command-line options and then exits.
4767 Displays dlltool's version number and then exits.
4774 * def file format:: The format of the dlltool @file{.def} file
4777 @node def file format
4778 @section The format of the @command{dlltool} @file{.def} file
4780 A @file{.def} file contains any number of the following commands:
4784 @item @code{NAME} @var{name} @code{[ ,} @var{base} @code{]}
4785 The result is going to be named @var{name}@code{.exe}.
4787 @item @code{LIBRARY} @var{name} @code{[ ,} @var{base} @code{]}
4788 The result is going to be named @var{name}@code{.dll}.
4789 Note: If you want to use LIBRARY as name then you need to quote. Otherwise
4790 this will fail due a necessary hack for libtool (see PR binutils/13710 for more
4793 @item @code{EXPORTS ( ( (} @var{name1} @code{[ = } @var{name2} @code{] ) | ( } @var{name1} @code{=} @var{module-name} @code{.} @var{external-name} @code{) ) [ == } @var{its_name} @code{]}
4794 @item @code{[} @var{integer} @code{] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *}
4795 Declares @var{name1} as an exported symbol from the DLL, with optional
4796 ordinal number @var{integer}, or declares @var{name1} as an alias
4797 (forward) of the function @var{external-name} in the DLL.
4798 If @var{its_name} is specified, this name is used as string in export table.
4800 Note: The @code{EXPORTS} has to be the last command in .def file, as keywords
4801 are treated - beside @code{LIBRARY} - as simple name-identifiers.
4802 If you want to use LIBRARY as name then you need to quote it.
4804 @item @code{IMPORTS ( (} @var{internal-name} @code{=} @var{module-name} @code{.} @var{integer} @code{) | [} @var{internal-name} @code{= ]} @var{module-name} @code{.} @var{external-name} @code{) [ == ) @var{its_name} @code{]} *}
4805 Declares that @var{external-name} or the exported function whose
4806 ordinal number is @var{integer} is to be imported from the file
4807 @var{module-name}. If @var{internal-name} is specified then this is
4808 the name that the imported function will be referred to in the body of
4810 If @var{its_name} is specified, this name is used as string in import table.
4811 Note: The @code{IMPORTS} has to be the last command in .def file, as keywords
4812 are treated - beside @code{LIBRARY} - as simple name-identifiers.
4813 If you want to use LIBRARY as name then you need to quote it.
4815 @item @code{DESCRIPTION} @var{string}
4816 Puts @var{string} into the output @file{.exp} file in the
4817 @code{.rdata} section.
4819 @item @code{STACKSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]}
4820 @item @code{HEAPSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]}
4821 Generates @code{--stack} or @code{--heap}
4822 @var{number-reserve},@var{number-commit} in the output @code{.drectve}
4823 section. The linker will see this and act upon it.
4825 @item @code{CODE} @var{attr} @code{+}
4826 @item @code{DATA} @var{attr} @code{+}
4827 @item @code{SECTIONS (} @var{section-name} @var{attr}@code{ + ) *}
4828 Generates @code{--attr} @var{section-name} @var{attr} in the output
4829 @code{.drectve} section, where @var{attr} is one of @code{READ},
4830 @code{WRITE}, @code{EXECUTE} or @code{SHARED}. The linker will see
4831 this and act upon it.
4836 @c man begin SEEALSO dlltool
4837 The Info pages for @file{binutils}.
4844 @cindex ELF file information
4847 @c man title readelf display information about ELF files
4850 @c man begin SYNOPSIS readelf
4851 readelf [@option{-a}|@option{--all}]
4852 [@option{-h}|@option{--file-header}]
4853 [@option{-l}|@option{--program-headers}|@option{--segments}]
4854 [@option{-S}|@option{--section-headers}|@option{--sections}]
4855 [@option{-g}|@option{--section-groups}]
4856 [@option{-t}|@option{--section-details}]
4857 [@option{-e}|@option{--headers}]
4858 [@option{-s}|@option{--syms}|@option{--symbols}]
4859 [@option{--dyn-syms}|@option{--lto-syms}]
4860 [@option{--sym-base=[0|8|10|16]}]
4861 [@option{--demangle@var{=style}}|@option{--no-demangle}]
4863 [@option{--recurse-limit}|@option{--no-recurse-limit}]
4864 [@option{-U} @var{method}|@option{--unicode=}@var{method}]
4865 [@option{-n}|@option{--notes}]
4866 [@option{-r}|@option{--relocs}]
4867 [@option{-u}|@option{--unwind}]
4868 [@option{-d}|@option{--dynamic}]
4869 [@option{-V}|@option{--version-info}]
4870 [@option{-A}|@option{--arch-specific}]
4871 [@option{-D}|@option{--use-dynamic}]
4872 [@option{-L}|@option{--lint}|@option{--enable-checks}]
4873 [@option{-x} <number or name>|@option{--hex-dump=}<number or name>]
4874 [@option{-p} <number or name>|@option{--string-dump=}<number or name>]
4875 [@option{-R} <number or name>|@option{--relocated-dump=}<number or name>]
4876 [@option{-z}|@option{--decompress}]
4877 [@option{-c}|@option{--archive-index}]
4878 [@option{-w[lLiaprmfFsoORtUuTgAck]}|
4879 @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]]
4880 [@option{-wK}|@option{--debug-dump=follow-links}]
4881 [@option{-wN}|@option{--debug-dump=no-follow-links}]
4882 [@option{-P}|@option{--process-links}]
4883 [@option{--dwarf-depth=@var{n}}]
4884 [@option{--dwarf-start=@var{n}}]
4885 [@option{--ctf=}@var{section}]
4886 [@option{--ctf-parent=}@var{section}]
4887 [@option{--ctf-symbols=}@var{section}]
4888 [@option{--ctf-strings=}@var{section}]
4889 [@option{-I}|@option{--histogram}]
4890 [@option{-v}|@option{--version}]
4891 [@option{-W}|@option{--wide}]
4892 [@option{-T}|@option{--silent-truncation}]
4893 [@option{-H}|@option{--help}]
4894 @var{elffile}@dots{}
4898 @c man begin DESCRIPTION readelf
4900 @command{readelf} displays information about one or more ELF format object
4901 files. The options control what particular information to display.
4903 @var{elffile}@dots{} are the object files to be examined. 32-bit and
4904 64-bit ELF files are supported, as are archives containing ELF files.
4906 This program performs a similar function to @command{objdump} but it
4907 goes into more detail and it exists independently of the @sc{bfd}
4908 library, so if there is a bug in @sc{bfd} then readelf will not be
4913 @c man begin OPTIONS readelf
4915 The long and short forms of options, shown here as alternatives, are
4916 equivalent. At least one option besides @samp{-v} or @samp{-H} must be
4922 Equivalent to specifying @option{--file-header},
4923 @option{--program-headers}, @option{--sections}, @option{--symbols},
4924 @option{--relocs}, @option{--dynamic}, @option{--notes},
4925 @option{--version-info}, @option{--arch-specific}, @option{--unwind},
4926 @option{--section-groups} and @option{--histogram}.
4928 Note - this option does not enable @option{--use-dynamic} itself, so
4929 if that option is not present on the command line then dynamic symbols
4930 and dynamic relocs will not be displayed.
4933 @itemx --file-header
4934 @cindex ELF file header information
4935 Displays the information contained in the ELF header at the start of the
4939 @itemx --program-headers
4941 @cindex ELF program header information
4942 @cindex ELF segment information
4943 Displays the information contained in the file's segment headers, if it
4948 Suppress "no symbols" diagnostic.
4952 @itemx --section-headers
4953 @cindex ELF section information
4954 Displays the information contained in the file's section headers, if it
4958 @itemx --section-groups
4959 @cindex ELF section group information
4960 Displays the information contained in the file's section groups, if it
4964 @itemx --section-details
4965 @cindex ELF section information
4966 Displays the detailed section information. Implies @option{-S}.
4971 @cindex ELF symbol table information
4972 Displays the entries in symbol table section of the file, if it has one.
4973 If a symbol has version information associated with it then this is
4974 displayed as well. The version string is displayed as a suffix to the
4975 symbol name, preceded by an @@ character. For example
4976 @samp{foo@@VER_1}. If the version is the default version to be used
4977 when resolving unversioned references to the symbol then it is
4978 displayed as a suffix preceded by two @@ characters. For example
4979 @samp{foo@@@@VER_2}.
4982 @cindex ELF dynamic symbol table information
4983 Displays the entries in dynamic symbol table section of the file, if it
4984 has one. The output format is the same as the format used by the
4985 @option{--syms} option.
4988 @cindex LTO symbol table
4989 Displays the contents of any LTO symbol tables in the file.
4991 @item --sym-base=[0|8|10|16]
4992 @cindex symbol table size base
4993 Forces the size field of the symbol table to use the given base. Any
4994 unrecognized options will be treated as @samp{0}. @option{--sym-base=0}
4995 represents the default and legacy behaviour. This will output sizes as decimal
4996 for numbers less than 100000. For sizes 100000 and greater hexadecimal notation
4997 will be used with a 0x prefix.
4998 @option{--sym-base=8} will give the symbol sizes in octal.
4999 @option{--sym-base=10} will always give the symbol sizes in decimal.
5000 @option{--sym-base=16} will always give the symbol sizes in hexadecimal with a
5004 @itemx --demangle[=@var{style}]
5005 @cindex demangling in nm
5006 Decode (@dfn{demangle}) low-level symbol names into user-level names.
5007 This makes C++ function names readable. Different compilers have
5008 different mangling styles. The optional demangling style argument can
5009 be used to choose an appropriate demangling style for your
5010 compiler. @xref{c++filt}, for more information on demangling.
5013 Do not demangle low-level symbol names. This is the default.
5015 @item --recurse-limit
5016 @itemx --no-recurse-limit
5017 @itemx --recursion-limit
5018 @itemx --no-recursion-limit
5019 Enables or disables a limit on the amount of recursion performed
5020 whilst demangling strings. Since the name mangling formats allow for
5021 an infinite level of recursion it is possible to create strings whose
5022 decoding will exhaust the amount of stack space available on the host
5023 machine, triggering a memory fault. The limit tries to prevent this
5024 from happening by restricting recursion to 2048 levels of nesting.
5026 The default is for this limit to be enabled, but disabling it may be
5027 necessary in order to demangle truly complicated names. Note however
5028 that if the recursion limit is disabled then stack exhaustion is
5029 possible and any bug reports about such an event will be rejected.
5031 @item -U @var{[d|i|l|e|x|h]}
5032 @itemx --unicode=[default|invalid|locale|escape|hex|highlight]
5033 Controls the display of non-ASCII characters in identifier names.
5034 The default (@option{--unicode=locale} or @option{--unicode=default}) is
5035 to treat them as multibyte characters and display them in the current
5036 locale. All other versions of this option treat the bytes as UTF-8
5037 encoded values and attempt to interpret them. If they cannot be
5038 interpreted or if the @option{--unicode=invalid} option is used then
5039 they are displayed as a sequence of hex bytes, encloses in curly
5040 parethesis characters.
5042 Using the @option{--unicode=escape} option will display the characters
5043 as as unicode escape sequences (@var{\uxxxx}). Using the
5044 @option{--unicode=hex} will display the characters as hex byte
5045 sequences enclosed between angle brackets.
5047 Using the @option{--unicode=highlight} will display the characters as
5048 unicode escape sequences but it will also highlighted them in red,
5049 assuming that colouring is supported by the output device. The
5050 colouring is intended to draw attention to the presence of unicode
5051 sequences when they might not be expected.
5055 Display all the headers in the file. Equivalent to @option{-h -l -S}.
5060 Displays the contents of the NOTE segments and/or sections, if any.
5064 @cindex ELF reloc information
5065 Displays the contents of the file's relocation section, if it has one.
5069 @cindex unwind information
5070 Displays the contents of the file's unwind section, if it has one. Only
5071 the unwind sections for IA64 ELF files, as well as ARM unwind tables
5072 (@code{.ARM.exidx} / @code{.ARM.extab}) are currently supported. If
5073 support is not yet implemented for your architecture you could try
5074 dumping the contents of the @var{.eh_frames} section using the
5075 @option{--debug-dump=frames} or @option{--debug-dump=frames-interp}
5080 @cindex ELF dynamic section information
5081 Displays the contents of the file's dynamic section, if it has one.
5084 @itemx --version-info
5085 @cindex ELF version sections information
5086 Displays the contents of the version sections in the file, it they
5090 @itemx --arch-specific
5091 Displays architecture-specific information in the file, if there
5095 @itemx --use-dynamic
5096 When displaying symbols, this option makes @command{readelf} use the
5097 symbol hash tables in the file's dynamic section, rather than the
5098 symbol table sections.
5100 When displaying relocations, this option makes @command{readelf}
5101 display the dynamic relocations rather than the static relocations.
5105 @itemx --enable-checks
5106 Displays warning messages about possible problems with the file(s)
5107 being examined. If used on its own then all of the contents of the
5108 file(s) will be examined. If used with one of the dumping options
5109 then the warning messages will only be produced for the things being
5112 @item -x <number or name>
5113 @itemx --hex-dump=<number or name>
5114 Displays the contents of the indicated section as a hexadecimal bytes.
5115 A number identifies a particular section by index in the section table;
5116 any other string identifies all sections with that name in the object file.
5118 @item -R <number or name>
5119 @itemx --relocated-dump=<number or name>
5120 Displays the contents of the indicated section as a hexadecimal
5121 bytes. A number identifies a particular section by index in the
5122 section table; any other string identifies all sections with that name
5123 in the object file. The contents of the section will be relocated
5124 before they are displayed.
5126 @item -p <number or name>
5127 @itemx --string-dump=<number or name>
5128 Displays the contents of the indicated section as printable strings.
5129 A number identifies a particular section by index in the section table;
5130 any other string identifies all sections with that name in the object file.
5134 Requests that the section(s) being dumped by @option{x}, @option{R} or
5135 @option{p} options are decompressed before being displayed. If the
5136 section(s) are not compressed then they are displayed as is.
5139 @itemx --archive-index
5140 @cindex Archive file symbol index information
5141 Displays the file symbol index information contained in the header part
5142 of binary archives. Performs the same function as the @option{t}
5143 command to @command{ar}, but without using the BFD library. @xref{ar}.
5145 @item -w[lLiaprmfFsOoRtUuTgAckK]
5146 @itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]
5147 @include debug.options.texi
5150 @itemx --process-links
5151 Display the contents of non-debug sections found in separate debuginfo
5152 files that are linked to the main file. This option automatically
5153 implies the @option{-wK} option, and only sections requested by other
5154 command line options will be displayed.
5156 @include ctf.options.texi
5157 @item --ctf-symbols=@var{section}
5158 @item --ctf-strings=@var{section}
5159 Specify the name of another section from which the CTF file can inherit
5160 strings and symbols. By default, the @code{.symtab} and its linked
5161 string table are used.
5163 If either of @option{--ctf-symbols} or @option{--ctf-strings} is specified, the
5164 other must be specified as well.
5168 Display a histogram of bucket list lengths when displaying the contents
5169 of the symbol tables.
5173 Display the version number of readelf.
5177 Don't break output lines to fit into 80 columns. By default
5178 @command{readelf} breaks section header and segment listing lines for
5179 64-bit ELF files, so that they fit into 80 columns. This option causes
5180 @command{readelf} to print each section header resp. each segment one a
5181 single line, which is far more readable on terminals wider than 80 columns.
5184 @itemx --silent-truncation
5185 Normally when readelf is displaying a symbol name, and it has to
5186 truncate the name to fit into an 80 column display, it will add a
5187 suffix of @code{[...]} to the name. This command line option
5188 disables this behaviour, allowing 5 more characters of the name to be
5189 displayed and restoring the old behaviour of readelf (prior to release
5194 Display the command-line options understood by @command{readelf}.
5201 @c man begin SEEALSO readelf
5202 objdump(1), and the Info entries for @file{binutils}.
5209 @cindex Update ELF header
5212 @c man title elfedit update ELF header and program property of ELF files
5215 @c man begin SYNOPSIS elfedit
5216 elfedit [@option{--input-mach=}@var{machine}]
5217 [@option{--input-type=}@var{type}]
5218 [@option{--input-osabi=}@var{osabi}]
5219 [@option{--input-abiversion=}@var{version}]
5220 @option{--output-mach=}@var{machine}
5221 @option{--output-type=}@var{type}
5222 @option{--output-osabi=}@var{osabi}
5223 @option{--output-abiversion=}@var{version}
5224 @option{--enable-x86-feature=}@var{feature}
5225 @option{--disable-x86-feature=}@var{feature}
5226 [@option{-v}|@option{--version}]
5227 [@option{-h}|@option{--help}]
5228 @var{elffile}@dots{}
5232 @c man begin DESCRIPTION elfedit
5234 @command{elfedit} updates the ELF header and program property of ELF
5235 files which have the matching ELF machine and file types. The options
5236 control how and which fields in the ELF header and program property
5239 @var{elffile}@dots{} are the ELF files to be updated. 32-bit and
5240 64-bit ELF files are supported, as are archives containing ELF files.
5243 @c man begin OPTIONS elfedit
5245 The long and short forms of options, shown here as alternatives, are
5246 equivalent. At least one of the @option{--output-mach},
5247 @option{--output-type}, @option{--output-osabi},
5248 @option{--output-abiversion},
5249 @option{--enable-x86-feature} and @option{--disable-x86-feature}
5250 options must be given.
5254 @item --input-mach=@var{machine}
5255 Set the matching input ELF machine type to @var{machine}. If
5256 @option{--input-mach} isn't specified, it will match any ELF
5259 The supported ELF machine types are, @var{i386}, @var{IAMCU}, @var{L1OM},
5260 @var{K1OM} and @var{x86-64}.
5262 @item --output-mach=@var{machine}
5263 Change the ELF machine type in the ELF header to @var{machine}. The
5264 supported ELF machine types are the same as @option{--input-mach}.
5266 @item --input-type=@var{type}
5267 Set the matching input ELF file type to @var{type}. If
5268 @option{--input-type} isn't specified, it will match any ELF file types.
5270 The supported ELF file types are, @var{rel}, @var{exec} and @var{dyn}.
5272 @item --output-type=@var{type}
5273 Change the ELF file type in the ELF header to @var{type}. The
5274 supported ELF types are the same as @option{--input-type}.
5276 @item --input-osabi=@var{osabi}
5277 Set the matching input ELF file OSABI to @var{osabi}. If
5278 @option{--input-osabi} isn't specified, it will match any ELF OSABIs.
5280 The supported ELF OSABIs are, @var{none}, @var{HPUX}, @var{NetBSD},
5281 @var{GNU}, @var{Linux} (alias for @var{GNU}),
5282 @var{Solaris}, @var{AIX}, @var{Irix},
5283 @var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS},
5284 @var{NSK}, @var{AROS} and @var{FenixOS}.
5286 @item --output-osabi=@var{osabi}
5287 Change the ELF OSABI in the ELF header to @var{osabi}. The
5288 supported ELF OSABI are the same as @option{--input-osabi}.
5290 @item --input-abiversion=@var{version}
5291 Set the matching input ELF file ABIVERSION to @var{version}.
5292 @var{version} must be between 0 and 255. If @option{--input-abiversion}
5293 isn't specified, it will match any ELF ABIVERSIONs.
5295 @item --output-abiversion=@var{version}
5296 Change the ELF ABIVERSION in the ELF header to @var{version}.
5297 @var{version} must be between 0 and 255.
5299 @item --enable-x86-feature=@var{feature}
5300 Set the @var{feature} bit in program property in @var{exec} or @var{dyn}
5301 ELF files with machine types of @var{i386} or @var{x86-64}. The
5302 supported features are, @var{ibt}, @var{shstk}, @var{lam_u48} and
5305 @item --disable-x86-feature=@var{feature}
5306 Clear the @var{feature} bit in program property in @var{exec} or
5307 @var{dyn} ELF files with machine types of @var{i386} or @var{x86-64}.
5308 The supported features are the same as @option{--enable-x86-feature}.
5310 Note: @option{--enable-x86-feature} and @option{--disable-x86-feature}
5311 are available only on hosts with @samp{mmap} support.
5315 Display the version number of @command{elfedit}.
5319 Display the command-line options understood by @command{elfedit}.
5326 @c man begin SEEALSO elfedit
5327 readelf(1), and the Info entries for @file{binutils}.
5331 @node Common Options
5332 @chapter Common Options
5334 The following command-line options are supported by all of the
5335 programs described in this manual.
5337 @c man begin OPTIONS
5339 @include at-file.texi
5343 Display the command-line options supported by the program.
5346 Display the version number of the program.
5348 @c man begin OPTIONS
5352 @node Selecting the Target System
5353 @chapter Selecting the Target System
5355 You can specify two aspects of the target system to the @sc{gnu}
5356 binary file utilities, each in several ways:
5366 In the following summaries, the lists of ways to specify values are in
5367 order of decreasing precedence. The ways listed first override those
5370 The commands to list valid values only list the values for which the
5371 programs you are running were configured. If they were configured with
5372 @option{--enable-targets=all}, the commands list most of the available
5373 values, but a few are left out; not all targets can be configured in at
5374 once because some of them can only be configured @dfn{native} (on hosts
5375 with the same type as the target system).
5378 * Target Selection::
5379 * Architecture Selection::
5382 @node Target Selection
5383 @section Target Selection
5385 A @dfn{target} is an object file format. A given target may be
5386 supported for multiple architectures (@pxref{Architecture Selection}).
5387 A target selection may also have variations for different operating
5388 systems or architectures.
5390 The command to list valid target values is @samp{objdump -i}
5391 (the first column of output contains the relevant information).
5393 Some sample values are: @samp{a.out-hp300bsd}, @samp{ecoff-littlemips},
5394 @samp{a.out-sunos-big}.
5396 You can also specify a target using a configuration triplet. This is
5397 the same sort of name that is passed to @file{configure} to specify a
5398 target. When you use a configuration triplet as an argument, it must be
5399 fully canonicalized. You can see the canonical version of a triplet by
5400 running the shell script @file{config.sub} which is included with the
5403 Some sample configuration triplets are: @samp{m68k-hp-bsd},
5404 @samp{mips-dec-ultrix}, @samp{sparc-sun-sunos}.
5406 @subheading @command{objdump} Target
5412 command-line option: @option{-b} or @option{--target}
5415 environment variable @code{GNUTARGET}
5418 deduced from the input file
5421 @subheading @command{objcopy} and @command{strip} Input Target
5427 command-line options: @option{-I} or @option{--input-target}, or @option{-F} or @option{--target}
5430 environment variable @code{GNUTARGET}
5433 deduced from the input file
5436 @subheading @command{objcopy} and @command{strip} Output Target
5442 command-line options: @option{-O} or @option{--output-target}, or @option{-F} or @option{--target}
5445 the input target (see ``@command{objcopy} and @command{strip} Input Target'' above)
5448 environment variable @code{GNUTARGET}
5451 deduced from the input file
5454 @subheading @command{nm}, @command{size}, and @command{strings} Target
5460 command-line option: @option{--target}
5463 environment variable @code{GNUTARGET}
5466 deduced from the input file
5469 @node Architecture Selection
5470 @section Architecture Selection
5472 An @dfn{architecture} is a type of @sc{cpu} on which an object file is
5473 to run. Its name may contain a colon, separating the name of the
5474 processor family from the name of the particular @sc{cpu}.
5476 The command to list valid architecture values is @samp{objdump -i} (the
5477 second column contains the relevant information).
5479 Sample values: @samp{m68k:68020}, @samp{mips:3000}, @samp{sparc}.
5481 @subheading @command{objdump} Architecture
5487 command-line option: @option{-m} or @option{--architecture}
5490 deduced from the input file
5493 @subheading @command{objcopy}, @command{nm}, @command{size}, @command{strings} Architecture
5499 deduced from the input file
5504 @cindex separate debug files
5506 debuginfod is a web service that indexes ELF/DWARF debugging resources
5507 by build-id and serves them over HTTP.
5509 Binutils can be built with the debuginfod client library
5510 @code{libdebuginfod} using the @option{--with-debuginfod} configure option.
5511 This option is enabled by default if @code{libdebuginfod} is installed
5512 and found at configure time. This allows @command{objdump} and
5513 @command{readelf} to automatically query debuginfod servers for
5514 separate debug files when the files are otherwise not found.
5516 debuginfod is packaged with elfutils, starting with version 0.178.
5517 You can get the latest version from `https://sourceware.org/elfutils/'.
5519 @node Reporting Bugs
5520 @chapter Reporting Bugs
5522 @cindex reporting bugs
5524 Your bug reports play an essential role in making the binary utilities
5527 Reporting a bug may help you by bringing a solution to your problem, or
5528 it may not. But in any case the principal function of a bug report is
5529 to help the entire community by making the next version of the binary
5530 utilities work better. Bug reports are your contribution to their
5533 In order for a bug report to serve its purpose, you must include the
5534 information that enables us to fix the bug.
5537 * Bug Criteria:: Have you found a bug?
5538 * Bug Reporting:: How to report bugs
5542 @section Have You Found a Bug?
5543 @cindex bug criteria
5545 If you are not sure whether you have found a bug, here are some guidelines:
5548 @cindex fatal signal
5551 If a binary utility gets a fatal signal, for any input whatever, that is
5552 a bug. Reliable utilities never crash.
5554 @cindex error on valid input
5556 If a binary utility produces an error message for valid input, that is a
5560 If you are an experienced user of binary utilities, your suggestions for
5561 improvement are welcome in any case.
5565 @section How to Report Bugs
5567 @cindex bugs, reporting
5569 A number of companies and individuals offer support for @sc{gnu}
5570 products. If you obtained the binary utilities from a support
5571 organization, we recommend you contact that organization first.
5573 You can find contact information for many support companies and
5574 individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
5578 In any event, we also recommend that you send bug reports for the binary
5579 utilities to @value{BUGURL}.
5582 The fundamental principle of reporting bugs usefully is this:
5583 @strong{report all the facts}. If you are not sure whether to state a
5584 fact or leave it out, state it!
5586 Often people omit facts because they think they know what causes the
5587 problem and assume that some details do not matter. Thus, you might
5588 assume that the name of a file you use in an example does not matter.
5589 Well, probably it does not, but one cannot be sure. Perhaps the bug is
5590 a stray memory reference which happens to fetch from the location where
5591 that pathname is stored in memory; perhaps, if the pathname were
5592 different, the contents of that location would fool the utility into
5593 doing the right thing despite the bug. Play it safe and give a
5594 specific, complete example. That is the easiest thing for you to do,
5595 and the most helpful.
5597 Keep in mind that the purpose of a bug report is to enable us to fix the bug if
5598 it is new to us. Therefore, always write your bug reports on the assumption
5599 that the bug has not been reported previously.
5601 Sometimes people give a few sketchy facts and ask, ``Does this ring a
5602 bell?'' This cannot help us fix a bug, so it is basically useless. We
5603 respond by asking for enough details to enable us to investigate.
5604 You might as well expedite matters by sending them to begin with.
5606 To enable us to fix the bug, you should include all these things:
5610 The version of the utility. Each utility announces it if you start it
5611 with the @option{--version} argument.
5613 Without this, we will not know whether there is any point in looking for
5614 the bug in the current version of the binary utilities.
5617 Any patches you may have applied to the source, including any patches
5618 made to the @code{BFD} library.
5621 The type of machine you are using, and the operating system name and
5625 What compiler (and its version) was used to compile the utilities---e.g.
5629 The command arguments you gave the utility to observe the bug. To
5630 guarantee you will not omit something important, list them all. A copy
5631 of the Makefile (or the output from make) is sufficient.
5633 If we were to try to guess the arguments, we would probably guess wrong
5634 and then we might not encounter the bug.
5637 A complete input file, or set of input files, that will reproduce the
5638 bug. If the utility is reading an object file or files, then it is
5639 generally most helpful to send the actual object files.
5641 If the source files were produced exclusively using @sc{gnu} programs
5642 (e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it
5643 may be OK to send the source files rather than the object files. In
5644 this case, be sure to say exactly what version of @command{gcc}, or
5645 whatever, was used to produce the object files. Also say how
5646 @command{gcc}, or whatever, was configured.
5649 A description of what behavior you observe that you believe is
5650 incorrect. For example, ``It gets a fatal signal.''
5652 Of course, if the bug is that the utility gets a fatal signal, then we
5653 will certainly notice it. But if the bug is incorrect output, we might
5654 not notice unless it is glaringly wrong. You might as well not give us
5655 a chance to make a mistake.
5657 Even if the problem you experience is a fatal signal, you should still
5658 say so explicitly. Suppose something strange is going on, such as your
5659 copy of the utility is out of sync, or you have encountered a bug in
5660 the C library on your system. (This has happened!) Your copy might
5661 crash and ours would not. If you told us to expect a crash, then when
5662 ours fails to crash, we would know that the bug was not happening for
5663 us. If you had not told us to expect a crash, then we would not be able
5664 to draw any conclusion from our observations.
5667 If you wish to suggest changes to the source, send us context diffs, as
5668 generated by @command{diff} with the @option{-u}, @option{-c}, or @option{-p}
5669 option. Always send diffs from the old file to the new file. If you
5670 wish to discuss something in the @command{ld} source, refer to it by
5671 context, not by line number.
5673 The line numbers in our development sources will not match those in your
5674 sources. Your line numbers would convey no useful information to us.
5677 Here are some things that are not necessary:
5681 A description of the envelope of the bug.
5683 Often people who encounter a bug spend a lot of time investigating
5684 which changes to the input file will make the bug go away and which
5685 changes will not affect it.
5687 This is often time consuming and not very useful, because the way we
5688 will find the bug is by running a single example under the debugger
5689 with breakpoints, not by pure deduction from a series of examples.
5690 We recommend that you save your time for something else.
5692 Of course, if you can find a simpler example to report @emph{instead}
5693 of the original one, that is a convenience for us. Errors in the
5694 output will be easier to spot, running under the debugger will take
5695 less time, and so on.
5697 However, simplification is not vital; if you do not want to do this,
5698 report the bug anyway and send us the entire test case you used.
5701 A patch for the bug.
5703 A patch for the bug does help us if it is a good one. But do not omit
5704 the necessary information, such as the test case, on the assumption that
5705 a patch is all we need. We might see problems with your patch and decide
5706 to fix the problem another way, or we might not understand it at all.
5708 Sometimes with programs as complicated as the binary utilities it is
5709 very hard to construct an example that will make the program follow a
5710 certain path through the code. If you do not send us the example, we
5711 will not be able to construct one, so we will not be able to verify that
5714 And if we cannot understand what bug you are trying to fix, or why your
5715 patch should be an improvement, we will not install it. A test case will
5716 help us to understand.
5719 A guess about what the bug is or what it depends on.
5721 Such guesses are usually wrong. Even we cannot guess right about such
5722 things without first using the debugger to find the facts.
5725 @node GNU Free Documentation License
5726 @appendix GNU Free Documentation License
5730 @node Binutils Index
5731 @unnumbered Binutils Index