This is the mail archive of the gcc-help@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]
Other format: [Raw text]

__builtin_return_address from inline assembly on x86-64.


Hi Guys,

This is a question regarding inline assembly on x86-64.
I wanted to do a __builtin_return_address(0) through inline assembly.
This inline assembly call will be in a macro, and can be called from
multiple functions.

Now i could have simply used the knowledge that the return address is
stored at the base of the stack by getting it through (%rsp).

But as i say this macro can be used in different context, and the
"rsp" pointer could have changed depending on the stack usage of the
calling function.

So please let me know if there its possible to do a
__builtin_return_address from assembly without making assumptions
regarding the "rsp".

Thanks,
Alok


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