-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Make sure dead function stubs are always included in the final binary #92165
Copy link
Copy link
Open
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
-uor/includelinker args.(Created based on discussions in #92142)