]>
Commit | Line | Data |
---|---|---|
0e166a63 RP |
1 | .\" Copyright (c) 1991, 1992 Free Software Foundation |
2 | .\" See section COPYING for conditions for redistribution | |
3 | .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools" | |
4 | .de BP | |
5 | .sp | |
6 | .ti \-.2i | |
7 | \(** | |
8 | .. | |
9 | ||
10 | .SH NAME | |
11 | ld \- the GNU linker | |
12 | ||
13 | .SH SYNOPSIS | |
14 | .hy 0 | |
15 | .na | |
16 | .TP | |
17 | .B ld | |
18 | .RB "[\|" \-o " | |
19 | .I output\c | |
20 | \&\|] \c | |
8ddef552 | 21 | .I objfile\c |
0e166a63 RP |
22 | \&.\|.\|. |
23 | .br | |
24 | .RB "[\|" \-A\c | |
25 | .I architecture\c | |
26 | \&\|] | |
27 | .RB "[\|" "\-b\ "\c | |
28 | .I input-format\c | |
29 | \&\|] | |
30 | .RB "[\|" \-Bstatic "\|]" | |
31 | .RB "[\|" "\-c\ "\c | |
32 | .I commandfile\c | |
33 | \&\|] | |
34 | .RB "[\|" \-d | \-dc | \-dp\c | |
35 | \|] | |
36 | .br | |
37 | .RB "[\|" "\-defsym\ "\c | |
38 | .I symbol\c | |
39 | \& = \c | |
40 | .I expression\c | |
41 | \&\|] | |
42 | .RB "[\|" "\-e\ "\c | |
43 | .I entry\c | |
44 | \&\|] | |
45 | .RB "[\|" \-F "\|]" | |
46 | .RB "[\|" "\-F\ "\c | |
47 | .I format\c | |
48 | \&\|] | |
49 | .RB "[\|" "\-format\ "\c | |
50 | .I input-format\c | |
51 | \&\|] | |
52 | .RB "[\|" \-g "\|]" | |
8ddef552 DM |
53 | .RB "[\|" \-G\c |
54 | .I size\c | |
55 | \&\|] | |
bf065bfd | 56 | .RB "[\|" \-\-help "\|]" |
0e166a63 RP |
57 | .RB "[\|" \-i "\|]" |
58 | .RB "[\|" \-l\c | |
59 | .I ar\c | |
60 | \&\|] | |
61 | .RB "[\|" \-L\c | |
62 | .I searchdir\c | |
63 | \&\|] | |
8ddef552 | 64 | .RB "[\|" \-M "\|]" |
d18a4527 DM |
65 | .RB "[\|" \-Map\c |
66 | .I mapfile\c | |
67 | \&\|] | |
8ddef552 DM |
68 | .RB "[\|" \-m\c |
69 | .I emulation\c | |
70 | \&\|] | |
0e166a63 RP |
71 | .RB "[\|" \-n | \-N "\|]" |
72 | .RB "[\|" \-noinhibit-exec "\|]" | |
346535cc DM |
73 | .RB "[\|" "\-oformat\ "\c |
74 | .I output-format\c | |
75 | \&\|] | |
0e166a63 RP |
76 | .RB "[\|" "\-R\ "\c |
77 | .I filename\c | |
78 | \&\|] | |
79 | .RB "[\|" \-relax "\|]" | |
80 | .RB "[\|" \-r | \-Ur "\|]" | |
81 | .RB "[\|" \-S "\|]" | |
82 | .RB "[\|" \-s "\|]" | |
83 | .RB "[\|" "\-T\ "\c | |
84 | .I commandfile\c | |
85 | \&\|] | |
86 | .RB "[\|" "\-Ttext\ "\c | |
87 | .I textorg\c | |
88 | \&\|] | |
89 | .RB "[\|" "\-Tdata\ "\c | |
90 | .I dataorg\c | |
91 | \&\|] | |
92 | .RB "[\|" "\-Tbss\ "\c | |
93 | .I bssorg\c | |
94 | \&\|] | |
95 | .RB "[\|" \-t "\|]" | |
96 | .RB "[\|" "\-u\ "\c | |
97 | .I sym\c | |
98 | \&] | |
8ddef552 | 99 | .RB "[\|" \-V "\|]" |
0e166a63 | 100 | .RB "[\|" \-v "\|]" |
bf065bfd | 101 | .RB "[\|" \-\-version "\|]" |
0e166a63 RP |
102 | .RB "[\|" \-X "\|]" |
103 | .RB "[\|" \-x "\|]" | |
0e166a63 RP |
104 | .ad b |
105 | .hy 1 | |
106 | .SH DESCRIPTION | |
107 | \c | |
108 | .B ld\c | |
109 | \& combines a number of object and archive files, relocates | |
110 | their data and ties up symbol references. Often the last step in | |
111 | building a new compiled program to run is a call to \c | |
112 | .B ld\c | |
113 | \&. | |
114 | ||
115 | \c | |
116 | .B ld\c | |
117 | \& accepts Linker Command Language files | |
118 | to provide explicit and total control over the linking process. | |
119 | This man page does not describe the command language; see the `\|\c | |
120 | .B ld\c | |
121 | \|' entry in `\|\c | |
122 | .B info\c | |
123 | \|', or the manual | |
124 | .I | |
125 | ld: the GNU linker | |
126 | \&, for full details on the command language and on other aspects of | |
127 | the GNU linker. | |
128 | ||
129 | This version of \c | |
130 | .B ld\c | |
131 | \& uses the general purpose BFD libraries | |
132 | to operate on object files. This allows \c | |
133 | .B ld\c | |
134 | \& to read, combine, and | |
135 | write object files in many different formats\(em\&for example, COFF or | |
136 | \c | |
137 | .B a.out\c | |
138 | \&. Different formats may be linked together to produce any | |
139 | available kind of object file. You can use `\|\c | |
140 | .B objdump \-i\c | |
141 | \|' to get a list of formats supported on various architectures; see | |
142 | .BR objdump ( 1 ). | |
143 | ||
144 | Aside from its flexibility, the GNU linker is more helpful than other | |
145 | linkers in providing diagnostic information. Many linkers abandon | |
146 | execution immediately upon encountering an error; whenever possible, | |
147 | \c | |
148 | .B ld\c | |
149 | \& continues executing, allowing you to identify other errors | |
150 | (or, in some cases, to get an output file in spite of the error). | |
151 | ||
152 | The GNU linker \c | |
153 | .B ld\c | |
154 | \& is meant to cover a broad range of situations, | |
155 | and to be as compatible as possible with other linkers. As a result, | |
156 | you have many choices to control its behavior through the command line, | |
157 | and through environment variables. | |
158 | ||
159 | .SH OPTIONS | |
160 | The plethora of command-line options may seem intimidating, but in | |
161 | actual practice few of them are used in any particular context. | |
162 | For instance, a frequent use of \c | |
163 | .B ld\c | |
164 | \& is to link standard Unix | |
165 | object files on a standard, supported Unix system. On such a system, to | |
166 | link a file \c | |
167 | .B hello.o\c | |
168 | \&: | |
169 | .sp | |
170 | .br | |
171 | $\ ld\ \-o\ output\ /lib/crt0.o\ hello.o\ \-lc | |
172 | .br | |
173 | .sp | |
174 | This tells \c | |
175 | .B ld\c | |
176 | \& to produce a file called \c | |
177 | .B output\c | |
178 | \& as the | |
179 | result of linking the file \c | |
180 | .B /lib/crt0.o\c | |
181 | \& with \c | |
182 | .B hello.o\c | |
183 | \& and | |
184 | the library \c | |
185 | .B libc.a\c | |
186 | \& which will come from the standard search | |
187 | directories. | |
188 | ||
189 | The command-line options to \c | |
190 | .B ld\c | |
191 | \& may be specified in any order, and | |
192 | may be repeated at will. For the most part, repeating an option with a | |
193 | different argument will either have no further effect, or override prior | |
194 | occurrences (those further to the left on the command line) of an | |
195 | option. | |
196 | ||
197 | The exceptions\(em\&which may meaningfully be used more than once\(em\&are | |
198 | \c | |
199 | .B \-A\c | |
200 | \&, \c | |
201 | .B \-b\c | |
202 | \& (or its synonym \c | |
203 | .B \-format\c | |
204 | \&), \c | |
205 | .B \-defsym\c | |
206 | \&, | |
207 | \c | |
208 | .B \-L\c | |
209 | \&, \c | |
210 | .B \-l\c | |
211 | \&, \c | |
212 | .B \-R\c | |
213 | \&, and \c | |
214 | .B \-u\c | |
215 | \&. | |
216 | ||
217 | The list of object files to be linked together, shown as \c | |
8ddef552 | 218 | .I objfile\c |
0e166a63 RP |
219 | \&, |
220 | may follow, precede, or be mixed in with command-line options; save that | |
221 | an \c | |
8ddef552 | 222 | .I objfile\c |
0e166a63 RP |
223 | \& argument may not be placed between an option flag and |
224 | its argument. | |
225 | ||
226 | Usually the linker is invoked with at least one object file, but other | |
227 | forms of binary input files can also be specified with \c | |
228 | .B \-l\c | |
229 | \&, | |
230 | \c | |
231 | .B \-R\c | |
232 | \&, and the script command language. If \c | |
233 | .I no\c | |
234 | \& binary input | |
235 | files at all are specified, the linker does not produce any output, and | |
236 | issues the message `\|\c | |
237 | .B No input files\c | |
238 | \|'. | |
239 | ||
240 | Option arguments must either follow the option letter without intervening | |
241 | whitespace, or be given as separate arguments immediately following the | |
242 | option that requires them. | |
243 | ||
0e166a63 RP |
244 | .TP |
245 | .BI "-A" "architecture"\c | |
246 | \& | |
247 | In the current release of \c | |
248 | .B ld\c | |
249 | \&, this option is useful only for the | |
250 | Intel 960 family of architectures. In that \c | |
251 | .B ld\c | |
252 | \& configuration, the | |
253 | \c | |
254 | .I architecture\c | |
255 | \& argument is one of the two-letter names identifying | |
256 | members of the 960 family; the option specifies the desired output | |
257 | target, and warns of any incompatible instructions in the input files. | |
258 | It also modifies the linker's search strategy for archive libraries, to | |
259 | support the use of libraries specific to each particular | |
260 | architecture, by including in the search loop names suffixed with the | |
261 | string identifying the architecture. | |
262 | ||
263 | For example, if your \c | |
264 | .B ld\c | |
265 | \& command line included `\|\c | |
266 | .B \-ACA\c | |
267 | \|' as | |
268 | well as `\|\c | |
269 | .B \-ltry\c | |
270 | \|', the linker would look (in its built-in search | |
271 | paths, and in any paths you specify with \c | |
272 | .B \-L\c | |
273 | \&) for a library with | |
274 | the names | |
275 | .sp | |
276 | .br | |
277 | try | |
278 | .br | |
279 | libtry.a | |
280 | .br | |
281 | tryca | |
282 | .br | |
283 | libtryca.a | |
284 | .br | |
285 | .sp | |
286 | ||
287 | The first two possibilities would be considered in any event; the last | |
288 | two are due to the use of `\|\c | |
289 | .B \-ACA\c | |
290 | \|'. | |
291 | ||
292 | Future releases of \c | |
293 | .B ld\c | |
294 | \& may support similar functionality for | |
295 | other architecture families. | |
296 | ||
297 | You can meaningfully use \c | |
298 | .B \-A\c | |
299 | \& more than once on a command line, if | |
300 | an architecture family allows combination of target architectures; each | |
301 | use will add another pair of name variants to search for when \c | |
302 | .B \-l\c | |
303 | \& | |
304 | specifies a library. | |
305 | ||
306 | .TP | |
307 | .BI "-b " "input-format"\c | |
308 | \& | |
309 | Specify the binary format for input object files that follow this option | |
310 | on the command line. You don't usually need to specify this, as | |
311 | \c | |
312 | .B ld\c | |
313 | \& is configured to expect as a default input format the most | |
314 | usual format on each machine. \c | |
315 | .I input-format\c | |
316 | \& is a text string, the | |
317 | name of a particular format supported by the BFD libraries. | |
318 | \c | |
319 | .B \-format \c | |
320 | .I input-format\c | |
321 | \&\c | |
346535cc DM |
322 | \& has the same effect, as does the script command |
323 | .BR TARGET . | |
0e166a63 RP |
324 | |
325 | You may want to use this option if you are linking files with an unusual | |
326 | binary format. You can also use \c | |
327 | .B \-b\c | |
328 | \& to switch formats explicitly (when | |
329 | linking object files of different formats), by including | |
330 | \c | |
331 | .B \-b \c | |
332 | .I input-format\c | |
333 | \&\c | |
334 | \& before each group of object files in a | |
335 | particular format. | |
336 | ||
337 | The default format is taken from the environment variable | |
338 | .B GNUTARGET\c | |
339 | \&. You can also define the input | |
340 | format from a script, using the command \c | |
341 | .B TARGET\c | |
342 | \&. | |
343 | ||
344 | .TP | |
345 | .B \-Bstatic | |
346 | This flag is accepted for command-line compatibility with the SunOS linker, | |
347 | but has no effect on \c | |
348 | .B ld\c | |
349 | \&. | |
350 | ||
351 | .TP | |
352 | .BI "-c " "commandfile"\c | |
353 | \& | |
354 | Directs \c | |
355 | .B ld\c | |
356 | \& to read link commands from the file | |
357 | \c | |
358 | .I commandfile\c | |
359 | \&. These commands will completely override \c | |
360 | .B ld\c | |
361 | \&'s | |
362 | default link format (rather than adding to it); \c | |
363 | .I commandfile\c | |
364 | \& must | |
365 | specify everything necessary to describe the target format. | |
366 | ||
367 | ||
368 | You may also include a script of link commands directly in the command | |
369 | line by bracketing it between `\|\c | |
370 | .B {\c | |
371 | \|' and `\|\c | |
372 | .B }\c | |
373 | \|' characters. | |
374 | ||
375 | .TP | |
376 | .B \-d | |
377 | .TP | |
378 | .B \-dc | |
379 | .TP | |
380 | .B \-dp | |
381 | These three options are equivalent; multiple forms are supported for | |
382 | compatibility with other linkers. Use any of them to make \c | |
383 | .B ld\c | |
384 | \& | |
385 | assign space to common symbols even if a relocatable output file is | |
386 | specified (\c | |
387 | .B \-r\c | |
388 | \&). The script command | |
389 | \c | |
390 | .B FORCE_COMMON_ALLOCATION\c | |
391 | \& has the same effect. | |
392 | ||
393 | .TP | |
394 | .BI "-defsym " "symbol"\c | |
395 | \& = \c | |
396 | .I expression\c | |
397 | \& | |
398 | Create a global symbol in the output file, containing the absolute | |
399 | address given by \c | |
400 | .I expression\c | |
401 | \&. You may use this option as many | |
402 | times as necessary to define multiple symbols in the command line. A | |
403 | limited form of arithmetic is supported for the \c | |
404 | .I expression\c | |
405 | \& in this | |
406 | context: you may give a hexadecimal constant or the name of an existing | |
407 | symbol, or use \c | |
408 | .B +\c | |
409 | \& and \c | |
410 | .B \-\c | |
411 | \& to add or subtract hexadecimal | |
412 | constants or symbols. If you need more elaborate expressions, consider | |
413 | using the linker command language from a script. | |
414 | ||
415 | .TP | |
416 | .BI "-e " "entry"\c | |
417 | \& | |
418 | Use \c | |
419 | .I entry\c | |
420 | \& as the explicit symbol for beginning execution of your | |
421 | program, rather than the default entry point. for a | |
422 | discussion of defaults and other ways of specifying the | |
423 | entry point. | |
424 | ||
425 | .TP | |
426 | .B \-F | |
427 | .TP | |
428 | .BI "-F" "format"\c | |
429 | \& | |
430 | Some older linkers used this option throughout a compilation toolchain | |
431 | for specifying object-file format for both input and output object | |
432 | files. \c | |
433 | .B ld\c | |
434 | \&'s mechanisms (the \c | |
435 | .B \-b\c | |
436 | \& or \c | |
437 | .B \-format\c | |
438 | \& options | |
439 | for input files, the \c | |
440 | .B TARGET\c | |
441 | \& command in linker scripts for output | |
442 | files, the \c | |
443 | .B GNUTARGET\c | |
444 | \& environment variable) are more flexible, but | |
445 | but it accepts (and ignores) the \c | |
446 | .B \-F\c | |
447 | \& option flag for compatibility | |
448 | with scripts written to call the old linker. | |
449 | ||
450 | .TP | |
451 | .BI "-format " "input-format"\c | |
452 | \& | |
453 | Synonym for \c | |
454 | .B \-b\c | |
455 | \& \c | |
456 | .I input-format\c | |
457 | \&. | |
458 | ||
459 | .TP | |
460 | .B \-g | |
461 | Accepted, but ignored; provided for compatibility with other tools. | |
462 | ||
8ddef552 DM |
463 | .TP |
464 | .BI "\-G " "size"\c | |
465 | Set the maximum size of objects to be optimized using the GP register | |
466 | to | |
467 | .I size | |
468 | under MIPS ECOFF. Ignored for other object file formats. | |
469 | ||
bf065bfd DM |
470 | .TP |
471 | .B \-\-help | |
472 | Print a summary of the command-line options on the standard output and exit. | |
473 | This option and | |
474 | .B \-\-version | |
475 | begin with two dashes instead of one | |
476 | for compatibility with other GNU programs. The other options start with | |
477 | only one dash for compatibility with other linkers. | |
478 | ||
0e166a63 RP |
479 | .TP |
480 | .B \-i | |
481 | Perform an incremental link (same as option \c | |
482 | .B \-r\c | |
483 | \&). | |
484 | ||
485 | .TP | |
486 | .BI "-l" "ar"\c | |
487 | \& | |
488 | Add an archive file \c | |
489 | .I ar\c | |
490 | \& to the list of files to link. This | |
491 | option may be used any number of times. \c | |
492 | .B ld\c | |
493 | \& will search its | |
494 | path-list for occurrences of \c | |
495 | .B lib\c | |
496 | .I ar\c | |
497 | \&.a\c | |
498 | \& for every \c | |
499 | .I ar\c | |
500 | \& | |
501 | specified. | |
502 | ||
503 | .TP | |
504 | .BI "-L" "searchdir"\c | |
505 | \& | |
506 | This command adds path \c | |
507 | .I searchdir\c | |
508 | \& to the list of paths that | |
509 | \c | |
510 | .B ld\c | |
511 | \& will search for archive libraries. You may use this option | |
512 | any number of times. | |
513 | ||
514 | The default set of paths searched (without being specified with | |
515 | \c | |
516 | .B \-L\c | |
517 | \&) depends on what emulation mode \c | |
518 | .B ld\c | |
519 | \& is using, and in | |
520 | some cases also on how it was configured. The | |
521 | paths can also be specified in a link script with the \c | |
522 | .B SEARCH_DIR\c | |
523 | \& | |
524 | command. | |
525 | ||
526 | .TP | |
527 | .B \-M | |
0e166a63 RP |
528 | Print (to the standard output file) a link map\(em\&diagnostic information |
529 | about where symbols are mapped by \c | |
530 | .B ld\c | |
531 | \&, and information on global | |
532 | common storage allocation. | |
533 | ||
d18a4527 DM |
534 | .TP |
535 | .BI "\-Map " "mapfile"\c | |
536 | Print to the file | |
537 | .I mapfile | |
538 | a link map\(em\&diagnostic information | |
539 | about where symbols are mapped by \c | |
540 | .B ld\c | |
541 | \&, and information on global | |
542 | common storage allocation. | |
543 | ||
8ddef552 DM |
544 | .TP |
545 | .BI "\-m " "emulation"\c | |
546 | Emulate the | |
547 | .I emulation | |
548 | linker. You can list the available emulations with the | |
549 | .I \-V | |
550 | option. This option overrides the compiled-in default, which is the | |
551 | system for which you configured | |
552 | .BR ld . | |
553 | ||
0e166a63 RP |
554 | .TP |
555 | .B \-N | |
556 | specifies readable and writable \c | |
557 | .B text\c | |
558 | \& and \c | |
559 | .B data\c | |
560 | \& sections. If | |
561 | the output format supports Unix style magic numbers, the output is | |
562 | marked as \c | |
563 | .B OMAGIC\c | |
564 | \&. | |
565 | ||
566 | When you use the `\|\c | |
567 | .B \-N\c | |
568 | \&\|' option, the linker does not page-align the | |
569 | data segment. | |
570 | ||
571 | .TP | |
572 | .B \-n | |
573 | sets the text segment to be read only, and \c | |
574 | .B NMAGIC\c | |
575 | \& is written | |
576 | if possible. | |
577 | ||
578 | .TP | |
579 | .B \-noinhibit-exec | |
580 | Normally, the linker will not produce an output file if it encounters | |
581 | errors during the link process. With this flag, you can specify that | |
582 | you wish the output file retained even after non-fatal errors. | |
583 | ||
584 | .TP | |
585 | .BI "-o " "output"\c | |
586 | \& | |
587 | .I output\c | |
588 | \& | |
589 | \c | |
590 | .I output\c | |
591 | \& is a name for the program produced by \c | |
592 | .B ld\c | |
593 | \&; if this | |
594 | option is not specified, the name `\|\c | |
595 | .B a.out\c | |
596 | \|' is used by default. The | |
597 | script command \c | |
598 | .B OUTPUT\c | |
599 | \& can also specify the output file name. | |
600 | ||
346535cc DM |
601 | .TP |
602 | .BI "-oformat " "output-format"\c | |
603 | \& | |
604 | Specify the binary format for the output object file. | |
605 | You don't usually need to specify this, as | |
606 | \c | |
607 | .B ld\c | |
608 | \& is configured to produce as a default output format the most | |
609 | usual format on each machine. \c | |
610 | .I output-format\c | |
611 | \& is a text string, the | |
612 | name of a particular format supported by the BFD libraries. | |
613 | The script command | |
614 | .B OUTPUT_FORMAT | |
615 | can also specify the output format, but this option overrides it. | |
616 | ||
0e166a63 RP |
617 | .TP |
618 | .BI "-R " "filename"\c | |
619 | \& | |
620 | .I file\c | |
621 | \& | |
622 | Read symbol names and their addresses from \c | |
623 | .I filename\c | |
624 | \&, but do not | |
625 | relocate it or include it in the output. This allows your output file | |
626 | to refer symbolically to absolute locations of memory defined in other | |
627 | programs. | |
628 | ||
629 | .TP | |
630 | .B \-relax | |
631 | An option with machine dependent effects. Currently this option is only | |
632 | supported on the H8/300. | |
633 | ||
634 | On some platforms, use this option to perform global optimizations that | |
635 | become possible when the linker resolves addressing in your program, such | |
636 | as relaxing address modes and synthesizing new instructions in the | |
637 | output object file. | |
638 | ||
639 | On platforms where this is not supported, `\|\c | |
640 | .B \-relax\c | |
641 | \&\|' is accepted, but has no effect. | |
642 | ||
643 | .TP | |
644 | .B \-r | |
645 | Generates relocatable output\(em\&i.e., generate an output file that can in | |
646 | turn serve as input to \c | |
647 | .B ld\c | |
648 | \&. This is often called \c | |
649 | .I partial | |
650 | linking\c | |
651 | \&. As a side effect, in environments that support standard Unix | |
652 | magic numbers, this option also sets the output file's magic number to | |
653 | \c | |
654 | .B OMAGIC\c | |
655 | \&. | |
656 | If this option is not specified, an absolute file is produced. When | |
657 | linking C++ programs, this option \c | |
658 | .I will not\c | |
659 | \& resolve references to | |
660 | constructors; \c | |
661 | .B \-Ur\c | |
662 | \& is an alternative. | |
663 | ||
664 | This option does the same as \c | |
665 | .B \-i\c | |
666 | \&. | |
667 | ||
668 | .TP | |
669 | .B \-S | |
670 | Omits debugger symbol information (but not all symbols) from the output file. | |
671 | ||
672 | .TP | |
673 | .B \-s | |
674 | Omits all symbol information from the output file. | |
675 | ||
0e166a63 RP |
676 | .TP |
677 | .BI "-Tbss " "org"\c | |
678 | .TP | |
679 | .BI "-Tdata " "org"\c | |
680 | .TP | |
681 | .BI "-Ttext " "org"\c | |
682 | Use \c | |
683 | .I org\c | |
684 | \& as the starting address for\(em\&respectively\(em\&the | |
685 | \c | |
686 | .B bss\c | |
687 | \&, \c | |
688 | .B data\c | |
689 | \&, or the \c | |
690 | .B text\c | |
691 | \& segment of the output file. | |
692 | \c | |
693 | .I textorg\c | |
694 | \& must be a hexadecimal integer. | |
695 | ||
696 | .TP | |
697 | .BI "-T " "commandfile"\c | |
698 | \& | |
699 | .TP | |
700 | .BI "-T" "commandfile"\c | |
701 | Equivalent to \c | |
702 | .B \-c \c | |
703 | .I commandfile\c | |
704 | \&\c | |
705 | \&; supported for compatibility with | |
706 | other tools. | |
707 | ||
708 | .TP | |
709 | .B \-t | |
710 | Prints names of input files as \c | |
711 | .B ld\c | |
712 | \& processes them. | |
713 | ||
714 | .TP | |
715 | .BI "-u " "sym" | |
716 | Forces \c | |
717 | .I sym\c | |
718 | \& to be entered in the output file as an undefined symbol. | |
719 | This may, for example, trigger linking of additional modules from | |
720 | standard libraries. \c | |
721 | .B \-u\c | |
722 | \& may be repeated with different option | |
723 | arguments to enter additional undefined symbols. | |
724 | ||
725 | .TP | |
726 | .B \-Ur | |
727 | For anything other than C++ programs, this option is equivalent to | |
728 | \c | |
729 | .B \-r\c | |
730 | \&: it generates relocatable output\(em\&i.e., an output file that can in | |
731 | turn serve as input to \c | |
732 | .B ld\c | |
733 | \&. When linking C++ programs, \c | |
734 | .B \-Ur\c | |
735 | \& | |
736 | \c | |
737 | .I will\c | |
738 | \& resolve references to constructors, unlike \c | |
739 | .B \-r\c | |
740 | \&. | |
741 | ||
8ddef552 DM |
742 | .TP |
743 | .B \-V | |
744 | Display the version number for \c | |
745 | .B ld | |
746 | and list the supported emulations. | |
de87cdb4 | 747 | Display which input files can and can not be opened. |
8ddef552 | 748 | |
0e166a63 RP |
749 | .TP |
750 | .B \-v | |
751 | Display the version number for \c | |
752 | .B ld\c | |
753 | \&. | |
754 | ||
bf065bfd DM |
755 | .TP |
756 | .B \-\-version | |
757 | Display the version number for \c | |
758 | .B ld | |
759 | and exit. | |
760 | ||
0e166a63 RP |
761 | .TP |
762 | .B \-X | |
763 | If \c | |
764 | .B \-s\c | |
765 | \& or \c | |
766 | .B \-S\c | |
767 | \& is also specified, delete only local symbols | |
768 | beginning with `\|\c | |
769 | .B L\c | |
770 | \|'. | |
771 | ||
772 | .TP | |
773 | .B \-x | |
774 | If \c | |
775 | .B \-s\c | |
776 | \& or \c | |
777 | .B \-S\c | |
778 | \& is also specified, delete all local symbols, | |
779 | not just those beginning with `\|\c | |
780 | .B L\c | |
781 | \|'. | |
782 | ||
783 | .PP | |
784 | ||
785 | .SH ENVIRONMENT | |
786 | \c | |
8ddef552 | 787 | You can change the behavior of |
0e166a63 | 788 | .B ld\c |
8ddef552 | 789 | \& with the environment variable \c |
0e166a63 | 790 | .B GNUTARGET\c |
8ddef552 | 791 | \&. |
0e166a63 RP |
792 | |
793 | \c | |
794 | .B GNUTARGET\c | |
795 | \& determines the input-file object format if you don't | |
796 | use \c | |
797 | .B \-b\c | |
798 | \& (or its synonym \c | |
799 | .B \-format\c | |
800 | \&). Its value should be one | |
801 | of the BFD names for an input format. If there is no | |
802 | \c | |
803 | .B GNUTARGET\c | |
804 | \& in the environment, \c | |
805 | .B ld\c | |
806 | \& uses the natural format | |
807 | of the host. If \c | |
808 | .B GNUTARGET\c | |
809 | \& is set to \c | |
810 | .B default\c | |
811 | \& then BFD attempts to discover the | |
812 | input format by examining binary input files; this method often | |
813 | succeeds, but there are potential ambiguities, since there is no method | |
814 | of ensuring that the magic number used to flag object-file formats is | |
815 | unique. However, the configuration procedure for BFD on each system | |
816 | places the conventional format for that system first in the search-list, | |
817 | so ambiguities are resolved in favor of convention. | |
818 | ||
0e166a63 RP |
819 | .PP |
820 | ||
821 | .SH "SEE ALSO" | |
822 | ||
823 | .BR objdump ( 1 ) | |
824 | .br | |
825 | .br | |
826 | .RB "`\|" ld "\|' and `\|" binutils "\|'" | |
827 | entries in | |
828 | .B info\c | |
829 | .br | |
830 | .I | |
831 | ld: the GNU linker\c | |
832 | , Steve Chamberlain and Roland Pesch; | |
833 | .I | |
834 | The GNU Binary Utilities\c | |
835 | , Roland H. Pesch. | |
836 | ||
837 | .SH COPYING | |
838 | Copyright (c) 1991, 1992 Free Software Foundation, Inc. | |
839 | .PP | |
840 | Permission is granted to make and distribute verbatim copies of | |
841 | this manual provided the copyright notice and this permission notice | |
842 | are preserved on all copies. | |
843 | .PP | |
844 | Permission is granted to copy and distribute modified versions of this | |
845 | manual under the conditions for verbatim copying, provided that the | |
846 | entire resulting derived work is distributed under the terms of a | |
847 | permission notice identical to this one. | |
848 | .PP | |
849 | Permission is granted to copy and distribute translations of this | |
850 | manual into another language, under the above conditions for modified | |
851 | versions, except that this permission notice may be included in | |
852 | translations approved by the Free Software Foundation instead of in | |
853 | the original English. |