[PATCH] D29104: Add !associated metadata.

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 17:09:09 PST 2017


eugenis added a comment.

See https://reviews.llvm.org/D28481 for the previous attempt at this.

In short, ASan emits "metadata" globals for each original global, and needs them to be alive as long as the corresponding original global is. We can not put a reference to the "metadata" global into the original global, because that would kill .bss (among other things).

The only part of this CL that we really need is the one that emits SHF_ASSOCIATED for "metadata" globals. The GlobalDCE part mirrors the linker handling of SHF_ASSOCIATED. As an alternative, we could add all "metadata" globals to llvm.compiler.used, but that would suppress some optimizations.

See this discussion of SHF_ASSOCIATED:
https://groups.google.com/d/msg/generic-abi/_CbBM6T6WeM/LZnqx1KZAQAJ


Repository:
  rL LLVM

https://reviews.llvm.org/D29104





More information about the llvm-commits mailing list