ld.1

来自「基于4个mips核的noc设计」· 1 代码 · 共 1,509 行 · 第 1/4 页

1
1,509
字号
.B OUTPUT_FORMATcan also specify the output format, but this option overrides it..TP.BI "\-R " "filename"Read symbol names and their addresses from \c.I filename\c\&, 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..TP.B \-relaxAn option with machine dependent effects.  Currently this option is onlysupported on the H8/300.On some platforms, use this option to perform global optimizations thatbecome possible when the linker resolves addressing in your program, suchas relaxing address modes and synthesizing new instructions in theoutput object file.  On platforms where this is not supported, `\|\c.B \-relax\c\&\|' is accepted, but has no effect..TP.B \-r Generates relocatable output\(em\&i.e., generate an output file that can inturn serve as input to \c.B ld\c\&.  This is often called \c.I partiallinking\c\&.  As a side effect, in environments that support standard Unixmagic numbers, this option also sets the output file's magic number to\c.B OMAGIC\c\&.If this option is not specified, an absolute file is produced.  Whenlinking C++ programs, this option \c.I will not\c\& resolve references toconstructors; \c.B \-Ur\c\& is an alternative. This option does the same as \c.B \-i\c\&..TP.B \-rpath\ \fIdirectoryAdd a directory to the runtime library search path.  This is used whenlinking an ELF executable with shared objects.  All .B \-rpatharguments are concatenated and passed to the runtime linker, which usesthem to locate shared objects at runtime.  The.B \-rpathoption is also used when locating shared objects which are needed byshared objects explicitly included in the link; see the description ofthe.B \-rpath\-linkoption.  If.B \-rpathis not used when linking an ELF executable, the contents of theenvironment variable.B LD_RUN_PATHwill be used if it is defined.The.B \-rpathoption may also be used on SunOS.  By default, on SunOS, the linkerwill form a runtime search path out of all the.B \-Loptions it is given.  If a.B \-rpathoption is used, the runtime search path will be formed exclusivelyusing the.B \-rpathoptions, ignoringthe.B \-Loptions.  This can be useful when using gcc, which adds many.B \-Loptions which may be on NFS mounted filesystems..TP.B \-rpath\-link\ \fIdirectoryWhen using ELF or SunOS, one shared library may require another.  Thishappens when an.B ld\ \-sharedlink includes a shared library as one of 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.B \-rpath\-linkoption specifies the first set of directories to search.  The.B \-rpath\-linkoption may specify a sequence of directory names either by specifyinga list of names separated by colons, or by appearing multiple times.If the required shared library is not found, the linker will issue awarning and continue with the link..TP.B \-S Omits debugger symbol information (but not all symbols) from the output file..TP.B \-s Omits all symbol information from the output file..TP.B \-sharedCreate a shared library.  This is currently only supported on ELF andSunOS platforms (on SunOS it is not required, as the linker willautomatically create a shared library when there are undefined symbolsand the.B \-eoption is not used)..TP.B \-sort\-commonNormally, when.B ldplaces the global common symbols in the appropriate output sections,it sorts them by size.  First come all the one byte symbols, then allthe two bytes, then all the four bytes, and then everything else.This is to prevent gaps between symbols due toalignment constraints.  This option disables that sorting..TP.B \-split\-by\-reloc\ \fIcountTrys to creates extra sections in the output file so that no singleoutput section in the file contains more than.I countrelocations.This is useful when generating huge relocatable for downloading intocertain real time kernels with the COFF object file format; since COFFcannot 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 individualinput sections for redistribution, so if a single input sectioncontains more than.I countrelocations one output section will contain that many relocations..TP.B \-split\-by\-fileSimilar to.B \-split\-by\-relocbut creates a new output section for each input file..TP.BI "--section-start " "sectionname" "\fR=\fP"orgLocate a section in the output file at the absoluteaddress given by \c.I org\c\&.  \c\c.I org\c\& must be a hexadecimal integer.You may use this option as manytimes as necessary to locate multiple sections in the commandline.  If you need more elaborate expressions, considerusing the linker command language from a script..TP.BI "\-Tbss " "org"\c.TP.BI "\-Tdata " "org"\c.TP.BI "\-Ttext " "org"\cUse \c.I org\c\& as the starting address for\(em\&respectively\(em\&the\c.B bss\c\&, \c.B data\c\&, or the \c.B text\c\& segment of the output file.\c.I org\c\& must be a hexadecimal integer..TP.BI "\-T " "commandfile"Equivalent to \c.B \-c \c.I commandfile\c\&\c\&; supported for compatibility withother tools.  .TP.B \-t Prints names of input files as \c.B ld\c\& processes them..TP.BI "\-u " "sym"Forces \c.I sym\c\& to be entered in the output file as an undefined symbol.This may, for example, trigger linking of additional modules fromstandard libraries.  \c.B \-u\c\& may be repeated with different optionarguments to enter additional undefined symbols..TP.B \-Ur For anything other than C++ programs, this option is equivalent to\c.B \-r\c\&: it generates relocatable output\(em\&i.e., an output file that can inturn serve as input to \c.B ld\c\&.  When linking C++ programs, \c.B \-Ur.I will\c\& resolve references to constructors, unlike \c.B \-r\c\&..TP.B \-\-verboseDisplay the version number for \c.B ldand list the supported emulations.Display which input files can and can not be opened..TP.B \-v, \-VDisplay the version number for \c.B ld\c\&.The.B \-Voption also lists the supported emulations..TP.B \-\-versionDisplay the version number for \c.B ldand exit..TP.B \-warn\-commonWarn when a common symbol is combined with another common symbol or witha symbol definition.  Unix linkers allow this somewhat sloppy practice,but linkers on some other operating systems do not.  This option allowsyou to find potential problems from combining global symbols..TP.B \-warn\-constructorsWarn if any global constructors are used.  This is only useful for afew object file formats.  For formats like COFF or ELF, the linker cannot detect the use of global constructors..TP.B \-warn\-multiple\-gpWarn if the output file requires multiple global-pointer values.  Thisoption is only meaningful for certain processors, such as the Alpha..TP.B \-warn\-onceOnly warn once for each undefined symbol, rather than once per modulewhich refers to it..TP.B \-warn\-section\-alignWarn if the address of an output section is changed because ofalignment.  Typically, the alignment will be set by an input section.The address will only be changed if it not explicitly specified; thatis, if the SECTIONS command does not specify a start address for thesection..TP.B \-\-whole\-archiveFor each archive mentioned on the command line after the.B \-\-whole\-archiveoption, include every object file in the archive in the link, ratherthan searching the archive for the required object files.  This isnormally used to turn an archive file into a shared library, forcingevery object to be included in the resulting shared library..TP.B \-\-no\-whole\-archiveTurn off the effect of the.B \-\-whole\-archiveoption for archives which appear later on the command line..TP.BI "--wrap " "symbol"Use a wrapper function for .I symbol.Any undefined reference to.I symbolwill be resolved to.BI "__wrap_" "symbol".Any undefined reference to.BI "__real_" "symbol"will be resolved to.I symbol..TP.B \-X Delete all temporary local symbols.  For most targets, this is all localsymbols whose names begin with `\|\c.B L\c\|'..TP.B \-xDelete all local symbols..PP.SH ENVIRONMENT\cYou can change the behavior of.B ld\c\& with the environment variable \c.B GNUTARGET\c\&.\c.B GNUTARGET\c\& determines the input-file object format if you don'tuse \c.B \-b\c\& (or its synonym \c.B \-format\c\&).  Its value should be oneof the BFD names for an input format.  If there is no\c.B GNUTARGET\c\& in the environment, \c.B ld\c\& uses the natural formatof the host. If \c.B GNUTARGET\c\& is set to \c.B default\c\& then BFD attempts to discover theinput format by examining binary input files; this method oftensucceeds, but there are potential ambiguities, since there is no methodof ensuring that the magic number used to flag object-file formats isunique.  However, the configuration procedure for BFD on each systemplaces the conventional format for that system first in the search-list,so ambiguities are resolved in favor of convention..PP.SH "SEE ALSO".BR objdump ( 1 ).br.br.RB "`\|" ld "\|' and `\|" binutils "\|'"entries in.B info\c.br.I ld: the GNU linker\c, Steve Chamberlain and Roland Pesch;.IThe GNU Binary Utilities\c, Roland H. Pesch..SH COPYING

⌨️ 快捷键说明

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