This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __builtin_apply


Hi,

these functions are also used in Objective-C for message forwarding.
Unfortunatly the functions seem to be broken in various gcc
versions/platforms. You can take a look at the libFoundation Objective-C
library to see how to calculate the arguments.

There is also a library called libffi which can be used for dynamic
function calls, but AFAIK not for decoding these.

Greetings
  Helge

Stuart Meikle wrote:
> 
> Hi folks,
> 
> What I'm trying to do:-> pass unknown parameters to a remote function
> running on a similar machine and return the results. machine
> configurations are the same - i expect to be able to call the remote
> functions directly using a copy of the stack from the other machine.
> 
> blah. anyway i see that there are 3 functions : __builtin_apply ,
> __builtin_apply_args, etc which should enable me to do this. but, in fact
> don't because they say that one of the parameters is 'tricky' to
> calculate. this makes them rather useless as there's a danger i can mess
> the stack up by getting size wrong.
> 
> i guess forming function calls is done all the time in GCC, so i can't
> understand why these functions are so mysterious. can we fix them ?? I can
> do this myself if you guys are busy, but then where can I find out about
> gcc's function-calling strategy ? ( I see from assembler output that's its
> not quite as trivial as pushing the parameters onto the stack and then
> popping them off in the function ).
> 
> anyway, any help would be appreciated, thanks
> 
> Stuart
> 
> Stuart Meikle
> Technical Director
> 
> -------------------------------------------------------------
>         B A S T I O N   S O F T W A R E   L I M I T E D
> -------------------------------------------------------------
> tel:(+44) 114 2211809          http://www.bastionsoftware.com
> Sheffield Science Park, Arundel Street, Sheffield, UK. S1 2NS

-- 
SKYRIX-OS  Web Application Environment - http://www.skyrix.com
SKYRIX-IAS Groupware Application Suite - http://www.skyrix.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]