rjmccall added a comment. In https://reviews.llvm.org/D46665#1102348, @rsmith wrote:
> In https://reviews.llvm.org/D46665#1102290, @rjmccall wrote: > > > I believe static and dynamic linkers — at least on ELF and Mach-O — will > > always drop weak symbols for strong ones. Now, I think that isn't LLVM's > > posted semantics for linkonce_odr, but to me that means that LLVM's > > semantics are inadequate, not that we should decline to take advantage of > > them. > > > > If we can't rely on that, it probably means that the type name symbol for > > class types always has to be linkonce_odr, even if it's for a type with a > > key function. > > > That all makes sense to me. (But I think `weak_odr` would be more formally > correct, even though the symbol will never actually be discarded as it's > referenced from the type_info and vtable.) Yes, of course. > The rule that ASan is using is that if there is an `external` definition for > a global variable, there should not be any other definitions for that symbol, > which seems right given LLVM's semantics, but wrong here. I agree. > For now, the simplest thing to do seem to be to weaken `external` linkage to > `weak_odr` for the type info name. Yes. Repository: rC Clang https://reviews.llvm.org/D46665 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits