On Wed, Sep 19, 2018 at 8:35 PM Venkata Ramanaiah Nalamothu via lldb-dev <lldb-dev@lists.llvm.org> wrote: > > Hi, > > After compiling an example.cpp file with "-c -ffunction-sections" and linking > with "--gc-sections" (used ld.lld), I am still seeing debug info for the > sections deleted by garbage collector in the generated executable. > > Are there any compiler/linker options and/or other tools in LLVM to get rid > of the above mentioned unneeded debug info? > > If such options does not exist, what needs to be changed in the linker (lld)? >
It's not easy. It's also format dependent. I assume you're talking about ELF here. In first approximation, the linker does not GC section marked without SHF_ALLOC. At some point we did an analysis and in practice it turns out most of them are debug info. I seem to recall that Cary Coutant had a proposal for ld.gold on how to reclaim them without breaking, but I can't find it easily (cc:ing him directly). Thanks, -- Davide _______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev