aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2016-02-29 11:21:11 +1030
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-06-20 15:24:25 +1000
commitc6275625b1bb7a96a4c6e673811d8680f6770093 (patch)
treed4bc35022c85919e269a925b0eb0368bfe4bde9e
parentb57caaac6d7b54b9a1e440ff478fb519b7f878cb (diff)
downloadskiboot-c6275625b1bb7a96a4c6e673811d8680f6770093.zip
skiboot-c6275625b1bb7a96a4c6e673811d8680f6770093.tar.gz
skiboot-c6275625b1bb7a96a4c6e673811d8680f6770093.tar.bz2
core: Fix backtrace for gcc 6
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@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit 793f6f5b32c96f2774bd955b6062c74a672317ca)
-rw-r--r--core/stack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/stack.c b/core/stack.c
index 5fba6c7..3b92a14 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -31,7 +31,7 @@ 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);
unsigned long top_adj = top_of_ram;
/* Assume one stack for early backtraces */
@@ -40,6 +40,7 @@ void __nomcount __backtrace(struct bt_entry *entries, unsigned int *count)
*count = 0;
while(room) {
+ fp = (unsigned long *)fp[0];
if (!fp || (unsigned long)fp > top_adj)
break;
entries->sp = (unsigned long)fp;
@@ -47,7 +48,6 @@ void __nomcount __backtrace(struct bt_entry *entries, unsigned int *count)
entries++;
*count = (*count) + 1;
room--;
- fp = (unsigned long *)fp[0];
}
}