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

📄 arm-linux-ld.1

📁 arm-linux.rar
💻 1
📖 第 1 页 / 共 5 页
字号:
For compatibility with linkers produced by \s-1MRI\s0, \fBld\fR accepts scriptfiles written in an alternate, restricted command language, described inthe \s-1MRI\s0 Compatible Script Files section of \s-1GNU\s0 ld documentation.Introduce \s-1MRI\s0 script files withthe option \fB\-c\fR; use the \fB\-T\fR option to run linkerscripts written in the general-purpose \fBld\fR scripting language.If \fIMRI-cmdfile\fR does not exist, \fBld\fR looks for it in the directoriesspecified by any \fB\-L\fR options..IP "\fB\-d\fR" 4.IX Item "-d".PD 0.IP "\fB\-dc\fR" 4.IX Item "-dc".IP "\fB\-dp\fR" 4.IX Item "-dp".PDThese three options are equivalent; multiple forms are supported forcompatibility with other linkers.  They assign space to common symbolseven if a relocatable output file is specified (with \fB\-r\fR).  Thescript command \f(CW\*(C`FORCE_COMMON_ALLOCATION\*(C'\fR has the same effect..IP "\fB\-e\fR \fIentry\fR" 4.IX Item "-e entry".PD 0.IP "\fB\-\-entry=\fR\fIentry\fR" 4.IX Item "--entry=entry".PDUse \fIentry\fR as the explicit symbol for beginning execution of yourprogram, rather than the default entry point.  If there is no symbolnamed \fIentry\fR, the linker will try to parse \fIentry\fR as a number,and use that as the entry address (the number will be interpreted inbase 10; you may use a leading \fB0x\fR for base 16, or a leading\&\fB0\fR for base 8).  .IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4.IX Item "--exclude-libs lib,lib,..."Specifies a list of archive libraries from which symbols should not be automaticallyexported. The library names may be delimited by commas or colons.  Specifying\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries fromautomatic export.  This option is available only for the i386 \s-1PE\s0 targetedport of the linker and for \s-1ELF\s0 targeted ports.  For i386 \s-1PE\s0, symbolsexplicitly listed in a .def file are still exported, regardless of thisoption.  For \s-1ELF\s0 targeted ports, symbols affected by this option willbe treated as hidden..IP "\fB\-E\fR" 4.IX Item "-E".PD 0.IP "\fB\-\-export\-dynamic\fR" 4.IX Item "--export-dynamic".PDWhen creating a dynamically linked executable, add all symbols to thedynamic symbol table.  The dynamic symbol table is the set of symbolswhich are visible from dynamic objects at run time..SpIf you do not use this option, the dynamic symbol table will normallycontain only those symbols which are referenced by some dynamic objectmentioned in the link..SpIf you use \f(CW\*(C`dlopen\*(C'\fR to load a dynamic object which needs to referback to the symbols defined by the program, rather than some otherdynamic object, then you will probably need to use this option whenlinking the program itself..SpYou can also use the version script to control what symbols shouldbe added to the dynamic symbol table if the output format supports it.See the description of \fB\-\-version\-script\fR in \f(CW@ref\fR{\s-1VERSION\s0}..IP "\fB\-EB\fR" 4.IX Item "-EB"Link big-endian objects.  This affects the default output format..IP "\fB\-EL\fR" 4.IX Item "-EL"Link little-endian objects.  This affects the default output format..IP "\fB\-f\fR" 4.IX Item "-f".PD 0.IP "\fB\-\-auxiliary\fR \fIname\fR" 4.IX Item "--auxiliary name".PDWhen creating an \s-1ELF\s0 shared object, set the internal \s-1DT_AUXILIARY\s0 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 \fIname\fR..SpIf you later link a program against this filter object, then, when yourun the program, the dynamic linker will see the \s-1DT_AUXILIARY\s0 field.  Ifthe dynamic linker resolves any symbols from the filter object, it willfirst check whether there is a definition in the shared object\&\fIname\fR.  If there is one, it will be used instead of the definitionin the filter object.  The shared object \fIname\fR need not exist.Thus the shared object \fIname\fR may be used to provide an alternativeimplementation of certain functions, perhaps for debugging or formachine specific performance..SpThis option may be specified more than once.  The \s-1DT_AUXILIARY\s0 entrieswill be created in the order in which they appear on the command line..IP "\fB\-F\fR \fIname\fR" 4.IX Item "-F name".PD 0.IP "\fB\-\-filter\fR \fIname\fR" 4.IX Item "--filter name".PDWhen creating an \s-1ELF\s0 shared object, set the internal \s-1DT_FILTER\s0 field tothe specified name.  This tells the dynamic linker that the symbol tableof the shared object which is being created should be used as a filteron the symbol table of the shared object \fIname\fR..SpIf you later link a program against this filter object, then, when yourun the program, the dynamic linker will see the \s-1DT_FILTER\s0 field.  Thedynamic linker will resolve symbols according to the symbol table of thefilter object as usual, but it will actually link to the definitionsfound in the shared object \fIname\fR.  Thus the filter object can beused to select a subset of the symbols provided by the object\&\fIname\fR..SpSome older linkers used the \fB\-F\fR option throughout a compilationtoolchain for specifying object-file format for both input and outputobject files.The \s-1GNU\s0 linker uses other mechanisms for this purpose: the\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the \&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fRenvironment variable.The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when notcreating an \s-1ELF\s0 shared object..IP "\fB\-fini\fR \fIname\fR" 4.IX Item "-fini name"When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when theexecutable or shared object is unloaded, by setting \s-1DT_FINI\s0 to theaddress of the function.  By default, the linker uses \f(CW\*(C`_fini\*(C'\fR asthe function to call..IP "\fB\-g\fR" 4.IX Item "-g"Ignored.  Provided for compatibility with other tools..IP "\fB\-G\fR\fIvalue\fR" 4.IX Item "-Gvalue".PD 0.IP "\fB\-\-gpsize=\fR\fIvalue\fR" 4.IX Item "--gpsize=value".PDSet the maximum size of objects to be optimized using the \s-1GP\s0 register to\&\fIsize\fR.  This is only meaningful for object file formats such as\&\s-1MIPS\s0 \s-1ECOFF\s0 which supports putting large and small objects into differentsections.  This is ignored for other object file formats..IP "\fB\-h\fR\fIname\fR" 4.IX Item "-hname".PD 0.IP "\fB\-soname=\fR\fIname\fR" 4.IX Item "-soname=name".PDWhen creating an \s-1ELF\s0 shared object, set the internal \s-1DT_SONAME\s0 field tothe specified name.  When an executable is linked with a shared objectwhich has a \s-1DT_SONAME\s0 field, then when the executable is run the dynamiclinker will attempt to load the shared object specified by the \s-1DT_SONAME\s0field rather than the using the file name given to the linker..IP "\fB\-i\fR" 4.IX Item "-i"Perform an incremental link (same as option \fB\-r\fR)..IP "\fB\-init\fR \fIname\fR" 4.IX Item "-init name"When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when theexecutable or shared object is loaded, by setting \s-1DT_INIT\s0 to the addressof the function.  By default, the linker uses \f(CW\*(C`_init\*(C'\fR as thefunction to call..IP "\fB\-l\fR\fIarchive\fR" 4.IX Item "-larchive".PD 0.IP "\fB\-\-library=\fR\fIarchive\fR" 4.IX Item "--library=archive".PDAdd archive file \fIarchive\fR to the list of files to link.  Thisoption may be used any number of times.  \fBld\fR will search itspath-list for occurrences of \f(CW\*(C`lib\f(CIarchive\f(CW.a\*(C'\fR for every\&\fIarchive\fR specified..SpOn systems which support shared libraries, \fBld\fR may also search forlibraries with extensions other than \f(CW\*(C`.a\*(C'\fR.  Specifically, on \s-1ELF\s0and SunOS systems, \fBld\fR will search a directory for a library withan extension of \f(CW\*(C`.so\*(C'\fR before searching for one with an extension of\&\f(CW\*(C`.a\*(C'\fR.  By convention, a \f(CW\*(C`.so\*(C'\fR extension indicates a sharedlibrary..SpThe linker will search an archive only once, at the location where it isspecified on the command line.  If the archive defines a symbol whichwas undefined in some object which appeared before the archive on thecommand line, the linker will include the appropriate file(s) from thearchive.  However, an undefined symbol in an object appearing later onthe command line will not cause the linker to search the archive again..SpSee the \fB\-(\fR option for a way to force the linker to searcharchives multiple times..SpYou may list the same archive multiple times on the command line..SpThis type of archive searching is standard for Unix linkers.  However,if you are using \fBld\fR on \s-1AIX\s0, note that it is different from thebehaviour of the \s-1AIX\s0 linker..IP "\fB\-L\fR\fIsearchdir\fR" 4.IX Item "-Lsearchdir".PD 0.IP "\fB\-\-library\-path=\fR\fIsearchdir\fR" 4.IX Item "--library-path=searchdir".PDAdd path \fIsearchdir\fR to the list of paths that \fBld\fR will searchfor archive libraries and \fBld\fR 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\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of theorder in which the options appear..SpIf \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replacedby the \fIsysroot prefix\fR, a path specified when the linker is configured..SpThe default set of paths searched (without being specified with\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and insome cases also on how it was configured.  .SpThe paths can also be specified in a link script with the\&\f(CW\*(C`SEARCH_DIR\*(C'\fR command.  Directories specified this way are searchedat the point in which the linker script appears in the command line..IP "\fB\-m\fR\fIemulation\fR" 4.IX Item "-memulation"Emulate the \fIemulation\fR linker.  You can list the availableemulations with the \fB\-\-verbose\fR or \fB\-V\fR options..SpIf the \fB\-m\fR option is not used, the emulation is taken from the\&\f(CW\*(C`LDEMULATION\*(C'\fR environment variable, if that is defined..SpOtherwise, the default emulation depends upon how the linker wasconfigured..IP "\fB\-M\fR" 4.IX Item "-M".PD 0.IP "\fB\-\-print\-map\fR" 4.IX Item "--print-map".PDPrint a link map to the standard output.  A link map providesinformation about the link, including the following:.RS 4.IP "*" 4Where object files and symbols are mapped into memory..IP "*" 4How common symbols are allocated..IP "*" 4All archive members included in the link, with a mention of the symbolwhich caused the archive member to be brought in..RE.RS 4.RE.IP "\fB\-n\fR" 4.IX Item "-n".PD 0.IP "\fB\-\-nmagic\fR" 4.IX Item "--nmagic".PDTurn off page alignment of sections, and mark the output as\&\f(CW\*(C`NMAGIC\*(C'\fR if possible..IP "\fB\-N\fR" 4.IX Item "-N".PD 0.IP "\fB\-\-omagic\fR" 4.IX Item "--omagic".PDSet the text and data sections to be readable and writable.  Also, donot page-align the data segment, and disable linking against sharedlibraries.  If the output format supports Unix style magic numbers,mark the output as \f(CW\*(C`OMAGIC\*(C'\fR. Note: Although a writable text sectionis allowed for PE-COFF targets, it does not conform to the formatspecification published by Microsoft..IP "\fB\-\-no\-omagic\fR" 4.IX Item "--no-omagic"This option negates most of the effects of the \fB\-N\fR option.  Itsets the text section to be read\-only, and forces the data segment tobe page\-aligned.  Note \- this option does not enable linking againstshared libraries.  Use \fB\-Bdynamic\fR for this..IP "\fB\-o\fR \fIoutput\fR" 4.IX Item "-o output".PD 0.IP "\fB\-\-output=\fR\fIoutput\fR" 4.IX Item "--output=output".PDUse \fIoutput\fR as the name for the program produced by \fBld\fR; if thisoption is not specified, the name \fIa.out\fR is used by default.  Thescript command \f(CW\*(C`OUTPUT\*(C'\fR can also specify the output file name..IP "\fB\-O\fR \fIlevel\fR" 4.IX Item "-O level"If \fIlevel\fR is a numeric values greater than zero \fBld\fR optimizesthe output.  This might take significantly longer and therefore probablyshould only be enabled for the final binary..IP "\fB\-q\fR" 4.IX Item "-q".PD 0.IP "\fB\-\-emit\-relocs\fR" 4.IX Item "--emit-relocs".PDLeave relocation sections and contents in fully linked exececutables.Post link analysis and optimization tools may need this information inorder to perform correct modifications of executables.  This resultsin larger executables..SpThis option is currently only supported on \s-1ELF\s0 platforms..IP "\fB\-r\fR" 4.IX Item "-r".PD 0.IP "\fB\-\-relocatable\fR" 4.IX Item "--relocatable".PD

⌨️ 快捷键说明

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