Red Hat ENTERPRISE LINUX 4 - USING BINUTILS Using Instructions page 26

Using binutils, the gnu binary utilities
Hide thumbs Also See for ENTERPRISE LINUX 4 - USING BINUTILS:
Table of Contents

Advertisement

20
-add-gnu-debuglink=
Creates a .gnu_debuglink section which contains a reference to
the output file.
-only-keep-debug
Strip a file, removing any sections that would be stripped by
debugging sections.
The intention is that this option will be used in conjunction with
create a two part executable. One a stripped binary which will occupy less space in RAM and
in a distribution and the second a debugging information file which is only needed if debugging
abilities are required. The suggested procedure to create these files is as follows:
1. Link the executable as normal. Assuming that is is called
2. Run
objcopy -only-keep-debug foo foo.dbg
ging info.
3. Run
objcopy -strip-debug foo
4. Run
objcopy -add-gnu-debuglink=foo.dbg foo
into the stripped executable.
Note - the choice of
-only-keep-debug
1. Link the executable as normal.
2. Copy
foo
3. Run
objcopy -strip-debug foo
4. Run
objcopy -add-gnu-debuglink=foo.full foo
ie the file pointed to by the
to be a file created by the
-V
-version
Show the version number of
-v
-verbose
Verbose output: list all object files modified. In the case of archives,
bers of the archive.
-help
Show a summary of the options to
-info
Display a list showing all architectures and object formats available.
path-to-file
as an extension for the debug info file is arbitrary. Also the
.dbg
step is optional. You could instead do this:
to
foo.full
-add-gnu-debuglink
-only-keep-debug
objcopy
objcopy
to create a stripped executable.
can be the full executable. It does not have
switch.
.
.
Chapter 4. objcopy
path-to-file
and leaving the
-strip-debug
-add-gnu-debuglink
then...
foo
to create a file containing the debug-
to add a link to the debugging info
objcopy -V
and adds it to
to
lists all mem-

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents