This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: How to let GCC produce flat assembly
On 16 November 2007 05:56, Li Wang wrote:
> As you said, the coprocessor has no ABI to describe a stack and a
> function interface, then inline applies. But how could I inline 'main'?
> And I am sorry for I misuse the word 'elf assembly', what exactly I mean
> by that is how to omit the section or any other informations helps
> linker to organize a executable from the cc1 output. In a word, codes
> something like the following is what I want, If possible to let cc1
> produce such assembly? Thanks.
>
> movl $2, -4(%ebp)
> movl $2, -8(%ebp)
> movl -8(%ebp), %eax
> addl -4(%ebp), %eax
Various CPU backends (but IIRC not i386) implement a "naked" function
attribute, which suppresses function epilogue and prologue generation. You
could implement something like that.
cheers,
DaveK
--
Can't think of a witty .sigline today....