Dave Korn 写道:
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.
It seems to be what I want. Could you please give more clues? Which
backend and where I can find that "naked" function attribute, thanks.
cheers,
DaveK
Regards,
Li Wang