Alexander Yermolovich via llvm-dev
2020-Oct-21 00:25 UTC
[llvm-dev] LLD: question about debug_info relocs with emit-relocs + gc-sections.
Hello. I have been looking in to what relocs are emitted when --emit-relcos and --gc-sections flags are set. Seems like relocs sections for .debug_* are not emitted. Looking into it the debug sections are marked live in MarkLive.cpp:MarkLive on first pass through all the inputSections, but their dependendSections are not marked as live. It then goes to rest of the algorithm that handles some special sections, but mainly deals with sections based on defined symbols in symtab. As the result when -gc-sections flag is set relocations for debug_* would not be in output. Is that intentional, or oversight? Thank You -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201021/a6c1699c/attachment.html>
David Blaikie via llvm-dev
2020-Oct-21 00:35 UTC
[llvm-dev] LLD: question about debug_info relocs with emit-relocs + gc-sections.
+Fangrui Song <maskray at google.com> Yeah, that sounds like a bug to me. On Tue, Oct 20, 2020 at 5:25 PM Alexander Yermolovich via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hello. > > I have been looking in to what relocs are emitted when --emit-relcos and > --gc-sections flags are set. > Seems like relocs sections for .debug_* are not emitted. > Looking into it the debug sections are marked live in > MarkLive.cpp:MarkLive on first pass through all the inputSections, but > their dependendSections are not marked as live. > It then goes to rest of the algorithm that handles some special sections, > but mainly deals with sections based on defined symbols in symtab. > > As the result when -gc-sections flag is set relocations for debug_* would > not be in output. Is that intentional, or oversight? > > Thank You > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201020/0be8918f/attachment.html>
Fāng-ruì Sòng via llvm-dev
2020-Oct-21 01:13 UTC
[llvm-dev] LLD: question about debug_info relocs with emit-relocs + gc-sections.
Thanks for the report! The bug can be generalized to all non-SHF_ALLOC SHT_REL[A] (due to --emit-relocs) and SHF_LINK_ORDER. https://reviews.llvm.org/D89841 will fix it. On Tue, Oct 20, 2020 at 5:35 PM David Blaikie <dblaikie at gmail.com> wrote:> > +Fangrui Song > > Yeah, that sounds like a bug to me. > > On Tue, Oct 20, 2020 at 5:25 PM Alexander Yermolovich via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> Hello. >> >> I have been looking in to what relocs are emitted when --emit-relcos and --gc-sections flags are set. >> Seems like relocs sections for .debug_* are not emitted. >> Looking into it the debug sections are marked live in MarkLive.cpp:MarkLive on first pass through all the inputSections, but their dependendSections are not marked as live. >> It then goes to rest of the algorithm that handles some special sections, but mainly deals with sections based on defined symbols in symtab. >> >> As the result when -gc-sections flag is set relocations for debug_* would not be in output. Is that intentional, or oversight? >> >> Thank You >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- 宋方睿