[PATCH] D149367: Emit the CodeView `S_ARMSWITCHTABLE` debug symbol for jump tables

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 14:22:24 PDT 2023

efriedma added inline comments.

Comment at: llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h:163
+  uint32_t EntriesCount;
It looks like the other classes initialize all the fields to zero.

Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3491
+                    "EK_Inline, EK_Custom32, EK_GPRel32BlockAddress, and "
+                    "EK_GPRel64BlockAddress should never be emitted for COFF");
+              case MachineJumpTableInfo::EK_BlockAddress:
dpaoliello wrote:
> efriedma wrote:
> > LLVM can target 32-bit ARM Windows.
> I wasn't seeing ARM32 hit this code before, but it looks like it was because of the assumption that the branch instruction wasn't the one to use the jump table value.
> I've fixed the code to handle ARM32 and added it to the tests, but there seems to be some bug where the offsets are always 0? If I run the test via `llc` then the correct labels appear in the debug info, but somewhere between `llc -filetype=obj` and `llvm-readobj` the offsets are lost...
In general, .secrel32 emits a relocation; `llvm-readobj --codeview` won't dump it, I think, but it should still be there.  What's the relocation pointing to?



More information about the llvm-commits mailing list