This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
__declspec(naked) and function body size
- From: Ilyes Gouta <ilyes dot gouta at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 08 Dec 2007 15:59:53 +0100
- Subject: __declspec(naked) and function body size
Hi,
I'd like to do the following thing under Linux using GCC.
/* __declspec(naked) is Microsoft's C compiler specific. */
__declspec(naked) int function1()
{
/* dummy stub dumped by the JIT. */
int a = 0, b = 1;
int c = a + b;
return (c);
}
__declspec(naked) void end_function1() {}
unsigned char t[256];
void main()
{
/* I'd like to do the following, i.e copying code around. */
memcpy(t, function1, end_function1 - function1);
}
Is it possible using GCC? If yes, could you please tell me how?
Best regards,
Ilyes Gouta.