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