[PATCH] D61615: [COFF] Use COFF stubs for extern_weak functions

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 11:21:33 PDT 2019


rnk marked an inline comment as done.
rnk added a comment.

Thanks! I'll see about AArch64. It would be nice for this use of `__attribute__((weak))` declarations to work there as well.



================
Comment at: llvm/test/CodeGen/X86/extern_weak.ll:20-21
+; DARWIN-LABEL: _bar:
+; DARWIN: cmpl $0, L_foo$non_lazy_ptr
+; DARWIN: jmp _foo ## TAILCALL
+
----------------
smeenai wrote:
> 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?
Yes, it's basically the same thing as a COFF stub or a GOT entry: a global pointer that points to `_foo`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61615/new/

https://reviews.llvm.org/D61615





More information about the cfe-commits mailing list