]> granicus.if.org Git - clang/commit
[Attr] Add support for the `ms_hook_prologue` attribute.
authorCharles Davis <cdavis5x@gmail.com>
Mon, 8 Aug 2016 21:03:39 +0000 (21:03 +0000)
committerCharles Davis <cdavis5x@gmail.com>
Mon, 8 Aug 2016 21:03:39 +0000 (21:03 +0000)
commit7d3d1e6b34653fb8be0f350caec788bc31c3bf95
treede4a4882dcac12c8465eedea763eb53e6c57396c
parent50d23ea322eeef0e6290f5743f014ecdd1c12e8f
[Attr] Add support for the `ms_hook_prologue` attribute.

Summary:
Based on a patch by Michael Mueller.

This attribute specifies that a function can be hooked or patched. This
mechanism was originally devised by Microsoft for hotpatching their
binaries (which they're constantly updating to stay ahead of crackers,
script kiddies, and other ne'er-do-wells on the Internet), but it's now
commonly abused by Windows programs that want to hook API functions. It
is for this reason that this attribute was added to GCC--hence the name,
`ms_hook_prologue`.

Depends on D19908.

Reviewers: rnk, aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278050 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
lib/CodeGen/TargetInfo.cpp
lib/Sema/SemaDeclAttr.cpp
test/CodeGen/function-attributes.c
test/Sema/attr-ms-hook-prologue-wrong-arch.c [new file with mode: 0644]
test/Sema/attr-ms-hook-prologue.c [new file with mode: 0644]