summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwarflint/dwarf_4.cc5
-rw-r--r--dwarflint/dwarf_gnu.cc22
-rw-r--r--dwarflint/dwarf_version.hh2
3 files changed, 19 insertions, 10 deletions
diff --git a/dwarflint/dwarf_4.cc b/dwarflint/dwarf_4.cc
index 812eef62..3beb9b65 100644
--- a/dwarflint/dwarf_4.cc
+++ b/dwarflint/dwarf_4.cc
@@ -1,5 +1,5 @@
/* Pedantic checking of DWARF files
- Copyright (C) 2010 Red Hat, Inc.
+ Copyright (C) 2010, 2011 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -67,8 +67,7 @@ namespace
add (exprloc_form (DW_FORM_exprloc));
add (flag_form (DW_FORM_flag_present, fw_0));
- // xxx This actually needs to be something like ref8_form. This
- // and DW_AT_GNU_odr_signature.
+ // http://wiki.dwarfstd.org/index.php?title=COMDAT_Type_Sections
add (ref_form (DW_FORM_ref_sig8, fw_8));
// In DWARF 2 we claim that blocks are exprloc forms (see
diff --git a/dwarflint/dwarf_gnu.cc b/dwarflint/dwarf_gnu.cc
index 36c826c2..df3e85b1 100644
--- a/dwarflint/dwarf_gnu.cc
+++ b/dwarflint/dwarf_gnu.cc
@@ -1,5 +1,5 @@
/* Pedantic checking of DWARF files
- Copyright (C) 2010 Red Hat, Inc.
+ Copyright (C) 2010, 2011 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -63,12 +63,10 @@ namespace
add (const_attribute (DW_AT_GNU_shared_locks_required));
// Contains a shallower 8-byte signature of the type described
- // in the type unit. We encode it the same way as
- // DW_AT_signature, which AFAICT is just a standardized name of
- // DW_AT_GNU_odr_signature.
+ // in the type unit. This is nominally a const_attribute, but
+ // we do the checking ourselves in form_allowed.
// http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo
- // http://wiki.dwarfstd.org/index.php?title=COMDAT_Type_Sections
- add (ref_attribute (DW_AT_GNU_odr_signature));
+ add (const_attribute (DW_AT_GNU_odr_signature));
add (string_attribute (DW_AT_GNU_template_name)); // xxx ???
}
@@ -80,6 +78,18 @@ namespace
dwarf_gnu_ext_t ()
: std_dwarf (dwarf_gnu_attributes (), form_table ())
{}
+
+ virtual bool
+ form_allowed (int attribute_name, int form_name) const
+ {
+ if (attribute_name == DW_AT_GNU_odr_signature)
+ {
+ form const *f = get_form (form_name);
+ return f->classes ()[cl_constant] && f->width (NULL) == fw_8;
+ }
+ else
+ return std_dwarf::form_allowed (attribute_name, form_name);
+ }
};
}
diff --git a/dwarflint/dwarf_version.hh b/dwarflint/dwarf_version.hh
index 1d397817..c8a0e6a3 100644
--- a/dwarflint/dwarf_version.hh
+++ b/dwarflint/dwarf_version.hh
@@ -186,7 +186,7 @@ public:
/// Figure out whether, in given DWARF version, given attribute is
/// allowed to have given form.
- bool form_allowed (int attribute_name, int form_name) const;
+ virtual bool form_allowed (int attribute_name, int form_name) const;
/// Answer a class of FORM given ATTRIBUTE as a context. If there's
/// exactly one candidate class, that's the one answered. If