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