Re: How to let GCC produce flat assembly

2007-11-16 Thread Paul Brook
On Friday 16 November 2007, Dave Korn wrote: > 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 ex

Re: How to let GCC produce flat assembly

2007-11-16 Thread Li Wang
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 th

RE: How to let GCC produce flat assembly

2007-11-16 Thread 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

RE: How to let GCC produce flat assembly

2007-11-16 Thread Dave Korn
On 16 November 2007 10:56, Li Wang wrote: > Dave Korn 写道: >> >> 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 y

Re: How to let GCC produce flat assembly

2007-11-15 Thread Li Wang
Hi, Thanks for your attention and response. I think I am still not very accurate to describe what I want to do. I am too anxious to explain far from clearly. Now permit me use a simple example, for the simple C program below, compiled by cc1 targetting to x86 platform, the assembly is as fo

Re: How to let GCC produce flat assembly

2007-11-15 Thread Jim Wilson
Li Wang wrote: and execute it. If I want to let GCC produce assembly for it, how should I code the machine description file? Should I first let cc1 produce a elf assembly for it, and then let binutils trunate it to a flat assembly? It seems ugly hacking. Thanks. I don't know what a .com file is

Re: How to let GCC produce flat assembly

2007-11-15 Thread Joe Buck
On Thu, Nov 15, 2007 at 04:20:49PM -0800, Li Wang wrote: > I may need explain this problem more clearly. Yes, my earlier message directing you to gcc-help was because I thought you didn't grasp what the compiler should do and what the linker should do; sorry about that. > For a backend which runs

Re: How to let GCC produce flat assembly

2007-11-15 Thread Li Wang
Hi, I may need explain this problem more clearly.For a backend which runs as coprocessor to a host processor, such as GPU, which incoporates large numbers of ALUS and processes only arithmetic operations and some other simple operations, runs in VLIW pattern to accelerate the host processor. Say, t

Re: How to let GCC produce flat assembly

2007-11-15 Thread Joe Buck
On Thu, Nov 15, 2007 at 06:41:17AM -0800, Li Wang wrote: > I wonder how to let GCC produce flat assembly, say, just like the .com > file under the DOS, without function calls and complicate executable > file headers, only instructions. How to modify the machine description > file to achieve that? T