libc: clear frame pointer on user-context entry

If built with frame-pointer support the backtrace now stops at the user
entry code. Before, the libc kernel stack was trced back too.
This commit is contained in:
Christian Helmuth 2016-12-16 21:15:17 +01:00 committed by Norman Feske
parent 7386c4e1d1
commit e93fe55e54
2 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,7 @@
{
asm volatile ("mov r0, %2;" /* set arg */
"mov sp, %0;" /* set stack */
"mov fp, #0;" /* clear frame pointer */
"mov pc, %1;" /* call func */
""
: : "r"(sp), "r"(func), "r"(arg) : "r0");

View File

@ -26,6 +26,7 @@
asm volatile ("movl %2, 0(%0);"
"movl %1, -0x4(%0);"
"movl %0, %%esp;"
"xorl %%ebp, %%ebp;" /* clear frame pointer */
"call *-4(%%esp);"
: : "r" (sp), "r" (func), "r" (arg));
__builtin_unreachable();