Jim Wilson
unread,May 30, 2018, 1:11:51 PM5/30/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Baikal, RISC-V SW Dev, smadh...@gmail.com, yun...@eecs.berkeley.edu, sw-...@lists.riscv.org, je...@j-software.dk
On Wed, May 30, 2018 at 1:30 AM, Baikal <
dnd...@gmail.com> wrote:
> Is there a new ABI document? I still could not find the stack frame layout.
> I just find:
> caller_ra = *(callee_fp-4);
> caller_fp = *(callee_fp-8);
> But I'm not sure. If you have the newest ABI document, please tell me how to
> download it, Thanks!
https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
You should not make any assumptions about stack frame layout. If you
need something from a stack frame, use a compiler builtin function if
available, or use the unwind info.
But, yes, assuming no compiler optimization, this is what gcc will do.
With compiler optimization, gcc may do something different, and there
is no guarantee that these values will be on the stack at those
locations at every point in the function. The builtin functions and
unwind info will work with compiler optimization.
Jim