[PATCH] gas: Fix .debug_info CU header for --gdwarf-5
Mark Wielaard
mark@klomp.org
Thu Aug 6 11:35:50 GMT 2020
Hi,
On Wed, Aug 05, 2020 at 11:04:47PM -0700, Fangrui Song wrote:
> On 2020-08-04, Alan Modra via Binutils wrote:
> > On Mon, Aug 03, 2020 at 02:37:27AM +0200, Mark Wielaard wrote:
> > > DWARF5 CU headers have a new unit type field and move the abbrev offset
> > > to the end of the header.
> > >
> > > gas/ChangeLog:
> > >
> > > * dwarf2dbg.c (out_debug_info): Emit unit type and abbrev offset
> > > for DWARF5.
> > > * gas/testsuite/gas/elf/dwarf-4-cu.d: New file.
> > > * gas/testsuite/gas/elf/dwarf-4-cu.s: Likewise.
> > > * gas/testsuite/gas/elf/dwarf-5-cu.d: Likewise.
> > > * gas/testsuite/gas/elf/dwarf-5-cu.s: Likewise.
> > > * testsuite/gas/elf/elf.exp: Run dwarf-4-cu and dwarf-5-cu.
> >
> > OK.
>
> WoW! So .debug_info -gdwarf-5 had been broken until you fixed it yesterday... Thanks!
Yes, but most gas users (DWARF producers) will create the .debug_info
themselves and don't rely on gas to produce it. Also it was only
introduced in 2.35 which has only been released a few days ago, so
nobody had been using the new flag yet.
Maybe that means this patch needs to be backported to the 2.35
branch. I never did that, so if that is a good idea, please let me
know how (is there a branch/tag against which to push?)
> I assume that 7.5.1.2 Skeleton and Split Compilation Unit Headers is
> still not supported: they have a dwo_id field
No, not directly by gas. And I don't think it makes much sense, since
the debug_info DIE trees gas produces are really small, when you would
produce split dwarf for them the overhead (an extra section,
signature, CU header and DIE, possibly in a separate file) would be
twice as big as the actual data.
Cheers,
Mark
More information about the Binutils
mailing list