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

📄 arm-linux-ld.1

📁 arm-linux.rar
💻 1
📖 第 1 页 / 共 5 页
字号:
definition within the shared library, if any.  Normally, it is possiblefor a program linked against a shared library to override the definitionwithin the shared library.  This option is only meaningful on \s-1ELF\s0platforms which support shared libraries..IP "\fB\-\-check\-sections\fR" 4.IX Item "--check-sections".PD 0.IP "\fB\-\-no\-check\-sections\fR" 4.IX Item "--no-check-sections".PDAsks the linker \fInot\fR to check section addresses after they havebeen assigned to see if there any overlaps.  Normally the linker willperform this check, and if it finds any overlaps it will producesuitable error messages.  The linker does know about, and does makeallowances for sections in overlays.  The default behaviour can berestored by using the command line switch \fB\-\-check\-sections\fR..IP "\fB\-\-cref\fR" 4.IX Item "--cref"Output 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..SpThe format of the table is intentionally simple, so that it may beeasily processed by a script if necessary.  The symbols are printed out,sorted by name.  For each symbol, a list of file names is given.  If thesymbol is defined, the first file listed is the location of thedefinition.  The remaining files contain references to the symbol..IP "\fB\-\-no\-define\-common\fR" 4.IX Item "--no-define-common"This option inhibits the assignment of addresses to common symbols.The script command \f(CW\*(C`INHIBIT_COMMON_ALLOCATION\*(C'\fR has the same effect..SpThe \fB\-\-no\-define\-common\fR option allows decouplingthe decision to assign addresses to Common symbols from the choiceof the output file type; otherwise a non-Relocatable output typeforces assigning addresses to Common symbols.Using \fB\-\-no\-define\-common\fR allows Common symbols that are referencedfrom a shared library to be assigned addresses only in the main program.This eliminates the unused duplicate space in the shared library,and also prevents any possible confusion over resolving to the wrongduplicate when there are many dynamic modules with specialized searchpaths for runtime symbol resolution..IP "\fB\-\-defsym\fR \fIsymbol\fR\fB=\fR\fIexpression\fR" 4.IX Item "--defsym symbol=expression"Create a global symbol in the output file, containing the absoluteaddress given by \fIexpression\fR.  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 \fIexpression\fR in thiscontext: you may give a hexadecimal constant or the name of an existingsymbol, or use \f(CW\*(C`+\*(C'\fR and \f(CW\*(C`\-\*(C'\fR to add or subtract hexadecimalconstants or symbols.  If you need more elaborate expressions, considerusing the linker command language from a script.  \fINote:\fR there should be no whitespace between \fIsymbol\fR, the equals sign (``\fB=\fR''), and\&\fIexpression\fR..IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4.IX Item "--demangle[=style]".PD 0.IP "\fB\-\-no\-demangle\fR" 4.IX Item "--no-demangle".PDThese options control whether to demangle symbol names in error messagesand other output.  When the linker is told to demangle, it tries topresent symbol names in a readable fashion: it strips leadingunderscores if they are used by the object file format, and converts \*(C+mangled symbol names into user readable names.  Different compilers havedifferent mangling styles.  The optional demangling style argument can be usedto choose an appropriate demangling style for your compiler.  The linker willdemangle by default unless the environment variable \fB\s-1COLLECT_NO_DEMANGLE\s0\fRis set.  These options may be used to override the default..IP "\fB\-\-dynamic\-linker\fR \fIfile\fR" 4.IX Item "--dynamic-linker file"Set the name of the dynamic linker.  This is only meaningful whengenerating dynamically linked \s-1ELF\s0 executables.  The default dynamiclinker is normally correct; don't use this unless you know what you aredoing..IP "\fB\-\-fatal\-warnings\fR" 4.IX Item "--fatal-warnings"Treat all warnings as errors..IP "\fB\-\-force\-exe\-suffix\fR" 4.IX Item "--force-exe-suffix"Make sure that an output file has a .exe suffix..SpIf a successfully built fully linked output file does not have a\&\f(CW\*(C`.exe\*(C'\fR or \f(CW\*(C`.dll\*(C'\fR suffix, this option forces the linker to copythe output file to one of the same name with a \f(CW\*(C`.exe\*(C'\fR suffix. Thisoption is useful when using unmodified Unix makefiles on a MicrosoftWindows host, since some versions of Windows won't run an image unlessit ends in a \f(CW\*(C`.exe\*(C'\fR suffix..IP "\fB\-\-no\-gc\-sections\fR" 4.IX Item "--no-gc-sections".PD 0.IP "\fB\-\-gc\-sections\fR" 4.IX Item "--gc-sections".PDEnable garbage collection of unused input sections.  It is ignored ontargets that do not support this option.  This option is not compatiblewith \fB\-r\fR. The default behaviour (of not performing this garbagecollection) can be restored by specifying \fB\-\-no\-gc\-sections\fR onthe command line..IP "\fB\-\-help\fR" 4.IX Item "--help"Print a summary of the command-line options on the standard output and exit..IP "\fB\-\-target\-help\fR" 4.IX Item "--target-help"Print a summary of all target specific options on the standard output and exit..IP "\fB\-Map\fR \fImapfile\fR" 4.IX Item "-Map mapfile"Print a link map to the file \fImapfile\fR.  See the description of the\&\fB\-M\fR option, above..IP "\fB\-\-no\-keep\-memory\fR" 4.IX Item "--no-keep-memory"\&\fBld\fR normally optimizes for speed over memory usage by caching thesymbol tables of input files in memory.  This option tells \fBld\fR toinstead optimize for memory usage, by rereading the symbol tables asnecessary.  This may be required if \fBld\fR runs out of memory spacewhile linking a large executable..IP "\fB\-\-no\-undefined\fR" 4.IX Item "--no-undefined".PD 0.IP "\fB\-z defs\fR" 4.IX Item "-z defs".PDReport unresolved symbol references from regular object files.  Thisis done even if the linker is creating a non-symbolic shared library.The switch \fB\-\-[no\-]allow\-shlib\-undefined\fR controls thebehaviour for reporting unresolved references found in sharedlibraries being linked in.  .IP "\fB\-\-allow\-multiple\-definition\fR" 4.IX Item "--allow-multiple-definition".PD 0.IP "\fB\-z muldefs\fR" 4.IX Item "-z muldefs".PDNormally when a symbol is defined multiple times, the linker willreport a fatal error. These options allow multiple definitions and thefirst definition will be used..IP "\fB\-\-allow\-shlib\-undefined\fR" 4.IX Item "--allow-shlib-undefined".PD 0.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4.IX Item "--no-allow-shlib-undefined".PDAllows (the default) or disallows undefined symbols in shared libraries.This switch is similar to \fB\-\-no\-undefined\fR except that itdetermines the behaviour when the undefined symbols are in ashared library rather than a regular object file.  It does not affecthow undefined symbols in regular object files are handled..SpThe reason that \fB\-\-allow\-shlib\-undefined\fR is the default is thatthe shared library being specified at link time may not be the same asthe one that is available at load time, so the symbols might actually beresolvable at load time.  Plus there are some systems, (eg BeOS) whereundefined symbols in shared libraries is normal.  (The kernel patchesthem at load time to select which function is most appropriate for the current architecture.  This is used for example to dynamicallyselect an appropriate memset function).  Apparently it is also normalfor \s-1HPPA\s0 shared libraries to have undefined symbols..IP "\fB\-\-no\-undefined\-version\fR" 4.IX Item "--no-undefined-version"Normally when a symbol has an undefined version, the linker will ignoreit. This option disallows symbols with undefined version and a fatal errorwill be issued instead..IP "\fB\-\-default\-symver\fR" 4.IX Item "--default-symver"Create and use a default symbol version (the soname) for unversionedexported symbols..IP "\fB\-\-default\-imported\-symver\fR" 4.IX Item "--default-imported-symver"Create and use a default symbol version (the soname) for unversionedimported symbols..IP "\fB\-\-no\-warn\-mismatch\fR" 4.IX Item "--no-warn-mismatch"Normally \fBld\fR will give an error if you try to link together inputfiles that are mismatched for some reason, perhaps because they havebeen compiled for different processors or for different endiannesses.This option tells \fBld\fR that it should silently permit such possibleerrors.  This option should only be used with care, in cases when youhave taken some special action that ensures that the linker errors areinappropriate..IP "\fB\-\-no\-whole\-archive\fR" 4.IX Item "--no-whole-archive"Turn off the effect of the \fB\-\-whole\-archive\fR option for subsequentarchive files..IP "\fB\-\-noinhibit\-exec\fR" 4.IX Item "--noinhibit-exec"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..IP "\fB\-nostdlib\fR" 4.IX Item "-nostdlib"Only search library directories explicitly specified on thecommand line.  Library directories specified in linker scripts(including linker scripts specified on the command line) are ignored..IP "\fB\-\-oformat\fR \fIoutput-format\fR" 4.IX Item "--oformat output-format"\&\fBld\fR may be configured to support more than one kind of objectfile.  If your \fBld\fR is configured this way, you can use the\&\fB\-\-oformat\fR option to specify the binary format for the outputobject file.  Even when \fBld\fR is configured to support alternativeobject formats, you don't usually need to specify this, as \fBld\fRshould be configured to produce as a default output format the mostusual format on each machine.  \fIoutput-format\fR is a text string, thename of a particular format supported by the \s-1BFD\s0 libraries.  (You canlist the available binary formats with \fBobjdump \-i\fR.)  The scriptcommand \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, butthis option overrides it.  .IP "\fB\-pie\fR" 4.IX Item "-pie".PD 0.IP "\fB\-\-pic\-executable\fR" 4.IX Item "--pic-executable".PDCreate a position independent executable.  This is currently only supported on\&\s-1ELF\s0 platforms.  Position independent executables are similar to sharedlibraries in that they are relocated by the dynamic linker to the virtualaddress the \s-1OS\s0 chooses for them (which can vary between invocations).  Likenormal dynamically linked executables they can be executed and symbolsdefined in the executable cannot be overridden by shared libraries..IP "\fB\-qmagic\fR" 4.IX Item "-qmagic"This option is ignored for Linux compatibility..IP "\fB\-Qy\fR" 4.IX Item "-Qy"This option is ignored for \s-1SVR4\s0 compatibility..IP "\fB\-\-relax\fR" 4.IX Item "--relax"An option with machine dependent effects.This option is only supported on a few targets..SpOn some platforms, the \fB\-\-relax\fR option performs globaloptimizations that become possible when the linker resolves addressingin the program, such as relaxing address modes and synthesizing newinstructions in the output object file..SpOn some platforms these link time global optimizations may make symbolicdebugging of the resulting executable impossible.This is known to bethe case for the Matsushita \s-1MN10200\s0 and \s-1MN10300\s0 family of processors..SpOn platforms where this is not supported, \fB\-\-relax\fR is accepted,but ignored..IP "\fB\-\-retain\-symbols\-file\fR \fIfilename\fR" 4.IX Item "--retain-symbols-file filename"Retain \fIonly\fR the symbols listed in the file \fIfilename\fR,discarding all others.  \fIfilename\fR 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..Sp\&\fB\-\-retain\-symbols\-file\fR does \fInot\fR discard undefined symbols,or symbols needed for relocations..SpYou may only specify \fB\-\-retain\-symbols\-file\fR once in the commandline.  It overrides \fB\-s\fR and \fB\-S\fR..IP "\fB\-rpath\fR \fIdir\fR" 4.IX Item "-rpath dir"Add a directory to the runtime library search path.  This is used whenlinking an \s-1ELF\s0 executable with shared objects.  All \fB\-rpath\fRarguments are concatenated and passed to the runtime linker, which usesthem to locate shared objects at runtime.  The \fB\-rpath\fR option isalso used when locating shared objects which are needed by sharedobjects explicitly included in the link; see the description of the\&\fB\-rpath\-link\fR option.  If \fB\-rpath\fR is not used when linking an\&\s-1ELF\s0 executable, the contents of the environment variable\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR will be used if it is defined..SpThe \fB\-rpath\fR option may also be used on SunOS.  By default, onSunOS, the linker will form a runtime search patch out of all the\&\fB\-L\fR options it is given.  If a \fB\-rpath\fR option is used, theruntime search path will be formed exclusively using the \fB\-rpath\fRoptions, ignoring the \fB\-L\fR options.  This can be useful when usinggcc, which adds many \fB\-L\fR options which may be on \s-1NFS\s0 mountedfilesystems..SpFor compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option isfollowed by a directory name, rather than a file name, it is treated asthe \fB\-rpath\fR option..IP "\fB\-rpath\-link\fR \fI\s-1DIR\s0\fR" 4.IX Item "-rpath-link DIR"When using \s-1ELF\s0 or SunOS, one shared library may require another.  Thishappens when an \f(CW\*(C`ld \-shared\*(C'\fR link includes a shared library as oneof the input files..SpWhen the linker encounters such a dependency when doing a non\-shared,non-relocatable 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 \fB\-rpath\-link\fR optionspecifies the first set of directories to search.  The\&\fB\-rpath\-link\fR option may specify a sequence of directory nameseither by specifying a list of names separated by colons, or byappearing multiple times..SpThis option should be used with caution as it overrides the search paththat may have been hard compiled into a shared library. In such a case itis possible to use unintentionally a different search path than theruntime linker would do..SpThe linker uses the following search paths to locate required sharedlibraries..RS 4.IP "1." 4Any directories specified by \fB\-rpath\-link\fR options.

⌨️ 快捷键说明

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