/* dw2gencfi.c - Support for generating Dwarf2 CFI information.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
Contributed by Michal Ludvig <mludvig@suse.cz>
This file is part of GAS, the GNU Assembler.
{
reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput, code);
char *p = frag_more (size);
- gas_assert (size == howto->bitsize / 8);
+ gas_assert (size == (unsigned) howto->bitsize / 8);
md_number_to_chars (p, 0, size);
fix_new (frag_now, p - frag_now->fr_literal, size, exp->X_add_symbol,
exp->X_add_number, howto->pc_relative, code);
unsigned char per_encoding;
unsigned char lsda_encoding;
expressionS personality;
+#ifdef tc_cie_entry_extras
+ tc_cie_entry_extras
+#endif
struct cfi_insn_data *first, *last;
};
/* List of CIEs so that they could be reused. */
static struct cie_entry *cie_root;
-/* Stack of old CFI data, for save/restore. */
-struct cfa_save_data
-{
- struct cfa_save_data *next;
- offsetT cfa_offset;
-};
-
-/* Current open FDE entry. */
-struct frch_cfi_data
-{
- struct fde_entry *cur_fde_data;
- symbolS *last_address;
- offsetT cur_cfa_offset;
- struct cfa_save_data *cfa_save_stack;
-};
-\f
/* Construct a new FDE structure and add it to the end of the fde list. */
static struct fde_entry *
fde->per_encoding = DW_EH_PE_omit;
fde->lsda_encoding = DW_EH_PE_omit;
fde->eh_header_type = EH_COMPACT_UNKNOWN;
+#ifdef tc_fde_entry_init_extra
+ tc_fde_entry_init_extra (fde)
+#endif
return fde;
}
static void
dot_cfi_label (int ignored ATTRIBUTE_UNUSED)
{
- char *name = read_symbol_name ();
+ char *name;
+
+ if (frchain_now->frch_cfi_data == NULL)
+ {
+ as_bad (_("CFI instruction used without previous .cfi_startproc"));
+ ignore_rest_of_line ();
+ return;
+ }
+ name = read_symbol_name ();
if (name == NULL)
return;
if (cie->lsda_encoding != DW_EH_PE_omit)
out_one ('L');
out_one ('R');
+#ifdef tc_output_cie_extra
+ tc_output_cie_extra (cie);
+#endif
}
if (cie->signal_frame)
out_one ('S');
{
reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput, code);
char *p = frag_more (addr_size);
- gas_assert (addr_size == howto->bitsize / 8);
+ gas_assert (addr_size == (unsigned) howto->bitsize / 8);
md_number_to_chars (p, 0, addr_size);
fix_new (frag_now, p - frag_now->fr_literal, addr_size,
fde->start_address, 0, howto->pc_relative, code);
{
if (CUR_SEG (cie) != CUR_SEG (fde))
continue;
+#ifdef tc_cie_fde_equivalent_extra
+ if (!tc_cie_fde_equivalent_extra (cie, fde))
+ continue;
+#endif
if (cie->return_column != fde->return_column
|| cie->signal_frame != fde->signal_frame
|| cie->per_encoding != fde->per_encoding
cie->lsda_encoding = fde->lsda_encoding;
cie->personality = fde->personality;
cie->first = fde->data;
+#ifdef tc_cie_entry_init_extra
+ tc_cie_entry_init_extra (cie, fde)
+#endif
for (i = cie->first; i ; i = i->next)
if (i->insn == DW_CFA_advance_loc