Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wesleywiser opened this issue Dec 21, 2021 · 0 comments
Open
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@wesleywiser
Copy link
Member

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)

@wesleywiser wesleywiser added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) labels Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

1 participant