This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold: No .debug_aranges section when linking with --gdb-index
- From: Martin Richtarsky <m at martinien dot de>
- To: Cary Coutant <ccoutant at gmail dot com>, Martin Richtarsky <ml at martinien dot de>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 29 Jan 2019 12:37:35 +0100 (CET)
- Subject: Re: gold: No .debug_aranges section when linking with --gdb-index
- References: <dbf45ea476d816809581348eb037ec0f-EhVcX1dJRwNeRwQRAQsKVxcwfgFLV15YQUBGAEFbWkA3VF0NQVpwH1FRQ15cRioDWllQQV5dWwFZ-webmailer1@server06.webmailer.hosteurope.de> <CAJimCsFrYKk=5ViCmUr_i_9wH1JfkqdO3Jsw58LkhuGGz0XauA@mail.gmail.com>
> > when I use gold with --gdb-index, the resulting binary is missing the
> > .debug_aranges section. The script below demonstrates the issue. lib1.so
> > is linked without --gdb-index and has .debug_aranges, but not
> > lib1_index.so. is this on purpose? .debug_aranges would be helpful for us
> > for fast callstack resolution.
> >
> > Interestingly lld handles it differently (you can also test it with the
> > script below, just set the path to lld binutils)
>
> Yes, it was on purpose. The .gdb_index section contains its own
> lookup-by-address table, making .debug_aranges redundant.
>
> DWARF-5 support should resolve this. The new fast-lookup tables in
> DWARF-5 provide the features of .gdb_index that are required for split
> debug without replacing the .debug_aranges section.
>
> If you want to use .gdb_index without stripping .debug_aranges, it
> would probably be best to add a new option.
>
> -cary
Hi Cary,
good to know, thanks. I have resolved it with a small patch to gold in the meantime, to not skip emitting .debug_aranges.
Best regards,
Martin
--
http://www.productive-cpp.com/