diff options
author | Joel Stanley <joel@jms.id.au> | 2016-02-29 11:21:11 +1030 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-03-30 18:15:39 +1100 |
commit | 793f6f5b32c96f2774bd955b6062c74a672317ca (patch) | |
tree | 2962d9c93254405d3c120a11b7825d61bcc60f97 /core/stack.c | |
parent | b68849baad2c7cd46d9a8278279b42039b3d5174 (diff) | |
download | skiboot-793f6f5b32c96f2774bd955b6062c74a672317ca.zip skiboot-793f6f5b32c96f2774bd955b6062c74a672317ca.tar.gz skiboot-793f6f5b32c96f2774bd955b6062c74a672317ca.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>
Diffstat (limited to 'core/stack.c')
-rw-r--r-- | core/stack.c | 4 |
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]; } } |