ld.1

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

1
1,509
字号
You may want to use this option if you are linking files with an unusualbinary format.  You can also use \c.B \-b\c\& to switch formats explicitly (whenlinking object files of different formats), by including\c.B \-b \c.I input-format\c\&\c\& before each group of object files in aparticular format.  The default format is taken from the environment variable.B GNUTARGET\c\&.  You can also define the inputformat from a script, using the command \c.B TARGET\c\&..TP.B \-Bstatic Do not link against shared libraries.  This is only meaningful onplatforms for which shared libraries are supported..TP.B \-BdynamicLink against dynamic libraries.  This is only meaningful on platformsfor which shared libraries are supported.  This option is normally thedefault on such platforms..TP.B \-BgroupSet the \c.B DF_1_GROUP\cflag in the \c.B DT_FLAGS_1\centry in the dynamic section.  This causes the runtime linker to handlelookups in this object and its dependencies to be performed only insidethe group.  No undefined symbols are allowed.  This option is onlymeaningful on ELF platforms which support shared libraries..TP.B \-BsymbolicWhen creating a shared library, bind references to global symbols tothe definition within the shared library, if any.  Normally, it ispossible for a program linked against a shared library to override thedefinition within the shared library.  This option is only meaningfulon ELF platforms which support shared libraries..TP.BI "\-c " "commandfile"Directs \c.B ld\c\& to read link commands from the file\c.I commandfile\c\&.  These commands will completely override \c.B ld\c\&'sdefault link format (rather than adding to it); \c.I commandfile\c\& mustspecify everything necessary to describe the target format.You may also include a script of link commands directly in the commandline by bracketing it between `\|\c.B {\c\|' and `\|\c.B }\c\|' characters..TP.B \-\-crefOutput a cross reference table.  If a linker map file is beinggenerated, the cross reference table is printed to the map file.Otherwise, it is printed on the standard output..TP.B \-d .TP.B \-dc.TP.B \-dpThese three options are equivalent; multiple forms are supported forcompatibility with other linkers.  Use any of them to make \c.B ldassign space to common symbols even if a relocatable output file isspecified (\c.B \-r\c\&).  The script command\c.B FORCE_COMMON_ALLOCATION\c\& has the same effect..TP.BI "-defsym " "symbol" "\fR=\fP" expressionCreate a global symbol in the output file, containing the absoluteaddress given by \c.I expression\c\&.  You may use this option as manytimes as necessary to define multiple symbols in the command line.  Alimited form of arithmetic is supported for the \c.I expression\c\& in thiscontext: you may give a hexadecimal constant or the name of an existingsymbol, or use \c.B +\c\& and \c.B \-\c\& to add or subtract hexadecimalconstants or symbols.  If you need more elaborate expressions, considerusing the linker command language from a script..TP.B \-\-demangle.TP.B \-\-no\-demangleThese options control whether to demangle symbol names in errormessages and other output.  When the linker is told to demangle, ittries to present symbol names in a readable fashion: it strips leadingunderscores if they are used by the object file format, and convertsC++ mangled symbol names into user readable names.  The linker willdemangle by default unless the environment variable.B COLLECT_NO_DEMANGLEis set.  These options may be used to override the default..TP.BI "-e " "entry"\c\& Use \c.I entry\c\& as the explicit symbol for beginning execution of yourprogram, rather than the default entry point.  See the `\|\c.B ld\c\|' entry in `\|\c.B info\c\|' for adiscussion of defaults and other ways of specifying theentry point..TP.B \-embedded\-relocsThis option is only meaningful when linking MIPS embedded PIC code,generated by the.B \-membedded\-picoption to the GNU compiler and assembler.  It causes the linker tocreate a table which may be used at runtime to relocate any data whichwas statically initialized to pointer values.  See the code intestsuite/ld-empic for details..TP.B \-E.TP.B \-export\-dynamicWhen creating an ELF file, add all symbols to the dynamic symbol table.Normally, the dynamic symbol table contains only symbols which are usedby a dynamic object.  This option is needed for some uses of.I dlopen..TP.BI "-f " "name".TP.BI "--auxiliary " "name"When creating an ELF shared object, set the internal DT_AUXILIARY fieldto the specified name.  This tells the dynamic linker that the symboltable of the shared object should be used as an auxiliary filter on thesymbol table of the shared object.I name..TP.BI "-F " "name".TP.BI "--filter " "name"When creating an ELF shared object, set the internal DT_FILTER field tothe specified name.  This tells the dynamic linker that the symbol tableof the shared object should be used as a filter on the symbol table ofthe shared object.I name..TP.BI "\-format " "input\-format"Synonym for \c.B \-b\c\& \c.I input\-format\c\&..TP.B \-gAccepted, but ignored; provided for compatibility with other tools..TP.BI "\-G " "size"\cSet the maximum size of objects to be optimized using the GP registerto.I sizeunder MIPS ECOFF.  Ignored for other object file formats..TP.BI "-h " "name".TP.BI "-soname " "name"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..TP.B \-\-helpPrint a summary of the command-line options on the standard output and exit.This option and.B \-\-versionbegin with two dashes instead of onefor compatibility with other GNU programs.  The other options start withonly one dash for compatibility with other linkers..TP.B \-iPerform an incremental link (same as option \c.B \-r\c\&)..TP.BI "\-l" "ar"\c\& Add an archive file \c.I ar\c\& to the list of files to link.  This option may be used any number of times.  \c.B ld\c\& will search itspath-list for occurrences of \c.B lib\c.I ar\c\&.a\c\& for every \c.I arspecified..TP.BI "\-L" "searchdir"This command adds path \c.I searchdir\c\& to the list of paths that\c.B ld\c\& will search for archive libraries.  You may use this optionany number of times.The default set of paths searched (without being specified with\c.B \-L\c\&) depends on what emulation mode \c.B ld\c\& is using, and insome cases also on how it was configured.    Thepaths can also be specified in a link script with the \c.B SEARCH_DIRcommand..TP.B \-M Print (to the standard output file) a link map\(em\&diagnostic informationabout where symbols are mapped by \c.B ld\c\&, and information on globalcommon storage allocation..TP.BI "\-Map " "mapfile"\cPrint to the file.I mapfilea link map\(em\&diagnostic informationabout where symbols are mapped by \c.B ld\c\&, and information on globalcommon storage allocation..TP.BI "\-m " "emulation"\cEmulate the.I emulationlinker.  You can list the available emulations with the.I \-\-verboseor.I \-Voptions.  This option overrides the compiled-in default, which is thesystem for which you configured.BR ld ..TP.B \-N specifies readable and writable \c.B text\c\& and \c.B data\c\& sections. Ifthe output format supports Unix style magic numbers, the output ismarked as \c.B OMAGIC\c\&.When you use the `\|\c.B \-N\c\&\|' option, the linker does not page-align thedata segment..TP.B \-n sets the text segment to be read only, and \c.B NMAGIC\c\& is writtenif possible..TP.B \-noinhibit\-execNormally, the linker will not produce an output file if it encounterserrors during the link process.  With this flag, you can specify thatyou wish the output file retained even after non-fatal errors..TP.B \-no\-keep\-memoryThe linker normally optimizes for speed over memory usage by cachingthe symbol tables of input files in memory.  This option tells thelinker to instead optimize for memory usage, by rereading the symboltables as necessary.  This may be required if the linker runs out ofmemory space while linking a large executable..TP.B \-no\-warn\-mismatchNormally the linker will give an error if you try to link togetherinput files that are mismatched for some reason, perhaps because theyhave been compiled for different processors or for differentendiannesses.  This option tells the linker that it should silentlypermit such possible errors.  This option should only be used withcare, in cases when you have taken some special action that ensuresthat the linker errors are inappropriate..TP.BI "\-o " "output".I output\c\& is a name for the program produced by \c.B ld\c\&; if thisoption is not specified, the name `\|\c.B a.out\c\|' is used by default.  Thescript command \c.B OUTPUT\c\& can also specify the output file name..TP.BI "\-O" "level"Generate optimized output files.  This might use significantly moretime and therefore probably should be enabled only for generating thefinal binary.\c.I level\c\& is supposed to be a numeric value.  Any value greater than zero enablesthe optimizations..TP.BI "\--oformat " "output\-format"Specify the binary format for the output object file.You don't usually need to specify this, as\c.B ld\c\& is configured to produce as a default output format the mostusual format on each machine.  \c.I output-format\c\& is a text string, thename of a particular format supported by the BFD libraries.  The script command

⌨️ 快捷键说明

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