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