diff options
| author | Mark Wielaard <[email protected]> | 2020-09-03 17:46:53 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2020-09-07 12:21:10 +0200 |
| commit | 5ed73d79bf5670484963cb5b57b8da50c68d5c3e (patch) | |
| tree | 2253b44f8322d2520ccd3538d832f97aecc1bb26 /libdw/dwarf_getcfi.c | |
| parent | 18d64cd8e7ce0761568631bb40136ca7a154b6e0 (diff) | |
libdw,readelf: Recognize DW_CFA_AARCH64_negate_ra_state
DW_CFA_AARCH64_negate_ra_state is used on aarch64 to indicate whether
or not the return address is mangled or not. This has the same value
as the DW_CFA_GNU_window_save. So we have to pass around the e_machine
value of the process or core we are inspecting to know which one to
use.
Note that it isn't actually implemented yet. It needs ARMv8.3 hardware.
If we don't have such hardware it is enough to simply ignore the
DW_CFA_AARCH64_negate_ra_state (and not confuse it with
DW_CFA_GNU_window_save) to get backtraces to work on aarch64.
Add a testcase for eu-readelf --debug-dump=frames to show the value
is correctly recognized. Also don't warn we cannot find any DWARF
if we are just dumping frames (those will come from .eh_frame if
there is no .debug_frame).
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_getcfi.c')
| -rw-r--r-- | libdw/dwarf_getcfi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdw/dwarf_getcfi.c b/libdw/dwarf_getcfi.c index 51932cd9..afa8a460 100644 --- a/libdw/dwarf_getcfi.c +++ b/libdw/dwarf_getcfi.c @@ -57,6 +57,11 @@ dwarf_getcfi (Dwarf *dbg) cfi->datarel = 0; cfi->e_ident = (unsigned char *) elf_getident (dbg->elf, NULL); + + GElf_Ehdr ehdr; + gelf_getehdr (dbg->elf, &ehdr); + cfi->e_machine = ehdr.e_machine; + cfi->other_byte_order = dbg->other_byte_order; cfi->default_same_value = false; |
