This patch is for the google/gcc-4_8 branch. A namespace alias entry can cause a DW_TAG_imported_declaration DIE to be added to the pubnames table, but we don't handle that case when generating the .debug_gnu_pubnames table.
2013-06-28 <ccout...@google.com> * gcc/dwarf2out.c (output_pubname): Fix global/static flag for type DIEs. Handle DW_TAG_imported_declaration. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 200549) +++ gcc/dwarf2out.c (working copy) @@ -9147,6 +9147,7 @@ output_pubname (dw_offset die_offset, pu GDB_INDEX_SYMBOL_STATIC_SET_VALUE(flags, is_static); break; case DW_TAG_namespace: + case DW_TAG_imported_declaration: GDB_INDEX_SYMBOL_KIND_SET_VALUE(flags, GDB_INDEX_SYMBOL_KIND_TYPE); break; case DW_TAG_class_type: @@ -9155,7 +9156,8 @@ output_pubname (dw_offset die_offset, pu case DW_TAG_union_type: case DW_TAG_enumeration_type: GDB_INDEX_SYMBOL_KIND_SET_VALUE(flags, GDB_INDEX_SYMBOL_KIND_TYPE); - GDB_INDEX_SYMBOL_STATIC_SET_VALUE(flags, 1); + if (!is_cxx () && !is_java ()) + GDB_INDEX_SYMBOL_STATIC_SET_VALUE(flags, 1); break; default: gcc_unreachable ();