With CONFIG_GCOV_KERNEL, the Linux kernel indirectly calls the
__llvm_gcov_* functions generated by LLVM. With -fsanitize=kcfi,
these calls are made from instrumented code and fail indirect
call checks as they don't have !kcfi_type metadata. Similarly
to D138945, set type metadata for these functions to allow GCOV
and KCFI to be both enabled.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
Ensuring that every instrumentation works with kcfi is a lot of work on the compiler side (think that another instrumentation technique comes up, we need to update O(n) existing instrumentation passes) and I don't quite agree that it's compiler's responsibility.
But if sanitizers and gcov are all, I think it's fine...
llvm/include/llvm/Transforms/Utils/ModuleUtils.h | ||
---|---|---|
45 | Used | |
llvm/test/Transforms/GCOVProfiling/kcfi.ll | ||
26 | This comment should be moved to the top. |
Used