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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to