From 0b3363e95173ddee5eed7be767f8ae31efa78d88 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 1 Jun 2010 15:42:14 -0700 Subject: [PATCH] Handle DWARF version 4 CUs. --- NEWS | 2 ++ libdw/ChangeLog | 4 ++++ libdw/libdw_findcu.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 6e70e91..de1740f 100644 --- 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. diff --git a/libdw/ChangeLog b/libdw/ChangeLog index ead4397..156ba80 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2010-06-01 Roland McGrath + + * libdw_findcu.c (__libdw_findcu): Accept version 4. + 2010-05-31 Mark Wielaard * cfi.h (dwarf_cfi_cie_p): Move definition from here, to .. diff --git a/libdw/libdw_findcu.c b/libdw/libdw_findcu.c index afff6d3..cf79c63 100644 --- a/libdw/libdw_findcu.c +++ b/libdw/libdw_findcu.c @@ -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 , 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. */ -- 2.7.4