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

📄 ld.1

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻 1
字号:
.TH LD 1 .SH NAMEld \- loader.SH SYNOPSIS.B ld[ option ] file ....SH DESCRIPTION.I Ldcombines severalobject programs into one, resolves externalreferences, and searches libraries.In the simplest case several object.I filesare given, and.I ldcombines them, producingan object module which can be either executed orbecome the input for a further.I ldrun.(In the latter case, the.B \-roption must be givento preserve the relocation bits.)The output of.I ldis left on.BR a.out .This file is made executableonly if no errors occurred during the load..PPThe argument routines are concatenated in the orderspecified.  The entry point of the output is thebeginning of the first routine..PPIf any argument is a library, it is searched exactly onceat the point it is encountered in the argument list.Only those routines defining an unresolved externalreference are loaded.If a routine from a libraryreferences another routine in the library,and the library has not been processed by.IR ranlib (1),the referenced routine must appear after thereferencing routine in the library.Thus the order of programs within librariesmay be important.If the first member of a library is named`__.SYMDEF',then it is understood to be a dictionary for thelibrarysuchas produced by.IR ranlib ;the dictionary is searchediteratively to satisfy as many references as possible..PPThe symbols `\_etext', `\_edata' and `\_end'(`etext', `edata' and `end' in C)are reserved, and if referred to,are set to the first location above the program,the first location above initialized data,and the first location above all data respectively.It is erroneous to define these symbols..PP.I Ldunderstands several options.Except for.BR \-l ,they should appear before the file names..TP .B  \-s`Strip' the output, that is, remove the symbol tableand relocation bits to save space (but impair theusefulness of the debugger).This information can also be removed by.IR  strip (1)..TP .B  \-uTake the following argument as a symbol and enterit as undefined in the symbol table.  This is usefulfor loading wholly from a library, since initially the symboltable is empty and an unresolved reference is neededto force the loading of the first routine..TP .BI \-l xThisoption is an abbreviation for the library name.RI `/lib/lib x .a',where.I xis a string.If that does not exist,.I ldtries.RI `/usr/lib/lib x .a'.A library is searched when its name is encountered,so the placement of a.B  \-lis significant..TP .B  \-xDo not preserve local(non-.globl) symbols in the output symbol table; only enterexternal symbols.This option saves some space in the output file..TP .B  \-XSave local symbolsexcept for those whose names begin with `L'.This option is used by.IR cc (1)to discard internally generated labels whileretaining symbols local to routines..TP .B  \-rGenerate relocation bits in the output fileso that it can be the subject of another.I ldrun.This flag also prevents final definitions from beinggiven to common symbols,and suppresses the `undefined symbol' diagnostics..TP .B  \-dForce definition of common storageeven if the.B \-rflag is present..TP .B  \-nArrange thatwhen the output file is executed,the text portion will be read-only and sharedamong all users executing the file.This involves moving the data areas up to the firstpossible 4K word boundary following theend of the text..TP .B  \-iWhen the output file is executed, the programtext and data areas will live in separate address spaces.The only difference between this optionand.B \-nis that here the data starts at location 0..TP .B  \-oThe.I nameargument after.B \-ois used as the name of the.I ldoutput file, instead of.BR a.out ..TP.B \-eThe following argument is taken to be thename of the entry point of the loadedprogram; location 0 is the default..TP.B \-OThis is an overlay file, only the text segmentwill be replaced by.IR exec (2).Shared data must have the same layout as inthe program overlaid..TP.B \-DThe next argument is a decimal number that setsthe size of the data segment..SH FILES.ta \w'/usr/lib/lib*.a\ \ 'u/lib/lib*.a	libraries.br/usr/lib/lib*.a	more libraries.bra.out	output file.SH "SEE ALSO"as(1), ar(1), cc(1), ranlib(1).SH BUGS

⌨️ 快捷键说明

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