This change adds description of globals created by UBSan
instrumentation (UBSan handlers, type descriptors, filenames) to
llvm.asan.globals metadata, effectively "blacklisting" them. This can
dramatically decrease the data section in binaries built with UBSan+ASan,
as UBSan tends to create a lot of handlers, and ASan instrumentation
increases the global size to at least 64 bytes.
Details
Diff Detail
Event Timeline
lib/CodeGen/CGExpr.cpp | ||
---|---|---|
2179–2180 | I'm concerned about this one: these strings may be shared by other parts of the program, where ASan instrumentation is important. How much does instrumenting these strings cost us? |
lib/CodeGen/CGExpr.cpp | ||
---|---|---|
2179–2180 | Yeah, we might get false negatives on out-of-bound access to stuff like FILE. I don't think it's a big deal, though. We already create several global strings in ASan instrumentation (including the string with filename for the global, name for the global etc.) and call setUnnamedAddr(true), allowing to merge them. |
I'm concerned about this one: these strings may be shared by other parts of the program, where ASan instrumentation is important. How much does instrumenting these strings cost us?