An issue was reported to me that involved using “-fsanitize-coverage=trace-pc-guard -flto=thin”.
Currently, what seems to happen is that the sancov instrumentation gets inserted at compile-time, then at LTO-time some instrumented functions get erased. The associated sancov globals don’t get erased, though. The end result is that some sancov globals have null MD_associated metadata, and the linker prints an error like “incompatible section flags for __sancov_guards”. This seems to happen for any program where a function is erased at link time. For example, the following program:
void testfn(){}
__attribute((visibility(“hidden”))) void testfn2(){}
I’m not sure how __sancov_guards is supposed to work in this context. Is LTO misbehaving, or is SanitizerCoverage making bad assumptions?
-Eli
I believe i have reported a related issue in
https://bugs.llvm.org/show_bug.cgi?id=41734
"-fsanitize-coverage=inline-8bit-counters + ThinLTO = lld crash"
An issue was reported to me that involved using “-fsanitize-coverage=trace-pc-guard -flto=thin”.
Currently, what seems to happen is that the sancov instrumentation gets inserted at compile-time, then at LTO-time some instrumented functions get erased. The associated sancov globals don’t get erased, though. The end result is that some sancov globals have null MD_associated metadata, and the linker prints an error like “incompatible section flags for __sancov_guards”. This seems to happen for any program where a function is erased at link time. For example, the following program:
void testfn(){}
__attribute((visibility("hidden"))) void testfn2(){}
I’m not sure how __sancov_guards is supposed to work in this context. Is LTO misbehaving, or is SanitizerCoverage making bad assumptions?
-Eli
Roman