[PATCH] D44543: [AsmPrinter] Emit .weak directive for weak linkage on COFF

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 16:14:11 PDT 2018


espindola added a comment.

In https://reviews.llvm.org/D44543#1039582, @smeenai wrote:

> Yeah, you're right. Introducing a new linkage type for `__attribute__((weak))` definitions is probably the way to go then?


I don't think so.

The cases Reid lists are not really weak when targeting COFF.  If they were not in a comdat we would get a linker error.

The solution I think is to have weak in the IR really mean weak (I.E., this change is fine once the dependencies are done) but change the producers to not use weak/linkonce if they don't want weak semantics.

This would require first splitting linkonce out of linkage to be just a can_drop_if_unused bit.


Repository:
  rL LLVM

https://reviews.llvm.org/D44543





More information about the llvm-commits mailing list