[llvm-bugs] [Bug 39147] New: lld-link emits symbol data for global variables that were optimized out by /opt:ref

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 1 17:26:12 PDT 2018


            Bug ID: 39147
           Summary: lld-link emits symbol data for global variables that
                    were optimized out by /opt:ref
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: brucedawson at chromium.org
                CC: llvm-bugs at lists.llvm.org

When running https://cs.chromium.org/chromium/src/tools/win/ShowGlobals/ on the
latest Canary chrome_child.dll.pdb I noticed that some of the large globals
were listed as being in section 0. I was trying to make sure that as much data
as possible was in the read-only section (section 2) and this section number
confused me.

One of the variables in question was kWebuiResources. ShowGlobals shows this as
being in section 2 in chrome.dll (browser process) and I confirmed this using
the debugger and vmmap, however when I tried to repeat this test in the
renderer process the debugger claimed that kWebuiResources did not exist.

Checking the .rsp for chrome_child.dll I see that
obj/ui/resources/webui_resources_grd/webui_resources_map.obj is indeed linked
in but the linker presumably then discards kWebuiResources. It appears that
when it discards the symbol it still emits a debug record for it, leading to
this confusion.

This isn't a serious bug but it would seem worthwhile to avoid emitting debug
information for deleted data. This will shrink the PDB slightly and will avoid
confusion. But, not high priority.

Any recent published PDB for chrome_child.dll.pdb can be used to investigate
this but the one I was using has been uploaded to Google drive and is
accessible to Google employees at

The top-ten (by size) symbols that this applies to are:


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/20181002/cfbd1f11/attachment.html>

More information about the llvm-bugs mailing list