[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/24321] Objcopy "--only-keep-debug" generates Bad Offset in

From: manojgupta at google dot com
Subject: [Bug binutils/24321] Objcopy "--only-keep-debug" generates Bad Offset in LOAD sections for lld built binaries
Date: Mon, 11 Mar 2019 23:09:24 +0000


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.

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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]