[clang] [llvm] [ASAN] Add "sanitized_padded_global" llvm ir attribute to identify sanitizer instrumented globals (PR #68865)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 08:11:46 PDT 2024


arsenm wrote:

> > (You can even place `.quad sym[0].hash; .long sym[0].size` in a section `SHF_LINK_ORDER` linking to the global variable for linker garbage collection.)
> > The runtime can build a map correlating hashes to sizes, which can be used to answer variable size queries.
> 
> AMD language runtimes provide queries for the size of device global symbols and functions to copy data to and from device global variables. Currently, runtime gets the needed information form the ELF symbol sizes in the symbol table. So, in #70166 We have come up with approach of adding two symbols (at the same offset but with different sizes) for the same global, one symbol which reports actual global size and other symbol which reports instrumented size.

Have you looked into switching to the suggested approach of having a separately emitted field? 

https://github.com/llvm/llvm-project/pull/68865


More information about the cfe-commits mailing list