]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/binutils/binutils/doc/binutils.7
src.conf.5: regen after r368667, GDB retirement
[FreeBSD/FreeBSD.git] / contrib / binutils / binutils / doc / binutils.7
1 .Dd 2015-03-02
2 .Dt BINUTILS 7
3 .Os
4 .Sh NAME
5 .Nm binutils
6 .Nd GNU Binary Utilities
7 .Sh  Introduction
8 This brief manual contains documentation for the GNU binary utilities version "2.17.50
9 [FreeBSD] 2007-07-03":
10 .Pp
11 This document is distributed under the terms of the GNU Free Documentation
12 License. A copy of the license is included in the section entitled "GNU Free
13 Documentation License".
14 .Pp
15 .Sh  ar
16 .Bd -literal -offset indent
17 ar [-]p[mod [relpos] [count]] archive [member...]
18 ar -M [ <mri-script ]
19 .Ed
20 .Pp
21 The GNU
22 .Xr ar
23 program creates, modifies, and extracts from archives. An
24 .Em archive
25 is a single file holding a collection of other files in a structure that makes
26 it possible to retrieve the original individual files (called
27 .Em members
28 of the archive).
29 .Pp
30 The original files' contents, mode (permissions), timestamp, owner, and group
31 are preserved in the archive, and can be restored on extraction.
32 .Pp
33 GNU
34 .Xr ar
35 can maintain archives whose members have names of any length; however, depending
36 on how
37 .Xr ar
38 is configured on your system, a limit on member-name length may be imposed
39 for compatibility with archive formats maintained with other tools. If it
40 exists, the limit is often 15 characters (typical of formats related to a.out)
41 or 16 characters (typical of formats related to coff).
42 .Pp
43 .Xr ar
44 is considered a binary utility because archives of this sort are most often
45 used as
46 .Em libraries
47 holding commonly needed subroutines.
48 .Pp
49 .Xr ar
50 creates an index to the symbols defined in relocatable object modules in the
51 archive when you specify the modifier
52 .Li s .
53 Once created, this index is updated in the archive whenever
54 .Xr ar
55 makes a change to its contents (save for the
56 .Li q
57 update operation). An archive with such an index speeds up linking to the
58 library, and allows routines in the library to call each other without regard
59 to their placement in the archive.
60 .Pp
61 You may use
62 .Li nm -s
63 or
64 .Li nm --print-armap
65 to list this index table. If an archive lacks the table, another form of
66 .Xr ar
67 called
68 .Xr ranlib
69 can be used to add just the table.
70 .Pp
71 GNU
72 .Xr ar
73 is designed to be compatible with two different facilities. You can control
74 its activity using command-line options, like the different varieties of
75 .Xr ar
76 on Unix systems; or, if you specify the single command-line option
77 .Op -M ,
78 you can control it with a script supplied via standard input, like the MRI
79 \(lqlibrarian\(rq program.
80 .Pp
81 .Ss  Controlling Xr ar on the Command Line
82 .Bd -literal -offset indent
83 ar [-X32_64] [-]p[mod [relpos] [count]] archive [member...]
84 .Ed
85 .Pp
86 When you use
87 .Xr ar
88 in the Unix style,
89 .Xr ar
90 insists on at least two arguments to execute: one keyletter specifying the
91 .Em operation
92 (optionally accompanied by other keyletters specifying
93 .Em modifiers ) ,
94 and the archive name to act on.
95 .Pp
96 Most operations can also accept further
97 .Va member
98 arguments, specifying particular files to operate on.
99 .Pp
100 GNU
101 .Xr ar
102 allows you to mix the operation code
103 .Va p
104 and modifier flags
105 .Va mod
106 in any order, within the first command-line argument.
107 .Pp
108 If you wish, you may begin the first command-line argument with a dash.
109 .Pp
110 The
111 .Va p
112 keyletter specifies what operation to execute; it may be any of the following,
113 but you must specify only one of them:
114 .Pp
115 .Bl -tag -width Ds
116 .It  d
117 .Em Delete
118 modules from the archive. Specify the names of modules to be deleted as
119 .Va member
120 \&...; the archive is untouched if you specify no files to delete.
121 .Pp
122 If you specify the
123 .Li v
124 modifier,
125 .Xr ar
126 lists each module as it is deleted.
127 .Pp
128 .It  m
129 Use this operation to
130 .Em move
131 members in an archive.
132 .Pp
133 The ordering of members in an archive can make a difference in how programs
134 are linked using the library, if a symbol is defined in more than one member.
135 .Pp
136 If no modifiers are used with
137 .Li m ,
138 any members you name in the
139 .Va member
140 arguments are moved to the
141 .Em end
142 of the archive; you can use the
143 .Li a ,
144 .Li b ,
145 or
146 .Li i
147 modifiers to move them to a specified place instead.
148 .Pp
149 .It  p
150 .Em Print
151 the specified members of the archive, to the standard output file. If the
152 .Li v
153 modifier is specified, show the member name before copying its contents to
154 standard output.
155 .Pp
156 If you specify no
157 .Va member
158 arguments, all the files in the archive are printed.
159 .Pp
160 .It  q
161 .Em Quick append ;
162 Historically, add the files
163 .Va member
164 \&...to the end of
165 .Va archive ,
166 without checking for replacement.
167 .Pp
168 The modifiers
169 .Li a ,
170 .Li b ,
171 and
172 .Li i
173 do
174 .Em not
175 affect this operation; new members are always placed at the end of the archive.
176 .Pp
177 The modifier
178 .Li v
179 makes
180 .Xr ar
181 list each file as it is appended.
182 .Pp
183 Since the point of this operation is speed, the archive's symbol table index
184 is not updated, even if it already existed; you can use
185 .Li ar s
186 or
187 .Xr ranlib
188 explicitly to update the symbol table index.
189 .Pp
190 However, too many different systems assume quick append rebuilds the index,
191 so GNU
192 .Xr ar
193 implements
194 .Li q
195 as a synonym for
196 .Li r .
197 .Pp
198 .It  r
199 Insert the files
200 .Va member
201 \&...into
202 .Va archive
203 (with
204 .Em replacement ) .
205 This operation differs from
206 .Li q
207 in that any previously existing members are deleted if their names match those
208 being added.
209 .Pp
210 If one of the files named in
211 .Va member
212 \&...does not exist,
213 .Xr ar
214 displays an error message, and leaves undisturbed any existing members of
215 the archive matching that name.
216 .Pp
217 By default, new members are added at the end of the file; but you may use
218 one of the modifiers
219 .Li a ,
220 .Li b ,
221 or
222 .Li i
223 to request placement relative to some existing member.
224 .Pp
225 The modifier
226 .Li v
227 used with this operation elicits a line of output for each file inserted,
228 along with one of the letters
229 .Li a
230 or
231 .Li r
232 to indicate whether the file was appended (no old member deleted) or replaced.
233 .Pp
234 .It  t
235 Display a
236 .Em table
237 listing the contents of
238 .Va archive ,
239 or those of the files listed in
240 .Va member
241 \&...that are present in the archive. Normally only the member name is shown; if
242 you also want to see the modes (permissions), timestamp, owner, group, and
243 size, you can request that by also specifying the
244 .Li v
245 modifier.
246 .Pp
247 If you do not specify a
248 .Va member ,
249 all files in the archive are listed.
250 .Pp
251 If there is more than one file with the same name (say,
252 .Li fie )
253 in an archive (say
254 .Li b.a ) ,
255 .Li ar t b.a fie
256 lists only the first instance; to see them all, you must ask for a complete
257 listing---in our example,
258 .Li ar t b.a .
259 .Pp
260 .It  x
261 .Em Extract
262 members (named
263 .Va member )
264 from the archive. You can use the
265 .Li v
266 modifier with this operation, to request that
267 .Xr ar
268 list each name as it extracts it.
269 .Pp
270 If you do not specify a
271 .Va member ,
272 all files in the archive are extracted.
273 .Pp
274 .El
275 A number of modifiers (
276 .Va mod )
277 may immediately follow the
278 .Va p
279 keyletter, to specify variations on an operation's behavior:
280 .Pp
281 .Bl -tag -width Ds
282 .It  a
283 Add new files
284 .Em after
285 an existing member of the archive. If you use the modifier
286 .Li a ,
287 the name of an existing archive member must be present as the
288 .Va relpos
289 argument, before the
290 .Va archive
291 specification.
292 .Pp
293 .It  b
294 Add new files
295 .Em before
296 an existing member of the archive. If you use the modifier
297 .Li b ,
298 the name of an existing archive member must be present as the
299 .Va relpos
300 argument, before the
301 .Va archive
302 specification. (same as
303 .Li i ) .
304 .Pp
305 .It  c
306 .Em Create
307 the archive. The specified
308 .Va archive
309 is always created if it did not exist, when you request an update. But a warning
310 is issued unless you specify in advance that you expect to create it, by using
311 this modifier.
312 .Pp
313 .It  f
314 Truncate names in the archive. GNU
315 .Xr ar
316 will normally permit file names of any length. This will cause it to create
317 archives which are not compatible with the native
318 .Xr ar
319 program on some systems. If this is a concern, the
320 .Li f
321 modifier may be used to truncate file names when putting them in the archive.
322 .Pp
323 .It  i
324 Insert new files
325 .Em before
326 an existing member of the archive. If you use the modifier
327 .Li i ,
328 the name of an existing archive member must be present as the
329 .Va relpos
330 argument, before the
331 .Va archive
332 specification. (same as
333 .Li b ) .
334 .Pp
335 .It  l
336 This modifier is accepted but not used.
337 .Pp
338 .It  N
339 Uses the
340 .Va count
341 parameter. This is used if there are multiple entries in the archive with
342 the same name. Extract or delete instance
343 .Va count
344 of the given name from the archive.
345 .Pp
346 .It  o
347 Preserve the
348 .Em original
349 dates of members when extracting them. If you do not specify this modifier,
350 files extracted from the archive are stamped with the time of extraction.
351 .Pp
352 .It  P
353 Use the full path name when matching names in the archive. GNU
354 .Xr ar
355 can not create an archive with a full path name (such archives are not POSIX
356 complaint), but other archive creators can. This option will cause GNU
357 .Xr ar
358 to match file names using a complete path name, which can be convenient when
359 extracting a single file from an archive created by another tool.
360 .Pp
361 .It  s
362 Write an object-file index into the archive, or update an existing one, even
363 if no other change is made to the archive. You may use this modifier flag
364 either with any operation, or alone. Running
365 .Li ar s
366 on an archive is equivalent to running
367 .Li ranlib
368 on it.
369 .Pp
370 .It  S
371 Do not generate an archive symbol table. This can speed up building a large
372 library in several steps. The resulting archive can not be used with the linker.
373 In order to build a symbol table, you must omit the
374 .Li S
375 modifier on the last execution of
376 .Li ar ,
377 or you must run
378 .Li ranlib
379 on the archive.
380 .Pp
381 .It  u
382 Normally,
383 .Li ar r
384 \&...inserts all files listed into the archive. If you would like to insert
385 .Em only
386 those of the files you list that are newer than existing members of the same
387 names, use this modifier. The
388 .Li u
389 modifier is allowed only for the operation
390 .Li r
391 (replace). In particular, the combination
392 .Li qu
393 is not allowed, since checking the timestamps would lose any speed advantage
394 from the operation
395 .Li q .
396 .Pp
397 .It  v
398 This modifier requests the
399 .Em verbose
400 version of an operation. Many operations display additional information, such
401 as filenames processed, when the modifier
402 .Li v
403 is appended.
404 .Pp
405 .It  V
406 This modifier shows the version number of
407 .Xr ar .
408 .El
409 .Pp
410 .Xr ar
411 ignores an initial option spelt
412 .Li -X32_64 ,
413 for compatibility with AIX. The behaviour produced by this option is the default
414 for GNU
415 .Xr ar .
416 .Xr ar
417 does not support any of the other
418 .Li -X
419 options; in particular, it does not support
420 .Op -X32
421 which is the default for AIX
422 .Xr ar .
423 .Pp
424 .Ss  Controlling Xr ar with a Script
425 .Bd -literal -offset indent
426 ar -M [ <script ]
427 .Ed
428 .Pp
429 If you use the single command-line option
430 .Li -M
431 with
432 .Xr ar ,
433 you can control its operation with a rudimentary command language. This form
434 of
435 .Xr ar
436 operates interactively if standard input is coming directly from a terminal.
437 During interactive use,
438 .Xr ar
439 prompts for input (the prompt is
440 .Li AR > ) ,
441 and continues executing even after errors. If you redirect standard input
442 to a script file, no prompts are issued, and
443 .Xr ar
444 abandons execution (with a nonzero exit code) on any error.
445 .Pp
446 The
447 .Xr ar
448 command language is
449 .Em not
450 designed to be equivalent to the command-line options; in fact, it provides
451 somewhat less control over archives. The only purpose of the command language
452 is to ease the transition to GNU
453 .Xr ar
454 for developers who already have scripts written for the MRI \(lqlibrarian\(rq program.
455 .Pp
456 The syntax for the
457 .Xr ar
458 command language is straightforward:
459 .Bl -bullet
460 .It
461 commands are recognized in upper or lower case; for example,
462 .Li LIST
463 is the same as
464 .Li list .
465 In the following descriptions, commands are shown in upper case for clarity.
466 .Pp
467 .It
468 a single command may appear on each line; it is the first word on the line.
469 .Pp
470 .It
471 empty lines are allowed, and have no effect.
472 .Pp
473 .It
474 comments are allowed; text after either of the characters
475 .Li *
476 or
477 .Li ;
478 is ignored.
479 .Pp
480 .It
481 Whenever you use a list of names as part of the argument to an
482 .Xr ar
483 command, you can separate the individual names with either commas or blanks.
484 Commas are shown in the explanations below, for clarity.
485 .Pp
486 .It
487 .Li +
488 is used as a line continuation character; if
489 .Li +
490 appears at the end of a line, the text on the following line is considered
491 part of the current command.
492 .El
493 .Pp
494 Here are the commands you can use in
495 .Xr ar
496 scripts, or when using
497 .Xr ar
498 interactively. Three of them have special significance:
499 .Pp
500 .Li OPEN
501 or
502 .Li CREATE
503 specify a
504 .Em current archive ,
505 which is a temporary file required for most of the other commands.
506 .Pp
507 .Li SAVE
508 commits the changes so far specified by the script. Prior to
509 .Li SAVE ,
510 commands affect only the temporary copy of the current archive.
511 .Pp
512 .Bl -tag -width Ds
513 .It  ADDLIB Va archive
514 .It  ADDLIB Va archive ( Va module, Va module, ... Va module)
515 Add all the contents of
516 .Va archive
517 (or, if specified, each named
518 .Va module
519 from
520 .Va archive )
521 to the current archive.
522 .Pp
523 Requires prior use of
524 .Li OPEN
525 or
526 .Li CREATE .
527 .Pp
528 .It  ADDMOD Va member, Va member, ... Va member
529 Add each named
530 .Va member
531 as a module in the current archive.
532 .Pp
533 Requires prior use of
534 .Li OPEN
535 or
536 .Li CREATE .
537 .Pp
538 .It  CLEAR
539 Discard the contents of the current archive, canceling the effect of any operations
540 since the last
541 .Li SAVE .
542 May be executed (with no effect) even if no current archive is specified.
543 .Pp
544 .It  CREATE Va archive
545 Creates an archive, and makes it the current archive (required for many other
546 commands). The new archive is created with a temporary name; it is not actually
547 saved as
548 .Va archive
549 until you use
550 .Li SAVE .
551 You can overwrite existing archives; similarly, the contents of any existing
552 file named
553 .Va archive
554 will not be destroyed until
555 .Li SAVE .
556 .Pp
557 .It  DELETE Va module, Va module, ... Va module
558 Delete each listed
559 .Va module
560 from the current archive; equivalent to
561 .Li ar -d Va archive Va module ... Va module .
562 .Pp
563 Requires prior use of
564 .Li OPEN
565 or
566 .Li CREATE .
567 .Pp
568 .It  DIRECTORY Va archive ( Va module, ... Va module)
569 .It  DIRECTORY Va archive ( Va module, ... Va module) Va outputfile
570 List each named
571 .Va module
572 present in
573 .Va archive .
574 The separate command
575 .Li VERBOSE
576 specifies the form of the output: when verbose output is off, output is like
577 that of
578 .Li ar -t Va archive Va module... .
579 When verbose output is on, the listing is like
580 .Li ar -tv Va archive Va module... .
581 .Pp
582 Output normally goes to the standard output stream; however, if you specify
583 .Va outputfile
584 as a final argument,
585 .Xr ar
586 directs the output to that file.
587 .Pp
588 .It  END
589 Exit from
590 .Xr ar ,
591 with a
592 .Li 0
593 exit code to indicate successful completion. This command does not save the
594 output file; if you have changed the current archive since the last
595 .Li SAVE
596 command, those changes are lost.
597 .Pp
598 .It  EXTRACT Va module, Va module, ... Va module
599 Extract each named
600 .Va module
601 from the current archive, writing them into the current directory as separate
602 files. Equivalent to
603 .Li ar -x Va archive Va module... .
604 .Pp
605 Requires prior use of
606 .Li OPEN
607 or
608 .Li CREATE .
609 .Pp
610 .It  LIST
611 Display full contents of the current archive, in \(lqverbose\(rq style regardless
612 of the state of
613 .Li VERBOSE .
614 The effect is like
615 .Li ar tv Va archive .
616 (This single command is a GNU
617 .Xr ar
618 enhancement, rather than present for MRI compatibility.)
619 .Pp
620 Requires prior use of
621 .Li OPEN
622 or
623 .Li CREATE .
624 .Pp
625 .It  OPEN Va archive
626 Opens an existing archive for use as the current archive (required for many
627 other commands). Any changes as the result of subsequent commands will not
628 actually affect
629 .Va archive
630 until you next use
631 .Li SAVE .
632 .Pp
633 .It  REPLACE Va module, Va module, ... Va module
634 In the current archive, replace each existing
635 .Va module
636 (named in the
637 .Li REPLACE
638 arguments) from files in the current working directory. To execute this command
639 without errors, both the file, and the module in the current archive, must
640 exist.
641 .Pp
642 Requires prior use of
643 .Li OPEN
644 or
645 .Li CREATE .
646 .Pp
647 .It  VERBOSE
648 Toggle an internal flag governing the output from
649 .Li DIRECTORY .
650 When the flag is on,
651 .Li DIRECTORY
652 output matches output from
653 .Li ar -tv
654 \&...\&.
655 .Pp
656 .It  SAVE
657 Commit your changes to the current archive, and actually save it as a file
658 with the name specified in the last
659 .Li CREATE
660 or
661 .Li OPEN
662 command.
663 .Pp
664 Requires prior use of
665 .Li OPEN
666 or
667 .Li CREATE .
668 .Pp
669 .El
670 .Sh  nm
671 .Bd -literal -offset indent
672 nm [-a|--debug-syms] [-g|--extern-only]
673    [-B] [-C|--demangle[=style]] [-D|--dynamic]
674    [-S|--print-size] [-s|--print-armap]
675    [-A|-o|--print-file-name][--special-syms]
676    [-n|-v|--numeric-sort] [-p|--no-sort]
677    [-r|--reverse-sort] [--size-sort] [-u|--undefined-only]
678    [-t radix|--radix=radix] [-P|--portability]
679    [--target=bfdname] [-fformat|--format=format]
680    [--defined-only] [-l|--line-numbers] [--no-demangle]
681    [-V|--version] [-X 32_64] [--help]  [objfile...]
682 .Ed
683 .Pp
684 GNU
685 .Xr nm
686 lists the symbols from object files
687 .Va objfile
688 \&...\&. If no object files are listed as arguments,
689 .Xr nm
690 assumes the file
691 .Pa a.out .
692 .Pp
693 For each symbol,
694 .Xr nm
695 shows:
696 .Pp
697 .Bl -bullet
698 .It
699 The symbol value, in the radix selected by options (see below), or hexadecimal
700 by default.
701 .Pp
702 .It
703 The symbol type. At least the following types are used; others are, as well,
704 depending on the object file format. If lowercase, the symbol is local; if
705 uppercase, the symbol is global (external).
706 .Pp
707 .Bl -tag -width Ds
708 .It  A
709 The symbol's value is absolute, and will not be changed by further linking.
710 .Pp
711 .It  B
712 The symbol is in the uninitialized data section (known as BSS).
713 .Pp
714 .It  C
715 The symbol is common. Common symbols are uninitialized data. When linking,
716 multiple common symbols may appear with the same name. If the symbol is defined
717 anywhere, the common symbols are treated as undefined references. For more
718 details on common symbols, see the discussion of --warn-common in Options,,Linker
719 options,ld.info,The GNU linker.
720 .Pp
721 .It  D
722 The symbol is in the initialized data section.
723 .Pp
724 .It  G
725 The symbol is in an initialized data section for small objects. Some object
726 file formats permit more efficient access to small data objects, such as a
727 global int variable as opposed to a large global array.
728 .Pp
729 .It  I
730 The symbol is an indirect reference to another symbol. This is a GNU extension
731 to the a.out object file format which is rarely used.
732 .Pp
733 .It  N
734 The symbol is a debugging symbol.
735 .Pp
736 .It  R
737 The symbol is in a read only data section.
738 .Pp
739 .It  S
740 The symbol is in an uninitialized data section for small objects.
741 .Pp
742 .It  T
743 The symbol is in the text (code) section.
744 .Pp
745 .It  U
746 The symbol is undefined.
747 .Pp
748 .It  V
749 The symbol is a weak object. When a weak defined symbol is linked with a normal
750 defined symbol, the normal defined symbol is used with no error. When a weak
751 undefined symbol is linked and the symbol is not defined, the value of the
752 weak symbol becomes zero with no error.
753 .Pp
754 .It  W
755 The symbol is a weak symbol that has not been specifically tagged as a weak
756 object symbol. When a weak defined symbol is linked with a normal defined
757 symbol, the normal defined symbol is used with no error. When a weak undefined
758 symbol is linked and the symbol is not defined, the value of the symbol is
759 determined in a system-specific manner without error. On some systems, uppercase
760 indicates that a default value has been specified.
761 .Pp
762 .It  -
763 The symbol is a stabs symbol in an a.out object file. In this case, the next
764 values printed are the stabs other field, the stabs desc field, and the stab
765 type. Stabs symbols are used to hold debugging information. For more information,
766 see Top,Stabs,Stabs Overview,stabs.info, The \(lqstabs\(rq debug format.
767 .Pp
768 .It  ?
769 The symbol type is unknown, or object file format specific.
770 .El
771 .Pp
772 .It
773 The symbol name.
774 .El
775 .Pp
776 The long and short forms of options, shown here as alternatives, are equivalent.
777 .Pp
778 .Bl -tag -width Ds
779 .It  -A
780 .It  -o
781 .It  --print-file-name
782 Precede each symbol by the name of the input file (or archive member) in which
783 it was found, rather than identifying the input file once only, before all
784 of its symbols.
785 .Pp
786 .It  -a
787 .It  --debug-syms
788 Display all symbols, even debugger-only symbols; normally these are not listed.
789 .Pp
790 .It  -B
791 The same as
792 .Op --format=bsd
793 (for compatibility with the MIPS
794 .Xr nm ) .
795 .Pp
796 .It  -C
797 .It  --demangle[= Va style]
798 Decode (
799 .Em demangle )
800 low-level symbol names into user-level names. Besides removing any initial
801 underscore prepended by the system, this makes C++ function names readable.
802 Different compilers have different mangling styles. The optional demangling
803 style argument can be used to choose an appropriate demangling style for your
804 compiler.See Section
805 .Dq c++filt ,
806 for more information on demangling.
807 .Pp
808 .It  --no-demangle
809 Do not demangle low-level symbol names. This is the default.
810 .Pp
811 .It  -D
812 .It  --dynamic
813 Display the dynamic symbols rather than the normal symbols. This is only meaningful
814 for dynamic objects, such as certain types of shared libraries.
815 .Pp
816 .It  -f Va format
817 .It  --format= Va format
818 Use the output format
819 .Va format ,
820 which can be
821 .Li bsd ,
822 .Li sysv ,
823 or
824 .Li posix .
825 The default is
826 .Li bsd .
827 Only the first character of
828 .Va format
829 is significant; it can be either upper or lower case.
830 .Pp
831 .It  -g
832 .It  --extern-only
833 Display only external symbols.
834 .Pp
835 .It  -l
836 .It  --line-numbers
837 For each symbol, use debugging information to try to find a filename and line
838 number. For a defined symbol, look for the line number of the address of the
839 symbol. For an undefined symbol, look for the line number of a relocation
840 entry which refers to the symbol. If line number information can be found,
841 print it after the other symbol information.
842 .Pp
843 .It  -n
844 .It  -v
845 .It  --numeric-sort
846 Sort symbols numerically by their addresses, rather than alphabetically by
847 their names.
848 .Pp
849 .It  -p
850 .It  --no-sort
851 Do not bother to sort the symbols in any order; print them in the order encountered.
852 .Pp
853 .It  -P
854 .It  --portability
855 Use the POSIX.2 standard output format instead of the default format. Equivalent
856 to
857 .Li -f posix .
858 .Pp
859 .It  -S
860 .It  --print-size
861 Print size, not the value, of defined symbols for the
862 .Li bsd
863 output format.
864 .Pp
865 .It  -s
866 .It  --print-armap
867 When listing symbols from archive members, include the index: a mapping (stored
868 in the archive by
869 .Xr ar
870 or
871 .Xr ranlib )
872 of which modules contain definitions for which names.
873 .Pp
874 .It  -r
875 .It  --reverse-sort
876 Reverse the order of the sort (whether numeric or alphabetic); let the last
877 come first.
878 .Pp
879 .It  --size-sort
880 Sort symbols by size. The size is computed as the difference between the value
881 of the symbol and the value of the symbol with the next higher value. If the
882 .Li bsd
883 output format is used the size of the symbol is printed, rather than the value,
884 and
885 .Li -S
886 must be used in order both size and value to be printed.
887 .Pp
888 .It  --special-syms
889 Display symbols which have a target-specific special meaning. These symbols
890 are usually used by the target for some special processing and are not normally
891 helpful when included included in the normal symbol lists. For example for
892 ARM targets this option would skip the mapping symbols used to mark transitions
893 between ARM code, THUMB code and data.
894 .Pp
895 .It  -t Va radix
896 .It  --radix= Va radix
897 Use
898 .Va radix
899 as the radix for printing the symbol values. It must be
900 .Li d
901 for decimal,
902 .Li o
903 for octal, or
904 .Li x
905 for hexadecimal.
906 .Pp
907 .It  --target= Va bfdname
908 Specify an object code format other than your system's default format.See Section
909 .Dq Target Selection ,
910 for more information.
911 .Pp
912 .It  -u
913 .It  --undefined-only
914 Display only undefined symbols (those external to each object file).
915 .Pp
916 .It  --defined-only
917 Display only defined symbols for each object file.
918 .Pp
919 .It  -V
920 .It  --version
921 Show the version number of
922 .Xr nm
923 and exit.
924 .Pp
925 .It  -X
926 This option is ignored for compatibility with the AIX version of
927 .Xr nm .
928 It takes one parameter which must be the string
929 .Op 32_64 .
930 The default mode of AIX
931 .Xr nm
932 corresponds to
933 .Op -X 32 ,
934 which is not supported by GNU
935 .Xr nm .
936 .Pp
937 .It  --help
938 Show a summary of the options to
939 .Xr nm
940 and exit.
941 .El
942 .Pp
943 .Sh  objcopy
944 .Bd -literal -offset indent
945 objcopy [-F bfdname|--target=bfdname]
946         [-I bfdname|--input-target=bfdname]
947         [-O bfdname|--output-target=bfdname]
948         [-B bfdarch|--binary-architecture=bfdarch]
949         [-S|--strip-all]
950         [-g|--strip-debug]
951         [-K symbolname|--keep-symbol=symbolname]
952         [-N symbolname|--strip-symbol=symbolname]
953         [--strip-unneeded-symbol=symbolname]
954         [-G symbolname|--keep-global-symbol=symbolname]
955         [--localize-hidden]
956         [-L symbolname|--localize-symbol=symbolname]
957         [--globalize-symbol=symbolname]
958         [-W symbolname|--weaken-symbol=symbolname]
959         [-w|--wildcard]
960         [-x|--discard-all]
961         [-X|--discard-locals]
962         [-b byte|--byte=byte]
963         [-i interleave|--interleave=interleave]
964         [-j sectionname|--only-section=sectionname]
965         [-R sectionname|--remove-section=sectionname]
966         [-p|--preserve-dates]
967         [--debugging]
968         [--gap-fill=val]
969         [--pad-to=address]
970         [--set-start=val]
971         [--adjust-start=incr]
972         [--change-addresses=incr]
973         [--change-section-address section{=,+,-}val]
974         [--change-section-lma section{=,+,-}val]
975         [--change-section-vma section{=,+,-}val]
976         [--change-warnings] [--no-change-warnings]
977         [--set-section-flags section=flags]
978         [--add-section sectionname=filename]
979         [--rename-section oldname=newname[,flags]]
980         [--change-leading-char] [--remove-leading-char]
981         [--reverse-bytes=num]
982         [--srec-len=ival] [--srec-forceS3]
983         [--redefine-sym old=new]
984         [--redefine-syms=filename]
985         [--weaken]
986         [--keep-symbols=filename]
987         [--strip-symbols=filename]
988         [--strip-unneeded-symbols=filename]
989         [--keep-global-symbols=filename]
990         [--localize-symbols=filename]
991         [--globalize-symbols=filename]
992         [--weaken-symbols=filename]
993         [--alt-machine-code=index]
994         [--prefix-symbols=string]
995         [--prefix-sections=string]
996         [--prefix-alloc-sections=string]
997         [--add-GNU-debuglink=path-to-file]
998         [--keep-file-symbols]
999         [--only-keep-debug]
1000         [--extract-symbol]
1001         [--writable-text]
1002         [--readonly-text]
1003         [--pure]
1004         [--impure]
1005         [-v|--verbose]
1006         [-V|--version]
1007         [--help] [--info]
1008         infile [outfile]
1009 .Ed
1010 .Pp
1011 The GNU
1012 .Xr objcopy
1013 utility copies the contents of an object file to another.
1014 .Xr objcopy
1015 uses the GNU bfd Library to read and write the object files. It can write
1016 the destination object file in a format different from that of the source
1017 object file. The exact behavior of
1018 .Xr objcopy
1019 is controlled by command-line options. Note that
1020 .Xr objcopy
1021 should be able to copy a fully linked file between any two formats. However,
1022 copying a relocatable object file between any two formats may not work as
1023 expected.
1024 .Pp
1025 .Xr objcopy
1026 creates temporary files to do its translations and deletes them afterward.
1027 .Xr objcopy
1028 uses bfd to do all its translation work; it has access to all the formats
1029 described in bfd and thus is able to recognize most formats without being
1030 told explicitly.See Section
1031 .Dq BFD .
1032 .Pp
1033 .Xr objcopy
1034 can be used to generate S-records by using an output target of
1035 .Li srec
1036 (e.g., use
1037 .Li -O srec ) .
1038 .Pp
1039 .Xr objcopy
1040 can be used to generate a raw binary file by using an output target of
1041 .Li binary
1042 (e.g., use
1043 .Op -O binary ) .
1044 When
1045 .Xr objcopy
1046 generates a raw binary file, it will essentially produce a memory dump of
1047 the contents of the input object file. All symbols and relocation information
1048 will be discarded. The memory dump will start at the load address of the lowest
1049 section copied into the output file.
1050 .Pp
1051 When generating an S-record or a raw binary file, it may be helpful to use
1052 .Op -S
1053 to remove sections containing debugging information. In some cases
1054 .Op -R
1055 will be useful to remove sections which contain information that is not needed
1056 by the binary file.
1057 .Pp
1058 Note---
1059 .Xr objcopy
1060 is not able to change the endianness of its input files. If the input format
1061 has an endianness (some formats do not),
1062 .Xr objcopy
1063 can only copy the inputs into file formats that have the same endianness or
1064 which have no endianness (e.g.,
1065 .Li srec ) .
1066 (However, see the
1067 .Op --reverse-bytes
1068 option.)
1069 .Pp
1070 .Bl -tag -width Ds
1071 .It  Va infile
1072 .It  Va outfile
1073 The input and output files, respectively. If you do not specify
1074 .Va outfile ,
1075 .Xr objcopy
1076 creates a temporary file and destructively renames the result with the name
1077 of
1078 .Va infile .
1079 .Pp
1080 .It  -I Va bfdname
1081 .It  --input-target= Va bfdname
1082 Consider the source file's object format to be
1083 .Va bfdname ,
1084 rather than attempting to deduce it.See Section
1085 .Dq Target Selection ,
1086 for more information.
1087 .Pp
1088 .It  -O Va bfdname
1089 .It  --output-target= Va bfdname
1090 Write the output file using the object format
1091 .Va bfdname .
1092 See Section.Dq Target Selection ,
1093 for more information.
1094 .Pp
1095 .It  -F Va bfdname
1096 .It  --target= Va bfdname
1097 Use
1098 .Va bfdname
1099 as the object format for both the input and the output file; i.e., simply
1100 transfer data from source to destination with no translation.See Section
1101 .Dq Target Selection ,
1102 for more information.
1103 .Pp
1104 .It  -B Va bfdarch
1105 .It  --binary-architecture= Va bfdarch
1106 Useful when transforming a raw binary input file into an object file. In this
1107 case the output architecture can be set to
1108 .Va bfdarch .
1109 This option will be ignored if the input file has a known
1110 .Va bfdarch .
1111 You can access this binary data inside a program by referencing the special
1112 symbols that are created by the conversion process. These symbols are called
1113 _binary_
1114 .Va objfile
1115 _start, _binary_
1116 .Va objfile
1117 _end and _binary_
1118 .Va objfile
1119 _size. e.g. you can transform a picture file into an object file and then
1120 access it in your code using these symbols.
1121 .Pp
1122 .It  -j Va sectionname
1123 .It  --only-section= Va sectionname
1124 Copy only the named section from the input file to the output file. This option
1125 may be given more than once. Note that using this option inappropriately may
1126 make the output file unusable.
1127 .Pp
1128 .It  -R Va sectionname
1129 .It  --remove-section= Va sectionname
1130 Remove any section named
1131 .Va sectionname
1132 from the output file. This option may be given more than once. Note that using
1133 this option inappropriately may make the output file unusable.
1134 .Pp
1135 .It  -S
1136 .It  --strip-all
1137 Do not copy relocation and symbol information from the source file.
1138 .Pp
1139 .It  -g
1140 .It  --strip-debug
1141 Do not copy debugging symbols or sections from the source file.
1142 .Pp
1143 .It  --strip-unneeded
1144 Strip all symbols that are not needed for relocation processing.
1145 .Pp
1146 .It  -K Va symbolname
1147 .It  --keep-symbol= Va symbolname
1148 When stripping symbols, keep symbol
1149 .Va symbolname
1150 even if it would normally be stripped. This option may be given more than
1151 once.
1152 .Pp
1153 .It  -N Va symbolname
1154 .It  --strip-symbol= Va symbolname
1155 Do not copy symbol
1156 .Va symbolname
1157 from the source file. This option may be given more than once.
1158 .Pp
1159 .It  --strip-unneeded-symbol= Va symbolname
1160 Do not copy symbol
1161 .Va symbolname
1162 from the source file unless it is needed by a relocation. This option may
1163 be given more than once.
1164 .Pp
1165 .It  -G Va symbolname
1166 .It  --keep-global-symbol= Va symbolname
1167 Keep only symbol
1168 .Va symbolname
1169 global. Make all other symbols local to the file, so that they are not visible
1170 externally. This option may be given more than once.
1171 .Pp
1172 .It  --localize-hidden
1173 In an ELF object, mark all symbols that have hidden or internal visibility
1174 as local. This option applies on top of symbol-specific localization options
1175 such as
1176 .Op -L .
1177 .Pp
1178 .It  -L Va symbolname
1179 .It  --localize-symbol= Va symbolname
1180 Make symbol
1181 .Va symbolname
1182 local to the file, so that it is not visible externally. This option may be
1183 given more than once.
1184 .Pp
1185 .It  -W Va symbolname
1186 .It  --weaken-symbol= Va symbolname
1187 Make symbol
1188 .Va symbolname
1189 weak. This option may be given more than once.
1190 .Pp
1191 .It  --globalize-symbol= Va symbolname
1192 Give symbol
1193 .Va symbolname
1194 global scoping so that it is visible outside of the file in which it is defined.
1195 This option may be given more than once.
1196 .Pp
1197 .It  -w
1198 .It  --wildcard
1199 Permit regular expressions in
1200 .Va symbolname
1201 s used in other command line options. The question mark (?), asterisk (*),
1202 backslash (\e) and square brackets ([]) operators can be used anywhere in the
1203 symbol name. If the first character of the symbol name is the exclamation
1204 point (!) then the sense of the switch is reversed for that symbol. For example:
1205 .Pp
1206 .Bd -literal -offset indent
1207   -w -W !foo -W fo*
1208 .Ed
1209 .Pp
1210 would cause objcopy to weaken all symbols that start with \(lqfo\(rq except for the
1211 symbol \(lqfoo\(rq.
1212 .Pp
1213 .It  -x
1214 .It  --discard-all
1215 Do not copy non-global symbols from the source file.
1216 .Pp
1217 .It  -X
1218 .It  --discard-locals
1219 Do not copy compiler-generated local symbols. (These usually start with
1220 .Li L
1221 or
1222 .Li . . )
1223 .Pp
1224 .It  -b Va byte
1225 .It  --byte= Va byte
1226 Keep only every
1227 .Va byte
1228 th byte of the input file (header data is not affected).
1229 .Va byte
1230 can be in the range from 0 to
1231 .Va interleave
1232 -1, where
1233 .Va interleave
1234 is given by the
1235 .Op -i
1236 or
1237 .Op --interleave
1238 option, or the default of 4. This option is useful for creating files to program
1239 rom. It is typically used with an
1240 .Li srec
1241 output target.
1242 .Pp
1243 .It  -i Va interleave
1244 .It  --interleave= Va interleave
1245 Only copy one out of every
1246 .Va interleave
1247 bytes. Select which byte to copy with the
1248 .Op -b
1249 or
1250 .Op --byte
1251 option. The default is 4.
1252 .Xr objcopy
1253 ignores this option if you do not specify either
1254 .Op -b
1255 or
1256 .Op --byte .
1257 .Pp
1258 .It  -p
1259 .It  --preserve-dates
1260 Set the access and modification dates of the output file to be the same as
1261 those of the input file.
1262 .Pp
1263 .It  --debugging
1264 Convert debugging information, if possible. This is not the default because
1265 only certain debugging formats are supported, and the conversion process can
1266 be time consuming.
1267 .Pp
1268 .It  --gap-fill Va val
1269 Fill gaps between sections with
1270 .Va val .
1271 This operation applies to the
1272 .Em load address
1273 (LMA) of the sections. It is done by increasing the size of the section with
1274 the lower address, and filling in the extra space created with
1275 .Va val .
1276 .Pp
1277 .It  --pad-to Va address
1278 Pad the output file up to the load address
1279 .Va address .
1280 This is done by increasing the size of the last section. The extra space is
1281 filled in with the value specified by
1282 .Op --gap-fill
1283 (default zero).
1284 .Pp
1285 .It  --set-start Va val
1286 Set the start address of the new file to
1287 .Va val .
1288 Not all object file formats support setting the start address.
1289 .Pp
1290 .It  --change-start Va incr
1291 .It  --adjust-start Va incr
1292 Change the start address by adding
1293 .Va incr .
1294 Not all object file formats support setting the start address.
1295 .Pp
1296 .It  --change-addresses Va incr
1297 .It  --adjust-vma Va incr
1298 Change the VMA and LMA addresses of all sections, as well as the start address,
1299 by adding
1300 .Va incr .
1301 Some object file formats do not permit section addresses to be changed arbitrarily.
1302 Note that this does not relocate the sections; if the program expects sections
1303 to be loaded at a certain address, and this option is used to change the sections
1304 such that they are loaded at a different address, the program may fail.
1305 .Pp
1306 .It  --change-section-address Va section{=,+,-} Va val
1307 .It  --adjust-section-vma Va section{=,+,-} Va val
1308 Set or change both the VMA address and the LMA address of the named
1309 .Va section .
1310 If
1311 .Li =
1312 is used, the section address is set to
1313 .Va val .
1314 Otherwise,
1315 .Va val
1316 is added to or subtracted from the section address. See the comments under
1317 .Op --change-addresses ,
1318 above. If
1319 .Va section
1320 does not exist in the input file, a warning will be issued, unless
1321 .Op --no-change-warnings
1322 is used.
1323 .Pp
1324 .It  --change-section-lma Va section{=,+,-} Va val
1325 Set or change the LMA address of the named
1326 .Va section .
1327 The LMA address is the address where the section will be loaded into memory
1328 at program load time. Normally this is the same as the VMA address, which
1329 is the address of the section at program run time, but on some systems, especially
1330 those where a program is held in ROM, the two can be different. If
1331 .Li =
1332 is used, the section address is set to
1333 .Va val .
1334 Otherwise,
1335 .Va val
1336 is added to or subtracted from the section address. See the comments under
1337 .Op --change-addresses ,
1338 above. If
1339 .Va section
1340 does not exist in the input file, a warning will be issued, unless
1341 .Op --no-change-warnings
1342 is used.
1343 .Pp
1344 .It  --change-section-vma Va section{=,+,-} Va val
1345 Set or change the VMA address of the named
1346 .Va section .
1347 The VMA address is the address where the section will be located once the
1348 program has started executing. Normally this is the same as the LMA address,
1349 which is the address where the section will be loaded into memory, but on
1350 some systems, especially those where a program is held in ROM, the two can
1351 be different. If
1352 .Li =
1353 is used, the section address is set to
1354 .Va val .
1355 Otherwise,
1356 .Va val
1357 is added to or subtracted from the section address. See the comments under
1358 .Op --change-addresses ,
1359 above. If
1360 .Va section
1361 does not exist in the input file, a warning will be issued, unless
1362 .Op --no-change-warnings
1363 is used.
1364 .Pp
1365 .It  --change-warnings
1366 .It  --adjust-warnings
1367 If
1368 .Op --change-section-address
1369 or
1370 .Op --change-section-lma
1371 or
1372 .Op --change-section-vma
1373 is used, and the named section does not exist, issue a warning. This is the
1374 default.
1375 .Pp
1376 .It  --no-change-warnings
1377 .It  --no-adjust-warnings
1378 Do not issue a warning if
1379 .Op --change-section-address
1380 or
1381 .Op --adjust-section-lma
1382 or
1383 .Op --adjust-section-vma
1384 is used, even if the named section does not exist.
1385 .Pp
1386 .It  --set-section-flags Va section= Va flags
1387 Set the flags for the named section. The
1388 .Va flags
1389 argument is a comma separated string of flag names. The recognized names are
1390 .Li alloc ,
1391 .Li contents ,
1392 .Li load ,
1393 .Li noload ,
1394 .Li readonly ,
1395 .Li code ,
1396 .Li data ,
1397 .Li rom ,
1398 .Li share ,
1399 and
1400 .Li debug .
1401 You can set the
1402 .Li contents
1403 flag for a section which does not have contents, but it is not meaningful
1404 to clear the
1405 .Li contents
1406 flag of a section which does have contents--just remove the section instead.
1407 Not all flags are meaningful for all object file formats.
1408 .Pp
1409 .It  --add-section Va sectionname= Va filename
1410 Add a new section named
1411 .Va sectionname
1412 while copying the file. The contents of the new section are taken from the
1413 file
1414 .Va filename .
1415 The size of the section will be the size of the file. This option only works
1416 on file formats which can support sections with arbitrary names.
1417 .Pp
1418 .It  --rename-section Va oldname= Va newname[, Va flags]
1419 Rename a section from
1420 .Va oldname
1421 to
1422 .Va newname ,
1423 optionally changing the section's flags to
1424 .Va flags
1425 in the process. This has the advantage over usng a linker script to perform
1426 the rename in that the output stays as an object file and does not become
1427 a linked executable.
1428 .Pp
1429 This option is particularly helpful when the input format is binary, since
1430 this will always create a section called .data. If for example, you wanted
1431 instead to create a section called .rodata containing binary data you could
1432 use the following command line to achieve it:
1433 .Pp
1434 .Bd -literal -offset indent
1435   objcopy -I binary -O <output_format> -B <architecture> \e
1436    --rename-section .data=.rodata,alloc,load,readonly,data,contents \e
1437    <input_binary_file> <output_object_file>
1438 .Ed
1439 .Pp
1440 .It  --change-leading-char
1441 Some object file formats use special characters at the start of symbols. The
1442 most common such character is underscore, which compilers often add before
1443 every symbol. This option tells
1444 .Xr objcopy
1445 to change the leading character of every symbol when it converts between object
1446 file formats. If the object file formats use the same leading character, this
1447 option has no effect. Otherwise, it will add a character, or remove a character,
1448 or change a character, as appropriate.
1449 .Pp
1450 .It  --remove-leading-char
1451 If the first character of a global symbol is a special symbol leading character
1452 used by the object file format, remove the character. The most common symbol
1453 leading character is underscore. This option will remove a leading underscore
1454 from all global symbols. This can be useful if you want to link together objects
1455 of different file formats with different conventions for symbol names. This
1456 is different from
1457 .Op --change-leading-char
1458 because it always changes the symbol name when appropriate, regardless of
1459 the object file format of the output file.
1460 .Pp
1461 .It  --reverse-bytes= Va num
1462 Reverse the bytes in a section with output contents. A section length must
1463 be evenly divisible by the value given in order for the swap to be able to
1464 take place. Reversing takes place before the interleaving is performed.
1465 .Pp
1466 This option is used typically in generating ROM images for problematic target
1467 systems. For example, on some target boards, the 32-bit words fetched from
1468 8-bit ROMs are re-assembled in little-endian byte order regardless of the
1469 CPU byte order. Depending on the programming model, the endianness of the
1470 ROM may need to be modified.
1471 .Pp
1472 Consider a simple file with a section containing the following eight bytes:
1473 .Li 12345678 .
1474 .Pp
1475 Using
1476 .Li --reverse-bytes=2
1477 for the above example, the bytes in the output file would be ordered
1478 .Li 21436587 .
1479 .Pp
1480 Using
1481 .Li --reverse-bytes=4
1482 for the above example, the bytes in the output file would be ordered
1483 .Li 43218765 .
1484 .Pp
1485 By using
1486 .Li --reverse-bytes=2
1487 for the above example, followed by
1488 .Li --reverse-bytes=4
1489 on the output file, the bytes in the second output file would be ordered
1490 .Li 34127856 .
1491 .Pp
1492 .It  --srec-len= Va ival
1493 Meaningful only for srec output. Set the maximum length of the Srecords being
1494 produced to
1495 .Va ival .
1496 This length covers both address, data and crc fields.
1497 .Pp
1498 .It  --srec-forceS3
1499 Meaningful only for srec output. Avoid generation of S1/S2 records, creating
1500 S3-only record format.
1501 .Pp
1502 .It  --redefine-sym Va old= Va new
1503 Change the name of a symbol
1504 .Va old ,
1505 to
1506 .Va new .
1507 This can be useful when one is trying link two things together for which you
1508 have no source, and there are name collisions.
1509 .Pp
1510 .It  --redefine-syms= Va filename
1511 Apply
1512 .Op --redefine-sym
1513 to each symbol pair "
1514 .Va old
1515 .Va new "
1516 listed in the file
1517 .Va filename .
1518 .Va filename
1519 is simply a flat file, with one symbol pair per line. Line comments may be
1520 introduced by the hash character. This option may be given more than once.
1521 .Pp
1522 .It  --weaken
1523 Change all global symbols in the file to be weak. This can be useful when
1524 building an object which will be linked against other objects using the
1525 .Op -R
1526 option to the linker. This option is only effective when using an object file
1527 format which supports weak symbols.
1528 .Pp
1529 .It  --keep-symbols= Va filename
1530 Apply
1531 .Op --keep-symbol
1532 option to each symbol listed in the file
1533 .Va filename .
1534 .Va filename
1535 is simply a flat file, with one symbol name per line. Line comments may be
1536 introduced by the hash character. This option may be given more than once.
1537 .Pp
1538 .It  --strip-symbols= Va filename
1539 Apply
1540 .Op --strip-symbol
1541 option to each symbol listed in the file
1542 .Va filename .
1543 .Va filename
1544 is simply a flat file, with one symbol name per line. Line comments may be
1545 introduced by the hash character. This option may be given more than once.
1546 .Pp
1547 .It  --strip-unneeded-symbols= Va filename
1548 Apply
1549 .Op --strip-unneeded-symbol
1550 option to each symbol listed in the file
1551 .Va filename .
1552 .Va filename
1553 is simply a flat file, with one symbol name per line. Line comments may be
1554 introduced by the hash character. This option may be given more than once.
1555 .Pp
1556 .It  --keep-global-symbols= Va filename
1557 Apply
1558 .Op --keep-global-symbol
1559 option to each symbol listed in the file
1560 .Va filename .
1561 .Va filename
1562 is simply a flat file, with one symbol name per line. Line comments may be
1563 introduced by the hash character. This option may be given more than once.
1564 .Pp
1565 .It  --localize-symbols= Va filename
1566 Apply
1567 .Op --localize-symbol
1568 option to each symbol listed in the file
1569 .Va filename .
1570 .Va filename
1571 is simply a flat file, with one symbol name per line. Line comments may be
1572 introduced by the hash character. This option may be given more than once.
1573 .Pp
1574 .It  --globalize-symbols= Va filename
1575 Apply
1576 .Op --globalize-symbol
1577 option to each symbol listed in the file
1578 .Va filename .
1579 .Va filename
1580 is simply a flat file, with one symbol name per line. Line comments may be
1581 introduced by the hash character. This option may be given more than once.
1582 .Pp
1583 .It  --weaken-symbols= Va filename
1584 Apply
1585 .Op --weaken-symbol
1586 option to each symbol listed in the file
1587 .Va filename .
1588 .Va filename
1589 is simply a flat file, with one symbol name per line. Line comments may be
1590 introduced by the hash character. This option may be given more than once.
1591 .Pp
1592 .It  --alt-machine-code= Va index
1593 If the output architecture has alternate machine codes, use the
1594 .Va index
1595 th code instead of the default one. This is useful in case a machine is assigned
1596 an official code and the tool-chain adopts the new code, but other applications
1597 still depend on the original code being used. For ELF based architectures
1598 if the
1599 .Va index
1600 alternative does not exist then the value is treated as an absolute number
1601 to be stored in the e_machine field of the ELF header.
1602 .Pp
1603 .It  --writable-text
1604 Mark the output text as writable. This option isn't meaningful for all object
1605 file formats.
1606 .Pp
1607 .It  --readonly-text
1608 Make the output text write protected. This option isn't meaningful for all
1609 object file formats.
1610 .Pp
1611 .It  --pure
1612 Mark the output file as demand paged. This option isn't meaningful for all
1613 object file formats.
1614 .Pp
1615 .It  --impure
1616 Mark the output file as impure. This option isn't meaningful for all object
1617 file formats.
1618 .Pp
1619 .It  --prefix-symbols= Va string
1620 Prefix all symbols in the output file with
1621 .Va string .
1622 .Pp
1623 .It  --prefix-sections= Va string
1624 Prefix all section names in the output file with
1625 .Va string .
1626 .Pp
1627 .It  --prefix-alloc-sections= Va string
1628 Prefix all the names of all allocated sections in the output file with
1629 .Va string .
1630 .Pp
1631 .It  --add-GNU-debuglink= Va path-to-file
1632 Creates a .GNU_debuglink section which contains a reference to
1633 .Va path-to-file
1634 and adds it to the output file.
1635 .Pp
1636 .It  --keep-file-symbols
1637 When stripping a file, perhaps with
1638 .Op --strip-debug
1639 or
1640 .Op --strip-unneeded ,
1641 retain any symbols specifying source file names, which would otherwise get
1642 stripped.
1643 .Pp
1644 .It  --only-keep-debug
1645 Strip a file, removing contents of any sections that would not be stripped
1646 by
1647 .Op --strip-debug
1648 and leaving the debugging sections intact. In ELF files, this preserves all
1649 note sections in the output.
1650 .Pp
1651 The intention is that this option will be used in conjunction with
1652 .Op --add-GNU-debuglink
1653 to create a two part executable. One a stripped binary which will occupy less
1654 space in RAM and in a distribution and the second a debugging information
1655 file which is only needed if debugging abilities are required. The suggested
1656 procedure to create these files is as follows:
1657 .Pp
1658 .Bl -enum
1659 .It
1660 Link the executable as normal. Assuming that is is called
1661 .Li foo
1662 then...
1663 .It
1664 Run
1665 .Li objcopy --only-keep-debug foo foo.dbg
1666 to
1667 create a file containing the debugging info.
1668 .It
1669 Run
1670 .Li objcopy --strip-debug foo
1671 to create a
1672 stripped executable.
1673 .It
1674 Run
1675 .Li objcopy --add-GNU-debuglink=foo.dbg foo
1676 to add a link to the debugging info into the stripped executable.
1677 .El
1678 .Pp
1679 Note - the choice of
1680 .Li .dbg
1681 as an extension for the debug info file is arbitrary. Also the
1682 .Li --only-keep-debug
1683 step is optional. You could instead do this:
1684 .Pp
1685 .Bl -enum
1686 .It
1687 Link the executable as normal.
1688 .It
1689 Copy
1690 .Li foo
1691 to
1692 .Li foo.full
1693 .It
1694 Run
1695 .Li objcopy --strip-debug foo
1696 .It
1697 Run
1698 .Li objcopy --add-GNU-debuglink=foo.full foo
1699 .El
1700 .Pp
1701 i.e., the file pointed to by the
1702 .Op --add-GNU-debuglink
1703 can be the full executable. It does not have to be a file created by the
1704 .Op --only-keep-debug
1705 switch.
1706 .Pp
1707 Note - this switch is only intended for use on fully linked files. It does
1708 not make sense to use it on object files where the debugging information may
1709 be incomplete. Besides the GNU_debuglink feature currently only supports the
1710 presence of one filename containing debugging information, not multiple filenames
1711 on a one-per-object-file basis.
1712 .Pp
1713 .It  --extract-symbol
1714 Keep the file's section flags and symbols but remove all section data. Specifically,
1715 the option:
1716 .Pp
1717 .Bl -bullet
1718 .It
1719 sets the virtual and load addresses of every section to zero;
1720 .It
1721 removes the contents of all sections;
1722 .It
1723 sets the size of every section to zero; and
1724 .It
1725 sets the file's start address to zero.
1726 .El
1727 .Pp
1728 This option is used to build a
1729 .Pa .sym
1730 file for a VxWorks kernel. It can also be a useful way of reducing the size
1731 of a
1732 .Op --just-symbols
1733 linker input file.
1734 .Pp
1735 .It  -V
1736 .It  --version
1737 Show the version number of
1738 .Xr objcopy .
1739 .Pp
1740 .It  -v
1741 .It  --verbose
1742 Verbose output: list all object files modified. In the case of archives,
1743 .Li objcopy -V
1744 lists all members of the archive.
1745 .Pp
1746 .It  --help
1747 Show a summary of the options to
1748 .Xr objcopy .
1749 .Pp
1750 .It  --info
1751 Display a list showing all architectures and object formats available.
1752 .El
1753 .Pp
1754 .Sh  objdump
1755 .Bd -literal -offset indent
1756 objdump [-a|--archive-headers]
1757         [-b bfdname|--target=bfdname]
1758         [-C|--demangle[=style] ]
1759         [-d|--disassemble]
1760         [-D|--disassemble-all]
1761         [-z|--disassemble-zeroes]
1762         [-EB|-EL|--endian={big | little }]
1763         [-f|--file-headers]
1764         [--file-start-context]
1765         [-g|--debugging]
1766         [-e|--debugging-tags]
1767         [-h|--section-headers|--headers]
1768         [-i|--info]
1769         [-j section|--section=section]
1770         [-l|--line-numbers]
1771         [-S|--source]
1772         [-m machine|--architecture=machine]
1773         [-M options|--disassembler-options=options]
1774         [-p|--private-headers]
1775         [-r|--reloc]
1776         [-R|--dynamic-reloc]
1777         [-s|--full-contents]
1778         [-W|--dwarf]
1779         [-G|--stabs]
1780         [-t|--syms]
1781         [-T|--dynamic-syms]
1782         [-x|--all-headers]
1783         [-w|--wide]
1784         [--start-address=address]
1785         [--stop-address=address]
1786         [--prefix-addresses]
1787         [--[no-]show-raw-insn]
1788         [--adjust-vma=offset]
1789         [--special-syms]
1790         [-V|--version]
1791         [-H|--help]
1792         objfile...
1793 .Ed
1794 .Pp
1795 .Xr objdump
1796 displays information about one or more object files. The options control what
1797 particular information to display. This information is mostly useful to programmers
1798 who are working on the compilation tools, as opposed to programmers who just
1799 want their program to compile and work.
1800 .Pp
1801 .Va objfile
1802 \&...are the object files to be examined. When you specify archives,
1803 .Xr objdump
1804 shows information on each of the member object files.
1805 .Pp
1806 The long and short forms of options, shown here as alternatives, are equivalent.
1807 At least one option from the list
1808 .Op -a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x
1809 must be given.
1810 .Pp
1811 .Bl -tag -width Ds
1812 .It  -a
1813 .It  --archive-header
1814 If any of the
1815 .Va objfile
1816 files are archives, display the archive header information (in a format similar
1817 to
1818 .Li ls -l ) .
1819 Besides the information you could list with
1820 .Li ar tv ,
1821 .Li objdump -a
1822 shows the object file format of each archive member.
1823 .Pp
1824 .It  --adjust-vma= Va offset
1825 When dumping information, first add
1826 .Va offset
1827 to all the section addresses. This is useful if the section addresses do not
1828 correspond to the symbol table, which can happen when putting sections at
1829 particular addresses when using a format which can not represent section addresses,
1830 such as a.out.
1831 .Pp
1832 .It  -b Va bfdname
1833 .It  --target= Va bfdname
1834 Specify that the object-code format for the object files is
1835 .Va bfdname .
1836 This option may not be necessary;
1837 .Va objdump
1838 can automatically recognize many formats.
1839 .Pp
1840 For example,
1841 .Bd -literal -offset indent
1842 objdump -b oasys -m vax -h fu.o
1843 .Ed
1844 displays summary information from the section headers (
1845 .Op -h )
1846 of
1847 .Pa fu.o ,
1848 which is explicitly identified (
1849 .Op -m )
1850 as a VAX object file in the format produced by Oasys compilers. You can list
1851 the formats available with the
1852 .Op -i
1853 option.See Section
1854 .Dq Target Selection ,
1855 for more information.
1856 .Pp
1857 .It  -C
1858 .It  --demangle[= Va style]
1859 Decode (
1860 .Em demangle )
1861 low-level symbol names into user-level names. Besides removing any initial
1862 underscore prepended by the system, this makes C++ function names readable.
1863 Different compilers have different mangling styles. The optional demangling
1864 style argument can be used to choose an appropriate demangling style for your
1865 compiler.See Section
1866 .Dq c++filt ,
1867 for more information on demangling.
1868 .Pp
1869 .It  -g
1870 .It  --debugging
1871 Display debugging information. This attempts to parse debugging information
1872 stored in the file and print it out using a C like syntax. Only certain types
1873 of debugging information have been implemented. Some other types are supported
1874 by
1875 .Xr readelf -w .
1876 See Section.Dq readelf .
1877 .Pp
1878 .It  -e
1879 .It  --debugging-tags
1880 Like
1881 .Op -g ,
1882 but the information is generated in a format compatible with ctags tool.
1883 .Pp
1884 .It  -d
1885 .It  --disassemble
1886 Display the assembler mnemonics for the machine instructions from
1887 .Va objfile .
1888 This option only disassembles those sections which are expected to contain
1889 instructions.
1890 .Pp
1891 .It  -D
1892 .It  --disassemble-all
1893 Like
1894 .Op -d ,
1895 but disassemble the contents of all sections, not just those expected to contain
1896 instructions.
1897 .Pp
1898 .It  --prefix-addresses
1899 When disassembling, print the complete address on each line. This is the older
1900 disassembly format.
1901 .Pp
1902 .It  -EB
1903 .It  -EL
1904 .It  --endian={big|little}
1905 Specify the endianness of the object files. This only affects disassembly.
1906 This can be useful when disassembling a file format which does not describe
1907 endianness information, such as S-records.
1908 .Pp
1909 .It  -f
1910 .It  --file-headers
1911 Display summary information from the overall header of each of the
1912 .Va objfile
1913 files.
1914 .Pp
1915 .It  --file-start-context
1916 Specify that when displaying interlisted source code/disassembly (assumes
1917 .Op -S )
1918 from a file that has not yet been displayed, extend the context to the start
1919 of the file.
1920 .Pp
1921 .It  -h
1922 .It  --section-headers
1923 .It  --headers
1924 Display summary information from the section headers of the object file.
1925 .Pp
1926 File segments may be relocated to nonstandard addresses, for example by using
1927 the
1928 .Op -Ttext ,
1929 .Op -Tdata ,
1930 or
1931 .Op -Tbss
1932 options to
1933 .Xr ld .
1934 However, some object file formats, such as a.out, do not store the starting
1935 address of the file segments. In those situations, although
1936 .Xr ld
1937 relocates the sections correctly, using
1938 .Li objdump -h
1939 to list the file section headers cannot show the correct addresses. Instead,
1940 it shows the usual addresses, which are implicit for the target.
1941 .Pp
1942 .It  -H
1943 .It  --help
1944 Print a summary of the options to
1945 .Xr objdump
1946 and exit.
1947 .Pp
1948 .It  -i
1949 .It  --info
1950 Display a list showing all architectures and object formats available for
1951 specification with
1952 .Op -b
1953 or
1954 .Op -m .
1955 .Pp
1956 .It  -j Va name
1957 .It  --section= Va name
1958 Display information only for section
1959 .Va name .
1960 .Pp
1961 .It  -l
1962 .It  --line-numbers
1963 Label the display (using debugging information) with the filename and source
1964 line numbers corresponding to the object code or relocs shown. Only useful
1965 with
1966 .Op -d ,
1967 .Op -D ,
1968 or
1969 .Op -r .
1970 .Pp
1971 .It  -m Va machine
1972 .It  --architecture= Va machine
1973 Specify the architecture to use when disassembling object files. This can
1974 be useful when disassembling object files which do not describe architecture
1975 information, such as S-records. You can list the available architectures with
1976 the
1977 .Op -i
1978 option.
1979 .Pp
1980 .It  -M Va options
1981 .It  --disassembler-options= Va options
1982 Pass target specific information to the disassembler. Only supported on some
1983 targets. If it is necessary to specify more than one disassembler option then
1984 multiple
1985 .Op -M
1986 options can be used or can be placed together into a comma separated list.
1987 .Pp
1988 If the target is an ARM architecture then this switch can be used to select
1989 which register name set is used during disassembler. Specifying
1990 .Op -M reg-names-std
1991 (the default) will select the register names as used in ARM's instruction
1992 set documentation, but with register 13 called 'sp', register 14 called 'lr'
1993 and register 15 called 'pc'. Specifying
1994 .Op -M reg-names-apcs
1995 will select the name set used by the ARM Procedure Call Standard, whilst specifying
1996 .Op -M reg-names-raw
1997 will just use
1998 .Li r
1999 followed by the register number.
2000 .Pp
2001 There are also two variants on the APCS register naming scheme enabled by
2002 .Op -M reg-names-atpcs
2003 and
2004 .Op -M reg-names-special-atpcs
2005 which use the ARM/Thumb Procedure Call Standard naming conventions. (Either
2006 with the normal register names or the special register names).
2007 .Pp
2008 This option can also be used for ARM architectures to force the disassembler
2009 to interpret all instructions as Thumb instructions by using the switch
2010 .Op --disassembler-options=force-thumb .
2011 This can be useful when attempting to disassemble thumb code produced by other
2012 compilers.
2013 .Pp
2014 For the x86, some of the options duplicate functions of the
2015 .Op -m
2016 switch, but allow finer grained control. Multiple selections from the following
2017 may be specified as a comma separated string.
2018 .Op x86-64 ,
2019 .Op i386
2020 and
2021 .Op i8086
2022 select disassembly for the given architecture.
2023 .Op intel
2024 and
2025 .Op att
2026 select between intel syntax mode and AT&T syntax mode.
2027 .Op addr64 ,
2028 .Op addr32 ,
2029 .Op addr16 ,
2030 .Op data32
2031 and
2032 .Op data16
2033 specify the default address size and operand size. These four options will
2034 be overridden if
2035 .Op x86-64 ,
2036 .Op i386
2037 or
2038 .Op i8086
2039 appear later in the option string. Lastly,
2040 .Op suffix ,
2041 when in AT&T mode, instructs the disassembler to print a mnemonic suffix even
2042 when the suffix could be inferred by the operands.
2043 .Pp
2044 For PPC,
2045 .Op booke ,
2046 .Op booke32
2047 and
2048 .Op booke64
2049 select disassembly of BookE instructions.
2050 .Op 32
2051 and
2052 .Op 64
2053 select PowerPC and PowerPC64 disassembly, respectively.
2054 .Op e300
2055 selects disassembly for the e300 family.
2056 .Op 440
2057 selects disassembly for the PowerPC 440.
2058 .Pp
2059 For MIPS, this option controls the printing of instruction mnemonic names
2060 and register names in disassembled instructions. Multiple selections from
2061 the following may be specified as a comma separated string, and invalid options
2062 are ignored:
2063 .Pp
2064 .Bl -tag -width Ds
2065 .It  no-aliases
2066 Print the 'raw' instruction mnemonic instead of some pseudo instruction mnemonic.
2067 I.e., print 'daddu' or 'or' instead of 'move', 'sll' instead of 'nop', etc.
2068 .Pp
2069 .It  gpr-names= Va ABI
2070 Print GPR (general-purpose register) names as appropriate for the specified
2071 ABI. By default, GPR names are selected according to the ABI of the binary
2072 being disassembled.
2073 .Pp
2074 .It  fpr-names= Va ABI
2075 Print FPR (floating-point register) names as appropriate for the specified
2076 ABI. By default, FPR numbers are printed rather than names.
2077 .Pp
2078 .It  cp0-names= Va ARCH
2079 Print CP0 (system control coprocessor; coprocessor 0) register names as appropriate
2080 for the CPU or architecture specified by
2081 .Va ARCH .
2082 By default, CP0 register names are selected according to the architecture
2083 and CPU of the binary being disassembled.
2084 .Pp
2085 .It  hwr-names= Va ARCH
2086 Print HWR (hardware register, used by the
2087 .Li rdhwr
2088 instruction) names as appropriate for the CPU or architecture specified by
2089 .Va ARCH .
2090 By default, HWR names are selected according to the architecture and CPU of
2091 the binary being disassembled.
2092 .Pp
2093 .It  reg-names= Va ABI
2094 Print GPR and FPR names as appropriate for the selected ABI.
2095 .Pp
2096 .It  reg-names= Va ARCH
2097 Print CPU-specific register names (CP0 register and HWR names) as appropriate
2098 for the selected CPU or architecture.
2099 .El
2100 .Pp
2101 For any of the options listed above,
2102 .Va ABI
2103 or
2104 .Va ARCH
2105 may be specified as
2106 .Li numeric
2107 to have numbers printed rather than names, for the selected types of registers.
2108 You can list the available values of
2109 .Va ABI
2110 and
2111 .Va ARCH
2112 using the
2113 .Op --help
2114 option.
2115 .Pp
2116 For VAX, you can specify function entry addresses with
2117 .Op -M entry:0xf00ba .
2118 You can use this multiple times to properly disassemble VAX binary files that
2119 don't contain symbol tables (like ROM dumps). In these cases, the function
2120 entry mask would otherwise be decoded as VAX instructions, which would probably
2121 lead the rest of the function being wrongly disassembled.
2122 .Pp
2123 .It  -p
2124 .It  --private-headers
2125 Print information that is specific to the object file format. The exact information
2126 printed depends upon the object file format. For some object file formats,
2127 no additional information is printed.
2128 .Pp
2129 .It  -r
2130 .It  --reloc
2131 Print the relocation entries of the file. If used with
2132 .Op -d
2133 or
2134 .Op -D ,
2135 the relocations are printed interspersed with the disassembly.
2136 .Pp
2137 .It  -R
2138 .It  --dynamic-reloc
2139 Print the dynamic relocation entries of the file. This is only meaningful
2140 for dynamic objects, such as certain types of shared libraries.
2141 .Pp
2142 .It  -s
2143 .It  --full-contents
2144 Display the full contents of any sections requested. By default all non-empty
2145 sections are displayed.
2146 .Pp
2147 .It  -S
2148 .It  --source
2149 Display source code intermixed with disassembly, if possible. Implies
2150 .Op -d .
2151 .Pp
2152 .It  --show-raw-insn
2153 When disassembling instructions, print the instruction in hex as well as in
2154 symbolic form. This is the default except when
2155 .Op --prefix-addresses
2156 is used.
2157 .Pp
2158 .It  --no-show-raw-insn
2159 When disassembling instructions, do not print the instruction bytes. This
2160 is the default when
2161 .Op --prefix-addresses
2162 is used.
2163 .Pp
2164 .It  -W
2165 .It  --dwarf
2166 Displays the contents of the DWARF debug sections in the file, if any are
2167 present.
2168 .Pp
2169 .It  -G
2170 .It  --stabs
2171 Display the full contents of any sections requested. Display the contents
2172 of the .stab and .stab.index and .stab.excl sections from an ELF file. This
2173 is only useful on systems (such as Solaris 2.0) in which
2174 .Li .stab
2175 debugging symbol-table entries are carried in an ELF section. In most other
2176 file formats, debugging symbol-table entries are interleaved with linkage
2177 symbols, and are visible in the
2178 .Op --syms
2179 output. For more information on stabs symbols, see Top,Stabs,Stabs Overview,stabs.info,
2180 The \(lqstabs\(rq debug format.
2181 .Pp
2182 .It  --start-address= Va address
2183 Start displaying data at the specified address. This affects the output of
2184 the
2185 .Op -d ,
2186 .Op -r
2187 and
2188 .Op -s
2189 options.
2190 .Pp
2191 .It  --stop-address= Va address
2192 Stop displaying data at the specified address. This affects the output of
2193 the
2194 .Op -d ,
2195 .Op -r
2196 and
2197 .Op -s
2198 options.
2199 .Pp
2200 .It  -t
2201 .It  --syms
2202 Print the symbol table entries of the file. This is similar to the information
2203 provided by the
2204 .Li nm
2205 program.
2206 .Pp
2207 .It  -T
2208 .It  --dynamic-syms
2209 Print the dynamic symbol table entries of the file. This is only meaningful
2210 for dynamic objects, such as certain types of shared libraries. This is similar
2211 to the information provided by the
2212 .Li nm
2213 program when given the
2214 .Op -D
2215 (
2216 .Op --dynamic )
2217 option.
2218 .Pp
2219 .It  --special-syms
2220 When displaying symbols include those which the target considers to be special
2221 in some way and which would not normally be of interest to the user.
2222 .Pp
2223 .It  -V
2224 .It  --version
2225 Print the version number of
2226 .Xr objdump
2227 and exit.
2228 .Pp
2229 .It  -x
2230 .It  --all-headers
2231 Display all available header information, including the symbol table and relocation
2232 entries. Using
2233 .Op -x
2234 is equivalent to specifying all of
2235 .Op -a -f -h -p -r -t .
2236 .Pp
2237 .It  -w
2238 .It  --wide
2239 Format some lines for output devices that have more than 80 columns. Also
2240 do not truncate symbol names when they are displayed.
2241 .Pp
2242 .It  -z
2243 .It  --disassemble-zeroes
2244 Normally the disassembly output will skip blocks of zeroes. This option directs
2245 the disassembler to disassemble those blocks, just like any other data.
2246 .El
2247 .Pp
2248 .Sh  ranlib
2249 .Bd -literal -offset indent
2250 ranlib [-vV] archive
2251 .Ed
2252 .Pp
2253 .Xr ranlib
2254 generates an index to the contents of an archive and stores it in the archive.
2255 The index lists each symbol defined by a member of an archive that is a relocatable
2256 object file.
2257 .Pp
2258 You may use
2259 .Li nm -s
2260 or
2261 .Li nm --print-armap
2262 to list this index.
2263 .Pp
2264 An archive with such an index speeds up linking to the library and allows
2265 routines in the library to call each other without regard to their placement
2266 in the archive.
2267 .Pp
2268 The GNU
2269 .Xr ranlib
2270 program is another form of GNU
2271 .Xr ar ;
2272 running
2273 .Xr ranlib
2274 is completely equivalent to executing
2275 .Li ar -s .
2276 See Section.Dq ar .
2277 .Pp
2278 .Bl -tag -width Ds
2279 .It  -v
2280 .It  -V
2281 .It  --version
2282 Show the version number of
2283 .Xr ranlib .
2284 .El
2285 .Pp
2286 .Sh  size
2287 .Bd -literal -offset indent
2288 size [-A|-B|--format=compatibility]
2289      [--help]
2290      [-d|-o|-x|--radix=number]
2291      [-t|--totals]
2292      [--target=bfdname] [-V|--version]
2293      [objfile...]
2294 .Ed
2295 .Pp
2296 The GNU
2297 .Xr size
2298 utility lists the section sizes---and the total size---for each of the object
2299 or archive files
2300 .Va objfile
2301 in its argument list. By default, one line of output is generated for each
2302 object file or each module in an archive.
2303 .Pp
2304 .Va objfile
2305 \&...are the object files to be examined. If none are specified, the file
2306 .Li a.out
2307 will be used.
2308 .Pp
2309 The command line options have the following meanings:
2310 .Pp
2311 .Bl -tag -width Ds
2312 .It  -A
2313 .It  -B
2314 .It  --format= Va compatibility
2315 Using one of these options, you can choose whether the output from GNU
2316 .Xr size
2317 resembles output from System V
2318 .Xr size
2319 (using
2320 .Op -A ,
2321 or
2322 .Op --format=sysv ) ,
2323 or Berkeley
2324 .Xr size
2325 (using
2326 .Op -B ,
2327 or
2328 .Op --format=berkeley ) .
2329 The default is the one-line format similar to Berkeley's.
2330 .Pp
2331 Here is an example of the Berkeley (default) format of output from
2332 .Xr size :
2333 .Bd -literal -offset indent
2334 $ size --format=Berkeley ranlib size
2335 text    data    bss     dec     hex     filename
2336 294880  81920   11592   388392  5ed28   ranlib
2337 294880  81920   11888   388688  5ee50   size
2338 .Ed
2339 .Pp
2340 This is the same data, but displayed closer to System V conventions:
2341 .Pp
2342 .Bd -literal -offset indent
2343 $ size --format=SysV ranlib size
2344 ranlib  :
2345 section         size         addr
2346 \&.text         294880         8192
2347 \&.data          81920       303104
2348 \&.bss           11592       385024
2349 Total         388392
2350
2351
2352 size  :
2353 section         size         addr
2354 \&.text         294880         8192
2355 \&.data          81920       303104
2356 \&.bss           11888       385024
2357 Total         388688
2358 .Ed
2359 .Pp
2360 .It  --help
2361 Show a summary of acceptable arguments and options.
2362 .Pp
2363 .It  -d
2364 .It  -o
2365 .It  -x
2366 .It  --radix= Va number
2367 Using one of these options, you can control whether the size of each section
2368 is given in decimal (
2369 .Op -d ,
2370 or
2371 .Op --radix=10 ) ;
2372 octal (
2373 .Op -o ,
2374 or
2375 .Op --radix=8 ) ;
2376 or hexadecimal (
2377 .Op -x ,
2378 or
2379 .Op --radix=16 ) .
2380 In
2381 .Op --radix= Va number ,
2382 only the three values (8, 10, 16) are supported. The total size is always
2383 given in two radices; decimal and hexadecimal for
2384 .Op -d
2385 or
2386 .Op -x
2387 output, or octal and hexadecimal if you're using
2388 .Op -o .
2389 .Pp
2390 .It  -t
2391 .It  --totals
2392 Show totals of all objects listed (Berkeley format listing mode only).
2393 .Pp
2394 .It  --target= Va bfdname
2395 Specify that the object-code format for
2396 .Va objfile
2397 is
2398 .Va bfdname .
2399 This option may not be necessary;
2400 .Xr size
2401 can automatically recognize many formats.See Section
2402 .Dq Target Selection ,
2403 for more information.
2404 .Pp
2405 .It  -V
2406 .It  --version
2407 Display the version number of
2408 .Xr size .
2409 .El
2410 .Pp
2411 .Sh  strings
2412 .Bd -literal -offset indent
2413 strings [-afov] [-min-len]
2414         [-n min-len] [--bytes=min-len]
2415         [-t radix] [--radix=radix]
2416         [-e encoding] [--encoding=encoding]
2417         [-] [--all] [--print-file-name]
2418         [-T bfdname] [--target=bfdname]
2419         [--help] [--version] file...
2420 .Ed
2421 .Pp
2422 For each
2423 .Va file
2424 given, GNU
2425 .Xr strings
2426 prints the printable character sequences that are at least 4 characters long
2427 (or the number given with the options below) and are followed by an unprintable
2428 character. By default, it only prints the strings from the initialized and
2429 loaded sections of object files; for other types of files, it prints the strings
2430 from the whole file.
2431 .Pp
2432 .Xr strings
2433 is mainly useful for determining the contents of non-text files.
2434 .Pp
2435 .Bl -tag -width Ds
2436 .It  -a
2437 .It  --all
2438 .It  -
2439 Do not scan only the initialized and loaded sections of object files; scan
2440 the whole files.
2441 .Pp
2442 .It  -f
2443 .It  --print-file-name
2444 Print the name of the file before each string.
2445 .Pp
2446 .It  --help
2447 Print a summary of the program usage on the standard output and exit.
2448 .Pp
2449 .It  - Va min-len
2450 .It  -n Va min-len
2451 .It  --bytes= Va min-len
2452 Print sequences of characters that are at least
2453 .Va min-len
2454 characters long, instead of the default 4.
2455 .Pp
2456 .It  -o
2457 Like
2458 .Li -t o .
2459 Some other versions of
2460 .Xr strings
2461 have
2462 .Op -o
2463 act like
2464 .Li -t d
2465 instead. Since we can not be compatible with both ways, we simply chose one.
2466 .Pp
2467 .It  -t Va radix
2468 .It  --radix= Va radix
2469 Print the offset within the file before each string. The single character
2470 argument specifies the radix of the offset---
2471 .Li o
2472 for octal,
2473 .Li x
2474 for hexadecimal, or
2475 .Li d
2476 for decimal.
2477 .Pp
2478 .It  -e Va encoding
2479 .It  --encoding= Va encoding
2480 Select the character encoding of the strings that are to be found. Possible
2481 values for
2482 .Va encoding
2483 are:
2484 .Li s
2485 = single-7-bit-byte characters (ASCII, ISO 8859, etc., default),
2486 .Li S
2487 = single-8-bit-byte characters,
2488 .Li b
2489 = 16-bit bigendian,
2490 .Li l
2491 = 16-bit littleendian,
2492 .Li B
2493 = 32-bit bigendian,
2494 .Li L
2495 = 32-bit littleendian. Useful for finding wide character strings.
2496 .Pp
2497 .It  -T Va bfdname
2498 .It  --target= Va bfdname
2499 Specify an object code format other than your system's default format.See Section
2500 .Dq Target Selection ,
2501 for more information.
2502 .Pp
2503 .It  -v
2504 .It  --version
2505 Print the program version number on the standard output and exit.
2506 .El
2507 .Pp
2508 .Sh  strip
2509 .Bd -literal -offset indent
2510 strip [-F bfdname |--target=bfdname]
2511       [-I bfdname |--input-target=bfdname]
2512       [-O bfdname |--output-target=bfdname]
2513       [-s|--strip-all]
2514       [-S|-g|-d|--strip-debug]
2515       [-K symbolname |--keep-symbol=symbolname]
2516       [-N symbolname |--strip-symbol=symbolname]
2517       [-w|--wildcard]
2518       [-x|--discard-all] [-X |--discard-locals]
2519       [-R sectionname |--remove-section=sectionname]
2520       [-o file] [-p|--preserve-dates]
2521       [--keep-file-symbols]
2522       [--only-keep-debug]
2523       [-v |--verbose] [-V|--version]
2524       [--help] [--info]
2525       objfile...
2526 .Ed
2527 .Pp
2528 GNU
2529 .Xr strip
2530 discards all symbols from object files
2531 .Va objfile .
2532 The list of object files may include archives. At least one object file must
2533 be given.
2534 .Pp
2535 .Xr strip
2536 modifies the files named in its argument, rather than writing modified copies
2537 under different names.
2538 .Pp
2539 .Bl -tag -width Ds
2540 .It  -F Va bfdname
2541 .It  --target= Va bfdname
2542 Treat the original
2543 .Va objfile
2544 as a file with the object code format
2545 .Va bfdname ,
2546 and rewrite it in the same format.See Section
2547 .Dq Target Selection ,
2548 for more information.
2549 .Pp
2550 .It  --help
2551 Show a summary of the options to
2552 .Xr strip
2553 and exit.
2554 .Pp
2555 .It  --info
2556 Display a list showing all architectures and object formats available.
2557 .Pp
2558 .It  -I Va bfdname
2559 .It  --input-target= Va bfdname
2560 Treat the original
2561 .Va objfile
2562 as a file with the object code format
2563 .Va bfdname .
2564 See Section.Dq Target Selection ,
2565 for more information.
2566 .Pp
2567 .It  -O Va bfdname
2568 .It  --output-target= Va bfdname
2569 Replace
2570 .Va objfile
2571 with a file in the output format
2572 .Va bfdname .
2573 See Section.Dq Target Selection ,
2574 for more information.
2575 .Pp
2576 .It  -R Va sectionname
2577 .It  --remove-section= Va sectionname
2578 Remove any section named
2579 .Va sectionname
2580 from the output file. This option may be given more than once. Note that using
2581 this option inappropriately may make the output file unusable.
2582 .Pp
2583 .It  -s
2584 .It  --strip-all
2585 Remove all symbols.
2586 .Pp
2587 .It  -g
2588 .It  -S
2589 .It  -d
2590 .It  --strip-debug
2591 Remove debugging symbols only.
2592 .Pp
2593 .It  --strip-unneeded
2594 Remove all symbols that are not needed for relocation processing.
2595 .Pp
2596 .It  -K Va symbolname
2597 .It  --keep-symbol= Va symbolname
2598 When stripping symbols, keep symbol
2599 .Va symbolname
2600 even if it would normally be stripped. This option may be given more than
2601 once.
2602 .Pp
2603 .It  -N Va symbolname
2604 .It  --strip-symbol= Va symbolname
2605 Remove symbol
2606 .Va symbolname
2607 from the source file. This option may be given more than once, and may be
2608 combined with strip options other than
2609 .Op -K .
2610 .Pp
2611 .It  -o Va file
2612 Put the stripped output in
2613 .Va file ,
2614 rather than replacing the existing file. When this argument is used, only
2615 one
2616 .Va objfile
2617 argument may be specified.
2618 .Pp
2619 .It  -p
2620 .It  --preserve-dates
2621 Preserve the access and modification dates of the file.
2622 .Pp
2623 .It  -w
2624 .It  --wildcard
2625 Permit regular expressions in
2626 .Va symbolname
2627 s used in other command line options. The question mark (?), asterisk (*),
2628 backslash (\e) and square brackets ([]) operators can be used anywhere in the
2629 symbol name. If the first character of the symbol name is the exclamation
2630 point (!) then the sense of the switch is reversed for that symbol. For example:
2631 .Pp
2632 .Bd -literal -offset indent
2633   -w -K !foo -K fo*
2634 .Ed
2635 .Pp
2636 would cause strip to only keep symbols that start with the letters \(lqfo\(rq, but
2637 to discard the symbol \(lqfoo\(rq.
2638 .Pp
2639 .It  -x
2640 .It  --discard-all
2641 Remove non-global symbols.
2642 .Pp
2643 .It  -X
2644 .It  --discard-locals
2645 Remove compiler-generated local symbols. (These usually start with
2646 .Li L
2647 or
2648 .Li . . )
2649 .Pp
2650 .It  --keep-file-symbols
2651 When stripping a file, perhaps with
2652 .Op --strip-debug
2653 or
2654 .Op --strip-unneeded ,
2655 retain any symbols specifying source file names, which would otherwise get
2656 stripped.
2657 .Pp
2658 .It  --only-keep-debug
2659 Strip a file, removing contents of any sections that would not be stripped
2660 by
2661 .Op --strip-debug
2662 and leaving the debugging sections intact. In ELF files, this preserves all
2663 note sections in the output.
2664 .Pp
2665 The intention is that this option will be used in conjunction with
2666 .Op --add-GNU-debuglink
2667 to create a two part executable. One a stripped binary which will occupy less
2668 space in RAM and in a distribution and the second a debugging information
2669 file which is only needed if debugging abilities are required. The suggested
2670 procedure to create these files is as follows:
2671 .Pp
2672 .Bl -enum
2673 .It
2674 Link the executable as normal. Assuming that is is called
2675 .Li foo
2676 then...
2677 .It
2678 Run
2679 .Li objcopy --only-keep-debug foo foo.dbg
2680 to
2681 create a file containing the debugging info.
2682 .It
2683 Run
2684 .Li objcopy --strip-debug foo
2685 to create a
2686 stripped executable.
2687 .It
2688 Run
2689 .Li objcopy --add-GNU-debuglink=foo.dbg foo
2690 to add a link to the debugging info into the stripped executable.
2691 .El
2692 .Pp
2693 Note - the choice of
2694 .Li .dbg
2695 as an extension for the debug info file is arbitrary. Also the
2696 .Li --only-keep-debug
2697 step is optional. You could instead do this:
2698 .Pp
2699 .Bl -enum
2700 .It
2701 Link the executable as normal.
2702 .It
2703 Copy
2704 .Li foo
2705 to
2706 .Li foo.full
2707 .It
2708 Run
2709 .Li strip --strip-debug foo
2710 .It
2711 Run
2712 .Li objcopy --add-GNU-debuglink=foo.full foo
2713 .El
2714 .Pp
2715 ie the file pointed to by the
2716 .Op --add-GNU-debuglink
2717 can be the full executable. It does not have to be a file created by the
2718 .Op --only-keep-debug
2719 switch.
2720 .Pp
2721 Note - this switch is only intended for use on fully linked files. It does
2722 not make sense to use it on object files where the debugging information may
2723 be incomplete. Besides the GNU_debuglink feature currently only supports the
2724 presence of one filename containing debugging information, not multiple filenames
2725 on a one-per-object-file basis.
2726 .Pp
2727 .It  -V
2728 .It  --version
2729 Show the version number for
2730 .Xr strip .
2731 .Pp
2732 .It  -v
2733 .It  --verbose
2734 Verbose output: list all object files modified. In the case of archives,
2735 .Li strip -v
2736 lists all members of the archive.
2737 .El
2738 .Pp
2739 .Sh  c++filt
2740 .Bd -literal -offset indent
2741 c++filt [-_|--strip-underscores]
2742         [-n|--no-strip-underscores]
2743         [-p|--no-params]
2744         [-t|--types]
2745         [-i|--no-verbose]
2746         [-s format|--format=format]
2747         [--help]  [--version]  [symbol...]
2748 .Ed
2749 .Pp
2750 The C++ and Java languages provide function overloading, which means that
2751 you can write many functions with the same name, providing that each function
2752 takes parameters of different types. In order to be able to distinguish these
2753 similarly named functions C++ and Java encode them into a low-level assembler
2754 name which uniquely identifies each different version. This process is known
2755 as
2756 .Em mangling .
2757 The
2758 .Xr c++filt
2759 program does the inverse mapping: it decodes (
2760 .Em demangles )
2761 low-level names into user-level names so that they can be read.
2762 .Pp
2763 Every alphanumeric word (consisting of letters, digits, underscores, dollars,
2764 or periods) seen in the input is a potential mangled name. If the name decodes
2765 into a C++ name, the C++ name replaces the low-level name in the output, otherwise
2766 the original word is output. In this way you can pass an entire assembler
2767 source file, containing mangled names, through
2768 .Xr c++filt
2769 and see the same source file containing demangled names.
2770 .Pp
2771 You can also use
2772 .Xr c++filt
2773 to decipher individual symbols by passing them on the command line:
2774 .Pp
2775 .Bd -literal -offset indent
2776 c++filt symbol
2777 .Ed
2778 .Pp
2779 If no
2780 .Va symbol
2781 arguments are given,
2782 .Xr c++filt
2783 reads symbol names from the standard input instead. All the results are printed
2784 on the standard output. The difference between reading names from the command
2785 line versus reading names from the standard input is that command line arguments
2786 are expected to be just mangled names and no checking is performed to separate
2787 them from surrounding text. Thus for example:
2788 .Pp
2789 .Bd -literal -offset indent
2790 c++filt -n _Z1fv
2791 .Ed
2792 .Pp
2793 will work and demangle the name to \(lqf()\(rq whereas:
2794 .Pp
2795 .Bd -literal -offset indent
2796 c++filt -n _Z1fv,
2797 .Ed
2798 .Pp
2799 will not work. (Note the extra comma at the end of the mangled name which
2800 makes it invalid). This command however will work:
2801 .Pp
2802 .Bd -literal -offset indent
2803 echo _Z1fv, | c++filt -n
2804 .Ed
2805 .Pp
2806 and will display \(lqf(),\(rq ie the demangled name followed by a trailing comma.
2807 This behaviour is because when the names are read from the standard input
2808 it is expected that they might be part of an assembler source file where there
2809 might be extra, extraneous characters trailing after a mangled name. eg:
2810 .Pp
2811 .Bd -literal -offset indent
2812     .type   _Z1fv, @function
2813 .Ed
2814 .Pp
2815 .Bl -tag -width Ds
2816 .It  -_
2817 .It  --strip-underscores
2818 On some systems, both the C and C++ compilers put an underscore in front of
2819 every name. For example, the C name
2820 .Li foo
2821 gets the low-level name
2822 .Li _foo .
2823 This option removes the initial underscore. Whether
2824 .Xr c++filt
2825 removes the underscore by default is target dependent.
2826 .Pp
2827 .It  -j
2828 .It  --java
2829 Prints demangled names using Java syntax. The default is to use C++ syntax.
2830 .Pp
2831 .It  -n
2832 .It  --no-strip-underscores
2833 Do not remove the initial underscore.
2834 .Pp
2835 .It  -p
2836 .It  --no-params
2837 When demangling the name of a function, do not display the types of the function's
2838 parameters.
2839 .Pp
2840 .It  -t
2841 .It  --types
2842 Attempt to demangle types as well as function names. This is disabled by default
2843 since mangled types are normally only used internally in the compiler, and
2844 they can be confused with non-mangled names. eg a function called \(lqa\(rq treated
2845 as a mangled type name would be demangled to \(lqsigned char\(rq.
2846 .Pp
2847 .It  -i
2848 .It  --no-verbose
2849 Do not include implementation details (if any) in the demangled output.
2850 .Pp
2851 .It  -s Va format
2852 .It  --format= Va format
2853 .Xr c++filt
2854 can decode various methods of mangling, used by different compilers. The argument
2855 to this option selects which method it uses:
2856 .Pp
2857 .Bl -tag -width Ds
2858 .It  auto
2859 Automatic selection based on executable (the default method)
2860 .It  GNU
2861 the one used by the GNU C++ compiler (g++)
2862 .It  lucid
2863 the one used by the Lucid compiler (lcc)
2864 .It  arm
2865 the one specified by the C++ Annotated Reference Manual
2866 .It  hp
2867 the one used by the HP compiler (aCC)
2868 .It  edg
2869 the one used by the EDG compiler
2870 .It  GNU-v3
2871 the one used by the GNU C++ compiler (g++) with the V3 ABI.
2872 .It  java
2873 the one used by the GNU Java compiler (gcj)
2874 .It  gnat
2875 the one used by the GNU Ada compiler (GNAT).
2876 .El
2877 .Pp
2878 .It  --help
2879 Print a summary of the options to
2880 .Xr c++filt
2881 and exit.
2882 .Pp
2883 .It  --version
2884 Print the version number of
2885 .Xr c++filt
2886 and exit.
2887 .El
2888 .Pp
2889 .Qo
2890 .Em Warning:
2891 .Xr c++filt
2892 is a new utility, and the details of its user interface are subject to change
2893 in future releases. In particular, a command-line option may be required in
2894 the future to decode a name passed as an argument on the command line; in
2895 other words,
2896 .Pp
2897 .Bd -literal -offset indent
2898 c++filt symbol
2899 .Ed
2900 .Pp
2901 may in a future release become
2902 .Pp
2903 .Bd -literal -offset indent
2904 c++filt option symbol
2905 .Ed
2906 .Qc
2907 .Pp
2908 .Sh  addr2line
2909 .Bd -literal -offset indent
2910 addr2line [-b bfdname|--target=bfdname]
2911           [-C|--demangle[=style]]
2912           [-e filename|--exe=filename]
2913           [-f|--functions] [-s|--basename]
2914           [-i|--inlines]
2915           [-j|--section=name]
2916           [-H|--help] [-V|--version]
2917           [addr addr ...]
2918 .Ed
2919 .Pp
2920 .Xr addr2line
2921 translates addresses into file names and line numbers. Given an address in
2922 an executable or an offset in a section of a relocatable object, it uses the
2923 debugging information to figure out which file name and line number are associated
2924 with it.
2925 .Pp
2926 The executable or relocatable object to use is specified with the
2927 .Op -e
2928 option. The default is the file
2929 .Pa a.out .
2930 The section in the relocatable object to use is specified with the
2931 .Op -j
2932 option.
2933 .Pp
2934 .Xr addr2line
2935 has two modes of operation.
2936 .Pp
2937 In the first, hexadecimal addresses are specified on the command line, and
2938 .Xr addr2line
2939 displays the file name and line number for each address.
2940 .Pp
2941 In the second,
2942 .Xr addr2line
2943 reads hexadecimal addresses from standard input, and prints the file name
2944 and line number for each address on standard output. In this mode,
2945 .Xr addr2line
2946 may be used in a pipe to convert dynamically chosen addresses.
2947 .Pp
2948 The format of the output is
2949 .Li FILENAME:LINENO .
2950 The file name and line number for each address is printed on a separate line.
2951 If the
2952 .Xr -f
2953 option is used, then each
2954 .Li FILENAME:LINENO
2955 line is preceded by a
2956 .Li FUNCTIONNAME
2957 line which is the name of the function containing the address.
2958 .Pp
2959 If the file name or function name can not be determined,
2960 .Xr addr2line
2961 will print two question marks in their place. If the line number can not be
2962 determined,
2963 .Xr addr2line
2964 will print 0.
2965 .Pp
2966 The long and short forms of options, shown here as alternatives, are equivalent.
2967 .Pp
2968 .Bl -tag -width Ds
2969 .It  -b Va bfdname
2970 .It  --target= Va bfdname
2971 Specify that the object-code format for the object files is
2972 .Va bfdname .
2973 .Pp
2974 .It  -C
2975 .It  --demangle[= Va style]
2976 Decode (
2977 .Em demangle )
2978 low-level symbol names into user-level names. Besides removing any initial
2979 underscore prepended by the system, this makes C++ function names readable.
2980 Different compilers have different mangling styles. The optional demangling
2981 style argument can be used to choose an appropriate demangling style for your
2982 compiler.See Section
2983 .Dq c++filt ,
2984 for more information on demangling.
2985 .Pp
2986 .It  -e Va filename
2987 .It  --exe= Va filename
2988 Specify the name of the executable for which addresses should be translated.
2989 The default file is
2990 .Pa a.out .
2991 .Pp
2992 .It  -f
2993 .It  --functions
2994 Display function names as well as file and line number information.
2995 .Pp
2996 .It  -s
2997 .It  --basenames
2998 Display only the base of each file name.
2999 .Pp
3000 .It  -i
3001 .It  --inlines
3002 If the address belongs to a function that was inlined, the source information
3003 for all enclosing scopes back to the first non-inlined function will also
3004 be printed. For example, if
3005 .Li main
3006 inlines
3007 .Li callee1
3008 which inlines
3009 .Li callee2 ,
3010 and address is from
3011 .Li callee2 ,
3012 the source information for
3013 .Li callee1
3014 and
3015 .Li main
3016 will also be printed.
3017 .Pp
3018 .It  -j
3019 .It  --section
3020 Read offsets relative to the specified section instead of absolute addresses.
3021 .El
3022 .Pp
3023 .Sh  nlmconv
3024 .Xr nlmconv
3025 converts a relocatable object file into a NetWare Loadable Module.
3026 .Pp
3027 .Qo
3028 .Em Warning:
3029 .Xr nlmconv
3030 is not always built as part of the binary utilities, since it is only useful
3031 for NLM targets.
3032 .Qc
3033 .Pp
3034 .Bd -literal -offset indent
3035 nlmconv [-I bfdname|--input-target=bfdname]
3036         [-O bfdname|--output-target=bfdname]
3037         [-T headerfile|--header-file=headerfile]
3038         [-d|--debug] [-l linker|--linker=linker]
3039         [-h|--help] [-V|--version]
3040         infile outfile
3041 .Ed
3042 .Pp
3043 .Xr nlmconv
3044 converts the relocatable
3045 .Li i386
3046 object file
3047 .Va infile
3048 into the NetWare Loadable Module
3049 .Va outfile ,
3050 optionally reading
3051 .Va headerfile
3052 for NLM header information. For instructions on writing the NLM command file
3053 language used in header files, see the
3054 .Li linkers
3055 section,
3056 .Li NLMLINK
3057 in particular, of the
3058 .Em NLM Development and Tools Overview ,
3059 which is part of the NLM Software Developer's Kit (\(lqNLM SDK\(rq), available from
3060 Novell, Inc.
3061 .Xr nlmconv
3062 uses the GNU Binary File Descriptor library to read
3063 .Va infile ;
3064 see BFD,,BFD,ld.info,Using LD, for more information.
3065 .Pp
3066 .Xr nlmconv
3067 can perform a link step. In other words, you can list more than one object
3068 file for input if you list them in the definitions file (rather than simply
3069 specifying one input file on the command line). In this case,
3070 .Xr nlmconv
3071 calls the linker for you.
3072 .Pp
3073 .Bl -tag -width Ds
3074 .It  -I Va bfdname
3075 .It  --input-target= Va bfdname
3076 Object format of the input file.
3077 .Xr nlmconv
3078 can usually determine the format of a given file (so no default is necessary).See Section
3079 .Dq Target Selection ,
3080 for more information.
3081 .Pp
3082 .It  -O Va bfdname
3083 .It  --output-target= Va bfdname
3084 Object format of the output file.
3085 .Xr nlmconv
3086 infers the output format based on the input format, e.g. for a
3087 .Li i386
3088 input file the output format is
3089 .Li nlm32-i386 .
3090 See Section.Dq Target Selection ,
3091 for more information.
3092 .Pp
3093 .It  -T Va headerfile
3094 .It  --header-file= Va headerfile
3095 Reads
3096 .Va headerfile
3097 for NLM header information. For instructions on writing the NLM command file
3098 language used in header files, see see the
3099 .Li linkers
3100 section, of the
3101 .Em NLM Development and Tools Overview ,
3102 which is part of the NLM Software Developer's Kit, available from Novell,
3103 Inc.
3104 .Pp
3105 .It  -d
3106 .It  --debug
3107 Displays (on standard error) the linker command line used by
3108 .Xr nlmconv .
3109 .Pp
3110 .It  -l Va linker
3111 .It  --linker= Va linker
3112 Use
3113 .Va linker
3114 for any linking.
3115 .Va linker
3116 can be an absolute or a relative pathname.
3117 .Pp
3118 .It  -h
3119 .It  --help
3120 Prints a usage summary.
3121 .Pp
3122 .It  -V
3123 .It  --version
3124 Prints the version number for
3125 .Xr nlmconv .
3126 .El
3127 .Pp
3128 .Sh  windmc
3129 .Xr windmc
3130 may be used to generator Windows message resources.
3131 .Pp
3132 .Qo
3133 .Em Warning:
3134 .Xr windmc
3135 is not always built as part of the binary utilities, since it is only useful
3136 for Windows targets.
3137 .Qc
3138 .Pp
3139 .Bd -literal -offset indent
3140 windmc [options] input-file
3141 .Ed
3142 .Pp
3143 .Xr windmc
3144 reads message definitions from an input file (.mc) and translate them into
3145 a set of output files. The output files may be of four kinds:
3146 .Pp
3147 .Bl -tag -width Ds
3148 .It  h
3149 A C header file containing the message definitions.
3150 .Pp
3151 .It  rc
3152 A resource file compilable by the
3153 .Xr windres
3154 tool.
3155 .Pp
3156 .It  bin
3157 One or more binary files containing the resource data for a specific message
3158 language.
3159 .Pp
3160 .It  dbg
3161 A C include file that maps message id's to their symbolic name.
3162 .El
3163 .Pp
3164 The exact description of these different formats is available in documentation
3165 from Microsoft.
3166 .Pp
3167 When
3168 .Xr windmc
3169 converts from the
3170 .Li mc
3171 format to the
3172 .Li bin
3173 format,
3174 .Li rc ,
3175 .Li h ,
3176 and optional
3177 .Li dbg
3178 it is acting like the Windows Message Compiler.
3179 .Pp
3180 .Bl -tag -width Ds
3181 .It  -a
3182 .It  --ascii_in
3183 Specifies that the input file specified is ANSI. This is the default behaviour.
3184 .Pp
3185 .It  -A
3186 .It  --ascii_out
3187 Specifies that messages in the output
3188 .Li bin
3189 files should be in ANSI format.
3190 .Pp
3191 .It  -b
3192 .It  --binprefix
3193 Specifies that
3194 .Li bin
3195 filenames should have to be prefixed by the basename of the source file.
3196 .Pp
3197 .It  -c
3198 .It  --customflag
3199 Sets the customer bit in all message id's.
3200 .Pp
3201 .It  -C Va codepage
3202 .It  --codepage_in Va codepage
3203 Sets the default codepage to be used to convert input file to UTF16. The default
3204 is ocdepage 1252.
3205 .Pp
3206 .It  -d
3207 .It  --decimal_values
3208 Outputs the constants in the header file in decimal. Default is using hexadecimal
3209 output.
3210 .Pp
3211 .It  -e Va ext
3212 .It  --extension Va ext
3213 The extension for the header file. The default is .h extension.
3214 .Pp
3215 .It  -F Va target
3216 .It  --target Va target
3217 Specify the BFD format to use for a bin file as output. This is a BFD target
3218 name; you can use the
3219 .Op --help
3220 option to see a list of supported targets. Normally
3221 .Xr windmc
3222 will use the default format, which is the first one listed by the
3223 .Op --help
3224 option. Target Selection.
3225 .Pp
3226 .It  -h Va path
3227 .It  --headerdir Va path
3228 The target directory of the generated header file. The default is the current
3229 directory.
3230 .Pp
3231 .It  -H
3232 .It  --help
3233 Displays a list of command line options and then exits.
3234 .Pp
3235 .It  -m Va characters
3236 .It  --maxlength Va characters
3237 Instructs
3238 .Xr windmc
3239 to generate a warning if the length of any message exceeds the number specified.
3240 .Pp
3241 .It  -n
3242 .It  --nullterminate
3243 Terminate message text in
3244 .Li bin
3245 files by zero. By default they are terminated by CR/LF.
3246 .Pp
3247 .It  -o
3248 .It  --hresult_use
3249 Not yet implemented. Instructs
3250 .Li windmc
3251 to generate an OLE2 header file, using HRESULT definitions. Status codes are
3252 used if the flag is not specified.
3253 .Pp
3254 .It  -O Va codepage
3255 .It  --codepage_out Va codepage
3256 Sets the default codepage to be used to output text files. The default is
3257 ocdepage 1252.
3258 .Pp
3259 .It  -r Va path
3260 .It  --rcdir Va path
3261 The target directory for the generated
3262 .Li rc
3263 script and the generated
3264 .Li bin
3265 files that the resource compiler script includes. The default is the current
3266 directory.
3267 .Pp
3268 .It  -u
3269 .It  --unicode_in
3270 Specifies that the input file is UTF16.
3271 .Pp
3272 .It  -U
3273 .It  --unicode_out
3274 Specifies that messages in the output
3275 .Li bin
3276 file should be in UTF16 format. This is the default behaviour.
3277 .Pp
3278 .It  -v
3279 .It  --verbose
3280 Enable verbose mode. This tells you what the preprocessor is if you didn't
3281 specify one.
3282 .Pp
3283 .It  -V
3284 .It  --version
3285 Prints the version number for
3286 .Xr windres .
3287 .Pp
3288 .It  -x Va path
3289 .It  --xdgb Va path
3290 The path of the
3291 .Li dbg
3292 C include file that maps message id's to the symbolic name. No such file is
3293 generated without specifying the switch.
3294 .El
3295 .Pp
3296 .Sh  windres
3297 .Xr windres
3298 may be used to manipulate Windows resources.
3299 .Pp
3300 .Qo
3301 .Em Warning:
3302 .Xr windres
3303 is not always built as part of the binary utilities, since it is only useful
3304 for Windows targets.
3305 .Qc
3306 .Pp
3307 .Bd -literal -offset indent
3308 windres [options] [input-file] [output-file]
3309 .Ed
3310 .Pp
3311 .Xr windres
3312 reads resources from an input file and copies them into an output file. Either
3313 file may be in one of three formats:
3314 .Pp
3315 .Bl -tag -width Ds
3316 .It  rc
3317 A text format read by the Resource Compiler.
3318 .Pp
3319 .It  res
3320 A binary format generated by the Resource Compiler.
3321 .Pp
3322 .It  coff
3323 A COFF object or executable.
3324 .El
3325 .Pp
3326 The exact description of these different formats is available in documentation
3327 from Microsoft.
3328 .Pp
3329 When
3330 .Xr windres
3331 converts from the
3332 .Li rc
3333 format to the
3334 .Li res
3335 format, it is acting like the Windows Resource Compiler. When
3336 .Xr windres
3337 converts from the
3338 .Li res
3339 format to the
3340 .Li coff
3341 format, it is acting like the Windows
3342 .Li CVTRES
3343 program.
3344 .Pp
3345 When
3346 .Xr windres
3347 generates an
3348 .Li rc
3349 file, the output is similar but not identical to the format expected for the
3350 input. When an input
3351 .Li rc
3352 file refers to an external filename, an output
3353 .Li rc
3354 file will instead include the file contents.
3355 .Pp
3356 If the input or output format is not specified,
3357 .Xr windres
3358 will guess based on the file name, or, for the input file, the file contents.
3359 A file with an extension of
3360 .Pa .rc
3361 will be treated as an
3362 .Li rc
3363 file, a file with an extension of
3364 .Pa .res
3365 will be treated as a
3366 .Li res
3367 file, and a file with an extension of
3368 .Pa .o
3369 or
3370 .Pa .exe
3371 will be treated as a
3372 .Li coff
3373 file.
3374 .Pp
3375 If no output file is specified,
3376 .Xr windres
3377 will print the resources in
3378 .Li rc
3379 format to standard output.
3380 .Pp
3381 The normal use is for you to write an
3382 .Li rc
3383 file, use
3384 .Xr windres
3385 to convert it to a COFF object file, and then link the COFF file into your
3386 application. This will make the resources described in the
3387 .Li rc
3388 file available to Windows.
3389 .Pp
3390 .Bl -tag -width Ds
3391 .It  -i Va filename
3392 .It  --input Va filename
3393 The name of the input file. If this option is not used, then
3394 .Xr windres
3395 will use the first non-option argument as the input file name. If there are
3396 no non-option arguments, then
3397 .Xr windres
3398 will read from standard input.
3399 .Xr windres
3400 can not read a COFF file from standard input.
3401 .Pp
3402 .It  -o Va filename
3403 .It  --output Va filename
3404 The name of the output file. If this option is not used, then
3405 .Xr windres
3406 will use the first non-option argument, after any used for the input file
3407 name, as the output file name. If there is no non-option argument, then
3408 .Xr windres
3409 will write to standard output.
3410 .Xr windres
3411 can not write a COFF file to standard output. Note, for compatibility with
3412 .Xr rc
3413 the option
3414 .Op -fo
3415 is also accepted, but its use is not recommended.
3416 .Pp
3417 .It  -J Va format
3418 .It  --input-format Va format
3419 The input format to read.
3420 .Va format
3421 may be
3422 .Li res ,
3423 .Li rc ,
3424 or
3425 .Li coff .
3426 If no input format is specified,
3427 .Xr windres
3428 will guess, as described above.
3429 .Pp
3430 .It  -O Va format
3431 .It  --output-format Va format
3432 The output format to generate.
3433 .Va format
3434 may be
3435 .Li res ,
3436 .Li rc ,
3437 or
3438 .Li coff .
3439 If no output format is specified,
3440 .Xr windres
3441 will guess, as described above.
3442 .Pp
3443 .It  -F Va target
3444 .It  --target Va target
3445 Specify the BFD format to use for a COFF file as input or output. This is
3446 a BFD target name; you can use the
3447 .Op --help
3448 option to see a list of supported targets. Normally
3449 .Xr windres
3450 will use the default format, which is the first one listed by the
3451 .Op --help
3452 option. Target Selection.
3453 .Pp
3454 .It  --preprocessor Va program
3455 When
3456 .Xr windres
3457 reads an
3458 .Li rc
3459 file, it runs it through the C preprocessor first. This option may be used
3460 to specify the preprocessor to use, including any leading arguments. The default
3461 preprocessor argument is
3462 .Li gcc -E -xc-header -DRC_INVOKED .
3463 .Pp
3464 .It  -I Va directory
3465 .It  --include-dir Va directory
3466 Specify an include directory to use when reading an
3467 .Li rc
3468 file.
3469 .Xr windres
3470 will pass this to the preprocessor as an
3471 .Op -I
3472 option.
3473 .Xr windres
3474 will also search this directory when looking for files named in the
3475 .Li rc
3476 file. If the argument passed to this command matches any of the supported
3477 .Va formats
3478 (as described in the
3479 .Op -J
3480 option), it will issue a deprecation warning, and behave just like the
3481 .Op -J
3482 option. New programs should not use this behaviour. If a directory happens
3483 to match a
3484 .Va format ,
3485 simple prefix it with
3486 .Li ./
3487 to disable the backward compatibility.
3488 .Pp
3489 .It  -D Va target
3490 .It  --define Va sym[= Va val]
3491 Specify a
3492 .Op -D
3493 option to pass to the preprocessor when reading an
3494 .Li rc
3495 file.
3496 .Pp
3497 .It  -U Va target
3498 .It  --undefine Va sym
3499 Specify a
3500 .Op -U
3501 option to pass to the preprocessor when reading an
3502 .Li rc
3503 file.
3504 .Pp
3505 .It  -r
3506 Ignored for compatibility with rc.
3507 .Pp
3508 .It  -v
3509 Enable verbose mode. This tells you what the preprocessor is if you didn't
3510 specify one.
3511 .Pp
3512 .It  -c Va val
3513 .It  --codepage Va val
3514 Specify the default codepage to use when reading an
3515 .Li rc
3516 file.
3517 .Va val
3518 should be a hexadecimal prefixed by
3519 .Li 0x
3520 or decimal codepage code. The valid range is from zero up to 0xffff, but the
3521 validity of the codepage is host and configuration dependent.
3522 .Pp
3523 .It  -l Va val
3524 .It  --language Va val
3525 Specify the default language to use when reading an
3526 .Li rc
3527 file.
3528 .Va val
3529 should be a hexadecimal language code. The low eight bits are the language,
3530 and the high eight bits are the sublanguage.
3531 .Pp
3532 .It  --use-temp-file
3533 Use a temporary file to instead of using popen to read the output of the preprocessor.
3534 Use this option if the popen implementation is buggy on the host (eg., certain
3535 non-English language versions of Windows 95 and Windows 98 are known to have
3536 buggy popen where the output will instead go the console).
3537 .Pp
3538 .It  --no-use-temp-file
3539 Use popen, not a temporary file, to read the output of the preprocessor. This
3540 is the default behaviour.
3541 .Pp
3542 .It  -h
3543 .It  --help
3544 Prints a usage summary.
3545 .Pp
3546 .It  -V
3547 .It  --version
3548 Prints the version number for
3549 .Xr windres .
3550 .Pp
3551 .It  --yydebug
3552 If
3553 .Xr windres
3554 is compiled with
3555 .Li YYDEBUG
3556 defined as
3557 .Li 1 ,
3558 this will turn on parser debugging.
3559 .El
3560 .Pp
3561 .Sh  dlltool
3562 .Xr dlltool
3563 is used to create the files needed to create dynamic link libraries (DLLs)
3564 on systems which understand PE format image files such as Windows. A DLL contains
3565 an export table which contains information that the runtime loader needs to
3566 resolve references from a referencing program.
3567 .Pp
3568 The export table is generated by this program by reading in a
3569 .Pa .def
3570 file or scanning the
3571 .Pa .a
3572 and
3573 .Pa .o
3574 files which will be in the DLL. A
3575 .Pa .o
3576 file can contain information in special
3577 .Li .drectve
3578 sections with export information.
3579 .Pp
3580 .Qo
3581 .Em Note:
3582 .Xr dlltool
3583 is not always built as part of the binary utilities, since it is only useful
3584 for those targets which support DLLs.
3585 .Qc
3586 .Pp
3587 .Bd -literal -offset indent
3588 dlltool [-d|--input-def def-file-name]
3589         [-b|--base-file base-file-name]
3590         [-e|--output-exp exports-file-name]
3591         [-z|--output-def def-file-name]
3592         [-l|--output-lib library-file-name]
3593         [--export-all-symbols] [--no-export-all-symbols]
3594         [--exclude-symbols list]
3595         [--no-default-excludes]
3596         [-S|--as path-to-assembler] [-f|--as-flags options]
3597         [-D|--dllname name] [-m|--machine machine]
3598         [-a|--add-indirect]
3599         [-U|--add-underscore] [--add-stdcall-underscore]
3600         [-k|--kill-at] [-A|--add-stdcall-alias]
3601         [-p|--ext-prefix-alias prefix]
3602         [-x|--no-idata4] [-c|--no-idata5] [-i|--interwork]
3603         [-n|--nodelete] [-t|--temp-prefix prefix]
3604         [-v|--verbose]
3605         [-h|--help] [-V|--version]
3606         [object-file ...]
3607 .Ed
3608 .Pp
3609 .Xr dlltool
3610 reads its inputs, which can come from the
3611 .Op -d
3612 and
3613 .Op -b
3614 options as well as object files specified on the command line. It then processes
3615 these inputs and if the
3616 .Op -e
3617 option has been specified it creates a exports file. If the
3618 .Op -l
3619 option has been specified it creates a library file and if the
3620 .Op -z
3621 option has been specified it creates a def file. Any or all of the
3622 .Op -e ,
3623 .Op -l
3624 and
3625 .Op -z
3626 options can be present in one invocation of dlltool.
3627 .Pp
3628 When creating a DLL, along with the source for the DLL, it is necessary to
3629 have three other files.
3630 .Xr dlltool
3631 can help with the creation of these files.
3632 .Pp
3633 The first file is a
3634 .Pa .def
3635 file which specifies which functions are exported from the DLL, which functions
3636 the DLL imports, and so on. This is a text file and can be created by hand,
3637 or
3638 .Xr dlltool
3639 can be used to create it using the
3640 .Op -z
3641 option. In this case
3642 .Xr dlltool
3643 will scan the object files specified on its command line looking for those
3644 functions which have been specially marked as being exported and put entries
3645 for them in the
3646 .Pa .def
3647 file it creates.
3648 .Pp
3649 In order to mark a function as being exported from a DLL, it needs to have
3650 an
3651 .Op -export:<name_of_function>
3652 entry in the
3653 .Li .drectve
3654 section of the object file. This can be done in C by using the asm() operator:
3655 .Pp
3656 .Bd -literal -offset indent
3657   asm (".section .drectve");
3658   asm (".ascii \e"-export:my_func\e"");
3659
3660   int my_func (void) { ... }
3661 .Ed
3662 .Pp
3663 The second file needed for DLL creation is an exports file. This file is linked
3664 with the object files that make up the body of the DLL and it handles the
3665 interface between the DLL and the outside world. This is a binary file and
3666 it can be created by giving the
3667 .Op -e
3668 option to
3669 .Xr dlltool
3670 when it is creating or reading in a
3671 .Pa .def
3672 file.
3673 .Pp
3674 The third file needed for DLL creation is the library file that programs will
3675 link with in order to access the functions in the DLL. This file can be created
3676 by giving the
3677 .Op -l
3678 option to dlltool when it is creating or reading in a
3679 .Pa .def
3680 file.
3681 .Pp
3682 .Xr dlltool
3683 builds the library file by hand, but it builds the exports file by creating
3684 temporary files containing assembler statements and then assembling these.
3685 The
3686 .Op -S
3687 command line option can be used to specify the path to the assembler that
3688 dlltool will use, and the
3689 .Op -f
3690 option can be used to pass specific flags to that assembler. The
3691 .Op -n
3692 can be used to prevent dlltool from deleting these temporary assembler files
3693 when it is done, and if
3694 .Op -n
3695 is specified twice then this will prevent dlltool from deleting the temporary
3696 object files it used to build the library.
3697 .Pp
3698 Here is an example of creating a DLL from a source file
3699 .Li dll.c
3700 and also creating a program (from an object file called
3701 .Li program.o )
3702 that uses that DLL:
3703 .Pp
3704 .Bd -literal -offset indent
3705   gcc -c dll.c
3706   dlltool -e exports.o -l dll.lib dll.o
3707   gcc dll.o exports.o -o dll.dll
3708   gcc program.o dll.lib -o program
3709 .Ed
3710 .Pp
3711 The command line options have the following meanings:
3712 .Pp
3713 .Bl -tag -width Ds
3714 .It  -d Va filename
3715 .It  --input-def Va filename
3716 Specifies the name of a
3717 .Pa .def
3718 file to be read in and processed.
3719 .Pp
3720 .It  -b Va filename
3721 .It  --base-file Va filename
3722 Specifies the name of a base file to be read in and processed. The contents
3723 of this file will be added to the relocation section in the exports file generated
3724 by dlltool.
3725 .Pp
3726 .It  -e Va filename
3727 .It  --output-exp Va filename
3728 Specifies the name of the export file to be created by dlltool.
3729 .Pp
3730 .It  -z Va filename
3731 .It  --output-def Va filename
3732 Specifies the name of the
3733 .Pa .def
3734 file to be created by dlltool.
3735 .Pp
3736 .It  -l Va filename
3737 .It  --output-lib Va filename
3738 Specifies the name of the library file to be created by dlltool.
3739 .Pp
3740 .It  --export-all-symbols
3741 Treat all global and weak defined symbols found in the input object files
3742 as symbols to be exported. There is a small list of symbols which are not
3743 exported by default; see the
3744 .Op --no-default-excludes
3745 option. You may add to the list of symbols to not export by using the
3746 .Op --exclude-symbols
3747 option.
3748 .Pp
3749 .It  --no-export-all-symbols
3750 Only export symbols explicitly listed in an input
3751 .Pa .def
3752 file or in
3753 .Li .drectve
3754 sections in the input object files. This is the default behaviour. The
3755 .Li .drectve
3756 sections are created by
3757 .Li dllexport
3758 attributes in the source code.
3759 .Pp
3760 .It  --exclude-symbols Va list
3761 Do not export the symbols in
3762 .Va list .
3763 This is a list of symbol names separated by comma or colon characters. The
3764 symbol names should not contain a leading underscore. This is only meaningful
3765 when
3766 .Op --export-all-symbols
3767 is used.
3768 .Pp
3769 .It  --no-default-excludes
3770 When
3771 .Op --export-all-symbols
3772 is used, it will by default avoid exporting certain special symbols. The current
3773 list of symbols to avoid exporting is
3774 .Li DllMain@12 ,
3775 .Li DllEntryPoint@0 ,
3776 .Li impure_ptr .
3777 You may use the
3778 .Op --no-default-excludes
3779 option to go ahead and export these special symbols. This is only meaningful
3780 when
3781 .Op --export-all-symbols
3782 is used.
3783 .Pp
3784 .It  -S Va path
3785 .It  --as Va path
3786 Specifies the path, including the filename, of the assembler to be used to
3787 create the exports file.
3788 .Pp
3789 .It  -f Va options
3790 .It  --as-flags Va options
3791 Specifies any specific command line options to be passed to the assembler
3792 when building the exports file. This option will work even if the
3793 .Op -S
3794 option is not used. This option only takes one argument, and if it occurs
3795 more than once on the command line, then later occurrences will override earlier
3796 occurrences. So if it is necessary to pass multiple options to the assembler
3797 they should be enclosed in double quotes.
3798 .Pp
3799 .It  -D Va name
3800 .It  --dll-name Va name
3801 Specifies the name to be stored in the
3802 .Pa .def
3803 file as the name of the DLL when the
3804 .Op -e
3805 option is used. If this option is not present, then the filename given to
3806 the
3807 .Op -e
3808 option will be used as the name of the DLL.
3809 .Pp
3810 .It  -m Va machine
3811 .It  -machine Va machine
3812 Specifies the type of machine for which the library file should be built.
3813 .Xr dlltool
3814 has a built in default type, depending upon how it was created, but this option
3815 can be used to override that. This is normally only useful when creating DLLs
3816 for an ARM processor, when the contents of the DLL are actually encode using
3817 Thumb instructions.
3818 .Pp
3819 .It  -a
3820 .It  --add-indirect
3821 Specifies that when
3822 .Xr dlltool
3823 is creating the exports file it should add a section which allows the exported
3824 functions to be referenced without using the import library. Whatever the
3825 hell that means!
3826 .Pp
3827 .It  -U
3828 .It  --add-underscore
3829 Specifies that when
3830 .Xr dlltool
3831 is creating the exports file it should prepend an underscore to the names
3832 of
3833 .Em all
3834 exported symbols.
3835 .Pp
3836 .It  --add-stdcall-underscore
3837 Specifies that when
3838 .Xr dlltool
3839 is creating the exports file it should prepend an underscore to the names
3840 of exported
3841 .Em stdcall
3842 functions. Variable names and non-stdcall function names are not modified.
3843 This option is useful when creating GNU-compatible import libs for third party
3844 DLLs that were built with MS-Windows tools.
3845 .Pp
3846 .It  -k
3847 .It  --kill-at
3848 Specifies that when
3849 .Xr dlltool
3850 is creating the exports file it should not append the string
3851 .Li @ <number> .
3852 These numbers are called ordinal numbers and they represent another way of
3853 accessing the function in a DLL, other than by name.
3854 .Pp
3855 .It  -A
3856 .It  --add-stdcall-alias
3857 Specifies that when
3858 .Xr dlltool
3859 is creating the exports file it should add aliases for stdcall symbols without
3860 .Li @ <number>
3861 in addition to the symbols with
3862 .Li @ <number> .
3863 .Pp
3864 .It  -p
3865 .It  --ext-prefix-alias Va prefix
3866 Causes
3867 .Xr dlltool
3868 to create external aliases for all DLL imports with the specified prefix.
3869 The aliases are created for both external and import symbols with no leading
3870 underscore.
3871 .Pp
3872 .It  -x
3873 .It  --no-idata4
3874 Specifies that when
3875 .Xr dlltool
3876 is creating the exports and library files it should omit the
3877 .Li .idata4
3878 section. This is for compatibility with certain operating systems.
3879 .Pp
3880 .It  -c
3881 .It  --no-idata5
3882 Specifies that when
3883 .Xr dlltool
3884 is creating the exports and library files it should omit the
3885 .Li .idata5
3886 section. This is for compatibility with certain operating systems.
3887 .Pp
3888 .It  -i
3889 .It  --interwork
3890 Specifies that
3891 .Xr dlltool
3892 should mark the objects in the library file and exports file that it produces
3893 as supporting interworking between ARM and Thumb code.
3894 .Pp
3895 .It  -n
3896 .It  --nodelete
3897 Makes
3898 .Xr dlltool
3899 preserve the temporary assembler files it used to create the exports file.
3900 If this option is repeated then dlltool will also preserve the temporary object
3901 files it uses to create the library file.
3902 .Pp
3903 .It  -t Va prefix
3904 .It  --temp-prefix Va prefix
3905 Makes
3906 .Xr dlltool
3907 use
3908 .Va prefix
3909 when constructing the names of temporary assembler and object files. By default,
3910 the temp file prefix is generated from the pid.
3911 .Pp
3912 .It  -v
3913 .It  --verbose
3914 Make dlltool describe what it is doing.
3915 .Pp
3916 .It  -h
3917 .It  --help
3918 Displays a list of command line options and then exits.
3919 .Pp
3920 .It  -V
3921 .It  --version
3922 Displays dlltool's version number and then exits.
3923 .Pp
3924 .El
3925 .Ss  The format of the Xr dlltool Pa .def file
3926 A
3927 .Pa .def
3928 file contains any number of the following commands:
3929 .Pp
3930 .Bl -tag -width Ds
3931 .It  Li NAME Va name Li [ , Va base Li ]
3932 The result is going to be named
3933 .Va name
3934 .Li .exe .
3935 .Pp
3936 .It  Li LIBRARY Va name Li [ , Va base Li ]
3937 The result is going to be named
3938 .Va name
3939 .Li .dll .
3940 .Pp
3941 .It  Li EXPORTS ( ( ( Va name1 Li [ = Va name2 Li ] ) | ( Va name1 Li = Va module-name Li . Va external-name Li ) )
3942 .It  Li [ Va integer Li ] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *
3943 Declares
3944 .Va name1
3945 as an exported symbol from the DLL, with optional ordinal number
3946 .Va integer ,
3947 or declares
3948 .Va name1
3949 as an alias (forward) of the function
3950 .Va external-name
3951 in the DLL
3952 .Va module-name .
3953 .Pp
3954 .It  Li IMPORTS ( ( Va internal-name Li = Va module-name Li . Va integer Li ) | [ Va internal-name Li = ] Va module-name Li . Va external-name Li ) ) *
3955 Declares that
3956 .Va external-name
3957 or the exported function whose ordinal number is
3958 .Va integer
3959 is to be imported from the file
3960 .Va module-name .
3961 If
3962 .Va internal-name
3963 is specified then this is the name that the imported function will be referred
3964 to in the body of the DLL.
3965 .Pp
3966 .It  Li DESCRIPTION Va string
3967 Puts
3968 .Va string
3969 into the output
3970 .Pa .exp
3971 file in the
3972 .Li .rdata
3973 section.
3974 .Pp
3975 .It  Li STACKSIZE Va number-reserve Li [, Va number-commit Li ]
3976 .It  Li HEAPSIZE Va number-reserve Li [, Va number-commit Li ]
3977 Generates
3978 .Li --stack
3979 or
3980 .Li --heap
3981 .Va number-reserve
3982 ,
3983 .Va number-commit
3984 in the output
3985 .Li .drectve
3986 section. The linker will see this and act upon it.
3987 .Pp
3988 .It  Li CODE Va attr Li +
3989 .It  Li DATA Va attr Li +
3990 .It  Li SECTIONS ( Va section-name Va attr Li  + ) *
3991 Generates
3992 .Li --attr
3993 .Va section-name
3994 .Va attr
3995 in the output
3996 .Li .drectve
3997 section, where
3998 .Va attr
3999 is one of
4000 .Li READ ,
4001 .Li WRITE ,
4002 .Li EXECUTE
4003 or
4004 .Li SHARED .
4005 The linker will see this and act upon it.
4006 .Pp
4007 .El
4008 .Sh  readelf
4009 .Bd -literal -offset indent
4010 readelf [-a|--all]
4011         [-h|--file-header]
4012         [-l|--program-headers|--segments]
4013         [-S|--section-headers|--sections]
4014         [-g|--section-groups]
4015         [-t|--section-details]
4016         [-e|--headers]
4017         [-s|--syms|--symbols]
4018         [-n|--notes]
4019         [-r|--relocs]
4020         [-u|--unwind]
4021         [-d|--dynamic]
4022         [-V|--version-info]
4023         [-A|--arch-specific]
4024         [-D|--use-dynamic]
4025         [-x <number or name>|--hex-dump=<number or name>]
4026         [-w[liaprmfFsoR]|
4027          --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
4028         [-I|-histogram]
4029         [-v|--version]
4030         [-W|--wide]
4031         [-H|--help]
4032         elffile...
4033 .Ed
4034 .Pp
4035 .Xr readelf
4036 displays information about one or more ELF format object files. The options
4037 control what particular information to display.
4038 .Pp
4039 .Va elffile
4040 \&...are the object files to be examined. 32-bit and 64-bit ELF files are supported,
4041 as are archives containing ELF files.
4042 .Pp
4043 This program performs a similar function to
4044 .Xr objdump
4045 but it goes into more detail and it exists independently of the bfd library,
4046 so if there is a bug in bfd then readelf will not be affected.
4047 .Pp
4048 The long and short forms of options, shown here as alternatives, are equivalent.
4049 At least one option besides
4050 .Li -v
4051 or
4052 .Li -H
4053 must be given.
4054 .Pp
4055 .Bl -tag -width Ds
4056 .It  -a
4057 .It  --all
4058 Equivalent to specifying
4059 .Op --file-header ,
4060 .Op --program-headers ,
4061 .Op --sections ,
4062 .Op --symbols ,
4063 .Op --relocs ,
4064 .Op --dynamic ,
4065 .Op --notes
4066 and
4067 .Op --version-info .
4068 .Pp
4069 .It  -h
4070 .It  --file-header
4071 Displays the information contained in the ELF header at the start of the file.
4072 .Pp
4073 .It  -l
4074 .It  --program-headers
4075 .It  --segments
4076 Displays the information contained in the file's segment headers, if it has
4077 any.
4078 .Pp
4079 .It  -S
4080 .It  --sections
4081 .It  --section-headers
4082 Displays the information contained in the file's section headers, if it has
4083 any.
4084 .Pp
4085 .It  -g
4086 .It  --section-groups
4087 Displays the information contained in the file's section groups, if it has
4088 any.
4089 .Pp
4090 .It  -t
4091 .It  --section-details
4092 Displays the detailed section information. Implies
4093 .Op -S .
4094 .Pp
4095 .It  -s
4096 .It  --symbols
4097 .It  --syms
4098 Displays the entries in symbol table section of the file, if it has one.
4099 .Pp
4100 .It  -e
4101 .It  --headers
4102 Display all the headers in the file. Equivalent to
4103 .Op -h -l -S .
4104 .Pp
4105 .It  -n
4106 .It  --notes
4107 Displays the contents of the NOTE segments and/or sections, if any.
4108 .Pp
4109 .It  -r
4110 .It  --relocs
4111 Displays the contents of the file's relocation section, if it has one.
4112 .Pp
4113 .It  -u
4114 .It  --unwind
4115 Displays the contents of the file's unwind section, if it has one. Only the
4116 unwind sections for IA64 ELF files are currently supported.
4117 .Pp
4118 .It  -d
4119 .It  --dynamic
4120 Displays the contents of the file's dynamic section, if it has one.
4121 .Pp
4122 .It  -V
4123 .It  --version-info
4124 Displays the contents of the version sections in the file, it they exist.
4125 .Pp
4126 .It  -A
4127 .It  --arch-specific
4128 Displays architecture-specific information in the file, if there is any.
4129 .Pp
4130 .It  -D
4131 .It  --use-dynamic
4132 When displaying symbols, this option makes
4133 .Xr readelf
4134 use the symbol table in the file's dynamic section, rather than the one in
4135 the symbols section.
4136 .Pp
4137 .It  -x <number or name>
4138 .It  --hex-dump=<number or name>
4139 Displays the contents of the indicated section as a hexadecimal dump. A number
4140 identifies a particular section by index in the section table; any other string
4141 identifies all sections with that name in the object file.
4142 .Pp
4143 .It  -w[liaprmfFsoR]
4144 .It  --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]
4145 Displays the contents of the debug sections in the file, if any are present.
4146 If one of the optional letters or words follows the switch then only data
4147 found in those specific sections will be dumped.
4148 .Pp
4149 .It  -I
4150 .It  --histogram
4151 Display a histogram of bucket list lengths when displaying the contents of
4152 the symbol tables.
4153 .Pp
4154 .It  -v
4155 .It  --version
4156 Display the version number of readelf.
4157 .Pp
4158 .It  -W
4159 .It  --wide
4160 Don't break output lines to fit into 80 columns. By default
4161 .Xr readelf
4162 breaks section header and segment listing lines for 64-bit ELF files, so that
4163 they fit into 80 columns. This option causes
4164 .Xr readelf
4165 to print each section header resp. each segment one a single line, which is
4166 far more readable on terminals wider than 80 columns.
4167 .Pp
4168 .It  -H
4169 .It  --help
4170 Display the command line options understood by
4171 .Xr readelf .
4172 .Pp
4173 .El
4174 .Sh  Common Options
4175 The following command-line options are supported by all of the programs described
4176 in this manual.
4177 .Pp
4178 .Bl -tag -width Ds
4179 .It  @ Va file
4180 Read command-line options from
4181 .Va file .
4182 The options read are inserted in place of the original @
4183 .Va file
4184 option. If
4185 .Va file
4186 does not exist, or cannot be read, then the option will be treated literally,
4187 and not removed.
4188 .Pp
4189 Options in
4190 .Va file
4191 are separated by whitespace. A whitespace character may be included in an
4192 option by surrounding the entire option in either single or double quotes.
4193 Any character (including a backslash) may be included by prefixing the character
4194 to be included with a backslash. The
4195 .Va file
4196 may itself contain additional @
4197 .Va file
4198 options; any such options will be processed recursively.
4199 .Pp
4200 .It  --help
4201 Display the command-line options supported by the program.
4202 .Pp
4203 .It  --version
4204 Display the version number of the program.
4205 .Pp
4206 .El
4207 .Sh  Selecting the Target System
4208 You can specify two aspects of the target system to the GNU binary file utilities,
4209 each in several ways:
4210 .Pp
4211 .Bl -bullet
4212 .It
4213 the target
4214 .Pp
4215 .It
4216 the architecture
4217 .El
4218 .Pp
4219 In the following summaries, the lists of ways to specify values are in order
4220 of decreasing precedence. The ways listed first override those listed later.
4221 .Pp
4222 The commands to list valid values only list the values for which the programs
4223 you are running were configured. If they were configured with
4224 .Op --enable-targets=all ,
4225 the commands list most of the available values, but a few are left out; not
4226 all targets can be configured in at once because some of them can only be
4227 configured
4228 .Em native
4229 (on hosts with the same type as the target system).
4230 .Pp
4231 .Ss  Target Selection
4232 A
4233 .Em target
4234 is an object file format. A given target may be supported for multiple architectures
4235 (see Section
4236 .Dq Architecture Selection ) .
4237 A target selection may also have variations for different operating systems
4238 or architectures.
4239 .Pp
4240 The command to list valid target values is
4241 .Li objdump -i
4242 (the first column of output contains the relevant information).
4243 .Pp
4244 Some sample values are:
4245 .Li a.out-hp300bsd ,
4246 .Li ecoff-littlemips ,
4247 .Li a.out-sunos-big .
4248 .Pp
4249 You can also specify a target using a configuration triplet. This is the same
4250 sort of name that is passed to
4251 .Pa configure
4252 to specify a target. When you use a configuration triplet as an argument,
4253 it must be fully canonicalized. You can see the canonical version of a triplet
4254 by running the shell script
4255 .Pa config.sub
4256 which is included with the sources.
4257 .Pp
4258 Some sample configuration triplets are:
4259 .Li m68k-hp-bsd ,
4260 .Li mips-dec-ultrix ,
4261 .Li sparc-sun-sunos .
4262 .Pp
4263 .Em  Xr objdump Target
4264 .Pp
4265 Ways to specify:
4266 .Pp
4267 .Bl -enum
4268 .It
4269 command line option:
4270 .Op -b
4271 or
4272 .Op --target
4273 .Pp
4274 .It
4275 environment variable
4276 .Li GNUTARGET
4277 .Pp
4278 .It
4279 deduced from the input file
4280 .El
4281 .Pp
4282 .Em  Xr objcopy and Xr strip Input Target
4283 .Pp
4284 Ways to specify:
4285 .Pp
4286 .Bl -enum
4287 .It
4288 command line options:
4289 .Op -I
4290 or
4291 .Op --input-target ,
4292 or
4293 .Op -F
4294 or
4295 .Op --target
4296 .Pp
4297 .It
4298 environment variable
4299 .Li GNUTARGET
4300 .Pp
4301 .It
4302 deduced from the input file
4303 .El
4304 .Pp
4305 .Em  Xr objcopy and Xr strip Output Target
4306 .Pp
4307 Ways to specify:
4308 .Pp
4309 .Bl -enum
4310 .It
4311 command line options:
4312 .Op -O
4313 or
4314 .Op --output-target ,
4315 or
4316 .Op -F
4317 or
4318 .Op --target
4319 .Pp
4320 .It
4321 the input target (see \(lq
4322 .Xr objcopy
4323 and
4324 .Xr strip
4325 Input Target\(rq above)
4326 .Pp
4327 .It
4328 environment variable
4329 .Li GNUTARGET
4330 .Pp
4331 .It
4332 deduced from the input file
4333 .El
4334 .Pp
4335 .Em  Xr nm, Xr size, and Xr strings Target
4336 .Pp
4337 Ways to specify:
4338 .Pp
4339 .Bl -enum
4340 .It
4341 command line option:
4342 .Op --target
4343 .Pp
4344 .It
4345 environment variable
4346 .Li GNUTARGET
4347 .Pp
4348 .It
4349 deduced from the input file
4350 .El
4351 .Pp
4352 .Ss  Architecture Selection
4353 An
4354 .Em architecture
4355 is a type of cpu on which an object file is to run. Its name may contain a
4356 colon, separating the name of the processor family from the name of the particular
4357 cpu.
4358 .Pp
4359 The command to list valid architecture values is
4360 .Li objdump -i
4361 (the second column contains the relevant information).
4362 .Pp
4363 Sample values:
4364 .Li m68k:68020 ,
4365 .Li mips:3000 ,
4366 .Li sparc .
4367 .Pp
4368 .Em  Xr objdump Architecture
4369 .Pp
4370 Ways to specify:
4371 .Pp
4372 .Bl -enum
4373 .It
4374 command line option:
4375 .Op -m
4376 or
4377 .Op --architecture
4378 .Pp
4379 .It
4380 deduced from the input file
4381 .El
4382 .Pp
4383 .Em  Xr objcopy, Xr nm, Xr size, Xr strings Architecture
4384 .Pp
4385 Ways to specify:
4386 .Pp
4387 .Bl -enum
4388 .It
4389 deduced from the input file
4390 .El
4391 .Pp
4392 .Sh  Reporting Bugs
4393 Your bug reports play an essential role in making the binary utilities reliable.
4394 .Pp
4395 Reporting a bug may help you by bringing a solution to your problem, or it
4396 may not. But in any case the principal function of a bug report is to help
4397 the entire community by making the next version of the binary utilities work
4398 better. Bug reports are your contribution to their maintenance.
4399 .Pp
4400 In order for a bug report to serve its purpose, you must include the information
4401 that enables us to fix the bug.
4402 .Pp
4403 .Ss  Have You Found a Bug?
4404 If you are not sure whether you have found a bug, here are some guidelines:
4405 .Pp
4406 .Bl -bullet
4407 .It
4408 If a binary utility gets a fatal signal, for any input whatever, that is a
4409 bug. Reliable utilities never crash.
4410 .Pp
4411 .It
4412 If a binary utility produces an error message for valid input, that is a bug.
4413 .Pp
4414 .It
4415 If you are an experienced user of binary utilities, your suggestions for improvement
4416 are welcome in any case.
4417 .El
4418 .Pp
4419 .Ss  How to Report Bugs
4420 A number of companies and individuals offer support for GNU products. If you
4421 obtained the binary utilities from a support organization, we recommend you
4422 contact that organization first.
4423 .Pp
4424 You can find contact information for many support companies and individuals
4425 in the file
4426 .Pa etc/SERVICE
4427 in the GNU Emacs distribution.
4428 .Pp
4429 The fundamental principle of reporting bugs usefully is this:
4430 .Sy report all the facts .
4431 If you are not sure whether to state a fact or leave it out, state it!
4432 .Pp
4433 Often people omit facts because they think they know what causes the problem
4434 and assume that some details do not matter. Thus, you might assume that the
4435 name of a file you use in an example does not matter. Well, probably it does
4436 not, but one cannot be sure. Perhaps the bug is a stray memory reference which
4437 happens to fetch from the location where that pathname is stored in memory;
4438 perhaps, if the pathname were different, the contents of that location would
4439 fool the utility into doing the right thing despite the bug. Play it safe
4440 and give a specific, complete example. That is the easiest thing for you to
4441 do, and the most helpful.
4442 .Pp
4443 Keep in mind that the purpose of a bug report is to enable us to fix the bug
4444 if it is new to us. Therefore, always write your bug reports on the assumption
4445 that the bug has not been reported previously.
4446 .Pp
4447 Sometimes people give a few sketchy facts and ask, \(lqDoes this ring a bell?\(rq
4448 This cannot help us fix a bug, so it is basically useless. We respond by asking
4449 for enough details to enable us to investigate. You might as well expedite
4450 matters by sending them to begin with.
4451 .Pp
4452 To enable us to fix the bug, you should include all these things:
4453 .Pp
4454 .Bl -bullet
4455 .It
4456 The version of the utility. Each utility announces it if you start it with
4457 the
4458 .Op --version
4459 argument.
4460 .Pp
4461 Without this, we will not know whether there is any point in looking for the
4462 bug in the current version of the binary utilities.
4463 .Pp
4464 .It
4465 Any patches you may have applied to the source, including any patches made
4466 to the
4467 .Li BFD
4468 library.
4469 .Pp
4470 .It
4471 The type of machine you are using, and the operating system name and version
4472 number.
4473 .Pp
4474 .It
4475 What compiler (and its version) was used to compile the utilities---e.g. \(lq
4476 .Li gcc-2.7
4477 \(rq\&.
4478 .Pp
4479 .It
4480 The command arguments you gave the utility to observe the bug. To guarantee
4481 you will not omit something important, list them all. A copy of the Makefile
4482 (or the output from make) is sufficient.
4483 .Pp
4484 If we were to try to guess the arguments, we would probably guess wrong and
4485 then we might not encounter the bug.
4486 .Pp
4487 .It
4488 A complete input file, or set of input files, that will reproduce the bug.
4489 If the utility is reading an object file or files, then it is generally most
4490 helpful to send the actual object files.
4491 .Pp
4492 If the source files were produced exclusively using GNU programs (e.g.,
4493 .Xr gcc ,
4494 .Xr gas ,
4495 and/or the GNU
4496 .Xr ld ) ,
4497 then it may be OK to send the source files rather than the object files. In
4498 this case, be sure to say exactly what version of
4499 .Xr gcc ,
4500 or whatever, was used to produce the object files. Also say how
4501 .Xr gcc ,
4502 or whatever, was configured.
4503 .Pp
4504 .It
4505 A description of what behavior you observe that you believe is incorrect.
4506 For example, \(lqIt gets a fatal signal.\(rq
4507 .Pp
4508 Of course, if the bug is that the utility gets a fatal signal, then we will
4509 certainly notice it. But if the bug is incorrect output, we might not notice
4510 unless it is glaringly wrong. You might as well not give us a chance to make
4511 a mistake.
4512 .Pp
4513 Even if the problem you experience is a fatal signal, you should still say
4514 so explicitly. Suppose something strange is going on, such as your copy of
4515 the utility is out of sync, or you have encountered a bug in the C library
4516 on your system. (This has happened!) Your copy might crash and ours would
4517 not. If you told us to expect a crash, then when ours fails to crash, we would
4518 know that the bug was not happening for us. If you had not told us to expect
4519 a crash, then we would not be able to draw any conclusion from our observations.
4520 .Pp
4521 .It
4522 If you wish to suggest changes to the source, send us context diffs, as generated
4523 by
4524 .Xr diff
4525 with the
4526 .Op -u ,
4527 .Op -c ,
4528 or
4529 .Op -p
4530 option. Always send diffs from the old file to the new file. If you wish to
4531 discuss something in the
4532 .Xr ld
4533 source, refer to it by context, not by line number.
4534 .Pp
4535 The line numbers in our development sources will not match those in your sources.
4536 Your line numbers would convey no useful information to us.
4537 .El
4538 .Pp
4539 Here are some things that are not necessary:
4540 .Pp
4541 .Bl -bullet
4542 .It
4543 A description of the envelope of the bug.
4544 .Pp
4545 Often people who encounter a bug spend a lot of time investigating which changes
4546 to the input file will make the bug go away and which changes will not affect
4547 it.
4548 .Pp
4549 This is often time consuming and not very useful, because the way we will
4550 find the bug is by running a single example under the debugger with breakpoints,
4551 not by pure deduction from a series of examples. We recommend that you save
4552 your time for something else.
4553 .Pp
4554 Of course, if you can find a simpler example to report
4555 .Em instead
4556 of the original one, that is a convenience for us. Errors in the output will
4557 be easier to spot, running under the debugger will take less time, and so
4558 on.
4559 .Pp
4560 However, simplification is not vital; if you do not want to do this, report
4561 the bug anyway and send us the entire test case you used.
4562 .Pp
4563 .It
4564 A patch for the bug.
4565 .Pp
4566 A patch for the bug does help us if it is a good one. But do not omit the
4567 necessary information, such as the test case, on the assumption that a patch
4568 is all we need. We might see problems with your patch and decide to fix the
4569 problem another way, or we might not understand it at all.
4570 .Pp
4571 Sometimes with programs as complicated as the binary utilities it is very
4572 hard to construct an example that will make the program follow a certain path
4573 through the code. If you do not send us the example, we will not be able to
4574 construct one, so we will not be able to verify that the bug is fixed.
4575 .Pp
4576 And if we cannot understand what bug you are trying to fix, or why your patch
4577 should be an improvement, we will not install it. A test case will help us
4578 to understand.
4579 .Pp
4580 .It
4581 A guess about what the bug is or what it depends on.
4582 .Pp
4583 Such guesses are usually wrong. Even we cannot guess right about such things
4584 without first using the debugger to find the facts.
4585 .El
4586 .Pp
4587 .Sh  GNU Free Documentation License
4588 .Bd -filled -offset indent
4589 Copyright (C) 2000, 2003 Free Software Foundation, Inc. 51 Franklin Street,
4590 Fifth Floor, Boston, MA 02110-1301 USA
4591 .Pp
4592 Everyone is permitted to copy and distribute verbatim copies of this license
4593 document, but changing it is not allowed.
4594 .Ed
4595 .Pp
4596 .Bl -enum
4597 .It
4598 PREAMBLE
4599 .Pp
4600 The purpose of this License is to make a manual, textbook, or other written
4601 document \(lqfree\(rq in the sense of freedom: to assure everyone the effective freedom
4602 to copy and redistribute it, with or without modifying it, either commercially
4603 or noncommercially. Secondarily, this License preserves for the author and
4604 publisher a way to get credit for their work, while not being considered responsible
4605 for modifications made by others.
4606 .Pp
4607 This License is a kind of \(lqcopyleft\(rq, which means that derivative works of the
4608 document must themselves be free in the same sense. It complements the GNU
4609 General Public License, which is a copyleft license designed for free software.
4610 .Pp
4611 We have designed this License in order to use it for manuals for free software,
4612 because free software needs free documentation: a free program should come
4613 with manuals providing the same freedoms that the software does. But this
4614 License is not limited to software manuals; it can be used for any textual
4615 work, regardless of subject matter or whether it is published as a printed
4616 book. We recommend this License principally for works whose purpose is instruction
4617 or reference.
4618 .Pp
4619 .It
4620 APPLICABILITY AND DEFINITIONS
4621 .Pp
4622 This License applies to any manual or other work that contains a notice placed
4623 by the copyright holder saying it can be distributed under the terms of this
4624 License. The \(lqDocument\(rq, below, refers to any such manual or work. Any member
4625 of the public is a licensee, and is addressed as \(lqyou.\(rq
4626 .Pp
4627 A \(lqModified Version\(rq of the Document means any work containing the Document
4628 or a portion of it, either copied verbatim, or with modifications and/or translated
4629 into another language.
4630 .Pp
4631 A \(lqSecondary Section\(rq is a named appendix or a front-matter section of the Document
4632 that deals exclusively with the relationship of the publishers or authors
4633 of the Document to the Document's overall subject (or to related matters)
4634 and contains nothing that could fall directly within that overall subject.
4635 (For example, if the Document is in part a textbook of mathematics, a Secondary
4636 Section may not explain any mathematics.) The relationship could be a matter
4637 of historical connection with the subject or with related matters, or of legal,
4638 commercial, philosophical, ethical or political position regarding them.
4639 .Pp
4640 The \(lqInvariant Sections\(rq are certain Secondary Sections whose titles are designated,
4641 as being those of Invariant Sections, in the notice that says that the Document
4642 is released under this License.
4643 .Pp
4644 The \(lqCover Texts\(rq are certain short passages of text that are listed, as Front-Cover
4645 Texts or Back-Cover Texts, in the notice that says that the Document is released
4646 under this License.
4647 .Pp
4648 A \(lqTransparent\(rq copy of the Document means a machine-readable copy, represented
4649 in a format whose specification is available to the general public, whose
4650 contents can be viewed and edited directly and straightforwardly with generic
4651 text editors or (for images composed of pixels) generic paint programs or
4652 (for drawings) some widely available drawing editor, and that is suitable
4653 for input to text formatters or for automatic translation to a variety of
4654 formats suitable for input to text formatters. A copy made in an otherwise
4655 Transparent file format whose markup has been designed to thwart or discourage
4656 subsequent modification by readers is not Transparent. A copy that is not
4657 \(lqTransparent\(rq is called \(lqOpaque.\(rq
4658 .Pp
4659 Examples of suitable formats for Transparent copies include plain ASCII without
4660 markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly
4661 available DTD, and standard-conforming simple HTML designed for human modification.
4662 Opaque formats include PostScript, PDF, proprietary formats that can be read
4663 and edited only by proprietary word processors, SGML or XML for which the
4664 DTD and/or processing tools are not generally available, and the machine-generated
4665 HTML produced by some word processors for output purposes only.
4666 .Pp
4667 The \(lqTitle Page\(rq means, for a printed book, the title page itself, plus such
4668 following pages as are needed to hold, legibly, the material this License
4669 requires to appear in the title page. For works in formats which do not have
4670 any title page as such, \(lqTitle Page\(rq means the text near the most prominent
4671 appearance of the work's title, preceding the beginning of the body of the
4672 text.
4673 .Pp
4674 .It
4675 VERBATIM COPYING
4676 .Pp
4677 You may copy and distribute the Document in any medium, either commercially
4678 or noncommercially, provided that this License, the copyright notices, and
4679 the license notice saying this License applies to the Document are reproduced
4680 in all copies, and that you add no other conditions whatsoever to those of
4681 this License. You may not use technical measures to obstruct or control the
4682 reading or further copying of the copies you make or distribute. However,
4683 you may accept compensation in exchange for copies. If you distribute a large
4684 enough number of copies you must also follow the conditions in section 3.
4685 .Pp
4686 You may also lend copies, under the same conditions stated above, and you
4687 may publicly display copies.
4688 .Pp
4689 .It
4690 COPYING IN QUANTITY
4691 .Pp
4692 If you publish printed copies of the Document numbering more than 100, and
4693 the Document's license notice requires Cover Texts, you must enclose the copies
4694 in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover
4695 Texts on the front cover, and Back-Cover Texts on the back cover. Both covers
4696 must also clearly and legibly identify you as the publisher of these copies.
4697 The front cover must present the full title with all words of the title equally
4698 prominent and visible. You may add other material on the covers in addition.
4699 Copying with changes limited to the covers, as long as they preserve the title
4700 of the Document and satisfy these conditions, can be treated as verbatim copying
4701 in other respects.
4702 .Pp
4703 If the required texts for either cover are too voluminous to fit legibly,
4704 you should put the first ones listed (as many as fit reasonably) on the actual
4705 cover, and continue the rest onto adjacent pages.
4706 .Pp
4707 If you publish or distribute Opaque copies of the Document numbering more
4708 than 100, you must either include a machine-readable Transparent copy along
4709 with each Opaque copy, or state in or with each Opaque copy a publicly-accessible
4710 computer-network location containing a complete Transparent copy of the Document,
4711 free of added material, which the general network-using public has access
4712 to download anonymously at no charge using public-standard network protocols.
4713 If you use the latter option, you must take reasonably prudent steps, when
4714 you begin distribution of Opaque copies in quantity, to ensure that this Transparent
4715 copy will remain thus accessible at the stated location until at least one
4716 year after the last time you distribute an Opaque copy (directly or through
4717 your agents or retailers) of that edition to the public.
4718 .Pp
4719 It is requested, but not required, that you contact the authors of the Document
4720 well before redistributing any large number of copies, to give them a chance
4721 to provide you with an updated version of the Document.
4722 .Pp
4723 .It
4724 MODIFICATIONS
4725 .Pp
4726 You may copy and distribute a Modified Version of the Document under the conditions
4727 of sections 2 and 3 above, provided that you release the Modified Version
4728 under precisely this License, with the Modified Version filling the role of
4729 the Document, thus licensing distribution and modification of the Modified
4730 Version to whoever possesses a copy of it. In addition, you must do these
4731 things in the Modified Version:
4732 .Pp
4733 A. Use in the Title Page (and on the covers, if any) a title distinct from
4734 that of the Document, and from those of previous versions (which should, if
4735 there were any, be listed in the History section of the Document). You may
4736 use the same title as a previous version if the original publisher of that
4737 version gives permission.  B. List on the Title Page, as authors, one or more
4738 persons or entities responsible for authorship of the modifications in the
4739 Modified Version, together with at least five of the principal authors of
4740 the Document (all of its principal authors, if it has less than five).  C.
4741 State on the Title page the name of the publisher of the Modified Version,
4742 as the publisher.  D. Preserve all the copyright notices of the Document. 
4743 E. Add an appropriate copyright notice for your modifications adjacent to
4744 the other copyright notices.  F. Include, immediately after the copyright
4745 notices, a license notice giving the public permission to use the Modified
4746 Version under the terms of this License, in the form shown in the Addendum
4747 below.  G. Preserve in that license notice the full lists of Invariant Sections
4748 and required Cover Texts given in the Document's license notice.  H. Include
4749 an unaltered copy of this License.  I. Preserve the section entitled \(lqHistory\(rq,
4750 and its title, and add to it an item stating at least the title, year, new
4751 authors, and publisher of the Modified Version as given on the Title Page.
4752 If there is no section entitled \(lqHistory\(rq in the Document, create one stating
4753 the title, year, authors, and publisher of the Document as given on its Title
4754 Page, then add an item describing the Modified Version as stated in the previous
4755 sentence.  J. Preserve the network location, if any, given in the Document
4756 for public access to a Transparent copy of the Document, and likewise the
4757 network locations given in the Document for previous versions it was based
4758 on. These may be placed in the \(lqHistory\(rq section. You may omit a network location
4759 for a work that was published at least four years before the Document itself,
4760 or if the original publisher of the version it refers to gives permission. 
4761 K. In any section entitled \(lqAcknowledgements\(rq or \(lqDedications\(rq, preserve the section's
4762 title, and preserve in the section all the substance and tone of each of the
4763 contributor acknowledgements and/or dedications given therein.  L. Preserve
4764 all the Invariant Sections of the Document, unaltered in their text and in
4765 their titles. Section numbers or the equivalent are not considered part of
4766 the section titles.  M. Delete any section entitled \(lqEndorsements.\(rq Such a section
4767 may not be included in the Modified Version.  N. Do not retitle any existing
4768 section as \(lqEndorsements\(rq or to conflict in title with any Invariant Section. 
4769 .Pp
4770 If the Modified Version includes new front-matter sections or appendices that
4771 qualify as Secondary Sections and contain no material copied from the Document,
4772 you may at your option designate some or all of these sections as invariant.
4773 To do this, add their titles to the list of Invariant Sections in the Modified
4774 Version's license notice. These titles must be distinct from any other section
4775 titles.
4776 .Pp
4777 You may add a section entitled \(lqEndorsements\(rq, provided it contains nothing
4778 but endorsements of your Modified Version by various parties--for example,
4779 statements of peer review or that the text has been approved by an organization
4780 as the authoritative definition of a standard.
4781 .Pp
4782 You may add a passage of up to five words as a Front-Cover Text, and a passage
4783 of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts
4784 in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover
4785 Text may be added by (or through arrangements made by) any one entity. If
4786 the Document already includes a cover text for the same cover, previously
4787 added by you or by arrangement made by the same entity you are acting on behalf
4788 of, you may not add another; but you may replace the old one, on explicit
4789 permission from the previous publisher that added the old one.
4790 .Pp
4791 The author(s) and publisher(s) of the Document do not by this License give
4792 permission to use their names for publicity for or to assert or imply endorsement
4793 of any Modified Version.
4794 .Pp
4795 .It
4796 COMBINING DOCUMENTS
4797 .Pp
4798 You may combine the Document with other documents released under this License,
4799 under the terms defined in section 4 above for modified versions, provided
4800 that you include in the combination all of the Invariant Sections of all of
4801 the original documents, unmodified, and list them all as Invariant Sections
4802 of your combined work in its license notice.
4803 .Pp
4804 The combined work need only contain one copy of this License, and multiple
4805 identical Invariant Sections may be replaced with a single copy. If there
4806 are multiple Invariant Sections with the same name but different contents,
4807 make the title of each such section unique by adding at the end of it, in
4808 parentheses, the name of the original author or publisher of that section
4809 if known, or else a unique number. Make the same adjustment to the section
4810 titles in the list of Invariant Sections in the license notice of the combined
4811 work.
4812 .Pp
4813 In the combination, you must combine any sections entitled \(lqHistory\(rq in the
4814 various original documents, forming one section entitled \(lqHistory\(rq; likewise
4815 combine any sections entitled \(lqAcknowledgements\(rq, and any sections entitled
4816 \(lqDedications.\(rq You must delete all sections entitled \(lqEndorsements.\(rq
4817 .Pp
4818 .It
4819 COLLECTIONS OF DOCUMENTS
4820 .Pp
4821 You may make a collection consisting of the Document and other documents released
4822 under this License, and replace the individual copies of this License in the
4823 various documents with a single copy that is included in the collection, provided
4824 that you follow the rules of this License for verbatim copying of each of
4825 the documents in all other respects.
4826 .Pp
4827 You may extract a single document from such a collection, and distribute it
4828 individually under this License, provided you insert a copy of this License
4829 into the extracted document, and follow this License in all other respects
4830 regarding verbatim copying of that document.
4831 .Pp
4832 .It
4833 AGGREGATION WITH INDEPENDENT WORKS
4834 .Pp
4835 A compilation of the Document or its derivatives with other separate and independent
4836 documents or works, in or on a volume of a storage or distribution medium,
4837 does not as a whole count as a Modified Version of the Document, provided
4838 no compilation copyright is claimed for the compilation. Such a compilation
4839 is called an \(lqaggregate\(rq, and this License does not apply to the other self-contained
4840 works thus compiled with the Document, on account of their being thus compiled,
4841 if they are not themselves derivative works of the Document.
4842 .Pp
4843 If the Cover Text requirement of section 3 is applicable to these copies of
4844 the Document, then if the Document is less than one quarter of the entire
4845 aggregate, the Document's Cover Texts may be placed on covers that surround
4846 only the Document within the aggregate. Otherwise they must appear on covers
4847 around the whole aggregate.
4848 .Pp
4849 .It
4850 TRANSLATION
4851 .Pp
4852 Translation is considered a kind of modification, so you may distribute translations
4853 of the Document under the terms of section 4. Replacing Invariant Sections
4854 with translations requires special permission from their copyright holders,
4855 but you may include translations of some or all Invariant Sections in addition
4856 to the original versions of these Invariant Sections. You may include a translation
4857 of this License provided that you also include the original English version
4858 of this License. In case of a disagreement between the translation and the
4859 original English version of this License, the original English version will
4860 prevail.
4861 .Pp
4862 .It
4863 TERMINATION
4864 .Pp
4865 You may not copy, modify, sublicense, or distribute the Document except as
4866 expressly provided for under this License. Any other attempt to copy, modify,
4867 sublicense or distribute the Document is void, and will automatically terminate
4868 your rights under this License. However, parties who have received copies,
4869 or rights, from you under this License will not have their licenses terminated
4870 so long as such parties remain in full compliance.
4871 .Pp
4872 .It
4873 FUTURE REVISIONS OF THIS LICENSE
4874 .Pp
4875 The Free Software Foundation may publish new, revised versions of the GNU
4876 Free Documentation License from time to time. Such new versions will be similar
4877 in spirit to the present version, but may differ in detail to address new
4878 problems or concerns. See http://www.gnu.org/copyleft/.
4879 .Pp
4880 Each version of the License is given a distinguishing version number. If the
4881 Document specifies that a particular numbered version of this License \(lqor any
4882 later version\(rq applies to it, you have the option of following the terms and
4883 conditions either of that specified version or of any later version that has
4884 been published (not as a draft) by the Free Software Foundation. If the Document
4885 does not specify a version number of this License, you may choose any version
4886 ever published (not as a draft) by the Free Software Foundation.
4887 .Pp
4888 .El
4889 .Ss  ADDENDUM: How to use this License for your documents
4890 To use this License in a document you have written, include a copy of the
4891 License in the document and put the following copyright and license notices
4892 just after the title page:
4893 .Pp
4894 .Bd -literal -offset indent
4895
4896 Copyright (C)  year  your name.
4897 Permission is granted to copy, distribute and/or modify this document
4898 under the terms of the GNU Free Documentation License, Version 1.1
4899 or any later version published by the Free Software Foundation;
4900 with the Invariant Sections being list their titles, with the
4901 Front-Cover Texts being list, and with the Back-Cover Texts being list.
4902 A copy of the license is included in the section entitled "GNU
4903 Free Documentation License."
4904
4905 .Ed
4906 .Pp
4907 If you have no Invariant Sections, write \(lqwith no Invariant Sections\(rq instead
4908 of saying which ones are invariant. If you have no Front-Cover Texts, write
4909 \(lqno Front-Cover Texts\(rq instead of \(lqFront-Cover Texts being
4910 .Va list
4911 \(rq; likewise for Back-Cover Texts.
4912 .Pp
4913 If your document contains nontrivial examples of program code, we recommend
4914 releasing these examples in parallel under your choice of free software license,
4915 such as the GNU General Public License, to permit their use in free software.
4916 .Pp
4917 .Sh  Binutils Index