[PATCH] D50483: [SanitizerCoverage] Add associated metadata to PC guards.
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 14:37:52 PDT 2018
eugenis added a comment.
I don't understand what's going on.
!associated metadata does not do anything with link order. It prevents linker from discarding a global in some cases, that's all.
Are you relying on the fact that the number of guards is the same as the number of functions? I don't think that's a good idea, because linker GC is not guaranteed to be 100% perfect, and it can also be disabled (or rather not enabled).
================
Comment at: compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:230
+ assert(
+ PCs()[GuardIdx] - ModulePCTable[i].Start[j].PC < 100 &&
+ "PC table entry doesn't match address from PC guard callback");
----------------
Why 100?
================
Comment at: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:406
// so we need to prevent them from being dead stripped.
- if (TargetTriple.isOSBinFormatMachO())
- appendToUsed(M, GlobalsToAppendToUsed);
----------------
You are removing MachO-specific code. But !associated is ELF-specific. It has no effect on MachO. What's up with that?
https://reviews.llvm.org/D50483
More information about the llvm-commits
mailing list