Use NAL (nop-and-link) to get the current PC.

This commit is contained in:
simonb 2021-04-07 01:54:31 +00:00
parent b5412104dc
commit 5c6aa0100d
1 changed files with 2 additions and 3 deletions

View File

@ -107,9 +107,8 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
ra = (register_t)(intptr_t)__builtin_return_address(0);
__asm __volatile(
"jal 99f\n"
"nop\n"
"99:\n"
"nal\n"
" nop\n"
"move %0, $31\n" /* get ra */
"move $31, %1\n" /* restore ra */
: "=r" (pc)