https://sourceware.org/bugzilla/show_bug.cgi?id=24321
Manoj Gupta <manojgupta at google dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID |--- --- Comment #2 from Manoj Gupta <manojgupta at google dot com> --- Here is the problem: --only-keep-debug is supposed to preserve the section headers. But it is not doing so. Our tooling and public tools like Linux perf relies on section headers in splitdebug files to match original binary. Linking to the documentation of --only-keep-debug in objcopy at https://sourceware.org/binutils/docs/binutils/objcopy.html where it says that sections headers are preserved. " --only-keep-debug Strip a file, removing contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact. In ELF files, this preserves all note sections in the output. Note - the section headers of the stripped sections are preserved, including their sizes, but the contents of the section are discarded. The section headers are preserved so that other tools can match up the debuginfo file with the real executable, even if that executable has been relocated to a different address space. " Note: Sorry about causing the in --keep-debug". I just wanted to illustrate that eu-strip preserves the headers correctly. eu-strip however does not support --only-keep-debug" and has a different way of generating splitdebug files which is via "--kep-debug" -f <outfile> option. I am NOT using "--keep-debug" option with GNU strip when generating the splitdebug files. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils