diff options
| author | Mark Wielaard <[email protected]> | 2013-10-06 17:04:07 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-10-07 11:16:27 +0200 |
| commit | 3dec3e110bb2a2453156868e1221dc8192399e3e (patch) | |
| tree | 65eb424f42bfd80f2bcc2b6a8d1a6d96df5e475a /backends | |
| parent | 5dbbc5e32cc1fb3a7cf33e52e0bfc6f47097f3fe (diff) | |
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 <[email protected]>
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/ChangeLog | 5 | ||||
| -rw-r--r-- | backends/ppc_cfi.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 3409010d..28c807a9 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2013-10-06 Mark Wielaard <[email protected]> + + * ppc_cfi.c (ppc_abi_cfi): Use DW_CFA_val_offset for reg1, not + DW_CFA_val_expression. + 2013-08-29 Mark Wielaard <[email protected]> * Makefile.am (arm_SRCS): Add arm_cfi.c. diff --git a/backends/ppc_cfi.c b/backends/ppc_cfi.c index 6a4f4619..55169aef 100644 --- a/backends/ppc_cfi.c +++ b/backends/ppc_cfi.c @@ -44,7 +44,7 @@ ppc_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info) DW_CFA_def_cfa, ULEB128_7 (1), ULEB128_7 (0) */ /* r1 is assumed to be restored from cfa adress, r1 acts as a stack frame pointer. */ - DW_CFA_val_expression, ULEB128_7 (1), ULEB128_7 (1), DW_OP_nop, + DW_CFA_val_offset, ULEB128_7 (1), ULEB128_7 (0), /* lr is not callee-saved but it needs to be preserved as it is pre-set by the caller. */ DW_CFA_same_value, ULEB128_7 (65), /* lr */ |
