[COFF] Add MC support for emitting IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY symbols
commit10c17c97ebaf81ac26f6830e51a7a57ddcf63cd2
authorEli Friedman <efriedma@quicinc.com>
Mon, 17 Apr 2023 20:15:46 +0000 (17 13:15 -0700)
committerEli Friedman <efriedma@quicinc.com>
Mon, 17 Apr 2023 20:17:25 +0000 (17 13:17 -0700)
tree4a7e6b501f6e0e44e1196d18cace1b80e7c01587
parentb0b2b2e047caa5a7c4b7e15d4425493f2df18d79
[COFF] Add MC support for emitting IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY symbols

This is mostly useful for ARM64EC, which uses such symbols extensively.

One interesting quirk of ARM64EC is that we need to be able to emit weak
symbols that point at each other (so if either symbol is defined
elsewhere, both symbols point at the definition).  This required a few
changes to the way we handle weak symbols on Windows.

Differential Revision: https://reviews.llvm.org/D145208
14 files changed:
llvm/include/llvm/MC/MCDirectives.h
llvm/include/llvm/MC/MCSymbol.h
llvm/include/llvm/MC/MCSymbolCOFF.h
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCELFStreamer.cpp
llvm/lib/MC/MCExpr.cpp
llvm/lib/MC/MCMachOStreamer.cpp
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/MC/MCParser/COFFAsmParser.cpp
llvm/lib/MC/MCWinCOFFStreamer.cpp
llvm/lib/MC/WinCOFFObjectWriter.cpp
llvm/test/MC/COFF/addrsig.s
llvm/test/MC/COFF/alias.s
llvm/test/MC/COFF/weak-anti-dep.s [new file with mode: 0644]