This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add support for the Win32 hook prologue (try 3)



I'd propose to have the function attrib the way it is, and add something
similar to /hotpatch or /functionpadmin later if needed(e.g. reactos or mingw
might be interested in that, but I don't think Wine will ever need it). That
way Wine can more reliably generate code that Windows apps know how to hook.

I'd be glad if a gcc maintainer could comment on that, so I know which way to
go.

It is common to have both an attribute and a machine-specific option. There is no problem with that.


Regarding adding padding before the function it would be possible to implement it by defining the ASM_OUTPUT_FUNCTION_PREFIX macro.

Right now ASM_OUTPUT_FUNCTION_PREFIX is defined to be emitted *after* the alignment directive; for your purpose it would be best to call it before, so that it will keep the requested function alignment. Luckily, ASM_OUTPUT_FUNCTION_PREFIX is unused, so you can move it as you wish (and possibly replace it with a target hook instead of using a macro).

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]