From 0da76f83eb29135ae1bd52ba5962721fb1d0c6fc Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 13 May 2004 14:41:18 +0000 Subject: [PATCH] Handle dwarf3 format CIE entries. --- bfd/ChangeLog | 5 +++++ bfd/elf-eh-frame.c | 9 ++++++--- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 29 +++++++++++++++++++++++++---- gas/ChangeLog | 4 ++++ gas/dw2gencfi.c | 5 ++++- 6 files changed, 49 insertions(+), 8 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7465e46..1c91d5d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2004-05-13 Paul Brook + + * eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle dwarf3 + format CIE entries. + 2004-05-13 Joel Sherrill * config.bfd (or32-*-rtems*): Switch to elf. diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index d3777b4..7608e77 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,5 @@ /* .eh_frame section optimization. - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -410,7 +410,7 @@ _bfd_elf_discard_section_eh_frame cie.version = *buf++; /* Cannot handle unknown versions. */ - if (cie.version != 1) + if (cie.version != 1 && cie.version != 3) goto free_no_table; if (strlen (buf) > sizeof (cie.augmentation) - 1) goto free_no_table; @@ -434,7 +434,10 @@ _bfd_elf_discard_section_eh_frame ports this will not matter as the value will be less than 128. For the others (eg FRV, SH, MMIX, IA64) they need a fixed GCC which conforms to the DWARF3 standard. */ - read_uleb128 (cie.ra_column, buf); + if (cie.version == 1) + cie.ra_column = *buf++; + else + read_uleb128 (cie.ra_column, buf); ENSURE_NO_RELOCS (buf); cie.lsda_encoding = DW_EH_PE_omit; cie.fde_encoding = DW_EH_PE_omit; diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0dec4fe..0cbdf4b 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2004-05-13 Paul Brook + + * readelf.c (display_debug_frames): Handle dwarf3 format CIE + entries. + 2004-05-13 Nick Clifton * po/fr.po: Updated French translation. diff --git a/binutils/readelf.c b/binutils/readelf.c index 1c4e57d..569c7f2 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Originally developed by Eric Youngdale Modifications by Nick Clifton @@ -8968,7 +8968,14 @@ display_debug_frames (Elf_Internal_Shdr *section, { fc->code_factor = LEB (); fc->data_factor = SLEB (); - fc->ra = byte_get (start, 1); start += 1; + if (version == 1) + { + fc->ra = GET (1); + } + else + { + fc->ra = LEB (); + } augmentation_data_len = LEB (); augmentation_data = start; start += augmentation_data_len; @@ -8978,13 +8985,27 @@ display_debug_frames (Elf_Internal_Shdr *section, start += addr_size; fc->code_factor = LEB (); fc->data_factor = SLEB (); - fc->ra = byte_get (start, 1); start += 1; + if (version == 1) + { + fc->ra = GET (1); + } + else + { + fc->ra = LEB (); + } } else { fc->code_factor = LEB (); fc->data_factor = SLEB (); - fc->ra = byte_get (start, 1); start += 1; + if (version == 1) + { + fc->ra = GET (1); + } + else + { + fc->ra = LEB (); + } } cie = fc; diff --git a/gas/ChangeLog b/gas/ChangeLog index 93b930d..eec43a8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2004-05-13 Paul Brook + + * dw2gencfi.c (output_cie): Handle dwarf3 format CIE entries. + 2004-05-13 Joel Sherrill * configure.in (or32-*-rtems*): Switch to elf. diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index ff0aa35..05d7e3d 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -845,7 +845,10 @@ output_cie (struct cie_entry *cie) out_one (0); out_uleb128 (DWARF2_LINE_MIN_INSN_LENGTH); /* Code alignment */ out_sleb128 (DWARF2_CIE_DATA_ALIGNMENT); /* Data alignment */ - out_one (cie->return_column); /* Return column */ + if (DW_CIE_VERSION == 1) /* Return column. */ + out_one (cie->return_column); + else + out_uleb128 (cie->return_column); out_uleb128 (1); /* Augmentation size */ #if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr out_one (DW_EH_PE_pcrel | DW_EH_PE_sdata4); -- 2.7.4