📄 binutils.html
字号:
<DT><CODE>-R <VAR>sectionname</VAR></CODE><DD><DT><CODE>--remove-section=<VAR>sectionname</VAR></CODE><DD>Remove any section named <VAR>sectionname</VAR> from the output file. Thisoption may be given more than once. Note that using this optioninappropriately may make the output file unusable.<DT><CODE>-S</CODE><DD><DT><CODE>--strip-all</CODE><DD>Do not copy relocation and symbol information from the source file.<DT><CODE>-g</CODE><DD><DT><CODE>--strip-debug</CODE><DD>Do not copy debugging symbols from the source file.<DT><CODE>--strip-unneeded</CODE><DD>Strip all symbols that are not needed for relocation processing.<DT><CODE>-K <VAR>symbolname</VAR></CODE><DD><DT><CODE>--keep-symbol=<VAR>symbolname</VAR></CODE><DD>Copy only symbol <VAR>symbolname</VAR> from the source file. This option maybe given more than once.<DT><CODE>-N <VAR>symbolname</VAR></CODE><DD><DT><CODE>--strip-symbol=<VAR>symbolname</VAR></CODE><DD>Do not copy symbol <VAR>symbolname</VAR> from the source file. This optionmay be given more than once, and may be combined with strip optionsother than <CODE>-K</CODE>.<DT><CODE>-x</CODE><DD><DT><CODE>--discard-all</CODE><DD>Do not copy non-global symbols from the source file.<DT><CODE>-X</CODE><DD><DT><CODE>--discard-locals</CODE><DD>Do not copy compiler-generated local symbols.(These usually start with <SAMP>`L'</SAMP> or <SAMP>`.'</SAMP>.)<DT><CODE>-b <VAR>byte</VAR></CODE><DD><DT><CODE>--byte=<VAR>byte</VAR></CODE><DD>Keep only every <VAR>byte</VAR>th byte of the input file (header data is notaffected). <VAR>byte</VAR> can be in the range from 0 to <VAR>interleave</VAR>-1,where <VAR>interleave</VAR> is given by the <SAMP>`-i'</SAMP> or <SAMP>`--interleave'</SAMP>option, or the default of 4. This option is useful for creating filesto program ROM. It is typically used with an <CODE>srec</CODE> outputtarget.<DT><CODE>-i <VAR>interleave</VAR></CODE><DD><DT><CODE>--interleave=<VAR>interleave</VAR></CODE><DD>Only copy one out of every <VAR>interleave</VAR> bytes. Select which byte tocopy with the <VAR>-b</VAR> or <SAMP>`--byte'</SAMP> option. The default is 4.<CODE>objcopy</CODE> ignores this option if you do not specify either <SAMP>`-b'</SAMP> or<SAMP>`--byte'</SAMP>.<DT><CODE>--debugging</CODE><DD>Convert debugging information, if possible. This is not the defaultbecause only certain debugging formats are supported, and theconversion process can be time consuming.<DT><CODE>--gap-fill <VAR>val</VAR></CODE><DD>Fill gaps between sections with <VAR>val</VAR>. This is done by increasingthe size of the section with the lower address, and filling in the extraspace created with <VAR>val</VAR>.<DT><CODE>--pad-to <VAR>address</VAR></CODE><DD>Pad the output file up to the virtual address <VAR>address</VAR>. This isdone by increasing the size of the last section. The extra space isfilled in with the value specified by <SAMP>`--gap-fill'</SAMP> (default zero).<DT><CODE>--set-start <VAR>val</VAR></CODE><DD>Set the address of the new file to <VAR>val</VAR>. Not all object fileformats support setting the start address.<DT><CODE>--adjust-start <VAR>incr</VAR></CODE><DD>Adjust the start address by adding <VAR>incr</VAR>. Not all object fileformats support setting the start address.<DT><CODE>--adjust-vma <VAR>incr</VAR></CODE><DD>Adjust the address of all sections, as well as the start address, byadding <VAR>incr</VAR>. Some object file formats do not permit sectionaddresses to be changed arbitrarily. Note that this does not relocatethe sections; if the program expects sections to be loaded at a certainaddress, and this option is used to change the sections such that theyare loaded at a different address, the program may fail.<DT><CODE>--adjust-section-vma <VAR>section</VAR>{=,+,-}<VAR>val</VAR></CODE><DD>Set or adjust the address of the named <VAR>section</VAR>. If <SAMP>`='</SAMP> isused, the section address is set to <VAR>val</VAR>. Otherwise, <VAR>val</VAR> isadded to or subtracted from the section address. See the comments under<SAMP>`--adjust-vma'</SAMP>, above. If <VAR>section</VAR> does not exist in theinput file, a warning will be issued, unless <SAMP>`--no-adjust-warnings'</SAMP>is used.<DT><CODE>--adjust-warnings</CODE><DD>If <SAMP>`--adjust-section-vma'</SAMP> is used, and the named section does notexist, issue a warning. This is the default.<DT><CODE>--no-adjust-warnings</CODE><DD>Do not issue a warning if <SAMP>`--adjust-section-vma'</SAMP> is used, even ifthe named section does not exist.<DT><CODE>--set-section-flags <VAR>section</VAR>=<VAR>flags</VAR></CODE><DD>Set the flags for the named section. The <VAR>flags</VAR> argument is acomma separated string of flag names. The recognized names are<SAMP>`alloc'</SAMP>, <SAMP>`load'</SAMP>, <SAMP>`readonly'</SAMP>, <SAMP>`code'</SAMP>, <SAMP>`data'</SAMP>,and <SAMP>`rom'</SAMP>. Not all flags are meaningful for all object fileformats.<DT><CODE>--add-section <VAR>sectionname</VAR>=<VAR>filename</VAR></CODE><DD>Add a new section named <VAR>sectionname</VAR> while copying the file. Thecontents of the new section are taken from the file <VAR>filename</VAR>. Thesize of the section will be the size of the file. This option onlyworks on file formats which can support sections with arbitrary names.<DT><CODE>--remove-leading-char</CODE><DD>If the first character of a global symbol is a special symbol leadingcharacter used by the object file format, remove the character. Themost common symbol leading character is underscore. This option willremove a leading underscore from all global symbols. This can be usefulif you want to link together objects of different file formats withdifferent conventions for symbol names.<DT><CODE>-V</CODE><DD><DT><CODE>--version</CODE><DD>Show the version number of <CODE>objcopy</CODE>.<DT><CODE>-v</CODE><DD><DT><CODE>--verbose</CODE><DD>Verbose output: list all object files modified. In the case ofarchives, <SAMP>`objcopy -V'</SAMP> lists all members of the archive.<DT><CODE>--help</CODE><DD>Show a summary of the options to <CODE>objcopy</CODE>.</DL><H1><A NAME="SEC6" HREF="binutils_toc.html#TOC6">objdump</A></H1><P><A NAME="IDX47"></A><A NAME="IDX48"></A></P><PRE>objdump [ -a | --archive-headers ] [ -b <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ --debugging ] [ -d | --disassemble ] [ -D | --disassemble-all ] [ -f | --file-headers ] [ -h | --section-headers | --headers ] [ -i | --info ] [ -j <VAR>section</VAR> | --section=<VAR>section</VAR> ] [ -l | --line-numbers ] [ -S | --source ] [ -m <VAR>machine</VAR> | --architecture=<VAR>machine</VAR> ] [ -r | --reloc ] [ -R | --dynamic-reloc ] [ -s | --full-contents ] [ --stabs ] [ -t | --syms ] [ -T | --dynamic-syms ] [ -x | --all-headers ] [ --version ] [ --help ] <VAR>objfile</VAR>... [ -w | --wide ] [ --start-address=<VAR>address</VAR> ] [ --stop-address=<VAR>address</VAR> ] [ --show-raw-insn ] [ --version ] [ --help ] <VAR>objfile</VAR>...</PRE><P><CODE>objdump</CODE> displays information about one or more object files.The options control what particular information to display. Thisinformation is mostly useful to programmers who are working on thecompilation tools, as opposed to programmers who just want theirprogram to compile and work.</P><P><VAR>objfile</VAR>... are the object files to be examined. When youspecify archives, <CODE>objdump</CODE> shows information on each of the memberobject files.</P><P>The long and short forms of options, shown here as alternatives, areequivalent. At least one option besides <SAMP>`-l'</SAMP> must be given.</P><DL COMPACT><DT><CODE>-a</CODE><DD><DT><CODE>--archive-header</CODE><DD><A NAME="IDX49"></A>If any of the <VAR>objfile</VAR> files are archives, display the archiveheader information (in a format similar to <SAMP>`ls -l'</SAMP>). Besides theinformation you could list with <SAMP>`ar tv'</SAMP>, <SAMP>`objdump -a'</SAMP> showsthe object file format of each archive member.<DT><CODE>-b <VAR>bfdname</VAR></CODE><DD><DT><CODE>--target=<VAR>bfdname</VAR></CODE><DD><A NAME="IDX50"></A>Specify that the object-code format for the object files is<VAR>bfdname</VAR>. This option may not be necessary; <VAR>objdump</VAR> canautomatically recognize many formats.For example,<PRE>objdump -b oasys -m vax -h fu.o</PRE>displays summary information from the section headers (<SAMP>`-h'</SAMP>) of<TT>`fu.o'</TT>, which is explicitly identified (<SAMP>`-m'</SAMP>) as a VAX objectfile in the format produced by Oasys compilers. You can list theformats available with the <SAMP>`-i'</SAMP> option.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<DT><CODE>--debugging</CODE><DD>Display debugging information. This attempts to parse debugginginformation stored in the file and print it out using a C like syntax.Only certain types of debugging information have been implemented.<DT><CODE>-d</CODE><DD><DT><CODE>--disassemble</CODE><DD><A NAME="IDX51"></A><A NAME="IDX52"></A>Display the assembler mnemonics for the machine instructions from<VAR>objfile</VAR>. This option only disassembles those sections which areexpected to contain instructions.<DT><CODE>-D</CODE><DD><DT><CODE>--disassemble-all</CODE><DD>Like <SAMP>`-d'</SAMP>, but disassemble the contents of all sections, not justthose expected to contain instructions.<DT><CODE>-f</CODE><DD><DT><CODE>--file-header</CODE><DD><A NAME="IDX53"></A>Display summary information from the overall header ofeach of the <VAR>objfile</VAR> files.<DT><CODE>-h</CODE><DD><DT><CODE>--section-header</CODE><DD><DT><CODE>--header</CODE><DD><A NAME="IDX54"></A>Display summary information from the section headers of theobject file.File segments may be relocated to nonstandard addresses, for example byusing the <SAMP>`-Ttext'</SAMP>, <SAMP>`-Tdata'</SAMP>, or <SAMP>`-Tbss'</SAMP> options to<CODE>ld</CODE>. However, some object file formats, such as a.out, do notstore the starting address of the file segments. In those situations,although <CODE>ld</CODE> relocates the sections correctly, using <SAMP>`objdump-h'</SAMP> to list the file section headers cannot show the correct addresses.Instead, it shows the usual addresses, which are implicit for thetarget.<DT><CODE>--help</CODE><DD>Print a summary of the options to <CODE>objdump</CODE> and exit.<DT><CODE>-i</CODE><DD><DT><CODE>--info</CODE><DD><A NAME="IDX55"></A><A NAME="IDX56"></A>Display a list showing all architectures and object formats availablefor specification with <SAMP>`-b'</SAMP> or <SAMP>`-m'</SAMP>.<DT><CODE>-j <VAR>name</VAR></CODE><DD><DT><CODE>--section=<VAR>name</VAR></CODE><DD><A NAME="IDX57"></A>Display information only for section <VAR>name</VAR>.<DT><CODE>-l</CODE><DD><DT><CODE>--line-numbers</CODE><DD><A NAME="IDX58"></A>Label the display (using debugging information) with the filenameand source line numbers corresponding to the object code shown.Only useful with <SAMP>`-d'</SAMP> or <SAMP>`-D'</SAMP>.<DT><CODE>-m <VAR>machine</VAR></CODE><DD><DT><CODE>--architecture=<VAR>machine</VAR></CODE><DD><A NAME="IDX59"></A>Specify that the object files <VAR>objfile</VAR> are for architecture<VAR>machine</VAR>. You can list available architectures using the <SAMP>`-i'</SAMP>option. <DT><CODE>-r</CODE><DD><DT><CODE>--reloc</CODE><DD><A NAME="IDX60"></A>Print the relocation entries of the file. If used with <SAMP>`-d'</SAMP> or<SAMP>`-D'</SAMP>, the relocations are printed interspersed with thedisassembly.<DT><CODE>-R</CODE><DD><DT><CODE>--dynamic-reloc</CODE><DD><A NAME="IDX61"></A>Print the dynamic relocation entries of the file. This is onlymeaningful for dynamic objects, such as certain types of sharedlibraries.<DT><CODE>-s</CODE><DD><DT><CODE>--full-contents</CODE><DD><A NAME="IDX62"></A><A NAME="IDX63"></A>Display the full contents of any sections requested.<DT><CODE>-S</CODE><DD><DT><CODE>--source</CODE><DD><A NAME="IDX64"></A><A NAME="IDX65"></A>Display source code intermixed with disassembly, if possible. Implies<SAMP>`-d'</SAMP>.<DT><CODE>--show-raw-insn</CODE><DD>When disassembling instructions, print the instruction in hex as well asin symbolic form. Not all targets handle this correctly yet.<DT><CODE>--stabs</CODE><DD><A NAME="IDX66"></A><A NAME="IDX67"></A><A NAME="IDX68"></A><A NAME="IDX69"></A>Display the full contents of any sections requested. Display thecontents of the .stab and .stab.index and .stab.excl sections from anELF file. This is only useful on systems (such as Solaris 2.0) in which<CODE>.stab</CODE> debugging symbol-table entries are carried in an ELFsection. In most other file formats, debugging symbol-table entries areinterleaved with linkage symbols, and are visible in the <SAMP>`--syms'</SAMP>output. For more information on stabs symbols, see section `Stabs Overview' in <CITE>The "stabs" debug format</CITE>.<DT><CODE>--start-address=<VAR>address</VAR></CODE><DD><A NAME="IDX70"></A>Start displaying data at the specified address. This affects the outputof the <CODE>-d</CODE>, <CODE>-r</CODE> and <CODE>-s</CODE> options.<DT><CODE>--stop-address=<VAR>address</VAR></CODE><DD><A NAME="IDX71"></A>Stop displaying data at the specified address. This affects the outputof the <CODE>-d</CODE>, <CODE>-r</CODE> and <CODE>-s</CODE> options.<DT><CODE>-t</CODE><DD><DT><CODE>--syms</CODE><DD><A NAME="IDX72"></A>Print the symbol table entries of the file.This is similar to the information provided by the <SAMP>`nm'</SAMP> program.<DT><CODE>-T</CODE><DD><DT><CODE>--dynamic-syms</CODE><DD><A NAME="IDX73"></A>Print the dynamic symbol table entries of the file. This is onlymeaningful for dynamic objects, such as certain types of sharedlibraries. This is similar to the information provided by the <SAMP>`nm'</SAMP>program when given the <SAMP>`-D'</SAMP> (<SAMP>`--dynamic'</SAMP>) option.<DT><CODE>--version</CODE><DD>Print the version number of <CODE>objdump</CODE> and exit.<DT><CODE>-x</CODE><DD><DT><CODE>--all-header</CODE><DD><A NAME="IDX74"></A><A NAME="IDX75"></A>Display all available header information, including the symbol table andrelocation entries. Using <SAMP>`-x'</SAMP> is equivalent to specifying all of<SAMP>`-a -f -h -r -t'</SAMP>.<DT><CODE>-w</CODE><DD><DT><CODE>--wide</CODE><DD><A NAME="IDX76"></A>Format some lines for output devices that have more than 80 columns.</DL><H1><A NAME="SEC7" HREF="binutils_toc.html#TOC7">ranlib</A></H1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -