On Mon, Sep 28, 2020 at 05:46:08PM +0200, Jan Kratochvil wrote:
> A way out of this could be either to use comdat .debug_info etc.
> (but that would result in quite large increase of *.o file sizes), or let
> the linker or a tool like DWZ discard or simplify such DIEs.
> I don't see how could you see at compile time that the linker will not
> choose the particular copy.
Another option is to use clang which should have such optimization implemented
If you do it on the compiler side, you'll get a lot of those pesky partial
units you so hate on the lldb side.