Re: function arguments are passed in registers

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

 



Zheng Da wrote:
Suppose I have two libraries, A and B.
In library A, there is function a() whose arguments are passed in registers.
In library B, there is b() whose arguments are passed in the stack.
Now I have to use a() and b() in my program.
But how do I tell GCC that they use different ways to pass the
arguments and which is the right way.
This is why a common ABI exists. The only "sane" way to accomplish this with GCC is to write a "thunking" [iirc that's the term] layer in which you pass the parameters in a different convention.

How did you end up with this mess anyways? Most assembler routines that interface with C are written to use the ABI so they're drop in.

Tom

[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