[PATCH] D47841: [asan] Instrument comdat globals on COFF targets

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 12:58:10 PDT 2018


rnk added a comment.

In https://reviews.llvm.org/D47841#1123978, @pcc wrote:

> > there is no reason that we cannot also do this for ELF.
>
> I thought we were already using `!associated` (which translates into `SHF_LINK_ORDER`) on ELF?


We use that in addition to setting the comdat group. I think !associated is only really needed to make --gc-sections work. The comdat group is what allows us to mix instrumented and uninstrumented globals and not worry about which one prevails.

Anyway, it's just a matter of changing isOSBinFormatCOFF to supportsCOMDAT() to enable it for ELF. I've gotten in trouble in the past for claiming to know more about ELF than I really do, so I'd rather commit that as a separate, easily revertable one line change.


https://reviews.llvm.org/D47841





More information about the llvm-commits mailing list