aboutsummaryrefslogtreecommitdiff
path: root/bfd
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 /bfd
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 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-tic6x.c31
2 files changed, 37 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5702597..e04ede9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2011-05-09 Paul Brook <paul@codesourcery.com>
+ * elf32-tic6x.c (is_tic6x_elf_unwind_section_name,
+ elf32_tic6x_fake_sections): New functions.
+ (elf_backend_fake_sections): Define.
+
+2011-05-09 Paul Brook <paul@codesourcery.com>
+
* elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
(elf_backend_gc_mark_extra_sections): Define.
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 6b10654..a70ef01 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -1886,6 +1886,36 @@ elf32_tic6x_gc_mark_extra_sections (struct bfd_link_info *info,
return TRUE;
}
+/* Return TRUE if this is an unwinding table index. */
+
+static bfd_boolean
+is_tic6x_elf_unwind_section_name (const char *name)
+{
+ return (CONST_STRNEQ (name, ELF_STRING_C6000_unwind)
+ || CONST_STRNEQ (name, ELF_STRING_C6000_unwind_once));
+}
+
+
+/* Set the type and flags for an unwinding index table. We do this by
+ the section name, which is a hack, but ought to work. */
+
+static bfd_boolean
+elf32_tic6x_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
+ Elf_Internal_Shdr *hdr, asection *sec)
+{
+ const char * name;
+
+ name = bfd_get_section_name (abfd, sec);
+
+ if (is_tic6x_elf_unwind_section_name (name))
+ {
+ hdr->sh_type = SHT_C6000_UNWIND;
+ hdr->sh_flags |= SHF_LINK_ORDER;
+ }
+
+ return TRUE;
+}
+
/* Update the got entry reference counts for the section being removed. */
static bfd_boolean
@@ -3979,6 +4009,7 @@ elf32_tic6x_copy_private_data (bfd * ibfd, bfd * obfd)
#define elf_backend_plt_readonly 1
#define elf_backend_rela_normal 1
#define elf_backend_got_header_size 8
+#define elf_backend_fake_sections elf32_tic6x_fake_sections
#define elf_backend_gc_sweep_hook elf32_tic6x_gc_sweep_hook
#define elf_backend_gc_mark_extra_sections elf32_tic6x_gc_mark_extra_sections
#define elf_backend_modify_program_headers \