[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
Mon Mar 19 10:18:35 PDT 2018


espindola added a comment.

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

> @rnk, does that make sense to you?
>
> I'm not very familiar with this part of LLVM; I ran into this issue because an internal user needed `__attribute__((weak))` semantics on COFF, and having inline assembly with a manual `.weak` directive for a gigantic mangled C++ name isn't the greatest workaround (though it does work). I'm happy to follow through if there's agreement on how to proceed here though.
>
> I do have a question though. `linkonce` doesn't appear to do anything by itself on COFF right now. E.g. if I have
>
>   define linkonce void @f() {
>     ret void
>   }
>
>
> and run `bin/llc -mtriple=x86_64-windows-msvc` on it, the object file produced is the same both with and without the `linkonce`.


This is almost certainly an oversight. I don't think I have ever seen a plain linkonce used in practice, so it was probably never implemented.


Repository:
  rL LLVM

https://reviews.llvm.org/D44543





More information about the llvm-commits mailing list