Make sure dead function stubs are always included in the final binary #92165
Labels
A-code-coverage
Area: Source-based code coverage (-Cinstrument-coverage)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
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)
The text was updated successfully, but these errors were encountered: