From 3dec3e110bb2a2453156868e1221dc8192399e3e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 6 Oct 2013 17:04:07 +0200 Subject: backends: ppc_abi_cfi reg1 use DW_CFA_val_offset not DW_CFA_val_expression. Register rules using expressions are stored using an offset from the start of the .eh_frame or .debug_frame ELF section data. Since abi_cfi rules aren't stored in those ELF sections they should use neither DW_CFA_expression nor DW_CFA_val_expression. The only backend that used DW_CFA_val_expression was ppc_cfi.c. It was easier to express the same rule using DW_CFA_val_offset than to change the code to handle register rules using expressions. On most architectures this did work by accident. See the definition of struct dwarf_frame_register value in libdw/cfi.h to see why. But on ia64 the abi_cfi data and actual frame data were placed too far apart and caused a crash in tests/run-addrcfi.sh for ppc32. Signed-off-by: Mark Wielaard --- libebl/libebl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libebl/libebl.h') diff --git a/libebl/libebl.h b/libebl/libebl.h index cae31c9b..990167a5 100644 --- a/libebl/libebl.h +++ b/libebl/libebl.h @@ -257,6 +257,11 @@ extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc, before each CIE's initial instructions. It should set the data_alignment_factor member if it affects the initial instructions. + The callback should not use the register rules DW_CFA_expression or + DW_CFA_val_expression. Defining the CFA using DW_CFA_def_cfa_expression + is allowed. This is an implementation detail since register rules + store expressions as offsets from the .eh_frame or .debug_frame data. + As a shorthand for some common cases, for this instruction stream we overload some CFI instructions that cannot be used in a CIE: -- cgit v1.2.1