public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* __declspec(naked) and function body size
@ 2007-12-08 15:01 Ilyes Gouta
  2007-12-08 19:46 ` Brian Dessent
  0 siblings, 1 reply; 5+ messages in thread
From: Ilyes Gouta @ 2007-12-08 15:01 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-09  6:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-08 15:01 __declspec(naked) and function body size Ilyes Gouta
2007-12-08 19:46 ` Brian Dessent
2007-12-08 21:58   ` Ilyes Gouta
2007-12-08 23:26     ` Brian Dessent
2007-12-09  6:51       ` Ilyes Gouta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).