On 7 September 2016 at 12:32, Ard Biesheuvel <[email protected]> wrote:
> On 7 September 2016 at 12:25, Michael Zimmermann
> <[email protected]> wrote:
>>> However, looking at this
>>> code, this is still not sufficient to find the *next* frame pointer on
>>> the stack.
>> are you sure about that? this code looks like it does just that:
>> https://github.com/torvalds/linux/blob/master/arch/arm/kernel/stacktrace.c
>>
>
> First of all, that comment makes little sense:
>
> * With framepointer enabled, a simple function prologue looks like this:
> * mov ip, sp
> * stmdb sp!, {fp, ip, lr, pc}
>
> I assume this should be
>
> stmdb sp!, {fp, ip, lr}
>
> * sub fp, ip, #4
> *
> * A simple function epilogue looks like this:
> * ldm sp, {fp, sp, pc}
>
OK, I spoke a bit too soon. The 'pop' does not actually increment the
stack pointer, so while the push does make sense (and pushing the pc
in addition is just informational), the pop should actually be
implemented as
ldm sp, {fp, sp, lr}
... do other stuff including incrementing the sp to its original value ...
bx lr
In any case, unless you have any information that suggests that GCC in
Thumb2 mode can be coerced into managing the frame pointer in a way
that allows us to do something similar in EDK2, I am going to stick
with my assertion that this is not currently possible on ARM.
Thanks,
Ard.
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel