Skip to content

Make sure dead function stubs are always included in the final binary #92165

Open
@wesleywiser

Description

@wesleywiser

Currently, when generating dead function stubs for code coverage, we pick a CGU to put them in by looking for exported symbols which makes it more likely the linker will pull the CGU's object file into the final assembly. However, if the linker doesn't actually need any of the exported symbols in the object file, it won't include it in the final assembly. This matters for code coverage because without the dead function stubs being included in the final binary, the code coverage tools won't know about these functions and it will artificially inflate coverage numbers.

In order to truly resolve this, we need to make sure the object file (CGU) containing the dead function stubs is included in the final binary. This will probably require forcing these function symbols to be included via -u or /include linker args.

(Created based on discussions in #92142)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions