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

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

Advertisement

Chapter 9. strip
-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
strip -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 for
-v
-verbose
Verbose output: list all object files modified. In the case of archives,
of the archive.
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
.
strip
-strip-debug
foo
to create a file containing the debug-
to create a stripped executable.
to add a link to the debugging info
can be the full executable. It does not have
switch.
and leaving the
-add-gnu-debuglink
then...
lists all members
strip -v
35
to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents