musl/arch
Rich Felker 54991729fd work around gdb issues recognizing sigreturn trampoline on x86_64
gdb can only backtrace/unwind across signal handlers if it recognizes
the sa_restorer trampoline. for x86_64, gdb first attempts to
determine the symbol name for the function in which the program
counter resides and match it against "__restore_rt". if no name can be
found (e.g. in the case of a stripped binary), the exact instruction
sequence is matched instead.

when matching the function name, however, gdb's unwind code wrongly
considers the interval [sym,sym+size] rather than [sym,sym+size).
thus, if __restore_rt begins immediately after another function, gdb
wrongly identifies pc as lying within the previous adjacent function.
this patch adds a nop before __restore_rt to preclude that
possibility. it also removes the symbol name __restore and replaces it
with a macro since the stability of whether gdb identifies the
function as __restore_rt or __restore is not clear.

for the no-symbols case, the instruction sequence is changed to use
%rax rather than %eax to match what gdb expects.

based on patch by Szabolcs Nagy, with extended description and
corresponding x32 changes added.
2016-11-12 19:54:43 -05:00
..
aarch64 add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
arm add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
generic/bits generalize ELF hash table types not to assume 32-bit entries 2016-11-11 12:46:06 -05:00
i386 make brace placement in public header typedef'd structs consistent 2016-07-03 16:19:28 -04:00
microblaze microblaze: add syscall numbers from linux v4.7 2016-08-30 15:58:28 -04:00
mips add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
mips64 add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
mipsn32 add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
or1k remove or1k version of sem.h 2016-07-06 00:21:19 -04:00
powerpc add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
powerpc64 add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
s390x add s390x port 2016-11-11 23:06:21 -05:00
sh add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
x32 work around gdb issues recognizing sigreturn trampoline on x86_64 2016-11-12 19:54:43 -05:00
x86_64 work around gdb issues recognizing sigreturn trampoline on x86_64 2016-11-12 19:54:43 -05:00