Re: x86 procedure calling convention (again)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/08/12 08:10, phi gcc wrote:

> The document you point out say page 3-11 'All incoming arguments
> appear on the stack, residing in the stack frame of the caller.'

This is true for x86/32.

> It is obvious that GCC don't care about this and assign some args
> tosome (scratch) registers, the problem is that what arg goes in what
> regs changes over time, and I need to know if there is a way to know
> this.

No, that's not so for global functions.  You're talking about x86/64;
it's a different ABI.

> I need this to automate linux crash dump analysis, that look at
> stack unwind programatically, and I recieve dumps from 'production
> system' that run old frozen kernel. So basically I need to adapt to
> gcc, to automate args retrieval and way obsolete gc :)
> 
> I have many heuristics for that, so far it works pretty well, but this
> is pure reverse engineering and I wondered if gcc (internal?) doc
> would explicitly describe what strategy they choose for a given gcc
> version.

For static functions GCC has always been able to do whatever it wants,
and if I wanted to know exactly how it's done I'd read the compiler
source.  I've never seen any docs for the internal conventions for
static functions.  There's fastcall as well, of course, but that is in
the GCC docs.

Andrew.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux