From: "André Wagner" <andre@syspoint.com.br>
To: linux-assembly@vger.kernel.org
Subject: Re: Naked Functions
Date: Tue, 27 May 2003 11:29:23 -0300 [thread overview]
Message-ID: <oprpt469swpa9nly@smtp.syspoint.com.br> (raw)
In-Reply-To: <Law14-F517jvXRGwmHi0000fee3@hotmail.com>
Hi,
I've read some time ago about how writing a full programm without the
headers. It's useful for write a boot sector for example, but I'm not sure
for functions. But you can use it as a start point...
Just compile your program like this:
gcc -c test.c
ld -o test -Ttext 0x0 -e main test.o
objcopy -R .note -R .comment -S -O binary test test.bin
HTH,
André
On Tue, 27 May 2003 19:43:59 +0530, S kris <kris_bs@hotmail.com> wrote:
> Hi,
>
> I have come across some MS C code which uses 'naked' functions. How can I
> achieve a similar effect with GNU toolchain. I do not want to rewrite the
> code in assembly .s file and would prefer to do simple modifications to
> make it work with Linux.
>
> Is the macro __attribute__((naked)) valid for the above purpose?
> If not, what are the methods to generate the code for functions without
> its prolog and epilog code (naked functions) under Linux?
> Is prolog and epilog code generated by both MS tools and GNU tools
> (compilers) are same?
>
> Please clarify the above queries.
>
> Thanks in advance.
>
> --Kris
>
> _________________________________________________________________
> Reconnect with old pals. Relive the happy times.
> http://www.batchmates.com/msn.asp With just one click.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-assembly"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
André Wagner
next prev parent reply other threads:[~2003-05-27 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-27 14:13 Naked Functions S kris
2003-05-27 14:29 ` André Wagner [this message]
2003-06-08 14:51 ` HLA v1.49 is now available Randall Hyde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=oprpt469swpa9nly@smtp.syspoint.com.br \
--to=andre@syspoint.com.br \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.