aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tic6x.h
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2011-05-09 13:17:58 +0000
committerPaul Brook <paul@codesourcery.com>2011-05-09 13:17:58 +0000
commit1bce6bd86f99b05ddc311eb34545165983ff8ddc (patch)
tree67998c9ac603266185a3b7c6898b0d3b8e607200 /gas/config/tc-tic6x.h
parent9cf0e28212068b89d962e7c850f33b56a0f50a09 (diff)
downloadgdb-1bce6bd86f99b05ddc311eb34545165983ff8ddc.zip
gdb-1bce6bd86f99b05ddc311eb34545165983ff8ddc.tar.gz
gdb-1bce6bd86f99b05ddc311eb34545165983ff8ddc.tar.bz2
2011-05-09 Paul Brook <paul@codesourcery.com>
bfd/ * elf32-tic6x.c (is_tic6x_elf_unwind_section_name, elf32_tic6x_fake_sections): New functions. (elf_backend_fake_sections): Define. gas/ * config/tc-tic6x.c (streq): Define. (tic6x_get_unwind): New. (s_tic6x_cantunwind, s_tic6x_handlerdata, s_tic6x_endp, s_tic6x_personalityindex, s_tic6x_personality): New functions. (md_pseudo_table): Add "endp", "handlerdata", "personalityindex", "personality" and "cantunwind". (tic6x_regname_to_dw2regnum, tic6x_frame_initial_instructions, tic6x_start_unwind_section, tic6x_unwind_frame_regs, tic6x_pop_rts_offset_little, tic6x_pop_rts_offset_big, tic6x_unwind_reg_from_dwarf, tic6x_flush_unwind_word, tic6x_unwind_byte, tic6x_unwind_2byte, tic6x_unwind_uleb, tic6x_cfi_startproc, output_exidx_entry, tic6x_output_unwinding, tic6x_cfi_endproc): New. * config/tc-tic6x.h (TIC6X_NUM_UNWIND_REGS): Define. (tic6x_unwind_info): New. (tic6x_segment_info_type): Add marked_pr_dependency, unwind and text_unwind. (TARGET_USE_CFIPOP, tc_regname_to_dw2regnum, tc_cfi_frame_initial_instructions, DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT, tc_cfi_startproc, tc_cfi_endproc, tc_cfi_section_name): Define. * doc/c-tic6x.texi: Document new unwinding directives. * dw2gencfi.c (tc_cfi_startproc, tc_cfi_endproc): Add default definitions. (cfi_insn_data, fde_entry, CFI_adjust_cfa_offset, CFI_return_column, CFI_rel_offset, CFI_escape, CFI_signal_frame, CFI_val_encoded_addr): Move to dw2gencfi.h. (CFI_EMIT_target): Define. (dot_cfi_sections): Check tc_cfi_section_name. (dot_cfi_startproc): Use tc_cfi_startproc. (dot_cfi_endproc): Use tc_cfi_endproc. * dw2gencfi.h (cfi_insn_data, fde_entry, CFI_adjust_cfa_offset, CFI_return_column, CFI_rel_offset, CFI_escape, CFI_signal_frame, CFI_val_encoded_addr): Move to here from dw2gencfi.c. gas/testsuite: * gas/tic6x/unwind-1.d: New test. * gas/tic6x/unwind-1.s: New test. * gas/tic6x/unwind-2.d: New test. * gas/tic6x/unwind-2.s: New test. * gas/tic6x/unwind-3.d: New test. * gas/tic6x/unwind-3.s: New test. * gas/tic6x/unwind-bad-1.d: New test. * gas/tic6x/unwind-bad-1.s: New test. * gas/tic6x/unwind-bad-1.l: New test. * gas/tic6x/unwind-bad-2.d: New test. * gas/tic6x/unwind-bad-2.s: New test. * gas/tic6x/unwind-bad-2.l: New test. include/ * elf/tic6x.h (ELF_STRING_C6000_unwind, ELF_STRING_C6000_unwind_info, ELF_STRING_C6000_unwind_once, ELF_STRING_C6000_unwind_info_once): Define.
Diffstat (limited to 'gas/config/tc-tic6x.h')
-rw-r--r--gas/config/tc-tic6x.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/gas/config/tc-tic6x.h b/gas/config/tc-tic6x.h
index a324c02..ca85968 100644
--- a/gas/config/tc-tic6x.h
+++ b/gas/config/tc-tic6x.h
@@ -43,6 +43,38 @@ typedef struct tic6x_label_list
symbolS *label;
} tic6x_label_list;
+/* Must be consistent with the enum in tc-tic6x.c. */
+#define TIC6X_NUM_UNWIND_REGS 13
+
+/* Unwinding information state. */
+typedef struct tic6x_unwind_info {
+ int personality_index;
+ symbolS *personality_routine;
+ symbolS *function_start;
+ segT saved_seg;
+ subsegT saved_subseg;
+ /* NULL if table entry is inline. */
+ symbolS *table_entry;
+ char *frag_start;
+ valueT data;
+ /* 0 before .cfi_startproc
+ -1 between .cfi_startproc and .handlerdata
+ >0 between .handlerdata and .endp */
+ int data_bytes;
+
+ offsetT reg_offset[TIC6X_NUM_UNWIND_REGS];
+ bfd_boolean reg_saved[TIC6X_NUM_UNWIND_REGS];
+ int cfa_reg;
+ int return_reg;
+ unsigned safe_mask;
+ unsigned compact_mask;
+ unsigned reg_saved_mask;
+ offsetT cfa_offset;
+ bfd_boolean pop_rts;
+ /* Only valid for UNWIND_OP_POP_REG */
+ int saved_reg_count;
+} tic6x_unwind_info;
+
typedef struct
{
/* Any labels seen since the last instruction or data. If not NULL,
@@ -77,6 +109,14 @@ typedef struct
from the SPLOOP instruction (in the range 1 to 14); otherwise
0. */
int sploop_ii;
+
+ /* Bit N indicates that an R_C6000_NONE relocation has been output for
+ __c6xabi_unwind_cpp_prN already if set. This enables dependencies to be
+ emitted only once per section, to save unnecessary bloat. */
+ unsigned int marked_pr_dependency;
+
+ tic6x_unwind_info *unwind;
+ tic6x_unwind_info *text_unwind;
} tic6x_segment_info_type;
#define TC_SEGMENT_INFO_TYPE tic6x_segment_info_type
@@ -158,3 +198,28 @@ extern void tic6x_init_after_args (void);
#define tc_unrecognized_line(c) tic6x_unrecognized_line (c)
extern int tic6x_unrecognized_line (int c);
+
+/* We want .cfi_* pseudo-ops for generating unwind info. */
+#define TARGET_USE_CFIPOP 1
+
+/* CFI hooks. */
+#define tc_regname_to_dw2regnum tic6x_regname_to_dw2regnum
+int tic6x_regname_to_dw2regnum (char *regname);
+
+#define tc_cfi_frame_initial_instructions tic6x_frame_initial_instructions
+void tic6x_frame_initial_instructions (void);
+
+/* The return register is B3. */
+#define DWARF2_DEFAULT_RETURN_COLUMN (16 + 3)
+
+/* Registers are generally saved at negative offsets to the CFA. */
+#define DWARF2_CIE_DATA_ALIGNMENT (-4)
+
+#define tc_cfi_startproc tic6x_cfi_startproc
+void tic6x_cfi_startproc (void);
+
+#define tc_cfi_endproc tic6x_cfi_endproc
+struct fde_entry;
+void tic6x_cfi_endproc (struct fde_entry *fde);
+
+#define tc_cfi_section_name ".c6xabi.exidx"