1 This is ../.././binutils/doc/binutils.info, produced by makeinfo 2 version 4.8 from ../.././binutils/doc/binutils.texi. 3 4 START-INFO-DIR-ENTRY 5 * Binutils: (binutils). The GNU binary utilities. 6 * ar: (binutils)ar. Create, modify, and extract from archives 7 * nm: (binutils)nm. List symbols from object files 8 * objcopy: (binutils)objcopy. Copy and translate object files 9 * objdump: (binutils)objdump. Display information from object files 10 * ranlib: (binutils)ranlib. Generate index to archive contents 11 * readelf: (binutils)readelf. Display the contents of ELF format files. 12 * size: (binutils)size. List section sizes and total size 13 * strings: (binutils)strings. List printable strings from files 14 * strip: (binutils)strip. Discard symbols 15 * c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols 16 * cxxfilt: (binutils)c++filt. MS-DOS name for c++filt 17 * addr2line: (binutils)addr2line. Convert addresses to file and line 18 * nlmconv: (binutils)nlmconv. Converts object code into an NLM 19 * windres: (binutils)windres. Manipulate Windows resources 20 * dlltool: (binutils)dlltool. Create files needed to build and use DLLs 21 END-INFO-DIR-ENTRY 22 23 Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 24 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 25 26 Permission is granted to copy, distribute and/or modify this document 27 under the terms of the GNU Free Documentation License, Version 1.1 or 28 any later version published by the Free Software Foundation; with no 29 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 30 Texts. A copy of the license is included in the section entitled "GNU 31 Free Documentation License". 32 33 34 File: binutils.info, Node: Top, Next: ar, Up: (dir) 35 36 Introduction 37 ************ 38 39 This brief manual contains documentation for the GNU binary utilities 40 (collectively version 2.17): 41 42 This document is distributed under the terms of the GNU Free 43 Documentation License. A copy of the license is included in the 44 section entitled "GNU Free Documentation License". 45 46 * Menu: 47 48 * ar:: Create, modify, and extract from archives 49 * nm:: List symbols from object files 50 * objcopy:: Copy and translate object files 51 * objdump:: Display information from object files 52 * ranlib:: Generate index to archive contents 53 * readelf:: Display the contents of ELF format files. 54 * size:: List section sizes and total size 55 * strings:: List printable strings from files 56 * strip:: Discard symbols 57 * c++filt:: Filter to demangle encoded C++ symbols 58 * cxxfilt: c++filt. MS-DOS name for c++filt 59 * addr2line:: Convert addresses to file and line 60 * nlmconv:: Converts object code into an NLM 61 * windres:: Manipulate Windows resources 62 * dlltool:: Create files needed to build and use DLLs 63 * Common Options:: Command-line options for all utilities 64 * Selecting The Target System:: How these utilities determine the target. 65 * Reporting Bugs:: Reporting Bugs 66 * GNU Free Documentation License:: GNU Free Documentation License 67 * Index:: Index 68 69 70 File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top 71 72 1 ar 73 **** 74 75 ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] 76 ar -M [ <mri-script ] 77 78 The GNU `ar' program creates, modifies, and extracts from archives. 79 An "archive" is a single file holding a collection of other files in a 80 structure that makes it possible to retrieve the original individual 81 files (called "members" of the archive). 82 83 The original files' contents, mode (permissions), timestamp, owner, 84 and group are preserved in the archive, and can be restored on 85 extraction. 86 87 GNU `ar' can maintain archives whose members have names of any 88 length; however, depending on how `ar' is configured on your system, a 89 limit on member-name length may be imposed for compatibility with 90 archive formats maintained with other tools. If it exists, the limit 91 is often 15 characters (typical of formats related to a.out) or 16 92 characters (typical of formats related to coff). 93 94 `ar' is considered a binary utility because archives of this sort 95 are most often used as "libraries" holding commonly needed subroutines. 96 97 `ar' creates an index to the symbols defined in relocatable object 98 modules in the archive when you specify the modifier `s'. Once 99 created, this index is updated in the archive whenever `ar' makes a 100 change to its contents (save for the `q' update operation). An archive 101 with such an index speeds up linking to the library, and allows 102 routines in the library to call each other without regard to their 103 placement in the archive. 104 105 You may use `nm -s' or `nm --print-armap' to list this index table. 106 If an archive lacks the table, another form of `ar' called `ranlib' can 107 be used to add just the table. 108 109 GNU `ar' is designed to be compatible with two different facilities. 110 You can control its activity using command-line options, like the 111 different varieties of `ar' on Unix systems; or, if you specify the 112 single command-line option `-M', you can control it with a script 113 supplied via standard input, like the MRI "librarian" program. 114 115 * Menu: 116 117 * ar cmdline:: Controlling `ar' on the command line 118 * ar scripts:: Controlling `ar' with a script 119 120 121 File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar 122 123 1.1 Controlling `ar' on the Command Line 124 ======================================== 125 126 ar [`-X32_64'] [`-']P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] 127 128 When you use `ar' in the Unix style, `ar' insists on at least two 129 arguments to execute: one keyletter specifying the _operation_ 130 (optionally accompanied by other keyletters specifying _modifiers_), 131 and the archive name to act on. 132 133 Most operations can also accept further MEMBER arguments, specifying 134 particular files to operate on. 135 136 GNU `ar' allows you to mix the operation code P and modifier flags 137 MOD in any order, within the first command-line argument. 138 139 If you wish, you may begin the first command-line argument with a 140 dash. 141 142 The P keyletter specifies what operation to execute; it may be any 143 of the following, but you must specify only one of them: 144 145 `d' 146 _Delete_ modules from the archive. Specify the names of modules to 147 be deleted as MEMBER...; the archive is untouched if you specify 148 no files to delete. 149 150 If you specify the `v' modifier, `ar' lists each module as it is 151 deleted. 152 153 `m' 154 Use this operation to _move_ members in an archive. 155 156 The ordering of members in an archive can make a difference in how 157 programs are linked using the library, if a symbol is defined in 158 more than one member. 159 160 If no modifiers are used with `m', any members you name in the 161 MEMBER arguments are moved to the _end_ of the archive; you can 162 use the `a', `b', or `i' modifiers to move them to a specified 163 place instead. 164 165 `p' 166 _Print_ the specified members of the archive, to the standard 167 output file. If the `v' modifier is specified, show the member 168 name before copying its contents to standard output. 169 170 If you specify no MEMBER arguments, all the files in the archive 171 are printed. 172 173 `q' 174 _Quick append_; Historically, add the files MEMBER... to the end of 175 ARCHIVE, without checking for replacement. 176 177 The modifiers `a', `b', and `i' do _not_ affect this operation; 178 new members are always placed at the end of the archive. 179 180 The modifier `v' makes `ar' list each file as it is appended. 181 182 Since the point of this operation is speed, the archive's symbol 183 table index is not updated, even if it already existed; you can 184 use `ar s' or `ranlib' explicitly to update the symbol table index. 185 186 However, too many different systems assume quick append rebuilds 187 the index, so GNU `ar' implements `q' as a synonym for `r'. 188 189 `r' 190 Insert the files MEMBER... into ARCHIVE (with _replacement_). This 191 operation differs from `q' in that any previously existing members 192 are deleted if their names match those being added. 193 194 If one of the files named in MEMBER... does not exist, `ar' 195 displays an error message, and leaves undisturbed any existing 196 members of the archive matching that name. 197 198 By default, new members are added at the end of the file; but you 199 may use one of the modifiers `a', `b', or `i' to request placement 200 relative to some existing member. 201 202 The modifier `v' used with this operation elicits a line of output 203 for each file inserted, along with one of the letters `a' or `r' 204 to indicate whether the file was appended (no old member deleted) 205 or replaced. 206 207 `t' 208 Display a _table_ listing the contents of ARCHIVE, or those of the 209 files listed in MEMBER... that are present in the archive. 210 Normally only the member name is shown; if you also want to see 211 the modes (permissions), timestamp, owner, group, and size, you can 212 request that by also specifying the `v' modifier. 213 214 If you do not specify a MEMBER, all files in the archive are 215 listed. 216 217 If there is more than one file with the same name (say, `fie') in 218 an archive (say `b.a'), `ar t b.a fie' lists only the first 219 instance; to see them all, you must ask for a complete listing--in 220 our example, `ar t b.a'. 221 222 `x' 223 _Extract_ members (named MEMBER) from the archive. You can use 224 the `v' modifier with this operation, to request that `ar' list 225 each name as it extracts it. 226 227 If you do not specify a MEMBER, all files in the archive are 228 extracted. 229 230 231 A number of modifiers (MOD) may immediately follow the P keyletter, 232 to specify variations on an operation's behavior: 233 234 `a' 235 Add new files _after_ an existing member of the archive. If you 236 use the modifier `a', the name of an existing archive member must 237 be present as the RELPOS argument, before the ARCHIVE 238 specification. 239 240 `b' 241 Add new files _before_ an existing member of the archive. If you 242 use the modifier `b', the name of an existing archive member must 243 be present as the RELPOS argument, before the ARCHIVE 244 specification. (same as `i'). 245 246 `c' 247 _Create_ the archive. The specified ARCHIVE is always created if 248 it did not exist, when you request an update. But a warning is 249 issued unless you specify in advance that you expect to create it, 250 by using this modifier. 251 252 `f' 253 Truncate names in the archive. GNU `ar' will normally permit file 254 names of any length. This will cause it to create archives which 255 are not compatible with the native `ar' program on some systems. 256 If this is a concern, the `f' modifier may be used to truncate file 257 names when putting them in the archive. 258 259 `i' 260 Insert new files _before_ an existing member of the archive. If 261 you use the modifier `i', the name of an existing archive member 262 must be present as the RELPOS argument, before the ARCHIVE 263 specification. (same as `b'). 264 265 `l' 266 This modifier is accepted but not used. 267 268 `N' 269 Uses the COUNT parameter. This is used if there are multiple 270 entries in the archive with the same name. Extract or delete 271 instance COUNT of the given name from the archive. 272 273 `o' 274 Preserve the _original_ dates of members when extracting them. If 275 you do not specify this modifier, files extracted from the archive 276 are stamped with the time of extraction. 277 278 `P' 279 Use the full path name when matching names in the archive. GNU 280 `ar' can not create an archive with a full path name (such archives 281 are not POSIX complaint), but other archive creators can. This 282 option will cause GNU `ar' to match file names using a complete 283 path name, which can be convenient when extracting a single file 284 from an archive created by another tool. 285 286 `s' 287 Write an object-file index into the archive, or update an existing 288 one, even if no other change is made to the archive. You may use 289 this modifier flag either with any operation, or alone. Running 290 `ar s' on an archive is equivalent to running `ranlib' on it. 291 292 `S' 293 Do not generate an archive symbol table. This can speed up 294 building a large library in several steps. The resulting archive 295 can not be used with the linker. In order to build a symbol 296 table, you must omit the `S' modifier on the last execution of 297 `ar', or you must run `ranlib' on the archive. 298 299 `u' 300 Normally, `ar r'... inserts all files listed into the archive. If 301 you would like to insert _only_ those of the files you list that 302 are newer than existing members of the same names, use this 303 modifier. The `u' modifier is allowed only for the operation `r' 304 (replace). In particular, the combination `qu' is not allowed, 305 since checking the timestamps would lose any speed advantage from 306 the operation `q'. 307 308 `v' 309 This modifier requests the _verbose_ version of an operation. Many 310 operations display additional information, such as filenames 311 processed, when the modifier `v' is appended. 312 313 `V' 314 This modifier shows the version number of `ar'. 315 316 `ar' ignores an initial option spelt `-X32_64', for compatibility 317 with AIX. The behaviour produced by this option is the default for GNU 318 `ar'. `ar' does not support any of the other `-X' options; in 319 particular, it does not support `-X32' which is the default for AIX 320 `ar'. 321 322 323 File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar 324 325 1.2 Controlling `ar' with a Script 326 ================================== 327 328 ar -M [ <SCRIPT ] 329 330 If you use the single command-line option `-M' with `ar', you can 331 control its operation with a rudimentary command language. This form 332 of `ar' operates interactively if standard input is coming directly 333 from a terminal. During interactive use, `ar' prompts for input (the 334 prompt is `AR >'), and continues executing even after errors. If you 335 redirect standard input to a script file, no prompts are issued, and 336 `ar' abandons execution (with a nonzero exit code) on any error. 337 338 The `ar' command language is _not_ designed to be equivalent to the 339 command-line options; in fact, it provides somewhat less control over 340 archives. The only purpose of the command language is to ease the 341 transition to GNU `ar' for developers who already have scripts written 342 for the MRI "librarian" program. 343 344 The syntax for the `ar' command language is straightforward: 345 * commands are recognized in upper or lower case; for example, `LIST' 346 is the same as `list'. In the following descriptions, commands are 347 shown in upper case for clarity. 348 349 * a single command may appear on each line; it is the first word on 350 the line. 351 352 * empty lines are allowed, and have no effect. 353 354 * comments are allowed; text after either of the characters `*' or 355 `;' is ignored. 356 357 * Whenever you use a list of names as part of the argument to an `ar' 358 command, you can separate the individual names with either commas 359 or blanks. Commas are shown in the explanations below, for 360 clarity. 361 362 * `+' is used as a line continuation character; if `+' appears at 363 the end of a line, the text on the following line is considered 364 part of the current command. 365 366 Here are the commands you can use in `ar' scripts, or when using 367 `ar' interactively. Three of them have special significance: 368 369 `OPEN' or `CREATE' specify a "current archive", which is a temporary 370 file required for most of the other commands. 371 372 `SAVE' commits the changes so far specified by the script. Prior to 373 `SAVE', commands affect only the temporary copy of the current archive. 374 375 `ADDLIB ARCHIVE' 376 `ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' 377 Add all the contents of ARCHIVE (or, if specified, each named 378 MODULE from ARCHIVE) to the current archive. 379 380 Requires prior use of `OPEN' or `CREATE'. 381 382 `ADDMOD MEMBER, MEMBER, ... MEMBER' 383 Add each named MEMBER as a module in the current archive. 384 385 Requires prior use of `OPEN' or `CREATE'. 386 387 `CLEAR' 388 Discard the contents of the current archive, canceling the effect 389 of any operations since the last `SAVE'. May be executed (with no 390 effect) even if no current archive is specified. 391 392 `CREATE ARCHIVE' 393 Creates an archive, and makes it the current archive (required for 394 many other commands). The new archive is created with a temporary 395 name; it is not actually saved as ARCHIVE until you use `SAVE'. 396 You can overwrite existing archives; similarly, the contents of any 397 existing file named ARCHIVE will not be destroyed until `SAVE'. 398 399 `DELETE MODULE, MODULE, ... MODULE' 400 Delete each listed MODULE from the current archive; equivalent to 401 `ar -d ARCHIVE MODULE ... MODULE'. 402 403 Requires prior use of `OPEN' or `CREATE'. 404 405 `DIRECTORY ARCHIVE (MODULE, ... MODULE)' 406 `DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' 407 List each named MODULE present in ARCHIVE. The separate command 408 `VERBOSE' specifies the form of the output: when verbose output is 409 off, output is like that of `ar -t ARCHIVE MODULE...'. When 410 verbose output is on, the listing is like `ar -tv ARCHIVE 411 MODULE...'. 412 413 Output normally goes to the standard output stream; however, if you 414 specify OUTPUTFILE as a final argument, `ar' directs the output to 415 that file. 416 417 `END' 418 Exit from `ar', with a `0' exit code to indicate successful 419 completion. This command does not save the output file; if you 420 have changed the current archive since the last `SAVE' command, 421 those changes are lost. 422 423 `EXTRACT MODULE, MODULE, ... MODULE' 424 Extract each named MODULE from the current archive, writing them 425 into the current directory as separate files. Equivalent to `ar -x 426 ARCHIVE MODULE...'. 427 428 Requires prior use of `OPEN' or `CREATE'. 429 430 `LIST' 431 Display full contents of the current archive, in "verbose" style 432 regardless of the state of `VERBOSE'. The effect is like `ar tv 433 ARCHIVE'. (This single command is a GNU `ar' enhancement, rather 434 than present for MRI compatibility.) 435 436 Requires prior use of `OPEN' or `CREATE'. 437 438 `OPEN ARCHIVE' 439 Opens an existing archive for use as the current archive (required 440 for many other commands). Any changes as the result of subsequent 441 commands will not actually affect ARCHIVE until you next use 442 `SAVE'. 443 444 `REPLACE MODULE, MODULE, ... MODULE' 445 In the current archive, replace each existing MODULE (named in the 446 `REPLACE' arguments) from files in the current working directory. 447 To execute this command without errors, both the file, and the 448 module in the current archive, must exist. 449 450 Requires prior use of `OPEN' or `CREATE'. 451 452 `VERBOSE' 453 Toggle an internal flag governing the output from `DIRECTORY'. 454 When the flag is on, `DIRECTORY' output matches output from `ar 455 -tv '.... 456 457 `SAVE' 458 Commit your changes to the current archive, and actually save it 459 as a file with the name specified in the last `CREATE' or `OPEN' 460 command. 461 462 Requires prior use of `OPEN' or `CREATE'. 463 464 465 466 File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top 467 468 2 nm 469 **** 470 471 nm [`-a'|`--debug-syms'] [`-g'|`--extern-only'] 472 [`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic'] 473 [`-S'|`--print-size'] [`-s'|`--print-armap'] 474 [`-A'|`-o'|`--print-file-name'][`--special-syms'] 475 [`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort'] 476 [`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only'] 477 [`-t' RADIX|`--radix='RADIX] [`-P'|`--portability'] 478 [`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT] 479 [`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle'] 480 [`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...] 481 482 GNU `nm' lists the symbols from object files OBJFILE.... If no 483 object files are listed as arguments, `nm' assumes the file `a.out'. 484 485 For each symbol, `nm' shows: 486 487 * The symbol value, in the radix selected by options (see below), or 488 hexadecimal by default. 489 490 * The symbol type. At least the following types are used; others 491 are, as well, depending on the object file format. If lowercase, 492 the symbol is local; if uppercase, the symbol is global (external). 493 494 `A' 495 The symbol's value is absolute, and will not be changed by 496 further linking. 497 498 `B' 499 The symbol is in the uninitialized data section (known as 500 BSS). 501 502 `C' 503 The symbol is common. Common symbols are uninitialized data. 504 When linking, multiple common symbols may appear with the 505 same name. If the symbol is defined anywhere, the common 506 symbols are treated as undefined references. For more 507 details on common symbols, see the discussion of -warn-common 508 in *Note Linker options: (ld.info)Options. 509 510 `D' 511 The symbol is in the initialized data section. 512 513 `G' 514 The symbol is in an initialized data section for small 515 objects. Some object file formats permit more efficient 516 access to small data objects, such as a global int variable 517 as opposed to a large global array. 518 519 `I' 520 The symbol is an indirect reference to another symbol. This 521 is a GNU extension to the a.out object file format which is 522 rarely used. 523 524 `N' 525 The symbol is a debugging symbol. 526 527 `R' 528 The symbol is in a read only data section. 529 530 `S' 531 The symbol is in an uninitialized data section for small 532 objects. 533 534 `T' 535 The symbol is in the text (code) section. 536 537 `U' 538 The symbol is undefined. 539 540 `V' 541 The symbol is a weak object. When a weak defined symbol is 542 linked with a normal defined symbol, the normal defined 543 symbol is used with no error. When a weak undefined symbol 544 is linked and the symbol is not defined, the value of the 545 weak symbol becomes zero with no error. 546 547 `W' 548 The symbol is a weak symbol that has not been specifically 549 tagged as a weak object symbol. When a weak defined symbol 550 is linked with a normal defined symbol, the normal defined 551 symbol is used with no error. When a weak undefined symbol 552 is linked and the symbol is not defined, the value of the 553 symbol is determined in a system-specific manner without 554 error. On some systems, uppercase indicates that a default 555 value has been specified. 556 557 `-' 558 The symbol is a stabs symbol in an a.out object file. In 559 this case, the next values printed are the stabs other field, 560 the stabs desc field, and the stab type. Stabs symbols are 561 used to hold debugging information. For more information, 562 see *Note Stabs: (stabs.info)Top. 563 564 `?' 565 The symbol type is unknown, or object file format specific. 566 567 * The symbol name. 568 569 The long and short forms of options, shown here as alternatives, are 570 equivalent. 571 572 `-A' 573 `-o' 574 `--print-file-name' 575 Precede each symbol by the name of the input file (or archive 576 member) in which it was found, rather than identifying the input 577 file once only, before all of its symbols. 578 579 `-a' 580 `--debug-syms' 581 Display all symbols, even debugger-only symbols; normally these 582 are not listed. 583 584 `-B' 585 The same as `--format=bsd' (for compatibility with the MIPS `nm'). 586 587 `-C' 588 `--demangle[=STYLE]' 589 Decode ("demangle") low-level symbol names into user-level names. 590 Besides removing any initial underscore prepended by the system, 591 this makes C++ function names readable. Different compilers have 592 different mangling styles. The optional demangling style argument 593 can be used to choose an appropriate demangling style for your 594 compiler. *Note c++filt::, for more information on demangling. 595 596 `--no-demangle' 597 Do not demangle low-level symbol names. This is the default. 598 599 `-D' 600 `--dynamic' 601 Display the dynamic symbols rather than the normal symbols. This 602 is only meaningful for dynamic objects, such as certain types of 603 shared libraries. 604 605 `-f FORMAT' 606 `--format=FORMAT' 607 Use the output format FORMAT, which can be `bsd', `sysv', or 608 `posix'. The default is `bsd'. Only the first character of 609 FORMAT is significant; it can be either upper or lower case. 610 611 `-g' 612 `--extern-only' 613 Display only external symbols. 614 615 `-l' 616 `--line-numbers' 617 For each symbol, use debugging information to try to find a 618 filename and line number. For a defined symbol, look for the line 619 number of the address of the symbol. For an undefined symbol, 620 look for the line number of a relocation entry which refers to the 621 symbol. If line number information can be found, print it after 622 the other symbol information. 623 624 `-n' 625 `-v' 626 `--numeric-sort' 627 Sort symbols numerically by their addresses, rather than 628 alphabetically by their names. 629 630 `-p' 631 `--no-sort' 632 Do not bother to sort the symbols in any order; print them in the 633 order encountered. 634 635 `-P' 636 `--portability' 637 Use the POSIX.2 standard output format instead of the default 638 format. Equivalent to `-f posix'. 639 640 `-S' 641 `--print-size' 642 Print size, not the value, of defined symbols for the `bsd' output 643 format. 644 645 `-s' 646 `--print-armap' 647 When listing symbols from archive members, include the index: a 648 mapping (stored in the archive by `ar' or `ranlib') of which 649 modules contain definitions for which names. 650 651 `-r' 652 `--reverse-sort' 653 Reverse the order of the sort (whether numeric or alphabetic); let 654 the last come first. 655 656 `--size-sort' 657 Sort symbols by size. The size is computed as the difference 658 between the value of the symbol and the value of the symbol with 659 the next higher value. If the `bsd' output format is used the 660 size of the symbol is printed, rather than the value, and `-S' 661 must be used in order both size and value to be printed. 662 663 `--special-syms' 664 Display symbols which have a target-specific special meaning. 665 These symbols are usually used by the target for some special 666 processing and are not normally helpful when included included in 667 the normal symbol lists. For example for ARM targets this option 668 would skip the mapping symbols used to mark transistions between 669 ARM code, THUMB code and data. 670 671 `-t RADIX' 672 `--radix=RADIX' 673 Use RADIX as the radix for printing the symbol values. It must be 674 `d' for decimal, `o' for octal, or `x' for hexadecimal. 675 676 `--target=BFDNAME' 677 Specify an object code format other than your system's default 678 format. *Note Target Selection::, for more information. 679 680 `-u' 681 `--undefined-only' 682 Display only undefined symbols (those external to each object 683 file). 684 685 `--defined-only' 686 Display only defined symbols for each object file. 687 688 `-V' 689 `--version' 690 Show the version number of `nm' and exit. 691 692 `-X' 693 This option is ignored for compatibility with the AIX version of 694 `nm'. It takes one parameter which must be the string `32_64'. 695 The default mode of AIX `nm' corresponds to `-X 32', which is not 696 supported by GNU `nm'. 697 698 `--help' 699 Show a summary of the options to `nm' and exit. 700 701 702 File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top 703 704 3 objcopy 705 ********* 706 707 objcopy [`-F' BFDNAME|`--target='BFDNAME] 708 [`-I' BFDNAME|`--input-target='BFDNAME] 709 [`-O' BFDNAME|`--output-target='BFDNAME] 710 [`-B' BFDARCH|`--binary-architecture='BFDARCH] 711 [`-S'|`--strip-all'] 712 [`-g'|`--strip-debug'] 713 [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME] 714 [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME] 715 [`--strip-unneeded-symbol='SYMBOLNAME] 716 [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME] 717 [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME] 718 [`--globalize-symbol='SYMBOLNAME] 719 [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME] 720 [`-w'|`--wildcard'] 721 [`-x'|`--discard-all'] 722 [`-X'|`--discard-locals'] 723 [`-b' BYTE|`--byte='BYTE] 724 [`-i' INTERLEAVE|`--interleave='INTERLEAVE] 725 [`-j' SECTIONNAME|`--only-section='SECTIONNAME] 726 [`-R' SECTIONNAME|`--remove-section='SECTIONNAME] 727 [`-p'|`--preserve-dates'] 728 [`--debugging'] 729 [`--gap-fill='VAL] 730 [`--pad-to='ADDRESS] 731 [`--set-start='VAL] 732 [`--adjust-start='INCR] 733 [`--change-addresses='INCR] 734 [`--change-section-address' SECTION{=,+,-}VAL] 735 [`--change-section-lma' SECTION{=,+,-}VAL] 736 [`--change-section-vma' SECTION{=,+,-}VAL] 737 [`--change-warnings'] [`--no-change-warnings'] 738 [`--set-section-flags' SECTION=FLAGS] 739 [`--add-section' SECTIONNAME=FILENAME] 740 [`--rename-section' OLDNAME=NEWNAME[,FLAGS]] 741 [`--change-leading-char'] [`--remove-leading-char'] 742 [`--srec-len='IVAL] [`--srec-forceS3'] 743 [`--redefine-sym' OLD=NEW] 744 [`--redefine-syms='FILENAME] 745 [`--weaken'] 746 [`--keep-symbols='FILENAME] 747 [`--strip-symbols='FILENAME] 748 [`--strip-unneeded-symbols='FILENAME] 749 [`--keep-global-symbols='FILENAME] 750 [`--localize-symbols='FILENAME] 751 [`--globalize-symbols='FILENAME] 752 [`--weaken-symbols='FILENAME] 753 [`--alt-machine-code='INDEX] 754 [`--prefix-symbols='STRING] 755 [`--prefix-sections='STRING] 756 [`--prefix-alloc-sections='STRING] 757 [`--add-gnu-debuglink='PATH-TO-FILE] 758 [`--keep-file-symbols'] 759 [`--only-keep-debug'] 760 [`--writable-text'] 761 [`--readonly-text'] 762 [`--pure'] 763 [`--impure'] 764 [`-v'|`--verbose'] 765 [`-V'|`--version'] 766 [`--help'] [`--info'] 767 INFILE [OUTFILE] 768 769 The GNU `objcopy' utility copies the contents of an object file to 770 another. `objcopy' uses the GNU BFD Library to read and write the 771 object files. It can write the destination object file in a format 772 different from that of the source object file. The exact behavior of 773 `objcopy' is controlled by command-line options. Note that `objcopy' 774 should be able to copy a fully linked file between any two formats. 775 However, copying a relocatable object file between any two formats may 776 not work as expected. 777 778 `objcopy' creates temporary files to do its translations and deletes 779 them afterward. `objcopy' uses BFD to do all its translation work; it 780 has access to all the formats described in BFD and thus is able to 781 recognize most formats without being told explicitly. *Note BFD: 782 (ld.info)BFD. 783 784 `objcopy' can be used to generate S-records by using an output 785 target of `srec' (e.g., use `-O srec'). 786 787 `objcopy' can be used to generate a raw binary file by using an 788 output target of `binary' (e.g., use `-O binary'). When `objcopy' 789 generates a raw binary file, it will essentially produce a memory dump 790 of the contents of the input object file. All symbols and relocation 791 information will be discarded. The memory dump will start at the load 792 address of the lowest section copied into the output file. 793 794 When generating an S-record or a raw binary file, it may be helpful 795 to use `-S' to remove sections containing debugging information. In 796 some cases `-R' will be useful to remove sections which contain 797 information that is not needed by the binary file. 798 799 Note--`objcopy' is not able to change the endianness of its input 800 files. If the input format has an endianness (some formats do not), 801 `objcopy' can only copy the inputs into file formats that have the same 802 endianness or which have no endianness (e.g., `srec'). 803 804 `INFILE' 805 `OUTFILE' 806 The input and output files, respectively. If you do not specify 807 OUTFILE, `objcopy' creates a temporary file and destructively 808 renames the result with the name of INFILE. 809 810 `-I BFDNAME' 811 `--input-target=BFDNAME' 812 Consider the source file's object format to be BFDNAME, rather than 813 attempting to deduce it. *Note Target Selection::, for more 814 information. 815 816 `-O BFDNAME' 817 `--output-target=BFDNAME' 818 Write the output file using the object format BFDNAME. *Note 819 Target Selection::, for more information. 820 821 `-F BFDNAME' 822 `--target=BFDNAME' 823 Use BFDNAME as the object format for both the input and the output 824 file; i.e., simply transfer data from source to destination with no 825 translation. *Note Target Selection::, for more information. 826 827 `-B BFDARCH' 828 `--binary-architecture=BFDARCH' 829 Useful when transforming a raw binary input file into an object 830 file. In this case the output architecture can be set to BFDARCH. 831 This option will be ignored if the input file has a known BFDARCH. 832 You can access this binary data inside a program by referencing 833 the special symbols that are created by the conversion process. 834 These symbols are called _binary_OBJFILE_start, 835 _binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can 836 transform a picture file into an object file and then access it in 837 your code using these symbols. 838 839 `-j SECTIONNAME' 840 `--only-section=SECTIONNAME' 841 Copy only the named section from the input file to the output file. 842 This option may be given more than once. Note that using this 843 option inappropriately may make the output file unusable. 844 845 `-R SECTIONNAME' 846 `--remove-section=SECTIONNAME' 847 Remove any section named SECTIONNAME from the output file. This 848 option may be given more than once. Note that using this option 849 inappropriately may make the output file unusable. 850 851 `-S' 852 `--strip-all' 853 Do not copy relocation and symbol information from the source file. 854 855 `-g' 856 `--strip-debug' 857 Do not copy debugging symbols or sections from the source file. 858 859 `--strip-unneeded' 860 Strip all symbols that are not needed for relocation processing. 861 862 `-K SYMBOLNAME' 863 `--keep-symbol=SYMBOLNAME' 864 When stripping symbols, keep symbol SYMBOLNAME even if it would 865 normally be stripped. This option may be given more than once. 866 867 `-N SYMBOLNAME' 868 `--strip-symbol=SYMBOLNAME' 869 Do not copy symbol SYMBOLNAME from the source file. This option 870 may be given more than once. 871 872 `--strip-unneeded-symbol=SYMBOLNAME' 873 Do not copy symbol SYMBOLNAME from the source file unless it is 874 needed by a relocation. This option may be given more than once. 875 876 `-G SYMBOLNAME' 877 `--keep-global-symbol=SYMBOLNAME' 878 Keep only symbol SYMBOLNAME global. Make all other symbols local 879 to the file, so that they are not visible externally. This option 880 may be given more than once. 881 882 `-L SYMBOLNAME' 883 `--localize-symbol=SYMBOLNAME' 884 Make symbol SYMBOLNAME local to the file, so that it is not 885 visible externally. This option may be given more than once. 886 887 `-W SYMBOLNAME' 888 `--weaken-symbol=SYMBOLNAME' 889 Make symbol SYMBOLNAME weak. This option may be given more than 890 once. 891 892 `--globalize-symbol=SYMBOLNAME' 893 Give symbol SYMBOLNAME global scoping so that it is visible 894 outside of the file in which it is defined. This option may be 895 given more than once. 896 897 `-w' 898 `--wildcard' 899 Permit regular expressions in SYMBOLNAMEs used in other command 900 line options. The question mark (?), asterisk (*), backslash (\) 901 and square brackets ([]) operators can be used anywhere in the 902 symbol name. If the first character of the symbol name is the 903 exclamation point (!) then the sense of the switch is reversed for 904 that symbol. For example: 905 906 -w -W !foo -W fo* 907 908 would cause objcopy to weaken all symbols that start with "fo" 909 except for the symbol "foo". 910 911 `-x' 912 `--discard-all' 913 Do not copy non-global symbols from the source file. 914 915 `-X' 916 `--discard-locals' 917 Do not copy compiler-generated local symbols. (These usually 918 start with `L' or `.'.) 919 920 `-b BYTE' 921 `--byte=BYTE' 922 Keep only every BYTEth byte of the input file (header data is not 923 affected). BYTE can be in the range from 0 to INTERLEAVE-1, where 924 INTERLEAVE is given by the `-i' or `--interleave' option, or the 925 default of 4. This option is useful for creating files to program 926 ROM. It is typically used with an `srec' output target. 927 928 `-i INTERLEAVE' 929 `--interleave=INTERLEAVE' 930 Only copy one out of every INTERLEAVE bytes. Select which byte to 931 copy with the `-b' or `--byte' option. The default is 4. 932 `objcopy' ignores this option if you do not specify either `-b' or 933 `--byte'. 934 935 `-p' 936 `--preserve-dates' 937 Set the access and modification dates of the output file to be the 938 same as those of the input file. 939 940 `--debugging' 941 Convert debugging information, if possible. This is not the 942 default because only certain debugging formats are supported, and 943 the conversion process can be time consuming. 944 945 `--gap-fill VAL' 946 Fill gaps between sections with VAL. This operation applies to 947 the _load address_ (LMA) of the sections. It is done by increasing 948 the size of the section with the lower address, and filling in the 949 extra space created with VAL. 950 951 `--pad-to ADDRESS' 952 Pad the output file up to the load address ADDRESS. This is done 953 by increasing the size of the last section. The extra space is 954 filled in with the value specified by `--gap-fill' (default zero). 955 956 `--set-start VAL' 957 Set the start address of the new file to VAL. Not all object file 958 formats support setting the start address. 959 960 `--change-start INCR' 961 `--adjust-start INCR' 962 Change the start address by adding INCR. Not all object file 963 formats support setting the start address. 964 965 `--change-addresses INCR' 966 `--adjust-vma INCR' 967 Change the VMA and LMA addresses of all sections, as well as the 968 start address, by adding INCR. Some object file formats do not 969 permit section addresses to be changed arbitrarily. Note that 970 this does not relocate the sections; if the program expects 971 sections to be loaded at a certain address, and this option is 972 used to change the sections such that they are loaded at a 973 different address, the program may fail. 974 975 `--change-section-address SECTION{=,+,-}VAL' 976 `--adjust-section-vma SECTION{=,+,-}VAL' 977 Set or change both the VMA address and the LMA address of the named 978 SECTION. If `=' is used, the section address is set to VAL. 979 Otherwise, VAL is added to or subtracted from the section address. 980 See the comments under `--change-addresses', above. If SECTION 981 does not exist in the input file, a warning will be issued, unless 982 `--no-change-warnings' is used. 983 984 `--change-section-lma SECTION{=,+,-}VAL' 985 Set or change the LMA address of the named SECTION. The LMA 986 address is the address where the section will be loaded into 987 memory at program load time. Normally this is the same as the VMA 988 address, which is the address of the section at program run time, 989 but on some systems, especially those where a program is held in 990 ROM, the two can be different. If `=' is used, the section 991 address is set to VAL. Otherwise, VAL is added to or subtracted 992 from the section address. See the comments under 993 `--change-addresses', above. If SECTION does not exist in the 994 input file, a warning will be issued, unless 995 `--no-change-warnings' is used. 996 997 `--change-section-vma SECTION{=,+,-}VAL' 998 Set or change the VMA address of the named SECTION. The VMA 999 address is the address where the section will be located once the 1000 program has started executing. Normally this is the same as the 1001 LMA address, which is the address where the section will be loaded 1002 into memory, but on some systems, especially those where a program 1003 is held in ROM, the two can be different. If `=' is used, the 1004 section address is set to VAL. Otherwise, VAL is added to or 1005 subtracted from the section address. See the comments under 1006 `--change-addresses', above. If SECTION does not exist in the 1007 input file, a warning will be issued, unless 1008 `--no-change-warnings' is used. 1009 1010 `--change-warnings' 1011 `--adjust-warnings' 1012 If `--change-section-address' or `--change-section-lma' or 1013 `--change-section-vma' is used, and the named section does not 1014 exist, issue a warning. This is the default. 1015 1016 `--no-change-warnings' 1017 `--no-adjust-warnings' 1018 Do not issue a warning if `--change-section-address' or 1019 `--adjust-section-lma' or `--adjust-section-vma' is used, even if 1020 the named section does not exist. 1021 1022 `--set-section-flags SECTION=FLAGS' 1023 Set the flags for the named section. The FLAGS argument is a 1024 comma separated string of flag names. The recognized names are 1025 `alloc', `contents', `load', `noload', `readonly', `code', `data', 1026 `rom', `share', and `debug'. You can set the `contents' flag for 1027 a section which does not have contents, but it is not meaningful 1028 to clear the `contents' flag of a section which does have 1029 contents-just remove the section instead. Not all flags are 1030 meaningful for all object file formats. 1031 1032 `--add-section SECTIONNAME=FILENAME' 1033 Add a new section named SECTIONNAME while copying the file. The 1034 contents of the new section are taken from the file FILENAME. The 1035 size of the section will be the size of the file. This option only 1036 works on file formats which can support sections with arbitrary 1037 names. 1038 1039 `--rename-section OLDNAME=NEWNAME[,FLAGS]' 1040 Rename a section from OLDNAME to NEWNAME, optionally changing the 1041 section's flags to FLAGS in the process. This has the advantage 1042 over usng a linker script to perform the rename in that the output 1043 stays as an object file and does not become a linked executable. 1044 1045 This option is particularly helpful when the input format is 1046 binary, since this will always create a section called .data. If 1047 for example, you wanted instead to create a section called .rodata 1048 containing binary data you could use the following command line to 1049 achieve it: 1050 1051 objcopy -I binary -O <output_format> -B <architecture> \ 1052 --rename-section .data=.rodata,alloc,load,readonly,data,contents \ 1053 <input_binary_file> <output_object_file> 1054 1055 `--change-leading-char' 1056 Some object file formats use special characters at the start of 1057 symbols. The most common such character is underscore, which 1058 compilers often add before every symbol. This option tells 1059 `objcopy' to change the leading character of every symbol when it 1060 converts between object file formats. If the object file formats 1061 use the same leading character, this option has no effect. 1062 Otherwise, it will add a character, or remove a character, or 1063 change a character, as appropriate. 1064 1065 `--remove-leading-char' 1066 If the first character of a global symbol is a special symbol 1067 leading character used by the object file format, remove the 1068 character. The most common symbol leading character is 1069 underscore. This option will remove a leading underscore from all 1070 global symbols. This can be useful if you want to link together 1071 objects of different file formats with different conventions for 1072 symbol names. This is different from `--change-leading-char' 1073 because it always changes the symbol name when appropriate, 1074 regardless of the object file format of the output file. 1075 1076 `--srec-len=IVAL' 1077 Meaningful only for srec output. Set the maximum length of the 1078 Srecords being produced to IVAL. This length covers both address, 1079 data and crc fields. 1080 1081 `--srec-forceS3' 1082 Meaningful only for srec output. Avoid generation of S1/S2 1083 records, creating S3-only record format. 1084 1085 `--redefine-sym OLD=NEW' 1086 Change the name of a symbol OLD, to NEW. This can be useful when 1087 one is trying link two things together for which you have no 1088 source, and there are name collisions. 1089 1090 `--redefine-syms=FILENAME' 1091 Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the 1092 file FILENAME. FILENAME is simply a flat file, with one symbol 1093 pair per line. Line comments may be introduced by the hash 1094 character. This option may be given more than once. 1095 1096 `--weaken' 1097 Change all global symbols in the file to be weak. This can be 1098 useful when building an object which will be linked against other 1099 objects using the `-R' option to the linker. This option is only 1100 effective when using an object file format which supports weak 1101 symbols. 1102 1103 `--keep-symbols=FILENAME' 1104 Apply `--keep-symbol' option to each symbol listed in the file 1105 FILENAME. FILENAME is simply a flat file, with one symbol name 1106 per line. Line comments may be introduced by the hash character. 1107 This option may be given more than once. 1108 1109 `--strip-symbols=FILENAME' 1110 Apply `--strip-symbol' option to each symbol listed in the file 1111 FILENAME. FILENAME is simply a flat file, with one symbol name 1112 per line. Line comments may be introduced by the hash character. 1113 This option may be given more than once. 1114 1115 `--strip-unneeded-symbols=FILENAME' 1116 Apply `--strip-unneeded-symbol' option to each symbol listed in 1117 the file FILENAME. FILENAME is simply a flat file, with one 1118 symbol name per line. Line comments may be introduced by the hash 1119 character. This option may be given more than once. 1120 1121 `--keep-global-symbols=FILENAME' 1122 Apply `--keep-global-symbol' option to each symbol listed in the 1123 file FILENAME. FILENAME is simply a flat file, with one symbol 1124 name per line. Line comments may be introduced by the hash 1125 character. This option may be given more than once. 1126 1127 `--localize-symbols=FILENAME' 1128 Apply `--localize-symbol' option to each symbol listed in the file 1129 FILENAME. FILENAME is simply a flat file, with one symbol name 1130 per line. Line comments may be introduced by the hash character. 1131 This option may be given more than once. 1132 1133 `--globalize-symbols=FILENAME' 1134 Apply `--globalize-symbol' option to each symbol listed in the file 1135 FILENAME. FILENAME is simply a flat file, with one symbol name 1136 per line. Line comments may be introduced by the hash character. 1137 This option may be given more than once. 1138 1139 `--weaken-symbols=FILENAME' 1140 Apply `--weaken-symbol' option to each symbol listed in the file 1141 FILENAME. FILENAME is simply a flat file, with one symbol name 1142 per line. Line comments may be introduced by the hash character. 1143 This option may be given more than once. 1144 1145 `--alt-machine-code=INDEX' 1146 If the output architecture has alternate machine codes, use the 1147 INDEXth code instead of the default one. This is useful in case a 1148 machine is assigned an official code and the tool-chain adopts the 1149 new code, but other applications still depend on the original code 1150 being used. For ELF based architectures if the INDEX alternative 1151 does not exist then the value is treated as an absolute number to 1152 be stored in the e_machine field of the ELF header. 1153 1154 `--writable-text' 1155 Mark the output text as writable. This option isn't meaningful 1156 for all object file formats. 1157 1158 `--readonly-text' 1159 Make the output text write protected. This option isn't 1160 meaningful for all object file formats. 1161 1162 `--pure' 1163 Mark the output file as demand paged. This option isn't 1164 meaningful for all object file formats. 1165 1166 `--impure' 1167 Mark the output file as impure. This option isn't meaningful for 1168 all object file formats. 1169 1170 `--prefix-symbols=STRING' 1171 Prefix all symbols in the output file with STRING. 1172 1173 `--prefix-sections=STRING' 1174 Prefix all section names in the output file with STRING. 1175 1176 `--prefix-alloc-sections=STRING' 1177 Prefix all the names of all allocated sections in the output file 1178 with STRING. 1179 1180 `--add-gnu-debuglink=PATH-TO-FILE' 1181 Creates a .gnu_debuglink section which contains a reference to 1182 PATH-TO-FILE and adds it to the output file. 1183 1184 `--keep-file-symbols' 1185 When stripping a file, perhaps with `--strip-debug' or 1186 `--strip-unneeded', retain any symbols specifying source file 1187 names, which would otherwise get stripped. 1188 1189 `--only-keep-debug' 1190 Strip a file, removing contents of any sections that would not be 1191 stripped by `--strip-debug' and leaving the debugging sections 1192 intact. 1193 1194 The intention is that this option will be used in conjunction with 1195 `--add-gnu-debuglink' to create a two part executable. One a 1196 stripped binary which will occupy less space in RAM and in a 1197 distribution and the second a debugging information file which is 1198 only needed if debugging abilities are required. The suggested 1199 procedure to create these files is as follows: 1200 1201 1. Link the executable as normal. Assuming that is is called 1202 `foo' then... 1203 1204 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file 1205 containing the debugging info. 1206 1207 3. Run `objcopy --strip-debug foo' to create a stripped 1208 executable. 1209 1210 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link 1211 to the debugging info into the stripped executable. 1212 1213 Note - the choice of `.dbg' as an extension for the debug info 1214 file is arbitrary. Also the `--only-keep-debug' step is optional. 1215 You could instead do this: 1216 1217 1. Link the executable as normal. 1218 1219 2. Copy `foo' to `foo.full' 1220 1221 3. Run `objcopy --strip-debug foo' 1222 1223 4. Run `objcopy --add-gnu-debuglink=foo.full foo' 1224 1225 i.e. the file pointed to by the `--add-gnu-debuglink' can be the 1226 full executable. It does not have to be a file created by the 1227 `--only-keep-debug' switch. 1228 1229 `-V' 1230 `--version' 1231 Show the version number of `objcopy'. 1232 1233 `-v' 1234 `--verbose' 1235 Verbose output: list all object files modified. In the case of 1236 archives, `objcopy -V' lists all members of the archive. 1237 1238 `--help' 1239 Show a summary of the options to `objcopy'. 1240 1241 `--info' 1242 Display a list showing all architectures and object formats 1243 available. 1244 1245 1246 File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top 1247 1248 4 objdump 1249 ********* 1250 1251 objdump [`-a'|`--archive-headers'] 1252 [`-b' BFDNAME|`--target=BFDNAME'] 1253 [`-C'|`--demangle'[=STYLE] ] 1254 [`-d'|`--disassemble'] 1255 [`-D'|`--disassemble-all'] 1256 [`-z'|`--disassemble-zeroes'] 1257 [`-EB'|`-EL'|`--endian='{big | little }] 1258 [`-f'|`--file-headers'] 1259 [`--file-start-context'] 1260 [`-g'|`--debugging'] 1261 [`-e'|`--debugging-tags'] 1262 [`-h'|`--section-headers'|`--headers'] 1263 [`-i'|`--info'] 1264 [`-j' SECTION|`--section='SECTION] 1265 [`-l'|`--line-numbers'] 1266 [`-S'|`--source'] 1267 [`-m' MACHINE|`--architecture='MACHINE] 1268 [`-M' OPTIONS|`--disassembler-options='OPTIONS] 1269 [`-p'|`--private-headers'] 1270 [`-r'|`--reloc'] 1271 [`-R'|`--dynamic-reloc'] 1272 [`-s'|`--full-contents'] 1273 [`-W'|`--dwarf'] 1274 [`-G'|`--stabs'] 1275 [`-t'|`--syms'] 1276 [`-T'|`--dynamic-syms'] 1277 [`-x'|`--all-headers'] 1278 [`-w'|`--wide'] 1279 [`--start-address='ADDRESS] 1280 [`--stop-address='ADDRESS] 1281 [`--prefix-addresses'] 1282 [`--[no-]show-raw-insn'] 1283 [`--adjust-vma='OFFSET] 1284 [`--special-syms'] 1285 [`-V'|`--version'] 1286 [`-H'|`--help'] 1287 OBJFILE... 1288 1289 `objdump' displays information about one or more object files. The 1290 options control what particular information to display. This 1291 information is mostly useful to programmers who are working on the 1292 compilation tools, as opposed to programmers who just want their 1293 program to compile and work. 1294 1295 OBJFILE... are the object files to be examined. When you specify 1296 archives, `objdump' shows information on each of the member object 1297 files. 1298 1299 The long and short forms of options, shown here as alternatives, are 1300 equivalent. At least one option from the list 1301 `-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x' must be given. 1302 1303 `-a' 1304 `--archive-header' 1305 If any of the OBJFILE files are archives, display the archive 1306 header information (in a format similar to `ls -l'). Besides the 1307 information you could list with `ar tv', `objdump -a' shows the 1308 object file format of each archive member. 1309 1310 `--adjust-vma=OFFSET' 1311 When dumping information, first add OFFSET to all the section 1312 addresses. This is useful if the section addresses do not 1313 correspond to the symbol table, which can happen when putting 1314 sections at particular addresses when using a format which can not 1315 represent section addresses, such as a.out. 1316 1317 `-b BFDNAME' 1318 `--target=BFDNAME' 1319 Specify that the object-code format for the object files is 1320 BFDNAME. This option may not be necessary; OBJDUMP can 1321 automatically recognize many formats. 1322 1323 For example, 1324 objdump -b oasys -m vax -h fu.o 1325 displays summary information from the section headers (`-h') of 1326 `fu.o', which is explicitly identified (`-m') as a VAX object file 1327 in the format produced by Oasys compilers. You can list the 1328 formats available with the `-i' option. *Note Target Selection::, 1329 for more information. 1330 1331 `-C' 1332 `--demangle[=STYLE]' 1333 Decode ("demangle") low-level symbol names into user-level names. 1334 Besides removing any initial underscore prepended by the system, 1335 this makes C++ function names readable. Different compilers have 1336 different mangling styles. The optional demangling style argument 1337 can be used to choose an appropriate demangling style for your 1338 compiler. *Note c++filt::, for more information on demangling. 1339 1340 `-g' 1341 `--debugging' 1342 Display debugging information. This attempts to parse debugging 1343 information stored in the file and print it out using a C like 1344 syntax. Only certain types of debugging information have been 1345 implemented. Some other types are supported by `readelf -w'. 1346 *Note readelf::. 1347 1348 `-e' 1349 `--debugging-tags' 1350 Like `-g', but the information is generated in a format compatible 1351 with ctags tool. 1352 1353 `-d' 1354 `--disassemble' 1355 Display the assembler mnemonics for the machine instructions from 1356 OBJFILE. This option only disassembles those sections which are 1357 expected to contain instructions. 1358 1359 `-D' 1360 `--disassemble-all' 1361 Like `-d', but disassemble the contents of all sections, not just 1362 those expected to contain instructions. 1363 1364 `--prefix-addresses' 1365 When disassembling, print the complete address on each line. This 1366 is the older disassembly format. 1367 1368 `-EB' 1369 `-EL' 1370 `--endian={big|little}' 1371 Specify the endianness of the object files. This only affects 1372 disassembly. This can be useful when disassembling a file format 1373 which does not describe endianness information, such as S-records. 1374 1375 `-f' 1376 `--file-headers' 1377 Display summary information from the overall header of each of the 1378 OBJFILE files. 1379 1380 `--file-start-context' 1381 Specify that when displaying interlisted source code/disassembly 1382 (assumes `-S') from a file that has not yet been displayed, extend 1383 the context to the start of the file. 1384 1385 `-h' 1386 `--section-headers' 1387 `--headers' 1388 Display summary information from the section headers of the object 1389 file. 1390 1391 File segments may be relocated to nonstandard addresses, for 1392 example by using the `-Ttext', `-Tdata', or `-Tbss' options to 1393 `ld'. However, some object file formats, such as a.out, do not 1394 store the starting address of the file segments. In those 1395 situations, although `ld' relocates the sections correctly, using 1396 `objdump -h' to list the file section headers cannot show the 1397 correct addresses. Instead, it shows the usual addresses, which 1398 are implicit for the target. 1399 1400 `-H' 1401 `--help' 1402 Print a summary of the options to `objdump' and exit. 1403 1404 `-i' 1405 `--info' 1406 Display a list showing all architectures and object formats 1407 available for specification with `-b' or `-m'. 1408 1409 `-j NAME' 1410 `--section=NAME' 1411 Display information only for section NAME. 1412 1413 `-l' 1414 `--line-numbers' 1415 Label the display (using debugging information) with the filename 1416 and source line numbers corresponding to the object code or relocs 1417 shown. Only useful with `-d', `-D', or `-r'. 1418 1419 `-m MACHINE' 1420 `--architecture=MACHINE' 1421 Specify the architecture to use when disassembling object files. 1422 This can be useful when disassembling object files which do not 1423 describe architecture information, such as S-records. You can 1424 list the available architectures with the `-i' option. 1425 1426 `-M OPTIONS' 1427 `--disassembler-options=OPTIONS' 1428 Pass target specific information to the disassembler. Only 1429 supported on some targets. If it is necessary to specify more 1430 than one disassembler option then multiple `-M' options can be 1431 used or can be placed together into a comma separated list. 1432 1433 If the target is an ARM architecture then this switch can be used 1434 to select which register name set is used during disassembler. 1435 Specifying `-M reg-names-std' (the default) will select the 1436 register names as used in ARM's instruction set documentation, but 1437 with register 13 called 'sp', register 14 called 'lr' and register 1438 15 called 'pc'. Specifying `-M reg-names-apcs' will select the 1439 name set used by the ARM Procedure Call Standard, whilst 1440 specifying `-M reg-names-raw' will just use `r' followed by the 1441 register number. 1442 1443 There are also two variants on the APCS register naming scheme 1444 enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs' 1445 which use the ARM/Thumb Procedure Call Standard naming 1446 conventions. (Either with the normal register names or the 1447 special register names). 1448 1449 This option can also be used for ARM architectures to force the 1450 disassembler to interpret all instructions as Thumb instructions by 1451 using the switch `--disassembler-options=force-thumb'. This can be 1452 useful when attempting to disassemble thumb code produced by other 1453 compilers. 1454 1455 For the x86, some of the options duplicate functions of the `-m' 1456 switch, but allow finer grained control. Multiple selections from 1457 the following may be specified as a comma separated string. 1458 `x86-64', `i386' and `i8086' select disassembly for the given 1459 architecture. `intel' and `att' select between intel syntax mode 1460 and AT&T syntax mode. `addr32', `addr16', `data32' and `data16' 1461 specify the default address size and operand size. These four 1462 options will be overridden if `x86-64', `i386' or `i8086' appear 1463 later in the option string. Lastly, `suffix', when in AT&T mode, 1464 instructs the disassembler to print a mnemonic suffix even when the 1465 suffix could be inferred by the operands. 1466 1467 For PPC, `booke', `booke32' and `booke64' select disassembly of 1468 BookE instructions. `32' and `64' select PowerPC and PowerPC64 1469 disassembly, respectively. `e300' selects disassembly for the 1470 e300 family. 1471 1472 For MIPS, this option controls the printing of instruction 1473 mneumonic names and register names in disassembled instructions. 1474 Multiple selections from the following may be specified as a comma 1475 separated string, and invalid options are ignored: 1476 1477 `no-aliases' 1478 Print the 'raw' instruction mneumonic instead of some pseudo 1479 instruction mneumonic. I.E. print 'daddu' or 'or' instead of 1480 'move', 'sll' instead of 'nop', etc. 1481 1482 `gpr-names=ABI' 1483 Print GPR (general-purpose register) names as appropriate for 1484 the specified ABI. By default, GPR names are selected 1485 according to the ABI of the binary being disassembled. 1486 1487 `fpr-names=ABI' 1488 Print FPR (floating-point register) names as appropriate for 1489 the specified ABI. By default, FPR numbers are printed 1490 rather than names. 1491 1492 `cp0-names=ARCH' 1493 Print CP0 (system control coprocessor; coprocessor 0) 1494 register names as appropriate for the CPU or architecture 1495 specified by ARCH. By default, CP0 register names are 1496 selected according to the architecture and CPU of the binary 1497 being disassembled. 1498 1499 `hwr-names=ARCH' 1500 Print HWR (hardware register, used by the `rdhwr' 1501 instruction) names as appropriate for the CPU or architecture 1502 specified by ARCH. By default, HWR names are selected 1503 according to the architecture and CPU of the binary being 1504 disassembled. 1505 1506 `reg-names=ABI' 1507 Print GPR and FPR names as appropriate for the selected ABI. 1508 1509 `reg-names=ARCH' 1510 Print CPU-specific register names (CP0 register and HWR names) 1511 as appropriate for the selected CPU or architecture. 1512 1513 For any of the options listed above, ABI or ARCH may be specified 1514 as `numeric' to have numbers printed rather than names, for the 1515 selected types of registers. You can list the available values of 1516 ABI and ARCH using the `--help' option. 1517 1518 For VAX, you can specify function entry addresses with `-M 1519 entry:0xf00ba'. You can use this multiple times to properly 1520 disassemble VAX binary files that don't contain symbol tables (like 1521 ROM dumps). In these cases, the function entry mask would 1522 otherwise be decoded as VAX instructions, which would probably 1523 lead the the rest of the function being wrongly disassembled. 1524 1525 `-p' 1526 `--private-headers' 1527 Print information that is specific to the object file format. The 1528 exact information printed depends upon the object file format. 1529 For some object file formats, no additional information is printed. 1530 1531 `-r' 1532 `--reloc' 1533 Print the relocation entries of the file. If used with `-d' or 1534 `-D', the relocations are printed interspersed with the 1535 disassembly. 1536 1537 `-R' 1538 `--dynamic-reloc' 1539 Print the dynamic relocation entries of the file. This is only 1540 meaningful for dynamic objects, such as certain types of shared 1541 libraries. 1542 1543 `-s' 1544 `--full-contents' 1545 Display the full contents of any sections requested. By default 1546 all non-empty sections are displayed. 1547 1548 `-S' 1549 `--source' 1550 Display source code intermixed with disassembly, if possible. 1551 Implies `-d'. 1552 1553 `--show-raw-insn' 1554 When disassembling instructions, print the instruction in hex as 1555 well as in symbolic form. This is the default except when 1556 `--prefix-addresses' is used. 1557 1558 `--no-show-raw-insn' 1559 When disassembling instructions, do not print the instruction 1560 bytes. This is the default when `--prefix-addresses' is used. 1561 1562 `-W' 1563 `--dwarf' 1564 Displays the contents of the DWARF debug sections in the file, if 1565 any are present. 1566 1567 `-G' 1568 `--stabs' 1569 Display the full contents of any sections requested. Display the 1570 contents of the .stab and .stab.index and .stab.excl sections from 1571 an ELF file. This is only useful on systems (such as Solaris 2.0) 1572 in which `.stab' debugging symbol-table entries are carried in an 1573 ELF section. In most other file formats, debugging symbol-table 1574 entries are interleaved with linkage symbols, and are visible in 1575 the `--syms' output. For more information on stabs symbols, see 1576 *Note Stabs: (stabs.info)Top. 1577 1578 `--start-address=ADDRESS' 1579 Start displaying data at the specified address. This affects the 1580 output of the `-d', `-r' and `-s' options. 1581 1582 `--stop-address=ADDRESS' 1583 Stop displaying data at the specified address. This affects the 1584 output of the `-d', `-r' and `-s' options. 1585 1586 `-t' 1587 `--syms' 1588 Print the symbol table entries of the file. This is similar to 1589 the information provided by the `nm' program. 1590 1591 `-T' 1592 `--dynamic-syms' 1593 Print the dynamic symbol table entries of the file. This is only 1594 meaningful for dynamic objects, such as certain types of shared 1595 libraries. This is similar to the information provided by the `nm' 1596 program when given the `-D' (`--dynamic') option. 1597 1598 `--special-syms' 1599 When displaying symbols include those which the target considers 1600 to be special in some way and which would not normally be of 1601 interest to the user. 1602 1603 `-V' 1604 `--version' 1605 Print the version number of `objdump' and exit. 1606 1607 `-x' 1608 `--all-headers' 1609 Display all available header information, including the symbol 1610 table and relocation entries. Using `-x' is equivalent to 1611 specifying all of `-a -f -h -p -r -t'. 1612 1613 `-w' 1614 `--wide' 1615 Format some lines for output devices that have more than 80 1616 columns. Also do not truncate symbol names when they are 1617 displayed. 1618 1619 `-z' 1620 `--disassemble-zeroes' 1621 Normally the disassembly output will skip blocks of zeroes. This 1622 option directs the disassembler to disassemble those blocks, just 1623 like any other data. 1624 1625 1626 File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top 1627 1628 5 ranlib 1629 ******** 1630 1631 ranlib [`-vV'] ARCHIVE 1632 1633 `ranlib' generates an index to the contents of an archive and stores 1634 it in the archive. The index lists each symbol defined by a member of 1635 an archive that is a relocatable object file. 1636 1637 You may use `nm -s' or `nm --print-armap' to list this index. 1638 1639 An archive with such an index speeds up linking to the library and 1640 allows routines in the library to call each other without regard to 1641 their placement in the archive. 1642 1643 The GNU `ranlib' program is another form of GNU `ar'; running 1644 `ranlib' is completely equivalent to executing `ar -s'. *Note ar::. 1645 1646 `-v' 1647 `-V' 1648 `--version' 1649 Show the version number of `ranlib'. 1650 1651 1652 File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top 1653 1654 6 size 1655 ****** 1656 1657 size [`-A'|`-B'|`--format='COMPATIBILITY] 1658 [`--help'] 1659 [`-d'|`-o'|`-x'|`--radix='NUMBER] 1660 [`-t'|`--totals'] 1661 [`--target='BFDNAME] [`-V'|`--version'] 1662 [OBJFILE...] 1663 1664 The GNU `size' utility lists the section sizes--and the total 1665 size--for each of the object or archive files OBJFILE in its argument 1666 list. By default, one line of output is generated for each object file 1667 or each module in an archive. 1668 1669 OBJFILE... are the object files to be examined. If none are 1670 specified, the file `a.out' will be used. 1671 1672 The command line options have the following meanings: 1673 1674 `-A' 1675 `-B' 1676 `--format=COMPATIBILITY' 1677 Using one of these options, you can choose whether the output from 1678 GNU `size' resembles output from System V `size' (using `-A', or 1679 `--format=sysv'), or Berkeley `size' (using `-B', or 1680 `--format=berkeley'). The default is the one-line format similar 1681 to Berkeley's. 1682 1683 Here is an example of the Berkeley (default) format of output from 1684 `size': 1685 $ size --format=Berkeley ranlib size 1686 text data bss dec hex filename 1687 294880 81920 11592 388392 5ed28 ranlib 1688 294880 81920 11888 388688 5ee50 size 1689 1690 This is the same data, but displayed closer to System V 1691 conventions: 1692 1693 $ size --format=SysV ranlib size 1694 ranlib : 1695 section size addr 1696 .text 294880 8192 1697 .data 81920 303104 1698 .bss 11592 385024 1699 Total 388392 1700 1701 1702 size : 1703 section size addr 1704 .text 294880 8192 1705 .data 81920 303104 1706 .bss 11888 385024 1707 Total 388688 1708 1709 `--help' 1710 Show a summary of acceptable arguments and options. 1711 1712 `-d' 1713 `-o' 1714 `-x' 1715 `--radix=NUMBER' 1716 Using one of these options, you can control whether the size of 1717 each section is given in decimal (`-d', or `--radix=10'); octal 1718 (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). 1719 In `--radix=NUMBER', only the three values (8, 10, 16) are 1720 supported. The total size is always given in two radices; decimal 1721 and hexadecimal for `-d' or `-x' output, or octal and hexadecimal 1722 if you're using `-o'. 1723 1724 `-t' 1725 `--totals' 1726 Show totals of all objects listed (Berkeley format listing mode 1727 only). 1728 1729 `--target=BFDNAME' 1730 Specify that the object-code format for OBJFILE is BFDNAME. This 1731 option may not be necessary; `size' can automatically recognize 1732 many formats. *Note Target Selection::, for more information. 1733 1734 `-V' 1735 `--version' 1736 Display the version number of `size'. 1737 1738 1739 File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top 1740 1741 7 strings 1742 ********* 1743 1744 strings [`-afov'] [`-'MIN-LEN] 1745 [`-n' MIN-LEN] [`--bytes='MIN-LEN] 1746 [`-t' RADIX] [`--radix='RADIX] 1747 [`-e' ENCODING] [`--encoding='ENCODING] 1748 [`-'] [`--all'] [`--print-file-name'] 1749 [`--target='BFDNAME] 1750 [`--help'] [`--version'] FILE... 1751 1752 For each FILE given, GNU `strings' prints the printable character 1753 sequences that are at least 4 characters long (or the number given with 1754 the options below) and are followed by an unprintable character. By 1755 default, it only prints the strings from the initialized and loaded 1756 sections of object files; for other types of files, it prints the 1757 strings from the whole file. 1758 1759 `strings' is mainly useful for determining the contents of non-text 1760 files. 1761 1762 `-a' 1763 `--all' 1764 `-' 1765 Do not scan only the initialized and loaded sections of object 1766 files; scan the whole files. 1767 1768 `-f' 1769 `--print-file-name' 1770 Print the name of the file before each string. 1771 1772 `--help' 1773 Print a summary of the program usage on the standard output and 1774 exit. 1775 1776 `-MIN-LEN' 1777 `-n MIN-LEN' 1778 `--bytes=MIN-LEN' 1779 Print sequences of characters that are at least MIN-LEN characters 1780 long, instead of the default 4. 1781 1782 `-o' 1783 Like `-t o'. Some other versions of `strings' have `-o' act like 1784 `-t d' instead. Since we can not be compatible with both ways, we 1785 simply chose one. 1786 1787 `-t RADIX' 1788 `--radix=RADIX' 1789 Print the offset within the file before each string. The single 1790 character argument specifies the radix of the offset--`o' for 1791 octal, `x' for hexadecimal, or `d' for decimal. 1792 1793 `-e ENCODING' 1794 `--encoding=ENCODING' 1795 Select the character encoding of the strings that are to be found. 1796 Possible values for ENCODING are: `s' = single-7-bit-byte 1797 characters (ASCII, ISO 8859, etc., default), `S' = 1798 single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit 1799 littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian. 1800 Useful for finding wide character strings. 1801 1802 `--target=BFDNAME' 1803 Specify an object code format other than your system's default 1804 format. *Note Target Selection::, for more information. 1805 1806 `-v' 1807 `--version' 1808 Print the program version number on the standard output and exit. 1809 1810 1811 File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top 1812 1813 8 strip 1814 ******* 1815 1816 strip [`-F' BFDNAME |`--target='BFDNAME] 1817 [`-I' BFDNAME |`--input-target='BFDNAME] 1818 [`-O' BFDNAME |`--output-target='BFDNAME] 1819 [`-s'|`--strip-all'] 1820 [`-S'|`-g'|`-d'|`--strip-debug'] 1821 [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME] 1822 [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME] 1823 [`-w'|`--wildcard'] 1824 [`-x'|`--discard-all'] [`-X' |`--discard-locals'] 1825 [`-R' SECTIONNAME |`--remove-section='SECTIONNAME] 1826 [`-o' FILE] [`-p'|`--preserve-dates'] 1827 [`--keep-file-symbols'] 1828 [`--only-keep-debug'] 1829 [`-v' |`--verbose'] [`-V'|`--version'] 1830 [`--help'] [`--info'] 1831 OBJFILE... 1832 1833 GNU `strip' discards all symbols from object files OBJFILE. The 1834 list of object files may include archives. At least one object file 1835 must be given. 1836 1837 `strip' modifies the files named in its argument, rather than 1838 writing modified copies under different names. 1839 1840 `-F BFDNAME' 1841 `--target=BFDNAME' 1842 Treat the original OBJFILE as a file with the object code format 1843 BFDNAME, and rewrite it in the same format. *Note Target 1844 Selection::, for more information. 1845 1846 `--help' 1847 Show a summary of the options to `strip' and exit. 1848 1849 `--info' 1850 Display a list showing all architectures and object formats 1851 available. 1852 1853 `-I BFDNAME' 1854 `--input-target=BFDNAME' 1855 Treat the original OBJFILE as a file with the object code format 1856 BFDNAME. *Note Target Selection::, for more information. 1857 1858 `-O BFDNAME' 1859 `--output-target=BFDNAME' 1860 Replace OBJFILE with a file in the output format BFDNAME. *Note 1861 Target Selection::, for more information. 1862 1863 `-R SECTIONNAME' 1864 `--remove-section=SECTIONNAME' 1865 Remove any section named SECTIONNAME from the output file. This 1866 option may be given more than once. Note that using this option 1867 inappropriately may make the output file unusable. 1868 1869 `-s' 1870 `--strip-all' 1871 Remove all symbols. 1872 1873 `-g' 1874 `-S' 1875 `-d' 1876 `--strip-debug' 1877 Remove debugging symbols only. 1878 1879 `--strip-unneeded' 1880 Remove all symbols that are not needed for relocation processing. 1881 1882 `-K SYMBOLNAME' 1883 `--keep-symbol=SYMBOLNAME' 1884 When stripping symbols, keep symbol SYMBOLNAME even if it would 1885 normally be stripped. This option may be given more than once. 1886 1887 `-N SYMBOLNAME' 1888 `--strip-symbol=SYMBOLNAME' 1889 Remove symbol SYMBOLNAME from the source file. This option may be 1890 given more than once, and may be combined with strip options other 1891 than `-K'. 1892 1893 `-o FILE' 1894 Put the stripped output in FILE, rather than replacing the 1895 existing file. When this argument is used, only one OBJFILE 1896 argument may be specified. 1897 1898 `-p' 1899 `--preserve-dates' 1900 Preserve the access and modification dates of the file. 1901 1902 `-w' 1903 `--wildcard' 1904 Permit regular expressions in SYMBOLNAMEs used in other command 1905 line options. The question mark (?), asterisk (*), backslash (\) 1906 and square brackets ([]) operators can be used anywhere in the 1907 symbol name. If the first character of the symbol name is the 1908 exclamation point (!) then the sense of the switch is reversed for 1909 that symbol. For example: 1910 1911 -w -K !foo -K fo* 1912 1913 would cause strip to only keep symbols that start with the letters 1914 "fo", but to discard the symbol "foo". 1915 1916 `-x' 1917 `--discard-all' 1918 Remove non-global symbols. 1919 1920 `-X' 1921 `--discard-locals' 1922 Remove compiler-generated local symbols. (These usually start 1923 with `L' or `.'.) 1924 1925 `--keep-file-symbols' 1926 When stripping a file, perhaps with `--strip-debug' or 1927 `--strip-unneeded', retain any symbols specifying source file 1928 names, which would otherwise get stripped. 1929 1930 `--only-keep-debug' 1931 Strip a file, removing any sections that would be stripped by 1932 `--strip-debug' and leaving the debugging sections. 1933 1934 The intention is that this option will be used in conjunction with 1935 `--add-gnu-debuglink' to create a two part executable. One a 1936 stripped binary which will occupy less space in RAM and in a 1937 distribution and the second a debugging information file which is 1938 only needed if debugging abilities are required. The suggested 1939 procedure to create these files is as follows: 1940 1941 1. Link the executable as normal. Assuming that is is called 1942 `foo' then... 1943 1944 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file 1945 containing the debugging info. 1946 1947 3. Run `objcopy --strip-debug foo' to create a stripped 1948 executable. 1949 1950 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link 1951 to the debugging info into the stripped executable. 1952 1953 Note - the choice of `.dbg' as an extension for the debug info 1954 file is arbitrary. Also the `--only-keep-debug' step is optional. 1955 You could instead do this: 1956 1957 1. Link the executable as normal. 1958 1959 2. Copy `foo' to `foo.full' 1960 1961 3. Run `strip --strip-debug foo' 1962 1963 4. Run `objcopy --add-gnu-debuglink=foo.full foo' 1964 1965 ie the file pointed to by the `--add-gnu-debuglink' can be the 1966 full executable. It does not have to be a file created by the 1967 `--only-keep-debug' switch. 1968 1969 `-V' 1970 `--version' 1971 Show the version number for `strip'. 1972 1973 `-v' 1974 `--verbose' 1975 Verbose output: list all object files modified. In the case of 1976 archives, `strip -v' lists all members of the archive. 1977 1978 1979 File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top 1980 1981 9 c++filt 1982 ********* 1983 1984 c++filt [`-_'|`--strip-underscores'] 1985 [`-n'|`--no-strip-underscores'] 1986 [`-p'|`--no-params'] 1987 [`-t'|`--types'] 1988 [`-i'|`--no-verbose'] 1989 [`-s' FORMAT|`--format='FORMAT] 1990 [`--help'] [`--version'] [SYMBOL...] 1991 1992 The C++ and Java languages provide function overloading, which means 1993 that you can write many functions with the same name, providing that 1994 each function takes parameters of different types. In order to be able 1995 to distinguish these similarly named functions C++ and Java encode them 1996 into a low-level assembler name which uniquely identifies each 1997 different version. This process is known as "mangling". The `c++filt' 1998 (1) program does the inverse mapping: it decodes ("demangles") low-level 1999 names into user-level names so that they can be read. 2000 2001 Every alphanumeric word (consisting of letters, digits, underscores, 2002 dollars, or periods) seen in the input is a potential mangled name. If 2003 the name decodes into a C++ name, the C++ name replaces the low-level 2004 name in the output, otherwise the original word is output. In this way 2005 you can pass an entire assembler source file, containing mangled names, 2006 through `c++filt' and see the same source file containing demangled 2007 names. 2008 2009 You can also use `c++filt' to decipher individual symbols by passing 2010 them on the command line: 2011 2012 c++filt SYMBOL 2013 2014 If no SYMBOL arguments are given, `c++filt' reads symbol names from 2015 the standard input instead. All the results are printed on the 2016 standard output. The difference between reading names from the command 2017 line versus reading names from the standard input is that command line 2018 arguments are expected to be just mangled names and no checking is 2019 performed to seperate them from surrounding text. Thus for example: 2020 2021 c++filt -n _Z1fv 2022 2023 will work and demangle the name to "f()" whereas: 2024 2025 c++filt -n _Z1fv, 2026 2027 will not work. (Note the extra comma at the end of the mangled name 2028 which makes it invalid). This command however will work: 2029 2030 echo _Z1fv, | c++filt -n 2031 2032 and will display "f()," ie the demangled name followed by a trailing 2033 comma. This behaviour is because when the names are read from the 2034 standard input it is expected that they might be part of an assembler 2035 source file where there might be extra, extraneous characters trailing 2036 after a mangled name. eg: 2037 2038 .type _Z1fv, @function 2039 2040 `-_' 2041 `--strip-underscores' 2042 On some systems, both the C and C++ compilers put an underscore in 2043 front of every name. For example, the C name `foo' gets the 2044 low-level name `_foo'. This option removes the initial 2045 underscore. Whether `c++filt' removes the underscore by default 2046 is target dependent. 2047 2048 `-j' 2049 `--java' 2050 Prints demangled names using Java syntax. The default is to use 2051 C++ syntax. 2052 2053 `-n' 2054 `--no-strip-underscores' 2055 Do not remove the initial underscore. 2056 2057 `-p' 2058 `--no-params' 2059 When demangling the name of a function, do not display the types of 2060 the function's parameters. 2061 2062 `-t' 2063 `--types' 2064 Attempt to demangle types as well as function names. This is 2065 disabled by default since mangled types are normally only used 2066 internally in the compiler, and they can be confused with 2067 non-mangled names. eg a function called "a" treated as a mangled 2068 type name would be demangled to "signed char". 2069 2070 `-i' 2071 `--no-verbose' 2072 Do not include implementation details (if any) in the demangled 2073 output. 2074 2075 `-s FORMAT' 2076 `--format=FORMAT' 2077 `c++filt' can decode various methods of mangling, used by 2078 different compilers. The argument to this option selects which 2079 method it uses: 2080 2081 `auto' 2082 Automatic selection based on executable (the default method) 2083 2084 `gnu' 2085 the one used by the GNU C++ compiler (g++) 2086 2087 `lucid' 2088 the one used by the Lucid compiler (lcc) 2089 2090 `arm' 2091 the one specified by the C++ Annotated Reference Manual 2092 2093 `hp' 2094 the one used by the HP compiler (aCC) 2095 2096 `edg' 2097 the one used by the EDG compiler 2098 2099 `gnu-v3' 2100 the one used by the GNU C++ compiler (g++) with the V3 ABI. 2101 2102 `java' 2103 the one used by the GNU Java compiler (gcj) 2104 2105 `gnat' 2106 the one used by the GNU Ada compiler (GNAT). 2107 2108 `--help' 2109 Print a summary of the options to `c++filt' and exit. 2110 2111 `--version' 2112 Print the version number of `c++filt' and exit. 2113 2114 _Warning:_ `c++filt' is a new utility, and the details of its user 2115 interface are subject to change in future releases. In particular, 2116 a command-line option may be required in the the future to decode 2117 a name passed as an argument on the command line; in other words, 2118 2119 c++filt SYMBOL 2120 2121 may in a future release become 2122 2123 c++filt OPTION SYMBOL 2124 2125 ---------- Footnotes ---------- 2126 2127 (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS 2128 this program is named `CXXFILT'. 2129 2130 2131 File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top 2132 2133 10 addr2line 2134 ************ 2135 2136 addr2line [`-b' BFDNAME|`--target='BFDNAME] 2137 [`-C'|`--demangle'[=STYLE]] 2138 [`-e' FILENAME|`--exe='FILENAME] 2139 [`-f'|`--functions'] [`-s'|`--basename'] 2140 [`-i'|`--inlines'] 2141 [`-j'|`--section='NAME] 2142 [`-H'|`--help'] [`-V'|`--version'] 2143 [addr addr ...] 2144 2145 `addr2line' translates addresses into file names and line numbers. 2146 Given an address in an executable or an offset in a section of a 2147 relocatable object, it uses the debugging information to figure out 2148 which file name and line number are associated with it. 2149 2150 The executable or relocatable object to use is specified with the 2151 `-e' option. The default is the file `a.out'. The section in the 2152 relocatable object to use is specified with the `-j' option. 2153 2154 `addr2line' has two modes of operation. 2155 2156 In the first, hexadecimal addresses are specified on the command 2157 line, and `addr2line' displays the file name and line number for each 2158 address. 2159 2160 In the second, `addr2line' reads hexadecimal addresses from standard 2161 input, and prints the file name and line number for each address on 2162 standard output. In this mode, `addr2line' may be used in a pipe to 2163 convert dynamically chosen addresses. 2164 2165 The format of the output is `FILENAME:LINENO'. The file name and 2166 line number for each address is printed on a separate line. If the 2167 `-f' option is used, then each `FILENAME:LINENO' line is preceded by a 2168 `FUNCTIONNAME' line which is the name of the function containing the 2169 address. 2170 2171 If the file name or function name can not be determined, `addr2line' 2172 will print two question marks in their place. If the line number can 2173 not be determined, `addr2line' will print 0. 2174 2175 The long and short forms of options, shown here as alternatives, are 2176 equivalent. 2177 2178 `-b BFDNAME' 2179 `--target=BFDNAME' 2180 Specify that the object-code format for the object files is 2181 BFDNAME. 2182 2183 `-C' 2184 `--demangle[=STYLE]' 2185 Decode ("demangle") low-level symbol names into user-level names. 2186 Besides removing any initial underscore prepended by the system, 2187 this makes C++ function names readable. Different compilers have 2188 different mangling styles. The optional demangling style argument 2189 can be used to choose an appropriate demangling style for your 2190 compiler. *Note c++filt::, for more information on demangling. 2191 2192 `-e FILENAME' 2193 `--exe=FILENAME' 2194 Specify the name of the executable for which addresses should be 2195 translated. The default file is `a.out'. 2196 2197 `-f' 2198 `--functions' 2199 Display function names as well as file and line number information. 2200 2201 `-s' 2202 `--basenames' 2203 Display only the base of each file name. 2204 2205 `-i' 2206 `--inlines' 2207 If the address belongs to a function that was inlined, the source 2208 information for all enclosing scopes back to the first non-inlined 2209 function will also be printed. For example, if `main' inlines 2210 `callee1' which inlines `callee2', and address is from `callee2', 2211 the source information for `callee1' and `main' will also be 2212 printed. 2213 2214 `-j' 2215 `--section' 2216 Read offsets relative to the specified section instead of absolute 2217 addresses. 2218 2219 2220 File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top 2221 2222 11 nlmconv 2223 ********** 2224 2225 `nlmconv' converts a relocatable object file into a NetWare Loadable 2226 Module. 2227 2228 _Warning:_ `nlmconv' is not always built as part of the binary 2229 utilities, since it is only useful for NLM targets. 2230 2231 nlmconv [`-I' BFDNAME|`--input-target='BFDNAME] 2232 [`-O' BFDNAME|`--output-target='BFDNAME] 2233 [`-T' HEADERFILE|`--header-file='HEADERFILE] 2234 [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER] 2235 [`-h'|`--help'] [`-V'|`--version'] 2236 INFILE OUTFILE 2237 2238 `nlmconv' converts the relocatable `i386' object file INFILE into 2239 the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for 2240 NLM header information. For instructions on writing the NLM command 2241 file language used in header files, see the `linkers' section, 2242 `NLMLINK' in particular, of the `NLM Development and Tools Overview', 2243 which is part of the NLM Software Developer's Kit ("NLM SDK"), 2244 available from Novell, Inc. `nlmconv' uses the GNU Binary File 2245 Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for 2246 more information. 2247 2248 `nlmconv' can perform a link step. In other words, you can list 2249 more than one object file for input if you list them in the definitions 2250 file (rather than simply specifying one input file on the command line). 2251 In this case, `nlmconv' calls the linker for you. 2252 2253 `-I BFDNAME' 2254 `--input-target=BFDNAME' 2255 Object format of the input file. `nlmconv' can usually determine 2256 the format of a given file (so no default is necessary). *Note 2257 Target Selection::, for more information. 2258 2259 `-O BFDNAME' 2260 `--output-target=BFDNAME' 2261 Object format of the output file. `nlmconv' infers the output 2262 format based on the input format, e.g. for a `i386' input file the 2263 output format is `nlm32-i386'. *Note Target Selection::, for more 2264 information. 2265 2266 `-T HEADERFILE' 2267 `--header-file=HEADERFILE' 2268 Reads HEADERFILE for NLM header information. For instructions on 2269 writing the NLM command file language used in header files, see 2270 see the `linkers' section, of the `NLM Development and Tools 2271 Overview', which is part of the NLM Software Developer's Kit, 2272 available from Novell, Inc. 2273 2274 `-d' 2275 `--debug' 2276 Displays (on standard error) the linker command line used by 2277 `nlmconv'. 2278 2279 `-l LINKER' 2280 `--linker=LINKER' 2281 Use LINKER for any linking. LINKER can be an absolute or a 2282 relative pathname. 2283 2284 `-h' 2285 `--help' 2286 Prints a usage summary. 2287 2288 `-V' 2289 `--version' 2290 Prints the version number for `nlmconv'. 2291 2292 2293 File: binutils.info, Node: windres, Next: dlltool, Prev: nlmconv, Up: Top 2294 2295 12 windres 2296 ********** 2297 2298 `windres' may be used to manipulate Windows resources. 2299 2300 _Warning:_ `windres' is not always built as part of the binary 2301 utilities, since it is only useful for Windows targets. 2302 2303 windres [options] [input-file] [output-file] 2304 2305 `windres' reads resources from an input file and copies them into an 2306 output file. Either file may be in one of three formats: 2307 2308 `rc' 2309 A text format read by the Resource Compiler. 2310 2311 `res' 2312 A binary format generated by the Resource Compiler. 2313 2314 `coff' 2315 A COFF object or executable. 2316 2317 The exact description of these different formats is available in 2318 documentation from Microsoft. 2319 2320 When `windres' converts from the `rc' format to the `res' format, it 2321 is acting like the Windows Resource Compiler. When `windres' converts 2322 from the `res' format to the `coff' format, it is acting like the 2323 Windows `CVTRES' program. 2324 2325 When `windres' generates an `rc' file, the output is similar but not 2326 identical to the format expected for the input. When an input `rc' 2327 file refers to an external filename, an output `rc' file will instead 2328 include the file contents. 2329 2330 If the input or output format is not specified, `windres' will guess 2331 based on the file name, or, for the input file, the file contents. A 2332 file with an extension of `.rc' will be treated as an `rc' file, a file 2333 with an extension of `.res' will be treated as a `res' file, and a file 2334 with an extension of `.o' or `.exe' will be treated as a `coff' file. 2335 2336 If no output file is specified, `windres' will print the resources 2337 in `rc' format to standard output. 2338 2339 The normal use is for you to write an `rc' file, use `windres' to 2340 convert it to a COFF object file, and then link the COFF file into your 2341 application. This will make the resources described in the `rc' file 2342 available to Windows. 2343 2344 `-i FILENAME' 2345 `--input FILENAME' 2346 The name of the input file. If this option is not used, then 2347 `windres' will use the first non-option argument as the input file 2348 name. If there are no non-option arguments, then `windres' will 2349 read from standard input. `windres' can not read a COFF file from 2350 standard input. 2351 2352 `-o FILENAME' 2353 `--output FILENAME' 2354 The name of the output file. If this option is not used, then 2355 `windres' will use the first non-option argument, after any used 2356 for the input file name, as the output file name. If there is no 2357 non-option argument, then `windres' will write to standard output. 2358 `windres' can not write a COFF file to standard output. Note, for 2359 compatability with `rc' the option `-fo' is also accepted, but its 2360 use is not recommended. 2361 2362 `-J FORMAT' 2363 `--input-format FORMAT' 2364 The input format to read. FORMAT may be `res', `rc', or `coff'. 2365 If no input format is specified, `windres' will guess, as 2366 described above. 2367 2368 `-O FORMAT' 2369 `--output-format FORMAT' 2370 The output format to generate. FORMAT may be `res', `rc', or 2371 `coff'. If no output format is specified, `windres' will guess, 2372 as described above. 2373 2374 `-F TARGET' 2375 `--target TARGET' 2376 Specify the BFD format to use for a COFF file as input or output. 2377 This is a BFD target name; you can use the `--help' option to see 2378 a list of supported targets. Normally `windres' will use the 2379 default format, which is the first one listed by the `--help' 2380 option. *Note Target Selection::. 2381 2382 `--preprocessor PROGRAM' 2383 When `windres' reads an `rc' file, it runs it through the C 2384 preprocessor first. This option may be used to specify the 2385 preprocessor to use, including any leading arguments. The default 2386 preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'. 2387 2388 `-I DIRECTORY' 2389 `--include-dir DIRECTORY' 2390 Specify an include directory to use when reading an `rc' file. 2391 `windres' will pass this to the preprocessor as an `-I' option. 2392 `windres' will also search this directory when looking for files 2393 named in the `rc' file. If the argument passed to this command 2394 matches any of the supported FORMATS (as descrived in the `-J' 2395 option), it will issue a deprecation warning, and behave just like 2396 the `-J' option. New programs should not use this behaviour. If a 2397 directory happens to match a FORMAT, simple prefix it with `./' to 2398 disable the backward compatibility. 2399 2400 `-D TARGET' 2401 `--define SYM[=VAL]' 2402 Specify a `-D' option to pass to the preprocessor when reading an 2403 `rc' file. 2404 2405 `-U TARGET' 2406 `--undefine SYM' 2407 Specify a `-U' option to pass to the preprocessor when reading an 2408 `rc' file. 2409 2410 `-r' 2411 Ignored for compatibility with rc. 2412 2413 `-v' 2414 Enable verbose mode. This tells you what the preprocessor is if 2415 you didn't specify one. 2416 2417 `-l VAL' 2418 2419 `--language VAL' 2420 Specify the default language to use when reading an `rc' file. 2421 VAL should be a hexadecimal language code. The low eight bits are 2422 the language, and the high eight bits are the sublanguage. 2423 2424 `--use-temp-file' 2425 Use a temporary file to instead of using popen to read the output 2426 of the preprocessor. Use this option if the popen implementation 2427 is buggy on the host (eg., certain non-English language versions 2428 of Windows 95 and Windows 98 are known to have buggy popen where 2429 the output will instead go the console). 2430 2431 `--no-use-temp-file' 2432 Use popen, not a temporary file, to read the output of the 2433 preprocessor. This is the default behaviour. 2434 2435 `-h' 2436 2437 `--help' 2438 Prints a usage summary. 2439 2440 `-V' 2441 2442 `--version' 2443 Prints the version number for `windres'. 2444 2445 `--yydebug' 2446 If `windres' is compiled with `YYDEBUG' defined as `1', this will 2447 turn on parser debugging. 2448 2449 2450 File: binutils.info, Node: dlltool, Next: Common Options, Prev: windres, Up: Top 2451 2452 13 dlltool 2453 ********** 2454 2455 `dlltool' is used to create the files needed to create dynamic link 2456 libraries (DLLs) on systems which understand PE format image files such 2457 as Windows. A DLL contains an export table which contains information 2458 that the runtime loader needs to resolve references from a referencing 2459 program. 2460 2461 The export table is generated by this program by reading in a `.def' 2462 file or scanning the `.a' and `.o' files which will be in the DLL. A 2463 `.o' file can contain information in special `.drectve' sections with 2464 export information. 2465 2466 _Note:_ `dlltool' is not always built as part of the binary 2467 utilities, since it is only useful for those targets which support 2468 DLLs. 2469 2470 dlltool [`-d'|`--input-def' DEF-FILE-NAME] 2471 [`-b'|`--base-file' BASE-FILE-NAME] 2472 [`-e'|`--output-exp' EXPORTS-FILE-NAME] 2473 [`-z'|`--output-def' DEF-FILE-NAME] 2474 [`-l'|`--output-lib' LIBRARY-FILE-NAME] 2475 [`--export-all-symbols'] [`--no-export-all-symbols'] 2476 [`--exclude-symbols' LIST] 2477 [`--no-default-excludes'] 2478 [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS] 2479 [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE] 2480 [`-a'|`--add-indirect'] 2481 [`-U'|`--add-underscore'] [`--add-stdcall-underscore'] 2482 [`-k'|`--kill-at'] [`-A'|`--add-stdcall-alias'] 2483 [`-p'|`--ext-prefix-alias' PREFIX] 2484 [`-x'|`--no-idata4'] [`-c'|`--no-idata5'] [`-i'|`--interwork'] 2485 [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX] 2486 [`-v'|`--verbose'] 2487 [`-h'|`--help'] [`-V'|`--version'] 2488 [object-file ...] 2489 2490 `dlltool' reads its inputs, which can come from the `-d' and `-b' 2491 options as well as object files specified on the command line. It then 2492 processes these inputs and if the `-e' option has been specified it 2493 creates a exports file. If the `-l' option has been specified it 2494 creates a library file and if the `-z' option has been specified it 2495 creates a def file. Any or all of the `-e', `-l' and `-z' options can 2496 be present in one invocation of dlltool. 2497 2498 When creating a DLL, along with the source for the DLL, it is 2499 necessary to have three other files. `dlltool' can help with the 2500 creation of these files. 2501 2502 The first file is a `.def' file which specifies which functions are 2503 exported from the DLL, which functions the DLL imports, and so on. This 2504 is a text file and can be created by hand, or `dlltool' can be used to 2505 create it using the `-z' option. In this case `dlltool' will scan the 2506 object files specified on its command line looking for those functions 2507 which have been specially marked as being exported and put entries for 2508 them in the `.def' file it creates. 2509 2510 In order to mark a function as being exported from a DLL, it needs to 2511 have an `-export:<name_of_function>' entry in the `.drectve' section of 2512 the object file. This can be done in C by using the asm() operator: 2513 2514 asm (".section .drectve"); 2515 asm (".ascii \"-export:my_func\""); 2516 2517 int my_func (void) { ... } 2518 2519 The second file needed for DLL creation is an exports file. This 2520 file is linked with the object files that make up the body of the DLL 2521 and it handles the interface between the DLL and the outside world. 2522 This is a binary file and it can be created by giving the `-e' option to 2523 `dlltool' when it is creating or reading in a `.def' file. 2524 2525 The third file needed for DLL creation is the library file that 2526 programs will link with in order to access the functions in the DLL. 2527 This file can be created by giving the `-l' option to dlltool when it 2528 is creating or reading in a `.def' file. 2529 2530 `dlltool' builds the library file by hand, but it builds the exports 2531 file by creating temporary files containing assembler statements and 2532 then assembling these. The `-S' command line option can be used to 2533 specify the path to the assembler that dlltool will use, and the `-f' 2534 option can be used to pass specific flags to that assembler. The `-n' 2535 can be used to prevent dlltool from deleting these temporary assembler 2536 files when it is done, and if `-n' is specified twice then this will 2537 prevent dlltool from deleting the temporary object files it used to 2538 build the library. 2539 2540 Here is an example of creating a DLL from a source file `dll.c' and 2541 also creating a program (from an object file called `program.o') that 2542 uses that DLL: 2543 2544 gcc -c dll.c 2545 dlltool -e exports.o -l dll.lib dll.o 2546 gcc dll.o exports.o -o dll.dll 2547 gcc program.o dll.lib -o program 2548 2549 The command line options have the following meanings: 2550 2551 `-d FILENAME' 2552 `--input-def FILENAME' 2553 Specifies the name of a `.def' file to be read in and processed. 2554 2555 `-b FILENAME' 2556 `--base-file FILENAME' 2557 Specifies the name of a base file to be read in and processed. The 2558 contents of this file will be added to the relocation section in 2559 the exports file generated by dlltool. 2560 2561 `-e FILENAME' 2562 `--output-exp FILENAME' 2563 Specifies the name of the export file to be created by dlltool. 2564 2565 `-z FILENAME' 2566 `--output-def FILENAME' 2567 Specifies the name of the `.def' file to be created by dlltool. 2568 2569 `-l FILENAME' 2570 `--output-lib FILENAME' 2571 Specifies the name of the library file to be created by dlltool. 2572 2573 `--export-all-symbols' 2574 Treat all global and weak defined symbols found in the input object 2575 files as symbols to be exported. There is a small list of symbols 2576 which are not exported by default; see the `--no-default-excludes' 2577 option. You may add to the list of symbols to not export by using 2578 the `--exclude-symbols' option. 2579 2580 `--no-export-all-symbols' 2581 Only export symbols explicitly listed in an input `.def' file or in 2582 `.drectve' sections in the input object files. This is the default 2583 behaviour. The `.drectve' sections are created by `dllexport' 2584 attributes in the source code. 2585 2586 `--exclude-symbols LIST' 2587 Do not export the symbols in LIST. This is a list of symbol names 2588 separated by comma or colon characters. The symbol names should 2589 not contain a leading underscore. This is only meaningful when 2590 `--export-all-symbols' is used. 2591 2592 `--no-default-excludes' 2593 When `--export-all-symbols' is used, it will by default avoid 2594 exporting certain special symbols. The current list of symbols to 2595 avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'. 2596 You may use the `--no-default-excludes' option to go ahead and 2597 export these special symbols. This is only meaningful when 2598 `--export-all-symbols' is used. 2599 2600 `-S PATH' 2601 `--as PATH' 2602 Specifies the path, including the filename, of the assembler to be 2603 used to create the exports file. 2604 2605 `-f OPTIONS' 2606 `--as-flags OPTIONS' 2607 Specifies any specific command line options to be passed to the 2608 assembler when building the exports file. This option will work 2609 even if the `-S' option is not used. This option only takes one 2610 argument, and if it occurs more than once on the command line, 2611 then later occurrences will override earlier occurrences. So if 2612 it is necessary to pass multiple options to the assembler they 2613 should be enclosed in double quotes. 2614 2615 `-D NAME' 2616 `--dll-name NAME' 2617 Specifies the name to be stored in the `.def' file as the name of 2618 the DLL when the `-e' option is used. If this option is not 2619 present, then the filename given to the `-e' option will be used 2620 as the name of the DLL. 2621 2622 `-m MACHINE' 2623 `-machine MACHINE' 2624 Specifies the type of machine for which the library file should be 2625 built. `dlltool' has a built in default type, depending upon how 2626 it was created, but this option can be used to override that. 2627 This is normally only useful when creating DLLs for an ARM 2628 processor, when the contents of the DLL are actually encode using 2629 Thumb instructions. 2630 2631 `-a' 2632 `--add-indirect' 2633 Specifies that when `dlltool' is creating the exports file it 2634 should add a section which allows the exported functions to be 2635 referenced without using the import library. Whatever the hell 2636 that means! 2637 2638 `-U' 2639 `--add-underscore' 2640 Specifies that when `dlltool' is creating the exports file it 2641 should prepend an underscore to the names of _all_ exported 2642 symbols. 2643 2644 `--add-stdcall-underscore' 2645 Specifies that when `dlltool' is creating the exports file it 2646 should prepend an underscore to the names of exported _stdcall_ 2647 functions. Variable names and non-stdcall function names are not 2648 modified. This option is useful when creating GNU-compatible 2649 import libs for third party DLLs that were built with MS-Windows 2650 tools. 2651 2652 `-k' 2653 `--kill-at' 2654 Specifies that when `dlltool' is creating the exports file it 2655 should not append the string `@ <number>'. These numbers are 2656 called ordinal numbers and they represent another way of accessing 2657 the function in a DLL, other than by name. 2658 2659 `-A' 2660 `--add-stdcall-alias' 2661 Specifies that when `dlltool' is creating the exports file it 2662 should add aliases for stdcall symbols without `@ <number>' in 2663 addition to the symbols with `@ <number>'. 2664 2665 `-p' 2666 `--ext-prefix-alias PREFIX' 2667 Causes `dlltool' to create external aliases for all DLL imports 2668 with the specified prefix. The aliases are created for both 2669 external and import symbols with no leading underscore. 2670 2671 `-x' 2672 `--no-idata4' 2673 Specifies that when `dlltool' is creating the exports and library 2674 files it should omit the `.idata4' section. This is for 2675 compatibility with certain operating systems. 2676 2677 `-c' 2678 `--no-idata5' 2679 Specifies that when `dlltool' is creating the exports and library 2680 files it should omit the `.idata5' section. This is for 2681 compatibility with certain operating systems. 2682 2683 `-i' 2684 `--interwork' 2685 Specifies that `dlltool' should mark the objects in the library 2686 file and exports file that it produces as supporting interworking 2687 between ARM and Thumb code. 2688 2689 `-n' 2690 `--nodelete' 2691 Makes `dlltool' preserve the temporary assembler files it used to 2692 create the exports file. If this option is repeated then dlltool 2693 will also preserve the temporary object files it uses to create 2694 the library file. 2695 2696 `-t PREFIX' 2697 `--temp-prefix PREFIX' 2698 Makes `dlltool' use PREFIX when constructing the names of 2699 temporary assembler and object files. By default, the temp file 2700 prefix is generated from the pid. 2701 2702 `-v' 2703 `--verbose' 2704 Make dlltool describe what it is doing. 2705 2706 `-h' 2707 `--help' 2708 Displays a list of command line options and then exits. 2709 2710 `-V' 2711 `--version' 2712 Displays dlltool's version number and then exits. 2713 2714 2715 * Menu: 2716 2717 * def file format:: The format of the dlltool `.def' file 2718 2719 2720 File: binutils.info, Node: def file format, Up: dlltool 2721 2722 13.1 The format of the `dlltool' `.def' file 2723 ============================================ 2724 2725 A `.def' file contains any number of the following commands: 2726 2727 `NAME' NAME `[ ,' BASE `]' 2728 The result is going to be named NAME`.exe'. 2729 2730 `LIBRARY' NAME `[ ,' BASE `]' 2731 The result is going to be named NAME`.dll'. 2732 2733 `EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) )' 2734 2735 `[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *' 2736 Declares NAME1 as an exported symbol from the DLL, with optional 2737 ordinal number INTEGER, or declares NAME1 as an alias (forward) of 2738 the function EXTERNAL-NAME in the DLL MODULE-NAME. 2739 2740 `IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) ) *' 2741 Declares that EXTERNAL-NAME or the exported function whose ordinal 2742 number is INTEGER is to be imported from the file MODULE-NAME. If 2743 INTERNAL-NAME is specified then this is the name that the imported 2744 function will be referred to in the body of the DLL. 2745 2746 `DESCRIPTION' STRING 2747 Puts STRING into the output `.exp' file in the `.rdata' section. 2748 2749 `STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' 2750 2751 `HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' 2752 Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in 2753 the output `.drectve' section. The linker will see this and act 2754 upon it. 2755 2756 `CODE' ATTR `+' 2757 2758 `DATA' ATTR `+' 2759 2760 `SECTIONS (' SECTION-NAME ATTR` + ) *' 2761 Generates `--attr' SECTION-NAME ATTR in the output `.drectve' 2762 section, where ATTR is one of `READ', `WRITE', `EXECUTE' or 2763 `SHARED'. The linker will see this and act upon it. 2764 2765 2766 2767 File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top 2768 2769 14 readelf 2770 ********** 2771 2772 readelf [`-a'|`--all'] 2773 [`-h'|`--file-header'] 2774 [`-l'|`--program-headers'|`--segments'] 2775 [`-S'|`--section-headers'|`--sections'] 2776 [`-g'|`--section-groups'] 2777 [`-t'|`--section-details'] 2778 [`-e'|`--headers'] 2779 [`-s'|`--syms'|`--symbols'] 2780 [`-n'|`--notes'] 2781 [`-r'|`--relocs'] 2782 [`-u'|`--unwind'] 2783 [`-d'|`--dynamic'] 2784 [`-V'|`--version-info'] 2785 [`-A'|`--arch-specific'] 2786 [`-D'|`--use-dynamic'] 2787 [`-x' <number or name>|`--hex-dump='<number or name>] 2788 [`-w[liaprmfFsoR]'| 2789 `--debug-dump'[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]] 2790 [`-I'|`-histogram'] 2791 [`-v'|`--version'] 2792 [`-W'|`--wide'] 2793 [`-H'|`--help'] 2794 ELFFILE... 2795 2796 `readelf' displays information about one or more ELF format object 2797 files. The options control what particular information to display. 2798 2799 ELFFILE... are the object files to be examined. 32-bit and 64-bit 2800 ELF files are supported, as are archives containing ELF files. 2801 2802 This program performs a similar function to `objdump' but it goes 2803 into more detail and it exists independently of the BFD library, so if 2804 there is a bug in BFD then readelf will not be affected. 2805 2806 The long and short forms of options, shown here as alternatives, are 2807 equivalent. At least one option besides `-v' or `-H' must be given. 2808 2809 `-a' 2810 `--all' 2811 Equivalent to specifiying `--file-header', `--program-headers', 2812 `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and 2813 `--version-info'. 2814 2815 `-h' 2816 `--file-header' 2817 Displays the information contained in the ELF header at the start 2818 of the file. 2819 2820 `-l' 2821 `--program-headers' 2822 `--segments' 2823 Displays the information contained in the file's segment headers, 2824 if it has any. 2825 2826 `-S' 2827 `--sections' 2828 `--section-headers' 2829 Displays the information contained in the file's section headers, 2830 if it has any. 2831 2832 `-g' 2833 `--section-groups' 2834 Displays the information contained in the file's section groups, 2835 if it has any. 2836 2837 `-t' 2838 `--section-details' 2839 Displays the detailed section information. Implies `-S'. 2840 2841 `-s' 2842 `--symbols' 2843 `--syms' 2844 Displays the entries in symbol table section of the file, if it 2845 has one. 2846 2847 `-e' 2848 `--headers' 2849 Display all the headers in the file. Equivalent to `-h -l -S'. 2850 2851 `-n' 2852 `--notes' 2853 Displays the contents of the NOTE segments and/or sections, if any. 2854 2855 `-r' 2856 `--relocs' 2857 Displays the contents of the file's relocation section, if it has 2858 one. 2859 2860 `-u' 2861 `--unwind' 2862 Displays the contents of the file's unwind section, if it has one. 2863 Only the unwind sections for IA64 ELF files are currently 2864 supported. 2865 2866 `-d' 2867 `--dynamic' 2868 Displays the contents of the file's dynamic section, if it has one. 2869 2870 `-V' 2871 `--version-info' 2872 Displays the contents of the version sections in the file, it they 2873 exist. 2874 2875 `-A' 2876 `--arch-specific' 2877 Displays architecture-specific information in the file, if there 2878 is any. 2879 2880 `-D' 2881 `--use-dynamic' 2882 When displaying symbols, this option makes `readelf' use the 2883 symbol table in the file's dynamic section, rather than the one in 2884 the symbols section. 2885 2886 `-x <number or name>' 2887 `--hex-dump=<number or name>' 2888 Displays the contents of the indicated section as a hexadecimal 2889 dump. A number identifies a particular section by index in the 2890 section table; any other string identifies all sections with that 2891 name in the object file. 2892 2893 `-w[liaprmfFsoR]' 2894 `--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]' 2895 Displays the contents of the debug sections in the file, if any are 2896 present. If one of the optional letters or words follows the 2897 switch then only data found in those specific sections will be 2898 dumped. 2899 2900 `-I' 2901 `--histogram' 2902 Display a histogram of bucket list lengths when displaying the 2903 contents of the symbol tables. 2904 2905 `-v' 2906 `--version' 2907 Display the version number of readelf. 2908 2909 `-W' 2910 `--wide' 2911 Don't break output lines to fit into 80 columns. By default 2912 `readelf' breaks section header and segment listing lines for 2913 64-bit ELF files, so that they fit into 80 columns. This option 2914 causes `readelf' to print each section header resp. each segment 2915 one a single line, which is far more readable on terminals wider 2916 than 80 columns. 2917 2918 `-H' 2919 `--help' 2920 Display the command line options understood by `readelf'. 2921 2922 2923 2924 File: binutils.info, Node: Common Options, Next: Selecting The Target System, Prev: dlltool, Up: Top 2925 2926 15 Common Options 2927 ***************** 2928 2929 The following command-line options are supported by all of the programs 2930 described in this manual. 2931 2932 `@FILE' 2933 Read command-line options from FILE. The options read are 2934 inserted in place of the original @FILE option. If FILE does not 2935 exist, or cannot be read, then the option will be treated 2936 literally, and not removed. 2937 2938 Options in FILE are separated by whitespace. A whitespace 2939 character may be included in an option by surrounding the entire 2940 option in either single or double quotes. Any character 2941 (including a backslash) may be included by prefixing the character 2942 to be included with a backslash. The FILE may itself contain 2943 additional @FILE options; any such options will be processed 2944 recursively. 2945 2946 `--help' 2947 Display the command-line options supported by the program. 2948 2949 `--version' 2950 Display the version number of the program. 2951 2952 2953 2954 File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top 2955 2956 16 Selecting the Target System 2957 ****************************** 2958 2959 You can specify two aspects of the target system to the GNU binary file 2960 utilities, each in several ways: 2961 2962 * the target 2963 2964 * the architecture 2965 2966 In the following summaries, the lists of ways to specify values are 2967 in order of decreasing precedence. The ways listed first override those 2968 listed later. 2969 2970 The commands to list valid values only list the values for which the 2971 programs you are running were configured. If they were configured with 2972 `--enable-targets=all', the commands list most of the available values, 2973 but a few are left out; not all targets can be configured in at once 2974 because some of them can only be configured "native" (on hosts with the 2975 same type as the target system). 2976 2977 * Menu: 2978 2979 * Target Selection:: 2980 * Architecture Selection:: 2981 2982 2983 File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System 2984 2985 16.1 Target Selection 2986 ===================== 2987 2988 A "target" is an object file format. A given target may be supported 2989 for multiple architectures (*note Architecture Selection::). A target 2990 selection may also have variations for different operating systems or 2991 architectures. 2992 2993 The command to list valid target values is `objdump -i' (the first 2994 column of output contains the relevant information). 2995 2996 Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', 2997 `a.out-sunos-big'. 2998 2999 You can also specify a target using a configuration triplet. This is 3000 the same sort of name that is passed to `configure' to specify a 3001 target. When you use a configuration triplet as an argument, it must be 3002 fully canonicalized. You can see the canonical version of a triplet by 3003 running the shell script `config.sub' which is included with the 3004 sources. 3005 3006 Some sample configuration triplets are: `m68k-hp-bsd', 3007 `mips-dec-ultrix', `sparc-sun-sunos'. 3008 3009 `objdump' Target 3010 ---------------- 3011 3012 Ways to specify: 3013 3014 1. command line option: `-b' or `--target' 3015 3016 2. environment variable `GNUTARGET' 3017 3018 3. deduced from the input file 3019 3020 `objcopy' and `strip' Input Target 3021 ---------------------------------- 3022 3023 Ways to specify: 3024 3025 1. command line options: `-I' or `--input-target', or `-F' or 3026 `--target' 3027 3028 2. environment variable `GNUTARGET' 3029 3030 3. deduced from the input file 3031 3032 `objcopy' and `strip' Output Target 3033 ----------------------------------- 3034 3035 Ways to specify: 3036 3037 1. command line options: `-O' or `--output-target', or `-F' or 3038 `--target' 3039 3040 2. the input target (see "`objcopy' and `strip' Input Target" above) 3041 3042 3. environment variable `GNUTARGET' 3043 3044 4. deduced from the input file 3045 3046 `nm', `size', and `strings' Target 3047 ---------------------------------- 3048 3049 Ways to specify: 3050 3051 1. command line option: `--target' 3052 3053 2. environment variable `GNUTARGET' 3054 3055 3. deduced from the input file 3056 3057 3058 File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting The Target System 3059 3060 16.2 Architecture Selection 3061 =========================== 3062 3063 An "architecture" is a type of CPU on which an object file is to run. 3064 Its name may contain a colon, separating the name of the processor 3065 family from the name of the particular CPU. 3066 3067 The command to list valid architecture values is `objdump -i' (the 3068 second column contains the relevant information). 3069 3070 Sample values: `m68k:68020', `mips:3000', `sparc'. 3071 3072 `objdump' Architecture 3073 ---------------------- 3074 3075 Ways to specify: 3076 3077 1. command line option: `-m' or `--architecture' 3078 3079 2. deduced from the input file 3080 3081 `objcopy', `nm', `size', `strings' Architecture 3082 ----------------------------------------------- 3083 3084 Ways to specify: 3085 3086 1. deduced from the input file 3087 3088 3089 File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top 3090 3091 17 Reporting Bugs 3092 ***************** 3093 3094 Your bug reports play an essential role in making the binary utilities 3095 reliable. 3096 3097 Reporting a bug may help you by bringing a solution to your problem, 3098 or it may not. But in any case the principal function of a bug report 3099 is to help the entire community by making the next version of the binary 3100 utilities work better. Bug reports are your contribution to their 3101 maintenance. 3102 3103 In order for a bug report to serve its purpose, you must include the 3104 information that enables us to fix the bug. 3105 3106 * Menu: 3107 3108 * Bug Criteria:: Have you found a bug? 3109 * Bug Reporting:: How to report bugs 3110 3111 3112 File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs 3113 3114 17.1 Have You Found a Bug? 3115 ========================== 3116 3117 If you are not sure whether you have found a bug, here are some 3118 guidelines: 3119 3120 * If a binary utility gets a fatal signal, for any input whatever, 3121 that is a bug. Reliable utilities never crash. 3122 3123 * If a binary utility produces an error message for valid input, 3124 that is a bug. 3125 3126 * If you are an experienced user of binary utilities, your 3127 suggestions for improvement are welcome in any case. 3128 3129 3130 File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs 3131 3132 17.2 How to Report Bugs 3133 ======================= 3134 3135 A number of companies and individuals offer support for GNU products. 3136 If you obtained the binary utilities from a support organization, we 3137 recommend you contact that organization first. 3138 3139 You can find contact information for many support companies and 3140 individuals in the file `etc/SERVICE' in the GNU Emacs distribution. 3141 3142 In any event, we also recommend that you send bug reports for the 3143 binary utilities to `bug-binutils (a] gnu.org'. 3144 3145 The fundamental principle of reporting bugs usefully is this: 3146 *report all the facts*. If you are not sure whether to state a fact or 3147 leave it out, state it! 3148 3149 Often people omit facts because they think they know what causes the 3150 problem and assume that some details do not matter. Thus, you might 3151 assume that the name of a file you use in an example does not matter. 3152 Well, probably it does not, but one cannot be sure. Perhaps the bug is 3153 a stray memory reference which happens to fetch from the location where 3154 that pathname is stored in memory; perhaps, if the pathname were 3155 different, the contents of that location would fool the utility into 3156 doing the right thing despite the bug. Play it safe and give a 3157 specific, complete example. That is the easiest thing for you to do, 3158 and the most helpful. 3159 3160 Keep in mind that the purpose of a bug report is to enable us to fix 3161 the bug if it is new to us. Therefore, always write your bug reports 3162 on the assumption that the bug has not been reported previously. 3163 3164 Sometimes people give a few sketchy facts and ask, "Does this ring a 3165 bell?" This cannot help us fix a bug, so it is basically useless. We 3166 respond by asking for enough details to enable us to investigate. You 3167 might as well expedite matters by sending them to begin with. 3168 3169 To enable us to fix the bug, you should include all these things: 3170 3171 * The version of the utility. Each utility announces it if you 3172 start it with the `--version' argument. 3173 3174 Without this, we will not know whether there is any point in 3175 looking for the bug in the current version of the binary utilities. 3176 3177 * Any patches you may have applied to the source, including any 3178 patches made to the `BFD' library. 3179 3180 * The type of machine you are using, and the operating system name 3181 and version number. 3182 3183 * What compiler (and its version) was used to compile the 3184 utilities--e.g. "`gcc-2.7'". 3185 3186 * The command arguments you gave the utility to observe the bug. To 3187 guarantee you will not omit something important, list them all. A 3188 copy of the Makefile (or the output from make) is sufficient. 3189 3190 If we were to try to guess the arguments, we would probably guess 3191 wrong and then we might not encounter the bug. 3192 3193 * A complete input file, or set of input files, that will reproduce 3194 the bug. If the utility is reading an object file or files, then 3195 it is generally most helpful to send the actual object files, 3196 uuencoded if necessary to get them through the mail system. Note 3197 that `bug-binutils (a] gnu.org' is a mailing list, so you should avoid 3198 sending very large files to it. Making the files available for 3199 anonymous FTP is OK. 3200 3201 If the source files were produced exclusively using GNU programs 3202 (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to 3203 send the source files rather than the object files. In this case, 3204 be sure to say exactly what version of `gcc', or whatever, was 3205 used to produce the object files. Also say how `gcc', or 3206 whatever, was configured. 3207 3208 * A description of what behavior you observe that you believe is 3209 incorrect. For example, "It gets a fatal signal." 3210 3211 Of course, if the bug is that the utility gets a fatal signal, 3212 then we will certainly notice it. But if the bug is incorrect 3213 output, we might not notice unless it is glaringly wrong. You 3214 might as well not give us a chance to make a mistake. 3215 3216 Even if the problem you experience is a fatal signal, you should 3217 still say so explicitly. Suppose something strange is going on, 3218 such as your copy of the utility is out of synch, or you have 3219 encountered a bug in the C library on your system. (This has 3220 happened!) Your copy might crash and ours would not. If you told 3221 us to expect a crash, then when ours fails to crash, we would know 3222 that the bug was not happening for us. If you had not told us to 3223 expect a crash, then we would not be able to draw any conclusion 3224 from our observations. 3225 3226 * If you wish to suggest changes to the source, send us context 3227 diffs, as generated by `diff' with the `-u', `-c', or `-p' option. 3228 Always send diffs from the old file to the new file. If you wish 3229 to discuss something in the `ld' source, refer to it by context, 3230 not by line number. 3231 3232 The line numbers in our development sources will not match those 3233 in your sources. Your line numbers would convey no useful 3234 information to us. 3235 3236 Here are some things that are not necessary: 3237 3238 * A description of the envelope of the bug. 3239 3240 Often people who encounter a bug spend a lot of time investigating 3241 which changes to the input file will make the bug go away and which 3242 changes will not affect it. 3243 3244 This is often time consuming and not very useful, because the way 3245 we will find the bug is by running a single example under the 3246 debugger with breakpoints, not by pure deduction from a series of 3247 examples. We recommend that you save your time for something else. 3248 3249 Of course, if you can find a simpler example to report _instead_ 3250 of the original one, that is a convenience for us. Errors in the 3251 output will be easier to spot, running under the debugger will take 3252 less time, and so on. 3253 3254 However, simplification is not vital; if you do not want to do 3255 this, report the bug anyway and send us the entire test case you 3256 used. 3257 3258 * A patch for the bug. 3259 3260 A patch for the bug does help us if it is a good one. But do not 3261 omit the necessary information, such as the test case, on the 3262 assumption that a patch is all we need. We might see problems 3263 with your patch and decide to fix the problem another way, or we 3264 might not understand it at all. 3265 3266 Sometimes with programs as complicated as the binary utilities it 3267 is very hard to construct an example that will make the program 3268 follow a certain path through the code. If you do not send us the 3269 example, we will not be able to construct one, so we will not be 3270 able to verify that the bug is fixed. 3271 3272 And if we cannot understand what bug you are trying to fix, or why 3273 your patch should be an improvement, we will not install it. A 3274 test case will help us to understand. 3275 3276 * A guess about what the bug is or what it depends on. 3277 3278 Such guesses are usually wrong. Even we cannot guess right about 3279 such things without first using the debugger to find the facts. 3280 3281 3282 File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top 3283 3284 Appendix A GNU Free Documentation License 3285 ***************************************** 3286 3287 Version 1.1, March 2000 3288 3289 Copyright (C) 2000, 2003 Free Software Foundation, Inc. 3290 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 3291 3292 Everyone is permitted to copy and distribute verbatim copies 3293 of this license document, but changing it is not allowed. 3294 3295 3296 0. PREAMBLE 3297 3298 The purpose of this License is to make a manual, textbook, or other 3299 written document "free" in the sense of freedom: to assure everyone 3300 the effective freedom to copy and redistribute it, with or without 3301 modifying it, either commercially or noncommercially. Secondarily, 3302 this License preserves for the author and publisher a way to get 3303 credit for their work, while not being considered responsible for 3304 modifications made by others. 3305 3306 This License is a kind of "copyleft", which means that derivative 3307 works of the document must themselves be free in the same sense. 3308 It complements the GNU General Public License, which is a copyleft 3309 license designed for free software. 3310 3311 We have designed this License in order to use it for manuals for 3312 free software, because free software needs free documentation: a 3313 free program should come with manuals providing the same freedoms 3314 that the software does. But this License is not limited to 3315 software manuals; it can be used for any textual work, regardless 3316 of subject matter or whether it is published as a printed book. 3317 We recommend this License principally for works whose purpose is 3318 instruction or reference. 3319 3320 3321 1. APPLICABILITY AND DEFINITIONS 3322 3323 This License applies to any manual or other work that contains a 3324 notice placed by the copyright holder saying it can be distributed 3325 under the terms of this License. The "Document", below, refers to 3326 any such manual or work. Any member of the public is a licensee, 3327 and is addressed as "you." 3328 3329 A "Modified Version" of the Document means any work containing the 3330 Document or a portion of it, either copied verbatim, or with 3331 modifications and/or translated into another language. 3332 3333 A "Secondary Section" is a named appendix or a front-matter 3334 section of the Document that deals exclusively with the 3335 relationship of the publishers or authors of the Document to the 3336 Document's overall subject (or to related matters) and contains 3337 nothing that could fall directly within that overall subject. 3338 (For example, if the Document is in part a textbook of 3339 mathematics, a Secondary Section may not explain any mathematics.) 3340 The relationship could be a matter of historical connection with 3341 the subject or with related matters, or of legal, commercial, 3342 philosophical, ethical or political position regarding them. 3343 3344 The "Invariant Sections" are certain Secondary Sections whose 3345 titles are designated, as being those of Invariant Sections, in 3346 the notice that says that the Document is released under this 3347 License. 3348 3349 The "Cover Texts" are certain short passages of text that are 3350 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 3351 that says that the Document is released under this License. 3352 3353 A "Transparent" copy of the Document means a machine-readable copy, 3354 represented in a format whose specification is available to the 3355 general public, whose contents can be viewed and edited directly 3356 and straightforwardly with generic text editors or (for images 3357 composed of pixels) generic paint programs or (for drawings) some 3358 widely available drawing editor, and that is suitable for input to 3359 text formatters or for automatic translation to a variety of 3360 formats suitable for input to text formatters. A copy made in an 3361 otherwise Transparent file format whose markup has been designed 3362 to thwart or discourage subsequent modification by readers is not 3363 Transparent. A copy that is not "Transparent" is called "Opaque." 3364 3365 Examples of suitable formats for Transparent copies include plain 3366 ASCII without markup, Texinfo input format, LaTeX input format, 3367 SGML or XML using a publicly available DTD, and 3368 standard-conforming simple HTML designed for human modification. 3369 Opaque formats include PostScript, PDF, proprietary formats that 3370 can be read and edited only by proprietary word processors, SGML 3371 or XML for which the DTD and/or processing tools are not generally 3372 available, and the machine-generated HTML produced by some word 3373 processors for output purposes only. 3374 3375 The "Title Page" means, for a printed book, the title page itself, 3376 plus such following pages as are needed to hold, legibly, the 3377 material this License requires to appear in the title page. For 3378 works in formats which do not have any title page as such, "Title 3379 Page" means the text near the most prominent appearance of the 3380 work's title, preceding the beginning of the body of the text. 3381 3382 2. VERBATIM COPYING 3383 3384 You may copy and distribute the Document in any medium, either 3385 commercially or noncommercially, provided that this License, the 3386 copyright notices, and the license notice saying this License 3387 applies to the Document are reproduced in all copies, and that you 3388 add no other conditions whatsoever to those of this License. You 3389 may not use technical measures to obstruct or control the reading 3390 or further copying of the copies you make or distribute. However, 3391 you may accept compensation in exchange for copies. If you 3392 distribute a large enough number of copies you must also follow 3393 the conditions in section 3. 3394 3395 You may also lend copies, under the same conditions stated above, 3396 and you may publicly display copies. 3397 3398 3. COPYING IN QUANTITY 3399 3400 If you publish printed copies of the Document numbering more than 3401 100, and the Document's license notice requires Cover Texts, you 3402 must enclose the copies in covers that carry, clearly and legibly, 3403 all these Cover Texts: Front-Cover Texts on the front cover, and 3404 Back-Cover Texts on the back cover. Both covers must also clearly 3405 and legibly identify you as the publisher of these copies. The 3406 front cover must present the full title with all words of the 3407 title equally prominent and visible. You may add other material 3408 on the covers in addition. Copying with changes limited to the 3409 covers, as long as they preserve the title of the Document and 3410 satisfy these conditions, can be treated as verbatim copying in 3411 other respects. 3412 3413 If the required texts for either cover are too voluminous to fit 3414 legibly, you should put the first ones listed (as many as fit 3415 reasonably) on the actual cover, and continue the rest onto 3416 adjacent pages. 3417 3418 If you publish or distribute Opaque copies of the Document 3419 numbering more than 100, you must either include a 3420 machine-readable Transparent copy along with each Opaque copy, or 3421 state in or with each Opaque copy a publicly-accessible 3422 computer-network location containing a complete Transparent copy 3423 of the Document, free of added material, which the general 3424 network-using public has access to download anonymously at no 3425 charge using public-standard network protocols. If you use the 3426 latter option, you must take reasonably prudent steps, when you 3427 begin distribution of Opaque copies in quantity, to ensure that 3428 this Transparent copy will remain thus accessible at the stated 3429 location until at least one year after the last time you 3430 distribute an Opaque copy (directly or through your agents or 3431 retailers) of that edition to the public. 3432 3433 It is requested, but not required, that you contact the authors of 3434 the Document well before redistributing any large number of 3435 copies, to give them a chance to provide you with an updated 3436 version of the Document. 3437 3438 4. MODIFICATIONS 3439 3440 You may copy and distribute a Modified Version of the Document 3441 under the conditions of sections 2 and 3 above, provided that you 3442 release the Modified Version under precisely this License, with 3443 the Modified Version filling the role of the Document, thus 3444 licensing distribution and modification of the Modified Version to 3445 whoever possesses a copy of it. In addition, you must do these 3446 things in the Modified Version: 3447 3448 A. Use in the Title Page (and on the covers, if any) a title 3449 distinct from that of the Document, and from those of previous 3450 versions (which should, if there were any, be listed in the 3451 History section of the Document). You may use the same title 3452 as a previous version if the original publisher of that version 3453 gives permission. 3454 B. List on the Title Page, as authors, one or more persons or 3455 entities responsible for authorship of the modifications in the 3456 Modified Version, together with at least five of the principal 3457 authors of the Document (all of its principal authors, if it 3458 has less than five). 3459 C. State on the Title page the name of the publisher of the 3460 Modified Version, as the publisher. 3461 D. Preserve all the copyright notices of the Document. 3462 E. Add an appropriate copyright notice for your modifications 3463 adjacent to the other copyright notices. 3464 F. Include, immediately after the copyright notices, a license 3465 notice giving the public permission to use the Modified Version 3466 under the terms of this License, in the form shown in the 3467 Addendum below. 3468 G. Preserve in that license notice the full lists of Invariant 3469 Sections and required Cover Texts given in the Document's 3470 license notice. 3471 H. Include an unaltered copy of this License. 3472 I. Preserve the section entitled "History", and its title, and add 3473 to it an item stating at least the title, year, new authors, and 3474 publisher of the Modified Version as given on the Title Page. 3475 If there is no section entitled "History" in the Document, 3476 create one stating the title, year, authors, and publisher of 3477 the Document as given on its Title Page, then add an item 3478 describing the Modified Version as stated in the previous 3479 sentence. 3480 J. Preserve the network location, if any, given in the Document for 3481 public access to a Transparent copy of the Document, and 3482 likewise the network locations given in the Document for 3483 previous versions it was based on. These may be placed in the 3484 "History" section. You may omit a network location for a work 3485 that was published at least four years before the Document 3486 itself, or if the original publisher of the version it refers 3487 to gives permission. 3488 K. In any section entitled "Acknowledgements" or "Dedications", 3489 preserve the section's title, and preserve in the section all the 3490 substance and tone of each of the contributor acknowledgements 3491 and/or dedications given therein. 3492 L. Preserve all the Invariant Sections of the Document, 3493 unaltered in their text and in their titles. Section numbers 3494 or the equivalent are not considered part of the section titles. 3495 M. Delete any section entitled "Endorsements." Such a section 3496 may not be included in the Modified Version. 3497 N. Do not retitle any existing section as "Endorsements" or to 3498 conflict in title with any Invariant Section. 3499 3500 If the Modified Version includes new front-matter sections or 3501 appendices that qualify as Secondary Sections and contain no 3502 material copied from the Document, you may at your option 3503 designate some or all of these sections as invariant. To do this, 3504 add their titles to the list of Invariant Sections in the Modified 3505 Version's license notice. These titles must be distinct from any 3506 other section titles. 3507 3508 You may add a section entitled "Endorsements", provided it contains 3509 nothing but endorsements of your Modified Version by various 3510 parties-for example, statements of peer review or that the text has 3511 been approved by an organization as the authoritative definition 3512 of a standard. 3513 3514 You may add a passage of up to five words as a Front-Cover Text, 3515 and a passage of up to 25 words as a Back-Cover Text, to the end 3516 of the list of Cover Texts in the Modified Version. Only one 3517 passage of Front-Cover Text and one of Back-Cover Text may be 3518 added by (or through arrangements made by) any one entity. If the 3519 Document already includes a cover text for the same cover, 3520 previously added by you or by arrangement made by the same entity 3521 you are acting on behalf of, you may not add another; but you may 3522 replace the old one, on explicit permission from the previous 3523 publisher that added the old one. 3524 3525 The author(s) and publisher(s) of the Document do not by this 3526 License give permission to use their names for publicity for or to 3527 assert or imply endorsement of any Modified Version. 3528 3529 5. COMBINING DOCUMENTS 3530 3531 You may combine the Document with other documents released under 3532 this License, under the terms defined in section 4 above for 3533 modified versions, provided that you include in the combination 3534 all of the Invariant Sections of all of the original documents, 3535 unmodified, and list them all as Invariant Sections of your 3536 combined work in its license notice. 3537 3538 The combined work need only contain one copy of this License, and 3539 multiple identical Invariant Sections may be replaced with a single 3540 copy. If there are multiple Invariant Sections with the same name 3541 but different contents, make the title of each such section unique 3542 by adding at the end of it, in parentheses, the name of the 3543 original author or publisher of that section if known, or else a 3544 unique number. Make the same adjustment to the section titles in 3545 the list of Invariant Sections in the license notice of the 3546 combined work. 3547 3548 In the combination, you must combine any sections entitled 3549 "History" in the various original documents, forming one section 3550 entitled "History"; likewise combine any sections entitled 3551 "Acknowledgements", and any sections entitled "Dedications." You 3552 must delete all sections entitled "Endorsements." 3553 3554 6. COLLECTIONS OF DOCUMENTS 3555 3556 You may make a collection consisting of the Document and other 3557 documents released under this License, and replace the individual 3558 copies of this License in the various documents with a single copy 3559 that is included in the collection, provided that you follow the 3560 rules of this License for verbatim copying of each of the 3561 documents in all other respects. 3562 3563 You may extract a single document from such a collection, and 3564 distribute it individually under this License, provided you insert 3565 a copy of this License into the extracted document, and follow 3566 this License in all other respects regarding verbatim copying of 3567 that document. 3568 3569 7. AGGREGATION WITH INDEPENDENT WORKS 3570 3571 A compilation of the Document or its derivatives with other 3572 separate and independent documents or works, in or on a volume of 3573 a storage or distribution medium, does not as a whole count as a 3574 Modified Version of the Document, provided no compilation 3575 copyright is claimed for the compilation. Such a compilation is 3576 called an "aggregate", and this License does not apply to the 3577 other self-contained works thus compiled with the Document, on 3578 account of their being thus compiled, if they are not themselves 3579 derivative works of the Document. 3580 3581 If the Cover Text requirement of section 3 is applicable to these 3582 copies of the Document, then if the Document is less than one 3583 quarter of the entire aggregate, the Document's Cover Texts may be 3584 placed on covers that surround only the Document within the 3585 aggregate. Otherwise they must appear on covers around the whole 3586 aggregate. 3587 3588 8. TRANSLATION 3589 3590 Translation is considered a kind of modification, so you may 3591 distribute translations of the Document under the terms of section 3592 4. Replacing Invariant Sections with translations requires special 3593 permission from their copyright holders, but you may include 3594 translations of some or all Invariant Sections in addition to the 3595 original versions of these Invariant Sections. You may include a 3596 translation of this License provided that you also include the 3597 original English version of this License. In case of a 3598 disagreement between the translation and the original English 3599 version of this License, the original English version will prevail. 3600 3601 9. TERMINATION 3602 3603 You may not copy, modify, sublicense, or distribute the Document 3604 except as expressly provided for under this License. Any other 3605 attempt to copy, modify, sublicense or distribute the Document is 3606 void, and will automatically terminate your rights under this 3607 License. However, parties who have received copies, or rights, 3608 from you under this License will not have their licenses 3609 terminated so long as such parties remain in full compliance. 3610 3611 10. FUTURE REVISIONS OF THIS LICENSE 3612 3613 The Free Software Foundation may publish new, revised versions of 3614 the GNU Free Documentation License from time to time. Such new 3615 versions will be similar in spirit to the present version, but may 3616 differ in detail to address new problems or concerns. See 3617 http://www.gnu.org/copyleft/. 3618 3619 Each version of the License is given a distinguishing version 3620 number. If the Document specifies that a particular numbered 3621 version of this License "or any later version" applies to it, you 3622 have the option of following the terms and conditions either of 3623 that specified version or of any later version that has been 3624 published (not as a draft) by the Free Software Foundation. If 3625 the Document does not specify a version number of this License, 3626 you may choose any version ever published (not as a draft) by the 3627 Free Software Foundation. 3628 3629 3630 ADDENDUM: How to use this License for your documents 3631 ==================================================== 3632 3633 To use this License in a document you have written, include a copy of 3634 the License in the document and put the following copyright and license 3635 notices just after the title page: 3636 3637 Copyright (C) YEAR YOUR NAME. 3638 Permission is granted to copy, distribute and/or modify this document 3639 under the terms of the GNU Free Documentation License, Version 1.1 3640 or any later version published by the Free Software Foundation; 3641 with the Invariant Sections being LIST THEIR TITLES, with the 3642 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 3643 A copy of the license is included in the section entitled "GNU 3644 Free Documentation License." 3645 3646 If you have no Invariant Sections, write "with no Invariant Sections" 3647 instead of saying which ones are invariant. If you have no Front-Cover 3648 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being 3649 LIST"; likewise for Back-Cover Texts. 3650 3651 If your document contains nontrivial examples of program code, we 3652 recommend releasing these examples in parallel under your choice of 3653 free software license, such as the GNU General Public License, to 3654 permit their use in free software. 3655 3656 3657 File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top 3658 3659 Index 3660 ***** 3661 3662 [index] 3663 * Menu: 3664 3665 * .stab: objdump. (line 324) 3666 * addr2line: addr2line. (line 6) 3667 * address to file name and line number: addr2line. (line 6) 3668 * all header information, object file: objdump. (line 364) 3669 * ar: ar. (line 6) 3670 * ar compatibility: ar. (line 40) 3671 * architecture: objdump. (line 176) 3672 * architectures available: objdump. (line 161) 3673 * archive contents: ranlib. (line 6) 3674 * archive headers: objdump. (line 60) 3675 * archives: ar. (line 6) 3676 * base files: dlltool. (line 108) 3677 * bug criteria: Bug Criteria. (line 6) 3678 * bug reports: Bug Reporting. (line 6) 3679 * bugs: Reporting Bugs. (line 6) 3680 * bugs, reporting: Bug Reporting. (line 6) 3681 * c++filt: c++filt. (line 6) 3682 * changing object addresses: objcopy. (line 266) 3683 * changing section address: objcopy. (line 276) 3684 * changing section LMA: objcopy. (line 284) 3685 * changing section VMA: objcopy. (line 297) 3686 * changing start address: objcopy. (line 261) 3687 * collections of files: ar. (line 6) 3688 * compatibility, ar: ar. (line 40) 3689 * contents of archive: ar cmdline. (line 88) 3690 * crash: Bug Criteria. (line 9) 3691 * creating archives: ar cmdline. (line 127) 3692 * cxxfilt: c++filt. (line 14) 3693 * dates in archive: ar cmdline. (line 154) 3694 * debug symbols: objdump. (line 319) 3695 * debugging symbols: nm. (line 116) 3696 * deleting from archive: ar cmdline. (line 26) 3697 * demangling C++ symbols: c++filt. (line 6) 3698 * demangling in nm: nm. (line 124) 3699 * demangling in objdump <1>: addr2line. (line 55) 3700 * demangling in objdump: objdump. (line 88) 3701 * disassembling object code: objdump. (line 110) 3702 * disassembly architecture: objdump. (line 176) 3703 * disassembly endianness: objdump. (line 126) 3704 * disassembly, with source: objdump. (line 305) 3705 * discarding symbols: strip. (line 6) 3706 * DLL: dlltool. (line 6) 3707 * dlltool: dlltool. (line 6) 3708 * DWARF: objdump. (line 319) 3709 * dynamic relocation entries, in object file: objdump. (line 294) 3710 * dynamic symbol table entries, printing: objdump. (line 348) 3711 * dynamic symbols: nm. (line 136) 3712 * ELF dynamic section information: readelf. (line 102) 3713 * ELF file header information: readelf. (line 51) 3714 * ELF file information: readelf. (line 6) 3715 * ELF notes: readelf. (line 87) 3716 * ELF object file format: objdump. (line 324) 3717 * ELF program header information: readelf. (line 57) 3718 * ELF reloc information: readelf. (line 91) 3719 * ELF section group information: readelf. (line 68) 3720 * ELF section information: readelf. (line 63) 3721 * ELF segment information: readelf. (line 57) 3722 * ELF symbol table information: readelf. (line 78) 3723 * ELF version sections informations: readelf. (line 106) 3724 * endianness: objdump. (line 126) 3725 * error on valid input: Bug Criteria. (line 12) 3726 * external symbols: nm. (line 148) 3727 * extract from archive: ar cmdline. (line 103) 3728 * fatal signal: Bug Criteria. (line 9) 3729 * file name: nm. (line 110) 3730 * header information, all: objdump. (line 364) 3731 * input .def file: dlltool. (line 104) 3732 * input file name: nm. (line 110) 3733 * libraries: ar. (line 25) 3734 * listings strings: strings. (line 6) 3735 * machine instructions: objdump. (line 110) 3736 * moving in archive: ar cmdline. (line 34) 3737 * MRI compatibility, ar: ar scripts. (line 8) 3738 * name duplication in archive: ar cmdline. (line 97) 3739 * name length: ar. (line 18) 3740 * nm: nm. (line 6) 3741 * nm compatibility: nm. (line 120) 3742 * nm format: nm. (line 120) 3743 * not writing archive index: ar cmdline. (line 173) 3744 * objdump: objdump. (line 6) 3745 * object code format <1>: addr2line. (line 50) 3746 * object code format <2>: strings. (line 65) 3747 * object code format <3>: size. (line 79) 3748 * object code format <4>: objdump. (line 74) 3749 * object code format: nm. (line 212) 3750 * object file header: objdump. (line 132) 3751 * object file information: objdump. (line 6) 3752 * object file sections: objdump. (line 300) 3753 * object formats available: objdump. (line 161) 3754 * operations on archive: ar cmdline. (line 22) 3755 * printing from archive: ar cmdline. (line 46) 3756 * printing strings: strings. (line 6) 3757 * quick append to archive: ar cmdline. (line 54) 3758 * radix for section sizes: size. (line 65) 3759 * ranlib: ranlib. (line 6) 3760 * readelf: readelf. (line 6) 3761 * relative placement in archive: ar cmdline. (line 115) 3762 * relocation entries, in object file: objdump. (line 288) 3763 * removing symbols: strip. (line 6) 3764 * repeated names in archive: ar cmdline. (line 97) 3765 * replacement in archive: ar cmdline. (line 70) 3766 * reporting bugs: Reporting Bugs. (line 6) 3767 * scripts, ar: ar scripts. (line 8) 3768 * section addresses in objdump: objdump. (line 66) 3769 * section headers: objdump. (line 143) 3770 * section information: objdump. (line 166) 3771 * section sizes: size. (line 6) 3772 * sections, full contents: objdump. (line 300) 3773 * size: size. (line 6) 3774 * size display format: size. (line 26) 3775 * size number format: size. (line 65) 3776 * sorting symbols: nm. (line 167) 3777 * source code context: objdump. (line 136) 3778 * source disassembly: objdump. (line 305) 3779 * source file name: nm. (line 110) 3780 * source filenames for object files: objdump. (line 170) 3781 * stab: objdump. (line 324) 3782 * start-address: objdump. (line 334) 3783 * stop-address: objdump. (line 338) 3784 * strings: strings. (line 6) 3785 * strings, printing: strings. (line 6) 3786 * strip: strip. (line 6) 3787 * symbol index <1>: ranlib. (line 6) 3788 * symbol index: ar. (line 28) 3789 * symbol index, listing: nm. (line 182) 3790 * symbol line numbers: nm. (line 152) 3791 * symbol table entries, printing: objdump. (line 343) 3792 * symbols: nm. (line 6) 3793 * symbols, discarding: strip. (line 6) 3794 * undefined symbols: nm. (line 217) 3795 * Unix compatibility, ar: ar cmdline. (line 8) 3796 * unwind information: readelf. (line 96) 3797 * updating an archive: ar cmdline. (line 180) 3798 * version: Top. (line 6) 3799 * VMA in objdump: objdump. (line 66) 3800 * wide output, printing: objdump. (line 370) 3801 * writing archive index: ar cmdline. (line 167) 3802 3803 3804 3805 Tag Table: 3806 Node: Top1751 3807 Node: ar3304 3808 Node: ar cmdline5482 3809 Node: ar scripts13625 3810 Node: nm19313 3811 Node: objcopy27509 3812 Node: objdump50561 3813 Node: ranlib65474 3814 Node: size66229 3815 Node: strings69076 3816 Node: strip71426 3817 Node: c++filt76905 3818 Ref: c++filt-Footnote-181833 3819 Node: addr2line81939 3820 Node: nlmconv85210 3821 Node: windres87816 3822 Node: dlltool93549 3823 Node: def file format104387 3824 Node: readelf106125 3825 Node: Common Options110833 3826 Node: Selecting The Target System111873 3827 Node: Target Selection112805 3828 Node: Architecture Selection114787 3829 Node: Reporting Bugs115615 3830 Node: Bug Criteria116394 3831 Node: Bug Reporting116947 3832 Node: GNU Free Documentation License124041 3833 Node: Index143773 3834 3835 End Tag Table 3836