A COFF stub indirects the reference to a symbol through memory. A
.refptr.$sym global variable pointer is created to refer to $sym.
Typically mingw uses these for external global variable declarations,
but we can use them for weak function declarations as well.
Updates the dso_local classification to add a special case for
extern_weak symbols on COFF in both clang and LLVM.
Fixes PR37598
I'm not parsing this too well (it's not quite clear what the relation between L_foo$non_lazy_ptr and _foo is, but I'm assuming $non_lazy_ptr is some Darwin thing that gets synthesized by the .weak_reference _foo), but I think you're just enhancing the Darwin test rather than changing that codegen in any way?