OSDN Git Service

[COFF] Emit @feat.00 on 64-bit and set the CFG bit when emitting guardcf tables
authorHans Wennborg <hans@hanshq.net>
Wed, 19 Sep 2018 09:58:30 +0000 (09:58 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 19 Sep 2018 09:58:30 +0000 (09:58 +0000)
commitc75b449af658351186d2832909a8a28800600312
tree6efa6c2f34c6407a0da14492027ad6743c2b967d
parent94083e0671517548a7c8bbb4812e73f9aec7a11d
[COFF] Emit @feat.00 on 64-bit and set the CFG bit when emitting guardcf tables

The 0x800 bit in @feat.00 needs to be set in order to make LLD pick up
the .gfid$y table. I believe this is fine to set even if we don't emit
the instrumentation.

We haven't emitted @feat.00 on 64-bit before. I see that MSVC does emit
it, but I'm not entirely sure what the default value should be. I went
with zero since that seems as safe as not emitting the symbol in the
first place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342532 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86AsmPrinter.cpp
test/CodeGen/WinCFGuard/cfguard.ll