From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12298 invoked by alias); 8 Dec 2007 15:01:37 -0000 Received: (qmail 12290 invoked by uid 22791); 8 Dec 2007 15:01:36 -0000 X-Spam-Check-By: sourceware.org Received: from topnetmail3.outgw.tn (HELO topnetmail3.outgw.tn) (193.95.28.103) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 08 Dec 2007 15:01:26 +0000 Received: from server-d.ght (tounes114.tn [193.95.28.114]) by topnetmail3.outgw.tn (Postfix) with ESMTP id 2741499F9 for ; Sat, 8 Dec 2007 16:01:23 +0100 (CET) Received: from tounes-27.ati.tn (unverified) by server-d.ght (Content Technologies SMTPRS 4.3.14) with ESMTP id for ; Sat, 8 Dec 2007 16:06:45 +0100 Received: from mail1.topnet.tn (smtp.topnet.tn [213.150.176.204]) by tounes-27.ati.tn (Postfix) with ESMTP id 3C1A8520046 for ; Sat, 8 Dec 2007 16:01:22 +0100 (CET) Received: (qmail 21636 invoked by uid 89); 8 Dec 2007 14:54:42 -0000 Received: by simscan 1.1.0 ppid: 21618, pid: 21628, t: 0.1721s scanners: clamav: 0.91.2/m: Received: from unknown (HELO ?192.168.1.3?) (196.203.217.86) by mail1 with ESMTP; 8 Dec 2007 14:54:42 -0000 Message-ID: <475AB169.1000905@gmail.com> Date: Sat, 08 Dec 2007 15:01:00 -0000 From: Ilyes Gouta User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: __declspec(naked) and function body size Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00176.txt.bz2 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.