|
|
1.1 root 1: .TH 2L 1
2: .SH NAME
3: 2l, 6l, 8l, kl, vl, xl \- loaders
4: .SH SYNOPSIS
5: .B 2l
6: [
7: .I option ...
8: ]
9: [
10: .I file ...
11: ]
12: .br
13: .B 6l
14: [
15: .I option ...
16: ]
17: [
18: .I file ...
19: ]
20: .br
21: .B 8l
22: [
23: .I option ...
24: ]
25: [
26: .I file ...
27: ]
28: .br
29: .B kl
30: [
31: .I option ...
32: ]
33: [
34: .I file ...
35: ]
36: .br
37: .B vl
38: [
39: .I option ...
40: ]
41: [
42: .I file ...
43: ]
44: .br
45: .B xl
46: [
47: .I option ...
48: ]
49: [
50: .I file ...
51: ]
52: .SH DESCRIPTION
53: .IR 2l ,
54: .IR 6l ,
55: .IR 8l ,
56: .IR kl ,
57: .IR vl ,
58: and
59: .IR xl
60: load the named
61: .I files
62: into MC68020, i960, i386, SPARC, MIPS,
63: and ATT3210 executable files.
64: The files should be object files or libraries (archives of object files)
65: for the appropriate architecture.
66: Also, a name like
67: .BI -l ext
68: represents the library
69: .BI lib ext .a
70: in
71: .BR /$objtype/lib ,
72: where
73: .I objtype
74: is one of
75: .BR 68020 ,
76: .BR 960 ,
77: .BR 386 ,
78: .BR sparc ,
79: .BR mips ,
80: or
81: .BR 3210 .
82: The libraries must have tables of contents
83: (see
84: .IR ar (1)).
85: .PP
86: In practice,
87: .B -l
88: options are rarely necessary as the header files for
89: the libraries cause their archives to be included automatically in the load
90: (see
91: .IR 2c (1)).
92: For example, any program that includes header file
93: .B libc.h
94: causes the loader
95: to search the C library
96: .BR /$objtype/lib/libc.a .
97: Also, the loader creates an undefined symbol
98: .B _main
99: (or
100: .B _mainp
101: if profiling is enabled) to force loading of the
102: startup linkage from the C library.
103: .PP
104: The order of search to resolve undefined symbols is to load all files and libraries
105: mentioned explicitly on the command line, and then to resolve remaining symbols
106: by searching in topological order
107: libraries mentioned in header files included by files already loaded.
108: When scanning such libraries, the algorithm is to scan each library repeatedly until
109: no new undefined symbols are picked up, then to start on the next library. Thus if library
110: .I A
111: needs
112: .I B
113: which needs
114: .I A
115: again, it may be necessary to mention
116: .I A
117: explicitly so it will be read a second time.
118: .PP
119: The loader options are:
120: .TP 1i
121: .B -l
122: (As a bare option.)
123: Suppress the default loading of the startup linkage and libraries
124: specified by header files.
125: .TP
126: .BI -o " out"
127: Place output in file
128: .IR out .
129: Default is
130: .IB O .out\f1,
131: where
132: .I O
133: is the first letter of the loader name.
134: .TP
135: .B -p
136: Insert profiling code into the executable output; no special action is needed
137: during compilation or assembly.
138: .TP
139: .B -s
140: Strip the symbol tables from the output file.
141: .TP
142: .B -a
143: Print the object code in assembly language, with addresses.
144: .TP
145: .B -v
146: Print debugging output that annotates the activities of the load.
147: .TP
148: .BI -c function
149: .RI ( Xl
150: only) Place the
151: .I function
152: in the internal RAM of the DSP3210.
153: .TP
154: .BI -M
155: .RI ( Kl
156: only) Generate instructions rather than calls to emulation routines
157: for multiply and divide.
158: .TP
159: .BI -m size
160: .RI ( Xl
161: only) Use
162: .I size
163: (default 0, maximum 8192)
164: bytes of internal RAM of the DSP3210 for functions and small data items.
165: .TP
166: .BI -E symbol
167: The entry point for the binary is
168: .I symbol
169: (default
170: .BR _main ;
171: .B _mainp
172: under
173: .BR -p ).
174: .TP
175: .BI -H n
176: Executable header is type
177: .IR n .
178: The meaning of the types is architecture-dependent; typically
179: type 1 is Plan 9 boot format and type 2 is the
180: regular Plan 9 format, the default. These are reversed on the MIPS.
181: The Next boot format is 3. Type 4 in
182: .I vl
183: creates a MIPS executable for an SGI Unix system.
184: .TP
185: .BI -T t
186: The text segment starts at address
187: .IR t .
188: .TP
189: .BI -D d
190: The data segment starts at address
191: .IR d .
192: .TP
193: .BI -R r
194: The text segment is rounded to a multiple of
195: .I r
196: (if
197: .I r
198: is nonzero).
199: .PP
200: The numbers in the above options can begin with
201: .L 0x
202: or
203: .L 0
204: to change the default base from decimal to hexadecimal or octal.
205: The defaults for the values depend on the compiler and the
206: header type.
207: .PP
208: The loaded image has several symbols inserted by the loader:
209: .B etext
210: is the address of the end of the text segment;
211: .B bdata
212: is the address of the beginning of the data segment;
213: .B edata
214: is the address of the end of the data segment;
215: and
216: .B end
217: is the address of the end of the bss segment, and of the program.
218: .SH FILES
219: .TF /$objtype/lib
220: .TP
221: .B /$objtype/lib
222: for
223: .BI -l lib
224: arguments.
225: .SH SOURCE
226: .B /sys/src/cmd/2l
227: etc.
228: .SH "SEE ALSO"
229: .IR 2c (1),
230: .IR 2a (1),
231: .IR alef (1),
232: .IR ar (1),
233: .IR nm (1),
234: .IR db (1),
235: .IR prof (1)
236: .PP
237: Rob Pike,
238: ``How to Use the Plan 9 C Compiler''
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.