summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2018-01-08 16:33:42 +0000
committerAdrian McCarthy <amccarth@google.com>2018-01-08 16:33:42 +0000
commitcf6e6c82c1ca243c3be191c59409d26f76ec8d38 (patch)
tree5c0a022d0d1b2d1c574af89040a379b6227deb0e /llvm/lib/MC/MCObjectFileInfo.cpp
parentf02ad15ff1dd84c73958c002966e3b61f8539f18 (diff)
downloadbcm5719-llvm-cf6e6c82c1ca243c3be191c59409d26f76ec8d38.tar.gz
bcm5719-llvm-cf6e6c82c1ca243c3be191c59409d26f76ec8d38.zip
Emit Function IDs table for Control Flow Guard
Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs of functions that have their address taken into a section named .gfids$y for compatibility with Microsoft's Control Flow Guard feature. Differential Revision: https://reviews.llvm.org/D40531 llvm-svn: 322005
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index a6b5c43f1d2..f0f4dee8fc1 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -819,6 +819,11 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
SXDataSection = Ctx->getCOFFSection(".sxdata", COFF::IMAGE_SCN_LNK_INFO,
SectionKind::getMetadata());
+ GFIDsSection = Ctx->getCOFFSection(".gfids$y",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ,
+ SectionKind::getMetadata());
+
TLSDataSection = Ctx->getCOFFSection(
".tls$", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ |
COFF::IMAGE_SCN_MEM_WRITE,
OpenPOWER on IntegriCloud