When using objcopy --only-keep-debug to generate a separate symbolic debugging information file (as specified at http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html ), .eh_frame doesn't appear to be copied correctly. The section is present and is the same size as that of the originating file, but doesn't contain valid CIE/FDEs, instead showing only: Contents of the .eh_frame section: 00000000 ZERO terminator 00000004 ZERO terminator 00000008 ZERO terminator [...etc.] This problem doesn't seem to be exhibited for .debug_frame though. However, since some newer versions of gcc only output .eh_frame by default, this can be a bit troublesome for debugging.
.eh_frame is not a debug section. It is a loaded section so it will never be stripped from the original object.
(In reply to comment #1) > .eh_frame is not a debug section. It is a loaded section so it will never be > stripped from the original object. 1) Then why does it appear in the resulting .debug file at all? and 2) This still leaves the problem that on e.g. gcc 4.6.2, -g only outputs .eh_frame. I've looked through the bug database and this appears to be deliberate since the contents carry so much overlap with .debug_frame. Therefore, if .debug_frame isn't going to be output, then .eh_frame needs to be correctly copied, else there is no way for the debugger to unwind the call frame.
.eh_frame is handled like all other non-debug sections.
Not a bug