diff options
author | Tom de Vries <tdevries@suse.de> | 2019-02-08 09:49:06 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2019-02-08 09:49:06 +0000 |
commit | 4af50e13a035804b80551e4649cc2b055588ffc8 (patch) | |
tree | b74316f8166f219c2fee18d534d8eb67b014e69c /libbacktrace/simple.c | |
parent | 2536d696a3fc101af0b731c10351777c4c0f0bc1 (diff) | |
download | gcc-4af50e13a035804b80551e4649cc2b055588ffc8.zip gcc-4af50e13a035804b80551e4649cc2b055588ffc8.tar.gz gcc-4af50e13a035804b80551e4649cc2b055588ffc8.tar.bz2 |
[libbacktrace] Declare external backtrace fns noinline
The backtrace functions backtrace_full, backtrace_print and backtrace_simple
walk the call stack, but make sure to skip the first entry, in order to skip
over the functions themselves, and start the backtrace at the caller of the
functions.
When compiling with -flto, the functions may be inlined, causing them to skip
over the caller instead.
Fix this by declaring the functions with __attribute__((noinline)).
2019-02-08 Tom de Vries <tdevries@suse.de>
* backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
* print.c (backtrace_print): Same.
* simple.c (backtrace_simple): Same.
From-SVN: r268668
Diffstat (limited to 'libbacktrace/simple.c')
-rw-r--r-- | libbacktrace/simple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbacktrace/simple.c b/libbacktrace/simple.c index d439fce..1189363 100644 --- a/libbacktrace/simple.c +++ b/libbacktrace/simple.c @@ -90,7 +90,7 @@ simple_unwind (struct _Unwind_Context *context, void *vdata) /* Get a simple stack backtrace. */ -int +int __attribute__((noinline)) backtrace_simple (struct backtrace_state *state, int skip, backtrace_simple_callback callback, backtrace_error_callback error_callback, void *data) |