Charles.Forsyth20060303-partialeea662d19 years agoHistory
201 lines · 4.1 KB · Text
RawDownload
.TH 2L 10.1.SH NAME0l, 1l, 2l, 5l, 6l, 7l, 8l, kl, ql, vl \- loaders.SH SYNOPSIS.B 2l[.I option ...][.I file ...].bretc..SH DESCRIPTIONThese commands load the named.I filesinto executable files for the corresponding architectures; see.IR 2c (10.1)for the correspondence between an architecture and the character.RB ( 1 ,.BR 2 ,etc.)that specifies it.The files should be object files or libraries (archives of object files)for the appropriate architecture.Also, a name like.BI -l extrepresents the library.BI lib ext .ain.BR /$objtype/lib ,where.I objtypeis one of.BR 68000 ,etc. as listed in.IR 2c (10.1).The libraries must have tables of contents(see.IR iar (10.1))..PPIn practice,.B -loptions are rarely necessary as the header files forthe libraries cause their archives to be included automatically in the load(see.IR 2c (10.1)).For example, any program that includes header file.B libc.hcauses the loaderto search the C library.BR /$objtype/lib/libc.a .Also, the loader creates an undefined symbol.B _main(or.B _mainpif profiling is enabled) to force loading of thestartup linkage from the C library..PPThe order of search to resolve undefined symbols is to load all files and librariesmentioned explicitly on the command line, and then to resolve remaining symbolsby searching in topological orderlibraries mentioned in header files included by files already loaded.When scanning such libraries, the algorithm is to scan each library repeatedly untilno new undefined symbols are picked up, then to start on the next library.  Thus if library.I Aneeds.I Bwhich needs.I Aagain, it may be necessary to mention.I Aexplicitly so it will be read a second time..PPThe loader options are:.TP 1i.B -l(As a bare option.)Suppress the default loading of the startup linkage and librariesspecified by header files..TP.BI -o " out"Place output in file.IR out .Default is.IB O .out\f1,where.I Ois the first letter of the loader name..TP.B -pInsert profiling code into the executable output; no special action is neededduring compilation or assembly..TP.B -sStrip the symbol tables from the output file..TP.B -aPrint the object code in assembly language, with addresses..TP.B -vPrint debugging output that annotates the activities of the load..TP.BI -M.RI ( klonly) Generate instructions rather than calls to emulation routinesfor multiply and divide..TP.BI -E symbolThe entry point for the binary is.I symbol(default.BR _main ;.B _mainpunder.BR -p )..TP.B -x [.I file]Produce an export table in the executable.The optional.I filerestricts the exported symbols to those listed in the file.See.IR dynld (10.2)..TP.B -u [.I file]Produce an export table, import tableand a dynamic load section in the executable.The optional.I filerestricts the imported symbols to those listed in the file.See.IR dynld (10.2)..TP.BI -H nExecutable header is type.IR n .The meaning of the types is architecture-dependent; typicallytype 1 is Plan 9 boot format and type 2 is theregular Plan 9 format, the default.  These are reversed on the MIPS.The Next boot format is 3.  Type 4 in.I vlcreates a MIPS executable for an SGI Unix system..TP.BI -T tThe text segment starts at address.IR t ..TP.BI -D dThe data segment starts at address.IR d ..TP.BI -R rThe text segment is rounded to a multiple of.I r(if.I ris nonzero)..PPThe numbers in the above options can begin with.L 0xor.L 0to change the default base from decimal to hexadecimal or octal.The defaults for the values depend on the compiler and theheader type..PPThe loaded image has several symbols inserted by the loader:.B etextis the address of the end of the text segment;.B bdatais the address of the beginning of the data segment;.B edatais the address of the end of the data segment;and.B endis the address of the end of the bss segment, and of the program..SH FILES.TF /$objtype/lib.TP.B /$objtype/libfor.BI -l libarguments..SH SOURCE.B /utils/2letc..SH "SEE ALSO".IR 2c (10.1),.IR 2a (10.1),.IR iar (10.1),.IR inm (10.1).PPRob Pike,``How to Use the Plan 9 C Compiler''