[Skiboot] [PATCH] core: Fix backtrace for gcc 6

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Feb 29 16:26:22 AEDT 2016


On 02/29/2016 06:21 AM, Joel Stanley wrote:
> GCC 6 warns when we look at any stack frame other than our own, ie any
> argument to __builtin_frame_address other than zero.
>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>   core/stack.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/core/stack.c b/core/stack.c
> index 17f89d491ba2..8b8842fc9d45 100644
> --- a/core/stack.c
> +++ b/core/stack.c
> @@ -31,10 +31,11 @@ extern uint32_t _stext, _etext;
>   void __nomcount __backtrace(struct bt_entry *entries, unsigned int *count)
>   {
>   	unsigned int room = *count;
> -	unsigned long *fp = __builtin_frame_address(1);
> +	unsigned long *fp = __builtin_frame_address(0);
>
>   	*count = 0;
>   	while(room) {
> +		fp = (unsigned long *)fp[0];

What if fp is NULL?

-Vasant



More information about the Skiboot mailing list