Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Please add support for ms_hook_prologue function attribute #10513

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR10212
Status NEW
Importance P enhancement
Reported by austinenglish@gmail.com (austinenglish@gmail.com)
Reported on 2011-06-27 23:14:50 -0700
Last modified on 2019-03-28 13:32:19 -0700
Version trunk
Hardware PC Linux
CC aaron@aaronballman.com, amine.khaldi@reactos.org, cdavis5x@gmail.com, erich.e.hoover@gmail.com, geek4civic@gmail.com, jeremyhu@apple.com, joao@tritao.eu, llvm-bugs@lists.llvm.org, nicholas@mxc.ca, richard-llvm@metafoo.co.uk, rnk@google.com, yukariin@yandex.ru
Fixed by commit(s)
Attachments
Blocks PR6815, PR10638
Blocked by
See also
Quuxplusone commented 13 years ago

Sorry, hit tab one to many times before hitting Submit :)

gcc added support for this a couple years ago (Sep 2009), and has been in since gcc 4.5. It's used by Wine to allow programs to hook certain APIs. Without this, Steam, xfire, and several copy protections/DRM schemes fail to function.

Quuxplusone commented 12 years ago
Still present, as of
    git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@150433 91177308-0d34-0410-b5e6-96231b3b80d8
Quuxplusone commented 12 years ago

I just noticed Clang already abstracts this on the CGCXXABI object (EmitInstanceFunctionProlog), so it should be pretty to hook it up on the compiler once the LLVM part is done.

Quuxplusone commented 11 years ago
(In reply to comment #3)
> I just noticed Clang already abstracts this on the CGCXXABI object
> (EmitInstanceFunctionProlog), so it should be pretty to hook it up on the
> compiler once the LLVM part is done.

Instance functions aren't the only ones which would want this prologue.  This
is most commonly used on non-instance methods and corresponds to the /hotpatch
MSVC option: http://msdn.microsoft.com/en-us/library/ms173507.aspx

What's more, it's not x86-specific (we should support it for x64 and Itanium
targets as well, where it can require more than just the five-byte prologue).

For MSVC compatibility, we should consider adding a flag letting you turn this
feature on or off for an entire file instead of requiring an attribute.  Not
saying that we shouldn't also support the function attribute.
Quuxplusone commented 9 years ago

_Bug 20888 has been marked as a duplicate of this bug._

Quuxplusone commented 8 years ago

Any progress?

Quuxplusone commented 5 years ago
This feature was temporarily added in August 2016, then reverted almost
immediately thereafter:
 * add ms-hotpatch r278048: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160808/380298.html
 * add ms_hook_prologue r278050: https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160808/167275.html
 * revert ms_hook_prologue r278052: https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160808/167282.html
 * revert ms-hotpatch r278053: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160808/380301.html
and I don't think was ever revisited.