[LLVMdev] How to get the return address on the stack on LLVM

Xueying ZHANG s1031770 at sms.ed.ac.uk
Tue Jul 26 10:29:55 PDT 2011


Hi Anton,

Thanks for your reply!

I'm now stuck at a problem with the Intrinsic function returnaddress.
I call it twice in the function.

For the first time, it goes to the correct address which storing  
return address.
And then it saves the content it reads into the local stack.
But when I call returnaddress again, it just reads from the local stack.

How can I solve this problem?

Thank you
Ying


Quoting Anton Korobeynikov <anton at korobeynikov.info> on Tue, 26 Jul  
2011 21:12:07 +0400:

> Hello
>
>> In the prologue of the function, before I insert into the canary on
>> the stack, I can get the return address by:
> Note that there is no epilogue and prologue at IR level :)
>
>> But it does not work this time. I cannot get the return address.
>> What is problem? How can I get the return address? Thank you!
> What is the problem? It seems you're getting the return address via
> intrinsic call correctly.
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.






More information about the llvm-dev mailing list