<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - lld-link emits symbol data for global variables that were optimized out by /opt:ref"
   href="https://bugs.llvm.org/show_bug.cgi?id=39147">39147</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld-link emits symbol data for global variables that were optimized out by /opt:ref
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>brucedawson@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When running <a href="https://cs.chromium.org/chromium/src/tools/win/ShowGlobals/">https://cs.chromium.org/chromium/src/tools/win/ShowGlobals/</a> 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
<a href="https://drive.google.com/open?id=1aA5LngryRAoo7T-uLdV_4Y3gpOr42mBF">https://drive.google.com/open?id=1aA5LngryRAoo7T-uLdV_4Y3gpOr42mBF</a>

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

StrTable
kWebuiResources
ff_aac_eld_window_512_fixed
ff_aac_eld_window_480_fixed
g_kuiDequantCoeff8x8
instruction_table
kChromePolicyDetails
kPower10MantissaTable
ff_celt_pvq_u
gCurrencyList</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>