On Mon, 28 Sep 2020 17:35:26 +0200, Jakub Jelinek wrote:
So, was this compiled by GCC or clang?
Fedora Koji package:
lldb-debuginfo-11.0.0-0.2.rc3.fc34.x86_64
GNU GIMPLE 10.2.1 20200916 (Red Hat 10.2.1-4) -m64 -mtune=generic -march=x86-64 -g -g -g
-O2 -O2 -O2 -O2 -fno-openmp -fno-openacc -fcf-protection=none -ffat-lto-objects
-fexceptions -fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -fPIC -ffunction-sections -fdata-sections -fltrans
-fplugin=annobin
A way out of this could be either to use comdat .debug_info etc.
sections
(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
soon:
https://whova.com/embedded/session/llvm_202010/1193947/
Jan