X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=binutils%2Fdoc%2Fbinutils.texi;h=64333cff795986b49424c9e0e1f72b53eb815cee;hb=9294f12bf11f0ffa6f592e2f0bbc24dc4370b7ef;hp=c247593486041cec4028f30790233d794cf0caa6;hpb=e49e529d120e4bf2c93791900a41cf1a9e7e3cef;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index c247593486..64333cff79 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -1,73 +1,56 @@ \input texinfo @c -*- Texinfo -*- @setfilename binutils.info -@c Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 -@c Free Software Foundation, Inc. +@settitle @sc{gnu} Binary Utilities +@finalout +@synindex ky cp @c man begin INCLUDE @include bfdver.texi @c man end -@ifinfo -@format -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities. -* ar: (binutils)ar. Create, modify, and extract from archives -* nm: (binutils)nm. List symbols from object files -* objcopy: (binutils)objcopy. Copy and translate object files -* objdump: (binutils)objdump. Display information from object files -* ranlib: (binutils)ranlib. Generate index to archive contents -* readelf: (binutils)readelf. Display the contents of ELF format files. -* size: (binutils)size. List section sizes and total size -* strings: (binutils)strings. List printable strings from files -* strip: (binutils)strip. Discard symbols -* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols -* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt -* addr2line: (binutils)addr2line. Convert addresses to file and line -* nlmconv: (binutils)nlmconv. Converts object code into an NLM -* windres: (binutils)windres. Manipulate Windows resources -* dlltool: (binutils)dlltool. Create files needed to build and use DLLs -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@ifinfo +@copying @c man begin COPYRIGHT Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 +under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @c man end -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +@end copying -@end ignore -@end ifinfo +@dircategory Software development +@direntry +* Binutils: (binutils). The GNU binary utilities. +@end direntry + +@dircategory Individual utilities +@direntry +* addr2line: (binutils)addr2line. Convert addresses to file and line. +* ar: (binutils)ar. Create, modify, and extract from archives. +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols. +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt. +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs. +* nlmconv: (binutils)nlmconv. Converts object code into an NLM. +* nm: (binutils)nm. List symbols from object files. +* objcopy: (binutils)objcopy. Copy and translate object files. +* objdump: (binutils)objdump. Display information from object files. +* ranlib: (binutils)ranlib. Generate index to archive contents. +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size. +* strings: (binutils)strings. List printable strings from files. +* strip: (binutils)strip. Discard symbols. +* elfedit: (binutils)elfedit. Update the ELF header of ELF files. +* windmc: (binutils)windmc. Generator for Windows message resources. +* windres: (binutils)windres. Manipulate Windows resources. +@end direntry -@synindex ky cp -@c -@c This file documents the GNU binary utilities "ar", "ld", "objcopy", -@c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". -@c -@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c -@c This text may be freely distributed under the terms of the GNU -@c Free Documentation License. -@c - -@setchapternewpage odd -@settitle @sc{gnu} Binary Utilities @titlepage -@finalout @title The @sc{gnu} Binary Utilities @ifset VERSION_PACKAGE @subtitle @value{VERSION_PACKAGE} @@ -82,21 +65,13 @@ notice identical to this one except for the removal of this paragraph @tex {\parskip=0pt \hfill Cygnus Support\par \hfill -\TeX{}info \texinfoversion\par } +Texinfo \texinfoversion\par } @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled ``GNU Free Documentation License''. - +@insertcopying @end titlepage +@contents @node Top @top Introduction @@ -138,6 +113,9 @@ List printable strings from files @item strip Discard symbols +@item elfedit +Update the ELF header of ELF files. + @item c++filt Demangle encoded C++ symbols (on MS-DOS, this program is named @code{cxxfilt}) @@ -151,14 +129,17 @@ Convert object code into a Netware Loadable Module @item windres Manipulate Windows resources +@item windmc +Genertor for Windows message resources + @item dlltool Create the files needed to build and use Dynamic Link Libraries @end table @end iftex This document is distributed under the terms of the GNU Free -Documentation License. A copy of the license is included in the -section entitled "GNU Free Documentation License". +Documentation License version 1.3. A copy of the license is included +in the section entitled ``GNU Free Documentation License''. @menu * ar:: Create, modify, and extract from archives @@ -166,21 +147,23 @@ section entitled "GNU Free Documentation License". * objcopy:: Copy and translate object files * objdump:: Display information from object files * ranlib:: Generate index to archive contents -* readelf:: Display the contents of ELF format files. +* readelf:: Display the contents of ELF format files * size:: List section sizes and total size * strings:: List printable strings from files * strip:: Discard symbols +* elfedit:: Update the ELF header of ELF files * c++filt:: Filter to demangle encoded C++ symbols * cxxfilt: c++filt. MS-DOS name for c++filt * addr2line:: Convert addresses to file and line * nlmconv:: Converts object code into an NLM * windres:: Manipulate Windows resources +* windmc:: Generator for Windows message resources * dlltool:: Create files needed to build and use DLLs * Common Options:: Command-line options for all utilities -* Selecting The Target System:: How these utilities determine the target. +* Selecting the Target System:: How these utilities determine the target * Reporting Bugs:: Reporting Bugs * GNU Free Documentation License:: GNU Free Documentation License -* Binutils Index:: Binutils Index +* Binutils Index:: Binutils Index @end menu @node ar @@ -193,7 +176,7 @@ section entitled "GNU Free Documentation License". @c man title ar create, modify, and extract from archives @smallexample -ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] +ar [@option{--plugin} @var{name}] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] ar -M [ @end smallexample +@item --long-section-names @{enable,disable,keep@} +Controls the handling of long section names when processing @code{COFF} +and @code{PE-COFF} object formats. The default behaviour, @samp{keep}, +is to preserve long section names if any are present in the input file. +The @samp{enable} and @samp{disable} options forcibly enable or disable +the use of long section names in the output object; when @samp{disable} +is in effect, any long section names in the input object will be truncated. +The @samp{enable} option will only emit long section names if any are +present in the inputs; this is mostly the same as @samp{keep}, but it +is left undefined whether the @samp{enable} option might force the +creation of an empty string table in the output file. + @item --change-leading-char Some object file formats use special characters at the start of symbols. The most common such character is underscore, which compilers @@ -1341,13 +1448,37 @@ different conventions for symbol names. This is different from when appropriate, regardless of the object file format of the output file. +@item --reverse-bytes=@var{num} +Reverse the bytes in a section with output contents. A section length must +be evenly divisible by the value given in order for the swap to be able to +take place. Reversing takes place before the interleaving is performed. + +This option is used typically in generating ROM images for problematic +target systems. For example, on some target boards, the 32-bit words +fetched from 8-bit ROMs are re-assembled in little-endian byte order +regardless of the CPU byte order. Depending on the programming model, the +endianness of the ROM may need to be modified. + +Consider a simple file with a section containing the following eight +bytes: @code{12345678}. + +Using @samp{--reverse-bytes=2} for the above example, the bytes in the +output file would be ordered @code{21436587}. + +Using @samp{--reverse-bytes=4} for the above example, the bytes in the +output file would be ordered @code{43218765}. + +By using @samp{--reverse-bytes=2} for the above example, followed by +@samp{--reverse-bytes=4} on the output file, the bytes in the second +output file would be ordered @code{34127856}. + @item --srec-len=@var{ival} Meaningful only for srec output. Set the maximum length of the Srecords being produced to @var{ival}. This length covers both address, data and crc fields. @item --srec-forceS3 -Meaningful only for srec output. Avoid generation of S1/S2 records, +Meaningful only for srec output. Avoid generation of S1/S2 records, creating S3-only record format. @item --redefine-sym @var{old}=@var{new} @@ -1412,7 +1543,7 @@ This option may be given more than once. @item --alt-machine-code=@var{index} If the output architecture has alternate machine codes, use the @var{index}th code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the +a machine is assigned an official code and the tool-chain adopts the new code, but other applications still depend on the original code being used. For ELF based architectures if the @var{index} alternative does not exist then the value is treated as an absolute @@ -1456,7 +1587,7 @@ which would otherwise get stripped. @item --only-keep-debug Strip a file, removing contents of any sections that would not be stripped by @option{--strip-debug} and leaving the debugging sections -intact. +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -1476,7 +1607,7 @@ stripped executable. to add a link to the debugging info into the stripped executable. @end enumerate -Note - the choice of @code{.dbg} as an extension for the debug info +Note---the choice of @code{.dbg} as an extension for the debug info file is arbitrary. Also the @code{--only-keep-debug} step is optional. You could instead do this: @@ -1491,28 +1622,76 @@ i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. -Note - this switch is only intended for use on fully linked files. It +Note---this switch is only intended for use on fully linked files. It does not make sense to use it on object files where the debugging information may be incomplete. Besides the gnu_debuglink feature currently only supports the presence of one filename containing debugging information, not multiple filenames on a one-per-object-file basis. +@item --file-alignment @var{num} +Specify the file alignment. Sections in the file will always begin at +file offsets which are multiples of this number. This defaults to +512. +[This option is specific to PE targets.] + +@item --heap @var{reserve} +@itemx --heap @var{reserve},@var{commit} +Specify the number of bytes of memory to reserve (and optionally commit) +to be used as heap for this program. +[This option is specific to PE targets.] + +@item --image-base @var{value} +Use @var{value} as the base address of your program or dll. This is +the lowest memory location that will be used when your program or dll +is loaded. To reduce the need to relocate and improve performance of +your dlls, each should have a unique base address and not overlap any +other dlls. The default is 0x400000 for executables, and 0x10000000 +for dlls. +[This option is specific to PE targets.] + +@item --section-alignment @var{num} +Sets the section alignment. Sections in memory will always begin at +addresses which are a multiple of this number. Defaults to 0x1000. +[This option is specific to PE targets.] + +@item --stack @var{reserve} +@itemx --stack @var{reserve},@var{commit} +Specify the number of bytes of memory to reserve (and optionally commit) +to be used as stack for this program. +[This option is specific to PE targets.] + +@item --subsystem @var{which} +@itemx --subsystem @var{which}:@var{major} +@itemx --subsystem @var{which}:@var{major}.@var{minor} +Specifies the subsystem under which your program will execute. The +legal values for @var{which} are @code{native}, @code{windows}, +@code{console}, @code{posix}, @code{efi-app}, @code{efi-bsd}, +@code{efi-rtd}, @code{sal-rtd}, and @code{xbox}. You may optionally set +the subsystem version also. Numeric values are also accepted for +@var{which}. +[This option is specific to PE targets.] + @item --extract-symbol Keep the file's section flags and symbols but remove all section data. Specifically, the option: @itemize -@item sets the virtual and load addresses of every section to zero; @item removes the contents of all sections; @item sets the size of every section to zero; and @item sets the file's start address to zero. @end itemize - + This option is used to build a @file{.sym} file for a VxWorks kernel. It can also be a useful way of reducing the size of a @option{--just-symbols} linker input file. +@item --compress-debug-sections +Compress DWARF debug sections using zlib. + +@item --decompress-debug-sections +Decompress DWARF debug sections using zlib. + @item -V @itemx --version Show the version number of @command{objcopy}. @@ -1555,6 +1734,7 @@ objdump [@option{-a}|@option{--archive-headers}] [@option{-z}|@option{--disassemble-zeroes}] [@option{-EB}|@option{-EL}|@option{--endian=}@{big | little @}] [@option{-f}|@option{--file-headers}] + [@option{-F}|@option{--file-offsets}] [@option{--file-start-context}] [@option{-g}|@option{--debugging}] [@option{-e}|@option{--debugging-tags}] @@ -1566,10 +1746,12 @@ objdump [@option{-a}|@option{--archive-headers}] [@option{-m} @var{machine}|@option{--architecture=}@var{machine}] [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}] [@option{-p}|@option{--private-headers}] + [@option{-P} @var{options}|@option{--private=}@var{options}] [@option{-r}|@option{--reloc}] [@option{-R}|@option{--dynamic-reloc}] [@option{-s}|@option{--full-contents}] - [@option{-W}|@option{--dwarf}] + [@option{-W[lLiaprmfFsoRt]}| + @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] [@option{-G}|@option{--stabs}] [@option{-t}|@option{--syms}] [@option{-T}|@option{--dynamic-syms}] @@ -1581,6 +1763,9 @@ objdump [@option{-a}|@option{--archive-headers}] [@option{--[no-]show-raw-insn}] [@option{--adjust-vma=}@var{offset}] [@option{--special-syms}] + [@option{--prefix=}@var{prefix}] + [@option{--prefix-strip=}@var{level}] + [@option{--insn-width=}@var{width}] [@option{-V}|@option{--version}] [@option{-H}|@option{--help}] @var{objfile}@dots{} @@ -1605,7 +1790,7 @@ object files. The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list -@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x} must be given. +@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x} must be given. @table @env @item -a @@ -1649,17 +1834,17 @@ formats available with the @option{-i} option. Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -g @itemx --debugging -Display debugging information. This attempts to parse debugging -information stored in the file and print it out using a C like syntax. -Only certain types of debugging information have been implemented. -Some other types are supported by @command{readelf -w}. -@xref{readelf}. +Display debugging information. This attempts to parse STABS and IEEE +debugging format information stored in the file and print it out using +a C like syntax. If neither of these formats are found this option +falls back on the @option{-W} option to print any DWARF information in +the file. @item -e @itemx --debugging-tags @@ -1679,6 +1864,10 @@ expected to contain instructions. Like @option{-d}, but disassemble the contents of all sections, not just those expected to contain instructions. +If the target is an ARM architecture this switch also has the effect +of forcing the disassembler to decode pieces of data found in code +sections as if they were instructions. + @item --prefix-addresses When disassembling, print the complete address on each line. This is the older disassembly format. @@ -1698,6 +1887,16 @@ does not describe endianness information, such as S-records. Display summary information from the overall header of each of the @var{objfile} files. +@item -F +@itemx --file-offsets +@cindex object file offsets +When disassembling sections, whenever a symbol is displayed, also +display the file offset of the region of data that is about to be +dumped. If zeroes are being skipped, then when disassembly resumes, +tell the user how many zeroes were skipped and the file offset of the +location from where the disassembly resumes. When dumping sections, +display the file offset of the location from where the dump starts. + @item --file-start-context @cindex source code context Specify that when displaying interlisted source code/disassembly @@ -1752,6 +1951,13 @@ can be useful when disassembling object files which do not describe architecture information, such as S-records. You can list the available architectures with the @option{-i} option. +If the target is an ARM architecture then this switch has an +additional effect. It restricts the disassembly to only those +instructions supported by the architecture specified by @var{machine}. +If it is necessary to use this switch because the input file does not +contain any architecture information, but it is also desired to +disassemble all the instructions use @option{-marm}. + @item -M @var{options} @itemx --disassembler-options=@var{options} Pass target specific information to the disassembler. Only supported on @@ -1784,7 +1990,11 @@ switch, but allow finer grained control. Multiple selections from the following may be specified as a comma separated string. @option{x86-64}, @option{i386} and @option{i8086} select disassembly for the given architecture. @option{intel} and @option{att} select between -intel syntax mode and AT&T syntax mode. @option{addr64}, @option{addr32}, +intel syntax mode and AT&T syntax mode. +@option{intel-mnemonic} and @option{att-mnemonic} select between +intel mnemonic mode and AT&T mnemonic mode. @option{intel-mnemonic} +implies @option{intel} and @option{att-mnemonic} implies @option{att}. +@option{addr64}, @option{addr32}, @option{addr16}, @option{data32} and @option{data16} specify the default address size and operand size. These four options will be overridden if @option{x86-64}, @option{i386} or @option{i8086} appear later in the @@ -1792,11 +2002,12 @@ option string. Lastly, @option{suffix}, when in AT&T mode, instructs the disassembler to print a mnemonic suffix even when the suffix could be inferred by the operands. -For PPC, @option{booke}, @option{booke32} and @option{booke64} select -disassembly of BookE instructions. @option{32} and @option{64} select -PowerPC and PowerPC64 disassembly, respectively. @option{e300} selects +For PowerPC, @option{booke} controls the disassembly of BookE +instructions. @option{32} and @option{64} select PowerPC and +PowerPC64 disassembly, respectively. @option{e300} selects disassembly for the e300 family. @option{440} selects disassembly for -the powerPC 440. +the PowerPC 440. @option{ppcps} selects disassembly for the paired +single instructions of the PPC750CL. For MIPS, this option controls the printing of instruction mnemonic names and register names in disassembled instructions. Multiple @@ -1858,6 +2069,17 @@ Print information that is specific to the object file format. The exact information printed depends upon the object file format. For some object file formats, no additional information is printed. +@item -P @var{options} +@itemx --private=@var{options} +Print information that is specific to the object file format. The +argument @var{options} is a comma separated list that depends on the +format (the lists of options is displayed with the help). + +For XCOFF, the available options are: @option{header}, @option{aout}, +@option{sections}, @option{syms}, @option{relocs}, @option{lineno}, +@option{loader}, @option{except}, @option{typchk}, @option{traceback} +and @option{toc}. + @item -r @itemx --reloc @cindex relocation entries, in object file @@ -1870,7 +2092,9 @@ disassembly. @cindex dynamic relocation entries, in object file Print the dynamic relocation entries of the file. This is only meaningful for dynamic objects, such as certain types of shared -libraries. +libraries. As for @option{-r}, if used with @option{-d} or +@option{-D}, the relocations are printed interspersed with the +disassembly. @item -s @itemx --full-contents @@ -1886,6 +2110,16 @@ non-empty sections are displayed. Display source code intermixed with disassembly, if possible. Implies @option{-d}. +@item --prefix=@var{prefix} +@cindex Add prefix to absolute paths +Specify @var{prefix} to add to the absolute paths when used with +@option{-S}. + +@item --prefix-strip=@var{level} +@cindex Strip absolute paths +Indicate how many initial directory names to strip off the hardwired +absolute paths. It has no effect without @option{--prefix=}@var{prefix}. + @item --show-raw-insn When disassembling instructions, print the instruction in hex as well as in symbolic form. This is the default except when @@ -1895,12 +2129,43 @@ in symbolic form. This is the default except when When disassembling instructions, do not print the instruction bytes. This is the default when @option{--prefix-addresses} is used. -@item -W -@itemx --dwarf +@item --insn-width=@var{width} +@cindex Instruction width +Display @var{width} bytes on a single line when disassembling +instructions. + +@item -W[lLiaprmfFsoRt] +@itemx --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index] @cindex DWARF @cindex debug symbols -Displays the contents of the DWARF debug sections in the file, if any -are present. +Displays the contents of the debug sections in the file, if any are +present. If one of the optional letters or words follows the switch +then only data found in those specific sections will be dumped. + +Note that there is no single letter option to display the content of +trace sections or .gdb_index. + +Note: the output from the @option{=info} option can also be affected +by the options @option{--dwarf-depth} and @option{--dwarf-start}. + +@item --dwarf-depth=@var{n} +Limit the dump of the @code{.debug_info} section to @var{n} children. +This is only useful with @option{--dwarf=info}. The default is +to print all DIEs; the special value 0 for @var{n} will also have this +effect. + +With a non-zero value for @var{n}, DIEs at or deeper than @var{n} +levels will not be printed. The range for @var{n} is zero-based. + +@item --dwarf-start=@var{n} +Print only DIEs beginning with the DIE numbered @var{n}. This is only +useful with @option{--dwarf=info}. + +If specified, this option will suppress printing of any header +information and all DIEs before the DIE numbered @var{n}. Only +siblings and children of the specified DIE will be printed. + +This can be used in conjunction with @option{--dwarf-depth}. @item -G @itemx --stabs @@ -1934,7 +2199,86 @@ of the @option{-d}, @option{-r} and @option{-s} options. @itemx --syms @cindex symbol table entries, printing Print the symbol table entries of the file. -This is similar to the information provided by the @samp{nm} program. +This is similar to the information provided by the @samp{nm} program, +although the display format is different. The format of the output +depends upon the format of the file being dumped, but there are two main +types. One looks like this: + +@smallexample +[ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss +[ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred +@end smallexample + +where the number inside the square brackets is the number of the entry +in the symbol table, the @var{sec} number is the section number, the +@var{fl} value are the symbol's flag bits, the @var{ty} number is the +symbol's type, the @var{scl} number is the symbol's storage class and +the @var{nx} value is the number of auxilary entries associated with +the symbol. The last two fields are the symbol's value and its name. + +The other common output format, usually seen with ELF based files, +looks like this: + +@smallexample +00000000 l d .bss 00000000 .bss +00000000 g .text 00000000 fred +@end smallexample + +Here the first number is the symbol's value (sometimes refered to as +its address). The next field is actually a set of characters and +spaces indicating the flag bits that are set on the symbol. These +characters are described below. Next is the section with which the +symbol is associated or @emph{*ABS*} if the section is absolute (ie +not connected with any section), or @emph{*UND*} if the section is +referenced in the file being dumped, but not defined there. + +After the section name comes another field, a number, which for common +symbols is the alignment and for other symbol is the size. Finally +the symbol's name is displayed. + +The flag characters are divided into 7 groups as follows: +@table @code +@item l +@itemx g +@itemx u +@itemx ! +The symbol is a local (l), global (g), unique global (u), neither +global nor local (a space) or both global and local (!). A +symbol can be neither local or global for a variety of reasons, e.g., +because it is used for debugging, but it is probably an indication of +a bug if it is ever both local and global. Unique global symbols are +a GNU extension to the standard set of ELF symbol bindings. For such +a symbol the dynamic linker will make sure that in the entire process +there is just one symbol with this name and type in use. + +@item w +The symbol is weak (w) or strong (a space). + +@item C +The symbol denotes a constructor (C) or an ordinary symbol (a space). + +@item W +The symbol is a warning (W) or a normal symbol (a space). A warning +symbol's name is a message to be displayed if the symbol following the +warning symbol is ever referenced. + +@item I +@item i +The symbol is an indirect reference to another symbol (I), a function +to be evaluated during reloc processing (i) or a normal symbol (a +space). + +@item d +@itemx D +The symbol is a debugging symbol (d) or a dynamic symbol (D) or a +normal symbol (a space). + +@item F +@item f +@item O +The symbol is the name of a function (F) or a file (f) or an object +(O) or just a normal symbol (a space). +@end table @item -T @itemx --dynamic-syms @@ -1993,7 +2337,7 @@ nm(1), readelf(1), and the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS ranlib -ranlib [@option{-vV}] @var{archive} +ranlib [@option{-vVt}] @var{archive} @c man end @end smallexample @@ -2001,7 +2345,7 @@ ranlib [@option{-vV}] @var{archive} @command{ranlib} generates an index to the contents of an archive and stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. +member of an archive that is a relocatable object file. You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. @@ -2022,6 +2366,9 @@ The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; @itemx -V @itemx --version Show the version number of @command{ranlib}. + +@item -t +Update the timestamp of the symbol map of an archive. @end table @c man end @@ -2045,8 +2392,9 @@ ar(1), nm(1), and the Info entries for @file{binutils}. size [@option{-A}|@option{-B}|@option{--format=}@var{compatibility}] [@option{--help}] [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] + [@option{--common}] [@option{-t}|@option{--totals}] - [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] + [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] [@var{objfile}@dots{}] @c man end @end smallexample @@ -2076,13 +2424,13 @@ Using one of these options, you can choose whether the output from @sc{gnu} @command{size} resembles output from System V @command{size} (using @option{-A}, or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or @option{--format=berkeley}). The default is the one-line format similar to -Berkeley's. +Berkeley's. @c Bonus for doc-source readers: you can also say --format=strange (or @c anything else that starts with 's') for sysv, and --format=boring (or @c anything else that starts with 'b') for Berkeley. Here is an example of the Berkeley (default) format of output from -@command{size}: +@command{size}: @smallexample $ size --format=Berkeley ranlib size text data bss dec hex filename @@ -2097,18 +2445,18 @@ This is the same data, but displayed closer to System V conventions: $ size --format=SysV ranlib size ranlib : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11592 385024 -Total 388392 +.text 294880 8192 +.data 81920 303104 +.bss 11592 385024 +Total 388392 size : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11888 385024 -Total 388688 +.text 294880 8192 +.data 81920 303104 +.bss 11888 385024 +Total 388688 @end smallexample @item --help @@ -2128,6 +2476,10 @@ values (8, 10, 16) are supported. The total size is always given in two radices; decimal and hexadecimal for @option{-d} or @option{-x} output, or octal and hexadecimal if you're using @option{-o}. +@item --common +Print total size of common symbols in each file. When using Berkeley +format these are included in the bss size. + @item -t @itemx --totals Show totals of all objects listed (Berkeley format listing mode only). @@ -2163,7 +2515,7 @@ ar(1), objdump(1), readelf(1), and the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS strings -strings [@option{-afov}] [@option{-}@var{min-len}] +strings [@option{-afovV}] [@option{-}@var{min-len}] [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] @@ -2227,7 +2579,8 @@ Possible values for @var{encoding} are: @samp{s} = single-7-bit-byte characters (ASCII, ISO 8859, etc., default), @samp{S} = single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} = 16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit -littleendian. Useful for finding wide character strings. +littleendian. Useful for finding wide character strings. (@samp{l} +and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings). @item -T @var{bfdname} @itemx --target=@var{bfdname} @@ -2236,6 +2589,7 @@ Specify an object code format other than your system's default format. @xref{Target Selection}, for more information. @item -v +@itemx -V @itemx --version Print the program version number on the standard output and exit. @end table @@ -2387,8 +2741,9 @@ When stripping a file, perhaps with @option{--strip-debug} or which would otherwise get stripped. @item --only-keep-debug -Strip a file, removing any sections that would be stripped by -@option{--strip-debug} and leaving the debugging sections. +Strip a file, removing contents of any sections that would not be +stripped by @option{--strip-debug} and leaving the debugging sections +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -2408,22 +2763,22 @@ stripped executable. to add a link to the debugging info into the stripped executable. @end enumerate -Note - the choice of @code{.dbg} as an extension for the debug info +Note---the choice of @code{.dbg} as an extension for the debug info file is arbitrary. Also the @code{--only-keep-debug} step is optional. You could instead do this: @enumerate @item Link the executable as normal. -@item Copy @code{foo} to @code{foo.full} +@item Copy @code{foo} to @code{foo.full} @item Run @code{strip --strip-debug foo} @item Run @code{objcopy --add-gnu-debuglink=foo.full foo} @end enumerate -ie the file pointed to by the @option{--add-gnu-debuglink} can be the +i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. -Note - this switch is only intended for use on fully linked files. It +Note---this switch is only intended for use on fully linked files. It does not make sense to use it on object files where the debugging information may be incomplete. Besides the gnu_debuglink feature currently only supports the presence of one filename containing @@ -2448,7 +2803,7 @@ the Info entries for @file{binutils}. @c man end @end ignore -@node c++filt, addr2line, strip, Top +@node c++filt, addr2line, elfedit, Top @chapter c++filt @kindex c++filt @@ -2478,7 +2833,7 @@ able to distinguish these similarly named functions C++ and Java encode them into a low-level assembler name which uniquely identifies each different version. This process is known as @dfn{mangling}. The @command{c++filt} -@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on +@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on MS-DOS this program is named @command{CXXFILT}.} program does the inverse mapping: it decodes (@dfn{demangles}) low-level names into user-level names so that they can be read. @@ -2523,11 +2878,11 @@ name which makes it invalid). This command however will work: echo _Z1fv, | c++filt -n @end smallexample -and will display ``f(),'' ie the demangled name followed by a +and will display ``f(),'', i.e., the demangled name followed by a trailing comma. This behaviour is because when the names are read from the standard input it is expected that they might be part of an assembler source file where there might be extra, extraneous -characters trailing after a mangled name. eg: +characters trailing after a mangled name. For example: @smallexample .type _Z1fv, @@function @@ -2545,11 +2900,6 @@ of every name. For example, the C name @code{foo} gets the low-level name @code{_foo}. This option removes the initial underscore. Whether @command{c++filt} removes the underscore by default is target dependent. -@item -j -@itemx --java -Prints demangled names using Java syntax. The default is to use C++ -syntax. - @item -n @itemx --no-strip-underscores Do not remove the initial underscore. @@ -2563,7 +2913,7 @@ the function's parameters. @itemx --types Attempt to demangle types as well as function names. This is disabled by default since mangled types are normally only used internally in -the compiler, and they can be confused with non-mangled names. eg +the compiler, and they can be confused with non-mangled names. For example, a function called ``a'' treated as a mangled type name would be demangled to ``signed char''. @@ -2618,7 +2968,7 @@ the Info entries for @file{binutils}. @emph{Warning:} @command{c++filt} is a new utility, and the details of its user interface are subject to change in future releases. In particular, a command-line option may be required in the future to decode a name -passed as an argument on the command line; in other words, +passed as an argument on the command line; in other words, @example c++filt @var{symbol} @@ -2642,11 +2992,13 @@ c++filt @var{option} @var{symbol} @smallexample @c man begin SYNOPSIS addr2line -addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}] +addr2line [@option{-a}|@option{--addresses}] + [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-e} @var{filename}|@option{--exe=}@var{filename}] [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] [@option{-i}|@option{--inlines}] + [@option{-p}|@option{--pretty-print}] [@option{-j}|@option{--section=}@var{name}] [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] [addr addr @dots{}] @@ -2679,7 +3031,8 @@ The format of the output is @samp{FILENAME:LINENO}. The file name and line number for each address is printed on a separate line. If the @command{-f} option is used, then each @samp{FILENAME:LINENO} line is preceded by a @samp{FUNCTIONNAME} line which is the name of the function -containing the address. +containing the address. If the @command{-a} option is used, then the +address read is first printed. If the file name or function name can not be determined, @command{addr2line} will print two question marks in their place. If the @@ -2693,6 +3046,12 @@ The long and short forms of options, shown here as alternatives, are equivalent. @table @env +@item -a +@itemx --addresses +Display address before function names or file and line number +information. The address is printed with a @samp{0x} prefix to easily +identify it. + @item -b @var{bfdname} @itemx --target=@var{bfdname} @cindex object code format @@ -2705,8 +3064,8 @@ Specify that the object-code format for the object files is Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -e @var{filename} @@ -2734,6 +3093,12 @@ will also be printed. @item -j @itemx --section Read offsets relative to the specified section instead of absolute addresses. + +@item -p +@itemx --pretty-print +Make the output more human friendly: each location are printed on one line. +If option @option{-i} is specified, lines for all enclosing scopes are +prefixed with @samp{(inlined by)}. @end table @c man end @@ -2849,6 +3214,167 @@ the Info entries for @file{binutils}. @c man end @end ignore +@node windmc +@chapter windmc + +@command{windmc} may be used to generator Windows message resources. + +@quotation +@emph{Warning:} @command{windmc} is not always built as part of the binary +utilities, since it is only useful for Windows targets. +@end quotation + +@c man title windmc generates Windows message resources. + +@smallexample +@c man begin SYNOPSIS windmc +windmc [options] input-file +@c man end +@end smallexample + +@c man begin DESCRIPTION windmc + +@command{windmc} reads message definitions from an input file (.mc) and +translate them into a set of output files. The output files may be of +four kinds: + +@table @code +@item h +A C header file containing the message definitions. + +@item rc +A resource file compilable by the @command{windres} tool. + +@item bin +One or more binary files containing the resource data for a specific +message language. + +@item dbg +A C include file that maps message id's to their symbolic name. +@end table + +The exact description of these different formats is available in +documentation from Microsoft. + +When @command{windmc} converts from the @code{mc} format to the @code{bin} +format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the +Windows Message Compiler. + +@c man end + +@c man begin OPTIONS windmc + +@table @env +@item -a +@itemx --ascii_in +Specifies that the input file specified is ASCII. This is the default +behaviour. + +@item -A +@itemx --ascii_out +Specifies that messages in the output @code{bin} files should be in ASCII +format. + +@item -b +@itemx --binprefix +Specifies that @code{bin} filenames should have to be prefixed by the +basename of the source file. + +@item -c +@itemx --customflag +Sets the customer bit in all message id's. + +@item -C @var{codepage} +@itemx --codepage_in @var{codepage} +Sets the default codepage to be used to convert input file to UTF16. The +default is ocdepage 1252. + +@item -d +@itemx --decimal_values +Outputs the constants in the header file in decimal. Default is using +hexadecimal output. + +@item -e @var{ext} +@itemx --extension @var{ext} +The extension for the header file. The default is .h extension. + +@item -F @var{target} +@itemx --target @var{target} +Specify the BFD format to use for a bin file as output. This +is a BFD target name; you can use the @option{--help} option to see a list +of supported targets. Normally @command{windmc} will use the default +format, which is the first one listed by the @option{--help} option. +@ifclear man +@ref{Target Selection}. +@end ifclear + +@item -h @var{path} +@itemx --headerdir @var{path} +The target directory of the generated header file. The default is the +current directory. + +@item -H +@itemx --help +Displays a list of command line options and then exits. + +@item -m @var{characters} +@itemx --maxlength @var{characters} +Instructs @command{windmc} to generate a warning if the length +of any message exceeds the number specified. + +@item -n +@itemx --nullterminate +Terminate message text in @code{bin} files by zero. By default they are +terminated by CR/LF. + +@item -o +@itemx --hresult_use +Not yet implemented. Instructs @code{windmc} to generate an OLE2 header +file, using HRESULT definitions. Status codes are used if the flag is not +specified. + +@item -O @var{codepage} +@itemx --codepage_out @var{codepage} +Sets the default codepage to be used to output text files. The default +is ocdepage 1252. + +@item -r @var{path} +@itemx --rcdir @var{path} +The target directory for the generated @code{rc} script and the generated +@code{bin} files that the resource compiler script includes. The default +is the current directory. + +@item -u +@itemx --unicode_in +Specifies that the input file is UTF16. + +@item -U +@itemx --unicode_out +Specifies that messages in the output @code{bin} file should be in UTF16 +format. This is the default behaviour. + +@item -v +@item --verbose +Enable verbose mode. + +@item -V +@item --version +Prints the version number for @command{windmc}. + +@item -x @var{path} +@itemx --xdgb @var{path} +The path of the @code{dbg} C include file that maps message id's to the +symbolic name. No such file is generated without specifying the switch. +@end table + +@c man end + +@ignore +@c man begin SEEALSO windmc +the Info entries for @file{binutils}. +@c man end +@end ignore + @node windres @chapter windres @@ -2962,13 +3488,20 @@ preprocessor first. This option may be used to specify the preprocessor to use, including any leading arguments. The default preprocessor argument is @code{gcc -E -xc-header -DRC_INVOKED}. +@item --preprocessor-arg @var{option} +When @command{windres} reads an @code{rc} file, it runs it through +the C preprocessor first. This option may be used to specify additional +text to be passed to preprocessor on its command line. +This option can be used multiple times to add multiple options to the +preprocessor command line. + @item -I @var{directory} @itemx --include-dir @var{directory} Specify an include directory to use when reading an @code{rc} file. @command{windres} will pass this to the preprocessor as an @option{-I} option. @command{windres} will also search this directory when looking for files named in the @code{rc} file. If the argument passed to this command -matches any of the supported @var{formats} (as described in the @option{-J} +matches any of the supported @var{formats} (as described in the @option{-J} option), it will issue a deprecation warning, and behave just like the @option{-J} option. New programs should not use this behaviour. If a directory happens to match a @var{format}, simple prefix it with @samp{./} @@ -2991,6 +3524,13 @@ Ignored for compatibility with rc. Enable verbose mode. This tells you what the preprocessor is if you didn't specify one. +@item -c @var{val} +@item --codepage @var{val} +Specify the default codepage to use when reading an @code{rc} file. +@var{val} should be a hexadecimal prefixed by @samp{0x} or decimal +codepage code. The valid range is from zero up to 0xffff, but the +validity of the codepage is host and configuration dependent. + @item -l @var{val} @item --language @var{val} Specify the default language to use when reading an @code{rc} file. @@ -2999,8 +3539,8 @@ the language, and the high eight bits are the sublanguage. @item --use-temp-file Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and +the preprocessor. Use this option if the popen implementation is buggy +on the host (eg., certain non-English language versions of Windows 95 and Windows 98 are known to have buggy popen where the output will instead go the console). @@ -3059,7 +3599,8 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-b}|@option{--base-file} @var{base-file-name}] [@option{-e}|@option{--output-exp} @var{exports-file-name}] [@option{-z}|@option{--output-def} @var{def-file-name}] - [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{-y}|@option{--output-delaylib} @var{library-file-name}] [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] [@option{--exclude-symbols} @var{list}] [@option{--no-default-excludes}] @@ -3069,10 +3610,14 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-U}|@option{--add-underscore}] [@option{--add-stdcall-underscore}] [@option{-k}|@option{--kill-at}] [@option{-A}|@option{--add-stdcall-alias}] [@option{-p}|@option{--ext-prefix-alias} @var{prefix}] - [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] + [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] + [@option{--use-nul-prefixed-import-tables}] + [@option{-I}|@option{--identify} @var{library-file-name}] [@option{--identify-strict}] + [@option{-i}|@option{--interwork}] [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}] - [@option{-v}|@option{--verbose}] + [@option{-v}|@option{--verbose}] [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] + [@option{--no-leading-underscore}] [@option{--leading-underscore}] [object-file @dots{}] @c man end @end smallexample @@ -3084,8 +3629,8 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] line. It then processes these inputs and if the @option{-e} option has been specified it creates a exports file. If the @option{-l} option has been specified it creates a library file and if the @option{-z} option -has been specified it creates a def file. Any or all of the @option{-e}, -@option{-l} and @option{-z} options can be present in one invocation of +has been specified it creates a def file. Any or all of the @option{-e}, +@option{-l} and @option{-z} options can be present in one invocation of dlltool. When creating a DLL, along with the source for the DLL, it is necessary @@ -3106,7 +3651,7 @@ section of the object file. This can be done in C by using the asm() operator: @smallexample - asm (".section .drectve"); + asm (".section .drectve"); asm (".ascii \"-export:my_func\""); int my_func (void) @{ @dots{} @} @@ -3116,12 +3661,19 @@ The second file needed for DLL creation is an exports file. This file is linked with the object files that make up the body of the DLL and it handles the interface between the DLL and the outside world. This is a binary file and it can be created by giving the @option{-e} option to -@command{dlltool} when it is creating or reading in a @file{.def} file. +@command{dlltool} when it is creating or reading in a @file{.def} file. The third file needed for DLL creation is the library file that programs -will link with in order to access the functions in the DLL. This file -can be created by giving the @option{-l} option to dlltool when it -is creating or reading in a @file{.def} file. +will link with in order to access the functions in the DLL (an `import +library'). This file can be created by giving the @option{-l} option to +dlltool when it is creating or reading in a @file{.def} file. + +If the @option{-y} option is specified, dlltool generates a delay-import +library that can be used instead of the normal import library to allow +a program to link to the dll only as soon as an imported function is +called for the first time. The resulting executable will need to be +linked to the static delayimp library containing __delayLoadHelper2(), +which in turn will import LoadLibraryA and GetProcAddress from kernel32. @command{dlltool} builds the library file by hand, but it builds the exports file by creating temporary files containing assembler statements @@ -3144,6 +3696,11 @@ that uses that DLL: gcc program.o dll.lib -o program @end smallexample + +@command{dlltool} may also be used to query an existing import library +to determine the name of the DLL to which it is associated. See the +description of the @option{-I} or @option{--identify} option. + @c man end @c man begin OPTIONS dlltool @@ -3176,6 +3733,10 @@ Specifies the name of the @file{.def} file to be created by dlltool. @itemx --output-lib @var{filename} Specifies the name of the library file to be created by dlltool. +@item -y @var{filename} +@itemx --output-delaylib @var{filename} +Specifies the name of the delay-import library file to be created by dlltool. + @item --export-all-symbols Treat all global and weak defined symbols found in the input object files as symbols to be exported. There is a small list of symbols which @@ -3238,12 +3799,17 @@ contents of the DLL are actually encode using Thumb instructions. Specifies that when @command{dlltool} is creating the exports file it should add a section which allows the exported functions to be referenced without using the import library. Whatever the hell that -means! +means! @item -U @itemx --add-underscore Specifies that when @command{dlltool} is creating the exports file it -should prepend an underscore to the names of @emph{all} exported symbols. +should prepend an underscore to the names of @emph{all} exported symbols. + +@item --no-leading-underscore +@item --leading-underscore +Specifies whether standard symbol should be forced to be prefixed, or +not. @item --add-stdcall-underscore Specifies that when @command{dlltool} is creating the exports file it @@ -3277,12 +3843,32 @@ Specifies that when @command{dlltool} is creating the exports and library files it should omit the @code{.idata4} section. This is for compatibility with certain operating systems. +@item --use-nul-prefixed-import-tables +Specifies that when @command{dlltool} is creating the exports and library +files it should prefix the @code{.idata4} and @code{.idata5} by zero an +element. This emulates old gnu import library generation of +@code{dlltool}. By default this option is turned off. + @item -c @itemx --no-idata5 Specifies that when @command{dlltool} is creating the exports and library files it should omit the @code{.idata5} section. This is for compatibility with certain operating systems. +@item -I @var{filename} +@itemx --identify @var{filename} +Specifies that @command{dlltool} should inspect the import library +indicated by @var{filename} and report, on @code{stdout}, the name(s) +of the associated DLL(s). This can be performed in addition to any +other operations indicated by the other options and arguments. +@command{dlltool} fails if the import library does not exist or is not +actually an import library. See also @option{--identify-strict}. + +@item --identify-strict +Modifies the behavior of the @option{--identify} option, such +that an error is reported if @var{filename} is associated with +more than one DLL. + @item -i @itemx --interwork Specifies that @command{dlltool} should mark the objects in the library @@ -3300,7 +3886,7 @@ file. @itemx --temp-prefix @var{prefix} Makes @command{dlltool} use @var{prefix} when constructing the names of temporary assembler and object files. By default, the temp file prefix -is generated from the pid. +is generated from the pid. @item -v @itemx --verbose @@ -3335,19 +3921,21 @@ The result is going to be named @var{name}@code{.exe}. @item @code{LIBRARY} @var{name} @code{[ ,} @var{base} @code{]} The result is going to be named @var{name}@code{.dll}. -@item @code{EXPORTS ( ( (} @var{name1} @code{[ = } @var{name2} @code{] ) | ( } @var{name1} @code{=} @var{module-name} @code{.} @var{external-name} @code{) )} +@item @code{EXPORTS ( ( (} @var{name1} @code{[ = } @var{name2} @code{] ) | ( } @var{name1} @code{=} @var{module-name} @code{.} @var{external-name} @code{) ) [ == } @var{its_name} @code{]} @item @code{[} @var{integer} @code{] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *} Declares @var{name1} as an exported symbol from the DLL, with optional ordinal number @var{integer}, or declares @var{name1} as an alias -(forward) of the function @var{external-name} in the DLL +(forward) of the function @var{external-name} in the DLL. +If @var{its_name} is specified, this name is used as string in export table. @var{module-name}. -@item @code{IMPORTS ( (} @var{internal-name} @code{=} @var{module-name} @code{.} @var{integer} @code{) | [} @var{internal-name} @code{= ]} @var{module-name} @code{.} @var{external-name} @code{) ) *} +@item @code{IMPORTS ( (} @var{internal-name} @code{=} @var{module-name} @code{.} @var{integer} @code{) | [} @var{internal-name} @code{= ]} @var{module-name} @code{.} @var{external-name} @code{) [ == ) @var{its_name} @code{]} *} Declares that @var{external-name} or the exported function whose ordinal number is @var{integer} is to be imported from the file @var{module-name}. If @var{internal-name} is specified then this is the name that the imported function will be referred to in the body of the DLL. +If @var{its_name} is specified, this name is used as string in import table. @item @code{DESCRIPTION} @var{string} Puts @var{string} into the output @file{.exp} file in the @@ -3385,7 +3973,7 @@ The Info pages for @file{binutils}. @smallexample @c man begin SYNOPSIS readelf -readelf [@option{-a}|@option{--all}] +readelf [@option{-a}|@option{--all}] [@option{-h}|@option{--file-header}] [@option{-l}|@option{--program-headers}|@option{--segments}] [@option{-S}|@option{--section-headers}|@option{--sections}] @@ -3393,6 +3981,7 @@ readelf [@option{-a}|@option{--all}] [@option{-t}|@option{--section-details}] [@option{-e}|@option{--headers}] [@option{-s}|@option{--syms}|@option{--symbols}] + [@option{--dyn-syms}] [@option{-n}|@option{--notes}] [@option{-r}|@option{--relocs}] [@option{-u}|@option{--unwind}] @@ -3401,9 +3990,14 @@ readelf [@option{-a}|@option{--all}] [@option{-A}|@option{--arch-specific}] [@option{-D}|@option{--use-dynamic}] [@option{-x} |@option{--hex-dump=}] - [@option{-w[liaprmfFsoR]}| - @option{--debug-dump}[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]] - [@option{-I}|@option{-histogram}] + [@option{-p} |@option{--string-dump=}] + [@option{-R} |@option{--relocated-dump=}] + [@option{-c}|@option{--archive-index}] + [@option{-w[lLiaprmfFsoRt]}| + @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] + [@option{--dwarf-depth=@var{n}}] + [@option{--dwarf-start=@var{n}}] + [@option{-I}|@option{--histogram}] [@option{-v}|@option{--version}] [@option{-W}|@option{--wide}] [@option{-H}|@option{--help}] @@ -3430,7 +4024,7 @@ affected. The long and short forms of options, shown here as alternatives, are equivalent. At least one option besides @samp{-v} or @samp{-H} must be -given. +given. @table @env @item -a @@ -3438,7 +4032,7 @@ given. Equivalent to specifying @option{--file-header}, @option{--program-headers}, @option{--sections}, @option{--symbols}, @option{--relocs}, @option{--dynamic}, @option{--notes} and -@option{--version-info}. +@option{--version-info}. @item -h @itemx --file-header @@ -3478,6 +4072,11 @@ Displays the detailed section information. Implies @option{-S}. @cindex ELF symbol table information Displays the entries in symbol table section of the file, if it has one. +@item --dyn-syms +@cindex ELF dynamic symbol table information +Displays the entries in dynamic symbol table section of the file, if it +has one. + @item -e @itemx --headers Display all the headers in the file. Equivalent to @option{-h -l -S}. @@ -3496,7 +4095,8 @@ Displays the contents of the file's relocation section, if it has one. @itemx --unwind @cindex unwind information Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for IA64 ELF files are currently supported. +the unwind sections for IA64 ELF files, as well as ARM unwind tables +(@code{.ARM.exidx} / @code{.ARM.extab}) are currently supported. @item -d @itemx --dynamic @@ -3517,21 +4117,75 @@ is any. @item -D @itemx --use-dynamic When displaying symbols, this option makes @command{readelf} use the -symbol table in the file's dynamic section, rather than the one in the -symbols section. +symbol hash tables in the file's dynamic section, rather than the +symbol table sections. @item -x @itemx --hex-dump= -Displays the contents of the indicated section as a hexadecimal dump. +Displays the contents of the indicated section as a hexadecimal bytes. +A number identifies a particular section by index in the section table; +any other string identifies all sections with that name in the object file. + +@item -R +@itemx --relocated-dump= +Displays the contents of the indicated section as a hexadecimal +bytes. A number identifies a particular section by index in the +section table; any other string identifies all sections with that name +in the object file. The contents of the section will be relocated +before they are displayed. + +@item -p +@itemx --string-dump= +Displays the contents of the indicated section as printable strings. A number identifies a particular section by index in the section table; any other string identifies all sections with that name in the object file. -@item -w[liaprmfFsoR] -@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges] +@item -c +@itemx --archive-index +@cindex Archive file symbol index information +Displays the file symbol index infomation contained in the header part +of binary archives. Performs the same function as the @option{t} +command to @command{ar}, but without using the BFD library. @xref{ar}. + +@item -w[lLiaprmfFsoRt] +@itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index] Displays the contents of the debug sections in the file, if any are present. If one of the optional letters or words follows the switch then only data found in those specific sections will be dumped. +Note that there is no single letter option to display the content of +trace sections or .gdb_index. + +Note: the @option{=decodedline} option will display the interpreted +contents of a .debug_line section whereas the @option{=rawline} option +dumps the contents in a raw format. + +Note: the @option{=frames-interp} option will display the interpreted +contents of a .debug_frame section whereas the @option{=frames} option +dumps the contents in a raw format. + +Note: the output from the @option{=info} option can also be affected +by the options @option{--dwarf-depth} and @option{--dwarf-start}. + +@item --dwarf-depth=@var{n} +Limit the dump of the @code{.debug_info} section to @var{n} children. +This is only useful with @option{--debug-dump=info}. The default is +to print all DIEs; the special value 0 for @var{n} will also have this +effect. + +With a non-zero value for @var{n}, DIEs at or deeper than @var{n} +levels will not be printed. The range for @var{n} is zero-based. + +@item --dwarf-start=@var{n} +Print only DIEs beginning with the DIE numbered @var{n}. This is only +useful with @option{--debug-dump=info}. + +If specified, this option will suppress printing of any header +information and all DIEs before the DIE numbered @var{n}. Only +siblings and children of the specified DIE will be printed. + +This can be used in conjunction with @option{--dwarf-depth}. + @item -I @itemx --histogram Display a histogram of bucket list lengths when displaying the contents @@ -3563,6 +4217,98 @@ objdump(1), and the Info entries for @file{binutils}. @c man end @end ignore +@node elfedit +@chapter elfedit + +@cindex Update ELF header +@kindex elfedit + +@c man title elfedit Update the ELF header of ELF files. + +@smallexample +@c man begin SYNOPSIS elfedit +elfedit [@option{--input-mach=}@var{machine}] + [@option{--input-type=}@var{type}] + [@option{--input-osabi=}@var{osabi}] + @option{--output-mach=}@var{machine} + @option{--output-type=}@var{type} + @option{--output-osabi=}@var{osabi} + [@option{-v}|@option{--version}] + [@option{-h}|@option{--help}] + @var{elffile}@dots{} +@c man end +@end smallexample + +@c man begin DESCRIPTION elfedit + +@command{elfedit} updates the ELF header of ELF files which have +the matching ELF machine and file types. The options control how and +which fields in the ELF header should be updated. + +@var{elffile}@dots{} are the ELF files to be updated. 32-bit and +64-bit ELF files are supported, as are archives containing ELF files. +@c man end + +@c man begin OPTIONS elfedit + +The long and short forms of options, shown here as alternatives, are +equivalent. At least one of the @option{--output-mach}, +@option{--output-type} and @option{--output-osabi} options must be given. + +@table @env + +@itemx --input-mach=@var{machine} +Set the matching input ELF machine type to @var{machine}. If +@option{--input-mach} isn't specified, it will match any ELF +machine types. + +The supported ELF machine types are, @var{L1OM} and @var{x86-64}. + +@itemx --output-mach=@var{machine} +Change the ELF machine type in the ELF header to @var{machine}. The +supported ELF machine types are the same as @option{--input-mach}. + +@itemx --input-type=@var{type} +Set the matching input ELF file type to @var{type}. If +@option{--input-type} isn't specified, it will match any ELF file types. + +The supported ELF file types are, @var{rel}, @var{exec} and @var{dyn}. + +@itemx --output-type=@var{type} +Change the ELF file type in the ELF header to @var{type}. The +supported ELF types are the same as @option{--input-type}. + +@itemx --input-osabi=@var{osabi} +Set the matching input ELF file OSABI to @var{osabi}. If +@option{--input-osabi} isn't specified, it will match any ELF OSABIs. + +The supported ELF OSABIs are, @var{none}, @var{HPUX}, @var{NetBSD}, +@var{Linux}, @var{Hurd}, @var{Solaris}, @var{AIX}, @var{Irix}, +@var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS}, +@var{NSK}, @var{AROS} and @var{FenixOS}. + +@itemx --output-osabi=@var{osabi} +Change the ELF OSABI in the ELF header to @var{osabi}. The +supported ELF OSABI are the same as @option{--input-osabi}. + +@item -v +@itemx --version +Display the version number of @command{elfedit}. + +@item -h +@itemx --help +Display the command line options understood by @command{elfedit}. + +@end table + +@c man end + +@ignore +@c man begin SEEALSO elfedit +readelf(1), and the Info entries for @file{binutils}. +@c man end +@end ignore + @node Common Options @chapter Common Options @@ -3584,7 +4330,7 @@ Display the version number of the program. @end table @c man end -@node Selecting The Target System +@node Selecting the Target System @chapter Selecting the Target System You can specify two aspects of the target system to the @sc{gnu} @@ -3610,8 +4356,8 @@ once because some of them can only be configured @dfn{native} (on hosts with the same type as the target system). @menu -* Target Selection:: -* Architecture Selection:: +* Target Selection:: +* Architecture Selection:: @end menu @node Target Selection @@ -3940,6 +4686,9 @@ Such guesses are usually wrong. Even we cannot guess right about such things without first using the debugger to find the facts. @end itemize +@node GNU Free Documentation License +@appendix GNU Free Documentation License + @include fdl.texi @node Binutils Index @@ -3947,5 +4696,4 @@ things without first using the debugger to find the facts. @printindex cp -@contents @bye