⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ld.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<A NAME="IDX34"></A><DT><CODE>-g</CODE><DD>Ignored.  Provided for compatibility with other tools.<A NAME="IDX35"></A><A NAME="IDX36"></A><DT><CODE>-G<VAR>value</VAR></CODE><DD><DT><CODE>-G <VAR>value</VAR></CODE><DD>Set the maximum size of objects to be optimized using the GP register to<VAR>size</VAR> under MIPS ECOFF.  Ignored for other object file formats.<A NAME="IDX37"></A><A NAME="IDX38"></A><A NAME="IDX39"></A><DT><CODE>-help</CODE><DD>Print a summary of the command-line options on the standard output and exit.<A NAME="IDX40"></A><A NAME="IDX41"></A><DT><CODE>-i</CODE><DD>Perform an incremental link (same as option <SAMP>`-r'</SAMP>).<A NAME="IDX42"></A><A NAME="IDX43"></A><DT><CODE>-l<VAR>ar</VAR></CODE><DD>Add archive file <VAR>archive</VAR> to the list of files to link.  This option may be used any number of times.  <CODE>ld</CODE> will search itspath-list for occurrences of <CODE>lib<VAR>ar</VAR>.a</CODE> for every <VAR>archive</VAR>specified.<A NAME="IDX44"></A><A NAME="IDX45"></A><DT><CODE>-L<VAR>searchdir</VAR></CODE><DD><DT><CODE>-L <VAR>searchdir</VAR></CODE><DD>Add path <VAR>searchdir</VAR> to the list of paths that <CODE>ld</CODE> will searchfor archive libraries and <CODE>ld</CODE> control scripts.  You may use thisoption any number of times.  The directories are searched in the orderin which they are specified on the command line.  Directories specifiedon the command line are searched before the default directories.  All<CODE>-L</CODE> options apply to all <CODE>-l</CODE> options, regardless of theorder in which the options appear.The default set of paths searched (without being specified with<SAMP>`-L'</SAMP>) depends on which emulation mode <CODE>ld</CODE> is using, and insome cases also on how it was configured.  See section <A HREF="ld.html#SEC4">Environment Variables</A>.The paths can also be specified in a link script with the<CODE>SEARCH_DIR</CODE> command.  Directories specified this way are searchedat the point in which the linker script appears in the command line.<A NAME="IDX46"></A><A NAME="IDX47"></A><DT><CODE>-M</CODE><DD>Print (to the standard output) a link map--diagnostic information aboutwhere symbols are mapped by <CODE>ld</CODE>, and information on global commonstorage allocation.<A NAME="IDX48"></A><A NAME="IDX49"></A><DT><CODE>-Map <VAR>mapfile</VAR></CODE><DD>Print to the file <VAR>mapfile</VAR> a link map--diagnostic informationabout where symbols are mapped by <CODE>ld</CODE>, and information on globalcommon storage allocation.<A NAME="IDX50"></A><A NAME="IDX51"></A><DT><CODE>-m<VAR>emulation</VAR></CODE><DD><DT><CODE>-m <VAR>emulation</VAR></CODE><DD>Emulate the <VAR>emulation</VAR> linker.  You can list the availableemulations with the <SAMP>`--verbose'</SAMP> or <SAMP>`-V'</SAMP> options.  The defaultdepends on how your <CODE>ld</CODE> was configured.<A NAME="IDX52"></A><A NAME="IDX53"></A><A NAME="IDX54"></A><DT><CODE>-N</CODE><DD>Set the text and data sections to be readable and writable.  Also, donot page-align the data segment.  If the output format supports Unixstyle magic numbers, mark the output as <CODE>OMAGIC</CODE>.<A NAME="IDX55"></A><A NAME="IDX56"></A><A NAME="IDX57"></A><DT><CODE>-n</CODE><DD>Set the text segment to be read only, and mark the output as<CODE>NMAGIC</CODE> if possible.<A NAME="IDX58"></A><A NAME="IDX59"></A><DT><CODE>-noinhibit-exec</CODE><DD>Retain the executable output file whenever it is still usable.Normally, the linker will not produce an output file if it encounterserrors during the link process; it exits without writing an output filewhen it issues any error whatsoever.<A NAME="IDX60"></A><A NAME="IDX61"></A><DT><CODE>-no-keep-memory</CODE><DD><CODE>ld</CODE> normally optimizes for speed over memory usage by caching thesymbol tables of input files in memory.  This option tells <CODE>ld</CODE> toinstead optimize for memory usage, by rereading the symbol tables asnecessary.  This may be required if <CODE>ld</CODE> runs out of memory spacewhile linking a large executable.<A NAME="IDX62"></A><A NAME="IDX63"></A><DT><CODE>-o <VAR>output</VAR></CODE><DD>Use <VAR>output</VAR> as the name for the program produced by <CODE>ld</CODE>; if thisoption is not specified, the name <TT>`a.out'</TT> is used by default.  Thescript command <CODE>OUTPUT</CODE> can also specify the output file name.<A NAME="IDX64"></A><DT><CODE>-oformat <VAR>output-format</VAR></CODE><DD><CODE>ld</CODE> may be configured to support more than one kind of objectfile.  If your <CODE>ld</CODE> is configured this way, you can use the<SAMP>`-oformat'</SAMP> option to specify the binary format for the outputobject file.  Even when <CODE>ld</CODE> is configured to support alternativeobject formats, you don't usually need to specify this, as <CODE>ld</CODE>should be configured to produce as a default output format the mostusual format on each machine.  <VAR>output-format</VAR> is a text string, thename of a particular format supported by the BFD libraries.  (You canlist the available binary formats with <SAMP>`objdump -i'</SAMP>.)  The scriptcommand <CODE>OUTPUT_FORMAT</CODE> can also specify the output format, butthis option overrides it.  See section <A HREF="ld.html#SEC26">BFD</A>.<A NAME="IDX65"></A><A NAME="IDX66"></A><DT><CODE>-R <VAR>filename</VAR></CODE><DD>Read symbol names and their addresses from <VAR>filename</VAR>, but do notrelocate it or include it in the output.  This allows your output fileto refer symbolically to absolute locations of memory defined in otherprograms. <A NAME="IDX67"></A><A NAME="IDX68"></A><A NAME="IDX69"></A><DT><CODE>-relax</CODE><DD>An option with machine dependent effects.  Currently this option is only supported on the H8/300 and the Intel 960.See section <A HREF="ld.html#SEC25"><CODE>ld</CODE> and the Intel 960 family</A>.On some platforms, the <SAMP>`-relax'</SAMP> option performs global optimizations thatbecome possible when the linker resolves addressing in the program, suchas relaxing address modes and synthesizing new instructions in theoutput object file.  On platforms where this is not supported, <SAMP>`-relax'</SAMP> is accepted, butignored.<A NAME="IDX70"></A><A NAME="IDX71"></A><A NAME="IDX72"></A><DT><CODE>-retain-symbols-file <VAR>filename</VAR></CODE><DD>Retain <EM>only</EM> the symbols listed in the file <VAR>filename</VAR>,discarding all others.  <VAR>filename</VAR> is simply a flat file, with onesymbol name per line.  This option is especially useful in environments(such as VxWorks)where a large global symbol table is accumulated gradually, to conserverun-time memory.<SAMP>`-retain-symbols-file'</SAMP> does <EM>not</EM> discard undefined symbols,or symbols needed for relocations.You may only specify <SAMP>`-retain-symbols-file'</SAMP> once in the commandline.  It overrides <SAMP>`-s'</SAMP> and <SAMP>`-S'</SAMP>.<DT><CODE>-rpath <VAR>dir</VAR></CODE><DD><A NAME="IDX73"></A><A NAME="IDX74"></A>Add a directory to the runtime library search path.  This is used whenlinking an ELF executable with shared objects.  All <CODE>-rpath</CODE>arguments are concatenated and passed to the runtime linker, which usesthem to locate shared objects at runtime.  The <CODE>-rpath</CODE> option isalso used when locating shared objects which are needed by sharedobjects explicitly included in the link; see the description of the<CODE>-rpath-link</CODE> option.  If <CODE>-rpath</CODE> is not used when linking anELF executable, the contents of the environment variable<CODE>LD_RUN_PATH</CODE> will be used if it is defined.The <CODE>-rpath</CODE> option may also be used on SunOS.  By default, onSunOS, the linker will form a runtime search patch out of all the<CODE>-L</CODE> options it is given.  If a <CODE>-rpath</CODE> option is used, theruntime search path will be formed exclusively using the <CODE>-rpath</CODE>options, ignoring the <CODE>-L</CODE> options.  This can be useful when usinggcc, which adds many <CODE>-L</CODE> options which may be on NFS mountedfilesystems.<A NAME="IDX75"></A><A NAME="IDX76"></A><DT><CODE>-rpath-link <VAR>DIR</VAR></CODE><DD>When using ELF or SunOS, one shared library may require another.  Thishappens when an <CODE>ld -shared</CODE> link includes a shared library as oneof the input files.When the linker encounters such a dependency when doing a non-shared,non-relocateable link, it will automatically try to locate the requiredshared library and include it in the link, if it is not includedexplicitly.  In such a case, the <CODE>-rpath-link</CODE> optionspecifies the first set of directories to search.  The<CODE>-rpath-link</CODE> option may specify a sequence of directory nameseither by specifying a list of names separated by colons, or byappearing multiple times.The linker uses the following search paths to locate required sharedlibraries.<OL><LI>Any directories specified by <CODE>-rpath-link</CODE> options.<LI>Any directories specified by <CODE>-rpath</CODE> options.  The differencebetween <CODE>-rpath</CODE> and <CODE>-rpath-link</CODE> is that directoriesspecified by <CODE>-rpath</CODE> options are included in the executable andused at runtime, whereas the <CODE>-rpath-link</CODE> option is only effectiveat link time.<LI>On an ELF system, if the <CODE>-rpath</CODE> and <CODE>rpath-link</CODE> optionswere not used, search the contents of the environment variable<CODE>LD_RUN_PATH</CODE>.<LI>On SunOS, if the <CODE>-rpath</CODE> option was not used, search anydirectories specified using <CODE>-L</CODE> options.<LI>For a native linker, the contents of the environment variable<CODE>LD_LIBRARY_PATH</CODE>.<LI>The default directories, normally <TT>`/lib'</TT> and <TT>`/usr/lib'</TT>.</OL>If the required shared library is not found, the linker will issue awarning and continue with the link.<A NAME="IDX77"></A><A NAME="IDX78"></A><A NAME="IDX79"></A><DT><CODE>-r</CODE><DD>Generate relocatable output--i.e., generate an output file that can inturn serve as input to <CODE>ld</CODE>.  This is often called <EM>partiallinking</EM>.  As a side effect, in environments that support standard Unixmagic numbers, this option also sets the output file's magic number to<CODE>OMAGIC</CODE>.If this option is not specified, an absolute file is produced.  Whenlinking C++ programs, this option <EM>will not</EM> resolve references toconstructors; to do that, use <SAMP>`-Ur'</SAMP>.This option does the same thing as <SAMP>`-i'</SAMP>.<A NAME="IDX80"></A><A NAME="IDX81"></A><DT><CODE>-S</CODE><DD>Omit debugger symbol information (but not all symbols) from the output file.<A NAME="IDX82"></A><A NAME="IDX83"></A><DT><CODE>-s</CODE><DD>Omit all symbol information from the output file.<A NAME="IDX84"></A><A NAME="IDX85"></A><DT><CODE>-soname <VAR>name</VAR></CODE><DD>When creating an ELF shared object, set the internal DT_SONAME field tothe specified name.  When an executable is linked with a shared objectwhich has a DT_SONAME field, then when the executable is run the dynamiclinker will attempt to load the shared object specified by the DT_SONAMEfield rather than the using the file name given to the linker.<DT><CODE>-shared</CODE><DD><A NAME="IDX86"></A><A NAME="IDX87"></A>Create a shared library.  This is currently only supported on ELF andSunOS platforms.  On SunOS, the linker will automatically create ashared library if the <CODE>-e</CODE> option is not used and there areundefined symbols in the link.<DT><CODE>-sort-common</CODE><DD><A NAME="IDX88"></A>Normally, when <CODE>ld</CODE> places the global common symbols in theappropriate output sections, it sorts them by size.  First come all theone byte symbols, then all the two bytes, then all the four bytes, andthen everything else.  This is to prevent gaps between symbols due toalignment constraints.  This option disables that sorting.<A NAME="IDX89"></A><DT><CODE>-split-by-reloc <VAR>count</VAR></CODE><DD>Trys to creates extra sections in the output file so that no single output sectionin the file contains more than <VAR>count</VAR> relocations.  Thisis useful when generating huge relocatable for downloading intocertain real time kernels with the COFF object file format; sinceCOFF cannot represent more than 65535 relocations in a single section.Note that this will fail to work with object file formats which do notsupport arbitrary sections.  The linker will not split up individual inputsections for redistribution,  so if a single input section containsmore than <VAR>count</VAR> relocations one output section will contain thatmany relocations.<A NAME="IDX90"></A><DT><CODE>-split-by-file</CODE><DD>Similar to -split-by-reloc but creates a new output section for eachinput file.<DT><CODE>-stats</CODE><DD>Compute and display statistics about the operation of the linker,such as execution time and memory usage.<A NAME="IDX91"></A><A NAME="IDX92"></A><A NAME="IDX93"></A><A NAME="IDX94"></A><DT><CODE>-Tbss <VAR>org</VAR></CODE><DD><DT><CODE>-Tdata <VAR>org</VAR></CODE><DD><DT><CODE>-Ttext <VAR>org</VAR></CODE><DD>Use <VAR>org</VAR> as the starting address for--respectively--the<CODE>bss</CODE>, <CODE>data</CODE>, or the <CODE>text</CODE> segment of the output file.<VAR>org</VAR> must be a single hexadecimal integer;for compatibility with other linkers, you may omit the leading<SAMP>`0x'</SAMP> usually associated with hexadecimal values.<A NAME="IDX95"></A><A NAME="IDX96"></A><DT><CODE>-T <VAR>commandfile</VAR></CODE><DD><DT><CODE>-T<VAR>commandfile</VAR></CODE><DD>Read link commands from the file <VAR>commandfile</VAR>.  These commandsreplace <CODE>ld</CODE>'s default link script (rather than addingto it), so <VAR>commandfile</VAR> must specify everything necessary to describethe target format.  See section <A HREF="ld.html#SEC5">Command Language</A>.  If <VAR>commandfile</VAR> does notexist, <CODE>ld</CODE> looks for it in the directories specified by anypreceding <SAMP>`-L'</SAMP> options.  Multiple <SAMP>`-T'</SAMP> options accumulate.<A NAME="IDX97"></A><A NAME="IDX98"></A><A NAME="IDX99"></A><DT><CODE>-t</CODE><DD>Print the names of the input files as <CODE>ld</CODE> processes them.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -