gold: No .debug_aranges section when linking with --gdb-index

Martin Richtarsky m@martinien.de
Tue Jan 29 11:37:00 GMT 2019


> > 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/



More information about the Binutils mailing list