X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fdoc%2Fbinutils.texi;h=3874f25a3b6d67f0a86d32c0049fd423402cd101;hb=8d112f9ecbe59b0eee3ec636a86891a6a82e4d9b;hp=4c1f02423a1032f6e226d04008d57e46083acd83;hpb=2f3bb96af7966880e7378a1633f6ffe1ea7a6587;p=binutils-gdb.git diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 4c1f02423a1..3874f25a3b6 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -10,8 +10,7 @@ @copying @c man begin COPYRIGHT -Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright @copyright{} 1991-2014 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.3 @@ -44,6 +43,7 @@ section entitled ``GNU Free Documentation License''. * 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 @@ -111,6 +111,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}) @@ -125,7 +128,7 @@ Convert object code into a Netware Loadable Module Manipulate Windows resources @item windmc -Genertor for Windows message resources +Generator for Windows message resources @item dlltool Create the files needed to build and use Dynamic Link Libraries @@ -142,7 +145,6 @@ in the 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 * size:: List section sizes and total size * strings:: List printable strings from files * strip:: Discard symbols @@ -150,9 +152,11 @@ in the section entitled ``GNU Free Documentation License''. * 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 +* windres:: Manipulate Windows resources * dlltool:: Create files needed to build and use DLLs +* readelf:: Display the contents of ELF format files +* elfedit:: Update the ELF header of ELF files * Common Options:: Command-line options for all utilities * Selecting the Target System:: How these utilities determine the target * Reporting Bugs:: Reporting Bugs @@ -170,7 +174,7 @@ in the 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 [-]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@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 @@ -1535,6 +1720,64 @@ currently only supports the presence of one filename containing debugging information, not multiple filenames on a one-per-object-file basis. +@item --strip-dwo +Remove the contents of all DWARF .dwo sections, leaving the +remaining debugging sections and all symbols intact. +This option is intended for use by the compiler as part of +the @option{-gsplit-dwarf} option, which splits debug information +between the .o file and a separate .dwo file. The compiler +generates all debug information in the same file, then uses +the @option{--extract-dwo} option to copy the .dwo sections to +the .dwo file, then the @option{--strip-dwo} option to remove +those sections from the original .o file. + +@item --extract-dwo +Extract the contents of all DWARF .dwo sections. See the +@option{--strip-dwo} option for more information. + +@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: @@ -1549,6 +1792,12 @@ 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}. @@ -1603,10 +1852,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}] @@ -1618,6 +1869,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{} @@ -1642,7 +1896,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 @@ -1716,6 +1970,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. @@ -1799,6 +2057,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 @@ -1861,6 +2126,15 @@ Print the 'raw' instruction mnemonic instead of some pseudo instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', 'sll' instead of 'nop', etc. +@item msa +Disassemble MSA instructions. + +@item virt +Disassemble the virtualization ASE instructions. + +@item xpa +Disassemble the eXtended Physical Address (XPA) ASE instructions. + @item gpr-names=@var{ABI} Print GPR (general-purpose register) names as appropriate for the specified ABI. By default, GPR names are selected according to @@ -1910,6 +2184,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}, +@option{toc} and @option{ldinfo}. + @item -r @itemx --reloc @cindex relocation entries, in object file @@ -1922,7 +2207,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 @@ -1938,6 +2225,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 @@ -1947,12 +2244,47 @@ 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}, the @option{--dwarf-start} and +the @option{--dwarf-check}. + +@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 --dwarf-check +Enable additional checks for consistency of Dwarf information. @item -G @itemx --stabs @@ -1967,10 +2299,6 @@ ELF file. This is only useful on systems (such as Solaris 2.0) in which section. In most other file formats, debugging symbol-table entries are interleaved with linkage symbols, and are visible in the @option{--syms} output. -@ifclear man -For more information on stabs symbols, see @ref{Top,Stabs,Stabs -Overview,stabs.info, The ``stabs'' debug format}. -@end ifclear @item --start-address=@var{address} @cindex start-address @@ -2027,11 +2355,16 @@ The flag characters are divided into 7 groups as follows: @table @code @item l @itemx g +@itemx u @itemx ! -The symbol is local (l), global (g), neither (a space) or both (!). A +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. +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). @@ -2119,7 +2452,7 @@ nm(1), readelf(1), and the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS ranlib -ranlib [@option{-vVt}] @var{archive} +ranlib [@option{--plugin} @var{name}] [@option{-DhHvVt}] @var{archive} @c man end @end smallexample @@ -2144,13 +2477,42 @@ The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; @c man begin OPTIONS ranlib @table @env +@item -h +@itemx -H +@itemx --help +Show usage information for @command{ranlib}. + @item -v @itemx -V @itemx --version Show the version number of @command{ranlib}. +@item -D +@cindex deterministic archives +@kindex --enable-deterministic-archives +Operate in @emph{deterministic} mode. The symbol map archive member's +header will show zero for the UID, GID, and timestamp. When this +option is used, multiple runs will produce identical output files. + +If @file{binutils} was configured with +@option{--enable-deterministic-archives}, then this mode is on by +default. It can be disabled with the @samp{-U} option, described +below. + @item -t Update the timestamp of the symbol map of an archive. + +@item -U +@cindex deterministic archives +@kindex --enable-deterministic-archives +Do @emph{not} operate in @emph{deterministic} mode. This is the +inverse of the @samp{-D} option, above: the archive index will get +actual UID, GID, timestamp, and file mode values. + +If @file{binutils} was configured @emph{without} +@option{--enable-deterministic-archives}, then this mode is on by +default. + @end table @c man end @@ -2297,12 +2659,13 @@ 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}] [@option{-}] [@option{--all}] [@option{--print-file-name}] [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] + [@option{-w}] [@option{--include-all-whitespace}] [@option{--help}] [@option{--version}] @var{file}@dots{} @c man end @end smallexample @@ -2371,8 +2734,16 @@ 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. + +@item -w +@itemx --include-all-whitespace +By default tab and space characters are included in the strings that +are displayed, but other whitespace characters, such a newlines and +carriage returns, are not. The @option{-w} option changes this so +that all whitespace characters are considered to be part of a string. @end table @c man end @@ -2401,12 +2772,15 @@ strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}] [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname}] [@option{-s}|@option{--strip-all}] [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}] + [@option{--strip-dwo}] [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname}] [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname}] [@option{-w}|@option{--wildcard}] [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}] [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}] [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}] + [@option{-D}|@option{--enable-deterministic-archives}] + [@option{-U}|@option{--disable-deterministic-archives}] [@option{--keep-file-symbols}] [@option{--only-keep-debug}] [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] @@ -2456,7 +2830,9 @@ Replace @var{objfile} with a file in the output format @var{bfdname}. @itemx --remove-section=@var{sectionname} Remove any section named @var{sectionname} from the output file. This option may be given more than once. Note that using this option -inappropriately may make the output file unusable. +inappropriately may make the output file unusable. The wildcard +character @samp{*} may be given at the end of @var{sectionname}. If +so, then any section starting with @var{sectionname} will be removed. @item -s @itemx --strip-all @@ -2468,6 +2844,12 @@ Remove all symbols. @itemx --strip-debug Remove debugging symbols only. +@item --strip-dwo +Remove the contents of all DWARF .dwo sections, leaving the +remaining debugging sections and all symbols intact. +See the description of this option in the @command{objcopy} section +for more information. + @item --strip-unneeded Remove all symbols that are not needed for relocation processing. @@ -2491,6 +2873,30 @@ argument may be specified. @itemx --preserve-dates Preserve the access and modification dates of the file. +@item -D +@itemx --enable-deterministic-archives +@cindex deterministic archives +@kindex --enable-deterministic-archives +Operate in @emph{deterministic} mode. When copying archive members +and writing the archive index, use zero for UIDs, GIDs, timestamps, +and use consistent file modes for all files. + +If @file{binutils} was configured with +@option{--enable-deterministic-archives}, then this mode is on by default. +It can be disabled with the @samp{-U} option, below. + +@item -U +@itemx --disable-deterministic-archives +@cindex deterministic archives +@kindex --enable-deterministic-archives +Do @emph{not} operate in @emph{deterministic} mode. This is the +inverse of the @option{-D} option, above: when copying archive members +and writing the archive index, use their actual UID, GID, timestamp, +and file mode values. + +This is the default unless @file{binutils} was configured with +@option{--enable-deterministic-archives}. + @item -w @itemx --wildcard Permit regular expressions in @var{symbolname}s used in other command @@ -2594,8 +3000,8 @@ the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS cxxfilt -c++filt [@option{-_}|@option{--strip-underscores}] - [@option{-n}|@option{--no-strip-underscores}] +c++filt [@option{-_}|@option{--strip-underscore}] + [@option{-n}|@option{--no-strip-underscore}] [@option{-p}|@option{--no-params}] [@option{-t}|@option{--types}] [@option{-i}|@option{--no-verbose}] @@ -2675,19 +3081,14 @@ characters trailing after a mangled name. For example: @table @env @item -_ -@itemx --strip-underscores +@itemx --strip-underscore On some systems, both the C and C++ compilers put an underscore in front 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 +@itemx --no-strip-underscore Do not remove the initial underscore. @item -p @@ -2778,11 +3179,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{}] @@ -2811,12 +3214,34 @@ standard input, and prints the file name and line number for each address on standard output. In this mode, @command{addr2line} may be used in a pipe to convert dynamically chosen addresses. -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 +The format of the output is @samp{FILENAME:LINENO}. By default +each input address generates one line of output. + +Two options can generate additional lines before each +@samp{FILENAME:LINENO} line (in that order). + +If the @option{-a} option is used then a line with the input address +is displayed. + +If the @option{-f} option is used, then a line with the +@samp{FUNCTIONNAME} is displayed. This is the name of the function containing the address. +One option can generate additional lines after the +@samp{FILENAME:LINENO} line. + +If the @option{-i} option is used and the code at the given address is +present there because of inlining by the compiler then additional +lines are displayed afterwards. One or two extra lines (if the +@option{-f} option is used) are displayed for each inlined function. + +Alternatively if the @option{-p} option is used then each input +address generates a single, long, output line containing the address, +the function name, the file name and the line number. If the +@option{-i} option has also been used then any inlined functions will +be displayed in the same manner, but on separate lines, and prefixed +by the text @samp{(inlined by)}. + If the file name or function name can not be determined, @command{addr2line} will print two question marks in their place. If the line number can not be determined, @command{addr2line} will print 0. @@ -2829,6 +3254,12 @@ The long and short forms of options, shown here as alternatives, are equivalent. @table @env +@item -a +@itemx --addresses +Display the address before the function name, 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 @@ -2870,6 +3301,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 @@ -2998,7 +3435,7 @@ utilities, since it is only useful for Windows targets. @c man title windmc generates Windows message resources. @smallexample -@c man begin SYNOPSIS windres +@c man begin SYNOPSIS windmc windmc [options] input-file @c man end @end smallexample @@ -3038,12 +3475,12 @@ Windows Message Compiler. @table @env @item -a @itemx --ascii_in -Specifies that the input file specified is ANSI. This is the default +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 ANSI +Specifies that messages in the output @code{bin} files should be in ASCII format. @item -b @@ -3259,6 +3696,13 @@ 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. @@ -3364,6 +3808,7 @@ dlltool [@option{-d}|@option{--input-def} @var{def-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{-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}] @@ -3374,10 +3819,13 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@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{--identify} @var{library-file-name}] [@option{-i}|@option{--interwork}] + [@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{-h}|@option{--help}] [@option{-V}|@option{--version}] + [@option{--no-leading-underscore}] [@option{--leading-underscore}] [object-file @dots{}] @c man end @end smallexample @@ -3428,6 +3876,13 @@ 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 and then assembling these. The @option{-S} command line option can be @@ -3451,9 +3906,9 @@ that uses that DLL: @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 +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 @@ -3486,6 +3941,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 @@ -3555,6 +4014,11 @@ means! Specifies that when @command{dlltool} is creating the exports file it 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 should prepend an underscore to the names of exported @emph{stdcall} @@ -3587,6 +4051,12 @@ 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 @@ -3596,12 +4066,16 @@ 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 of -the associated DLL. This can be performed in addition to any other -operations indicated by the other options and arguments. @command{dlltool} -@option{--identify} fails if the import library does not exist, is not -actually an import library, or (rarely) if the import library somehow -specifies more than one associated DLL. +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 @@ -3654,20 +4128,31 @@ 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}. +Note: If you want to use LIBRARY as name then you need to quote. Otherwise +this will fail due a necessary hack for libtool (see PR binutils/13710 for more +details). -@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}. +Note: The @code{EXPORTS} has to be the last command in .def file, as keywords +are treated - beside @code{LIBRARY} - as simple name-identifiers. +If you want to use LIBRARY as name then you need to quote it. -@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. +Note: The @code{IMPORTS} has to be the last command in .def file, as keywords +are treated - beside @code{LIBRARY} - as simple name-identifiers. +If you want to use LIBRARY as name then you need to quote it. @item @code{DESCRIPTION} @var{string} Puts @var{string} into the output @file{.exp} file in the @@ -3713,6 +4198,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}] @@ -3722,10 +4208,13 @@ readelf [@option{-a}|@option{--all}] [@option{-D}|@option{--use-dynamic}] [@option{-x} |@option{--hex-dump=}] [@option{-p} |@option{--string-dump=}] + [@option{-R} |@option{--relocated-dump=}] [@option{-c}|@option{--archive-index}] - [@option{-w[lLiaprmfFsoR]}| - @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]] - [@option{-I}|@option{-histogram}] + [@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}] @@ -3800,6 +4289,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}. @@ -3818,7 +4312,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 @@ -3827,7 +4322,7 @@ Displays the contents of the file's dynamic section, if it has one. @item -V @itemx --version-info -@cindex ELF version sections informations +@cindex ELF version sections information Displays the contents of the version sections in the file, it they exist. @@ -3839,15 +4334,23 @@ 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. @@ -3857,20 +4360,49 @@ any other string identifies all sections with that name in the object file. @item -c @itemx --archive-index @cindex Archive file symbol index information -Displays the file symbol index infomation contained in the header part +Displays the file symbol index information 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[lLiaprmfFsoR] -@itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges] +@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 @@ -3902,6 +4434,100 @@ 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 + +@item --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}, @var{K1OM} and +@var{x86-64}. + +@item --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}. + +@item --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}. + +@item --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}. + +@item --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{GNU}, @var{Linux} (alias for @var{GNU}), +@var{Solaris}, @var{AIX}, @var{Irix}, +@var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS}, +@var{NSK}, @var{AROS} and @var{FenixOS}. + +@item --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 @@ -4281,7 +4907,7 @@ things without first using the debugger to find the facts. @node GNU Free Documentation License @appendix GNU Free Documentation License - + @include fdl.texi @node Binutils Index