On Wed, Jul 29, 2020 at 06:33:45PM +0200, Mark Wielaard wrote:
Yes, I think we have a winner!
gas generates a tiny bit of debuginfo even if you don't supply -g.
But... in 2.35 you can give the DWARF level you want.
The problem with not supplying -g (or --gdwarf-[VERSION]) is that the
dwarf_level is never set! And then gas will happily create an
.debug_info section with DWARF CUs that have a version of zero (!).
This, defaulting to version 4. Fixes it for me:
Older as versions emitted DWARF 2, so wouldn't that be a better default
and let gcc pass --gdwarf-? to as if it detects support at compile time
depending on gcc's default dwarf version or -gdwarf-N option?
Jakub