[PATCH] Add a flag to clang to support forward-edge control-flow integrity

Tom Roeder tmroeder at google.com
Tue Jul 1 13:39:03 PDT 2014


This patch adds a clang flag -ffcfi that enables forward-edge
control-flow integrity. It depends on the (not yet reviewed) FCFI
patch at http://reviews.llvm.org/D4167.

Specifically, it sets FCFI in llvm::TargetOptions when called LLVM
directly, and it passes the LLVM flag -fcfi through LTO to LLVM when
using gold.

This patch is related to the discussion on llvm-commits about my patch
http://reviews.llvm.org/D4128, which would have added a
-jump-table-all flag to LLVM directly; that flag would have set
unnamed_addr and jumptable on all address-taken functions. Instead,
this patch adds a flag that sets those attributes at CodeGen time
under clang, since unnamed_addr changes the semantics of functions
it's applied to.

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffcfi.patch
Type: text/x-patch
Size: 6322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140701/bb4b0ff8/attachment.bin>


More information about the cfe-commits mailing list