<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 - Consider using mergeable section for filenames in coverage mapping"
   href="https://bugs.llvm.org/show_bug.cgi?id=49155">49155</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Consider using mergeable section for filenames in coverage mapping
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the current coverage mapping format v5, we store mapping to together with
the list of filename in the __llvm_covmap section. Since v4, the list of
filenames can be also optionally zlib compressed.

The current format has one downside: there can be duplicate filenames in the
list of filenames across translation units, in C/C++ this is especially likely
for headers, but linker cannot deduplicate these.

This could be improved by adopting a solution similar to DWARF: we could store
filenames in a separate mergeable strings section (SHF_MERGE|SHF_STRINGS in
ELF), for example `__llvm_covstr`. This would allow linker to deduplicate
strings across translation units. We would also need to modify the coverage
mapping to use offsets into the `__llvm_covstr` section instead of indices.

The only downside of this approach is that we would be no longer able to
compress the filenames. It's possible that the size reduction due to
deduplication is going to be greater than the one from compression. This is
something we should investigate and experiment with.

We could also consider teaching linkers how to automatically compress output
sections as a generalization of the approach currently used for DWARF .debug_
sections (for example, when all input sections have the `SHF_COMPRESSED` flag,
the linker could automatically compress the output section).</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>