[PATCH] D48690: lld-link: align sections to 16 bytes if referenced from the gfids table

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 17:20:36 PDT 2018


inglorion created this revision.
inglorion added reviewers: ruiu, hans, thakis, zturner.

Control flow guard works best when targets it checks are 16-byte aligned.
Microsoft's link.exe helps ensure this by aligning code from sections
that are referenced from the gfids table to 16 bytes when linking with
-guard:cf, even if the original section specifies a smaller alignment.
This change implements that behavior in lld-link.

Fixes PR857012.


https://reviews.llvm.org/D48690

Files:
  lld/COFF/Writer.cpp
  lld/test/COFF/Inputs/guardcf-align-foobar.yaml
  lld/test/COFF/guardcf-align.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48690.153218.patch
Type: text/x-patch
Size: 3834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180628/2971a223/attachment.bin>


More information about the llvm-commits mailing list