OSDN Git Service

Handle dwarf3 format CIE entries.
authornickc <nickc>
Thu, 13 May 2004 14:41:16 +0000 (14:41 +0000)
committernickc <nickc>
Thu, 13 May 2004 14:41:16 +0000 (14:41 +0000)
bfd/ChangeLog
bfd/elf-eh-frame.c
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/dw2gencfi.c

index 7465e46..1c91d5d 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-13  Paul Brook  <paul@codesourcery.com>
+
+       * eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle dwarf3
+       format CIE entries.
+
 2004-05-13  Joel Sherrill <joel@oarcorp.com>
 
        * config.bfd (or32-*-rtems*): Switch to elf.
index d3777b4..7608e77 100644 (file)
@@ -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 <jakub@redhat.com>.
 
    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;
index 0dec4fe..0cbdf4b 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-13  Paul Brook  <paul@codesourcery.com>
+
+       * readelf.c (display_debug_frames): Handle dwarf3 format CIE
+       entries.
+
 2004-05-13  Nick Clifton  <nickc@redhat.com>
 
        * po/fr.po: Updated French translation.
index 1c4e57d..569c7f2 100644 (file)
@@ -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 <eric@andante.jic.com>
    Modifications by Nick Clifton <nickc@redhat.com>
@@ -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;
 
index 93b930d..eec43a8 100644 (file)
@@ -1,3 +1,7 @@
+2004-05-13  Paul Brook  <paul@codesourcery.com>
+
+       * dw2gencfi.c (output_cie):  Handle dwarf3 format CIE entries.
+
 2004-05-13  Joel Sherrill <joel@oarcorp.com>
 
        * configure.in (or32-*-rtems*): Switch to elf.
index ff0aa35..05d7e3d 100644 (file)
@@ -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);