Insert static branch prediction predicates in useful places and avoid
unnecessary code in the hottest paths. Bypass unnecessary indirect
calls, in particular to access_mem(), when known to be safe.
Since the fast unwinding code path doesn't need the full context,
a faster target dependent getcontext is implemented.
Signed-off-by: Lassi Tuura <lat@cern.ch>
Creating an alternate signal stack with a size of SIGSTKSZ (usually 8k) is
not enough on some targets because unw_cursor_t is bigger than that already.
Since the size of unw_cursor_t is part of the ABI the UNW_TDEP_CURSOR_LEN
can't be changed without breaking existent code. Therefore size of the
alternate signal stack has been increased to 1 MiB.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
In order to have the DWARF_* macros working properly a generic and a local
variant of the ex_tables.c have been created.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
We'd like to avoid calls to all malloc related functions
so libunwind is still usable from such allocators.
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Dropping the extra frame for unw_backtrace itself using unw_step is
approximately 15% slower than skipping the frame in tdep_trace. So
drop the frame in the latter, and make the function a private
implementation detail for libunwind, not an exported interface.
Also moves unw_getcontext call back into unw_backtrace to avoid an
extra call frame in case slow_backtrace does not get inlined into
unw_backtrace.
Adds new function to perform a pure stack walk without unwinding,
functionally similar to backtrace() but accelerated by an address
attribute cache the caller maintains across calls.
Usually we don't have a valid location for the SP but we keep calculating
the value of the CFA. The ARM backend should return this value instead.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Using malloc is not an option since unw_init_local and unw_step are supposed
to be async signal safe. Therefore this code path can be removed.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
There is no need for libunwind to set/fake a name of the elf file from which
the program header came from.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
DWARF expressions are more powerful than the ARM specific unwind tables.
Therefore DWARF should be the preferred unwind method.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Move code that does not necessarily need to reside in the ex_tables.h header
file into ex_tables.c. Add comments and remove unused code.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This test case relies on old libunwind internals such as the arm_stackframe.
Since the ARM extbtl-parser now operates on the DWARF model directly the
arm-extbl-test isn't of any particular use anymore.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This eliminates the arm_stackframe and therefore the need to synchronize the
two models. It also clears the way for unwinding call stacks with mixed
DWARF- and extbl-frames.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Uses ex_tables routines to provide a new means of unwinding the stack.
Set UNW_ARM_UNWIND_METHOD=4 to use ARM-specific unwinding tables.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Implements a check for call to sigreturn that the kernel will have
setup before jumping to the signal handler.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
If mmap fails, be sure to close the maps file before returning an error.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Avoids an endless loop when passing unknown options.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This prevents the linker from complaining about a missing symbol when
building the test-setjmp test case.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This results in different unwi_unwind_method symbol names for the local and
generic versions. It allows to statically link against both libraries.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This adds support for linkers that do not pull in the dependent shared
libraries of libunwind-$(arch).la and libunwind-setjmp.la implicitly.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
in elf_map_image() to ensure mapped files have a valid ELF header.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Arun Sharma <asharma@fb.com>
Eliminates obfuscating variables in favor of adding files directly
to library SOURCES. Eliminates the need for EXTRA_DIST variable.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Rather than building the sources directly, create a library that
gets linked statically into libunwind.la and libunwind-$(arch).la.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Build DWARF source files into automake convenience libraries to
eliminate duplication in arch-dependent library build rules.
Adds a configure-time check to determine whether to use them.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Eliminate redundant listing of libunwind_setjmp source files by
using automake's '+=' operator.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>