__declspec(naked) and function body size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux