[PATCH] D43959: [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 10:54:55 PST 2018


steven_wu accepted this revision.
steven_wu added a comment.
This revision is now accepted and ready to land.

LGTM.

The idea is to prevent LTO (ConstMerge pass) from merging global constants that has the same value, which has the same side-effect as linker merging two weak symbols that has ODR violation.

To be extra safe, there are some linkers that are capable of dedup functions and globals. Maybe a separate investigation to see if there is any linker dedup optimization can break this? Currently, ld64 doesn't dedup none weak symbols so it should be fine for now. Maybe check if lld does that?


Repository:
  rL LLVM

https://reviews.llvm.org/D43959





More information about the llvm-commits mailing list