]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix error diagnosis for dwarf_formref on DW_FORM_ref_sig8.
authorRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 05:24:19 +0000 (22:24 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 05:24:19 +0000 (22:24 -0700)
libdw/ChangeLog
libdw/dwarf_formref.c
libdw/dwarf_formref_die.c

index d6ea6c67dd048fdfb7e9f962975f8e1f61c3b77e..edb7cbff8d4bf0b61f0886e27289348a4a1df2a5 100644 (file)
@@ -1,5 +1,10 @@
 2010-06-15  Roland McGrath  <roland@redhat.com>
 
+       * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
+       DW_FORM_ref_addr.
+       * dwarf_formref_die.c (dwarf_formref_die): Diagnose it the same way
+       here, since we don't support it yet.
+
        * dwarf_next_cfi.c: Handle version 4 format.
 
        * dwarf_getsrclines.c: Handle version 4 format.
index b8463b70b16e82b90ce5331babc75c0ad00080c2..e4d35ae8c9352ebc6beb882fba4a17763ae3be04 100644 (file)
@@ -1,5 +1,5 @@
 /* Return reference offset represented by attribute.
-   Copyright (C) 2003, 2005, 2007, 2008 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.
 
@@ -92,6 +92,7 @@ __libdw_formref (attr, return_offset)
       break;
 
     case DW_FORM_ref_addr:
+    case DW_FORM_ref_sig8:
       __libdw_seterrno (DWARF_E_INVALID_REFERENCE);
       return -1;
 
index a004a0fd40263ae35f8f015d74e978c9e6aec7b9..3ab2cb384a0736b1cf35e0154c9bd13623c1fed7 100644 (file)
@@ -1,5 +1,5 @@
 /* Look up the DIE in a reference-form attribute.
-   Copyright (C) 2005, 2007 Red Hat, Inc.
+   Copyright (C) 2005-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -76,6 +76,23 @@ dwarf_formref_die (attr, die_mem)
                               ref_size, &offset, IDX_debug_info, 0))
        return NULL;
     }
+  else if (attr->form == DW_FORM_ref_sig8)
+    {
+      /* This doesn't have an offset, but instead a value we
+        have to match in the .debug_types type unit headers.  */
+
+      uint64_t sig = read_8ubyte_unaligned (attr->cu->dbg, attr->valp);
+
+      /* XXX We don't actually support this yet.  We need to parse
+        .debug_types and keep a table keyed on signature.  */
+#if 0
+      return INTUSE(dwarf_typeunit) (attr->cu->dbg, sig, die_mem);
+#else
+      sig = sig;
+      __libdw_seterrno (DWARF_E_INVALID_REFERENCE);
+#endif
+      return NULL;
+    }
   else
     {
       /* Other forms produce an offset from the CU.  */