diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2016-09-28 17:54:06 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2016-09-29 16:33:25 +0200 |
commit | 084303b8c636944564d7be3b85dde55e8c371e91 (patch) | |
tree | 80993d8ee34940a43773da8d03594584ffeb7775 /gas/dw2gencfi.c | |
parent | a5721ba270ddf860e0e5a45bba456214e8eac2be (diff) | |
download | gdb-084303b8c636944564d7be3b85dde55e8c371e91.zip gdb-084303b8c636944564d7be3b85dde55e8c371e91.tar.gz gdb-084303b8c636944564d7be3b85dde55e8c371e91.tar.bz2 |
Add .cfi_val_offset GAS command.
This patch adds support for .cfi_val_offset GAS pseudo command which
maps to DW_CFA_val_offset and DW_CFA_val_offset_sf.
gas/ChangeLog:
2016-09-29 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* doc/as.texinfo: Add docu for .cfi_val_offset.
* dw2gencfi.c (cfi_add_CFA_val_offset): New function.
(dot_cfi): Add case for DW_CFA_val_offset.
(output_cfi_insn): Likewise.
(cfi_pseudo_table): Add entry for cfi_val_offset.
* dw2gencfi.h: Add prototype for cfi_add_CFA_val_offset.
* testsuite/gas/cfi/cfi-common-8.d: New test.
* testsuite/gas/cfi/cfi-common-8.s: New test.
* testsuite/gas/cfi/cfi.exp: Run cfi-common-8 testcase.
binutils/ChangeLog:
2016-09-29 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* dwarf.c (display_debug_frames): Adjust output line.
Diffstat (limited to 'gas/dw2gencfi.c')
-rw-r--r-- | gas/dw2gencfi.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index fb3e302..4fbdf42 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -600,6 +600,22 @@ cfi_add_CFA_offset (unsigned regno, offsetT offset) as_bad (_("register save offset not a multiple of %u"), abs_data_align); } +/* Add a DW_CFA_val_offset record to the CFI data. */ + +void +cfi_add_CFA_val_offset (unsigned regno, offsetT offset) +{ + unsigned int abs_data_align; + + gas_assert (DWARF2_CIE_DATA_ALIGNMENT != 0); + cfi_add_CFA_insn_reg_offset (DW_CFA_val_offset, regno, offset); + + abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0 + ? -DWARF2_CIE_DATA_ALIGNMENT : DWARF2_CIE_DATA_ALIGNMENT); + if (offset % abs_data_align) + as_bad (_("register save offset not a multiple of %u"), abs_data_align); +} + /* Add a DW_CFA_def_cfa record to the CFI data. */ void @@ -727,6 +743,7 @@ const pseudo_typeS cfi_pseudo_table[] = { "cfi_val_encoded_addr", dot_cfi_val_encoded_addr, 0 }, { "cfi_inline_lsda", dot_cfi_inline_lsda, 0 }, { "cfi_label", dot_cfi_label, 0 }, + { "cfi_val_offset", dot_cfi, DW_CFA_val_offset }, { NULL, NULL, 0 } }; @@ -827,6 +844,13 @@ dot_cfi (int arg) cfi_add_CFA_offset (reg1, offset); break; + case DW_CFA_val_offset: + reg1 = cfi_parse_reg (); + cfi_parse_separator (); + offset = cfi_parse_const (); + cfi_add_CFA_val_offset (reg1, offset); + break; + case CFI_rel_offset: reg1 = cfi_parse_reg (); cfi_parse_separator (); @@ -1680,6 +1704,23 @@ output_cfi_insn (struct cfi_insn_data *insn) } break; + case DW_CFA_val_offset: + regno = insn->u.ri.reg; + offset = insn->u.ri.offset / DWARF2_CIE_DATA_ALIGNMENT; + if (offset < 0) + { + out_one (DW_CFA_val_offset_sf); + out_uleb128 (regno); + out_sleb128 (offset); + } + else + { + out_one (DW_CFA_val_offset); + out_uleb128 (regno); + out_uleb128 (offset); + } + break; + case DW_CFA_register: out_one (DW_CFA_register); out_uleb128 (insn->u.rr.reg1); @@ -2516,6 +2557,7 @@ const pseudo_typeS cfi_pseudo_table[] = { "cfi_val_encoded_addr", dot_cfi_dummy, 0 }, { "cfi_label", dot_cfi_dummy, 0 }, { "cfi_inline_lsda", dot_cfi_dummy, 0 }, + { "cfi_val_offset", dot_cfi_dummy, 0 }, { NULL, NULL, 0 } }; |