------- Comment #1 from pj dot pandit at yahoo dot co dot in 2010-08-02 18:38 ------- The following patch to gcc-4.4.4 seems to fix the issue for DW_AT_subprogram DIEs.
$ diff -Naurp gcc-4.4.4/gcc/dwarf2out.c gcc-4.4.4.1/gcc/dwarf2out.c --- gcc-4.4.4/gcc/dwarf2out.c 2010-02-10 20:39:06.000000000 +0530 +++ gcc-4.4.4.1/gcc/dwarf2out.c 2010-08-02 15:16:17.495688080 +0530 @@ -13712,7 +13712,7 @@ gen_subprogram_die (tree decl, dw_die_re { subr_die = new_die (DW_TAG_subprogram, context_die, decl); - if (TREE_PUBLIC (decl)) + if (TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) add_AT_flag (subr_die, DW_AT_external, 1); add_name_and_src_coords_attributes (subr_die, decl); @@ -14163,7 +14163,7 @@ gen_variable_die (tree decl, tree origin add_type_attribute (var_die, type, TREE_READONLY (decl), TREE_THIS_VOLATILE (decl), context_die); - if (TREE_PUBLIC (decl)) + if (TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) add_AT_flag (var_die, DW_AT_external, 1); if (DECL_ARTIFICIAL (decl)) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45153