[llvm-bugs] [Bug 48245] New: -fwhole-program-vtables causes unused vtables to be kept (breaks --gc-sections)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 20 11:12:11 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48245

            Bug ID: 48245
           Summary: -fwhole-program-vtables causes unused vtables to be
                    kept (breaks --gc-sections)
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: agrieve at google.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Not a confirmed theory, but it seems like the most plausible explanation for
what we're seeing.

When enabling -fwhole-program-vtables for Chrome on Android (arm32), the number
of relocations goes up instead of down.

I created a SuperSize report with --relocations, which produces a report of
just symbols that have relocations applied to them, and where their size is
replaced by the count of relocations that are applied to them.

Report:
https://chrome-supersize.firebaseapp.com/viewer.html?load_url=https%3A%2F%2Fstorage.googleapis.com%2Fchrome-supersize%2Foneoffs%2F1544ee488cda7704a1b001454fa81f09e66ac00d_5a6a344f9cb70dc3adf404ab99b1b4fce943b6ed.sizediff&byteunit=B&diff_mode=on

I chatted with pcc at google.com, and we think the problem is that
-fwhole-program-vtables removes all section names in favor of a few
".L__unnamed_#" sections, and that's what's breaking --gc-sections's ability to
remove unused virtual classes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201120/c58a720f/attachment.html>


More information about the llvm-bugs mailing list