?? lk.1
字號(hào):
.\" SCCSID: @(#)lk.1 3.3 2/2/88.TH lk 1 VAX.SH Namelk \- link editor.SH Syntax.B lk[\|\fIoption...\fR\|] \fIfile...\fR.SH Description.NXR "lk command".NXR "object file" "combining".NXS "link editor (VAX FORTRAN)" "lk command".NXA "ld command" "lk command".NXAM "lk command" "ar file".NXAM "lk command" "a.out file".NXA "lk command" "strip command".NXA "lk command" "ranlib command".NXA "cc compiler" "lk command"The.PN lkcommand combines several object programs into one, resolves externalreferences, and searches libraries.In the simplest case, several object.I filesare given, and.PN lkcombines them, producing an object module which can be executed.The output of.PN lkis always a standard ULTRIX .PN a.outobject module. This file is made executable only if no errors occurred during the load..PPThe argument routines are linked together in the orderspecified. The entry point of the output is thebeginning of the first routine, unless the \fB\-e\fP option is specified..PPIf the argument is a library, it is searched only onceat the point it is encountered in the argument list.Only those routines defining an unresolved externalreference are loaded.If a routine from a library references another routine in the libraryand the library has not been processed by .MS ranlib 1 ,the referenced routine mustappear after the referencing routine in the library.Thus the order of programs within libraries may be important.The first member of a library should be a file named `\_\^\_.SYMDEF',which is a dictionary for the library as produced by .MS ranlib 1 .The dictionary is searched repeatedlyto 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 in that order.It is an error to define these symbols..PPLike the .PN ldlinker, the .PN lklinker can process ULTRIXobject modules, .PN a.outfiles, archived libraries (.a files), andranlib-generated indexed libraries. Unlike the .PN ldlinker, however, the .PN lklinker can alsoprocess object modules generated by the VAX FORTRAN compiler.All .PN lkcommand options can also be specified on the .PN fortcommand..SH Options.NXR "lk command" "options"The .PN lkcommand has several options.Except for.B \-l,they should appear before the file names..IP "\fB\-\|D\fI number\fR" 20Sets data segment length. The `number' is a number specifying thedesired length of the data segment. The linker pads the data segmentto this length with zero bytes..IP "\fB\-\|e\fI symbol\fR" 20Take the argument as thename of the entry point of the loadedprogram. Location 0 is the default..IP "\fB\-\|H\fI number\fR" 20Takes number argument as a decimal integer, adds it to endof text, and starts data section at a higheraddress..IP \fB\-K\fR 20Produces full load map, cross-referencing all defined symbols..IP "\fB\-L\fIdir\fR" 20Add.I dirto the list of directories in which libraries are searched for.Directories specified with .B \-Lare searched before the standard directories..IP \fB\-l\fIx\fR 20Abbreviation for the library name.RI `/lib/lib x \&.a',where.I xis a string.If that does not exist,.PN lktries .RI `/usr/lib/lib x \&.a'A library is searched when its name is encountered,so the placement of a.B \-lis significant..IP \fB\-M\fR 20Produces full load map, consisting of a module and program section synopsisand symbol cross-reference. Only symbols that are referenced appearin the cross-reference. Use .B \-Kto cross-reference all symbols..IP \fB\-N\fR 20Do not make text portion read only or sharable. (Use magic number 0407.).IP \fB\-n\fR 20Arranges (by giving the output file a 0410 ``magic number'') thatwhen the output file is executed,the text portion is read-only and sharedamong all users executing the file.This involves moving the data areas up to the firstpossible 1024 byte boundary following theend of the text..IP "\fB\-\|o\fI name\fR" 20Takes the .I nameargument after.B \-oas the name of the.PN lkoutput file, instead of.PN a.out ..IP \fB\-S\fR 20Strips the output by removing all symbols except locals and globals..IP \fB\-s\fR 20Removes the symbol tableand relocation bits to save space. This impairs theusefulness of the debuggers.This information can also be removed by .MS strip 1 ..IP "\fB\-\|T\fI number\fR" 20Takes the argument as a hexadecimal number which sets the text segmentorigin. The default origin is 0..IP \fB\-t\fR 20Displays the name of each file as it is processed..IP "\fB\-\|u\fI symbol\fR" 20Enters argument as undefined symbol in symbol table. This is usefulfor loading from a library, since initially the symboltable is empty and an unresolved reference is neededto force the loading of the first routine..IP \fB\-X\fR 20Saves local symbolsexcept for those whose names begin with `L'.This option is used by .MS cc 1 to discard internally-generated labels whileretaining symbols local to routines..IP \fB\-x\fR 20Suppresses saving nonglobal symbols in output symbol table; enters only externalsymbols. This option saves some space in the output file..IP "\fB\-Y\fIenvironment\fR" 20Adjust the magic number in the output file so that the program runs in the specified.I environment .The parameter can be POSIX, SYSTEM_FIVE, or BSD.The parameter sets the program's execution environment to conform withone of the three standards. This parameter overrides the PROG_ENVenvironment variable, if it is present.If neither this parameter nor the PROG_ENV variable ispresent, \fB\-Y\fRBSD is assumed..IP \fB\-y\fIsym\fR 20Indicates each file in which.I symappears, its type and whether the file defines or references it.Many such options may be given to trace many symbols.(It is usually necessary to begin.I symwith an `_', as external C and PASCAL variables begin with underscores.).IP \fB\-z\fR 20Loads process on demand from the resulting executable file (413 format)rather than preloaded.This is the default.It results in a 1024 byte header on the output file followed bya text and data segment, whose size is a multiple of 1024 bytes(being padded out with nulls in the file if necessary).With this format the first few BSS segment symbols may actually appear,from the output of.MS size 1 ,to live in the data segment.This avoids wasting the space which results from the data segment size roundup..PPThe.PN lklinkerdoes not support the following .PN ldoptions:.B \-A,.B \-d,or.B \-r..SH Restrictions.NXR "lk command" "restricted"The.PN lkcommandpads the images which are to be demand loaded fromthe file system to the next page boundary..PPWhen linking code containing GFLOAT instructions,the GFLOAT versions of .I libcand/or the math library must beused rather than the normal DFLOAT versions. Link to these by using.I \-lcgand/or.I \-lmg. .PPThe compiler and the linker .MS lk 1 cannot detect the use of mixed double floating point types, and your program may produce erroneous results..SH Files.ta \w'/usr/local/lib/lib*.a\ \ 'u/lib/lib*.a libraries.br/usr/lib/lib*.a libraries.br/usr/local/lib/lib*.a libraries.bra.out output file.bra.map map file.SH See Alsoar(1), as(1), cc(1), ld(1), ranlib(1)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -