This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: binutils/gdb vs compressed debug ELF sections
- From: Pedro Alves <palves at redhat dot com>
- To: Mark Wielaard <mark at klomp dot org>, Matthias Klose <doko at ubuntu dot com>, nickc at redhat dot com, GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 26 Feb 2019 20:19:56 +0000
- Subject: Re: binutils/gdb vs compressed debug ELF sections
- References: <9fd4346efba926051011471017b5d683faacc37d.camel@klomp.org>
(Really adding gdb-patches@ this time.)
Hi all,
On 02/19/2019 01:37 PM, Mark Wielaard wrote:
> Hi Pedro and Nick and Matthias,
>
> I was talking to Matthias and Nick (separately) about the bugs in
> binutils wrt compressed debug ELF sections. Luckily Fedora doesn't use
> compressed debug ELF sections by default, so the issue isn't such a big
> deal. But apparently Debian and Ubuntu do use compressed debug ELF
> sections by default, so there it is much more of an issue.
>
> The problem is simply that when using the new style gabi compressed ELF
> sections binutils/bfd has a bug that will set the alignment of the
> section header wrong and it will simply ignore the alignment of the
> (de)compressed data. This is somewhat understandable because the old
> style GNU compressed headers didn't deal with alignment issues at all.
> But it is what we corrected when the ELF compressed sections were
> standardized. This was fixed in binutils 2.32.
>
> And since elfutils 0.175 libelf will correct the alignment of gabi
> compressed section headers when it writes out an ELF file (for example
> when using eu-strip or the kernel objtool).
>
> Unfortunately binutils also had another bug that would reject gabi
> style ELF compressed sections unless the alignment of the ELF section
> header was equal to the alignment of the (de)compressed data. That was
> a weird check because that would normally not be the case (except if
> you did as buggy binutils and always set the alignment to 1 for
> everything...).
>
> Nick just backported both fixes to the binutils 2.31 branch:
>
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=88739f776b733b0b84600b283417f862a010bb5d
>
> Since this fix is in bfd it would be nice to get gdb to also backport
> that fix to a stable release branch. Otherwise gdb will reject any
> newly created ELF compressed sections by either elfutils or binutils.
>
> Does gdb have a stable branch? And could it backport that bfd fix?
> That would be really helpful for distributions like Debian/Ubuntu which
> can then upgrade elfutils, binutils and gdb together to make sure
> everything keeps working.
Seems reasonable. I've now merged Nick's commit 88739f776b73 to
the gdb 8.2 branch.
Thanks,
Pedro Alves