[compiler-rt] [asan] Optimize initialization order checking (PR #101837)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 21:08:13 PDT 2024
MaskRay wrote:
The current commit message can use some rewording. Perhaps:
---
The pair `__asan_before_dynamic_init` and `__asan_after_dynamic_init` is executed for each TU.
`__asan_after_dynamic_init` unpoisons all globals, which makes the time complexity O(N^2) where N is the maximum of the global count and the TU count.
This is expensive for large binaries.
This patch decreases the time complexity to O(N) when lld and static runtime is used on SANITIZER_CAN_USE_PREINIT_ARRAY platforms.
This requires:
* Enabling incremental poisoning (`__asan_before_dynamic_init` since #101597).
* Making most `__asan_after_dynamic_init` calls do nothing.
https://github.com/llvm/llvm-project/pull/101837
More information about the llvm-commits
mailing list