google / gwpsan

GWPSan: Sampling-Based Sanitizer Framework
Apache License 2.0
307 stars 9 forks source link

core/semantic_metadata: Support multi-version semantic metadata #21

Closed copybara-service[bot] closed 4 months ago

copybara-service[bot] commented 4 months ago

core/semantic_metadata: Support multi-version semantic metadata

The implementation had been assuming that each module will only call the __sanitizermetadata*_{add,del} constructors and destructors once.

To support multi-version semantic metadata, we have to loosen this assumption, as different versions of semantic metadata will end up in separate sections with distinct constructor and destructor calls. In particular, combining TUs with different code models will always result in different versions of semantic metadata that need to be parsed separately.

Multi-version semantic metadata are correctly handled by LLVM since this commit: https://github.com/llvm/llvm-project/commit/f5b9e11eb8ad