This is the mail archive of the gcc-help@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]

__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.


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