Controlling ld and as with GCC-Backend

Jens Mehler
Wed Mar 20 09:41:00 GMT 2013

Am 20.03.2013 05:07, schrieb Chung-Ju Wu:
> 2013/3/19 Jens Mehler <>:
>> Hi jasonwucj
>> thanks for the tip and sorry for bothering you while working on your stuff.
>> I can run programs in my own simulator now ~ isn't that awesome?
>> Well atm I am looking at varargs implementation.
>> Do you happen to know anything about that?
>> With best regards
>> ~Jens
> Hi Jens,
> Generally speaking, there are two appoarches to
> deal with varargs arguments in ABI.
> The first approach is to have caller push all
> unnamed arguments into the stack.
> This is simplest way to support varargs.
> You just need to implement TARGET_STRICT_ARGUMENT_NAMING
> to guide compiler how you treat the last named argument.
> For the second approach,
> caller behaves in the way of calling a normal function.
> It passes arguments via register and then stack.
> In that case, callee is in charge of storing the unnamed register
> arguments into the stack so that all the arguments appear
> to have been passed consecutively on the stack.
> You need to further implement TARGET_SETUP_INCOMING_VARARGS.
> The value crtl->args.pretend_args_size will be servered
> as additonal offset for setting up the stack frame.
> You can refer to arm porting for more details.
> Best regards,
> jasonwucj
Hi jasonwucj,

I took the second approach because the stackspace for my four register
arguments are already present.
The callee just had to put those registers into their respective stack
space and and everything went totally smooth after that.
Thanks a lot for you help.
With best regards
~ Jens

More information about the Gcc-help mailing list