The requirement is to use GNU strip to discard the symbols from an object file, and save the symbols. Later on, if there are any core dumps of this object file, we have to include the symbols to check the core dumps. How can we accomplish this task? Thanks in advance!
Asked
Active
Viewed 268 times
2 Answers
1
The simple solution would be to keep a copy of the binary before you strip it. Then you can use the unstripped version to investigate the core dump as these binaries will be identical except for the stripped symbol information.
So, if you have a FOO binary, do something like:
cp FOO FOO.unstripped
strip FOO
then run FOO and when you investigate the coredump, use FOO.unstripped.

BjoernD
- 4,720
- 27
- 32
-
How can we create the unstripped and stripped version at the same time? – Derui Si Jul 31 '12 at 13:57
1
Different ways to get a "symbol file" are discussed here: How to generate gcc debug symbol outside the build target?
Actually, the linked question is very similar to this one.