From: Mark Wielaard Date: Thu, 7 Apr 2011 15:47:25 +0000 (+0200) Subject: dwarflint: check_dups_abstract_origin allow dup object_pointer on subprogram. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=370cf2bafc489b4890d359e29e122cae0eb0837f;p=thirdparty%2Felfutils.git dwarflint: check_dups_abstract_origin allow dup object_pointer on subprogram. --- diff --git a/dwarflint/check_dups_abstract_origin.cc b/dwarflint/check_dups_abstract_origin.cc index 03b1c820e..26d9811bc 100644 --- a/dwarflint/check_dups_abstract_origin.cc +++ b/dwarflint/check_dups_abstract_origin.cc @@ -55,7 +55,7 @@ namespace } bool - duplicate_ok (int tag, int at, int from) + duplicate_ok (int tag, int at, int from, bool same) { // A call site entry has a DW_AT_low_pc attribute which is the return // address after the call and a DW_AT_abstract_origin that is a @@ -64,7 +64,15 @@ namespace // values). if (tag == DW_TAG_GNU_call_site && (at == DW_AT_low_pc || at == DW_AT_abstract_origin) - && from == DW_AT_abstract_origin) + && from == DW_AT_abstract_origin + && ! same) + return true; + + // A subprogram that has been inlined can have a different + // object_pointer than the original variant of the subprogram. + if (tag == DW_TAG_subprogram + && at == DW_AT_object_pointer + && ! same) return true; return false; @@ -89,7 +97,8 @@ namespace at = referree.attributes ().begin (); at != referree.attributes ().end (); ++at) if ((at2 = m.find ((*at).first)) != m.end () - && ! duplicate_ok (die.tag (), at2->first, attr.first)) + && ! duplicate_ok (die.tag (), at2->first, attr.first, + at2->second == (*at).second)) wr_message (to_where (die), mc_impact_3 | mc_acc_bloat | mc_die_rel) << "Attribute " << dwarf::attributes::name (at2->first) << " is duplicated at " << dwarf::attributes::name (attr.first)