[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-assembly
Subject: Re: Naked Functions
From: André_Wagner <andre () syspoint ! com ! br>
Date: 2003-05-27 14:29:23
[Download RAW message or body]
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
-
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic