Handle DWARF version 4 CUs.
authorRoland McGrath <roland@redhat.com>
Tue, 1 Jun 2010 22:42:14 +0000 (15:42 -0700)
committerRoland McGrath <roland@redhat.com>
Tue, 1 Jun 2010 22:42:14 +0000 (15:42 -0700)
NEWS
libdw/ChangeLog
libdw/libdw_findcu.c

diff --git a/NEWS b/NEWS
index 6e70e91..de1740f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Version 0.148:
 
+libdw: Accept DWARF 4 format.
+
 libdwfl: Fixes in core-file handling, support cores from PIEs.
         When working from build IDs, don't open a named file that mismatches.
 
index ead4397..156ba80 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-01  Roland McGrath  <roland@redhat.com>
+
+       * libdw_findcu.c (__libdw_findcu): Accept version 4.
+
 2010-05-31  Mark Wielaard  <mjw@redhat.com>
 
        * cfi.h (dwarf_cfi_cie_p): Move definition from here, to ..
index afff6d3..cf79c63 100644 (file)
@@ -1,5 +1,5 @@
 /* Find CU for given offset.
-   Copyright (C) 2003, 2004, 2005, 2007 Red Hat, Inc.
+   Copyright (C) 2003-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2003.
 
@@ -121,8 +121,8 @@ __libdw_findcu (dbg, start)
                           + (2 * offset_size - 4));
       uint16_t version = read_2ubyte_unaligned (dbg, bytes);
 
-      /* We only know how to handle the DWARF version 2 and 3 formats.  */
-      if (unlikely (version != 2) && unlikely (version != 3))
+      /* We only know how to handle the DWARF version 2 through 4 formats.  */
+      if (unlikely (version < 2) || unlikely (version > 4))
        goto invalid;
 
       /* Create an entry for this CU.  */