📄 binutils.html
字号:
<P><A NAME="IDX77"></A><A NAME="IDX78"></A><A NAME="IDX79"></A></P><PRE>ranlib [-vV] <VAR>archive</VAR></PRE><P><CODE>ranlib</CODE> generates an index to the contents of an archive andstores it in the archive. The index lists each symbol defined by amember of an archive that is a relocatable object file. </P><P>You may use <SAMP>`nm -s'</SAMP> or <SAMP>`nm --print-armap'</SAMP> to list this index.</P><P>An archive with such an index speeds up linking to the library andallows routines in the library to call each other without regard totheir placement in the archive.</P><P>The GNU <CODE>ranlib</CODE> program is another form of GNU <CODE>ar</CODE>; running<CODE>ranlib</CODE> is completely equivalent to executing <SAMP>`ar -s'</SAMP>.See section <A HREF="binutils.html#SEC1">ar</A>.</P><DL COMPACT><DT><CODE>-v</CODE><DD><DT><CODE>-V</CODE><DD>Show the version number of <CODE>ranlib</CODE>.</DL><H1><A NAME="SEC8" HREF="binutils_toc.html#TOC8">size</A></H1><P><A NAME="IDX80"></A><A NAME="IDX81"></A></P><PRE>size [ -A | -B | --format=<VAR>compatibility</VAR> ] [ --help ] [ -d | -o | -x | --radix=<VAR>number</VAR> ] [ --target=<VAR>bfdname</VAR> ] [ -V | --version ] <VAR>objfile</VAR>...</PRE><P>The GNU <CODE>size</CODE> utility lists the section sizes--and the totalsize--for each of the object or archive files <VAR>objfile</VAR> in itsargument list. By default, one line of output is generated for eachobject file or each module in an archive.</P><P><VAR>objfile</VAR>... are the object files to be examined.</P><P>The command line options have the following meanings:</P><DL COMPACT><DT><CODE>-A</CODE><DD><DT><CODE>-B</CODE><DD><DT><CODE>--format=<VAR>compatibility</VAR></CODE><DD><A NAME="IDX82"></A>Using one of these options, you can choose whether the output from GNU<CODE>size</CODE> resembles output from System V <CODE>size</CODE> (using <SAMP>`-A'</SAMP>,or <SAMP>`--format=sysv'</SAMP>), or Berkeley <CODE>size</CODE> (using <SAMP>`-B'</SAMP>, or<SAMP>`--format=berkeley'</SAMP>). The default is the one-line format similar toBerkeley's. Here is an example of the Berkeley (default) format of output from<CODE>size</CODE>: <PRE>size --format=Berkeley ranlib sizetext data bss dec hex filename294880 81920 11592 388392 5ed28 ranlib294880 81920 11888 388688 5ee50 size</PRE>This is the same data, but displayed closer to System V conventions:<PRE>size --format=SysV ranlib sizeranlib :section size addr.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 </PRE><DT><CODE>--help</CODE><DD>Show a summary of acceptable arguments and options.<DT><CODE>-d</CODE><DD><DT><CODE>-o</CODE><DD><DT><CODE>-x</CODE><DD><DT><CODE>--radix=<VAR>number</VAR></CODE><DD><A NAME="IDX83"></A><A NAME="IDX84"></A>Using one of these options, you can control whether the size of eachsection is given in decimal (<SAMP>`-d'</SAMP>, or <SAMP>`--radix=10'</SAMP>); octal(<SAMP>`-o'</SAMP>, or <SAMP>`--radix=8'</SAMP>); or hexadecimal (<SAMP>`-x'</SAMP>, or<SAMP>`--radix=16'</SAMP>). In <SAMP>`--radix=<VAR>number</VAR>'</SAMP>, only the threevalues (8, 10, 16) are supported. The total size is always given in tworadices; decimal and hexadecimal for <SAMP>`-d'</SAMP> or <SAMP>`-x'</SAMP> output, oroctal and hexadecimal if you're using <SAMP>`-o'</SAMP>.<DT><CODE>--target=<VAR>bfdname</VAR></CODE><DD><A NAME="IDX85"></A>Specify that the object-code format for <VAR>objfile</VAR> is<VAR>bfdname</VAR>. This option may not be necessary; <CODE>size</CODE> canautomatically recognize many formats.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<DT><CODE>-V</CODE><DD><DT><CODE>--version</CODE><DD>Display the version number of <CODE>size</CODE>.</DL><H1><A NAME="SEC9" HREF="binutils_toc.html#TOC9">strings</A></H1><P><A NAME="IDX86"></A><A NAME="IDX87"></A><A NAME="IDX88"></A><A NAME="IDX89"></A></P><PRE>strings [-afov] [-<VAR>min-len</VAR>] [-n <VAR>min-len</VAR>] [-t <VAR>radix</VAR>] [-] [--all] [--print-file-name] [--bytes=<VAR>min-len</VAR>] [--radix=<VAR>radix</VAR>] [--target=<VAR>bfdname</VAR>] [--help] [--version] <VAR>file</VAR>...</PRE><P>For each <VAR>file</VAR> given, GNU <CODE>strings</CODE> prints the printablecharacter sequences that are at least 4 characters long (or the numbergiven with the options below) and are followed by an unprintablecharacter. By default, it only prints the strings from the initializedand loaded sections of object files; for other types of files, it printsthe strings from the whole file.</P><P><CODE>strings</CODE> is mainly useful for determining the contents of non-textfiles.</P><DL COMPACT><DT><CODE>-a</CODE><DD><DT><CODE>--all</CODE><DD><DT><CODE>-</CODE><DD>Do not scan only the initialized and loaded sections of object files;scan the whole files.<DT><CODE>-f</CODE><DD><DT><CODE>--print-file-name</CODE><DD>Print the name of the file before each string.<DT><CODE>--help</CODE><DD>Print a summary of the program usage on the standard output and exit.<DT><CODE>-<VAR>min-len</VAR></CODE><DD><DT><CODE>-n <VAR>min-len</VAR></CODE><DD><DT><CODE>--bytes=<VAR>min-len</VAR></CODE><DD>Print sequences of characters that are at least <VAR>min-len</VAR> characterslong, instead of the default 4.<DT><CODE>-o</CODE><DD>Like <SAMP>`-t o'</SAMP>. Some other versions of <CODE>strings</CODE> have <SAMP>`-o'</SAMP>act like <SAMP>`-t d'</SAMP> instead. Since we can not be compatible with bothways, we simply chose one.<DT><CODE>-t <VAR>radix</VAR></CODE><DD><DT><CODE>--radix=<VAR>radix</VAR></CODE><DD>Print the offset within the file before each string. The singlecharacter argument specifies the radix of the offset---<SAMP>`o'</SAMP> foroctal, <SAMP>`x'</SAMP> for hexadecimal, or <SAMP>`d'</SAMP> for decimal.<DT><CODE>--target=<VAR>bfdname</VAR></CODE><DD><A NAME="IDX90"></A>Specify an object code format other than your system's default format.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<DT><CODE>-v</CODE><DD><DT><CODE>--version</CODE><DD>Print the program version number on the standard output and exit.</DL><H1><A NAME="SEC10" HREF="binutils_toc.html#TOC10">strip</A></H1><P><A NAME="IDX91"></A><A NAME="IDX92"></A><A NAME="IDX93"></A><A NAME="IDX94"></A></P><PRE>strip [ -F <VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> | --target=<VAR>bfdname</VAR> ] [ -I <VAR>bfdname</VAR> | --input-target=<VAR>bfdname</VAR> ] [ -O <VAR>bfdname</VAR> | --output-target=<VAR>bfdname</VAR> ] [ -s | --strip-all ] [ -S | -g | --strip-debug ] [ -K <VAR>symbolname</VAR> | --keep-symbol=<VAR>symbolname</VAR> ] [ -N <VAR>symbolname</VAR> | --strip-symbol=<VAR>symbolname</VAR> ] [ -x | --discard-all ] [ -X | --discard-locals ] [ -R <VAR>sectionname</VAR> | --remove-section=<VAR>sectionname</VAR> ] [ -v | --verbose ] [ -V | --version ] [ --help ] <VAR>objfile</VAR>...</PRE><P>GNU <CODE>strip</CODE> discards all symbols from object files<VAR>objfile</VAR>. The list of object files may include archives.At least one object file must be given.</P><P><CODE>strip</CODE> modifies the files named in its argument,rather than writing modified copies under different names.</P><DL COMPACT><DT><CODE>-F <VAR>bfdname</VAR></CODE><DD><DT><CODE>--target=<VAR>bfdname</VAR></CODE><DD>Treat the original <VAR>objfile</VAR> as a file with the objectcode format <VAR>bfdname</VAR>, and rewrite it in the same format.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<DT><CODE>--help</CODE><DD>Show a summary of the options to <CODE>strip</CODE> and exit.<DT><CODE>-I <VAR>bfdname</VAR></CODE><DD><DT><CODE>--input-target=<VAR>bfdname</VAR></CODE><DD>Treat the original <VAR>objfile</VAR> as a file with the objectcode format <VAR>bfdname</VAR>.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<DT><CODE>-O <VAR>bfdname</VAR></CODE><DD><DT><CODE>--output-target=<VAR>bfdname</VAR></CODE><DD>Replace <VAR>objfile</VAR> with a file in the output format <VAR>bfdname</VAR>.See section <A HREF="binutils.html#SEC13">Target Selection</A>, for more information.<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>Remove all symbols.<DT><CODE>-g</CODE><DD><DT><CODE>-S</CODE><DD><DT><CODE>--strip-debug</CODE><DD>Remove debugging symbols only.<DT><CODE>--strip-unneeded</CODE><DD>Remove 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>Keep 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>Remove symbol <VAR>symbolname</VAR> from the source file. This option may begiven more than once, and may be combined with strip options other than<CODE>-K</CODE>.<DT><CODE>-x</CODE><DD><DT><CODE>--discard-all</CODE><DD>Remove non-global symbols.<DT><CODE>-X</CODE><DD><DT><CODE>--discard-locals</CODE><DD>Remove compiler-generated local symbols.(These usually start with <SAMP>`L'</SAMP> or <SAMP>`.'</SAMP>.)<DT><CODE>-V</CODE><DD><DT><CODE>--version</CODE><DD>Show the version number for <CODE>strip</CODE>.<DT><CODE>-v</CODE><DD><DT><CODE>--verbose</CODE><DD>Verbose output: list all object files modified. In the case ofarchives, <SAMP>`strip -v'</SAMP> lists all members of the archive.</DL><H1><A NAME="SEC11" HREF="binutils_toc.html#TOC11">c++filt</A></H1><P><A NAME="IDX95"></A><A NAME="IDX96"></A></P><PRE>c++filt [ -_ | --strip-underscores ] [ -n | --no-strip-underscores ] [ -s <VAR>format</VAR> | --format=<VAR>format</VAR> ] [ --help ] [ --version ] [ <VAR>symbol</VAR>... ]</PRE><P>The C++ language provides function overloading, which means that you canwrite many functions with the same name (providing each takes parametersof different types). All C++ function names are encoded into alow-level assembly label (this process is known as<EM>mangling</EM>). The <CODE>c++filt</CODE> program does the inverse mapping: itdecodes (<EM>demangles</EM>) low-level names into user-level names so thatthe linker can keep these overloaded functions from clashing.</P><P>Every alphanumeric word (consisting of letters, digits, underscores,dollars, or periods) seen in the input is a potential label. If thelabel decodes into a C++ name, the C++ name replaces the low-levelname in the output.</P><P>You can use <CODE>c++filt</CODE> to decipher individual symbols:</P><PRE>c++filt <VAR>symbol</VAR></PRE><P>If no <VAR>symbol</VAR> arguments are given, <CODE>c++filt</CODE> reads symbolnames from the standard input and writes the demangled names to thestandard output. All results are printed on the standard output.</P><DL COMPACT><DT><CODE>-_</CODE><DD><DT><CODE>--strip-underscores</CODE><DD>On some systems, both the C and C++ compilers put an underscore in frontof every name. For example, the C name <CODE>foo</CODE> gets the low-levelname <CODE>_foo</CODE>. This option removes the initial underscore. Whether<CODE>c++filt</CODE> removes the underscore by default is target dependent.<DT><CODE>-n</CODE><DD><DT><CODE>--no-strip-underscores</CODE><DD>Do not remove the initial underscore.<DT><CODE>-s <VAR>format</VAR></CODE><DD><DT><CODE>--format=<VAR>format</VAR></CODE><DD>GNU <CODE>nm</CODE> can decode three different methods of mangling, used bydifferent C++ compilers. The argument to this option selects which
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -