ld.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 566 行 · 第 1/2 页

1
566
字号
the best number for the.B \-Goption..IPThe.B \-nocountoption specifies that object files appearing after it on the command linecannot be recompiled.The.B \-countoption specifies that object files appearing after it on the command line can berecompiled. You can alternate the use of.B \-nocountand.B \-count.The .B \-countalloption specifies that all object files appearing after it on the commandline can be recompiled.This option overrides any .B \-nocountoptions that appear after it on the command line..TP 15.BI \-D " num"Set the data segment origin.  The argument.I numis a hexadecimal address.  See Restrictions for informationon valid values for the hexadecimal address..TP 15.B \-dForce definition of common storage and define loader defined symbols even if.B \-r is present..TP 15.B \-EBProduce the output object file with Big Endian byte ordered headers and symbolicinformation tables..TP 15.B \-ELProduce the output object file with Little Endian byte ordered headers andsymbolic information tables..TP 15.BI \-e " epsym"Set the default entry point address for the output file to be that of thesymbol.IR epsym..TP 15.B \-F Load the process ondemand from the resulting executable file (413 format)rather than preloading it as a ZMAGIC file.This behavior is the default. (This option is identical to the .B \-z option.).TP 15.BI \-f fillSet the fill pattern for ``holes'' within an output section.  The argument.I fillis a 4-byte hexadecimal constant..TP 15.BI \-G "num"Assume the decimal number \fInum\fR specifies the largest size in bytesof a .I \&.commitem or literal that is to be allocated in the small bss section forreference off the global pointer. The default largest size is 8 bytes..TP 15.B \-g .ns.TP.B \-g[123]Disable the.B -jmpoptoption. The .B -g0option is accepted, but it has no effect..TP 15.B \-jmpopt .ns.TP 15.B \-nojmpoptFill or do not fill the delay slots of jump instructions with the target of thejump and adjust the jump offset to jump past that instruction.  This featurealways isdisabled for debugging (when the.BR "\-g1, \-g2" " or" " \-g"flag is present).  When this optionis enabled it requires that all of the loaded program's text be in memory andcould cause the loader to run out of memory.  The default is .B \-nojmpopt..TP 15 .BI \-kl xSearch a ucode object library.BI lib x \&.b,where.I xis a string.  Because the link editor searches the library when it encounters the libraryname,the placement of the.B \-kloption is significant..TP 15.B \-LIgnore the .BI lib x \&.aor.BI lib x \&.bdefault directories when searching for libraries.This option is useful when you neverwant the link editor to search the default directories and want it toonly search the directories you specify with the.BI -L diroption..TP 15.BI \-L dirSearch \fIdir\fR before searching the default directories.BI lib x \&.aor.BI lib x \&.b.This option is effective only if it precedes the.B \-loption..TP 15 .BI \-l xSearch a library.BI lib x \&.a,where.I xis a string.Because the link editor searches the library when it encounters the libraryname,the placement of the.B \-loption is significant..TP 15.BR \-MProduce a primitive load map, listing the names of the files that areloaded. This option displays a map that resembles a UNIX 4.3BSD map.(See also the.B \-moption.).TP 15.BR \-mDisplay a map or listing of the input/output sections on standardoutput. This option displays a map that resembles a UNIX System V map.(See also the.B \-Moption.).TP 15.B \-NAssign the 0407 magic number to the output file, making it an OMAGICfile. In an OMAGIC file, the data section immediately follows the text section. The textsection can be read or written, but it is not shareable for users executing the OMAGICfile..TP 15 .B  \-nAssign 0419 magic number to the output file, making it an NMAGIC file. Whenusers execute the NMAGIC file, the text section of the executable is read-only and shared amongall users executing that file.This option moves the data section up to the firstpossible page-sizebyte boundary following the end of the text..TP 15.BI \-o " outfile"Produce an output object file by the name.I outfile.The name of the default object file is.BR a.out ..TP 15.BI \-p " file"Preserve (do not hide) the symbol names listed in.I filewhen loading ucode object files.  You must separate the symbol names in the file with blanks, tabs, or newline characters..TP 15 .B \-rRetain relocation entries in the output file.Relocation entries must be saved if the output file is to become an inputfile in a subsequent.PN ldrun.This option also prevents final definitions from being given to common symbolsand suppresses the undefined symbol diagnostics..TP 15.B \-SSet silent mode and suppress nonfatal errors..TP 15 .B \-sStrip the symbolic information from the output object file..TP 15.BI \-T " num"Set the text segment origin.  The argument.I numis a hexadecimal address.  See Restrictions for informationon valid values for the hexadecimal address..TP 15 .BI \-u " symname"Enter.I symnameas an undefined symbol in the symbol table.  This option is usefulfor loading linked material entirely from a library because initially the symboltable is empty. An unresolved reference is neededto force the loading of the first routine..TP 15.B \-VDisplay a message giving information about the version of.PN ldbeing used..TP 15.BI \-VS " num"Use.I numas the decimal version stamp to identify the .PN a.out file that is produced.  Theversion stamp is stored in the optional and symbolic headers..TP 15.B \-vSet verbose mode, which causes the link editor to display the name of each file as it is processed..TP 15 .B  \-xDo not preserve local(nonglobal) symbols in the output symbol table; enteronly external and static symbols.This option saves space in the output file..TP 15.BI \-y symDisplay the name of each file in which the specified symbolappears, the symbol's data type,and whether the file defines or referencesthe symbol.You can specify a number of.B \-yoptions to trace many symbols..TP 15.B \-z Load the process ondemand from the resulting executable file (413 format)rather than preloading it as a ZMAGIC file.This behavior is the default. (This option is identical to the .B \-F option.).SH RestrictionsThe text and data segments must not overlap and all addresses mustbe less than 0x80000000.The stack starts below 0x80000000 and growsthrough lower addresses, so leave space for it..PPFor ZMAGIC and NMAGIC files, the default text segment address is 0x00400000and the default data segment address is 0x10000000.For OMAGIC files, the default text segment address is 0x10000000 with the datasegment following the text segment.The default for all types of files is that the bss segment follows the datasegment..PPIf you use the.B \-Boption when you link an OMAGIC file, the origin you specify for the bsssegment must follow the data segment. If the bss segment does notfollow the data segment, the OMAGIC file will not run..PPThe segments must be on 4 megabyte boundaries.  Objects linked at addresses other than the default will not run..SH Files.TP 30.PN /usr/local/lib/lib*.aLibrary file.TP 30.PN /lib/lib*.aLibrary file.TP 30.PN /usr/lib/lib*.aLibrary file.TP 30.PN a.outOutput file.SH See Alsocc(1), as(1), ar(1), end(3)

⌨️ 快捷键说明

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