forked from msysgit/msysgit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinutils.info
4263 lines (3424 loc) · 166 KB
/
binutils.info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This is binutils.info, produced by makeinfo version 4.8 from
binutils.texi.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License".
INFO-DIR-SECTION Software development
START-INFO-DIR-ENTRY
* Binutils: (binutils). The GNU binary utilities.
END-INFO-DIR-ENTRY
INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
* addr2line: (binutils)addr2line. Convert addresses to file and line.
* ar: (binutils)ar. Create, modify, and extract from archives.
* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols.
* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt.
* dlltool: (binutils)dlltool. Create files needed to build and use DLLs.
* nlmconv: (binutils)nlmconv. Converts object code into an NLM.
* nm: (binutils)nm. List symbols from object files.
* objcopy: (binutils)objcopy. Copy and translate object files.
* objdump: (binutils)objdump. Display information from object files.
* ranlib: (binutils)ranlib. Generate index to archive contents.
* readelf: (binutils)readelf. Display the contents of ELF format files.
* size: (binutils)size. List section sizes and total size.
* strings: (binutils)strings. List printable strings from files.
* strip: (binutils)strip. Discard symbols.
* windmc: (binutils)windmc. Generator for Windows message resources.
* windres: (binutils)windres. Manipulate Windows resources.
END-INFO-DIR-ENTRY
File: binutils.info, Node: Top, Next: ar, Up: (dir)
Introduction
************
This brief manual contains documentation for the GNU binary utilities
(GNU Binutils) version 2.18.90:
This document is distributed under the terms of the GNU Free
Documentation License. A copy of the license is included in the
section entitled "GNU Free Documentation License".
* Menu:
* ar:: Create, modify, and extract from archives
* nm:: List symbols from object files
* objcopy:: Copy and translate object files
* objdump:: Display information from object files
* ranlib:: Generate index to archive contents
* readelf:: Display the contents of ELF format files
* size:: List section sizes and total size
* strings:: List printable strings from files
* strip:: Discard symbols
* c++filt:: Filter to demangle encoded C++ symbols
* cxxfilt: c++filt. MS-DOS name for c++filt
* addr2line:: Convert addresses to file and line
* nlmconv:: Converts object code into an NLM
* windres:: Manipulate Windows resources
* windmc:: Generator for Windows message resources
* dlltool:: Create files needed to build and use DLLs
* Common Options:: Command-line options for all utilities
* Selecting the Target System:: How these utilities determine the target
* Reporting Bugs:: Reporting Bugs
* GNU Free Documentation License:: GNU Free Documentation License
* Binutils Index:: Binutils Index
File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top
1 ar
****
ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
ar -M [ <mri-script ]
The GNU `ar' program creates, modifies, and extracts from archives.
An "archive" is a single file holding a collection of other files in a
structure that makes it possible to retrieve the original individual
files (called "members" of the archive).
The original files' contents, mode (permissions), timestamp, owner,
and group are preserved in the archive, and can be restored on
extraction.
GNU `ar' can maintain archives whose members have names of any
length; however, depending on how `ar' is configured on your system, a
limit on member-name length may be imposed for compatibility with
archive formats maintained with other tools. If it exists, the limit
is often 15 characters (typical of formats related to a.out) or 16
characters (typical of formats related to coff).
`ar' is considered a binary utility because archives of this sort
are most often used as "libraries" holding commonly needed subroutines.
`ar' creates an index to the symbols defined in relocatable object
modules in the archive when you specify the modifier `s'. Once
created, this index is updated in the archive whenever `ar' makes a
change to its contents (save for the `q' update operation). An archive
with such an index speeds up linking to the library, and allows
routines in the library to call each other without regard to their
placement in the archive.
You may use `nm -s' or `nm --print-armap' to list this index table.
If an archive lacks the table, another form of `ar' called `ranlib' can
be used to add just the table.
GNU `ar' can optionally create a _thin_ archive, which contains a
symbol index and references to the original copies of the member files
of the archives. Such an archive is useful for building libraries for
use within a local build, where the relocatable objects are expected to
remain available, and copying the contents of each object would only
waste time and space. Thin archives are also _flattened_, so that
adding one or more archives to a thin archive will add the elements of
the nested archive individually. The paths to the elements of the
archive are stored relative to the archive itself.
GNU `ar' is designed to be compatible with two different facilities.
You can control its activity using command-line options, like the
different varieties of `ar' on Unix systems; or, if you specify the
single command-line option `-M', you can control it with a script
supplied via standard input, like the MRI "librarian" program.
* Menu:
* ar cmdline:: Controlling `ar' on the command line
* ar scripts:: Controlling `ar' with a script
File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar
1.1 Controlling `ar' on the Command Line
========================================
ar [`-X32_64'] [`-']P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
When you use `ar' in the Unix style, `ar' insists on at least two
arguments to execute: one keyletter specifying the _operation_
(optionally accompanied by other keyletters specifying _modifiers_),
and the archive name to act on.
Most operations can also accept further MEMBER arguments, specifying
particular files to operate on.
GNU `ar' allows you to mix the operation code P and modifier flags
MOD in any order, within the first command-line argument.
If you wish, you may begin the first command-line argument with a
dash.
The P keyletter specifies what operation to execute; it may be any
of the following, but you must specify only one of them:
`d'
_Delete_ modules from the archive. Specify the names of modules to
be deleted as MEMBER...; the archive is untouched if you specify
no files to delete.
If you specify the `v' modifier, `ar' lists each module as it is
deleted.
`m'
Use this operation to _move_ members in an archive.
The ordering of members in an archive can make a difference in how
programs are linked using the library, if a symbol is defined in
more than one member.
If no modifiers are used with `m', any members you name in the
MEMBER arguments are moved to the _end_ of the archive; you can
use the `a', `b', or `i' modifiers to move them to a specified
place instead.
`p'
_Print_ the specified members of the archive, to the standard
output file. If the `v' modifier is specified, show the member
name before copying its contents to standard output.
If you specify no MEMBER arguments, all the files in the archive
are printed.
`q'
_Quick append_; Historically, add the files MEMBER... to the end of
ARCHIVE, without checking for replacement.
The modifiers `a', `b', and `i' do _not_ affect this operation;
new members are always placed at the end of the archive.
The modifier `v' makes `ar' list each file as it is appended.
Since the point of this operation is speed, the archive's symbol
table index is not updated, even if it already existed; you can
use `ar s' or `ranlib' explicitly to update the symbol table index.
However, too many different systems assume quick append rebuilds
the index, so GNU `ar' implements `q' as a synonym for `r'.
`r'
Insert the files MEMBER... into ARCHIVE (with _replacement_). This
operation differs from `q' in that any previously existing members
are deleted if their names match those being added.
If one of the files named in MEMBER... does not exist, `ar'
displays an error message, and leaves undisturbed any existing
members of the archive matching that name.
By default, new members are added at the end of the file; but you
may use one of the modifiers `a', `b', or `i' to request placement
relative to some existing member.
The modifier `v' used with this operation elicits a line of output
for each file inserted, along with one of the letters `a' or `r'
to indicate whether the file was appended (no old member deleted)
or replaced.
`t'
Display a _table_ listing the contents of ARCHIVE, or those of the
files listed in MEMBER... that are present in the archive.
Normally only the member name is shown; if you also want to see
the modes (permissions), timestamp, owner, group, and size, you can
request that by also specifying the `v' modifier.
If you do not specify a MEMBER, all files in the archive are
listed.
If there is more than one file with the same name (say, `fie') in
an archive (say `b.a'), `ar t b.a fie' lists only the first
instance; to see them all, you must ask for a complete listing--in
our example, `ar t b.a'.
`x'
_Extract_ members (named MEMBER) from the archive. You can use
the `v' modifier with this operation, to request that `ar' list
each name as it extracts it.
If you do not specify a MEMBER, all files in the archive are
extracted.
Files cannot be extracted from a thin archive.
A number of modifiers (MOD) may immediately follow the P keyletter,
to specify variations on an operation's behavior:
`a'
Add new files _after_ an existing member of the archive. If you
use the modifier `a', the name of an existing archive member must
be present as the RELPOS argument, before the ARCHIVE
specification.
`b'
Add new files _before_ an existing member of the archive. If you
use the modifier `b', the name of an existing archive member must
be present as the RELPOS argument, before the ARCHIVE
specification. (same as `i').
`c'
_Create_ the archive. The specified ARCHIVE is always created if
it did not exist, when you request an update. But a warning is
issued unless you specify in advance that you expect to create it,
by using this modifier.
`f'
Truncate names in the archive. GNU `ar' will normally permit file
names of any length. This will cause it to create archives which
are not compatible with the native `ar' program on some systems.
If this is a concern, the `f' modifier may be used to truncate file
names when putting them in the archive.
`i'
Insert new files _before_ an existing member of the archive. If
you use the modifier `i', the name of an existing archive member
must be present as the RELPOS argument, before the ARCHIVE
specification. (same as `b').
`l'
This modifier is accepted but not used.
`N'
Uses the COUNT parameter. This is used if there are multiple
entries in the archive with the same name. Extract or delete
instance COUNT of the given name from the archive.
`o'
Preserve the _original_ dates of members when extracting them. If
you do not specify this modifier, files extracted from the archive
are stamped with the time of extraction.
`P'
Use the full path name when matching names in the archive. GNU
`ar' can not create an archive with a full path name (such archives
are not POSIX complaint), but other archive creators can. This
option will cause GNU `ar' to match file names using a complete
path name, which can be convenient when extracting a single file
from an archive created by another tool.
`s'
Write an object-file index into the archive, or update an existing
one, even if no other change is made to the archive. You may use
this modifier flag either with any operation, or alone. Running
`ar s' on an archive is equivalent to running `ranlib' on it.
`S'
Do not generate an archive symbol table. This can speed up
building a large library in several steps. The resulting archive
can not be used with the linker. In order to build a symbol
table, you must omit the `S' modifier on the last execution of
`ar', or you must run `ranlib' on the archive.
`T'
Make the specified ARCHIVE a _thin_ archive. If it already exists
and is a regular archive, the existing members must be present in
the same directory as ARCHIVE.
`u'
Normally, `ar r'... inserts all files listed into the archive. If
you would like to insert _only_ those of the files you list that
are newer than existing members of the same names, use this
modifier. The `u' modifier is allowed only for the operation `r'
(replace). In particular, the combination `qu' is not allowed,
since checking the timestamps would lose any speed advantage from
the operation `q'.
`v'
This modifier requests the _verbose_ version of an operation. Many
operations display additional information, such as filenames
processed, when the modifier `v' is appended.
`V'
This modifier shows the version number of `ar'.
`ar' ignores an initial option spelt `-X32_64', for compatibility
with AIX. The behaviour produced by this option is the default for GNU
`ar'. `ar' does not support any of the other `-X' options; in
particular, it does not support `-X32' which is the default for AIX
`ar'.
File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar
1.2 Controlling `ar' with a Script
==================================
ar -M [ <SCRIPT ]
If you use the single command-line option `-M' with `ar', you can
control its operation with a rudimentary command language. This form
of `ar' operates interactively if standard input is coming directly
from a terminal. During interactive use, `ar' prompts for input (the
prompt is `AR >'), and continues executing even after errors. If you
redirect standard input to a script file, no prompts are issued, and
`ar' abandons execution (with a nonzero exit code) on any error.
The `ar' command language is _not_ designed to be equivalent to the
command-line options; in fact, it provides somewhat less control over
archives. The only purpose of the command language is to ease the
transition to GNU `ar' for developers who already have scripts written
for the MRI "librarian" program.
The syntax for the `ar' command language is straightforward:
* commands are recognized in upper or lower case; for example, `LIST'
is the same as `list'. In the following descriptions, commands are
shown in upper case for clarity.
* a single command may appear on each line; it is the first word on
the line.
* empty lines are allowed, and have no effect.
* comments are allowed; text after either of the characters `*' or
`;' is ignored.
* Whenever you use a list of names as part of the argument to an `ar'
command, you can separate the individual names with either commas
or blanks. Commas are shown in the explanations below, for
clarity.
* `+' is used as a line continuation character; if `+' appears at
the end of a line, the text on the following line is considered
part of the current command.
Here are the commands you can use in `ar' scripts, or when using
`ar' interactively. Three of them have special significance:
`OPEN' or `CREATE' specify a "current archive", which is a temporary
file required for most of the other commands.
`SAVE' commits the changes so far specified by the script. Prior to
`SAVE', commands affect only the temporary copy of the current archive.
`ADDLIB ARCHIVE'
`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)'
Add all the contents of ARCHIVE (or, if specified, each named
MODULE from ARCHIVE) to the current archive.
Requires prior use of `OPEN' or `CREATE'.
`ADDMOD MEMBER, MEMBER, ... MEMBER'
Add each named MEMBER as a module in the current archive.
Requires prior use of `OPEN' or `CREATE'.
`CLEAR'
Discard the contents of the current archive, canceling the effect
of any operations since the last `SAVE'. May be executed (with no
effect) even if no current archive is specified.
`CREATE ARCHIVE'
Creates an archive, and makes it the current archive (required for
many other commands). The new archive is created with a temporary
name; it is not actually saved as ARCHIVE until you use `SAVE'.
You can overwrite existing archives; similarly, the contents of any
existing file named ARCHIVE will not be destroyed until `SAVE'.
`DELETE MODULE, MODULE, ... MODULE'
Delete each listed MODULE from the current archive; equivalent to
`ar -d ARCHIVE MODULE ... MODULE'.
Requires prior use of `OPEN' or `CREATE'.
`DIRECTORY ARCHIVE (MODULE, ... MODULE)'
`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE'
List each named MODULE present in ARCHIVE. The separate command
`VERBOSE' specifies the form of the output: when verbose output is
off, output is like that of `ar -t ARCHIVE MODULE...'. When
verbose output is on, the listing is like `ar -tv ARCHIVE
MODULE...'.
Output normally goes to the standard output stream; however, if you
specify OUTPUTFILE as a final argument, `ar' directs the output to
that file.
`END'
Exit from `ar', with a `0' exit code to indicate successful
completion. This command does not save the output file; if you
have changed the current archive since the last `SAVE' command,
those changes are lost.
`EXTRACT MODULE, MODULE, ... MODULE'
Extract each named MODULE from the current archive, writing them
into the current directory as separate files. Equivalent to `ar -x
ARCHIVE MODULE...'.
Requires prior use of `OPEN' or `CREATE'.
`LIST'
Display full contents of the current archive, in "verbose" style
regardless of the state of `VERBOSE'. The effect is like `ar tv
ARCHIVE'. (This single command is a GNU `ar' enhancement, rather
than present for MRI compatibility.)
Requires prior use of `OPEN' or `CREATE'.
`OPEN ARCHIVE'
Opens an existing archive for use as the current archive (required
for many other commands). Any changes as the result of subsequent
commands will not actually affect ARCHIVE until you next use
`SAVE'.
`REPLACE MODULE, MODULE, ... MODULE'
In the current archive, replace each existing MODULE (named in the
`REPLACE' arguments) from files in the current working directory.
To execute this command without errors, both the file, and the
module in the current archive, must exist.
Requires prior use of `OPEN' or `CREATE'.
`VERBOSE'
Toggle an internal flag governing the output from `DIRECTORY'.
When the flag is on, `DIRECTORY' output matches output from `ar
-tv '....
`SAVE'
Commit your changes to the current archive, and actually save it
as a file with the name specified in the last `CREATE' or `OPEN'
command.
Requires prior use of `OPEN' or `CREATE'.
File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top
2 nm
****
nm [`-a'|`--debug-syms'] [`-g'|`--extern-only']
[`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic']
[`-S'|`--print-size'] [`-s'|`--print-armap']
[`-A'|`-o'|`--print-file-name'][`--special-syms']
[`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort']
[`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only']
[`-t' RADIX|`--radix='RADIX] [`-P'|`--portability']
[`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT]
[`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle']
[`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...]
GNU `nm' lists the symbols from object files OBJFILE.... If no
object files are listed as arguments, `nm' assumes the file `a.out'.
For each symbol, `nm' shows:
* The symbol value, in the radix selected by options (see below), or
hexadecimal by default.
* The symbol type. At least the following types are used; others
are, as well, depending on the object file format. If lowercase,
the symbol is local; if uppercase, the symbol is global (external).
`A'
The symbol's value is absolute, and will not be changed by
further linking.
`B'
`b'
The symbol is in the uninitialized data section (known as
BSS).
`C'
The symbol is common. Common symbols are uninitialized data.
When linking, multiple common symbols may appear with the
same name. If the symbol is defined anywhere, the common
symbols are treated as undefined references. For more
details on common symbols, see the discussion of -warn-common
in *Note Linker options: (ld.info)Options.
`D'
`d'
The symbol is in the initialized data section.
`G'
`g'
The symbol is in an initialized data section for small
objects. Some object file formats permit more efficient
access to small data objects, such as a global int variable
as opposed to a large global array.
`I'
The symbol is an indirect reference to another symbol. This
is a GNU extension to the a.out object file format which is
rarely used.
`i'
The symbol is in a section specific to the implementation of
DLLs.
`N'
The symbol is a debugging symbol.
`p'
The symbols is in a stack unwind section.
`R'
`r'
The symbol is in a read only data section.
`S'
`s'
The symbol is in an uninitialized data section for small
objects.
`T'
`t'
The symbol is in the text (code) section.
`U'
The symbol is undefined.
`V'
`v'
The symbol is a weak object. When a weak defined symbol is
linked with a normal defined symbol, the normal defined
symbol is used with no error. When a weak undefined symbol
is linked and the symbol is not defined, the value of the
weak symbol becomes zero with no error. On some systems,
uppercase indicates that a default value has been specified.
`W'
`w'
The symbol is a weak symbol that has not been specifically
tagged as a weak object symbol. When a weak defined symbol
is linked with a normal defined symbol, the normal defined
symbol is used with no error. When a weak undefined symbol
is linked and the symbol is not defined, the value of the
symbol is determined in a system-specific manner without
error. On some systems, uppercase indicates that a default
value has been specified.
`-'
The symbol is a stabs symbol in an a.out object file. In
this case, the next values printed are the stabs other field,
the stabs desc field, and the stab type. Stabs symbols are
used to hold debugging information. For more information,
see *Note Stabs: (stabs.info)Top.
`?'
The symbol type is unknown, or object file format specific.
* The symbol name.
The long and short forms of options, shown here as alternatives, are
equivalent.
`-A'
`-o'
`--print-file-name'
Precede each symbol by the name of the input file (or archive
member) in which it was found, rather than identifying the input
file once only, before all of its symbols.
`-a'
`--debug-syms'
Display all symbols, even debugger-only symbols; normally these
are not listed.
`-B'
The same as `--format=bsd' (for compatibility with the MIPS `nm').
`-C'
`--demangle[=STYLE]'
Decode ("demangle") low-level symbol names into user-level names.
Besides removing any initial underscore prepended by the system,
this makes C++ function names readable. Different compilers have
different mangling styles. The optional demangling style argument
can be used to choose an appropriate demangling style for your
compiler. *Note c++filt::, for more information on demangling.
`--no-demangle'
Do not demangle low-level symbol names. This is the default.
`-D'
`--dynamic'
Display the dynamic symbols rather than the normal symbols. This
is only meaningful for dynamic objects, such as certain types of
shared libraries.
`-f FORMAT'
`--format=FORMAT'
Use the output format FORMAT, which can be `bsd', `sysv', or
`posix'. The default is `bsd'. Only the first character of
FORMAT is significant; it can be either upper or lower case.
`-g'
`--extern-only'
Display only external symbols.
`-l'
`--line-numbers'
For each symbol, use debugging information to try to find a
filename and line number. For a defined symbol, look for the line
number of the address of the symbol. For an undefined symbol,
look for the line number of a relocation entry which refers to the
symbol. If line number information can be found, print it after
the other symbol information.
`-n'
`-v'
`--numeric-sort'
Sort symbols numerically by their addresses, rather than
alphabetically by their names.
`-p'
`--no-sort'
Do not bother to sort the symbols in any order; print them in the
order encountered.
`-P'
`--portability'
Use the POSIX.2 standard output format instead of the default
format. Equivalent to `-f posix'.
`-S'
`--print-size'
Print size, not the value, of defined symbols for the `bsd' output
format.
`-s'
`--print-armap'
When listing symbols from archive members, include the index: a
mapping (stored in the archive by `ar' or `ranlib') of which
modules contain definitions for which names.
`-r'
`--reverse-sort'
Reverse the order of the sort (whether numeric or alphabetic); let
the last come first.
`--size-sort'
Sort symbols by size. The size is computed as the difference
between the value of the symbol and the value of the symbol with
the next higher value. If the `bsd' output format is used the
size of the symbol is printed, rather than the value, and `-S'
must be used in order both size and value to be printed.
`--special-syms'
Display symbols which have a target-specific special meaning.
These symbols are usually used by the target for some special
processing and are not normally helpful when included included in
the normal symbol lists. For example for ARM targets this option
would skip the mapping symbols used to mark transitions between
ARM code, THUMB code and data.
`-t RADIX'
`--radix=RADIX'
Use RADIX as the radix for printing the symbol values. It must be
`d' for decimal, `o' for octal, or `x' for hexadecimal.
`--target=BFDNAME'
Specify an object code format other than your system's default
format. *Note Target Selection::, for more information.
`-u'
`--undefined-only'
Display only undefined symbols (those external to each object
file).
`--defined-only'
Display only defined symbols for each object file.
`-V'
`--version'
Show the version number of `nm' and exit.
`-X'
This option is ignored for compatibility with the AIX version of
`nm'. It takes one parameter which must be the string `32_64'.
The default mode of AIX `nm' corresponds to `-X 32', which is not
supported by GNU `nm'.
`--help'
Show a summary of the options to `nm' and exit.
File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top
3 objcopy
*********
objcopy [`-F' BFDNAME|`--target='BFDNAME]
[`-I' BFDNAME|`--input-target='BFDNAME]
[`-O' BFDNAME|`--output-target='BFDNAME]
[`-B' BFDARCH|`--binary-architecture='BFDARCH]
[`-S'|`--strip-all']
[`-g'|`--strip-debug']
[`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME]
[`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME]
[`--strip-unneeded-symbol='SYMBOLNAME]
[`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME]
[`--localize-hidden']
[`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME]
[`--globalize-symbol='SYMBOLNAME]
[`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME]
[`-w'|`--wildcard']
[`-x'|`--discard-all']
[`-X'|`--discard-locals']
[`-b' BYTE|`--byte='BYTE]
[`-i' INTERLEAVE|`--interleave='INTERLEAVE]
[`-j' SECTIONNAME|`--only-section='SECTIONNAME]
[`-R' SECTIONNAME|`--remove-section='SECTIONNAME]
[`-p'|`--preserve-dates']
[`--debugging']
[`--gap-fill='VAL]
[`--pad-to='ADDRESS]
[`--set-start='VAL]
[`--adjust-start='INCR]
[`--change-addresses='INCR]
[`--change-section-address' SECTION{=,+,-}VAL]
[`--change-section-lma' SECTION{=,+,-}VAL]
[`--change-section-vma' SECTION{=,+,-}VAL]
[`--change-warnings'] [`--no-change-warnings']
[`--set-section-flags' SECTION=FLAGS]
[`--add-section' SECTIONNAME=FILENAME]
[`--rename-section' OLDNAME=NEWNAME[,FLAGS]]
[`--change-leading-char'] [`--remove-leading-char']
[`--reverse-bytes='NUM]
[`--srec-len='IVAL] [`--srec-forceS3']
[`--redefine-sym' OLD=NEW]
[`--redefine-syms='FILENAME]
[`--weaken']
[`--keep-symbols='FILENAME]
[`--strip-symbols='FILENAME]
[`--strip-unneeded-symbols='FILENAME]
[`--keep-global-symbols='FILENAME]
[`--localize-symbols='FILENAME]
[`--globalize-symbols='FILENAME]
[`--weaken-symbols='FILENAME]
[`--alt-machine-code='INDEX]
[`--prefix-symbols='STRING]
[`--prefix-sections='STRING]
[`--prefix-alloc-sections='STRING]
[`--add-gnu-debuglink='PATH-TO-FILE]
[`--keep-file-symbols']
[`--only-keep-debug']
[`--extract-symbol']
[`--writable-text']
[`--readonly-text']
[`--pure']
[`--impure']
[`-v'|`--verbose']
[`-V'|`--version']
[`--help'] [`--info']
INFILE [OUTFILE]
The GNU `objcopy' utility copies the contents of an object file to
another. `objcopy' uses the GNU BFD Library to read and write the
object files. It can write the destination object file in a format
different from that of the source object file. The exact behavior of
`objcopy' is controlled by command-line options. Note that `objcopy'
should be able to copy a fully linked file between any two formats.
However, copying a relocatable object file between any two formats may
not work as expected.
`objcopy' creates temporary files to do its translations and deletes
them afterward. `objcopy' uses BFD to do all its translation work; it
has access to all the formats described in BFD and thus is able to
recognize most formats without being told explicitly. *Note BFD:
(ld.info)BFD.
`objcopy' can be used to generate S-records by using an output
target of `srec' (e.g., use `-O srec').
`objcopy' can be used to generate a raw binary file by using an
output target of `binary' (e.g., use `-O binary'). When `objcopy'
generates a raw binary file, it will essentially produce a memory dump
of the contents of the input object file. All symbols and relocation
information will be discarded. The memory dump will start at the load
address of the lowest section copied into the output file.
When generating an S-record or a raw binary file, it may be helpful
to use `-S' to remove sections containing debugging information. In
some cases `-R' will be useful to remove sections which contain
information that is not needed by the binary file.
Note--`objcopy' is not able to change the endianness of its input
files. If the input format has an endianness (some formats do not),
`objcopy' can only copy the inputs into file formats that have the same
endianness or which have no endianness (e.g., `srec'). (However, see
the `--reverse-bytes' option.)
`INFILE'
`OUTFILE'
The input and output files, respectively. If you do not specify
OUTFILE, `objcopy' creates a temporary file and destructively
renames the result with the name of INFILE.
`-I BFDNAME'
`--input-target=BFDNAME'
Consider the source file's object format to be BFDNAME, rather than
attempting to deduce it. *Note Target Selection::, for more
information.
`-O BFDNAME'
`--output-target=BFDNAME'
Write the output file using the object format BFDNAME. *Note
Target Selection::, for more information.
`-F BFDNAME'
`--target=BFDNAME'
Use BFDNAME as the object format for both the input and the output
file; i.e., simply transfer data from source to destination with no
translation. *Note Target Selection::, for more information.
`-B BFDARCH'
`--binary-architecture=BFDARCH'
Useful when transforming a raw binary input file into an object
file. In this case the output architecture can be set to BFDARCH.
This option will be ignored if the input file has a known BFDARCH.
You can access this binary data inside a program by referencing
the special symbols that are created by the conversion process.
These symbols are called _binary_OBJFILE_start,
_binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can
transform a picture file into an object file and then access it in
your code using these symbols.
`-j SECTIONNAME'
`--only-section=SECTIONNAME'
Copy only the named section from the input file to the output file.
This option may be given more than once. Note that using this
option inappropriately may make the output file unusable.
`-R SECTIONNAME'
`--remove-section=SECTIONNAME'
Remove any section named SECTIONNAME from the output file. This
option may be given more than once. Note that using this option
inappropriately may make the output file unusable.
`-S'
`--strip-all'
Do not copy relocation and symbol information from the source file.
`-g'
`--strip-debug'
Do not copy debugging symbols or sections from the source file.
`--strip-unneeded'
Strip all symbols that are not needed for relocation processing.
`-K SYMBOLNAME'
`--keep-symbol=SYMBOLNAME'
When stripping symbols, keep symbol SYMBOLNAME even if it would
normally be stripped. This option may be given more than once.
`-N SYMBOLNAME'
`--strip-symbol=SYMBOLNAME'
Do not copy symbol SYMBOLNAME from the source file. This option
may be given more than once.
`--strip-unneeded-symbol=SYMBOLNAME'
Do not copy symbol SYMBOLNAME from the source file unless it is
needed by a relocation. This option may be given more than once.
`-G SYMBOLNAME'
`--keep-global-symbol=SYMBOLNAME'
Keep only symbol SYMBOLNAME global. Make all other symbols local
to the file, so that they are not visible externally. This option
may be given more than once.
`--localize-hidden'
In an ELF object, mark all symbols that have hidden or internal
visibility as local. This option applies on top of
symbol-specific localization options such as `-L'.
`-L SYMBOLNAME'
`--localize-symbol=SYMBOLNAME'
Make symbol SYMBOLNAME local to the file, so that it is not
visible externally. This option may be given more than once.
`-W SYMBOLNAME'
`--weaken-symbol=SYMBOLNAME'
Make symbol SYMBOLNAME weak. This option may be given more than
once.
`--globalize-symbol=SYMBOLNAME'
Give symbol SYMBOLNAME global scoping so that it is visible
outside of the file in which it is defined. This option may be
given more than once.
`-w'
`--wildcard'
Permit regular expressions in SYMBOLNAMEs used in other command
line options. The question mark (?), asterisk (*), backslash (\)
and square brackets ([]) operators can be used anywhere in the
symbol name. If the first character of the symbol name is the
exclamation point (!) then the sense of the switch is reversed for
that symbol. For example:
-w -W !foo -W fo*
would cause objcopy to weaken all symbols that start with "fo"
except for the symbol "foo".
`-x'
`--discard-all'
Do not copy non-global symbols from the source file.
`-X'
`--discard-locals'
Do not copy compiler-generated local symbols. (These usually
start with `L' or `.'.)
`-b BYTE'
`--byte=BYTE'
Keep only every BYTEth byte of the input file (header data is not
affected). BYTE can be in the range from 0 to INTERLEAVE-1, where
INTERLEAVE is given by the `-i' or `--interleave' option, or the
default of 4. This option is useful for creating files to program
ROM. It is typically used with an `srec' output target.
`-i INTERLEAVE'
`--interleave=INTERLEAVE'
Only copy one out of every INTERLEAVE bytes. Select which byte to
copy with the `-b' or `--byte' option. The default is 4.
`objcopy' ignores this option if you do not specify either `-b' or
`--byte'.
`-p'
`--preserve-dates'
Set the access and modification dates of the output file to be the
same as those of the input file.
`--debugging'
Convert debugging information, if possible. This is not the
default because only certain debugging formats are supported, and
the conversion process can be time consuming.
`--gap-fill VAL'
Fill gaps between sections with VAL. This operation applies to
the _load address_ (LMA) of the sections. It is done by increasing
the size of the section with the lower address, and filling in the
extra space created with VAL.