[llvm-bugs] [Bug 49155] New: Consider using mergeable section for filenames in coverage mapping

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 12 00:38:41 PST 2021


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

            Bug ID: 49155
           Summary: Consider using mergeable section for filenames in
                    coverage mapping
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: phosek at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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).

-- 
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/20210212/f916328d/attachment.html>


More information about the llvm-bugs mailing list