[COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32
commite2d167823cc2dac88b43226855f365f68f2833b1
authorMartin Storsjo <martin@martin.st>
Tue, 29 Jan 2019 09:36:48 +0000 (29 09:36 +0000)
committerMartin Storsjo <martin@martin.st>
Tue, 29 Jan 2019 09:36:48 +0000 (29 09:36 +0000)
tree280a34f9d50343482bedf9d2cee194618d7b432d
parent4f8931ee2e4b52b5c9e1cf2c3930263e39a9146d
[COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32

Windows ARM64 has PIC relocation model and uses jump table kind
EK_LabelDifference32. This produces jump table entry as
".word LBB123 - LJTI1_2" which represents the distance between the block
and jump table.

A new relocation type (IMAGE_REL_ARM64_REL32) is needed to do the fixup
correctly if they are in different COFF section.

This change saves the jump table to the same COFF section as the
associated code. An ideal fix could be utilizing IMAGE_REL_ARM64_REL32
relocation type.

Patch by Tom Tan!

Differential Revision: https://reviews.llvm.org/D57277

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352465 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64AsmPrinter.cpp
lib/Target/AArch64/AArch64TargetMachine.cpp
test/CodeGen/AArch64/win64-jumptable.ll [new file with mode: 0644]