How can I do calling for external address in my "C" programm by inline GAS?

Dmitrij K kdiman1982@gmail.com
Mon Mar 26 21:02:00 GMT 2012


Ian Lance Taylor wrote:
> In this code p_printf is the address of the printf function.  You are
> running your asm with the value of p_printf in %1.  Rather than putting
> the value into a register, you are putting the address of the value into
> a register.  In effect you are putting an address on the stack into the
> register.  Then you are calling that address, which implies calling into
> the stack.  This fails.
> 
> In order to get this kind of thing working, I recommend learning how to
> use the debugger, with single-stepping and display of assembly
> instructions.  That would make it clear that at the point of the call
> %rcx does not hold the address you want to call.
> 
> Ian


Hi Ian!

Thank you for you reply on my letters.

Your tips does not helped me.

I have registered this behavirous as bug: 
http://sourceware.org/bugzilla/show_bug.cgi?id=13903

-- 
The best Regards.



More information about the Binutils mailing list