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)


On 09/11/2009 01:51 PM, Stefan Dösinger wrote:
     if (/* ix86_function_ms_hook_prologue (TREE_TYPE (decl)) */ 1) {
         gen_nop(); gen_nop(); gen_nop(); gen_nop(); gen_nop();

This certainly won't work. You need to output to FILE directly with fputs.


#define IX86_ADD_HOOK_NOPS ix86_hook_nops;

Not IX86 anything, since you'll be putting an empty copy of this hook into non-i386 files too. Perhaps


#define ASM_OUTPUT_FUNCTION_PADDING(FILE, DECL)

And in cygming.h and other places that have their own
ASM_DECLARE_FUNCTION_NAME:
#ifndef IX86_ADD_HOOK_NOPS
#define IX86_ADD_HOOK_NOPS(file, decl)
#endif

#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
    IX86_ADD_HOOK_NOPS(FILE, DECL) \
    whatever_declare_function_exists(file, name, decl)

At which places do I have to do that? config/i386/cygming.h? Or also things
like config/darwin.h?

config/elfos.h config/darwin.h config/i386/cygming.h

Also, it I guess its a good idea to split the in-function two byte nop and the
nops before the function into two different patches. (Maybe the outer nops
first, then the things inside the function)

How about the internal patch first, since that is, for the most part, done.



r~



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