Commit | Line | Data |
---|---|---|
c72af735 RP |
1 | \input texinfo |
2 | @setfilename binutils.info | |
3 | ||
9abcc3b8 RP |
4 | @ifinfo |
5 | @format | |
6 | START-INFO-DIR-ENTRY | |
7 | ||
c72af735 RP |
8 | * Binutils: (binutils). |
9 | The GNU binary utilities "ar", "ld", "objdump", "nm", | |
10 | "size", "strip", and "ranlib". | |
9abcc3b8 RP |
11 | |
12 | END-INFO-DIR-ENTRY | |
13 | @end format | |
14 | @end ifinfo | |
c72af735 RP |
15 | |
16 | @synindex ky cp | |
17 | @c | |
18 | @c This file documents the GNU binary utilities "ar", "ld", "objdump", "nm", | |
19 | @c "size", "strip", and "ranlib". | |
20 | @c | |
21 | @c Copyright (C) 1991 Free Software Foundation, Inc. | |
22 | @c | |
23 | @c This text may be freely distributed under the terms of the GNU | |
24 | @c General Public License. | |
25 | @c | |
26 | @c $Id$ | |
27 | @iftex | |
28 | @finalout | |
29 | @c @smallbook | |
30 | @end iftex | |
31 | @c @cropmarks | |
32 | @setchapternewpage odd | |
33 | @settitle GNU Binary Utilities | |
34 | @titlepage | |
35 | @title The GNU Binary Utilities | |
36 | @subtitle Version 1.90 | |
37 | @sp 1 | |
38 | @subtitle October 1991 | |
39 | @author Roland H. Pesch | |
40 | @author Cygnus Support | |
41 | @page | |
42 | ||
43 | @tex | |
44 | \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ | |
45 | \xdef\manvers{\$Revision$} % For use in headers, footers too | |
46 | {\parskip=0pt \hfill Cygnus Support\par \hfill \manvers\par \hfill | |
47 | \TeX{}info \texinfoversion\par } | |
48 | @end tex | |
49 | ||
50 | @vskip 0pt plus 1filll | |
51 | Copyright @copyright{} 1991 Free Software Foundation, Inc. | |
52 | ||
53 | Permission is granted to make and distribute verbatim copies of | |
54 | this manual provided the copyright notice and this permission notice | |
55 | are preserved on all copies. | |
56 | ||
57 | Permission is granted to copy and distribute modified versions of this | |
58 | manual under the conditions for verbatim copying, provided also that | |
59 | the entire resulting derived work is distributed under the terms of a | |
60 | permission notice identical to this one. | |
61 | ||
62 | Permission is granted to copy and distribute translations of this manual | |
63 | into another language, under the above conditions for modified versions. | |
64 | @end titlepage | |
65 | ||
66 | @node Top, ar, (dir), (dir) | |
67 | @chapter Introduction | |
68 | ||
69 | @cindex version | |
70 | This brief manual contains preliminary documentation for the GNU binary | |
71 | utilities (collectively version 1.90): | |
72 | @table @code | |
73 | @item ar | |
74 | Create, modify, and extract from archives | |
75 | ||
76 | @item nm | |
77 | List symbols from object files | |
78 | ||
79 | @item objdump | |
80 | Display information from object files | |
81 | ||
82 | @item ranlib | |
83 | Generate index to archive contents | |
84 | ||
85 | @item size | |
86 | List section sizes and total size | |
87 | ||
88 | @item strip | |
89 | Discard symbols | |
90 | @end table | |
91 | ||
92 | @ifinfo | |
93 | Copyright @copyright{} 1991 Free Software Foundation, Inc. | |
94 | ||
95 | Permission is granted to make and distribute verbatim copies of | |
96 | this manual provided the copyright notice and this permission notice | |
97 | are preserved on all copies. | |
98 | ||
99 | @ignore | |
100 | Permission is granted to process this file through TeX and print the | |
101 | results, provided the printed document carries a copying permission | |
102 | notice identical to this one except for the removal of this paragraph | |
103 | (this paragraph not being relevant to the printed manual). | |
104 | ||
105 | @end ignore | |
106 | ||
107 | Permission is granted to copy and distribute modified versions of this | |
108 | manual under the conditions for verbatim copying, provided also that | |
109 | the entire resulting derived work is distributed under the terms of a | |
110 | permission notice identical to this one. | |
111 | ||
112 | Permission is granted to copy and distribute translations of this manual | |
113 | into another language, under the above conditions for modified versions. | |
114 | @end ifinfo | |
115 | ||
116 | @menu | |
117 | * ar:: Create, modify, and extract from archives | |
118 | * ld:: See ld.info | |
119 | * nm:: List symbols from object files | |
120 | * objdump:: Display information from object files | |
121 | * ranlib:: Generate index to archive contents | |
122 | * size:: List section sizes and total size | |
123 | * strip:: Discard symbols | |
124 | * Index:: | |
125 | @end menu | |
126 | ||
127 | @node ar, ld, Top, Top | |
128 | @chapter ar | |
129 | ||
130 | @kindex ar | |
131 | @cindex archives | |
132 | @cindex collections of files | |
133 | @smallexample | |
134 | ar [-]@var{p}@var{mod} [ @var{membername} ] @var{archive} @var{files}@dots{} | |
135 | @end smallexample | |
136 | ||
137 | The GNU @code{ar} program creates, modifies, and extracts from | |
138 | archives. An @dfn{archive} is a single file holding a collection of | |
139 | other files in a structure that makes it possible to retrieve | |
140 | the original individual files (called @dfn{members} of the archive). | |
141 | ||
142 | The original files' contents, mode (permissions), timestamp, owner, and | |
143 | group are preserved in the archive, and may be reconstituted on | |
144 | extraction. | |
145 | ||
146 | @cindex name length | |
147 | GNU @code{ar} can maintain archives whose members have names of any | |
148 | length; however, depending on how @code{ar} is configured on your | |
149 | system, a limit on member-name length may be imposed (for compatibility | |
150 | with archive formats maintained with other tools). If it exists, the | |
151 | limit is often 15 characters (typical of formats related to a.out) or 16 | |
152 | characters (typical of formats related to coff). | |
153 | ||
154 | @cindex libraries | |
155 | @code{ar} is considered a binary utility because archives of this sort | |
156 | are most often used as @dfn{libraries} holding commonly needed | |
157 | subroutines. | |
158 | ||
159 | @cindex symbol index | |
160 | @code{ar} will create an index to the symbols defined in relocatable | |
161 | object modules in the archive when you specify the modifier @samp{s}. | |
162 | Once created, this index is updated in the archive whenever @code{ar} | |
163 | makes a change to its contents (save for the @samp{q} update operation). | |
164 | An archive with such an index speeds up linking to the library, and | |
165 | allows routines in the library to call each other without regard to | |
166 | their placement in the archive. | |
167 | ||
168 | You may use @samp{nm -s} or @samp{nm +print-armap} to list this index | |
169 | table. If an archive lacks the table, another form of @code{ar} called | |
170 | @code{ranlib} can be used to add just the table. | |
171 | ||
172 | @code{ar} insists on at least two arguments to execute: one | |
173 | keyletter specifying the @emph{operation} (optionally accompanied by other | |
174 | keyletters specifying @emph{modifiers}), and the archive name to act on. | |
175 | ||
176 | Most operations can also accept further @var{files} arguments, | |
177 | specifying particular files to operate on. | |
178 | ||
179 | GNU @code{ar} allows you to mix the operation code @var{p} and modifier | |
180 | flags @var{mod} in any order, within the first command-line argument. | |
181 | ||
182 | If you wish, you may begin the first command-line argument with a | |
183 | dash. | |
184 | ||
185 | @cindex operations on archive | |
186 | The @var{p} keyletter specifies what operation to execute; it may be | |
187 | any of the following, but you must specify only one of them: | |
188 | ||
189 | @table @code | |
190 | @item d | |
191 | @cindex deleting from archive | |
192 | @emph{Delete} modules from the archive. Specify the names of modules to | |
193 | be deleted as @var{files}; the archive is untouched if you | |
194 | specify no files to delete. | |
195 | ||
196 | If you specify the @samp{v} modifier, @code{ar} will list each module | |
197 | as it is deleted. | |
198 | ||
199 | @item m | |
200 | @cindex moving in archive | |
201 | Use this operation to @emph{move} members in an archive. | |
202 | ||
203 | The ordering of members in an archive can make a difference in how | |
204 | programs are linked using the library, if a symbol is defined in more | |
205 | than one member. | |
206 | ||
207 | If no modifiers are used with @code{m}, any members you name in the | |
208 | @var{files} arguments are moved to the @emph{end} of the archive; | |
209 | you can use the @samp{a}, @samp{b}, or @samp{i} modifiers to move them to a | |
210 | specified place instead. | |
211 | ||
212 | @item p | |
213 | @cindex printing from archive | |
214 | @emph{Print} the specified members of the archive, to the standard | |
215 | output file. If the @samp{v} modifier is specified, show the member | |
216 | name before copying its contents to standard output. | |
217 | ||
218 | If you specify no @var{files}, all the files in the archive are printed. | |
219 | ||
220 | @item q | |
221 | @cindex quick append to archive | |
222 | @emph{Quick append}; add @var{files} to the end of @var{archive}, | |
223 | without checking for replacement. | |
224 | ||
225 | The modifiers @samp{a}, @samp{b}, and @samp{i} do @emph{not} affect this | |
226 | operation; new members are always placed at the end of the archive. | |
227 | ||
228 | The modifier @samp{v} makes @code{ar} list each file as it is appended. | |
229 | ||
230 | Since the point of this operation is speed, the archive's symbol table | |
231 | index is not updated, even if it already existed; you can use @samp{ar s} or | |
232 | @code{ranlib} explicitly to update the symbol table index. | |
233 | ||
234 | @item r | |
235 | @cindex replacement in archive | |
236 | Insert @var{files} into @var{archive} (with @emph{replacement}). This | |
237 | operation differs from @samp{q} in that any previously existing members | |
238 | are deleted if their names match those being added. | |
239 | ||
240 | If one of the files named in @var{files} doesn't exist, @code{ar} | |
241 | displays an error message, and leaves undisturbed any existing members | |
242 | of the archive matching that name. | |
243 | ||
244 | By default, new members are added at the end of the file; but you may | |
245 | use one of the modifiers @samp{a}, @samp{b}, or @samp{i} to request | |
246 | placement relative to some existing member. | |
247 | ||
248 | The modifier @samp{v} used with this operation elicits a line of | |
249 | output for each file inserted, along with one of the letters @samp{a} or | |
250 | @samp{r} to indicate whether the file was appended (no old member | |
251 | deleted) or replaced. | |
252 | ||
253 | @item t | |
254 | @cindex contents of archive | |
255 | Display a @emph{table} listing the contents of @var{archive}, or those | |
256 | of the files listed in @var{files} that are present in the | |
257 | archive. Normally only the member name is shown; if you also want to | |
258 | see the modes (permissions), timestamp, owner, group, and size, you can | |
259 | request that by also specifying the @samp{v} modifier. | |
260 | ||
261 | If you do not specify any @var{files}, all files in the archive | |
262 | are listed. | |
263 | ||
264 | @cindex repeated names in archive | |
265 | @cindex name duplication in archive | |
266 | If there is more than one file with the same name (say, @samp{fie}) in | |
267 | an archive (say @samp{b.a}), @samp{ar t b.a fie} will list only the | |
268 | first instance; to see them all, you must ask for a complete | |
269 | listing---in our example, @samp{ar t b.a}. | |
270 | @c WRS only; per Gumby, this is implementation-dependent, and in a more | |
271 | @c recent case in fact works the other way. | |
272 | ||
273 | @item x | |
274 | @cindex extract from archive | |
275 | @emph{Extract} members (named @var{files}) from the archive. You can | |
276 | use the @samp{v} modifier with this operation, to request that | |
277 | @code{ar} list each name as it extracts it. | |
278 | ||
279 | If you do not specify any @var{files}, all files in the archive | |
280 | are extracted. | |
281 | ||
282 | @end table | |
283 | ||
284 | A number of modifiers (@var{mod}) may immediately follow the @var{p} | |
285 | keyletter, to specify variations on an operation's behavior: | |
286 | ||
287 | @table @code | |
288 | @item a | |
289 | @cindex relative placement in archive | |
290 | Add new files @emph{after} an existing member of the | |
291 | archive. If you use the modifier @code{a}, the name of an existing archive | |
292 | member must be present as the @var{membername} argument, before the | |
293 | @var{archive} specification. | |
294 | ||
295 | @item b | |
296 | Add new files @emph{before} an existing member of the | |
297 | archive. If you use the modifier @code{b}, the name of an existing archive | |
298 | member must be present as the @var{membername} argument, before the | |
299 | @var{archive} specification. (same as @samp{i}). | |
300 | ||
301 | @item c | |
302 | @cindex creating archives | |
303 | @emph{Create} the archive. The specified @var{archive} is always | |
304 | created if it didn't exist, when you request an update. But a warning is | |
305 | issued unless you specify in advance that you expect to create it, by | |
306 | using this modifier. | |
307 | ||
308 | @item i | |
309 | Insert new files @emph{before} an existing member of the | |
310 | archive. If you use the modifier @code{i}, the name of an existing archive | |
311 | member must be present as the @var{membername} argument, before the | |
312 | @var{archive} specification. (same as @samp{b}). | |
313 | ||
314 | @item l | |
315 | This modifier is accepted but not used. | |
316 | @c whaffor ar l modifier??? presumably compat; with | |
317 | @c what???---pesch@@cygnus.com, 25jan91 | |
318 | ||
319 | @item o | |
320 | @cindex dates in archive | |
321 | Preserve the @emph{original} dates of members when extracting them. If | |
322 | you do not specify this modifier, files extracted from the archive | |
323 | will be stamped with the time of extraction. | |
324 | ||
325 | @item s | |
326 | @cindex writing archive index | |
327 | Write an object-file index into the archive, or update an existing one, | |
328 | even if no other change is made to the archive. You may use this modifier | |
329 | flag either with any operation, or alone. Running @samp{ar s} on an | |
330 | archive is equivalent to running @samp{ranlib} on it. | |
331 | ||
332 | @item u | |
333 | @cindex updating an archive | |
334 | Normally, @code{ar r}@dots{} inserts all files | |
335 | listed into the archive. If you would like to insert @emph{only} those | |
336 | of the files you list that are newer than existing members of the same | |
337 | names, use this modifier. The @samp{u} modifier is allowed only for the | |
338 | operation @samp{r} (replace). In particular, the combination @samp{qu} is | |
339 | not allowed, since checking the timestamps would lose any speed | |
340 | advantage from the operation @samp{q}. | |
341 | ||
342 | @item v | |
343 | This modifier requests the @emph{verbose} version of an operation. Many | |
344 | operations display additional information, such as filenames processed, | |
345 | when the modifier @samp{v} is appended. | |
346 | ||
347 | @end table | |
348 | ||
349 | @node ld, nm, ar, Top | |
350 | @chapter ld | |
351 | @cindex linker | |
352 | @kindex ld | |
353 | The GNU linker @code{ld} is now described in a separate manual. | |
354 | @xref{Top,, Overview,, GLD: the GNU linker}. | |
355 | ||
356 | @node nm, objdump, ld, Top | |
357 | @chapter nm | |
358 | @cindex symbols | |
359 | @kindex nm | |
360 | ||
361 | @smallexample | |
362 | nm [ -a | +debug-syms ] [ -g | +extern-only ] | |
363 | [ -s | +print-armap ] [ -o | +print-file-name ] | |
364 | [ -n | +numeric-sort ] [ -p | +no-sort ] | |
365 | [ -r | +reverse-sort ] [ -u | +undefined-only ] | |
366 | [ +target @var{bfdname} ] | |
367 | [ @var{objfiles}@dots{} ] | |
368 | @end smallexample | |
369 | ||
370 | GNU @code{nm} will list the symbols from object files @var{objfiles}. | |
371 | ||
372 | The long and short forms of options, shown here as alternatives, are | |
373 | equivalent. | |
374 | ||
375 | @table @code | |
376 | @item @var{objfiles}@dots{} | |
377 | @kindex a.out | |
378 | Object files whose symbols are to be listed. If no object files are | |
379 | listed as arguments, @code{nm} assumes @samp{a.out}. | |
380 | ||
381 | @item -a | |
382 | @itemx +debug-syms | |
383 | @cindex debugging symbols | |
384 | Display debugger-only symbols; normally these are not listed. | |
385 | ||
386 | @item -g | |
387 | @itemx +extern-only | |
388 | @cindex external symbols | |
389 | Display only external symbols. | |
390 | ||
391 | @item -p | |
392 | @itemx +no-sort | |
393 | @cindex sorting symbols | |
394 | Don't bother to sort the symbols in any order; just print them in the | |
395 | order encountered. | |
396 | ||
397 | @item -n | |
398 | @itemx +numeric-sort | |
399 | Sort symbols numerically by their addresses, not alphabetically by their | |
400 | names. | |
401 | ||
402 | @item -s | |
403 | @itemx +print-armap | |
404 | @cindex symbol index, listing | |
405 | When listing symbols from archive members, include the index: a mapping | |
406 | (stored in the archive by @code{ar} or @code{ranlib}) of what modules | |
407 | contain definitions for what names. | |
408 | ||
409 | @item -o | |
410 | @itemx +print-file-name | |
411 | @cindex input file name | |
412 | @cindex file name | |
413 | @cindex source file name | |
414 | Precede each symbol by the name of the input file where it was found, | |
415 | rather than identifying the input file once only before all of its | |
416 | symbols. | |
417 | ||
418 | @item -r | |
419 | @itemx +reverse-sort | |
420 | Reverse the sense of the sort (whether numeric or alphabetic); let the | |
421 | last come first. | |
422 | ||
423 | @item +target @var{bfdname} | |
424 | @c @item +target | |
425 | @cindex object code format | |
426 | Specify an object code format other than your system's default format. | |
427 | @xref{objdump}, for information on listing available formats. | |
428 | @c FIXME what *does* +target/no arg do? | |
429 | ||
430 | @item -u | |
431 | @itemx +undefined-only | |
432 | @cindex external symbols | |
433 | @cindex undefined symbols | |
434 | Display only undefined symbols (those external to each object file). | |
435 | ||
436 | @end table | |
437 | ||
438 | @node objdump, ranlib, nm, Top | |
439 | @chapter objdump | |
440 | ||
441 | @cindex object file information | |
442 | @kindex objdump | |
443 | ||
444 | @smallexample | |
445 | objdump [ -a ] [ -b @var{bfdname} ] [ -d ] [ -f ] | |
446 | [ -h | +header ] [ -i ] [ -j @var{section} ] [ -l ] | |
447 | [ -m @var{machine} ] [ -r | +reloc ] [ -s ] | |
448 | [ -t | +syms ] [ -x ] | |
449 | @var{objfiles}@dots{} | |
450 | @end smallexample | |
451 | ||
452 | @code{objdump} displays information about one or more object files. | |
453 | The options control what particular information to display. This | |
454 | information is mostly useful to programmers who are working on the | |
455 | compilation tools, as opposed to programmers who just want their | |
456 | program to compile and work. | |
457 | ||
458 | The long and short forms of options, shown here as alternatives, are | |
459 | equivalent. | |
460 | ||
461 | @table @code | |
462 | @item @var{objfiles}@dots{} | |
463 | The object files to be examined. When you specify archives, | |
464 | @code{objdump} shows information on each of the member object files. | |
465 | ||
466 | @item -a | |
467 | @c print_arelt_descr | |
468 | @cindex archive headers | |
469 | If any files from @var{objfiles} are archives, display the archive | |
470 | header information (in a format similar to @samp{ls -l}). Besides the | |
471 | information you could list with @samp{ar tv}, @samp{objdump -a} shows | |
472 | the object file format of each archive member. | |
473 | ||
474 | @c suggest longname +target or +format or +bfd | |
475 | @item -b @var{bfdname} | |
476 | @cindex object code format | |
477 | You can specify a particular object-code format for your object files as | |
478 | @var{bfdname}. This may not be necessary; @var{objdump} can | |
479 | automatically recognize many formats. For example, | |
480 | @example | |
481 | objdump -b oasys -m vax -h fu.o | |
482 | @end example | |
483 | @noindent | |
484 | Displays summary information from the section headers (@samp{-h}) of | |
485 | @file{fu.o}, which is explicitly identified (@samp{-m}) as a Vax object | |
486 | file in the format produced by Oasys compilers. You can list the | |
487 | formats available with the @samp{-i} option. | |
488 | ||
489 | @item -d | |
490 | @cindex disassembling object code | |
491 | @cindex machine instructions | |
492 | Disassemble. Display the assembler mnemonics for the machine | |
493 | instructions from @var{objfiles}. | |
494 | ||
495 | @item -f | |
496 | @cindex object file header | |
497 | File header. Display summary information from the overall header of | |
498 | each file in @var{objfiles}. | |
499 | ||
500 | @item -h | |
501 | @itemx +header | |
502 | @cindex section headers | |
503 | Header. Display summary information from the section headers of the | |
504 | object file. | |
505 | ||
506 | @item -i | |
507 | @cindex architectures available | |
508 | @cindex object formats available | |
509 | Display a list showing all architectures and object formats available | |
510 | for specification with @code{-b} or @code{-m}. | |
511 | ||
512 | @c suggest longname +section | |
513 | @item -j @var{name} | |
514 | @cindex section information | |
515 | Display information only for section @var{name} | |
516 | ||
517 | @c suggest longname +label or +linespec | |
518 | @item -l | |
519 | @cindex source filenames for object files | |
520 | Label the display (using debugging information) with the source filename | |
521 | and line numbers corresponding to the object code shown. | |
522 | ||
523 | @c suggest longname +architecture | |
524 | @item -m @var{machine} | |
525 | @cindex architecture | |
526 | Specify the object files @var{objfiles} are for architecture | |
527 | @var{machine}. You can list available architectures using the @samp{-i} | |
528 | option. | |
529 | ||
530 | @item -r | |
531 | @itemx +reloc | |
532 | @cindex relocation entries, in object file | |
533 | Relocation. Print the relocation entries of the file. | |
534 | ||
535 | @item -s | |
536 | @cindex sections, full contents | |
537 | @cindex object file sections | |
538 | Display the full contents of any sections requested. | |
539 | ||
540 | @item -t | |
541 | @itemx +syms | |
542 | @cindex symbol table entries, printing | |
543 | Symbol Table. Print the symbol table entries of the file. | |
544 | This is similar to the information provided by the @samp{nm} program. | |
545 | ||
546 | @item -x | |
547 | @cindex all header information, object file | |
548 | @cindex header information, all | |
549 | Display all available header information, including the symbol table and | |
550 | relocation entries. Using @samp{-x} is equivalent to specifying all of | |
551 | @samp{-a -f -h -r -t}. | |
552 | ||
553 | @end table | |
554 | ||
555 | @node ranlib, size, objdump, Top | |
556 | @chapter ranlib | |
557 | ||
558 | @kindex ranlib | |
559 | @cindex archive contents | |
560 | @cindex symbol index | |
561 | ||
562 | @smallexample | |
563 | ranlib @var{archive} | |
564 | @end smallexample | |
565 | ||
566 | @code{ranlib} generates an index to the contents of an archive, and | |
567 | stores it in the archive. The index lists each symbol defined by a | |
568 | member of an archive that is a relocatable object file. | |
569 | ||
570 | You may use @samp{nm -s} or @samp{nm +print-armap} to list this index. | |
571 | ||
572 | An archive with such an index speeds up linking to the library, and | |
573 | allows routines in the library to call each other without regard to | |
574 | their placement in the archive. | |
575 | ||
576 | The GNU @code{ranlib} program is another form of GNU @code{ar}; running | |
577 | @code{ranlib} is completely equivalent to executing @samp{ar -s}. | |
578 | @xref{ar}. | |
579 | ||
580 | @node size, strip, ranlib, Top | |
581 | @chapter size | |
582 | ||
583 | @kindex size | |
584 | @cindex section sizes | |
585 | ||
586 | @smallexample | |
587 | size [ -A | -B | +format @var{compatibility} ] | |
588 | [ +help ] [ -d | -o | -x | +radix @var{number} ] | |
589 | [ +target @var{bfdname} ] [ -V | +version ] | |
590 | @var{objfiles}@dots{} | |
591 | @end smallexample | |
592 | ||
593 | The GNU @code{size} utility lists the section sizes---and the total | |
594 | size---for each of the object files @var{objfiles} in its argument list. | |
595 | By default, one line of output is generated for each object file or each | |
596 | module in an archive. | |
597 | ||
598 | The command line options have the following meanings: | |
599 | @table @code | |
600 | @item @var{objfiles}@dots{} | |
601 | The object files to be examined. | |
602 | ||
603 | @item -A | |
604 | @itemx -B | |
605 | @itemx +format @var{compatibility} | |
606 | @cindex size display format | |
607 | Using one of these options, you can choose whether the output from GNU | |
608 | @code{size} resembles output from System V @code{size} (using @samp{-A}, | |
609 | or @samp{+format sysv}), or Berkeley @code{size} (using @samp{-B}, or | |
610 | @samp{+format berkeley}). The default is the one-line format similar to | |
611 | Berkeley's. | |
612 | @c Bonus for doc-source readers: you can also say +format=strange (or | |
613 | @c anything else that starts with 's') for sysv, and +format=boring (or | |
614 | @c anything else that starts with 'b') for Berkeley. | |
615 | ||
616 | Here is an example of the Berkeley (default) format of output from | |
617 | @code{size}: | |
618 | @smallexample | |
619 | eg$ size +format Berkeley ranlib size | |
620 | text data bss dec hex filename | |
621 | 294880 81920 11592 388392 5ed28 ranlib | |
622 | 294880 81920 11888 388688 5ee50 size | |
623 | @end smallexample | |
624 | ||
625 | @noindent | |
626 | This is the same data, but displayed closer to System V conventions: | |
627 | ||
628 | @smallexample | |
629 | eg$ size +format SysV ranlib size | |
630 | ranlib : | |
631 | section size addr | |
632 | .text 294880 8192 | |
633 | .data 81920 303104 | |
634 | .bss 11592 385024 | |
635 | Total 388392 | |
636 | ||
637 | ||
638 | size : | |
639 | section size addr | |
640 | .text 294880 8192 | |
641 | .data 81920 303104 | |
642 | .bss 11888 385024 | |
643 | Total 388688 | |
644 | @end smallexample | |
645 | ||
646 | @item +help | |
647 | Show a summary of acceptable arguments and options. | |
648 | ||
649 | @item -d | |
650 | @itemx -o | |
651 | @itemx -x | |
652 | @itemx +radix @var{number} | |
653 | @cindex size number format | |
654 | @cindex radix for section sizes | |
655 | Using one of these options, you can control whether the size of each | |
656 | section is given in decimal (@samp{-d}, or @samp{+radix 10}); octal | |
657 | (@samp{-o}, or @samp{+radix 8}); or hexadecimal (@samp{-x}, or | |
658 | @samp{+radix 16}). In @samp{+radix @var{number}}, only the three | |
659 | values (8, 10, 16) are supported. The total size is always given in two | |
660 | radices; decimal and hexadecimal for @samp{-d} or @samp{-x} output, or | |
661 | octal and hexadecimal if you're using @samp{-o}. | |
662 | ||
663 | @item +target @var{bfdname} | |
664 | @cindex object code format | |
665 | You can specify a particular object-code format for @var{objfiles} as | |
666 | @var{bfdname}. This may not be necessary; @var{size} can | |
667 | automatically recognize many formats. @xref{objdump}, for information | |
668 | on listing available formats. | |
669 | ||
670 | @item -V | |
671 | @itemx +version | |
672 | Display version number information on @code{size} itself. | |
673 | ||
674 | @end table | |
675 | ||
676 | @node strip, Index, size, Top | |
677 | @chapter strip | |
678 | ||
679 | @kindex strip | |
680 | @cindex removing symbols | |
681 | @cindex discarding symbols | |
682 | ||
683 | @smallexample | |
684 | strip [ -s | +strip-all ] [ -g | -S | +strip-debug ] | |
685 | [ -x | +discard-all ] [ -X | +discard-locals ] | |
686 | [ -T @var{bfdname} ] | |
687 | @var{objfiles}@dots{} | |
688 | @end smallexample | |
689 | ||
690 | GNU @code{strip} will discard all symbols from object files | |
691 | @var{objfiles}, if no options are specified; or only certain symbols, | |
692 | depending on its command-line options. | |
693 | ||
694 | @code{strip} will not execute unless at least one object file is listed. | |
695 | ||
696 | @quotation | |
697 | @emph{WARNING:} @code{strip} modifies the files named in its argument, | |
698 | rather than writing modified copies under different names. | |
699 | @end quotation | |
700 | ||
701 | The long and short forms of options, shown here as alternatives, are | |
702 | equivalent. | |
703 | ||
704 | @table @code | |
705 | @item -s | |
706 | @itemx +strip-all | |
707 | @cindex all symbols, discarding | |
708 | This is the default case: strip all symbol entries from @var{objfiles}. | |
709 | ||
710 | @item -g | |
711 | @itemx -S | |
712 | @itemx +strip-debug | |
713 | @cindex debugging symbols, discarding | |
714 | Discard only debugging symbol information from @var{objfiles}. | |
715 | ||
716 | @item -x | |
717 | @itemx +discard-all | |
718 | @cindex local symbols, discarding | |
719 | Discard all symbols local to each file in @var{objfiles}. | |
720 | @emph{WARNING:} Note that @code{+discard-all} discards only @emph{local} | |
721 | symbols, in spite of its name. | |
722 | ||
723 | @item -X | |
724 | @itemx +discard-locals | |
725 | Discard local symbols starting with @samp{L} from each file in | |
726 | @var{objfiles}. (Some compilers produce internally-used symbols that | |
727 | begin with @samp{L}.) | |
728 | ||
729 | @item -T @var{bfdname} | |
730 | @cindex object code format | |
731 | You can specify a particular object-code format @var{bfdname} for | |
732 | @var{objfiles}. This may not be necessary; @var{strip} can automatically | |
733 | recognize many formats. @xref{objdump}, for information on listing | |
734 | available formats. | |
735 | @end table | |
736 | ||
737 | @node Index, , strip, Top | |
738 | @unnumbered Index | |
739 | ||
740 | @printindex cp | |
741 | ||
742 | @contents | |
743 | @bye |