[PATCH] D107784: Fix SEH table addresses for Windows

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 14:18:52 PDT 2021


rnk added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/WinException.cpp:333
 const MCExpr *WinException::getLabel(const MCSymbol *Label) {
-  if (isAArch64)
-    return MCSymbolRefExpr::create(Label, MCSymbolRefExpr::VK_COFF_IMGREL32,
----------------
I think you've lost this ARM change unintentionally. For AArch64, we don't bias the label forward. However, that seems wrong to me based on MSVC's output:
https://gcc.godbolt.org/z/3TxMfqoTh

MSVC inserts a `nop` instruction after the `bl` instruction implementing the call, and if I read the ip2state table correctly, the ip2state entry is the address following the nop instruction. So, I strongly suspect there is a bug here for ARM, but it's an existing problem.

You can see in the history that this code changed in 2018, we used to have a getLabelPlusOne method, but it was renamed:
https://reviews.llvm.org/D50166


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

https://reviews.llvm.org/D107784



More information about the llvm-commits mailing list