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: Cary Coutant <ccoutant at gmail dot com>
- To: Martin Richtarsky <ml at martinien dot de>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 28 Jan 2019 17:32:56 -0800
- Subject: Re: gold: No .debug_aranges section when linking with --gdb-index
- References: <dbf45ea476d816809581348eb037ec0f-EhVcX1dJRwNeRwQRAQsKVxcwfgFLV15YQUBGAEFbWkA3VF0NQVpwH1FRQ15cRioDWllQQV5dWwFZ-webmailer1@server06.webmailer.hosteurope.de>
> 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